[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 13:42:45 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 39cee966d1f2b4f36d0a55d0b3690d8cfd262cf6
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 23 21:47:13 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=46403, convert the margin/border/padding accessors
    to be logical.
    
    Reviewed by Adele Peterson.
    
    * rendering/InlineFlowBox.cpp:
    (WebCore::InlineFlowBox::getFlowSpacingLogicalWidth):
    (WebCore::InlineFlowBox::placeBoxesHorizontally):
    (WebCore::InlineFlowBox::paintBoxShadow):
    (WebCore::InlineFlowBox::paintBoxDecorations):
    (WebCore::InlineFlowBox::paintTextDecorations):
    * rendering/InlineFlowBox.h:
    (WebCore::InlineFlowBox::InlineFlowBox):
    (WebCore::InlineFlowBox::marginBorderPaddingLogicalLeft):
    (WebCore::InlineFlowBox::marginBorderPaddingLogicalRight):
    (WebCore::InlineFlowBox::marginLogicalLeft):
    (WebCore::InlineFlowBox::marginLogicalRight):
    (WebCore::InlineFlowBox::borderLogicalLeft):
    (WebCore::InlineFlowBox::borderLogicalRight):
    (WebCore::InlineFlowBox::paddingLogicalLeft):
    (WebCore::InlineFlowBox::paddingLogicalRight):
    (WebCore::InlineFlowBox::includeLogicalLeftEdge):
    (WebCore::InlineFlowBox::includeLogicalRightEdge):
    (WebCore::InlineFlowBox::setEdges):
    * rendering/RenderBlockLineLayout.cpp:
    (WebCore::RenderBlock::computeHorizontalPositionsForLine):
    * rendering/RenderBox.cpp:
    (WebCore::RenderBox::containingBlockWidthForPositioned):
    (WebCore::RenderBox::calcAbsoluteHorizontalValues):
    (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintFillLayerExtended):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 19546dd..f6d8e48 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,38 @@
+2010-09-23  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Adele Peterson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=46403, convert the margin/border/padding accessors
+        to be logical.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::getFlowSpacingLogicalWidth):
+        (WebCore::InlineFlowBox::placeBoxesHorizontally):
+        (WebCore::InlineFlowBox::paintBoxShadow):
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+        (WebCore::InlineFlowBox::paintTextDecorations):
+        * rendering/InlineFlowBox.h:
+        (WebCore::InlineFlowBox::InlineFlowBox):
+        (WebCore::InlineFlowBox::marginBorderPaddingLogicalLeft):
+        (WebCore::InlineFlowBox::marginBorderPaddingLogicalRight):
+        (WebCore::InlineFlowBox::marginLogicalLeft):
+        (WebCore::InlineFlowBox::marginLogicalRight):
+        (WebCore::InlineFlowBox::borderLogicalLeft):
+        (WebCore::InlineFlowBox::borderLogicalRight):
+        (WebCore::InlineFlowBox::paddingLogicalLeft):
+        (WebCore::InlineFlowBox::paddingLogicalRight):
+        (WebCore::InlineFlowBox::includeLogicalLeftEdge):
+        (WebCore::InlineFlowBox::includeLogicalRightEdge):
+        (WebCore::InlineFlowBox::setEdges):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::computeHorizontalPositionsForLine):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::containingBlockWidthForPositioned):
+        (WebCore::RenderBox::calcAbsoluteHorizontalValues):
+        (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
 2010-09-23  Jeff Schiller  <jeffschiller at google.com>
 
         Reviewed by David Hyatt.
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index a3e3207..e645206 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -53,12 +53,12 @@ InlineFlowBox::~InlineFlowBox()
 
 #endif
 
-int InlineFlowBox::getFlowSpacingWidth()
+int InlineFlowBox::getFlowSpacingLogicalWidth()
 {
-    int totWidth = marginBorderPaddingLeft() + marginBorderPaddingRight();
+    int totWidth = marginBorderPaddingLogicalLeft() + marginBorderPaddingLogicalRight();
     for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
         if (curr->isInlineFlowBox())
-            totWidth += static_cast<InlineFlowBox*>(curr)->getFlowSpacingWidth();
+            totWidth += static_cast<InlineFlowBox*>(curr)->getFlowSpacingLogicalWidth();
     }
     return totWidth;
 }
@@ -270,7 +270,7 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
     leftVisualOverflow = min(xPos + boxShadowLeft, leftVisualOverflow);
 
     int startX = xPos;
-    xPos += borderLeft() + paddingLeft();
+    xPos += borderLogicalLeft() + paddingLogicalLeft();
     
     for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
         if (curr->renderer()->isText()) {
@@ -320,9 +320,9 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
             }
             if (curr->renderer()->isRenderInline()) {
                 InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr);
-                xPos += flow->marginLeft();
+                xPos += flow->marginLogicalLeft();
                 xPos = flow->placeBoxesHorizontally(xPos, needsWordSpacing, textBoxDataMap);
-                xPos += flow->marginRight();
+                xPos += flow->marginLogicalRight();
                 leftLayoutOverflow = min(leftLayoutOverflow, flow->leftLayoutOverflow());
                 rightLayoutOverflow = max(rightLayoutOverflow, flow->rightLayoutOverflow());
                 leftVisualOverflow = min(leftVisualOverflow, flow->leftVisualOverflow());
@@ -346,7 +346,7 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
         }
     }
 
-    xPos += borderRight() + paddingRight();
+    xPos += borderLogicalRight() + paddingLogicalRight();
     setLogicalWidth(xPos - startX);
     rightVisualOverflow = max(x() + logicalWidth() + boxShadowRight, rightVisualOverflow);
     rightLayoutOverflow = max(x() + logicalWidth(), rightLayoutOverflow);
@@ -747,7 +747,7 @@ void InlineFlowBox::paintBoxShadow(GraphicsContext* context, RenderStyle* s, Sha
     else {
         // FIXME: We can do better here in the multi-line case. We want to push a clip so that the shadow doesn't
         // protrude incorrectly at the edges, and we want to possibly include shadows cast from the previous/following lines
-        boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s, shadowStyle, includeLeftEdge(), includeRightEdge());
+        boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s, shadowStyle, includeLogicalLeftEdge(), includeLogicalRightEdge());
     }
 }
 
@@ -801,7 +801,7 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
             // The simple case is where we either have no border image or we are the only box for this object.  In those
             // cases only a single call to draw is required.
             if (!hasBorderImage || (!prevLineBox() && !nextLineBox()))
-                boxModelObject()->paintBorder(context, tx, ty, w, h, renderer()->style(), includeLeftEdge(), includeRightEdge());
+                boxModelObject()->paintBorder(context, tx, ty, w, h, renderer()->style(), includeLogicalLeftEdge(), includeLogicalRightEdge());
             else {
                 // We have a border image that spans multiple lines.
                 // We need to adjust _tx and _ty by the width of all previous lines.
@@ -939,8 +939,8 @@ void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, b
     if (deco != TDNONE && 
         ((!paintedChildren && ((deco & UNDERLINE) || (deco & OVERLINE))) || (paintedChildren && (deco & LINE_THROUGH))) &&
         shouldDrawTextDecoration(renderer())) {
-        int x = m_x + borderLeft() + paddingLeft();
-        int w = m_logicalWidth - (borderLeft() + paddingLeft() + borderRight() + paddingRight());
+        int x = m_x + borderLogicalLeft() + paddingLogicalLeft();
+        int w = m_logicalWidth - (borderLogicalLeft() + paddingLogicalLeft() + borderLogicalRight() + paddingLogicalRight());
         RootInlineBox* rootLine = root();
         if (rootLine->ellipsisBox()) {
             int ellipsisX = m_x + rootLine->ellipsisBox()->x();
@@ -978,7 +978,7 @@ void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, b
         }
 
         // We must have child boxes and have decorations defined.
-        tx += borderLeft() + paddingLeft();
+        tx += borderLogicalLeft() + paddingLogicalLeft();
 
         Color underline, overline, linethrough;
         underline = overline = linethrough = styleToUse->visitedDependentColor(CSSPropertyColor);
@@ -996,7 +996,7 @@ void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, b
 
         int baselinePos = renderer()->style(m_firstLine)->font().ascent();
         if (!isRootInlineBox())
-            baselinePos += borderTop() + paddingTop();
+            baselinePos += boxModelObject()->borderTop() + boxModelObject()->paddingTop();
 
         bool setClip = false;
         int extraOffset = 0;
diff --git a/WebCore/rendering/InlineFlowBox.h b/WebCore/rendering/InlineFlowBox.h
index 454d298..0be8d4c 100644
--- a/WebCore/rendering/InlineFlowBox.h
+++ b/WebCore/rendering/InlineFlowBox.h
@@ -41,8 +41,8 @@ public:
         , m_lastChild(0)
         , m_prevLineBox(0)
         , m_nextLineBox(0)
-        , m_includeLeftEdge(false)
-        , m_includeRightEdge(false)
+        , m_includeLogicalLeftEdge(false)
+        , m_includeLogicalRightEdge(false)
 #ifndef NDEBUG
         , m_hasBadChildList(false)
 #endif
@@ -102,30 +102,57 @@ public:
 
     virtual RenderLineBoxList* rendererLineBoxes() const;
 
-    int marginBorderPaddingLeft() const { return marginLeft() + borderLeft() + paddingLeft(); }
-    int marginBorderPaddingRight() const { return marginRight() + borderRight() + paddingRight(); }
-    int marginLeft() const { if (includeLeftEdge()) return boxModelObject()->marginLeft(); return 0; }
-    int marginRight() const { if (includeRightEdge()) return boxModelObject()->marginRight(); return 0; }
-    int borderLeft() const { if (includeLeftEdge()) return renderer()->style()->borderLeftWidth(); return 0; }
-    int borderRight() const { if (includeRightEdge()) return renderer()->style()->borderRightWidth(); return 0; }
-    int borderTop() const { return renderer()->style()->borderTopWidth(); }
-    int borderBottom() const { return renderer()->style()->borderBottomWidth(); }
-    int paddingLeft() const { if (includeLeftEdge()) return boxModelObject()->paddingLeft(); return 0; }
-    int paddingRight() const { if (includeRightEdge()) return boxModelObject()->paddingRight(); return 0; }
-    int paddingTop() const { return boxModelObject()->paddingTop(); }
-    int paddingBottom() const { return boxModelObject()->paddingBottom(); }
-
-    bool includeLeftEdge() const { return m_includeLeftEdge; }
-    bool includeRightEdge() const { return m_includeRightEdge; }
+    // logicalLeft = left in a horizontal line and top in a vertical line.
+    int marginBorderPaddingLogicalLeft() const { return marginLogicalLeft() + borderLogicalLeft() + paddingLogicalLeft(); }
+    int marginBorderPaddingLogicalRight() const { return marginLogicalRight() + borderLogicalRight() + paddingLogicalRight(); }
+    int marginLogicalLeft() const
+    {
+        if (!includeLogicalLeftEdge())
+            return 0;
+        return !isVertical() ? boxModelObject()->marginLeft() : boxModelObject()->marginTop();
+    }
+    int marginLogicalRight() const
+    {
+        if (!includeLogicalRightEdge())
+            return 0;
+        return !isVertical() ? boxModelObject()->marginRight() : boxModelObject()->marginBottom();
+    }
+    int borderLogicalLeft() const
+    {
+        if (!includeLogicalLeftEdge())
+            return 0;
+        return !isVertical() ? renderer()->style()->borderLeftWidth() : renderer()->style()->borderTopWidth();
+    }
+    int borderLogicalRight() const
+    {
+        if (!includeLogicalRightEdge())
+            return 0;
+        return !isVertical() ? renderer()->style()->borderRightWidth() : renderer()->style()->borderBottomWidth();
+    }
+    int paddingLogicalLeft() const
+    {
+        if (!includeLogicalLeftEdge())
+            return 0;
+        return !isVertical() ? boxModelObject()->paddingLeft() : boxModelObject()->paddingTop();
+    }
+    int paddingLogicalRight() const
+    {
+        if (!includeLogicalRightEdge())
+            return 0;
+        return !isVertical() ? boxModelObject()->paddingRight() : boxModelObject()->paddingBottom();
+    }
+
+    bool includeLogicalLeftEdge() const { return m_includeLogicalLeftEdge; }
+    bool includeLogicalRightEdge() const { return m_includeLogicalRightEdge; }
     void setEdges(bool includeLeft, bool includeRight)
     {
-        m_includeLeftEdge = includeLeft;
-        m_includeRightEdge = includeRight;
+        m_includeLogicalLeftEdge = includeLeft;
+        m_includeLogicalRightEdge = includeRight;
     }
 
     // Helper functions used during line construction and placement.
     void determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject);
-    int getFlowSpacingWidth();
+    int getFlowSpacingLogicalWidth();
     bool onEndChain(RenderObject* endObject);
     int placeBoxesHorizontally(int x, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
     void computeLogicalBoxHeights(int& maxPositionTop, int& maxPositionBottom,
@@ -179,8 +206,8 @@ protected:
     InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderObject
     InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject
 
-    bool m_includeLeftEdge : 1;
-    bool m_includeRightEdge : 1;
+    bool m_includeLogicalLeftEdge : 1;
+    bool m_includeLogicalRightEdge : 1;
     bool m_hasTextChildren : 1;
 
 #ifndef NDEBUG
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index e103bd2..fc94323 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -324,7 +324,7 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
 {
     // First determine our total width.
     int availableWidth = lineWidth(height(), firstLine);
-    int totWidth = lineBox->getFlowSpacingWidth();
+    int totWidth = lineBox->getFlowSpacingLogicalWidth();
     bool needsWordSpacing = false;
     unsigned numSpaces = 0;
     ETextAlign textAlign = style()->textAlign();
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index 5c1489a..67f474e 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -1855,11 +1855,11 @@ int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* con
     int fromLeft;
     int fromRight;
     if (containingBlock->style()->direction() == LTR) {
-        fromLeft = first->x() + first->borderLeft();
-        fromRight = last->x() + last->logicalWidth() - last->borderRight();
+        fromLeft = first->logicalLeft() + first->borderLogicalLeft();
+        fromRight = last->logicalLeft() + last->logicalWidth() - last->borderLogicalRight();
     } else {
-        fromRight = first->x() + first->logicalWidth() - first->borderRight();
-        fromLeft = last->x() + last->borderLeft();
+        fromRight = first->logicalLeft() + first->logicalWidth() - first->borderLogicalRight();
+        fromLeft = last->logicalLeft() + last->borderLogicalLeft();
     }
 
     return max(0, (fromRight - fromLeft));
@@ -2201,7 +2201,7 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
         InlineFlowBox* firstLine = flow->firstLineBox();
         InlineFlowBox* lastLine = flow->lastLineBox();
         if (firstLine && lastLine && firstLine != lastLine) {
-            xPos = leftValue + marginLeftValue + lastLine->borderLeft() + (lastLine->x() - firstLine->x());
+            xPos = leftValue + marginLeftValue + lastLine->borderLogicalLeft() + (lastLine->x() - firstLine->x());
             return;
         }
     }
@@ -2607,7 +2607,7 @@ void RenderBox::calcAbsoluteHorizontalReplaced()
         InlineFlowBox* firstLine = flow->firstLineBox();
         InlineFlowBox* lastLine = flow->lastLineBox();
         if (firstLine && lastLine && firstLine != lastLine) {
-            m_frameRect.setX(leftValue + m_marginLeft + lastLine->borderLeft() + (lastLine->x() - firstLine->x()));
+            m_frameRect.setX(leftValue + m_marginLeft + lastLine->borderLogicalLeft() + (lastLine->x() - firstLine->x()));
             return;
         }
     }
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index d987060..5faa73f 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -505,8 +505,8 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
     if (context->paintingDisabled())
         return;
 
-    bool includeLeftEdge = box ? box->includeLeftEdge() : true;
-    bool includeRightEdge = box ? box->includeRightEdge() : true;
+    bool includeLeftEdge = box ? box->includeLogicalLeftEdge() : true;
+    bool includeRightEdge = box ? box->includeLogicalRightEdge() : true;
     int bLeft = includeLeftEdge ? borderLeft() : 0;
     int bRight = includeRightEdge ? borderRight() : 0;
     int pLeft = includeLeftEdge ? paddingLeft() : 0;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list