LayoutTests:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Jun 2006 04:07:11 +0000 (04:07 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Jun 2006 04:07:11 +0000 (04:07 +0000)
        Patch by mitzpettel.  Reviewed by hyatt.

        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9334
          Incomplete repaint when changing block from non-positioned to positioned

        * fast/repaint/static-to-positioned-expected.checksum: Added.
        * fast/repaint/static-to-positioned-expected.png: Added.
        * fast/repaint/static-to-positioned-expected.txt: Added.
        * fast/repaint/static-to-positioned.html: Added.

WebCore:

        Patch by mitzpettel.  Reviewed by hyatt.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9334
          Incomplete repaint when changing block from non-positioned to positioned

        Test: fast/repaint/static-to-positioned.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::setStyle): If changing from static to positioned, repaint
        as static.

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/static-to-positioned-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/static-to-positioned-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/static-to-positioned-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/static-to-positioned.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderObject.cpp

index 2c12154bead7d1c31ecbebcdaaed1ba71ba9728d..56bbee1046f6c4525501b06b19a17ebc3f7d5487 100644 (file)
@@ -1,3 +1,15 @@
+2006-06-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by hyatt.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9334
+          Incomplete repaint when changing block from non-positioned to positioned
+
+        * fast/repaint/static-to-positioned-expected.checksum: Added.
+        * fast/repaint/static-to-positioned-expected.png: Added.
+        * fast/repaint/static-to-positioned-expected.txt: Added.
+        * fast/repaint/static-to-positioned.html: Added.
+
 2006-06-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by hyatt.
diff --git a/LayoutTests/fast/repaint/static-to-positioned-expected.checksum b/LayoutTests/fast/repaint/static-to-positioned-expected.checksum
new file mode 100644 (file)
index 0000000..d88928a
--- /dev/null
@@ -0,0 +1,2 @@
+2a7a19f20244448431d6fbc290a76521
+\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/static-to-positioned-expected.png b/LayoutTests/fast/repaint/static-to-positioned-expected.png
new file mode 100644 (file)
index 0000000..cf8b723
Binary files /dev/null and b/LayoutTests/fast/repaint/static-to-positioned-expected.png differ
diff --git a/LayoutTests/fast/repaint/static-to-positioned-expected.txt b/LayoutTests/fast/repaint/static-to-positioned-expected.txt
new file mode 100644 (file)
index 0000000..8a382fb
--- /dev/null
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x486
+  RenderBlock {HTML} at (0,0) size 800x486
+    RenderBody {BODY} at (8,16) size 784x462
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 100x18
+          text run at (0,0) width 100: "Repaint test for "
+        RenderInline {I} at (0,0) size 777x36
+          RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+            RenderText {#text} at (100,0) size 348x18
+              text run at (100,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9334"
+          RenderText {#text} at (448,0) size 777x36
+            text run at (448,0) width 4: " "
+            text run at (452,0) width 325: "Incomplete repaint when changing block from non-"
+            text run at (0,18) width 150: "positioned to positioned"
+        RenderText {#text} at (150,18) size 4x18
+          text run at (150,18) width 4: "."
+      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+layer at (8,78) size 784x200
+  RenderBlock (relative positioned) {DIV} at (0,62) size 784x200
+layer at (8,128) size 100x100
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
+layer at (8,278) size 784x200
+  RenderBlock (relative positioned) {DIV} at (0,262) size 784x200
+    RenderBlock {DIV} at (0,50) size 784x150
+layer at (8,278) size 100x100
+  RenderBlock (positioned) {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
diff --git a/LayoutTests/fast/repaint/static-to-positioned.html b/LayoutTests/fast/repaint/static-to-positioned.html
new file mode 100644 (file)
index 0000000..41e9aaa
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+       <script src="repaint.js" type="text/javascript"></script>
+       <script type="text/javascript">
+          function repaintTest()
+          {
+           document.getElementById('a').style.position='relative';
+           document.getElementById('t').style.position='absolute';
+          }
+       </script>
+</head>
+<body onload="runRepaintTest();">
+    <p>
+        Repaint test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=9334">http://bugzilla.opendarwin.org/show_bug.cgi?id=9334</a>
+        Incomplete repaint when changing block from non-positioned to positioned</i>.
+    </p>
+    <hr>
+    <div style="position: relative; height: 200px;">
+        <div id="a" style="width: 100px; height: 100px; background: blue; top: 50px; "></div>
+    </div>
+    <div style="position: relative; height: 150px; padding-top: 50px;">
+        <div style="height: 150px;">
+            <div id="t" style="width: 100px; height: 100px; background: blue; top: 0;"></div>
+        </div>
+    </div>
+</body>
+</html>
index 77b4c69aa66d3341f31a99e5ac2c4723f3b47f14..50db854068a6fcad795f77eedc945e63405e3e0f 100644 (file)
@@ -1,3 +1,16 @@
+2006-06-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by hyatt.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9334
+          Incomplete repaint when changing block from non-positioned to positioned
+
+        Test: fast/repaint/static-to-positioned.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::setStyle): If changing from static to positioned, repaint
+        as static.
+
 2006-06-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by hyatt.
index 392c572b136c584e5f2b6746491bfcb038ef51fa..3552211a2194ce303e047b1381d24e71cd782b17 100644 (file)
@@ -2059,6 +2059,8 @@ void RenderObject::setStyle(RenderStyle *style)
         // to dirty the render tree using the old position value now.
         if (d == RenderStyle::Layout && m_parent && m_style->position() != style->position()) {
             markContainingBlocksForLayout();
+            if (m_style->position() == StaticPosition)
+                repaint();
             if (isRenderBlock()) {
                 if (style->position() == StaticPosition) {
                     // Clear our positioned objects list. Our absolutely positioned descendants will be