[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 14:14:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 60100f95db74ca874a78b40509af061dfa1e9673
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 5 20:01:00 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=47199
    
    Reviewed by Anders Carlsson.
    
    Make float positioning work in block layout with block children.
    It doesn't work yet from inside line layout, since line layout is unpatched.
    
    Added fast/blockflow/floats-in-block-layout.html
    
    WebCore:
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::adjustFloatingBlock):
    (WebCore::RenderBlock::setLogicalLeftForChild):
    (WebCore::RenderBlock::setLogicalTopForChild):
    (WebCore::RenderBlock::insertFloatingObject):
    (WebCore::RenderBlock::positionNewFloats):
    (WebCore::RenderBlock::logicalLeftOffsetForLine):
    (WebCore::RenderBlock::logicalRightOffsetForLine):
    * rendering/RenderBlock.h:
    (WebCore::RenderBlock::FloatingObject::type):
    (WebCore::RenderBlock::FloatingObject::renderer):
    (WebCore::RenderBlock::logicalRightForFloat):
    (WebCore::RenderBlock::setLogicalTopForFloat):
    (WebCore::RenderBlock::setLogicalLeftForFloat):
    (WebCore::RenderBlock::setLogicalHeightForFloat):
    (WebCore::RenderBlock::setLogicalWidthForFloat):
    
    LayoutTests:
    
    * fast/blockflow/floats-in-block-layout.html: Added.
    * platform/mac/fast/blockflow/floats-in-block-layout-expected.checksum: Added.
    * platform/mac/fast/blockflow/floats-in-block-layout-expected.png: Added.
    * platform/mac/fast/blockflow/floats-in-block-layout-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69136 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5db5318..dfc28cc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-05  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=47199
+        
+        Make float positioning work in block layout with block children.
+        It doesn't work yet from inside line layout, since line layout is unpatched.
+
+        Added fast/blockflow/floats-in-block-layout.html
+
+        * fast/blockflow/floats-in-block-layout.html: Added.
+        * platform/mac/fast/blockflow/floats-in-block-layout-expected.checksum: Added.
+        * platform/mac/fast/blockflow/floats-in-block-layout-expected.png: Added.
+        * platform/mac/fast/blockflow/floats-in-block-layout-expected.txt: Added.
+
 2010-10-05  Robert Hogan  <robert at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/LayoutTests/fast/blockflow/floats-in-block-layout.html b/LayoutTests/fast/blockflow/floats-in-block-layout.html
new file mode 100644
index 0000000..8e2188f
--- /dev/null
+++ b/LayoutTests/fast/blockflow/floats-in-block-layout.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+<body style="-webkit-writing-mode:tb-lr; writing-mode:tb-lr;">
+<div style="width:100px; background-color:yellow"></div>
+<div style="float:left;width:100px;height:100px;background-color:green; margin-top:10px;"></div>
+<div style="float:right;width:100px;height:100px;background-color:green; margin-bottom:10px"></div>
+<div style="clear:left; float:left;width:100px;height:100px;background-color:purple; margin-top:10px"></div>
+<div style="clear:right; float:right;width:100px;height:100px;background-color:purple; margin-bottom:10px"></div>
+</div>
diff --git a/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.checksum
new file mode 100644
index 0000000..79d3855
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.checksum
@@ -0,0 +1 @@
+1065aea2806575911d9f1d1e6d0d9bde
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.png b/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.png
new file mode 100644
index 0000000..c25fc7c
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.txt b/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.txt
new file mode 100644
index 0000000..84c9672
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/floats-in-block-layout-expected.txt
@@ -0,0 +1,10 @@
+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 300x584
+      RenderBlock {DIV} at (0,0) size 100x584 [bgcolor=#FFFF00]
+      RenderBlock (floating) {DIV} at (100,10) size 100x100 [bgcolor=#008000]
+      RenderBlock (floating) {DIV} at (100,474) size 100x100 [bgcolor=#008000]
+      RenderBlock (floating) {DIV} at (200,10) size 100x100 [bgcolor=#800080]
+      RenderBlock (floating) {DIV} at (200,474) size 100x100 [bgcolor=#800080]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e71c92b..a7f5f81 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,31 @@
+2010-10-05  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=47199
+        
+        Make float positioning work in block layout with block children.
+        It doesn't work yet from inside line layout, since line layout is unpatched.
+
+        Added fast/blockflow/floats-in-block-layout.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::adjustFloatingBlock):
+        (WebCore::RenderBlock::setLogicalLeftForChild):
+        (WebCore::RenderBlock::setLogicalTopForChild):
+        (WebCore::RenderBlock::insertFloatingObject):
+        (WebCore::RenderBlock::positionNewFloats):
+        (WebCore::RenderBlock::logicalLeftOffsetForLine):
+        (WebCore::RenderBlock::logicalRightOffsetForLine):
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::FloatingObject::type):
+        (WebCore::RenderBlock::FloatingObject::renderer):
+        (WebCore::RenderBlock::logicalRightForFloat):
+        (WebCore::RenderBlock::setLogicalTopForFloat):
+        (WebCore::RenderBlock::setLogicalLeftForFloat):
+        (WebCore::RenderBlock::setLogicalHeightForFloat):
+        (WebCore::RenderBlock::setLogicalWidthForFloat):
+
 2010-10-05  Kimmo Kinnunen  <kimmo.t.kinnunen at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 71b5be7..5c1111f 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -1370,9 +1370,9 @@ void RenderBlock::adjustFloatingBlock(const MarginInfo& marginInfo)
     // http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/046.html for
     // an example of this scenario.
     int marginOffset = marginInfo.canCollapseWithMarginBefore() ? 0 : marginInfo.margin();
-    setLogicalHeight(height() + marginOffset);
+    setLogicalHeight(logicalHeight() + marginOffset);
     positionNewFloats();
-    setLogicalHeight(height() - marginOffset);
+    setLogicalHeight(logicalHeight() - marginOffset);
 }
 
 bool RenderBlock::handleSpecialChild(RenderBox* child, const MarginInfo& marginInfo)
@@ -1720,22 +1720,26 @@ void RenderBlock::handleAfterSideOfBlock(int beforeSide, int afterSide, MarginIn
 void RenderBlock::setLogicalLeftForChild(RenderBox* child, int logicalLeft)
 {
     if (style()->isVerticalBlockFlow()) {
-        view()->addLayoutDelta(IntSize(child->x() - logicalLeft, 0));
-        child->setLocation(logicalLeft, child->y());
+        if (!child->isFloatingOrPositioned())
+            view()->addLayoutDelta(IntSize(child->x() - logicalLeft, 0));
+        child->setX(logicalLeft);
     } else {
-        view()->addLayoutDelta(IntSize(0, child->y() - logicalLeft));
-        child->setLocation(child->x(), logicalLeft);
+        if (!child->isFloatingOrPositioned())
+            view()->addLayoutDelta(IntSize(0, child->y() - logicalLeft));
+        child->setY(logicalLeft);
     }
 }
 
 void RenderBlock::setLogicalTopForChild(RenderBox* child, int logicalTop)
 {
     if (style()->isVerticalBlockFlow()) {
-        view()->addLayoutDelta(IntSize(0, child->y() - logicalTop));
-        child->setLocation(child->x(), logicalTop);
+        if (!child->isFloatingOrPositioned())
+            view()->addLayoutDelta(IntSize(0, child->y() - logicalTop));
+        child->setY(logicalTop);
     } else {
-        view()->addLayoutDelta(IntSize(child->x() - logicalTop, 0));
-        child->setLocation(logicalTop, child->y());
+        if (!child->isFloatingOrPositioned())
+            view()->addLayoutDelta(IntSize(child->x() - logicalTop, 0));
+        child->setX(logicalTop);
     }
 }
 
@@ -2075,7 +2079,7 @@ void RenderBlock::repaintOverhangingFloats(bool paintAllDescendants)
             // Only repaint the object if it is overhanging, is not in its own layer, and
             // is our responsibility to paint (m_shouldPaint is set). When paintAllDescendants is true, the latter
             // condition is replaced with being a descendant of us.
-            if (r->bottom() > height() && ((paintAllDescendants && r->m_renderer->isDescendantOf(this)) || r->m_shouldPaint) && !r->m_renderer->hasSelfPaintingLayer()) {
+            if (logicalBottomForFloat(r) > logicalHeight() && ((paintAllDescendants && r->m_renderer->isDescendantOf(this)) || r->m_shouldPaint) && !r->m_renderer->hasSelfPaintingLayer()) {
                 r->m_renderer->repaint();
                 r->m_renderer->repaintOverhangingFloats();
             }
@@ -2931,13 +2935,13 @@ RenderBlock::FloatingObject* RenderBlock::insertFloatingObject(RenderBox* o)
     // Our location is irrelevant if we're unsplittable or no pagination is in effect.
     // Just go ahead and lay out the float.
     bool affectedByPagination = o->isRenderBlock() && view()->layoutState()->m_pageHeight;
-    if (!affectedByPagination)
+    if (!affectedByPagination || isBlockFlowRoot()) // We are unsplittable if we're a block flow root.
         o->layoutIfNeeded();
     else {
         o->computeLogicalWidth();
         o->computeBlockDirectionMargins(this);
     }
-    newObj->setWidth(o->width() + o->marginLeft() + o->marginRight());
+    setLogicalWidthForFloat(newObj, logicalWidthForChild(o) + marginStartForChild(o) + marginEndForChild(o));
 
     newObj->m_shouldPaint = !o->hasSelfPaintingLayer(); // If a layer exists, the float will paint itself.  Otherwise someone else will.
     newObj->m_isDescendant = true;
@@ -2988,10 +2992,10 @@ bool RenderBlock::positionNewFloats()
     if (!m_floatingObjects)
         return false;
     
-    FloatingObject* f = m_floatingObjects->last();
+    FloatingObject* floatingObject = m_floatingObjects->last();
 
     // If all floats have already been positioned, then we have no work to do.
-    if (!f || f->isPlaced())
+    if (!floatingObject || floatingObject->isPlaced())
         return false;
 
     // Move backwards through our floating object list until we find a float that has
@@ -2999,102 +3003,107 @@ bool RenderBlock::positionNewFloats()
     // the new floats that need it.
     FloatingObject* lastFloat = m_floatingObjects->getPrev();
     while (lastFloat && !lastFloat->isPlaced()) {
-        f = m_floatingObjects->prev();
+        floatingObject = m_floatingObjects->prev();
         lastFloat = m_floatingObjects->getPrev();
     }
 
-    int y = height();
+    int logicalTop = logicalHeight();
     
-    // The float cannot start above the y position of the last positioned float.
+    // The float cannot start above the top position of the last positioned float.
     if (lastFloat)
-        y = max(lastFloat->top(), y);
+        logicalTop = max(logicalTopForFloat(lastFloat), logicalTop);
 
     // Now walk through the set of unpositioned floats and place them.
-    while (f) {
+    while (floatingObject) {
         // The containing block is responsible for positioning floats, so if we have floats in our
         // list that come from somewhere else, do not attempt to position them.
-        if (f->m_renderer->containingBlock() != this) {
-            f = m_floatingObjects->next();
+        if (floatingObject->renderer()->containingBlock() != this) {
+            floatingObject = m_floatingObjects->next();
             continue;
         }
 
-        RenderBox* o = f->m_renderer;
+        RenderBox* childBox = floatingObject->renderer();
+        int childLogicalLeftMargin = style()->isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
 
-        int ro = logicalRightOffsetForContent(); // Constant part of right offset.
-        int lo = logicalLeftOffsetForContent(); // Constant part of left offset.
-        int fwidth = f->width(); // The width we look for.
-        if (ro - lo < fwidth)
-            fwidth = ro - lo; // Never look for more than what will be available.
+        int rightOffset = logicalRightOffsetForContent(); // Constant part of right offset.
+        int leftOffset = logicalLeftOffsetForContent(); // Constant part of left offset.
+        int floatLogicalWidth = logicalWidthForFloat(floatingObject); // The width we look for.
+        if (rightOffset - leftOffset < floatLogicalWidth)
+            floatLogicalWidth = rightOffset - leftOffset; // Never look for more than what will be available.
         
-        IntRect oldRect(o->x(), o->y() , o->width(), o->height());
+        IntRect oldRect(childBox->x(), childBox->y() , childBox->width(), childBox->height());
 
-        if (o->style()->clear() & CLEFT)
-            y = max(lowestFloatLogicalBottom(FloatingObject::FloatLeft), y);
-        if (o->style()->clear() & CRIGHT)
-            y = max(lowestFloatLogicalBottom(FloatingObject::FloatRight), y);
+        if (childBox->style()->clear() & CLEFT)
+            logicalTop = max(lowestFloatLogicalBottom(FloatingObject::FloatLeft), logicalTop);
+        if (childBox->style()->clear() & CRIGHT)
+            logicalTop = max(lowestFloatLogicalBottom(FloatingObject::FloatRight), logicalTop);
 
-        if (o->style()->floating() == FLEFT) {
+        int floatLogicalLeft;
+        if (childBox->style()->floating() == FLEFT) {
             int heightRemainingLeft = 1;
             int heightRemainingRight = 1;
-            int fx = logicalLeftOffsetForLine(y, lo, false, &heightRemainingLeft);
-            while (logicalRightOffsetForLine(y, ro, false, &heightRemainingRight)-fx < fwidth) {
-                y += min(heightRemainingLeft, heightRemainingRight);
-                fx = logicalLeftOffsetForLine(y, lo, false, &heightRemainingLeft);
+            floatLogicalLeft = logicalLeftOffsetForLine(logicalTop, leftOffset, false, &heightRemainingLeft);
+            while (logicalRightOffsetForLine(logicalTop, rightOffset, false, &heightRemainingRight) - floatLogicalLeft < floatLogicalWidth) {
+                logicalTop += min(heightRemainingLeft, heightRemainingRight);
+                floatLogicalLeft = logicalLeftOffsetForLine(logicalTop, leftOffset, false, &heightRemainingLeft);
             }
-            fx = max(0, fx);
-            f->setLeft(fx);
-            o->setLocation(fx + o->marginLeft(), y + o->marginTop());
+            floatLogicalLeft = max(0, floatLogicalLeft);
         } else {
             int heightRemainingLeft = 1;
             int heightRemainingRight = 1;
-            int fx = logicalRightOffsetForLine(y, ro, false, &heightRemainingRight);
-            while (fx - logicalLeftOffsetForLine(y, lo, false, &heightRemainingLeft) < fwidth) {
-                y += min(heightRemainingLeft, heightRemainingRight);
-                fx = logicalRightOffsetForLine(y, ro, false, &heightRemainingRight);
+            floatLogicalLeft = logicalRightOffsetForLine(logicalTop, rightOffset, false, &heightRemainingRight);
+            while (floatLogicalLeft - logicalLeftOffsetForLine(logicalTop, leftOffset, false, &heightRemainingLeft) < floatLogicalWidth) {
+                logicalTop += min(heightRemainingLeft, heightRemainingRight);
+                floatLogicalLeft = logicalRightOffsetForLine(logicalTop, rightOffset, false, &heightRemainingRight);
             }
-            f->setLeft(fx - f->width());
-            o->setLocation(fx - o->marginRight() - o->width(), y + o->marginTop());
+            floatLogicalLeft -= logicalWidthForFloat(floatingObject); // Use the original width of the float here, since the local variable
+                                                                      // |floatLogicalWidth| was capped to the available line width.
+                                                                      // See fast/block/float/clamped-right-float.html.
         }
+        
+        setLogicalLeftForFloat(floatingObject, floatLogicalLeft);
+        setLogicalLeftForChild(childBox, floatLogicalLeft + childLogicalLeftMargin);
+        setLogicalTopForChild(childBox, logicalTop + marginBeforeForChild(childBox));
 
         if (view()->layoutState()->isPaginated()) {
-            RenderBlock* childBlock = o->isRenderBlock() ? toRenderBlock(o) : 0;
+            RenderBlock* childBlock = childBox->isRenderBlock() ? toRenderBlock(childBox) : 0;
 
-            if (childBlock && view()->layoutState()->m_pageHeight && view()->layoutState()->pageY(o->y()) != childBlock->pageY())
+            if (childBlock && view()->layoutState()->m_pageHeight && view()->layoutState()->pageY(childBox->y()) != childBlock->pageY())
                 childBlock->markForPaginationRelayout();
-            o->layoutIfNeeded();
+            childBox->layoutIfNeeded();
 
             // If we are unsplittable and don't fit, then we need to move down.
             // We include our margins as part of the unsplittable area.
-            int newY = adjustForUnsplittableChild(o, y, true);
+            int newLogicalTop = adjustForUnsplittableChild(childBox, logicalTop, true);
             
             // See if we have a pagination strut that is making us move down further.
             // Note that an unsplittable child can't also have a pagination strut, so this is
             // exclusive with the case above.
             if (childBlock && childBlock->paginationStrut()) {
-                newY += childBlock->paginationStrut();
+                newLogicalTop += childBlock->paginationStrut();
                 childBlock->setPaginationStrut(0);
             }
             
-            if (newY != y) {
-                f->m_paginationStrut = newY - y;
-                y = newY;
-                o->setY(y + o->marginTop());
+            if (newLogicalTop != logicalTop) {
+                floatingObject->m_paginationStrut = newLogicalTop - logicalTop;
+                logicalTop = newLogicalTop;
+                setLogicalTopForChild(childBox, logicalTop + marginBeforeForChild(childBox));
                 if (childBlock)
                     childBlock->setChildNeedsLayout(true, false);
-                o->layoutIfNeeded();
+                childBox->layoutIfNeeded();
             }
         }
 
-        f->setTop(y);
-        f->setHeight(o->marginTop() + o->height() + o->marginBottom());
+        setLogicalTopForFloat(floatingObject, logicalTop);
+        setLogicalHeightForFloat(floatingObject, logicalHeightForChild(childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox));
 
-        f->setIsPlaced();
+        floatingObject->setIsPlaced();
 
         // If the child moved, we have to repaint it.
-        if (o->checkForRepaintDuringLayout())
-            o->repaintDuringLayoutIfMoved(oldRect);
+        if (childBox->checkForRepaintDuringLayout())
+            childBox->repaintDuringLayoutIfMoved(oldRect);
 
-        f = m_floatingObjects->next();
+        floatingObject = m_floatingObjects->next();
     }
     return true;
 }
@@ -3214,7 +3223,7 @@ HashSet<RenderBox*>* RenderBlock::percentHeightDescendants() const
     return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) : 0;
 }
 
-int RenderBlock::logicalLeftOffsetForLine(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
+int RenderBlock::logicalLeftOffsetForLine(int logicalTop, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
 {
     int left = fixedOffset;
     if (m_floatingObjects) {
@@ -3223,12 +3232,12 @@ int RenderBlock::logicalLeftOffsetForLine(int y, int fixedOffset, bool applyText
         FloatingObject* r;
         DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
         for ( ; (r = it.current()); ++it) {
-            if (r->isPlaced() && r->top() <= y && r->bottom() > y
+            if (r->isPlaced() && logicalTopForFloat(r) <= logicalTop && logicalBottomForFloat(r) > logicalTop
                 && r->type() == FloatingObject::FloatLeft
-                && r->right() > left) {
-                left = r->right();
+                && logicalRightForFloat(r) > left) {
+                left = logicalRightForFloat(r);
                 if (heightRemaining)
-                    *heightRemaining = r->bottom() - y;
+                    *heightRemaining = logicalBottomForFloat(r) - logicalTop;
             }
         }
     }
@@ -3243,7 +3252,7 @@ int RenderBlock::logicalLeftOffsetForLine(int y, int fixedOffset, bool applyText
     return left;
 }
 
-int RenderBlock::logicalRightOffsetForLine(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
+int RenderBlock::logicalRightOffsetForLine(int logicalTop, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
 {
     int right = fixedOffset;
 
@@ -3253,12 +3262,12 @@ int RenderBlock::logicalRightOffsetForLine(int y, int fixedOffset, bool applyTex
         FloatingObject* r;
         DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
         for ( ; (r = it.current()); ++it) {
-            if (r->isPlaced() && r->top() <= y && r->bottom() > y
+            if (r->isPlaced() && logicalTopForFloat(r) <= logicalTop && logicalBottomForFloat(r) > logicalTop
                 && r->type() == FloatingObject::FloatRight
-                && r->left() < right) {
-                right = r->left();
+                && logicalLeftForFloat(r) < right) {
+                right = logicalLeftForFloat(r);
                 if (heightRemaining)
-                    *heightRemaining = r->bottom() - y;
+                    *heightRemaining = logicalBottomForFloat(r) - logicalTop;
             }
         }
     }
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index c569c40..864fc89 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -383,8 +383,9 @@ private:
         {
         }
 
-        Type type() { return static_cast<Type>(m_type); }
-
+        Type type() const { return static_cast<Type>(m_type); }
+        RenderBox* renderer() const { return m_renderer; }
+        
         bool isPlaced() const { return m_isPlaced; }
         void setIsPlaced(bool placed = true) { m_isPlaced = placed; }
 
@@ -415,8 +416,37 @@ private:
     int logicalTopForFloat(FloatingObject* child) const { return style()->isVerticalBlockFlow() ? child->top() : child->left(); }
     int logicalBottomForFloat(FloatingObject* child) const { return style()->isVerticalBlockFlow() ? child->bottom() : child->right(); }
     int logicalLeftForFloat(FloatingObject* child) const { return style()->isVerticalBlockFlow() ? child->left() : child->top(); }
+    int logicalRightForFloat(FloatingObject* child) const { return style()->isVerticalBlockFlow() ? child->right() : child->bottom(); }
     int logicalWidthForFloat(FloatingObject* child) const { return style()->isVerticalBlockFlow() ? child->width() : child->height(); }
-    
+    void setLogicalTopForFloat(FloatingObject* child, int logicalTop)
+    {
+        if (style()->isVerticalBlockFlow())
+            child->setTop(logicalTop);
+        else
+            child->setLeft(logicalTop);
+    }
+    void setLogicalLeftForFloat(FloatingObject* child, int logicalLeft)
+    {
+        if (style()->isVerticalBlockFlow())
+            child->setLeft(logicalLeft);
+        else
+            child->setTop(logicalLeft);
+    }
+    void setLogicalHeightForFloat(FloatingObject* child, int logicalHeight)
+    {
+        if (style()->isVerticalBlockFlow())
+            child->setHeight(logicalHeight);
+        else
+            child->setWidth(logicalHeight);
+    }
+    void setLogicalWidthForFloat(FloatingObject* child, int logicalWidth)
+    {
+        if (style()->isVerticalBlockFlow())
+            child->setWidth(logicalWidth);
+        else
+            child->setHeight(logicalWidth);
+    }
+
     // The following functions' implementations are in RenderBlockLineLayout.cpp.
     RootInlineBox* determineStartPosition(bool& firstLine, bool& fullLayout, bool& previousLineBrokeCleanly,
                                           InlineBidiResolver&, Vector<FloatWithRect>& floats, unsigned& numCleanFloats,

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list