style: Make the document blocked by the topmost element in the top layer.

Spec: https://html.spec.whatwg.org/multipage/#blocked-by-a-modal-dialog

Depends on D86392

Differential Revision: https://phabricator.services.mozilla.com/D86227
This commit is contained in:
Sean Feng 2020-08-17 15:41:19 +00:00 committed by Emilio Cobos Álvarez
parent 5d5d4f4429
commit cf496e4727
4 changed files with 7 additions and 0 deletions

View file

@ -148,6 +148,8 @@ bitflags! {
/// https://html.spec.whatwg.org/multipage/interaction.html#inert-subtrees
const IN_MOZINERT_STATE = 1 << 54;
/// State for the topmost dialog element in top layer
const IN_TOPMOST_MODAL_DIALOG_STATE = 1 << 55;
}
}

View file

@ -53,6 +53,7 @@ macro_rules! apply_non_ts_list {
("-moz-styleeditor-transitioning", MozStyleeditorTransitioning, IN_STYLEEDITOR_TRANSITIONING_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("fullscreen", Fullscreen, IN_FULLSCREEN_STATE, _),
("-moz-modal-dialog", MozModalDialog, IN_MODAL_DIALOG_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-topmost-modal-dialog", MozTopmostModalDialog, IN_TOPMOST_MODAL_DIALOG_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
// TODO(emilio): This is inconsistently named (the capital R).
("-moz-focusring", MozFocusRing, IN_FOCUSRING_STATE, _),
("-moz-broken", MozBroken, IN_BROKEN_STATE, _),

View file

@ -2063,6 +2063,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
NonTSPseudoClass::MozDirAttrLikeAuto |
NonTSPseudoClass::MozAutofill |
NonTSPseudoClass::MozModalDialog |
NonTSPseudoClass::MozTopmostModalDialog |
NonTSPseudoClass::Active |
NonTSPseudoClass::Hover |
NonTSPseudoClass::MozAutofillPreview => {

View file

@ -163,6 +163,9 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
/// pointer-events: none;
/// cursor: default;
///
/// NOTE: dialog:-moz-topmost-modal-dialog is used to override above
/// rules to remove the inertness for the topmost modal dialog.
///
/// NOTE: If this or the pointer-events tweak is removed, then
/// minimal-xul.css and the scrollbar style caching need to be tweaked.
fn adjust_for_inert(&mut self) {