diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebCore/rendering/RenderReplaced.cpp | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebCore/rendering/RenderReplaced.cpp')
-rw-r--r-- | WebCore/rendering/RenderReplaced.cpp | 72 |
1 files changed, 27 insertions, 45 deletions
diff --git a/WebCore/rendering/RenderReplaced.cpp b/WebCore/rendering/RenderReplaced.cpp index d3b449c..a087038 100644 --- a/WebCore/rendering/RenderReplaced.cpp +++ b/WebCore/rendering/RenderReplaced.cpp @@ -57,13 +57,6 @@ RenderReplaced::~RenderReplaced() { } -void RenderReplaced::setStyle(PassRefPtr<RenderStyle> newStyle) -{ - if (newStyle->blockFlow() != TopToBottomBlockFlow) - newStyle->setBlockFlow(TopToBottomBlockFlow); - RenderBox::setStyle(newStyle); -} - void RenderReplaced::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBox::styleDidChange(diff, oldStyle); @@ -88,8 +81,7 @@ void RenderReplaced::layout() m_overflow.clear(); addShadowOverflow(); - repainter.repaintAfterLayout(); - + repainter.repaintAfterLayout(); setNeedsLayout(false); } @@ -207,54 +199,54 @@ static inline bool lengthIsSpecified(Length length) return lengthType == Fixed || lengthType == Percent; } -int RenderReplaced::computeReplacedWidth(bool includeMaxWidth) const +int RenderReplaced::computeReplacedLogicalWidth(bool includeMaxWidth) const { - int width; + int logicalWidth; if (lengthIsSpecified(style()->width())) - width = computeReplacedWidthUsing(style()->width()); + logicalWidth = computeReplacedLogicalWidthUsing(style()->logicalWidth()); else if (m_hasIntrinsicSize) - width = calcAspectRatioWidth(); + logicalWidth = calcAspectRatioLogicalWidth(); else - width = intrinsicSize().width(); + logicalWidth = intrinsicLogicalWidth(); - int minW = computeReplacedWidthUsing(style()->minWidth()); - int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : computeReplacedWidthUsing(style()->maxWidth()); + int minLogicalWidth = computeReplacedLogicalWidthUsing(style()->logicalMinWidth()); + int maxLogicalWidth = !includeMaxWidth || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth()); - return max(minW, min(width, maxW)); + return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth)); } -int RenderReplaced::computeReplacedHeight() const +int RenderReplaced::computeReplacedLogicalHeight() const { - int height; - if (lengthIsSpecified(style()->height())) - height = computeReplacedHeightUsing(style()->height()); + int logicalHeight; + if (lengthIsSpecified(style()->logicalHeight())) + logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight()); else if (m_hasIntrinsicSize) - height = calcAspectRatioHeight(); + logicalHeight = calcAspectRatioLogicalHeight(); else - height = intrinsicSize().height(); + logicalHeight = intrinsicLogicalHeight(); - int minH = computeReplacedHeightUsing(style()->minHeight()); - int maxH = style()->maxHeight().isUndefined() ? height : computeReplacedHeightUsing(style()->maxHeight()); + int minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight()); + int maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight()); - return max(minH, min(height, maxH)); + return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight)); } -int RenderReplaced::calcAspectRatioWidth() const +int RenderReplaced::calcAspectRatioLogicalWidth() const { - int intrinsicWidth = intrinsicSize().width(); - int intrinsicHeight = intrinsicSize().height(); + int intrinsicWidth = intrinsicLogicalWidth(); + int intrinsicHeight = intrinsicLogicalHeight(); if (!intrinsicHeight) return 0; - return RenderBox::computeReplacedHeight() * intrinsicWidth / intrinsicHeight; + return RenderBox::computeReplacedLogicalHeight() * intrinsicWidth / intrinsicHeight; } -int RenderReplaced::calcAspectRatioHeight() const +int RenderReplaced::calcAspectRatioLogicalHeight() const { - int intrinsicWidth = intrinsicSize().width(); - int intrinsicHeight = intrinsicSize().height(); + int intrinsicWidth = intrinsicLogicalWidth(); + int intrinsicHeight = intrinsicLogicalHeight(); if (!intrinsicWidth) return 0; - return RenderBox::computeReplacedWidth() * intrinsicHeight / intrinsicWidth; + return RenderBox::computeReplacedLogicalWidth() * intrinsicHeight / intrinsicWidth; } void RenderReplaced::computePreferredLogicalWidths() @@ -262,7 +254,7 @@ void RenderReplaced::computePreferredLogicalWidths() ASSERT(preferredLogicalWidthsDirty()); int borderAndPadding = borderAndPaddingWidth(); - m_maxPreferredLogicalWidth = computeReplacedWidth(false) + borderAndPadding; + m_maxPreferredLogicalWidth = computeReplacedLogicalWidth(false) + borderAndPadding; if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0)); @@ -277,16 +269,6 @@ void RenderReplaced::computePreferredLogicalWidths() setPreferredLogicalWidthsDirty(false); } -int RenderReplaced::lineHeight(bool, bool) const -{ - return height() + marginTop() + marginBottom(); -} - -int RenderReplaced::baselinePosition(bool, bool) const -{ - return height() + marginTop() + marginBottom(); -} - unsigned RenderReplaced::caretMaxRenderedOffset() const { return 1; |