[webkit-changes] [WebKit/WebKit] d4994b: Add CSSSelector::parseStandalonePseudoElement()

Anne van Kesteren noreply at github.com
Tue Dec 26 08:57:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d4994b28b489ed0ca40eb28d5399431964076621
      https://github.com/WebKit/WebKit/commit/d4994b28b489ed0ca40eb28d5399431964076621
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2023-12-26 (Tue, 26 Dec 2023)

  Changed paths:
    M LayoutTests/fast/css/getComputedStyle/computed-style-properties-expected.txt
    M LayoutTests/fast/css/getComputedStyle/computed-style-properties.html
    M LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt
    M LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/target-expected.txt
    M Source/WebCore/animation/DeclarativeAnimationEvent.cpp
    M Source/WebCore/animation/KeyframeEffect.cpp
    M Source/WebCore/animation/WebAnimationUtilities.cpp
    M Source/WebCore/animation/WebAnimationUtilities.h
    M Source/WebCore/css/CSSComputedStyleDeclaration.cpp
    M Source/WebCore/css/CSSSelector.cpp
    M Source/WebCore/css/CSSSelector.h
    M Source/WebCore/page/LocalDOMWindow.cpp

  Log Message:
  -----------
  Add CSSSelector::parseStandalonePseudoElement()
https://bugs.webkit.org/show_bug.cgi?id=266862

Reviewed by Tim Nguyen.

Abstract the logic of non-selector-parser callers of
parsePseudoElement() into a more correct static method.

This means that from now on we require that standalone pseudo-elements
start with "::" (or just ":" for 4 legacy pseudo-elements), which is
aligned with the specification and Firefox.

This also fixes what appears to be a regression in
LocalDOMWindow::getMatchedCSSRules() introduced 272429 at main. It
incorrectly assumes to have a CSSSelector::PseudoElement from
which it can obtain a PseudoId.

This also helps https://bugs.webkit.org/show_bug.cgi?id=243539.

* LayoutTests/fast/css/getComputedStyle/computed-style-properties-expected.txt:
* LayoutTests/fast/css/getComputedStyle/computed-style-properties.html:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/target-expected.txt:
* Source/WebCore/animation/DeclarativeAnimationEvent.cpp:
(WebCore::DeclarativeAnimationEvent::DeclarativeAnimationEvent):
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setPseudoElement):
* Source/WebCore/animation/WebAnimationUtilities.cpp:
(WebCore::pseudoIdFromString):
* Source/WebCore/animation/WebAnimationUtilities.h:
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration):
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::CSSSelector::parsePseudoElement):
(WebCore::CSSSelector::parseStandalonePseudoElement):
* Source/WebCore/css/CSSSelector.h:
* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::getMatchedCSSRules const):

Canonical link: https://commits.webkit.org/272499@main




More information about the webkit-changes mailing list