LayoutTests:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Nov 2006 23:28:57 +0000 (23:28 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Nov 2006 23:28:57 +0000 (23:28 +0000)
        Reviewed by Mitz.

        Tests for http://bugs.webkit.org/show_bug.cgi?id=11277
        REGRESSION: Incomplete repaint of overflow areas when deleting

        * fast/repaint/overflow-delete-line-expected.checksum: Added.
        * fast/repaint/overflow-delete-line-expected.png: Added.
        * fast/repaint/overflow-delete-line-expected.txt: Added.
        * fast/repaint/overflow-delete-line.html: Added.
        * fast/repaint/overflow-scroll-delete-expected.checksum: Added.
        * fast/repaint/overflow-scroll-delete-expected.png: Added.
        * fast/repaint/overflow-scroll-delete-expected.txt: Added.
        * fast/repaint/overflow-scroll-delete.html: Added.
        * fast/repaint/overflow-outline-repaint-expected.checksum: Added.
        * fast/repaint/overflow-outline-repaint-expected.png: Added.
        * fast/repaint/overflow-outline-repaint-expected.txt: Added.
        * fast/repaint/overflow-outline-repaint.html: Added.

WebCore:

        Reviewed by Mitz.

        - Fix for http://bugs.webkit.org/show_bug.cgi?id=11277
        REGRESSION: Incomplete repaint of overflow areas when deleting

        Restrict the repaint rect for overflow blocks after the height has been fully computed.
        Also, adjust the repaint rect coordinates for the scroll offset.

        * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock):
        * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren):

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

16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/overflow-delete-line-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-delete-line-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-delete-line-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-delete-line.html [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-outline-repaint-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-outline-repaint-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-outline-repaint-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-outline-repaint.html [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-scroll-delete-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-scroll-delete-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-scroll-delete-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/overflow-scroll-delete.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/bidi.cpp

index d79e8d0437aad664ce805c528bfd65bf31532337..3cff834658695624260c71dffec3b571c8b22610 100644 (file)
@@ -1,3 +1,23 @@
+2006-11-01  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Mitz.
+
+        Tests for http://bugs.webkit.org/show_bug.cgi?id=11277
+        REGRESSION: Incomplete repaint of overflow areas when deleting
+
+        * fast/repaint/overflow-delete-line-expected.checksum: Added.
+        * fast/repaint/overflow-delete-line-expected.png: Added.
+        * fast/repaint/overflow-delete-line-expected.txt: Added.
+        * fast/repaint/overflow-delete-line.html: Added.
+        * fast/repaint/overflow-scroll-delete-expected.checksum: Added.
+        * fast/repaint/overflow-scroll-delete-expected.png: Added.
+        * fast/repaint/overflow-scroll-delete-expected.txt: Added.
+        * fast/repaint/overflow-scroll-delete.html: Added.
+        * fast/repaint/overflow-outline-repaint-expected.checksum: Added.
+        * fast/repaint/overflow-outline-repaint-expected.png: Added.
+        * fast/repaint/overflow-outline-repaint-expected.txt: Added.
+        * fast/repaint/overflow-outline-repaint.html: Added.
+
 2006-10-31  Geoffrey Garen  <ggaren@apple.com>
 
         Added test for accessing the 'caller' property from inside an event
diff --git a/LayoutTests/fast/repaint/overflow-delete-line-expected.checksum b/LayoutTests/fast/repaint/overflow-delete-line-expected.checksum
new file mode 100644 (file)
index 0000000..41b1d73
--- /dev/null
@@ -0,0 +1 @@
+e080e7fcabdfdcbbf6dad3ad4c236bd1
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/overflow-delete-line-expected.png b/LayoutTests/fast/repaint/overflow-delete-line-expected.png
new file mode 100644 (file)
index 0000000..012a0cf
Binary files /dev/null and b/LayoutTests/fast/repaint/overflow-delete-line-expected.png differ
diff --git a/LayoutTests/fast/repaint/overflow-delete-line-expected.txt b/LayoutTests/fast/repaint/overflow-delete-line-expected.txt
new file mode 100644 (file)
index 0000000..1cc3dd9
--- /dev/null
@@ -0,0 +1,23 @@
+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 {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 151x18
+          text run at (0,0) width 151: "This is a repaint test for "
+        RenderInline {I} at (0,0) size 755x36
+          RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+            RenderText {#text} at (151,0) size 301x18
+              text run at (151,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=11277"
+          RenderText {#text} at (452,0) size 755x36
+            text run at (452,0) width 4: " "
+            text run at (456,0) width 299: "REGRESSION: Incomplete repaint of overflow"
+            text run at (0,18) width 127: "areas when deleting"
+        RenderText {#text} at (127,18) size 4x18
+          text run at (127,18) width 4: "."
+      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+layer at (8,70) size 80x36
+  RenderBlock {DIV} at (0,62) size 80x36
+    RenderText {#text} at (0,0) size 72x18
+      text run at (0,0) width 72: "Lorem ipsu"
diff --git a/LayoutTests/fast/repaint/overflow-delete-line.html b/LayoutTests/fast/repaint/overflow-delete-line.html
new file mode 100644 (file)
index 0000000..db45a99
--- /dev/null
@@ -0,0 +1,21 @@
+<html>
+<head>
+    <script src="repaint.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        function repaintTest()
+        {
+            dv.firstChild.data='Lorem ipsu';
+        }
+    </script>
+</head>
+<body onload="runRepaintTest();">
+    <p>
+        This is a repaint test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=11277">http://bugs.webkit.org/show_bug.cgi?id=11277</a>
+        REGRESSION: Incomplete repaint of overflow areas when deleting</i>.
+    </p>
+    <hr>
+    <div contenteditable id="dv" style="overflow: hidden; outline: none; width: 80px; height: 36px">
+        Lorem ipsum
+    </div>
+</body>
+</html>
diff --git a/LayoutTests/fast/repaint/overflow-outline-repaint-expected.checksum b/LayoutTests/fast/repaint/overflow-outline-repaint-expected.checksum
new file mode 100644 (file)
index 0000000..b1b8f5c
--- /dev/null
@@ -0,0 +1 @@
+1bac8362fd3c44edb1f7b7e878c99ff0
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/overflow-outline-repaint-expected.png b/LayoutTests/fast/repaint/overflow-outline-repaint-expected.png
new file mode 100644 (file)
index 0000000..905a9c6
Binary files /dev/null and b/LayoutTests/fast/repaint/overflow-outline-repaint-expected.png differ
diff --git a/LayoutTests/fast/repaint/overflow-outline-repaint-expected.txt b/LayoutTests/fast/repaint/overflow-outline-repaint-expected.txt
new file mode 100644 (file)
index 0000000..99db35f
--- /dev/null
@@ -0,0 +1,26 @@
+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 (anonymous) at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 781x36
+          text run at (0,0) width 580: "If the red outline at the bottom of the div extends all the way to the scrollbar, the test passes. "
+          text run at (580,0) width 201: "If it stops short, then the test has"
+          text run at (0,18) width 293: "failed, and an incomplete repaint has occurred."
+layer at (8,44) size 80x69 clip at (8,44) size 65x69 scrollY 91 scrollHeight 198
+  RenderBlock {DIV} at (0,36) size 80x69
+    RenderBR {BR} at (0,0) size 0x18
+    RenderBR {BR} at (0,18) size 0x18
+    RenderBR {BR} at (0,36) size 0x18
+    RenderBR {BR} at (0,54) size 0x18
+    RenderBR {BR} at (0,72) size 0x18
+    RenderBR {BR} at (0,90) size 0x18
+    RenderBR {BR} at (0,108) size 0x18
+    RenderBR {BR} at (0,126) size 0x18
+    RenderBR {BR} at (0,144) size 0x18
+    RenderInline {SPAN} at (0,0) size 64x36
+      RenderText {#text} at (0,162) size 64x36
+        text run at (0,162) width 64: "Excellent!"
+        text run at (0,180) width 27: "Test"
+    RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/fast/repaint/overflow-outline-repaint.html b/LayoutTests/fast/repaint/overflow-outline-repaint.html
new file mode 100644 (file)
index 0000000..fb139d7
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<head>
+    <script src="repaint.js" type="text/javascript"></script>
+    <script type="text/javascript">
+       function repaintTest()
+       {
+       document.getElementById("z").lastChild.data='Excellent! Test';
+       }
+    </script>
+</head>
+<body onload="repaintTest()">
+If the red outline at the bottom of the div extends all the way to the scrollbar, the test passes.  If it stops short, then the test has failed, and an incomplete repaint has occurred.
+<div id="t" style="overflow-y: scroll; outline: none; width: 80px; height: 69px;">
+    <br><br><br><br><br><br><br><br><br><span id="z" style="outline: 3px solid red;">Failed Test</span>
+</div>
+<script>
+    document.getElementById("t").scrollTop = 91;
+</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/overflow-scroll-delete-expected.checksum b/LayoutTests/fast/repaint/overflow-scroll-delete-expected.checksum
new file mode 100644 (file)
index 0000000..5e5906c
--- /dev/null
@@ -0,0 +1 @@
+e00e7a9c293ecb5595ff7326d0b13028
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/overflow-scroll-delete-expected.png b/LayoutTests/fast/repaint/overflow-scroll-delete-expected.png
new file mode 100644 (file)
index 0000000..69798a0
Binary files /dev/null and b/LayoutTests/fast/repaint/overflow-scroll-delete-expected.png differ
diff --git a/LayoutTests/fast/repaint/overflow-scroll-delete-expected.txt b/LayoutTests/fast/repaint/overflow-scroll-delete-expected.txt
new file mode 100644 (file)
index 0000000..6f3ee19
--- /dev/null
@@ -0,0 +1,36 @@
+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 {P} at (0,0) size 784x54
+        RenderText {#text} at (0,0) size 151x18
+          text run at (0,0) width 151: "This is a repaint test for "
+        RenderInline {I} at (0,0) size 755x36
+          RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+            RenderText {#text} at (151,0) size 301x18
+              text run at (151,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=11277"
+          RenderText {#text} at (452,0) size 755x36
+            text run at (452,0) width 4: " "
+            text run at (456,0) width 299: "REGRESSION: Incomplete repaint of overflow"
+            text run at (0,18) width 127: "areas when deleting"
+        RenderText {#text} at (127,18) size 760x36
+          text run at (127,18) width 8: ". "
+          text run at (135,18) width 443: "This shows that the repaint rect doesn't account for scrolling. You can "
+          text run at (578,18) width 182: "use Quartz Debug to see that"
+          text run at (0,36) width 408: "changing the text repaints a rect where the text would have been "
+          text run at (408,36) width 154: "if it hadn't been scrolled."
+layer at (8,78) size 80x69 clip at (8,78) size 65x69 scrollY 128 scrollHeight 198
+  RenderBlock {DIV} at (0,70) size 80x69
+    RenderBR {BR} at (0,0) size 0x18
+    RenderBR {BR} at (0,18) size 0x18
+    RenderBR {BR} at (0,36) size 0x18
+    RenderBR {BR} at (0,54) size 0x18
+    RenderBR {BR} at (0,72) size 0x18
+    RenderBR {BR} at (0,90) size 0x18
+    RenderBR {BR} at (0,108) size 0x18
+    RenderBR {BR} at (0,126) size 0x18
+    RenderBR {BR} at (0,144) size 0x18
+    RenderText {#text} at (0,162) size 43x36
+      text run at (0,162) width 43: "Passed"
+      text run at (0,180) width 27: "Test"
diff --git a/LayoutTests/fast/repaint/overflow-scroll-delete.html b/LayoutTests/fast/repaint/overflow-scroll-delete.html
new file mode 100644 (file)
index 0000000..5c2a87f
--- /dev/null
@@ -0,0 +1,27 @@
+<html>
+<head>
+    <script src="repaint.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        function repaintTest()
+        {
+            document.getElementById("t").lastChild.data='Passed Test';
+        }
+    </script>
+</head>
+<body onload="runRepaintTest();">
+<p>
+    This is a repaint test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=11277">http://bugs.webkit.org/show_bug.cgi?id=11277</a>
+    REGRESSION: Incomplete repaint of overflow areas when deleting</i>.
+
+    This shows that the repaint rect doesn't account for scrolling. You can
+    use Quartz Debug to see that changing the text repaints a rect where the text would have been
+    if it hadn't been scrolled.
+</p>
+<div id="t" style="overflow-y: scroll; outline: none; width: 80px; height: 69px;">
+    <br><br><br><br><br><br><br><br><br>Failed Test
+</div>
+<script>
+    document.getElementById("t").scrollTop = 128;
+</script>
+</body>
+</html>
index 6e43a2c5ac8e3dd1871b089aaf818121b991e7fa..b83968dfbbdcdbf6489a89872860c346c7cae0fe 100644 (file)
@@ -1,3 +1,16 @@
+2006-11-01  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Mitz.
+
+        - Fix for http://bugs.webkit.org/show_bug.cgi?id=11277
+        REGRESSION: Incomplete repaint of overflow areas when deleting
+
+        Restrict the repaint rect for overflow blocks after the height has been fully computed.
+        Also, adjust the repaint rect coordinates for the scroll offset.
+
+        * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock):
+        * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren):
+
 2006-11-01  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Mitz.
index 7d7031abfa25daef113f804ef6e8fd7a75cfac83..5010f49ac51e54b0ddf44cb0b3d14ecbbab52d01 100644 (file)
@@ -554,11 +554,25 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
     if (checkForRepaint)
         didFullRepaint = repaintAfterLayoutIfNeeded(oldBounds, oldFullBounds);
     if (!didFullRepaint && !repaintRect.isEmpty()) {
+    
+        repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
+        
+        if (hasOverflowClip()) {
+            // Adjust repaint rect for scroll offset
+            int x = repaintRect.x();
+            int y = repaintRect.y();
+            layer()->subtractScrollOffset(x, y);
+            repaintRect.setX(x);
+            repaintRect.setY(y);
+
+            // Don't allow this rect to spill out of our overflow box.
+            repaintRect.intersect(IntRect(0, 0, m_width, m_height));
+        }
+    
         RenderView* v = view();
-        if (v && v->frameView()) {
-            repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
+        // Make sure the rect is still non-empty after intersecting for overflow above
+        if (!repaintRect.isEmpty() && v && v->frameView())
             v->frameView()->addRepaintInfo(this, repaintRect); // We need to do a partial repaint of our content.
-        }
     }
     setNeedsLayout(false);
 }
index e31aa3256d2014942b08a664fb667de60f66aa30..31c264ebfd0ac38fe77f0b627731bea0b1c27e88 100644 (file)
@@ -1744,9 +1744,6 @@ IntRect RenderBlock::layoutInlineChildren(bool relayoutChildren)
         repaintRect.setWidth(m_overflowWidth - m_overflowLeft);
         repaintRect.setY(repaintTop);
         repaintRect.setHeight(repaintBottom - repaintTop);
-        if (hasOverflowClip())
-            // Don't allow this rect to spill out of our overflow box.
-            repaintRect.intersect(IntRect(0, 0, m_width, m_height));
     }
 
     if (!firstLineBox() && hasLineIfEmpty())