[webkit-changes] [WebKit/WebKit] 810e27: [view-transitions] Implement "update pseudo-elemen...

mattwoodrow noreply at github.com
Fri Feb 16 05:01:26 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 810e27d205f59629bff16d325ae44e5c4d2ea5e4
      https://github.com/WebKit/WebKit/commit/810e27d205f59629bff16d325ae44e5c4d2ea5e4
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/ViewTransition.cpp
    M Source/WebCore/dom/ViewTransition.h
    M Source/WebCore/rendering/RenderObject.h
    A Source/WebCore/rendering/RenderViewTransitionCapture.cpp
    A Source/WebCore/rendering/RenderViewTransitionCapture.h
    M Source/WebCore/rendering/updating/RenderTreeUpdaterViewTransition.cpp
    M Source/WebCore/style/ElementRuleCollector.cpp
    M Source/WebCore/style/ElementRuleCollector.h
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleResolver.h
    M Source/WebCore/style/StyleScope.cpp
    M Source/WebCore/style/StyleScope.h
    M Source/WebCore/style/StyleScopeRuleSets.cpp
    M Source/WebCore/style/StyleScopeRuleSets.h
    M Source/WebCore/style/Styleable.cpp

  Log Message:
  -----------
  [view-transitions] Implement "update pseudo-element styles" algorithm.
https://bugs.webkit.org/show_bug.cgi?id=265224
rdar://118703293>

Reviewed by Tim Nguyen.

Implements the basic outline of capturing the computed style from both
the old and new elements, and using these to generate a style rule
for the selector ':root::view-transition-group(transitionName)'.

Adds a mostly empty RenderViewTransitionOld class that we will use
for the replaced snapshot content, but just acts as a placeholder
for the intrinsic size right now.

With these changes, the size of the transitioned element now gets
applied correctly to the :view-transition-new/old renderers, and
styles targetting them (like background color) correctly get
applied and rendered.

The next step is to implement the 'capture the image' algorithm
for new and old (likely splitting RenderViewTransformNew as a separate
class), so that we also include the replaced content.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::captureOldState):
(WebCore::ViewTransition::handleTransitionFrame):
(WebCore::ViewTransition::copyElementBaseProperties):
(WebCore::ViewTransition::updatePseudoElementStyles):
* Source/WebCore/dom/ViewTransition.h:
(WebCore::OrderedNamedElementsMap::map const):
(WebCore::OrderedNamedElementsMap::find const):
* Source/WebCore/rendering/RenderObject.h:
(WebCore::RenderObject::isRenderViewTransitionOld const):
* Source/WebCore/rendering/RenderViewTransitionOld.cpp: Added.
(WebCore::RenderViewTransitionOld::RenderViewTransitionOld):
(WebCore::RenderViewTransitionOld::setImage):
* Source/WebCore/rendering/RenderViewTransitionOld.h: Added.
* Source/WebCore/rendering/updating/RenderTreeUpdaterViewTransition.cpp:
(WebCore::RenderTreeUpdater::ViewTransition::buildPseudoElementGroup):
(WebCore::RenderTreeUpdater::ViewTransition::updatePseudoElementGroup):
* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::ElementRuleCollector):
(WebCore::Style::ElementRuleCollector::matchUARules):
* Source/WebCore/style/ElementRuleCollector.h:
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::applyMatchedProperties):
(WebCore::Style::Resolver::setViewTransitionGroupStyles):
* Source/WebCore/style/StyleResolver.h:
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::createDocumentResolver):
* Source/WebCore/style/StyleScope.h:
* Source/WebCore/style/StyleScopeRuleSets.cpp:
(WebCore::Style::ScopeRuleSets::dynamicViewTransitionsStyle const):
* Source/WebCore/style/StyleScopeRuleSets.h:
(WebCore::Style::ScopeRuleSets::setDynamicViewTransitionsStyle):

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




More information about the webkit-changes mailing list