WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2007 05:10:41 +0000 (05:10 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2007 05:10:41 +0000 (05:10 +0000)
        Reviewed by Darin Adler.

        - fix the common case of <http://bugs.webkit.org/show_bug.cgi?id=15994>
          REGRESSION: Incomplete repaint of CSS image substitution

        Test: fast/repaint/clip-with-layout-delta.html

        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState): Account for layout delta when
        pushing additional clip.

LayoutTests:

        Reviewed by Darin Adler.

        - repaint test for <http://bugs.webkit.org/show_bug.cgi?id=15994>
          REGRESSION: Incomplete repaint of CSS image substitution

        * fast/repaint/clip-with-layout-delta.html: Added.
        * platform/mac/fast/repaint/clip-with-layout-delta-expected.checksum: Added.
        * platform/mac/fast/repaint/clip-with-layout-delta-expected.png: Added.
        * platform/mac/fast/repaint/clip-with-layout-delta-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/clip-with-layout-delta.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/LayoutState.cpp

index 2e3486a07462e47f580a93d38217eb26da3ce403..1381dce9eae6787e48e0d85b663924c7d735f09a 100644 (file)
@@ -1,3 +1,15 @@
+2007-11-16  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - repaint test for <http://bugs.webkit.org/show_bug.cgi?id=15994>
+          REGRESSION: Incomplete repaint of CSS image substitution
+
+        * fast/repaint/clip-with-layout-delta.html: Added.
+        * platform/mac/fast/repaint/clip-with-layout-delta-expected.checksum: Added.
+        * platform/mac/fast/repaint/clip-with-layout-delta-expected.png: Added.
+        * platform/mac/fast/repaint/clip-with-layout-delta-expected.txt: Added.
+
 2007-11-16  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Adele.
diff --git a/LayoutTests/fast/repaint/clip-with-layout-delta.html b/LayoutTests/fast/repaint/clip-with-layout-delta.html
new file mode 100644 (file)
index 0000000..a28dedc
--- /dev/null
@@ -0,0 +1,31 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=15994</title>
+    <style type="text/css">
+        div {
+            overflow: hidden;
+        }
+        div, span {
+            height: 100px;
+            width: 100px;
+            display: block;
+        }
+        span.blue {
+            padding: 100px 0 0 0;
+            background: blue;
+        }
+    </style>
+    <script src="repaint.js" type="text/javascript"></script>
+    <script type="text/javascript">
+       function repaintTest()
+       {
+           document.getElementById('t1').removeAttribute("class");
+           document.getElementById('t2').setAttribute("class", "blue");
+       }
+    </script>
+</head>
+<body onload="runRepaintTest()">
+    <div style="background: green;"><span id="t1" class="blue">&nbsp;</span></div>
+    <div style="position: relative; margin: -100px 0 0 100px; background: red;"><span id="t2">&nbsp;</span></div>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.checksum b/LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.checksum
new file mode 100644 (file)
index 0000000..fefd78d
--- /dev/null
@@ -0,0 +1 @@
+cea95650105cc8ed2890b54ca75e76e0
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.png b/LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.png
new file mode 100644 (file)
index 0000000..5e5beca
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.txt b/LayoutTests/platform/mac/fast/repaint/clip-with-layout-delta-expected.txt
new file mode 100644 (file)
index 0000000..9559b37
--- /dev/null
@@ -0,0 +1,15 @@
+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
+layer at (8,8) size 100x100
+  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+    RenderBlock {SPAN} at (0,0) size 100x100
+      RenderText {#text} at (0,0) size 4x18
+        text run at (0,0) width 4: " "
+layer at (108,8) size 100x100 scrollHeight 200
+  RenderBlock (relative positioned) {DIV} at (100,0) size 100x100 [bgcolor=#FF0000]
+    RenderBlock {SPAN} at (0,0) size 100x200 [bgcolor=#0000FF]
+      RenderText {#text} at (0,100) size 4x18
+        text run at (0,100) width 4: " "
index 632ed05a5688a0cb671f915db9f984305be8d82c..4eb44f9e6d804928d5141bff9d736d2d1c946a86 100644 (file)
@@ -1,3 +1,16 @@
+2007-11-16  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - fix the common case of <http://bugs.webkit.org/show_bug.cgi?id=15994>
+          REGRESSION: Incomplete repaint of CSS image substitution
+
+        Test: fast/repaint/clip-with-layout-delta.html
+
+        * rendering/LayoutState.cpp:
+        (WebCore::LayoutState::LayoutState): Account for layout delta when
+        pushing additional clip.
+
 2007-11-16  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Adele.
index 85f825dd051e93f660e65dc1c367b3a7e7422cdd..2a792e04419f938580f82279cda4805be368370f 100644 (file)
@@ -67,6 +67,7 @@ LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const IntSize&
         int y = m_offset.height();
         RenderLayer* layer = renderer->layer();
         IntRect clipRect(x, y, layer->width(), layer->height());
+        clipRect.move(renderer->view()->layoutDelta());
         if (m_clipped)
             m_clipRect.intersect(clipRect);
         else {