Title: [149550] trunk
Revision
149550
Author
[email protected]
Date
2013-05-03 20:49:25 -0700 (Fri, 03 May 2013)

Log Message

incorrect repainting when a table has a transform
https://bugs.webkit.org/show_bug.cgi?id=109867

Patch by Arnaud Renevier <[email protected]> on 2013-05-03
Reviewed by Simon Fraser.

Source/WebCore:

Disable LayoutState when table, tableRow or tableSection render
objects have transforms or reflections.

Tests: fast/repaint/reflection-table-layout.html
       fast/repaint/transform-table-layout.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):

LayoutTests:

Create tests that resize an element inside a display: table element.
Compare to a reference html file where the element has a static size.
In the first test, the table like element has a transform. In the
second, it has a reflection.

* fast/repaint/reflection-table-layout-expected.html: Added.
* fast/repaint/reflection-table-layout.html: Added.
* fast/repaint/transform-table-layout-expected.html: Added.
* fast/repaint/transform-table-layout.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (149549 => 149550)


--- trunk/LayoutTests/ChangeLog	2013-05-04 03:43:12 UTC (rev 149549)
+++ trunk/LayoutTests/ChangeLog	2013-05-04 03:49:25 UTC (rev 149550)
@@ -1,3 +1,20 @@
+2013-05-03  Arnaud Renevier  <[email protected]>
+
+        incorrect repainting when a table has a transform
+        https://bugs.webkit.org/show_bug.cgi?id=109867
+
+        Reviewed by Simon Fraser.
+
+        Create tests that resize an element inside a display: table element.
+        Compare to a reference html file where the element has a static size.
+        In the first test, the table like element has a transform. In the
+        second, it has a reflection.
+
+        * fast/repaint/reflection-table-layout-expected.html: Added.
+        * fast/repaint/reflection-table-layout.html: Added.
+        * fast/repaint/transform-table-layout-expected.html: Added.
+        * fast/repaint/transform-table-layout.html: Added.
+
 2013-05-03  Antti Koivisto  <[email protected]>
 
         Remove concept of younger and older shadow trees

Added: trunk/LayoutTests/fast/repaint/reflection-table-layout-expected.txt (0 => 149550)


--- trunk/LayoutTests/fast/repaint/reflection-table-layout-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/reflection-table-layout-expected.txt	2013-05-04 03:49:25 UTC (rev 149550)
@@ -0,0 +1,11 @@
+(repaint rects
+  (rect 7 8 2 1)
+  (rect 6 8 4 2)
+  (rect -92 9 200 1)
+  (rect -92 8 200 2)
+  (rect 8 9 784 1)
+  (rect 0 17 800 1)
+  (rect -92 9 200 1)
+  (rect -92 9 200 1)
+)
+

Added: trunk/LayoutTests/fast/repaint/reflection-table-layout.html (0 => 149550)


--- trunk/LayoutTests/fast/repaint/reflection-table-layout.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/reflection-table-layout.html	2013-05-04 03:49:25 UTC (rev 149550)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+
+    <style>
+    #container {
+        width: 100px;
+        display: table;
+        -webkit-box-reflect: left;
+    }
+    #main {
+        width: 1px;
+        height: 1px;
+        background-color: black;
+    }
+    </style>
+
+<script src=""
+<script>
+function repaintTest() {
+    var div = document.getElementById("main");
+    div.style.width = '2px';
+    div.style.height = '2px';
+}
+</script>
+
+</head>
+<body _onload_="runRepaintTest()">
+
+<div id="container">
+    <div id="main"></div> 
+</div>
+
+</body>
+</html>

Added: trunk/LayoutTests/fast/repaint/transform-table-layout-expected.txt (0 => 149550)


--- trunk/LayoutTests/fast/repaint/transform-table-layout-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/transform-table-layout-expected.txt	2013-05-04 03:49:25 UTC (rev 149550)
@@ -0,0 +1,10 @@
+(repaint rects
+  (rect 8 108 1 1)
+  (rect 8 108 2 2)
+  (rect 8 109 100 1)
+  (rect 8 108 100 2)
+  (rect 8 9 784 1)
+  (rect 0 17 800 1)
+  (rect 8 109 100 1)
+)
+

Added: trunk/LayoutTests/fast/repaint/transform-table-layout.html (0 => 149550)


--- trunk/LayoutTests/fast/repaint/transform-table-layout.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/transform-table-layout.html	2013-05-04 03:49:25 UTC (rev 149550)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+
+    <style>
+    #container {
+        width: 100px;
+        display: table;
+        -webkit-transform: translate(0px, 100px);
+    }
+    #main {
+        width: 1px;
+        height: 1px;
+        background-color: black;
+    }
+    </style>
+
+<script src=""
+<script>
+function repaintTest() {
+    var div = document.getElementById("main");
+    div.style.width = '2px';
+    div.style.height = '2px';
+}
+</script>
+
+</head>
+<body _onload_="runRepaintTest()">
+
+<div id="container">
+    <div id="main"></div> 
+</div>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (149549 => 149550)


--- trunk/Source/WebCore/ChangeLog	2013-05-04 03:43:12 UTC (rev 149549)
+++ trunk/Source/WebCore/ChangeLog	2013-05-04 03:49:25 UTC (rev 149550)
@@ -1,3 +1,24 @@
+2013-05-03  Arnaud Renevier  <[email protected]>
+
+        incorrect repainting when a table has a transform
+        https://bugs.webkit.org/show_bug.cgi?id=109867
+
+        Reviewed by Simon Fraser.
+
+        Disable LayoutState when table, tableRow or tableSection render
+        objects have transforms or reflections.
+
+        Tests: fast/repaint/reflection-table-layout.html
+               fast/repaint/transform-table-layout.html
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::layout):
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::layout):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::layout):
+        (WebCore::RenderTableSection::layoutRows):
+
 2013-05-03  Antti Koivisto  <[email protected]>
 
         Remove concept of younger and older shadow trees

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (149549 => 149550)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2013-05-04 03:43:12 UTC (rev 149549)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2013-05-04 03:49:25 UTC (rev 149550)
@@ -404,7 +404,7 @@
     recalcBordersInRowDirection();
         
     LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
-    LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
+    LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
 
     setLogicalHeight(0);
 

Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (149549 => 149550)


--- trunk/Source/WebCore/rendering/RenderTableRow.cpp	2013-05-04 03:43:12 UTC (rev 149549)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp	2013-05-04 03:49:25 UTC (rev 149550)
@@ -159,7 +159,7 @@
     ASSERT(needsLayout());
 
     // Table rows do not add translation.
-    LayoutStateMaintainer statePusher(view(), this, LayoutSize(), style()->isFlippedBlocksWritingMode());
+    LayoutStateMaintainer statePusher(view(), this, LayoutSize(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
 
     bool paginated = view()->layoutState()->isPaginated();
                 

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (149549 => 149550)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2013-05-04 03:43:12 UTC (rev 149549)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2013-05-04 03:49:25 UTC (rev 149550)
@@ -371,7 +371,7 @@
     // can be called in a loop (e.g during parsing). Doing it now ensures we have a stable-enough structure.
     m_grid.shrinkToFit();
 
-    LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
+    LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
 
     const Vector<int>& columnPos = table()->columnPositions();
 
@@ -518,7 +518,7 @@
     int vspacing = table()->vBorderSpacing();
     unsigned nEffCols = table()->numEffCols();
 
-    LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
+    LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || style()->isFlippedBlocksWritingMode());
 
     for (unsigned r = 0; r < totalRows; r++) {
         // Set the row's x/y position and width/height.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to