forked from mirrors/gecko-dev
Bug 1851541 - Remove html5.inert.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187422
This commit is contained in:
parent
0ef3abf1ef
commit
4ae14d1518
7 changed files with 44 additions and 59 deletions
|
|
@ -16,55 +16,49 @@
|
|||
|
||||
<script>
|
||||
async function doTest() {
|
||||
if (SpecialPowers.getBoolPref("html5.inert.enabled")) {
|
||||
const inertContainer = getAccessible("inertContainer");
|
||||
const inertTree = { SECTION: [ // inertContainer
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // before
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // after
|
||||
]};
|
||||
testAccessibleTree(inertContainer, inertTree);
|
||||
const inertContainer = getAccessible("inertContainer");
|
||||
const inertTree = { SECTION: [ // inertContainer
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // before
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // after
|
||||
]};
|
||||
testAccessibleTree(inertContainer, inertTree);
|
||||
|
||||
info("Unsetting inert");
|
||||
let reordered = waitForEvent(EVENT_REORDER, inertContainer);
|
||||
const inertNode = getNode("inert");
|
||||
inertNode.inert = false;
|
||||
await reordered;
|
||||
testAccessibleTree(inertContainer, { SECTION: [ // inertContainer
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // before
|
||||
{ SECTION: [ // inert
|
||||
{ TEXT_LEAF: [] },
|
||||
{ PUSHBUTTON: [] },
|
||||
] },
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // after
|
||||
]});
|
||||
|
||||
info("Setting inert");
|
||||
reordered = waitForEvent(EVENT_REORDER, inertContainer);
|
||||
inertNode.inert = true;
|
||||
await reordered;
|
||||
testAccessibleTree(inertContainer, inertTree);
|
||||
} else {
|
||||
// It's too late to flip the pref now. We'd need to load a new document
|
||||
// to pick up the change.
|
||||
todo(false, "Inert not enabled, skipping inert tests");
|
||||
}
|
||||
|
||||
const noDialogTree = { SECTION: [ // dialogContainer
|
||||
{ TEXT_LEAF: [] }
|
||||
] };
|
||||
testAccessibleTree("dialogContainer", noDialogTree);
|
||||
|
||||
info("Showing modal dialog");
|
||||
let reordered = waitForEvent(EVENT_REORDER, document);
|
||||
const dialogNode = getNode("dialog");
|
||||
dialogNode.showModal();
|
||||
info("Unsetting inert");
|
||||
let reordered = waitForEvent(EVENT_REORDER, inertContainer);
|
||||
const inertNode = getNode("inert");
|
||||
inertNode.inert = false;
|
||||
await reordered;
|
||||
// The dialog makes everything else in the document inert.
|
||||
testAccessibleTree(document, { DOCUMENT: [
|
||||
{ DIALOG: [
|
||||
{ PUSHBUTTON: [] }
|
||||
] }
|
||||
] });
|
||||
testAccessibleTree(inertContainer, { SECTION: [ // inertContainer
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // before
|
||||
{ SECTION: [ // inert
|
||||
{ TEXT_LEAF: [] },
|
||||
{ PUSHBUTTON: [] },
|
||||
] },
|
||||
{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, // after
|
||||
]});
|
||||
|
||||
info("Setting inert");
|
||||
reordered = waitForEvent(EVENT_REORDER, inertContainer);
|
||||
inertNode.inert = true;
|
||||
await reordered;
|
||||
testAccessibleTree(inertContainer, inertTree);
|
||||
|
||||
const noDialogTree = { SECTION: [ // dialogContainer
|
||||
{ TEXT_LEAF: [] }
|
||||
] };
|
||||
testAccessibleTree("dialogContainer", noDialogTree);
|
||||
|
||||
info("Showing modal dialog");
|
||||
reordered = waitForEvent(EVENT_REORDER, document);
|
||||
const dialogNode = getNode("dialog");
|
||||
dialogNode.showModal();
|
||||
await reordered;
|
||||
// The dialog makes everything else in the document inert.
|
||||
testAccessibleTree(document, { DOCUMENT: [
|
||||
{ DIALOG: [
|
||||
{ PUSHBUTTON: [] }
|
||||
] }
|
||||
] });
|
||||
|
||||
info("Closing dialog");
|
||||
reordered = waitForEvent(EVENT_REORDER, document);
|
||||
|
|
|
|||
|
|
@ -773,8 +773,7 @@ void nsGenericHTMLElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
|||
SetFlags(NODE_HAS_ACCESSKEY);
|
||||
RegUnRegAccessKey(true);
|
||||
}
|
||||
} else if (aName == nsGkAtoms::inert &&
|
||||
StaticPrefs::html5_inert_enabled()) {
|
||||
} else if (aName == nsGkAtoms::inert) {
|
||||
if (aValue) {
|
||||
AddStates(ElementState::INERT);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ interface HTMLElement : Element {
|
|||
// user interaction
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute boolean hidden;
|
||||
[CEReactions, SetterThrows, Pure, Pref="html5.inert.enabled"]
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute boolean inert;
|
||||
[NeedsCallerType]
|
||||
undefined click();
|
||||
|
|
|
|||
|
|
@ -6776,12 +6776,6 @@
|
|||
# Prefs starting with "html5."
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# Turn HTML:inert on or off.
|
||||
- name: html5.inert.enabled
|
||||
type: bool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Time in milliseconds between the time a network buffer is seen and the timer
|
||||
# firing when the timer hasn't fired previously in this parse in the
|
||||
# off-the-main-thread HTML5 parser.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true, dom.forms.inputmode:true, dom.forms.autocapitalize:true, html5.inert.enabled:true, dom.picture_source_dimension_attributes.enabled:true]
|
||||
prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true, dom.forms.inputmode:true, dom.forms.autocapitalize:true, dom.picture_source_dimension_attributes.enabled:true]
|
||||
[idlharness.https.html?exclude=(Document|Window|HTML.*)]
|
||||
[AudioTrack interface: existence and properties of interface prototype object]
|
||||
expected: FAIL
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
prefs: [html5.inert.enabled:true]
|
||||
|
|
@ -1 +0,0 @@
|
|||
prefs: [html5.inert.enabled:true, dom.focus.fixup:true]
|
||||
Loading…
Reference in a new issue