In bug 1825611 and 1828373 we added more logic to create accessibles when elements have overflow styling. There is an edge case where HTML element will recieve overflow styling, in that case we do not want an accessible as we rely on the scroll offsets of the root viewport. Differential Revision: https://phabricator.services.mozilla.com/D256329
43 lines
1011 B
JavaScript
43 lines
1011 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
"use strict";
|
|
|
|
/* import-globals-from ../../mochitest/role.js */
|
|
loadScripts({ name: "role.js", dir: MOCHITESTS_DIR });
|
|
|
|
/**
|
|
* Verify that we don't mutate the accessible tree when the the root
|
|
* element gets a new overflow style.
|
|
*/
|
|
addAccessibleTask(
|
|
`
|
|
<button>button</button>
|
|
`,
|
|
async function testNoMutateOnRootOverflow(browser, accDoc) {
|
|
const tree = {
|
|
DOCUMENT: [
|
|
{
|
|
// Body element gets a generic container.
|
|
TEXT_CONTAINER: [
|
|
{
|
|
PUSHBUTTON: [{ TEXT_LEAF: [] }],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|
|
testAccessibleTree(accDoc, tree);
|
|
await contentSpawnMutation(
|
|
browser,
|
|
{ unexpected: [[EVENT_REORDER, accDoc]] },
|
|
function () {
|
|
content.document.documentElement.style.overflow = "hidden";
|
|
}
|
|
);
|
|
},
|
|
{
|
|
contentDocBodyAttrs: { style: "overflow: auto;" },
|
|
}
|
|
);
|