Title: [169120] trunk
Revision
169120
Author
[email protected]
Date
2014-05-20 10:38:04 -0700 (Tue, 20 May 2014)

Log Message

REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
https://bugs.webkit.org/show_bug.cgi?id=133111

Reviewed by David Hyatt.

Source/WebCore:
When computing the repaint rect of an element flowed into a flow thread, if the element is flowed directly into
the flow thread (meaning its containing block is the flow thread itself), the region's position within the flow
must no longer be taken into consideration, because its already included in the element's |topLeft|.

Test: fast/regions/hover-element-flowed-second-region.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):

LayoutTests:
Added test for the correct repaint of an element flowed directly into the second region of a flow thread.

* fast/regions/hover-element-flowed-second-region-expected.html: Added.
* fast/regions/hover-element-flowed-second-region.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (169119 => 169120)


--- trunk/LayoutTests/ChangeLog	2014-05-20 17:29:35 UTC (rev 169119)
+++ trunk/LayoutTests/ChangeLog	2014-05-20 17:38:04 UTC (rev 169120)
@@ -1,3 +1,15 @@
+2014-05-20  Radu Stavila  <[email protected]>
+
+        REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
+        https://bugs.webkit.org/show_bug.cgi?id=133111
+
+        Reviewed by David Hyatt.
+
+        Added test for the correct repaint of an element flowed directly into the second region of a flow thread.
+
+        * fast/regions/hover-element-flowed-second-region-expected.html: Added.
+        * fast/regions/hover-element-flowed-second-region.html: Added.
+
 2014-05-20  Prashant Hiremath  <[email protected]>
 
         Only set title on SVG documents

Added: trunk/LayoutTests/fast/regions/hover-element-flowed-second-region-expected.html (0 => 169120)


--- trunk/LayoutTests/fast/regions/hover-element-flowed-second-region-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-element-flowed-second-region-expected.html	2014-05-20 17:38:04 UTC (rev 169120)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+
+<head>
+    <style>
+        .region {
+            -webkit-flow-from: flow;
+            border: 2px solid blue;
+            width: 100px;
+            height: 100px;
+            margin: 10px;
+        }
+        #region2 {
+            margin-top: 10px;
+        }
+        .content {
+            -webkit-flow-into: flow;
+            background-color: green;
+            width: 100px;
+            height: 100px;
+        }
+
+        #content2 {
+            background-color: red;
+        }
+    </style>
+</head>
+
+<body>
+    <a href="" 133111 - [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted</a>
+    <p>When hovered, the <span style="color:green"><b>green</b></span> content should turn <span style="color:red"><b>red</b></span>.</p>
+    <div class="region" id="region1"></div>
+    <div class="region" id="region2"></div>
+    <div class="content" id="content1"></div>
+    <div class="content" id="content2"></div>
+</body>
\ No newline at end of file

Added: trunk/LayoutTests/fast/regions/hover-element-flowed-second-region.html (0 => 169120)


--- trunk/LayoutTests/fast/regions/hover-element-flowed-second-region.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-element-flowed-second-region.html	2014-05-20 17:38:04 UTC (rev 169120)
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+
+<head>
+    <style>
+        .region {
+            -webkit-flow-from: flow;
+            border: 2px solid blue;
+            width: 100px;
+            height: 100px;
+            margin: 10px;
+        }
+        #region2 {
+            margin-top: 10px;
+        }
+        .content {
+            -webkit-flow-into: flow;
+            background-color: green;
+            width: 100px;
+            height: 100px;
+        }
+
+        .content:hover {
+            background-color: red;
+        }
+    </style>
+</head>
+
+<script type="text/_javascript_">
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    function beginTest() {
+        if (window.eventSender) {
+
+            // move mouse on the hover test object
+            var content2 = document.getElementById("region2");
+            eventSender.mouseMoveTo(content2.offsetLeft + 20, content2.offsetTop + 20);
+            eventSender.mouseDown(0);
+
+            testRunner.notifyDone();
+        }
+    }
+</script>
+
+<body _onload_="beginTest()">
+    <a href="" 133111 - [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted</a>
+    <p>When hovered, the <span style="color:green"><b>green</b></span> content should turn <span style="color:red"><b>red</b></span>.</p>
+    <div class="region" id="region1"></div>
+    <div class="region" id="region2"></div>
+    <div class="content" id="content1"></div>
+    <div class="content" id="content2"></div>
+</body>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (169119 => 169120)


--- trunk/Source/WebCore/ChangeLog	2014-05-20 17:29:35 UTC (rev 169119)
+++ trunk/Source/WebCore/ChangeLog	2014-05-20 17:38:04 UTC (rev 169120)
@@ -1,3 +1,19 @@
+2014-05-20  Radu Stavila  <[email protected]>
+
+        REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
+        https://bugs.webkit.org/show_bug.cgi?id=133111
+
+        Reviewed by David Hyatt.
+
+        When computing the repaint rect of an element flowed into a flow thread, if the element is flowed directly into
+        the flow thread (meaning its containing block is the flow thread itself), the region's position within the flow
+        must no longer be taken into consideration, because its already included in the element's |topLeft|.
+
+        Test: fast/regions/hover-element-flowed-second-region.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeRectForRepaint):
+
 2014-05-20  Alex Christensen  <[email protected]>
 
         Fix web timing assertion failure.

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (169119 => 169120)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2014-05-20 17:29:35 UTC (rev 169119)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2014-05-20 17:38:04 UTC (rev 169120)
@@ -2140,7 +2140,9 @@
     // elements because their absolute position already pushes them down through
     // the regions so adding this here and then adding the topLeft again would cause
     // us to add the height twice.
-    if (o->isOutOfFlowRenderFlowThread() && position != AbsolutePosition) {
+    // The same logic applies for elements flowed directly into the flow thread. Their topLeft member
+    // will already contain the portion rect of the region.
+    if (o->isOutOfFlowRenderFlowThread() && position != AbsolutePosition && containingBlock() != flowThreadContainingBlock()) {
         RenderRegion* firstRegion = nullptr;
         RenderRegion* lastRegion = nullptr;
         if (toRenderFlowThread(o)->getRegionRangeForBox(this, firstRegion, lastRegion))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to