Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Oct 2004 21:12:06 +0000 (21:12 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Oct 2004 21:12:06 +0000 (21:12 +0000)
it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).

        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::getInlineRun):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_block.cpp

index 8cf7d1d..941dff0 100644 (file)
@@ -1,3 +1,13 @@
+2004-10-21  David Hyatt  <hyatt@apple.com>
+
+       Fix for 3847054, assertion failure in RenderText::layout() on news.com page.  Fix getInlineRun so that
+       it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
+       
+        Reviewed by darin
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::getInlineRun):
+
 2004-10-20  David Hyatt  <hyatt@apple.com>
 
        Add better dumping of overflow information for scrolling regions.
index 0b57401..0c7c612 100644 (file)
@@ -229,22 +229,13 @@ static void getInlineRun(RenderObject* start, RenderObject* stop,
     // is inline or not, we will not include it.  It's as though we encountered
     // a non-inline.
     inlineRunStart = inlineRunEnd = 0;
-
-    // Start by skipping as many non-inlines as we can.
-    RenderObject * curr = start;
-    while (curr && !(curr->isInline() || curr->isFloatingOrPositioned()))
-        curr = curr->nextSibling();
-
-    if (!curr)
-        return; // No more inline children to be found.
-    
-    while (curr && (curr->isInline() || curr->isFloatingOrPositioned()) && (curr != stop)) {
-        if (curr->isInline()) {
-            if (!inlineRunStart)
-                inlineRunStart = curr;
+    for (RenderObject* curr = start;
+         curr && curr != stop && (!inlineRunStart || curr->isInline() || curr->isFloatingOrPositioned());
+         curr = curr->nextSibling()) {
+        if (inlineRunStart)
             inlineRunEnd = curr;
-        }
-        curr = curr->nextSibling();
+        else if (curr->isInline())
+            inlineRunStart = inlineRunEnd = curr;
     }
 }