[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.2.2-27-g91dab87

Gustavo Noronha Silva gns at gnome.org
Thu Jul 15 21:13:14 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e13c814f3bf4150d934c1fa475cdbce085115173
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 18 20:33:17 2010 +0000

    WebCore: <rdar://problem/7761400> Rework the fix for
    https://bugs.webkit.org/show_bug.cgi?id=18722
    
    Reviewed by Darin Adler.
    
    Test: fast/dynamic/float-remove-above-line-2.html
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::removeFloatingObject): Treat 0- and less-than-0-height floats
    as having a height of 1 so that they intersect with the line they originate on.
    (WebCore::RenderBlock::clearFloats): Use numeric_limits.
    * rendering/RenderBlockLineLayout.cpp:
    (WebCore::RenderBlock::layoutInlineChildren): Removed the intersection checks here,
    so that a float is always included in the float list of the line it originates on, even
    if it does not intersect that line. This ensures that every float is accounted for, which
    is necessary during incremental layout when adding floats from clean lines.
    
    LayoutTests: Additional test for <rdar://problem/7761400>
    
    Reviewed by Darin Adler.
    
    * fast/dynamic/float-remove-above-line-2.html: Copied from LayoutTests/fast/dynamic/float-remove-above-line.html.
    * fast/dynamic/float-remove-above-line-expected.txt: Updated.
    * fast/dynamic/float-remove-above-line.html: Fixed inconsequential typo in end tag.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7153855..45855eb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-18  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Additional test for <rdar://problem/7761400>
+
+        * fast/dynamic/float-remove-above-line-2.html: Copied from LayoutTests/fast/dynamic/float-remove-above-line.html.
+        * fast/dynamic/float-remove-above-line-expected.txt: Updated.
+        * fast/dynamic/float-remove-above-line.html: Fixed inconsequential typo in end tag.
+
 2010-03-19  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/dynamic/float-remove-above-line-2.html b/LayoutTests/fast/dynamic/float-remove-above-line-2.html
new file mode 100644
index 0000000..558fa86
--- /dev/null
+++ b/LayoutTests/fast/dynamic/float-remove-above-line-2.html
@@ -0,0 +1,20 @@
+<p>
+    Another test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=18722">https://bugs.webkit.org/show_bug.cgi?id=18722</a>
+    Webkit Nightly Build crashes when visiting i has a hotdog</i>.
+</p>
+<p>
+    The test passes if it does not crash.
+</p>
+<div>
+    foo<br><div id="float-1" style="float: left;"></div><br>
+    <div id="float-2" style="float: right;"></div>
+</div>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    document.body.offsetTop;
+    document.getElementById("float-1").style.display = "none";
+    document.body.offsetTop;
+    document.getElementById("float-2").style.display = "none";
+</script>
diff --git a/LayoutTests/fast/dynamic/float-remove-above-line-expected.txt b/LayoutTests/fast/dynamic/float-remove-above-line-expected.txt
index 72dccf8..effc8d0 100644
--- a/LayoutTests/fast/dynamic/float-remove-above-line-expected.txt
+++ b/LayoutTests/fast/dynamic/float-remove-above-line-expected.txt
@@ -4,4 +4,3 @@ The test passes if it does not crash.
 
 foo
 bar
-
diff --git a/LayoutTests/fast/dynamic/float-remove-above-line.html b/LayoutTests/fast/dynamic/float-remove-above-line.html
index f871186..940b9b5 100644
--- a/LayoutTests/fast/dynamic/float-remove-above-line.html
+++ b/LayoutTests/fast/dynamic/float-remove-above-line.html
@@ -8,7 +8,7 @@
 <div>
     foo<br>bar
     <div id="float" style="float: right; height: 10px; width: 10px; background-color: lightblue; margin-top: -10px;"></div>
-<div>
+</div>
 <script>
     if (window.layoutTestController)
         layoutTestController.dumpAsText();
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e956ee2..ec14f8a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-03-18  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7761400> Rework the fix for
+        https://bugs.webkit.org/show_bug.cgi?id=18722
+
+        Test: fast/dynamic/float-remove-above-line-2.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::removeFloatingObject): Treat 0- and less-than-0-height floats
+        as having a height of 1 so that they intersect with the line they originate on.
+        (WebCore::RenderBlock::clearFloats): Use numeric_limits.
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::layoutInlineChildren): Removed the intersection checks here,
+        so that a float is always included in the float list of the line it originates on, even
+        if it does not intersect that line. This ensures that every float is accounted for, which
+        is necessary during incremental layout when adding floats from clean lines.
+
 2010-03-19  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 4a7363d..ce34444 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -2358,8 +2358,14 @@ void RenderBlock::removeFloatingObject(RenderBox* o)
         DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
         while (it.current()) {
             if (it.current()->m_renderer == o) {
-                if (childrenInline())
-                    markLinesDirtyInVerticalRange(0, it.current()->m_bottom);
+                if (childrenInline()) {
+                    int bottom = it.current()->m_bottom;
+                    // Special-case zero- and less-than-zero-height floats: those don't touch
+                    // the line that they're on, but it still needs to be dirtied. This is
+                    // accomplished by pretending they have a height of 1.
+                    bottom = max(bottom, it.current()->m_top + 1);
+                    markLinesDirtyInVerticalRange(0, bottom);
+                }
                 m_floatingObjects->removeRef(it.current());
             }
             ++it;
@@ -3010,8 +3016,8 @@ void RenderBlock::clearFloats()
         addIntrudingFloats(block, xoffset, offset);
 
     if (childrenInline()) {
-        int changeTop = INT_MAX;
-        int changeBottom = INT_MIN;
+        int changeTop = numeric_limits<int>::max();
+        int changeBottom = numeric_limits<int>::min();
         if (m_floatingObjects) {
             for (FloatingObject* f = m_floatingObjects->first(); f; f = m_floatingObjects->next()) {
                 FloatingObject* oldFloatingObject = floatMap.get(f->m_renderer);
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 191b24a..6e89060 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -646,7 +646,6 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
         bool endLineMatched = false;
         bool checkForEndLineMatch = endLine;
         bool checkForFloatsFromLastLine = false;
-        int lastHeight = height();
 
         bool isLineEmpty = true;
 
@@ -771,8 +770,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
                 } else
                     m_floatingObjects->first();
                 for (FloatingObject* f = m_floatingObjects->current(); f; f = m_floatingObjects->next()) {
-                    if (f->m_bottom > lastHeight)
-                        lastRootBox()->floats().append(f->m_renderer);
+                    lastRootBox()->floats().append(f->m_renderer);
                     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))
@@ -782,7 +780,6 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
                 lastFloat = m_floatingObjects->last();
             }
 
-            lastHeight = height();
             lineMidpointState.reset();
             resolver.setPosition(end);
         }
@@ -842,10 +839,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
                 m_floatingObjects->next();
             } else
                 m_floatingObjects->first();
-            for (FloatingObject* f = m_floatingObjects->current(); f; f = m_floatingObjects->next()) {
-                if (f->m_bottom > lastHeight)
-                    lastRootBox()->floats().append(f->m_renderer);
-            }
+            for (FloatingObject* f = m_floatingObjects->current(); f; f = m_floatingObjects->next())
+                lastRootBox()->floats().append(f->m_renderer);
             lastFloat = m_floatingObjects->last();
         }
         size_t floatCount = floats.size();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list