[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:34:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b36ae2f2de8a4244140a83b7c160e90446fd1d29
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 20 21:35:10 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=46119, add logical accessors to RenderStyle.  Not used by any RenderObjects yet, so no tests
    until then.
    
    Reviewed by Dan Bernstein.
    
    * rendering/style/RenderStyle.cpp:
    (WebCore::RenderStyle::logicalWidth):
    (WebCore::RenderStyle::logicalHeight):
    (WebCore::RenderStyle::logicalMinWidth):
    (WebCore::RenderStyle::logicalMaxWidth):
    (WebCore::RenderStyle::logicalMinHeight):
    (WebCore::RenderStyle::logicalMaxHeight):
    (WebCore::RenderStyle::borderBeforeWidth):
    (WebCore::RenderStyle::borderAfterWidth):
    (WebCore::RenderStyle::borderStartWidth):
    (WebCore::RenderStyle::borderEndWidth):
    (WebCore::RenderStyle::marginBefore):
    (WebCore::RenderStyle::marginAfter):
    (WebCore::RenderStyle::marginStart):
    (WebCore::RenderStyle::marginEnd):
    (WebCore::RenderStyle::paddingBefore):
    (WebCore::RenderStyle::paddingAfter):
    (WebCore::RenderStyle::paddingStart):
    (WebCore::RenderStyle::paddingEnd):
    * rendering/style/RenderStyle.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67884 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 11a6b6d..22f561e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,34 @@
 
         Reviewed by Dan Bernstein.
 
+        https://bugs.webkit.org/show_bug.cgi?id=46119, add logical accessors to RenderStyle.  Not used by any RenderObjects yet, so no tests
+        until then.
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::logicalWidth):
+        (WebCore::RenderStyle::logicalHeight):
+        (WebCore::RenderStyle::logicalMinWidth):
+        (WebCore::RenderStyle::logicalMaxWidth):
+        (WebCore::RenderStyle::logicalMinHeight):
+        (WebCore::RenderStyle::logicalMaxHeight):
+        (WebCore::RenderStyle::borderBeforeWidth):
+        (WebCore::RenderStyle::borderAfterWidth):
+        (WebCore::RenderStyle::borderStartWidth):
+        (WebCore::RenderStyle::borderEndWidth):
+        (WebCore::RenderStyle::marginBefore):
+        (WebCore::RenderStyle::marginAfter):
+        (WebCore::RenderStyle::marginStart):
+        (WebCore::RenderStyle::marginEnd):
+        (WebCore::RenderStyle::paddingBefore):
+        (WebCore::RenderStyle::paddingAfter):
+        (WebCore::RenderStyle::paddingStart):
+        (WebCore::RenderStyle::paddingEnd):
+        * rendering/style/RenderStyle.h:
+
+2010-09-20  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
         https://bugs.webkit.org/show_bug.cgi?id=46116, implement block-flow-aware logical properties.
         
         This patch adds all the logical properties from the CSS3 Writing Mode draft for margins, padding, border,
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index 4930a13..a35f172 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -1064,4 +1064,184 @@ const Color RenderStyle::visitedDependentColor(int colorProperty) const
     return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha());
 }
 
+Length RenderStyle::logicalWidth() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return width();
+    return height();
+}
+
+Length RenderStyle::logicalHeight() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return height();
+    return width();
+}
+
+Length RenderStyle::logicalMinWidth() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return minWidth();
+    return minHeight();
+}
+
+Length RenderStyle::logicalMaxWidth() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return maxWidth();
+    return maxHeight();
+}
+
+Length RenderStyle::logicalMinHeight() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return minHeight();
+    return minWidth();
+}
+
+Length RenderStyle::logicalMaxHeight() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return maxHeight();
+    return maxWidth();
+}
+
+unsigned short RenderStyle::borderBeforeWidth() const
+{
+    switch (blockFlow()) {
+    case TopToBottomBlockFlow:
+        return borderTopWidth();
+    case BottomToTopBlockFlow:
+        return borderBottomWidth();
+    case LeftToRightBlockFlow:
+        return borderLeftWidth();
+    case RightToLeftBlockFlow:
+        return borderRightWidth();
+    }
+    ASSERT_NOT_REACHED();
+    return borderTopWidth();
+}
+
+unsigned short RenderStyle::borderAfterWidth() const
+{
+    switch (blockFlow()) {
+    case TopToBottomBlockFlow:
+        return borderBottomWidth();
+    case BottomToTopBlockFlow:
+        return borderTopWidth();
+    case LeftToRightBlockFlow:
+        return borderRightWidth();
+    case RightToLeftBlockFlow:
+        return borderLeftWidth();
+    }
+    ASSERT_NOT_REACHED();
+    return borderBottomWidth();
+}
+
+unsigned short RenderStyle::borderStartWidth() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return direction() == LTR ? borderLeftWidth() : borderRightWidth();
+    return direction() == LTR ? borderTopWidth() : borderBottomWidth();
+}
+
+unsigned short RenderStyle::borderEndWidth() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return direction() == LTR ? borderRightWidth() : borderLeftWidth();
+    return direction() == LTR ? borderBottomWidth() : borderTopWidth();
+}
+    
+Length RenderStyle::marginBefore() const
+{
+    switch (blockFlow()) {
+    case TopToBottomBlockFlow:
+        return marginTop();
+    case BottomToTopBlockFlow:
+        return marginBottom();
+    case LeftToRightBlockFlow:
+        return marginLeft();
+    case RightToLeftBlockFlow:
+        return marginRight();
+    }
+    ASSERT_NOT_REACHED();
+    return marginTop();
+}
+
+Length RenderStyle::marginAfter() const
+{
+    switch (blockFlow()) {
+    case TopToBottomBlockFlow:
+        return marginBottom();
+    case BottomToTopBlockFlow:
+        return marginTop();
+    case LeftToRightBlockFlow:
+        return marginRight();
+    case RightToLeftBlockFlow:
+        return marginLeft();
+    }
+    ASSERT_NOT_REACHED();
+    return marginBottom();
+}
+
+Length RenderStyle::marginStart() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return direction() == LTR ? marginLeft() : marginRight();
+    return direction() == LTR ? marginTop() : marginBottom();
+}
+
+Length RenderStyle::marginEnd() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return direction() == LTR ? marginRight() : marginLeft();
+    return direction() == LTR ? marginBottom() : marginTop();
+}
+    
+Length RenderStyle::paddingBefore() const
+{
+    switch (blockFlow()) {
+    case TopToBottomBlockFlow:
+        return paddingTop();
+    case BottomToTopBlockFlow:
+        return paddingBottom();
+    case LeftToRightBlockFlow:
+        return paddingLeft();
+    case RightToLeftBlockFlow:
+        return paddingRight();
+    }
+    ASSERT_NOT_REACHED();
+    return paddingTop();
+}
+
+Length RenderStyle::paddingAfter() const
+{
+    switch (blockFlow()) {
+    case TopToBottomBlockFlow:
+        return paddingBottom();
+    case BottomToTopBlockFlow:
+        return paddingTop();
+    case LeftToRightBlockFlow:
+        return paddingRight();
+    case RightToLeftBlockFlow:
+        return paddingLeft();
+    }
+    ASSERT_NOT_REACHED();
+    return paddingBottom();
+}
+
+Length RenderStyle::paddingStart() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return direction() == LTR ? paddingLeft() : paddingRight();
+    return direction() == LTR ? paddingTop() : paddingBottom();
+}
+
+Length RenderStyle::paddingEnd() const
+{
+    if (blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow)
+        return direction() == LTR ? paddingRight() : paddingLeft();
+    return direction() == LTR ? paddingBottom() : paddingTop();
+}
+
 } // namespace WebCore
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index cf344dc..b4aaf86 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -390,6 +390,13 @@ public:
     Length maxWidth() const { return m_box->maxWidth(); }
     Length minHeight() const { return m_box->minHeight(); }
     Length maxHeight() const { return m_box->maxHeight(); }
+    
+    Length logicalWidth() const;
+    Length logicalHeight() const;
+    Length logicalMinWidth() const;
+    Length logicalMaxWidth() const;
+    Length logicalMinHeight() const;
+    Length logicalMaxHeight() const;
 
     const BorderData& border() const { return surround->border; }
     const BorderValue& borderLeft() const { return surround->border.left(); }
@@ -417,6 +424,11 @@ public:
     unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); }
     EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
     bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
+    
+    unsigned short borderBeforeWidth() const;
+    unsigned short borderAfterWidth() const;
+    unsigned short borderStartWidth() const;
+    unsigned short borderEndWidth() const;
 
     unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
     unsigned short outlineWidth() const
@@ -582,12 +594,20 @@ public:
     Length marginBottom() const { return surround->margin.bottom(); }
     Length marginLeft() const { return surround->margin.left(); }
     Length marginRight() const { return surround->margin.right(); }
+    Length marginBefore() const;
+    Length marginAfter() const;
+    Length marginStart() const;
+    Length marginEnd() const;
 
     LengthBox paddingBox() const { return surround->padding; }
     Length paddingTop() const { return surround->padding.top(); }
     Length paddingBottom() const { return surround->padding.bottom(); }
     Length paddingLeft() const { return surround->padding.left(); }
     Length paddingRight() const { return surround->padding.right(); }
+    Length paddingBefore() const;
+    Length paddingAfter() const;
+    Length paddingStart() const;
+    Length paddingEnd() const;
 
     ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list