Files
sousa-gecko/accessible/tests/browser/tree/browser_root_element.js
T
Eitan Isaacson d3d745fb76 Bug 1974682 - Don't create HTML element accessibles. r=morgan
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
2025-07-11 21:42:17 +00:00

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;" },
}
);