Title: [290735] trunk
Revision
290735
Author
[email protected]
Date
2022-03-02 10:47:09 -0800 (Wed, 02 Mar 2022)

Log Message

Outline-width with transition don't animate correctly
https://bugs.webkit.org/show_bug.cgi?id=173708

Reviewed by Antti Koivisto.

Source/WebCore:

Account for a change in outline size when checking whether a style change affects
visual overflow.

No new test for this, I'm not sure how to write one since the issue is failing to
repaint during an animation but WKTR seems to force a repaint for reftests.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeAffectsVisualOverflow const):

LayoutTests:

Add a repaint test that checks that the outline is accounted for during the transition.

* fast/repaint/outline-transition-expected.txt: Added.
* fast/repaint/outline-transition.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (290734 => 290735)


--- trunk/LayoutTests/ChangeLog	2022-03-02 17:09:34 UTC (rev 290734)
+++ trunk/LayoutTests/ChangeLog	2022-03-02 18:47:09 UTC (rev 290735)
@@ -1,3 +1,15 @@
+2022-03-02  Antoine Quint  <[email protected]>
+
+        Outline-width with transition don't animate correctly
+        https://bugs.webkit.org/show_bug.cgi?id=173708
+
+        Reviewed by Antti Koivisto.
+
+        Add a repaint test that checks that the outline is accounted for during the transition.
+
+        * fast/repaint/outline-transition-expected.txt: Added.
+        * fast/repaint/outline-transition.html: Added.
+
 2022-03-02  Alan Bujtas  <[email protected]>
 
         [RTL] Image alt text has incorrect bidi reordering

Added: trunk/LayoutTests/fast/repaint/outline-transition-expected.txt (0 => 290735)


--- trunk/LayoutTests/fast/repaint/outline-transition-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/outline-transition-expected.txt	2022-03-02 18:47:09 UTC (rev 290735)
@@ -0,0 +1,10 @@
+Test that using a CSS Transition to animate the 'outline' property causes repaints.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.internals?.repaintRectsAsText().indexOf('(rect 0 0 140 140)') > -1 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/repaint/outline-transition.html (0 => 290735)


--- trunk/LayoutTests/fast/repaint/outline-transition.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/outline-transition.html	2022-03-02 18:47:09 UTC (rev 290735)
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+
+div {
+    position: absolute;
+    left: 20px;
+    top: 20px;
+    width: 100px;
+    height: 100px;
+    outline: 0px solid green;
+}
+
+.animated {
+    transition: outline 100ms;
+    outline: 20px solid green;
+}
+
+</style>
+</head>
+<body>
+<div></div>
+<script src=""
+<script>
+
+jsTestIsAsync = true;
+
+description("Test that using a CSS Transition to animate the 'outline' property causes repaints.");
+
+(async function () {
+    await new Promise(setTimeout);
+    window.internals?.startTrackingRepaints();
+    const target = document.querySelector("div");
+    target.classList.add("animated");
+
+    await new Promise(resolve => target.addEventListener("transitionend", resolve)); 
+
+    shouldBeTrue("window.internals?.repaintRectsAsText().indexOf('(rect 0 0 140 140)') > -1");
+    window.internals.stopTrackingRepaints();
+
+    finishJSTest();
+})();
+
+</script>
+<script src=""
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (290734 => 290735)


--- trunk/Source/WebCore/ChangeLog	2022-03-02 17:09:34 UTC (rev 290734)
+++ trunk/Source/WebCore/ChangeLog	2022-03-02 18:47:09 UTC (rev 290735)
@@ -1,3 +1,19 @@
+2022-03-02  Antoine Quint  <[email protected]>
+
+        Outline-width with transition don't animate correctly
+        https://bugs.webkit.org/show_bug.cgi?id=173708
+
+        Reviewed by Antti Koivisto.
+
+        Account for a change in outline size when checking whether a style change affects
+        visual overflow.
+
+        No new test for this, I'm not sure how to write one since the issue is failing to
+        repaint during an animation but WKTR seems to force a repaint for reftests.
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::changeAffectsVisualOverflow const):
+
 2022-03-02  Alan Bujtas  <[email protected]>
 
         [RTL] Image alt text has incorrect bidi reordering

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (290734 => 290735)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-02 17:09:34 UTC (rev 290734)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-02 18:47:09 UTC (rev 290735)
@@ -640,8 +640,12 @@
         return visualOverflowForDecorations(*this, { }) != visualOverflowForDecorations(other, { });
     }
 
-    if (hasOutlineInVisualOverflow() != other.hasOutlineInVisualOverflow())
+    auto hasOutlineInVisualOverflow = this->hasOutlineInVisualOverflow();
+    auto otherHasOutlineInVisualOverflow = other.hasOutlineInVisualOverflow();
+    if (hasOutlineInVisualOverflow != otherHasOutlineInVisualOverflow
+        || (hasOutlineInVisualOverflow && otherHasOutlineInVisualOverflow && outlineSize() != other.outlineSize()))
         return true;
+
     return false;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to