diff --git a/blink/renderer/core/css/popup.css b/blink/renderer/core/css/popup.css index ed0129a0117..eda4ac96c1d 100644 --- a/blink/renderer/core/css/popup.css +++ b/blink/renderer/core/css/popup.css @@ -10,13 +10,10 @@ @namespace "http://www.w3.org/1999/xhtml"; [popup]:-internal-popup-hidden { - display: none; + display: none !important; } -[popup="" i], -[popup=auto i], -[popup=hint i], -[popup=manual i] { +[popup] { position: fixed; inset-inline-start: 0; inset-inline-end: 0; @@ -27,20 +24,14 @@ margin: auto; border: solid; overflow: auto; - padding: 1em; color: CanvasText; background-color: Canvas; } -[popup="" i]::backdrop, -[popup=auto i]::backdrop, -[popup=hint i]::backdrop, -[popup=manual i]::backdrop { - position: fixed; - inset-inline-start: 0; - inset-inline-end: 0; - inset-block-start: 0; - inset-block-end: 0; - background: transparent; - pointer-events: none !important; +[popup]::backdrop { + /* From the fullscreen spec: https://fullscreen.spec.whatwg.org/#user-agent-level-style-sheet-defaults: */ + position: fixed; + top:0; right:0; bottom:0; left:0; + /* Specific to [popup]: */ + pointer-events: none !important; } diff --git a/blink/renderer/core/css/selector_checker.cc b/blink/renderer/core/css/selector_checker.cc index b40284bf422..b113230a524 100644 --- a/blink/renderer/core/css/selector_checker.cc +++ b/blink/renderer/core/css/selector_checker.cc @@ -1504,11 +1504,17 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context, } return false; case CSSSelector::kPseudoPopupHidden: + if (!RuntimeEnabledFeatures::HTMLPopupAttributeEnabled( + element.GetDocument().GetExecutionContext())) { + return false; + } if (element.HasValidPopupAttribute()) { return element.GetPopupData()->visibilityState() == PopupVisibilityState::kHidden; } - return false; + // Invalid values of the `popup` attribute should match the + // :-internal-popup-hidden pseudo selector. + return element.FastHasAttribute(html_names::kPopupAttr); case CSSSelector::kPseudoFullscreen: // fall through case CSSSelector::kPseudoFullScreen: diff --git a/blink/web_tests/external/wpt/html/semantics/popups/popup-appearance-ref.tentative.html b/blink/web_tests/external/wpt/html/semantics/popups/popup-appearance-ref.tentative.html index 95f43dba293..b8ebba794d2 100644 --- a/blink/web_tests/external/wpt/html/semantics/popups/popup-appearance-ref.tentative.html +++ b/blink/web_tests/external/wpt/html/semantics/popups/popup-appearance-ref.tentative.html @@ -12,9 +12,8 @@
There should be four pop-ups with similar appearance, and - the word Unknown with no special styling.
+ the word "Unknown" should not be visible on the page.There should be four pop-ups with similar appearance, and - the word Unknown with no special styling.
+ the word "Unknown" should not be visible on the page.