[webkit-changes] [WebKit/WebKit] 2a9c86: getComputedStyle() should work with functional pse...

Anne van Kesteren noreply at github.com
Fri Feb 16 10:00:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2a9c86135d14c9f140a25f4e60f4bcff5b504e53
      https://github.com/WebKit/WebKit/commit/2a9c86135d14c9f140a25f4e60f4bcff5b504e53
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-008-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-013-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/highlight-pseudo-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-currentcolor-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-currentcolor-computed-inheritance-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-currentcolor-computed-visited-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-pseudos-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-pseudos-inheritance-computed-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-pseudos-visited-computed-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/mix-blend-mode-only-on-transition-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/style-inheritance-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo-with-argument-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo-with-argument.html
    M LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log
    M Source/WebCore/animation/WebAnimationUtilities.cpp
    M Source/WebCore/css/CSSSelector.cpp
    M Source/WebCore/css/CSSSelector.h
    M Source/WebCore/page/LocalDOMWindow.cpp
    M Source/WebCore/style/MatchedDeclarationsCache.cpp

  Log Message:
  -----------
  getComputedStyle() should work with functional pseudo-elements like ::highlight()
https://bugs.webkit.org/show_bug.cgi?id=264103
rdar://117864743

Reviewed by Antti Koivisto.

This adds parsing support for pseudo-elements with an argument to
CSSSelector::parsePseudoElement(). For now only getComputedStyle()
makes use of it and other callers continue to treat pseudo-elements
with an argument as an error.

To avoid hitting an assert introduced by 274629 at main and also problems
found in debugging where a RenderStyle's pseudoElementNameArgument
would get overwritten this makes
MatchedDeclarationsCache::isCacheable() return false when there is such
an argument.

New tests are upstreamed here:
https://github.com/web-platform-tests/wpt/pull/44607

* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-008-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-013-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/highlight-pseudo-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-currentcolor-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-currentcolor-computed-inheritance-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-currentcolor-computed-visited-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-pseudos-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-pseudos-inheritance-computed-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-pseudos-visited-computed-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/mix-blend-mode-only-on-transition-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/style-inheritance-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo-with-argument-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo-with-argument.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log:
* Source/WebCore/animation/WebAnimationUtilities.cpp:
(WebCore::pseudoIdFromString):
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::pseudoElementIdentifierFor):
(WebCore::CSSSelector::parsePseudoElement):
* Source/WebCore/css/CSSSelector.h:
* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::getComputedStyle const):
(WebCore::LocalDOMWindow::getMatchedCSSRules const):
* Source/WebCore/style/MatchedDeclarationsCache.cpp:
(WebCore::Style::MatchedDeclarationsCache::isCacheable):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list