[webkit-changes] [WebKit/WebKit] b206da: [popover] Implement CSS :open / :closed pseudo-cla...
Tim Nguyen
noreply at github.com
Tue Feb 14 11:42:17 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b206da85c2b322b551222ef81122c016972f6a1a
https://github.com/WebKit/WebKit/commit/b206da85c2b322b551222ef81122c016972f6a1a
Author: Tim Nguyen <ntim at apple.com>
Date: 2023-02-14 (Tue, 14 Feb 2023)
Changed paths:
M LayoutTests/TestExpectations
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/light-dismiss-event-ordering.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-idl-property.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-nesting.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-animated-hide-cleanup.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-animation-corner-cases.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-attribute-basic.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-attribute-basic.tentative.html
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-document-open.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-events.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-child-dialog-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-invoking-attribute.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss-on-scroll.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-removal-2.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-removal.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-shadow-dom.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-stacking.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-target-element-disabled.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-top-layer-combinations.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-types.tentative-expected.txt
M LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2.tentative-expected.txt
M LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss.tentative-expected.txt
A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable.tentative-expected.txt
M LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/light-dismiss-event-ordering.tentative-expected.txt
A LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-nesting.tentative-expected.txt
M LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2.tentative-expected.txt
A LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable.tentative-expected.txt
M Source/WebCore/css/CSSSelector.cpp
M Source/WebCore/css/CSSSelector.h
M Source/WebCore/css/SelectorChecker.cpp
M Source/WebCore/css/SelectorCheckerTestFunctions.h
M Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in
M Source/WebCore/cssjit/SelectorCompiler.cpp
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/Element.h
M Source/WebCore/dom/PopoverData.h
M Source/WebCore/html/HTMLElement.cpp
M Source/WebCore/html/HTMLElement.h
Log Message:
-----------
[popover] Implement CSS :open / :closed pseudo-classes
https://bugs.webkit.org/show_bug.cgi?id=252102
rdar://105435152
Reviewed by Antti Koivisto.
https://html.spec.whatwg.org/#selector-open
> The :open pseudo-class is defined to match any HTML element whose popover attribute is not in the no popover state and whose popover visibility state is showing.
> The :closed pseudo-class is defined to match any HTML element whose popover attribute is not in the no popover state and whose popover visibility state is hidden.
Other changes necessary for this change:
- Refactor popoverData lifetime to be consistent with popover attribute (gets initialized when attribute is set, gets cleared when attribute is removed).
- Store popover state (auto, manual, none) on popover data.
- Hide popovers when popover state changes from auto to manual or vice-versa
Also fix a test to expect InvalidStateError rather than NotSupportedError like the spec says.
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/light-dismiss-event-ordering.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-idl-property.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-nesting.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-animated-hide-cleanup.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-animation-corner-cases.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-attribute-basic.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-attribute-basic.tentative.html:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-document-open.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-events.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-child-dialog-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-invoking-attribute.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss-on-scroll.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-removal-2.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-removal.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-shadow-dom.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-stacking.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-target-element-disabled.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-top-layer-combinations.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-types.tentative-expected.txt:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2.tentative-expected.txt:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss.tentative-expected.txt:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable.tentative-expected.txt: Added.
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/light-dismiss-event-ordering.tentative-expected.txt:
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-nesting.tentative-expected.txt: Added.
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2.tentative-expected.txt:
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable.tentative-expected.txt: Added.
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* Source/WebCore/css/CSSSelector.h:
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesOpenPseudoClass):
(WebCore::matchesClosedPseudoClass):
* Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in:
* Source/WebCore/cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::JSC_DEFINE_JIT_OPERATION):
(WebCore::SelectorCompiler::addPseudoClassType):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::popoverData const):
(WebCore::Element::ensurePopoverData):
(WebCore::Element::clearPopoverData):
(WebCore::Element::popoverData): Deleted.
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/PopoverData.h:
(WebCore::PopoverData::popoverState):
(WebCore::PopoverData::setPopoverState):
(WebCore::PopoverData::setVisibilityState):
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute):
(WebCore::checkPopoverValidity):
(WebCore::HTMLElement::showPopover):
(WebCore::HTMLElement::hidePopover):
(WebCore::HTMLElement::togglePopover):
(WebCore::HTMLElement::popoverAttributeChanged):
(WebCore::HTMLElement::popover const):
(WebCore::HTMLElement::popoverState const):
* Source/WebCore/html/HTMLElement.h:
Canonical link: https://commits.webkit.org/260267@main
More information about the webkit-changes
mailing list