diff options
Diffstat (limited to 'WebCore/rendering/style/RenderStyle.cpp')
-rw-r--r-- | WebCore/rendering/style/RenderStyle.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index a6e7d59..0ea3673 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -1332,6 +1332,36 @@ Length RenderStyle::marginEndUsing(const RenderStyle* otherStyle) const return otherStyle->isLeftToRightDirection() ? marginBottom() : marginTop(); } +void RenderStyle::setMarginStart(Length margin) +{ + if (isHorizontalWritingMode()) { + if (isLeftToRightDirection()) + setMarginLeft(margin); + else + setMarginRight(margin); + } else { + if (isLeftToRightDirection()) + setMarginTop(margin); + else + setMarginBottom(margin); + } +} + +void RenderStyle::setMarginEnd(Length margin) +{ + if (isHorizontalWritingMode()) { + if (isLeftToRightDirection()) + setMarginRight(margin); + else + setMarginLeft(margin); + } else { + if (isLeftToRightDirection()) + setMarginBottom(margin); + else + setMarginTop(margin); + } +} + Length RenderStyle::paddingBefore() const { switch (writingMode()) { |