Title: [164600] trunk
Revision
164600
Author
stav...@adobe.com
Date
2014-02-24 12:51:05 -0800 (Mon, 24 Feb 2014)

Log Message

[CSS Regions] Relative positioned elements overflowing the region do not get painted into the next tile
https://bugs.webkit.org/show_bug.cgi?id=129254

Reviewed by Antti Koivisto.

Source/WebCore:

The painting of the region's layer should not be aborted so early if the region's fragment shouldn't be painted
because that would prevent all the layer's children from being painted.

Another problem this patch addresses is that clipping should also be performed when the clip rect is empty,
which is what happens when painting in a tile in which the flowed element would normally be painted
if it wasn't clipped by the region.

Test: fast/regions/content-relative-next-tile.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintFlowThreadIfRegionForFragments):

LayoutTests:

Added test for the painting across tiles of relative positioned elements flowed into regions.

* fast/regions/content-relative-next-tile-expected.html: Added.
* fast/regions/content-relative-next-tile.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (164599 => 164600)


--- trunk/LayoutTests/ChangeLog	2014-02-24 20:31:04 UTC (rev 164599)
+++ trunk/LayoutTests/ChangeLog	2014-02-24 20:51:05 UTC (rev 164600)
@@ -1,3 +1,15 @@
+2014-02-24  Radu Stavila  <stav...@adobe.com>
+
+        [CSS Regions] Relative positioned elements overflowing the region do not get painted into the next tile
+        https://bugs.webkit.org/show_bug.cgi?id=129254
+
+        Reviewed by Antti Koivisto.
+
+        Added test for the painting across tiles of relative positioned elements flowed into regions.
+
+        * fast/regions/content-relative-next-tile-expected.html: Added.
+        * fast/regions/content-relative-next-tile.html: Added.
+
 2014-02-24  Dirk Schulze  <k...@webkit.org>
 
         Transform more clip-path pixel tests to reference tests

Added: trunk/LayoutTests/fast/regions/content-relative-next-tile-expected.html (0 => 164600)


--- trunk/LayoutTests/fast/regions/content-relative-next-tile-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/content-relative-next-tile-expected.html	2014-02-24 20:51:05 UTC (rev 164600)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<style>
+    #region {
+        border: 4px solid brown;
+        padding: 5px;
+        position: relative;
+        top: 300px;
+    }
+
+    #content {
+        border: 2px solid green;
+        color: green;
+        width: 210px;
+        height: 150px;
+        padding: 3px;
+        position: relative;
+        top: 100px;
+    }
+
+    #firstTile {
+        margin: 0px;
+        position: absolute;
+        left: 0px;
+        top: 0px;
+        width: 512px;
+        height: 512px;
+        border: 2px solid blue;
+        border-top: none;
+        border-left: none;
+    }
+</style>
+
+<body>
+    <div id="firstTile"></div>
+    <div style="position:absolute">
+        <div>This tests that <span style="color:green">relative-positioned elements</span> flowed into <span style="color:brown">a region</span> are properly painted across <span style="color:blue">different tiles</span></div>
+        <a href="" 129254</a>
+    </div>
+
+    <div id="region">
+        <div id="content">
+            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span style="color:brown"><b>THE END</b></span>.
+        </div>
+    </div>
+</body>
\ No newline at end of file

Added: trunk/LayoutTests/fast/regions/content-relative-next-tile.html (0 => 164600)


--- trunk/LayoutTests/fast/regions/content-relative-next-tile.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/content-relative-next-tile.html	2014-02-24 20:51:05 UTC (rev 164600)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<style>
+    #region {
+        -webkit-flow-from: flow;
+        border: 4px solid brown;
+        padding: 5px;
+        position: relative;
+        top: 300px;
+    }
+
+    #content {
+        -webkit-flow-into: flow;
+        border: 2px solid green;
+        color: green;
+        width: 210px;
+        height: 150px;
+        padding: 3px;
+        position: relative;
+        top: 100px;
+    }
+
+    #firstTile {
+        margin: 0px;
+        position: absolute;
+        left: 0px;
+        top: 0px;
+        width: 512px;
+        height: 512px;
+        border: 2px solid blue;
+        border-top: none;
+        border-left: none;
+    }
+</style>
+
+<body>
+    <div id="firstTile"></div>
+    <div style="position:absolute">
+        <div>This tests that <span style="color:green">relative-positioned elements</span> flowed into <span style="color:brown">a region</span> are properly painted across <span style="color:blue">different tiles</span></div>
+        <a href="" 129254</a>
+    </div>
+
+    <div id="region"></div>
+
+    <div id="content">
+        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span style="color:brown"><b>THE END</b></span>.
+    </div>
+</body>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (164599 => 164600)


--- trunk/Source/WebCore/ChangeLog	2014-02-24 20:31:04 UTC (rev 164599)
+++ trunk/Source/WebCore/ChangeLog	2014-02-24 20:51:05 UTC (rev 164600)
@@ -1,3 +1,22 @@
+2014-02-24  Radu Stavila  <stav...@adobe.com>
+
+        [CSS Regions] Relative positioned elements overflowing the region do not get painted into the next tile
+        https://bugs.webkit.org/show_bug.cgi?id=129254
+
+        Reviewed by Antti Koivisto.
+
+        The painting of the region's layer should not be aborted so early if the region's fragment shouldn't be painted
+        because that would prevent all the layer's children from being painted.
+
+        Another problem this patch addresses is that clipping should also be performed when the clip rect is empty,
+        which is what happens when painting in a tile in which the flowed element would normally be painted
+        if it wasn't clipped by the region.
+
+        Test: fast/regions/content-relative-next-tile.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintFlowThreadIfRegionForFragments):
+
 2014-02-24  Renata Hodovan  <rhodovan.u-sze...@partner.samsung.com>
         
         Get rid of the unused 'immediate' parameters from repaint related functions

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (164599 => 164600)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2014-02-24 20:31:04 UTC (rev 164599)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2014-02-24 20:51:05 UTC (rev 164600)
@@ -6821,14 +6821,11 @@
     for (size_t i = 0; i < fragments.size(); ++i) {
         const LayerFragment& fragment = fragments.at(i);
 
-        if (!fragment.shouldPaintContent)
-            continue;
-
         ClipRect clipRect = fragment.backgroundRect;
         if (flowFragment->shouldClipFlowThreadContent())
             clipRect.intersect(regionClipRect);
 
-        bool shouldClip = !clipRect.isEmpty() && clipRect != LayoutRect::infiniteRect();
+        bool shouldClip = (clipRect != LayoutRect::infiniteRect());
         // Optimize clipping for the single fragment case.
         if (shouldClip)
             clipToRect(paintingInfo.rootLayer, context, paintingInfo.paintDirtyRect, clipRect);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to