<rdar://problem/9003382> Incomplete repaint of overflow in flipped lines writing...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Mar 2011 16:17:07 +0000 (16:17 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Mar 2011 16:17:07 +0000 (16:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=57197

Reviewed by Maciej Stachowiak.

Source/WebCore:

Tests: fast/repaint/overflow-flipped-writing-mode-block.html
       fast/repaint/overflow-flipped-writing-mode-table.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint): Flip the overflow rect before testing for intersection
with the damage rect.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paint): Made the intersection check more like the one in
RenderBlock::paint().

LayoutTests:

* fast/repaint/overflow-flipped-writing-mode-block-expected.checksum: Added.
* fast/repaint/overflow-flipped-writing-mode-block-expected.png: Added.
* fast/repaint/overflow-flipped-writing-mode-block-expected.txt: Added.
* fast/repaint/overflow-flipped-writing-mode-block.html: Added.
* fast/repaint/overflow-flipped-writing-mode-table-expected.checksum: Added.
* fast/repaint/overflow-flipped-writing-mode-table-expected.png: Added.
* fast/repaint/overflow-flipped-writing-mode-table-expected.txt: Added.
* fast/repaint/overflow-flipped-writing-mode-table.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82123 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-flipped-writing-mode-block.html [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-flipped-writing-mode-table.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderTable.cpp

index 83e89c679cf8c86ab04a9a48202db5b8cbaa9bdf..70232dead0b843249c687bd8eea089d5c61e5c65 100644 (file)
@@ -1,3 +1,19 @@
+2011-03-28  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        <rdar://problem/9003382> Incomplete repaint of overflow in flipped lines writing modes
+        https://bugs.webkit.org/show_bug.cgi?id=57197
+
+        * fast/repaint/overflow-flipped-writing-mode-block-expected.checksum: Added.
+        * fast/repaint/overflow-flipped-writing-mode-block-expected.png: Added.
+        * fast/repaint/overflow-flipped-writing-mode-block-expected.txt: Added.
+        * fast/repaint/overflow-flipped-writing-mode-block.html: Added.
+        * fast/repaint/overflow-flipped-writing-mode-table-expected.checksum: Added.
+        * fast/repaint/overflow-flipped-writing-mode-table-expected.png: Added.
+        * fast/repaint/overflow-flipped-writing-mode-table-expected.txt: Added.
+        * fast/repaint/overflow-flipped-writing-mode-table.html: Added.
+
 2011-03-28  Sergio Villar Senin  <svillar@igalia.com>
 
         Unreviewed, rebaseline GTK+ test results.
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.checksum b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.checksum
new file mode 100644 (file)
index 0000000..3a8d01f
--- /dev/null
@@ -0,0 +1 @@
+5755e2c47fbe4d6a731766f4d6edbb62
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.png b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.png
new file mode 100644 (file)
index 0000000..34473eb
Binary files /dev/null and b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.png differ
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.txt b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-expected.txt
new file mode 100644 (file)
index 0000000..cd0c728
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+        RenderBlock {DIV} at (0,0) size 100x25
+          RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+      RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#FF0000]
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block.html b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block.html
new file mode 100644 (file)
index 0000000..05dbb83
--- /dev/null
@@ -0,0 +1,15 @@
+<script src="resources/repaint.js"></script>
+<script>
+    onload = runRepaintTest;
+
+    function repaintTest()
+    {
+        document.getElementById("target").style.visibility = "hidden";
+    }
+</script>
+<div style="height: 100px; width: 100px; background-color: red; -webkit-writing-mode: horizontal-bt;">
+    <div style="height: 25px;">
+        <div style="height: 100px; background-color: green;"></div>
+    </div>
+</div>
+<div id="target" style="height: 50px; width: 100px; background-color: red; margin-top: -100px;"></div>
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.checksum b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.checksum
new file mode 100644 (file)
index 0000000..3a8d01f
--- /dev/null
@@ -0,0 +1 @@
+5755e2c47fbe4d6a731766f4d6edbb62
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.png b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.png
new file mode 100644 (file)
index 0000000..34473eb
Binary files /dev/null and b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.png differ
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.txt b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.txt
new file mode 100644 (file)
index 0000000..924d9b4
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+        RenderTable {DIV} at (0,0) size 100x25
+          RenderTableSection (anonymous) at (0,0) size 100x25
+            RenderTableRow (anonymous) at (0,0) size 100x25
+              RenderTableCell (anonymous) at (0,0) size 100x25 [r=0 c=0 rs=1 cs=1]
+                RenderBlock {DIV} at (0,0) size 100x25
+                  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+      RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#FF0000]
diff --git a/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table.html b/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table.html
new file mode 100644 (file)
index 0000000..624b5d0
--- /dev/null
@@ -0,0 +1,17 @@
+<script src="resources/repaint.js"></script>
+<script>
+    onload = runRepaintTest;
+
+    function repaintTest()
+    {
+        document.getElementById("target").style.visibility = "hidden";
+    }
+</script>
+<div style="height: 100px; width: 100px; background-color: red; -webkit-writing-mode: horizontal-bt;">
+    <div style="display: table; width: 100px;">
+        <div style="height: 25px;">
+            <div style="height: 100px; background-color: green;"></div>
+        </div>
+    </div>
+</div>
+<div id="target" style="height: 50px; width: 100px; background-color: red; margin-top: -100px;"></div>
index 5896205c7d8c486fe309dffe9dde6007fc0c7e17..e37c76b17ae75fac706410a5d89f7611e428ad48 100644 (file)
@@ -1,3 +1,20 @@
+2011-03-28  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        <rdar://problem/9003382> Incomplete repaint of overflow in flipped lines writing modes
+        https://bugs.webkit.org/show_bug.cgi?id=57197
+
+        Tests: fast/repaint/overflow-flipped-writing-mode-block.html
+               fast/repaint/overflow-flipped-writing-mode-table.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paint): Flip the overflow rect before testing for intersection
+        with the damage rect.
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::paint): Made the intersection check more like the one in
+        RenderBlock::paint().
+
 2011-03-28  Xiaomei Ji  <xji@chromium.org>
 
         Reviewed by Ryosuke Niwa.
index 62e3ec42aa0f3a9dd3a254ab1183f17bf06117fa..c0218e91c706254c33a1ff95c81549159e0223dc 100644 (file)
@@ -2246,6 +2246,7 @@ void RenderBlock::paint(PaintInfo& paintInfo, int tx, int ty)
     // paints the root's background.
     if (!isRoot()) {
         IntRect overflowBox = visualOverflowRect();
+        flipForWritingMode(overflowBox);
         overflowBox.inflate(maximalOutlineSize(paintInfo.phase));
         overflowBox.move(tx, ty);
         if (!overflowBox.intersects(paintInfo.rect))
index 35706d51bcb1ab60b0449eb30eeb00386cf2d4e6..010b9c1a09bc26dfc357a84750effc1f38360cc5 100644 (file)
@@ -452,10 +452,11 @@ void RenderTable::paint(PaintInfo& paintInfo, int tx, int ty)
     PaintPhase paintPhase = paintInfo.phase;
 
     if (!isRoot()) {
-        int os = 2 * maximalOutlineSize(paintPhase);
-        if (ty + minYVisualOverflow() >= paintInfo.rect.maxY() + os || ty + maxYVisualOverflow() <= paintInfo.rect.y() - os)
-            return;
-        if (tx + minXVisualOverflow() >= paintInfo.rect.maxX() + os || tx + maxXVisualOverflow() <= paintInfo.rect.x() - os)
+        IntRect overflowBox = visualOverflowRect();
+        flipForWritingMode(overflowBox);
+        overflowBox.inflate(maximalOutlineSize(paintInfo.phase));
+        overflowBox.move(tx, ty);
+        if (!overflowBox.intersects(paintInfo.rect))
             return;
     }