[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:23:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0415e5d1b5638be9588438c2ac880838896ced0f
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 7 17:40:25 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=47357
    
    Reviewed by Dan Bernstein.
    
    Make findNextLineBreak and some of the helper functions it also calls writing-mode-aware.
    
    * rendering/InlineFlowBox.cpp:
    (WebCore::InlineFlowBox::computeLogicalBoxHeights):
    (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::positionNewFloatOnLine):
    * rendering/RenderBlockLineLayout.cpp:
    (WebCore::getBorderPaddingMargin):
    (WebCore::inlineLogicalWidth):
    (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
    (WebCore::inlineFlowRequiresLineBox):
    (WebCore::RenderBlock::skipLeadingWhitespace):
    (WebCore::RenderBlock::fitBelowFloats):
    (WebCore::RenderBlock::findNextLineBreak):
    * rendering/RenderBoxModelObject.h:
    (WebCore::RenderBoxModelObject::hasInlineDirectionBordersPaddingOrMargin):
    (WebCore::RenderBoxModelObject::hasInlineDirectionBordersOrPadding):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69319 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8acb50e..bf09c2d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-10-07  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=47357
+        
+        Make findNextLineBreak and some of the helper functions it also calls writing-mode-aware.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::computeLogicalBoxHeights):
+        (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::positionNewFloatOnLine):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::getBorderPaddingMargin):
+        (WebCore::inlineLogicalWidth):
+        (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
+        (WebCore::inlineFlowRequiresLineBox):
+        (WebCore::RenderBlock::skipLeadingWhitespace):
+        (WebCore::RenderBlock::fitBelowFloats):
+        (WebCore::RenderBlock::findNextLineBreak):
+        * rendering/RenderBoxModelObject.h:
+        (WebCore::RenderBoxModelObject::hasInlineDirectionBordersPaddingOrMargin):
+        (WebCore::RenderBoxModelObject::hasInlineDirectionBordersOrPadding):
+
 2010-10-07  Luiz Agostini  <luiz.agostini at openbossa.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index 53ddf5b..5436b25 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -462,7 +462,7 @@ void InlineFlowBox::computeLogicalBoxHeights(int& maxPositionTop, int& maxPositi
         } else if (curr->y() == PositionBottom) {
             if (maxPositionBottom < lineHeight)
                 maxPositionBottom = lineHeight;
-        } else if ((!isInlineFlow || static_cast<InlineFlowBox*>(curr)->hasTextChildren()) || curr->boxModelObject()->hasHorizontalBordersOrPadding() || strictMode) {
+        } else if ((!isInlineFlow || static_cast<InlineFlowBox*>(curr)->hasTextChildren()) || curr->boxModelObject()->hasInlineDirectionBordersOrPadding() || strictMode) {
             int ascent = baseline - curr->y();
             int descent = lineHeight - ascent;
             if (maxAscent < ascent)
@@ -497,7 +497,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(int yPos, int maxHeight, int maxA
         else if (curr->y() == PositionBottom)
             curr->setY(yPos + maxHeight - curr->lineHeight(false));
         else {
-            if ((isInlineFlow && !static_cast<InlineFlowBox*>(curr)->hasTextChildren()) && !curr->boxModelObject()->hasHorizontalBordersOrPadding() && !strictMode)
+            if ((isInlineFlow && !static_cast<InlineFlowBox*>(curr)->hasTextChildren()) && !curr->boxModelObject()->hasInlineDirectionBordersOrPadding() && !strictMode)
                 childAffectsTopBottomPos = false;
             int posAdjust = maxAscent - curr->baselinePosition(false);
             curr->setY(curr->y() + yPos + posAdjust);
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 23f3081..6eff96e 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3120,29 +3120,29 @@ bool RenderBlock::positionNewFloatOnLine(FloatingObject* newFloat, FloatingObjec
     if (!didPosition || !newFloat->m_paginationStrut)
         return didPosition;
     
-    int floatTop = newFloat->top();
+    int floatLogicalTop = logicalTopForFloat(newFloat);
     int paginationStrut = newFloat->m_paginationStrut;
     FloatingObject* f = m_floatingObjects->last();
     
     ASSERT(f == newFloat);
 
-    if (floatTop - paginationStrut != height())
+    if (floatLogicalTop - paginationStrut != logicalHeight())
         return didPosition;
 
     for (f = m_floatingObjects->prev(); f && f != lastFloatFromPreviousLine; f = m_floatingObjects->prev()) {
-        if (f->top() == height()) {
+        if (logicalTopForFloat(f) == logicalHeight()) {
             ASSERT(!f->m_paginationStrut);
             f->m_paginationStrut = paginationStrut;
             RenderBox* o = f->m_renderer;
-            o->setY(o->y() + o->marginTop() + paginationStrut);
+            setLogicalTopForChild(o, logicalTopForChild(o) + marginBeforeForChild(o) + paginationStrut);
             if (o->isRenderBlock())
                 toRenderBlock(o)->setChildNeedsLayout(true, false);
             o->layoutIfNeeded();
-            f->setTop(f->top() + f->m_paginationStrut);
+            setLogicalTopForFloat(f, logicalTopForFloat(f) + f->m_paginationStrut);
         }
     }
         
-    setLogicalHeight(height() + paginationStrut);
+    setLogicalHeight(logicalHeight() + paginationStrut);
     
     return didPosition;
 }
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 9fd7b1b..ff473a7 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -57,13 +57,12 @@ const unsigned cMaxLineDepth = 200;
 
 static int getBorderPaddingMargin(RenderBoxModelObject* child, bool endOfInline)
 {
-    bool leftSide = (child->style()->isLeftToRightDirection()) ? !endOfInline : endOfInline;
-    if (leftSide)
-        return child->marginLeft() + child->paddingLeft() + child->borderLeft();
-    return child->marginRight() + child->paddingRight() + child->borderRight();
+    if (endOfInline)
+        return child->marginEnd() + child->paddingEnd() + child->borderEnd();
+    return child->marginStart() + child->paddingStart() + child->borderStart();
 }
 
-static int inlineWidth(RenderObject* child, bool start = true, bool end = true)
+static int inlineLogicalWidth(RenderObject* child, bool start = true, bool end = true)
 {
     unsigned lineDepth = 1;
     int extraWidth = 0;
@@ -296,7 +295,7 @@ RootInlineBox* RenderBlock::constructLine(unsigned runCount, BidiRun* firstRun,
 void RenderBlock::computeInlineDirectionPositionsForLine(RootInlineBox* lineBox, bool firstLine, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
 {
     // First determine our total width.
-    int availableWidth = availableLogicalWidthForLine(height(), firstLine);
+    int availableWidth = availableLogicalWidthForLine(logicalHeight(), firstLine);
     int totWidth = lineBox->getFlowSpacingLogicalWidth();
     bool needsWordSpacing = false;
     unsigned numSpaces = 0;
@@ -1203,7 +1202,7 @@ static bool inlineFlowRequiresLineBox(RenderInline* flow)
     // FIXME: Right now, we only allow line boxes for inlines that are truly empty.
     // We need to fix this, though, because at the very least, inlines containing only
     // ignorable whitespace should should also have line boxes. 
-    return !flow->firstChild() && flow->hasHorizontalBordersPaddingOrMargin();
+    return !flow->firstChild() && flow->hasInlineDirectionBordersPaddingOrMargin();
 }
 
 bool RenderBlock::requiresLineBox(const InlineIterator& it, bool isLineEmpty, bool previousLineBrokeCleanly)
@@ -1275,12 +1274,12 @@ void RenderBlock::skipTrailingWhitespace(InlineIterator& iterator, bool isLineEm
 int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly,
                                        FloatingObject* lastFloatFromPreviousLine)
 {
-    int availableWidth = availableLogicalWidthForLine(height(), firstLine);
+    int availableWidth = availableLogicalWidthForLine(logicalHeight(), firstLine);
     while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), isLineEmpty, previousLineBrokeCleanly)) {
         RenderObject* object = resolver.position().obj;
         if (object->isFloating()) {
             positionNewFloatOnLine(insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine);
-            availableWidth = availableLogicalWidthForLine(height(), firstLine);
+            availableWidth = availableLogicalWidthForLine(logicalHeight(), firstLine);
         } else if (object->isPositioned()) {
             // FIXME: The math here is actually not really right.  It's a best-guess approximation that
             // will work for the common cases
@@ -1332,7 +1331,7 @@ void RenderBlock::fitBelowFloats(int widthToFit, bool firstLine, int& availableW
     ASSERT(widthToFit > availableWidth);
 
     int floatLogicalBottom;
-    int lastFloatLogicalBottom = height();
+    int lastFloatLogicalBottom = logicalHeight();
     int newLineWidth = availableWidth;
     while (true) {
         floatLogicalBottom = nextFloatLogicalBottomBelow(lastFloatLogicalBottom);
@@ -1437,7 +1436,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
     // Firefox and Opera will allow a table cell to grow to fit an image inside it under
     // very specific circumstances (in order to match common WinIE renderings). 
     // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.) 
-    bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()->width().isIntrinsicOrAuto();
+    bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()->logicalWidth().isIntrinsicOrAuto();
 
     EWhiteSpace currWS = style()->whiteSpace();
     EWhiteSpace lastWS = currWS;
@@ -1487,9 +1486,9 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
                 // check if it fits in the current line.
                 // If it does, position it now, otherwise, position
                 // it after moving to next line (in newLine() func)
-                if (floatsFitOnLine && floatBox->width() + floatBox->marginLeft() + floatBox->marginRight() + w + tmpW <= width) {
+                if (floatsFitOnLine && logicalWidthForFloat(f) + w + tmpW <= width) {
                     positionNewFloatOnLine(f, lastFloatFromPreviousLine);
-                    width = availableLogicalWidthForLine(height(), firstLine);
+                    width = availableLogicalWidthForLine(logicalHeight(), firstLine);
                 } else
                     floatsFitOnLine = false;
             } else if (o->isPositioned()) {
@@ -1557,8 +1556,8 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
                 }
             }
 
-            tmpW += flowBox->marginLeft() + flowBox->borderLeft() + flowBox->paddingLeft() +
-                    flowBox->marginRight() + flowBox->borderRight() + flowBox->paddingRight();
+            tmpW += flowBox->marginStart() + flowBox->borderStart() + flowBox->paddingStart() +
+                    flowBox->marginEnd() + flowBox->borderEnd() + flowBox->paddingEnd();
         } else if (o->isReplaced()) {
             RenderBox* replacedBox = toRenderBox(o);
 
@@ -1581,7 +1580,8 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
             trailingSpaceObject = 0;
 
             // Optimize for a common case. If we can't find whitespace after the list
-            // item, then this is all moot. -dwh
+            // item, then this is all moot.
+            int replacedLogicalWidth = logicalWidthForChild(replacedBox) + marginStartForChild(replacedBox) + marginEndForChild(replacedBox) + inlineLogicalWidth(o);
             if (o->isListMarker()) {
                 if (style()->collapseWhiteSpace() && shouldSkipWhitespaceAfterStartObject(this, o, lineMidpointState)) {
                     // Like with inline flows, we start ignoring spaces to make sure that any 
@@ -1591,9 +1591,9 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
                     ignoringSpaces = true;
                 }
                 if (toRenderListMarker(o)->isInside())
-                    tmpW += replacedBox->width() + replacedBox->marginLeft() + replacedBox->marginRight() + inlineWidth(o);
+                    tmpW += replacedLogicalWidth;
             } else
-                tmpW += replacedBox->width() + replacedBox->marginLeft() + replacedBox->marginRight() + inlineWidth(o);
+                tmpW += replacedLogicalWidth;
         } else if (o->isText()) {
             if (!pos)
                 appliedStartWidth = false;
@@ -1621,7 +1621,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
             // space, then subtract its width.
             int wordTrailingSpaceWidth = f.typesettingFeatures() & Kerning ? f.width(TextRun(&space, 1)) + wordSpacing : 0;
 
-            int wrapW = tmpW + inlineWidth(o, !appliedStartWidth, true);
+            int wrapW = tmpW + inlineLogicalWidth(o, !appliedStartWidth, true);
             int charWidth = 0;
             bool breakNBSP = autoWrap && o->style()->nbspMode() == SPACE;
             // Auto-wrapping text should wrap in the middle of a word only if it could not wrap before the word,
@@ -1705,7 +1705,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
                         additionalTmpW = textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing;
                     tmpW += additionalTmpW;
                     if (!appliedStartWidth) {
-                        tmpW += inlineWidth(o, true, false);
+                        tmpW += inlineLogicalWidth(o, true, false);
                         appliedStartWidth = true;
                     }
                     
@@ -1850,7 +1850,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
             // IMPORTANT: pos is > length here!
             int additionalTmpW = ignoringSpaces ? 0 : textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing;
             tmpW += additionalTmpW;
-            tmpW += inlineWidth(o, !appliedStartWidth, true);
+            tmpW += inlineLogicalWidth(o, !appliedStartWidth, true);
 
             if (canHyphenate && w + tmpW > width) {
                 tryHyphenating(t, f, style->hyphenationLocale(), lastSpace, pos, w + tmpW - additionalTmpW, width, isFixedPitch, collapseWhiteSpace, lastSpaceWordSpacing, lBreak, nextBreakable, hyphenated);
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index 83c9367..08dfd3c 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -98,8 +98,8 @@ public:
     virtual int marginStart() const = 0;
     virtual int marginEnd() const = 0;
 
-    bool hasHorizontalBordersPaddingOrMargin() const { return hasHorizontalBordersOrPadding() || marginLeft() != 0 || marginRight() != 0; }
-    bool hasHorizontalBordersOrPadding() const { return borderLeft() != 0 || borderRight() != 0 || paddingLeft() != 0 || paddingRight() != 0; }
+    bool hasInlineDirectionBordersPaddingOrMargin() const { return hasInlineDirectionBordersOrPadding() || marginStart()|| marginEnd(); }
+    bool hasInlineDirectionBordersOrPadding() const { return borderStart() || borderEnd() || paddingStart()|| paddingEnd(); }
 
     virtual int containingBlockLogicalWidthForContent() const;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list