Title: [225379] trunk
Revision
225379
Author
za...@apple.com
Date
2017-11-30 18:54:29 -0800 (Thu, 30 Nov 2017)

Log Message

Source/WebCore:
[Simple line layout] Incorrect repaint rect with vertically shrinking content and bottom-padding.
https://bugs.webkit.org/show_bug.cgi?id=180223
<rdar://problem/34122210>

Reviewed by Simon Fraser.

Repaint rect should be extended all the way to bottom border/padding.

Test: fast/repaint/simple-line-layout-shrinking-content.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutSimpleLines):

LayoutTests:
[Simple line layout] Incorrect repaint rect with vertically shrinking content.
https://bugs.webkit.org/show_bug.cgi?id=180223
<rdar://problem/34122210>

Reviewed by Simon Fraser.

* fast/repaint/simple-line-layout-shrinking-content-expected.txt: Added.
* fast/repaint/simple-line-layout-shrinking-content.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (225378 => 225379)


--- trunk/LayoutTests/ChangeLog	2017-12-01 02:41:10 UTC (rev 225378)
+++ trunk/LayoutTests/ChangeLog	2017-12-01 02:54:29 UTC (rev 225379)
@@ -1,3 +1,14 @@
+2017-11-30  Zalan Bujtas  <za...@apple.com>
+
+        [Simple line layout] Incorrect repaint rect with vertically shrinking content.
+        https://bugs.webkit.org/show_bug.cgi?id=180223
+        <rdar://problem/34122210>
+
+        Reviewed by Simon Fraser.
+
+        * fast/repaint/simple-line-layout-shrinking-content-expected.txt: Added.
+        * fast/repaint/simple-line-layout-shrinking-content.html: Added.
+
 2017-11-30  Simon Fraser  <simon.fra...@apple.com>
 
         Improve filter logging

Added: trunk/LayoutTests/fast/repaint/simple-line-layout-shrinking-content-expected.txt (0 => 225379)


--- trunk/LayoutTests/fast/repaint/simple-line-layout-shrinking-content-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/simple-line-layout-shrinking-content-expected.txt	2017-12-01 02:54:29 UTC (rev 225379)
@@ -0,0 +1,9 @@
+foo
+(repaint rects
+  (rect 8 40 784 20)
+  (rect 8 39 784 1)
+  (rect 8 9 784 31)
+  (rect 8 40 784 20)
+  (rect 0 48 800 20)
+)
+

Added: trunk/LayoutTests/fast/repaint/simple-line-layout-shrinking-content.html (0 => 225379)


--- trunk/LayoutTests/fast/repaint/simple-line-layout-shrinking-content.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/simple-line-layout-shrinking-content.html	2017-12-01 02:54:29 UTC (rev 225379)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+    white-space: pre-line;
+    padding-bottom: 10px;
+    font-size: 20px;
+    font-family: ahem;
+    border: 1px solid blue;
+}
+</style>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+</script>
+</head>
+<body>
+<div id="text">foo
+bar</div>
+<script>
+document.body.offsetWidth;
+setTimeout(function() {
+    if (window.internals)
+        internals.startTrackingRepaints();
+    document.getElementById('text').innerHTML = "foo";
+    if (window.internals) {
+        let repaintRects = internals.repaintRectsAsText();
+        internals.stopTrackingRepaints();
+
+        let pre = document.createElement('pre');
+        document.body.appendChild(pre);
+        pre.innerHTML = repaintRects;
+        testRunner.notifyDone();
+    }
+}, 10);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (225378 => 225379)


--- trunk/Source/WebCore/ChangeLog	2017-12-01 02:41:10 UTC (rev 225378)
+++ trunk/Source/WebCore/ChangeLog	2017-12-01 02:54:29 UTC (rev 225379)
@@ -1,3 +1,18 @@
+2017-11-30  Zalan Bujtas  <za...@apple.com>
+
+        [Simple line layout] Incorrect repaint rect with vertically shrinking content and bottom-padding.
+        https://bugs.webkit.org/show_bug.cgi?id=180223
+        <rdar://problem/34122210>
+
+        Reviewed by Simon Fraser.
+
+        Repaint rect should be extended all the way to bottom border/padding.
+
+        Test: fast/repaint/simple-line-layout-shrinking-content.html
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::layoutSimpleLines):
+
 2017-11-30  Stephan Szabo  <stephan.sz...@sony.com>
 
         Make LegacyCustomProtocolManager optional for network process

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (225378 => 225379)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-12-01 02:41:10 UTC (rev 225378)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-12-01 02:54:29 UTC (rev 225379)
@@ -3594,7 +3594,7 @@
     LayoutUnit lineLayoutHeight = SimpleLineLayout::computeFlowHeight(*this, *m_simpleLineLayout);
     LayoutUnit lineLayoutTop = borderAndPaddingBefore();
     repaintLogicalTop = lineLayoutTop;
-    repaintLogicalBottom = needsLayout ? repaintLogicalTop + lineLayoutHeight : repaintLogicalTop;
+    repaintLogicalBottom = needsLayout ? repaintLogicalTop + lineLayoutHeight + borderAndPaddingAfter() : repaintLogicalTop;
     setLogicalHeight(lineLayoutTop + lineLayoutHeight + borderAndPaddingAfter());
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to