WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2007 17:48:56 +0000 (17:48 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2007 17:48:56 +0000 (17:48 +0000)
        Reviewed by Darin Adler.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15838
          Incomplete repaint toggling "How you know this person" on Facebook

        Test: fast/repaint/make-children-non-inline.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::makeChildrenNonInline): Repaint the block. This
        is needed because the inline children may be repositioned as they move
        into new anonymous blocks, but those blocks have no knowledge of where
        their children used to be, so they cannot invalidate those areas.

LayoutTests:

        Reviewed by Darin Adler.

        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=15838
          Incomplete repaint toggling "How you know this person" on Facebook

        * fast/repaint/make-children-non-inline.html: Added.
        * platform/mac/fast/repaint/make-children-non-inline-expected.txt: Added.
        * platform/mac-leopard/fast/repaint: Added.
        * platform/mac-leopard/fast/repaint/make-children-non-inline-expected.checksum: Added.
        * platform/mac-leopard/fast/repaint/make-children-non-inline-expected.png: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/make-children-non-inline.html [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/repaint/make-children-non-inline-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/repaint/make-children-non-inline-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/make-children-non-inline-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index d562feeaaac3eba95ba5ee390ebb8c28384374d6..9a436ccdb43834914eeea05f956644f8304675fb 100644 (file)
@@ -1,3 +1,16 @@
+2007-11-06  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=15838
+          Incomplete repaint toggling "How you know this person" on Facebook
+
+        * fast/repaint/make-children-non-inline.html: Added.
+        * platform/mac/fast/repaint/make-children-non-inline-expected.txt: Added.
+        * platform/mac-leopard/fast/repaint: Added.
+        * platform/mac-leopard/fast/repaint/make-children-non-inline-expected.checksum: Added.
+        * platform/mac-leopard/fast/repaint/make-children-non-inline-expected.png: Added.
+
 2007-11-05  Adam Roben  <aroben@apple.com>
 
         Remove a now-passing test from the Windows Skipped file
diff --git a/LayoutTests/fast/repaint/make-children-non-inline.html b/LayoutTests/fast/repaint/make-children-non-inline.html
new file mode 100644 (file)
index 0000000..4ee1224
--- /dev/null
@@ -0,0 +1,29 @@
+<html>
+<head>
+    <title></title>
+    <script src="repaint.js"></script>
+    <script>
+        function repaintTest()
+        {
+            document.getElementById("target").style.display = "";
+        }
+    </script>
+</head>
+<body onload="runRepaintTest()">
+    <p>
+        Repaint test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=15838">http://bugs.webkit.org/show_bug.cgi?id=15838</a> Incomplete repaint toggling "How you know this person" on Facebook</i>.
+    </p>
+    <div>
+        Word,<br>
+        words,<br>
+        more words.<br>
+        I could<br>
+        write a book<br>
+        <div id="target" style="background-color: yellow; display: none; height: 100px; width: 10px;"></div>
+        about all the stuff<br>
+        that comes<br>
+        after<br>
+        the break.
+    </div>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac-leopard/fast/repaint/make-children-non-inline-expected.checksum b/LayoutTests/platform/mac-leopard/fast/repaint/make-children-non-inline-expected.checksum
new file mode 100644 (file)
index 0000000..c887974
--- /dev/null
@@ -0,0 +1 @@
+899bb23c6fec683875040e49bde60ace
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/fast/repaint/make-children-non-inline-expected.png b/LayoutTests/platform/mac-leopard/fast/repaint/make-children-non-inline-expected.png
new file mode 100644 (file)
index 0000000..3757977
Binary files /dev/null and b/LayoutTests/platform/mac-leopard/fast/repaint/make-children-non-inline-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/make-children-non-inline-expected.txt b/LayoutTests/platform/mac/fast/repaint/make-children-non-inline-expected.txt
new file mode 100644 (file)
index 0000000..6144310
--- /dev/null
@@ -0,0 +1,47 @@
+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 100x18
+          text run at (0,0) width 100: "Repaint test for "
+        RenderInline {I} at (0,0) size 767x36
+          RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+            RenderText {#text} at (100,0) size 301x18
+              text run at (100,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=15838"
+          RenderText {#text} at (401,0) size 767x36
+            text run at (401,0) width 366: " Incomplete repaint toggling \"How you know this person\""
+            text run at (0,18) width 83: "on Facebook"
+        RenderText {#text} at (83,18) size 4x18
+          text run at (83,18) width 4: "."
+      RenderBlock {DIV} at (0,52) size 784x262
+        RenderBlock (anonymous) at (0,0) size 784x90
+          RenderText {#text} at (0,0) size 40x18
+            text run at (0,0) width 40: "Word,"
+          RenderBR {BR} at (40,14) size 0x0
+          RenderText {#text} at (0,18) size 43x18
+            text run at (0,18) width 43: "words,"
+          RenderBR {BR} at (43,32) size 0x0
+          RenderText {#text} at (0,36) size 79x18
+            text run at (0,36) width 79: "more words."
+          RenderBR {BR} at (79,50) size 0x0
+          RenderText {#text} at (0,54) size 44x18
+            text run at (0,54) width 44: "I could"
+          RenderBR {BR} at (44,68) size 0x0
+          RenderText {#text} at (0,72) size 79x18
+            text run at (0,72) width 79: "write a book"
+          RenderBR {BR} at (79,86) size 0x0
+        RenderBlock {DIV} at (0,90) size 10x100 [bgcolor=#FFFF00]
+        RenderBlock (anonymous) at (0,190) size 784x72
+          RenderText {#text} at (0,0) size 109x18
+            text run at (0,0) width 109: "about all the stuff"
+          RenderBR {BR} at (109,14) size 0x0
+          RenderText {#text} at (0,18) size 67x18
+            text run at (0,18) width 67: "that comes"
+          RenderBR {BR} at (67,32) size 0x0
+          RenderText {#text} at (0,36) size 28x18
+            text run at (0,36) width 28: "after"
+          RenderBR {BR} at (28,50) size 0x0
+          RenderText {#text} at (0,54) size 62x18
+            text run at (0,54) width 62: "the break."
index 19bc67871bc2bd92cf920017fe1d5b5283a9c6c4..d5023b9e6f7de8689ca70c2c74b1653036de6167 100644 (file)
@@ -1,3 +1,18 @@
+2007-11-06  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=15838
+          Incomplete repaint toggling "How you know this person" on Facebook
+
+        Test: fast/repaint/make-children-non-inline.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::makeChildrenNonInline): Repaint the block. This
+        is needed because the inline children may be repositioned as they move
+        into new anonymous blocks, but those blocks have no knowledge of where
+        their children used to be, so they cannot invalidate those areas.
+
 2007-11-06  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Darin.
index 771f675993c92d443fe5be81abb34b58bc7e100f..a9cabf803757b5acb88886a5d33c861068a6278f 100644 (file)
@@ -288,9 +288,11 @@ void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
 
     m_childrenInline = false;
 
-    deleteLineBoxTree();
-
     RenderObject *child = firstChild();
+    if (!child)
+        return;
+
+    deleteLineBoxTree();
 
     while (child) {
         RenderObject *inlineRunStart, *inlineRunEnd;
@@ -317,6 +319,8 @@ void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
     for (RenderObject *c = firstChild(); c; c = c->nextSibling())
         ASSERT(!c->isInline());
 #endif
+
+    repaint();
 }
 
 void RenderBlock::removeChild(RenderObject *oldChild)