[webkit-changes] [WebKit/WebKit] 61f529: [view-transitions] Occasional fade while animating...

mattwoodrow noreply at github.com
Wed Apr 17 14:33:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 61f529e65a3fce776e8c04a65ffda08901656751
      https://github.com/WebKit/WebKit/commit/61f529e65a3fce776e8c04a65ffda08901656751
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2024-04-17 (Wed, 17 Apr 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/dom/ViewTransition.cpp
    M Source/WebCore/dom/ViewTransition.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/RenderObject.cpp
    M Source/WebCore/rendering/RenderObject.h
    M Source/WebCore/rendering/RenderViewTransitionCapture.cpp
    M Source/WebCore/rendering/RenderViewTransitionCapture.h
    M Source/WebCore/rendering/updating/RenderTreeUpdaterViewTransition.cpp

  Log Message:
  -----------
  [view-transitions] Occasional fade while animating on https://codepen.io/argyleink/pen/dyLNgpX.
https://bugs.webkit.org/show_bug.cgi?id=272184
<rdar://125931538>

Reviewed by Tim Nguyen.

Captured view-transition snapshots need to be rescaled when the intrinsic size of the image is
different to the layout size of the pseduo element.

The captured image covers the overflow rect of the original element, but the border-box subset
defines the intrinsic size.
This computes the scale factors required to scale the intrinsic size of the up the replaced
content size of the pseudo renderer. It then scales the overflow rect (in coordinates of
the original element) into coordinates for the pseudo renderer.

Painting of the pseudo element (both new and old variants) are updated to factor this
scale in to the draw commands or layer attributes.

Doing this sizing during painting correctly exposed bugs where the computed layout of
the pseduo renderer was incorrect.

ViewTransition:::copyElementBaseProperties is changed to use the 'frameRect' of the view
(instead of the 'contentsWidth') when computing the size of the root element, so that
space taken up by scrollbars isn't removed.

RenderObject's calculation of the 'IsAnonymous' flag is changed so that the view-transition
pseudo elements are not considered anonymous and then correctly can be containing blocks
for their descendants.

* LayoutTests/TestExpectations:
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::captureOldState):
(WebCore::ViewTransition::copyElementBaseProperties):
(WebCore::ViewTransition::updatePseudoElementStyles):
* Source/WebCore/dom/ViewTransition.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateTransform):
(WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::shouldBeAnonymous):
(WebCore::RenderObject::RenderObject):
* Source/WebCore/rendering/RenderObject.h:
(WebCore::RenderObject::isRenderViewTransitionContainer const):
(WebCore::RenderObject::hasIntrinsicAspectRatio const):
(WebCore::RenderObject::node const):
* Source/WebCore/rendering/RenderViewTransitionCapture.cpp:
(WebCore::RenderViewTransitionCapture::paintReplaced):
(WebCore::RenderViewTransitionCapture::layout):
* Source/WebCore/rendering/RenderViewTransitionCapture.h:
(WebCore::RenderViewTransitionCapture::scale const):
* Source/WebCore/rendering/updating/RenderTreeUpdaterViewTransition.cpp:
(WebCore::RenderTreeUpdater::ViewTransition::updatePseudoElementTree):
(WebCore::createRendererIfNeeded):

Canonical link: https://commits.webkit.org/277636@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