2008-03-26 Dan Bernstein <mitz@apple.com>
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Mar 2008 20:53:07 +0000 (20:53 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Mar 2008 20:53:07 +0000 (20:53 +0000)
        Reviewed by Anders Carlsson.

        - fix http://bugs.webkit.org/show_bug.cgi?id=18104
          REGRESSION: LEAK: 2 InlineBox in editing/inserting/12882.html

        * rendering/bidi.cpp:
        (WebCore::RenderBlock::layoutInlineChildren): When deciding to ditch
        old clean lines (due to changed or newly-added floats), keep the
        reference to those lines so they can be properly deleted in the end,
        and use a separate flag to signal that no matching should be attempted.

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

WebCore/ChangeLog
WebCore/rendering/bidi.cpp

index 3ddf0eb..511f649 100644 (file)
@@ -1,3 +1,16 @@
+2008-03-26  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=18104
+          REGRESSION: LEAK: 2 InlineBox in editing/inserting/12882.html
+
+        * rendering/bidi.cpp:
+        (WebCore::RenderBlock::layoutInlineChildren): When deciding to ditch
+        old clean lines (due to changed or newly-added floats), keep the
+        reference to those lines so they can be properly deleted in the end,
+        and use a separate flag to signal that no matching should be attempted.
+
 2008-03-26  Mark Rowe  <mrowe@apple.com>
 
         Speculative Windows build fix.
index 381b9d2..6f1dbb1 100644 (file)
@@ -873,10 +873,11 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
             newLine(lastRootBox()->object()->lastChild()->style()->clear());
 
         bool endLineMatched = false;
+        bool checkForEndLineMatch = endLine;
 
         while (!end.atEnd()) {
             // FIXME: Is this check necessary before the first iteration or can it be moved to the end?
-            if (endLine && (endLineMatched = matchedEndLine(start, cleanLineStart, cleanLineBidiStatus, endLine, endLineYPos, repaintBottom, repaintTop)))
+            if (checkForEndLineMatch && (endLineMatched = matchedEndLine(start, cleanLineStart, cleanLineBidiStatus, endLine, endLineYPos, repaintBottom, repaintTop)))
                 break;
 
             betweenMidpoints = false;
@@ -951,7 +952,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
                     ASSERT(f->m_renderer == floats[floatIndex].object);
                     // If a float's geometry has changed, give up on syncing with clean lines.
                     if (floats[floatIndex].rect != IntRect(f->m_left, f->m_top, f->m_width, f->m_bottom - f->m_top))
-                        endLine = 0;
+                        checkForEndLineMatch = false;
                     floatIndex++;
                 }
                 lastFloat = m_floatingObjects->last();