[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

mitz at apple.com mitz at apple.com
Thu Apr 8 01:13:21 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 1d4e953f1ec4e945b1d833e25b358d8f14e67089
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 18 20:55:25 2010 +0000

    <rdar://problem/6892207> REGRESSION (Safari 4): Menus at sciencedirect.com push the main article context down the page
    <rdar://problem/7546035> Second right floated image misplacment
    https://bugs.webkit.org/show_bug.cgi?id=33245
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Test: fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html
    
    When the last line of a block contains a line break and there are floats
    after the line break, it is incorrect to put those floats in the last line's
    floats vector (along with floats from before the break). Instead, create
    an additional line box (a TrailingFloatsRootInlineBox) and put those floats
    in its floats vector.
    
    * WebCore.vcproj/WebCore.vcproj: Added TrailingFloatsRootInlineBox.h
    * WebCore.xcodeproj/project.pbxproj: Ditto.
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added an optional
    parameter, which is the highest line to dirty.
    * rendering/RenderBlock.h:
    * rendering/RenderBlockLineLayout.cpp:
    (WebCore::RenderBlock::layoutInlineChildren): Create a TrailingFloatsRootInlineBox
    for the floats occurring after the line break on the last line.
    (WebCore::RenderBlock::determineStartPosition): Prevent dirtying of lines
    above the first dirty line.
    * rendering/TrailingFloatsRootInlineBox.h: Added.
    (WebCore::TrailingFloatsRootInlineBox::TrailingFloatsRootInlineBox): Call
    setHasVirtualHeight().
    (WebCore::TrailingFloatsRootInlineBox::virtualHeight): Return 0.
    
    LayoutTests:
    
    * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html: Added.
    * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.checksum: Added.
    * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.png: Added.
    * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53420 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 578fb02..379bf81 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-18  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/6892207> REGRESSION (Safari 4): Menus at sciencedirect.com push the main article context down the page
+        <rdar://problem/7546035> Second right floated image misplacment
+        https://bugs.webkit.org/show_bug.cgi?id=33245
+
+        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html: Added.
+        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.checksum: Added.
+        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.png: Added.
+        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt: Added.
+
 2010-01-18  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.checksum b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.checksum
new file mode 100644
index 0000000..cffc528
--- /dev/null
+++ b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.checksum
@@ -0,0 +1 @@
+8bde9229c59f21c3ce5b6a046a93d3fd
\ No newline at end of file
diff --git a/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.png b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.png
new file mode 100644
index 0000000..f9ae4b2
Binary files /dev/null and b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.png differ
diff --git a/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt
new file mode 100644
index 0000000..03696b2
--- /dev/null
+++ b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt
@@ -0,0 +1,11 @@
+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
+      RenderImage {IMG} at (0,0) size 100x100
+      RenderBlock {DIV} at (0,0) size 784x100
+        RenderBR {BR} at (100,0) size 0x18
+        RenderImage {IMG} at (0,100) size 100x100
+        RenderText {#text} at (0,0) size 0x0
+      RenderImage {IMG} at (100,100) size 100x100 [bgcolor=#0000FF]
diff --git a/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html
new file mode 100644
index 0000000..69e60c1
--- /dev/null
+++ b/LayoutTests/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html
@@ -0,0 +1,10 @@
+<img style="float: left; width: 100px; height: 100px;">
+<div>
+    <br style="clear: both;">
+    <img style="float: left; width: 100px; height: 100px;">
+</div>
+<img id="target" style="float: left; width: 100px; height: 0; background-color: blue;">
+<script>
+    document.body.offsetTop;
+    document.getElementById("target").style.height = "100px";
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 94e2912..785ac12 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,35 @@
+2010-01-18  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/6892207> REGRESSION (Safari 4): Menus at sciencedirect.com push the main article context down the page
+        <rdar://problem/7546035> Second right floated image misplacment
+        https://bugs.webkit.org/show_bug.cgi?id=33245
+
+        Test: fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html
+
+        When the last line of a block contains a line break and there are floats
+        after the line break, it is incorrect to put those floats in the last line’s
+        floats vector (along with floats from before the break). Instead, create
+        an additional line box (a TrailingFloatsRootInlineBox) and put those floats
+        in its floats vector. 
+
+        * WebCore.vcproj/WebCore.vcproj: Added TrailingFloatsRootInlineBox.h
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added an optional
+        parameter, which is the highest line to dirty.
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::layoutInlineChildren): Create a TrailingFloatsRootInlineBox
+        for the floats occurring after the line break on the last line.
+        (WebCore::RenderBlock::determineStartPosition): Prevent dirtying of lines
+        above the first dirty line.
+        * rendering/TrailingFloatsRootInlineBox.h: Added.
+        (WebCore::TrailingFloatsRootInlineBox::TrailingFloatsRootInlineBox): Call
+        setHasVirtualHeight().
+        (WebCore::TrailingFloatsRootInlineBox::virtualHeight): Return 0.
+
 2010-01-18  Gavin Barraclough  <barraclough at apple.com>
 
         Reviewed by NOBODY (build fix).
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index bc40848..338e88e 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -27799,6 +27799,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\rendering\TrailingFloatsRootInlineBox.h"
+				>
+			</File>
+			<File
 				RelativePath="..\rendering\TransformState.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index b0d8266..9ae4c31 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -5982,6 +5982,7 @@
 		37C28A6710F659CC008C7813 /* TypesettingFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypesettingFeatures.h; sourceTree = "<group>"; };
 		37F818FB0D657606005E1F05 /* WebCoreURLResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreURLResponse.h; sourceTree = "<group>"; };
 		37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponse.mm; sourceTree = "<group>"; };
+		37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrailingFloatsRootInlineBox.h; sourceTree = "<group>"; };
 		41002CCB0F66EDEF009E660D /* ScriptFunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFunctionCall.h; sourceTree = "<group>"; };
 		41002CCC0F66EDEF009E660D /* ScriptFunctionCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptFunctionCall.cpp; sourceTree = "<group>"; };
 		410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageEventCustom.cpp; sourceTree = "<group>"; };
@@ -15640,6 +15641,7 @@
 				A8CFF04C0A154F09000A4234 /* TableLayout.h */,
 				AB014DE10E689A4300E10445 /* TextControlInnerElements.cpp */,
 				AB014DE20E689A4300E10445 /* TextControlInnerElements.h */,
+				37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */,
 				0F500AB00F54DB3100EEF928 /* TransformState.cpp */,
 				0F500AAE0F54DB1B00EEF928 /* TransformState.h */,
 			);
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 7a2ff9c..265c358 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
  *           (C) 2007 David Smith (catfish.man at gmail.com)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -2928,7 +2928,7 @@ RenderBlock::rightBottom()
     return bottom;
 }
 
-void RenderBlock::markLinesDirtyInVerticalRange(int top, int bottom)
+void RenderBlock::markLinesDirtyInVerticalRange(int top, int bottom, RootInlineBox* highest)
 {
     if (top >= bottom)
         return;
@@ -2940,7 +2940,7 @@ void RenderBlock::markLinesDirtyInVerticalRange(int top, int bottom)
         lowestDirtyLine = lowestDirtyLine->prevRootBox();
     }
 
-    while (afterLowest && afterLowest->blockHeight() >= top) {
+    while (afterLowest && afterLowest != highest && afterLowest->blockHeight() >= top) {
         afterLowest->markDirty();
         afterLowest = afterLowest->prevRootBox();
     }
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 51a7ac0..89e9a0a 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
  *           (C) 2007 David Smith (catfish.man at gmail.com)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -34,7 +34,6 @@ namespace WebCore {
 
 class InlineIterator;
 class RenderInline;
-class RootInlineBox;
 
 struct BidiRun;
 
@@ -356,7 +355,7 @@ private:
     void adjustPointToColumnContents(IntPoint&) const;
     void adjustForBorderFit(int x, int& left, int& right) const; // Helper function for borderFitAdjust
 
-    void markLinesDirtyInVerticalRange(int top, int bottom);
+    void markLinesDirtyInVerticalRange(int top, int bottom, RootInlineBox* highest = 0);
 
     void newLine(EClear);
 
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 12dfcb1..066ad8d 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000 Lars Knoll (knoll at kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009 Apple Inc. All right reserved.
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right reserved.
  * Copyright (C) 2010 Google Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -30,6 +30,7 @@
 #include "RenderInline.h"
 #include "RenderListMarker.h"
 #include "RenderView.h"
+#include "TrailingFloatsRootInlineBox.h"
 #include "break_lines.h"
 #include <wtf/AlwaysInline.h>
 #include <wtf/RefCountedLeakCounter.h>
@@ -1125,6 +1126,13 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
             // In case we have a float on the last line, it might not be positioned up to now.
             // This has to be done before adding in the bottom border/padding, or the float will
             // include the padding incorrectly. -dwh
+            if (checkForFloatsFromLastLine) {
+                TrailingFloatsRootInlineBox* trailingFloatsLineBox = new (renderArena()) TrailingFloatsRootInlineBox(this);
+                m_lineBoxes.appendLineBox(trailingFloatsLineBox);
+                trailingFloatsLineBox->setConstructed();
+                trailingFloatsLineBox->verticallyAlignBoxes(height());
+                trailingFloatsLineBox->setBlockHeight(height());
+            }
             if (lastFloat) {
                 for (FloatingObject* f = m_floatingObjects->last(); f != lastFloat; f = m_floatingObjects->prev()) {
                 }
@@ -1187,7 +1195,7 @@ RootInlineBox* RenderBlock::determineStartPosition(bool& firstLine, bool& fullLa
                     if (floats[floatIndex].rect.size() != newSize) {
                         int floatTop = floats[floatIndex].rect.y();
                         curr->markDirty();
-                        markLinesDirtyInVerticalRange(curr->blockHeight(), floatTop + max(floats[floatIndex].rect.height(), newSize.height()));
+                        markLinesDirtyInVerticalRange(curr->blockHeight(), floatTop + max(floats[floatIndex].rect.height(), newSize.height()), curr);
                         floats[floatIndex].rect.setSize(newSize);
                         dirtiedByFloat = true;
                     }
diff --git a/WebCore/rendering/TrailingFloatsRootInlineBox.h b/WebCore/rendering/TrailingFloatsRootInlineBox.h
new file mode 100644
index 0000000..9ceff10
--- /dev/null
+++ b/WebCore/rendering/TrailingFloatsRootInlineBox.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TrailingFloatsRootInlineBox_h
+#define TrailingFloatsRootInlineBox_h
+
+#include "RootInlineBox.h"
+
+namespace WebCore {
+
+class TrailingFloatsRootInlineBox : public RootInlineBox {
+public:
+    TrailingFloatsRootInlineBox(RenderObject* obj) : RootInlineBox(obj)
+    {
+        setHasVirtualHeight();
+    }
+
+    virtual int virtualHeight() const { return 0; }
+};
+
+} // namespace WebCore
+
+#endif // TrailingFloatsRootInlineBox_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list