⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278610 in webkit


Ignore:
Timestamp:
Jun 8, 2021, 9:27:50 AM (5 years ago)
Author:
graouts@webkit.org
Message:

REGRESSION (r256095): Adding a border-radius, border, or box-shadow breaks animations from scale(0)
https://bugs.webkit.org/show_bug.cgi?id=218371
<rdar://problem/70906316>

Reviewed by Simon Fraser.

Source/WebCore:

When computing an animation's transform extent, we must account for implicit keyframes.

Test: webanimations/accelerated-transform-animation-to-scale-zero-with-implicit-from-keyframe.html

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):

LayoutTests:

Add a test where we have an animation on an element with a a border and a transform animation to scale(0) where the
first keyframe is implicit. This test would fail prior to this patch.

  • webanimations/accelerated-transform-animation-to-scale-zero-with-implicit-from-keyframe-expected.html: Added.
  • webanimations/accelerated-transform-animation-to-scale-zero-with-implicit-from-keyframe.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278609 r278610  
     12021-06-08  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION (r256095): Adding a border-radius, border, or box-shadow breaks animations from scale(0)
     4        https://bugs.webkit.org/show_bug.cgi?id=218371
     5        <rdar://problem/70906316>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add a test where we have an animation on an element with a a border and a transform animation to scale(0) where the
     10        first keyframe is implicit. This test would fail prior to this patch.
     11
     12        * webanimations/accelerated-transform-animation-to-scale-zero-with-implicit-from-keyframe-expected.html: Added.
     13        * webanimations/accelerated-transform-animation-to-scale-zero-with-implicit-from-keyframe.html: Added.
     14
    1152021-06-08  Youenn Fablet  <youenn@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r278609 r278610  
     12021-06-08  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION (r256095): Adding a border-radius, border, or box-shadow breaks animations from scale(0)
     4        https://bugs.webkit.org/show_bug.cgi?id=218371
     5        <rdar://problem/70906316>
     6
     7        Reviewed by Simon Fraser.
     8
     9        When computing an animation's transform extent, we must account for implicit keyframes.
     10
     11        Test: webanimations/accelerated-transform-animation-to-scale-zero-with-implicit-from-keyframe.html
     12
     13        * animation/KeyframeEffect.cpp:
     14        (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
     15
    1162021-06-08  Youenn Fablet  <youenn@apple.com> and Victor M. Jaquez L. <vjaquez@igalia.com>
    217
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r278540 r278610  
    18961896    LayoutRect cumulativeBounds;
    18971897
     1898    auto addStyleToCumulativeBounds = [&](const RenderStyle* style) -> bool {
     1899        auto keyframeBounds = bounds;
     1900
     1901        bool canCompute;
     1902        if (transformFunctionListsMatch())
     1903            canCompute = computeTransformedExtentViaTransformList(rendererBox, *style, keyframeBounds);
     1904        else
     1905            canCompute = computeTransformedExtentViaMatrix(rendererBox, *style, keyframeBounds);
     1906
     1907        if (!canCompute)
     1908            return false;
     1909
     1910        cumulativeBounds.unite(keyframeBounds);
     1911        return true;
     1912    };
     1913
    18981914    for (const auto& keyframe : m_blendingKeyframes.keyframes()) {
    18991915        const auto* keyframeStyle = keyframe.style();
     
    19081924        }
    19091925
    1910         auto keyframeBounds = bounds;
    1911 
    1912         bool canCompute;
    1913         if (transformFunctionListsMatch())
    1914             canCompute = computeTransformedExtentViaTransformList(rendererBox, *keyframeStyle, keyframeBounds);
    1915         else
    1916             canCompute = computeTransformedExtentViaMatrix(rendererBox, *keyframeStyle, keyframeBounds);
    1917 
    1918         if (!canCompute)
     1926        if (!addStyleToCumulativeBounds(keyframeStyle))
    19191927            return false;
    1920 
    1921         cumulativeBounds.unite(keyframeBounds);
     1928    }
     1929
     1930    if (m_blendingKeyframes.hasImplicitKeyframes()) {
     1931        if (!addStyleToCumulativeBounds(&box.style()))
     1932            return false;
    19221933    }
    19231934
Note: See TracChangeset for help on using the changeset viewer.