2010-05-13 Yoshiki Hayashi <yhayashi@google.com>
authorhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 09:43:14 +0000 (09:43 +0000)
committerhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 09:43:14 +0000 (09:43 +0000)
        Reviewed by Darin Adler.

        Fix a bug in handleRunInChild where only the first child run-in block
        is inserted because removeChildNode clears next sibling.
        https://bugs.webkit.org/show_bug.cgi?id=25047

        * fast/css/run-in-children-expected.txt: Added.
        * fast/css/run-in-children.html: Added.
2010-05-13  Yoshiki Hayashi  <yhayashi@google.com>

        Reviewed by Darin Adler.

        Fix a bug in handleRunInChild where only the first child run-in block
        is inserted because removeChildNode clears next sibling.
        https://bugs.webkit.org/show_bug.cgi?id=25047

        Test: fast/css/run-in-children.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::handleRunInChild):

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

LayoutTests/ChangeLog
LayoutTests/fast/css/run-in-children-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/run-in-children.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index 6c79af318a1987de2480bdad109be894ce5a5976..49eddaf977f6e176de060cc6331627b9ba20f8a9 100644 (file)
@@ -1,3 +1,14 @@
+2010-05-13  Yoshiki Hayashi  <yhayashi@google.com>
+
+        Reviewed by Darin Adler.
+
+        Fix a bug in handleRunInChild where only the first child run-in block
+        is inserted because removeChildNode clears next sibling.
+        https://bugs.webkit.org/show_bug.cgi?id=25047
+
+        * fast/css/run-in-children-expected.txt: Added.
+        * fast/css/run-in-children.html: Added.
+
 2010-05-13  Fumitoshi Ukai  <ukai@chromium.org>
 
         Unreviewed.
diff --git a/LayoutTests/fast/css/run-in-children-expected.txt b/LayoutTests/fast/css/run-in-children-expected.txt
new file mode 100644 (file)
index 0000000..3ec0b95
--- /dev/null
@@ -0,0 +1,4 @@
+This tests if all children in run-in block will be displayed.
+
+foobar
+foo
diff --git a/LayoutTests/fast/css/run-in-children.html b/LayoutTests/fast/css/run-in-children.html
new file mode 100644 (file)
index 0000000..0de9ffb
--- /dev/null
@@ -0,0 +1,7 @@
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+<p> This tests if all children in run-in block will be displayed.</p>
+
+<p style="display: run-in;"><span>foo</span>bar</p><p>foo</p>
index 8e76bf62e3bcee6a0c65af2392f548b33ea19477..426ef778ef6fc5e2d1fbb8091f2810d4521e9b7f 100644 (file)
@@ -1,3 +1,16 @@
+2010-05-13  Yoshiki Hayashi  <yhayashi@google.com>
+
+        Reviewed by Darin Adler.
+
+        Fix a bug in handleRunInChild where only the first child run-in block
+        is inserted because removeChildNode clears next sibling.
+        https://bugs.webkit.org/show_bug.cgi?id=25047
+
+        Test: fast/css/run-in-children.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::handleRunInChild):
+
 2010-05-13  Alejandro G. Castro  <alex@igalia.com>
 
         Reviewed by Xan Lopez.
index d7d4975e3635c5f8f4f66c794aa7d7fcca7805fd..c09cd34d13d17c30a986b90d6dd3f4718a4844d5 100644 (file)
@@ -976,11 +976,13 @@ bool RenderBlock::handleRunInChild(RenderBox* child)
 
     // Move the nodes from the old child to the new child, but skip any :before/:after content.  It has already
     // been regenerated by the new inline.
-    for (RenderObject* runInChild = blockRunIn->firstChild(); runInChild; runInChild = runInChild->nextSibling()) {
+    for (RenderObject* runInChild = blockRunIn->firstChild(); runInChild;) {
+        RenderObject* nextSibling = runInChild->nextSibling();
         if (runInIsGenerated || (runInChild->style()->styleType() != BEFORE && runInChild->style()->styleType() != AFTER)) {
             blockRunIn->children()->removeChildNode(blockRunIn, runInChild, false);
             inlineRunIn->addChild(runInChild); // Use addChild instead of appendChildNode since it handles correct placement of the children relative to :after-generated content.
         }
+        runInChild = nextSibling;
     }
 
     // Now insert the new child under |currBlock|.