summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderReplaced.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/RenderReplaced.cpp')
-rw-r--r--WebCore/rendering/RenderReplaced.cpp72
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;