Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getComputedStyle() for pseudo-elements with argument #44607

Merged
merged 4 commits into from
Feb 16, 2024

Conversation

annevk
Copy link
Member

@annevk annevk commented Feb 15, 2024

No description provided.

@annevk annevk enabled auto-merge (squash) February 16, 2024 15:32
@annevk annevk disabled auto-merge February 16, 2024 17:00
@annevk annevk requested a review from noamr February 16, 2024 17:19
@annevk annevk enabled auto-merge (squash) February 16, 2024 17:19
webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request Feb 16, 2024
…: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@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:
web-platform-tests/wpt#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
@annevk annevk merged commit 97001c3 into master Feb 16, 2024
16 checks passed
@annevk annevk deleted the annevk/pe-with-argument branch February 16, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants