[webkit-changes] [WebKit/WebKit] 4c22f9: CSS animations on pseudo elements should participa...

Antti Koivisto noreply at github.com
Sat Jan 7 14:33:53 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4c22f9946fddcb1ec86eea7b5b529663950d01fa
      https://github.com/WebKit/WebKit/commit/4c22f9946fddcb1ec86eea7b5b529663950d01fa
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-01-07 (Sat, 07 Jan 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animation-important-001-expected.txt
    M Source/WebCore/css/MediaQueryMatcher.cpp
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/html/HTMLTitleElement.cpp
    M Source/WebCore/html/shadow/DateTimeFieldElement.cpp
    M Source/WebCore/html/shadow/DateTimeFieldElement.h
    M Source/WebCore/html/shadow/SliderThumbElement.cpp
    M Source/WebCore/html/shadow/SliderThumbElement.h
    M Source/WebCore/html/shadow/TextControlInnerElements.cpp
    M Source/WebCore/html/shadow/TextControlInnerElements.h
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleResolver.h
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h
    M Source/WebCore/svg/SVGElement.cpp
    M Source/WebCore/svg/SVGElement.h
    M Source/WebCore/svg/SVGElementRareData.h
    M Source/WebCore/testing/Internals.cpp

  Log Message:
  -----------
  CSS animations on pseudo elements should participate in the cascade
https://bugs.webkit.org/show_bug.cgi?id=250262
<rdar://problem/103983707>

Reviewed by Alan Baradlay.

Followup to https://bugs.webkit.org/show_bug.cgi?id=210963 to cover pseudo elements.

This is just a matter of passing MatchResult through from Style::Resolver::styleForPseudoElement
so we can construct the cascade after applying animation.

Also some related style resolution cleanup.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animation-important-001-expected.txt:
* Source/WebCore/css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle const):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::resolveStyle):
(WebCore::Element::resolveCustomStyle):
* Source/WebCore/dom/Element.h:
* Source/WebCore/html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::computedTextWithDirection):
* Source/WebCore/html/shadow/DateTimeFieldElement.cpp:
(WebCore::DateTimeFieldElement::resolveCustomStyle):
* Source/WebCore/html/shadow/DateTimeFieldElement.h:
* Source/WebCore/html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::resolveCustomStyle):
* Source/WebCore/html/shadow/SliderThumbElement.h:
* Source/WebCore/html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerContainer::resolveCustomStyle):
(WebCore::TextControlInnerElement::resolveCustomStyle):
(WebCore::TextControlInnerTextElement::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::resolveCustomStyle):
(WebCore::SearchFieldResultsButtonElement::resolveCustomStyle):
(WebCore::SearchFieldCancelButtonElement::resolveCustomStyle):
* Source/WebCore/html/shadow/TextControlInnerElements.h:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::getUncachedPseudoStyle const):
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::Resolver):
(WebCore::Style::Resolver::styleForElement):
(WebCore::Style::Resolver::styleForPseudoElement):

Return ResolvedStyle struct (that includes MatchResult) instead of a plain style.
Rename for clarity.

(WebCore::Style::Resolver::pseudoStyleForElement): Deleted.
* Source/WebCore/style/StyleResolver.h:

Rename ElementStyle -> ResolvedStyle.

* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForStyleable):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::resolvePseudoElement):
(WebCore::Style::TreeResolver::resolveAncestorPseudoElement):
(WebCore::Style::TreeResolver::resolveAncestorFirstLinePseudoElement):
(WebCore::Style::TreeResolver::resolveAncestorFirstLetterPseudoElement):

Pass ElementStyle.

(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

Refactor to use lambdas.

* Source/WebCore/style/StyleTreeResolver.h:
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::resolveCustomStyle):
* Source/WebCore/svg/SVGElement.h:
* Source/WebCore/svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::overrideComputedStyle):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::highlightPseudoElementColor):

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




More information about the webkit-changes mailing list