Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(984)

Unified Diff: Source/core/layout/LayoutReplaced.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutReplaced.h ('k') | Source/core/layout/LayoutReplica.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutReplaced.cpp
diff --git a/Source/core/layout/LayoutReplaced.cpp b/Source/core/layout/LayoutReplaced.cpp
index 35193bc747ab3cc0ce075ace73b63fcad046dd23..59cc89a27c8e4051de4c176a45c66e9c808224d2 100644
--- a/Source/core/layout/LayoutReplaced.cpp
+++ b/Source/core/layout/LayoutReplaced.cpp
@@ -38,14 +38,14 @@ const int LayoutReplaced::defaultWidth = 300;
const int LayoutReplaced::defaultHeight = 150;
LayoutReplaced::LayoutReplaced(Element* element)
- : RenderBox(element)
+ : LayoutBox(element)
, m_intrinsicSize(defaultWidth, defaultHeight)
{
setReplaced(true);
}
LayoutReplaced::LayoutReplaced(Element* element, const LayoutSize& intrinsicSize)
- : RenderBox(element)
+ : LayoutBox(element)
, m_intrinsicSize(intrinsicSize)
{
setReplaced(true);
@@ -60,12 +60,12 @@ void LayoutReplaced::willBeDestroyed()
if (!documentBeingDestroyed() && parent())
parent()->dirtyLinesFromChangedChild(this);
- RenderBox::willBeDestroyed();
+ LayoutBox::willBeDestroyed();
}
void LayoutReplaced::styleDidChange(StyleDifference diff, const LayoutStyle* oldStyle)
{
- RenderBox::styleDidChange(diff, oldStyle);
+ LayoutBox::styleDidChange(diff, oldStyle);
bool hadStyle = (oldStyle != 0);
float oldZoom = hadStyle ? oldStyle->effectiveZoom() : LayoutStyle::initialZoom();
@@ -172,7 +172,7 @@ static inline bool rendererHasAspectRatio(const LayoutObject* renderer)
return renderer->isImage() || renderer->isCanvas() || renderer->isVideo();
}
-void LayoutReplaced::computeAspectRatioInformationForRenderBox(RenderBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio) const
+void LayoutReplaced::computeAspectRatioInformationForLayoutBox(LayoutBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio) const
{
FloatSize intrinsicSize;
if (contentRenderer) {
@@ -210,8 +210,8 @@ void LayoutReplaced::computeAspectRatioInformationForRenderBox(RenderBox* conten
if (intrinsicRatio && !intrinsicSize.isEmpty() && style()->logicalWidth().isAuto() && style()->logicalHeight().isAuto()) {
// We can't multiply or divide by 'intrinsicRatio' here, it breaks tests, like fast/images/zoomed-img-size.html, which
// can only be fixed once subpixel precision is available for things like intrinsicWidth/Height - which include zoom!
- constrainedSize.setWidth(RenderBox::computeReplacedLogicalHeight() * intrinsicSize.width() / intrinsicSize.height());
- constrainedSize.setHeight(RenderBox::computeReplacedLogicalWidth() * intrinsicSize.height() / intrinsicSize.width());
+ constrainedSize.setWidth(LayoutBox::computeReplacedLogicalHeight() * intrinsicSize.width() / intrinsicSize.height());
+ constrainedSize.setHeight(LayoutBox::computeReplacedLogicalWidth() * intrinsicSize.height() / intrinsicSize.width());
}
}
@@ -271,12 +271,12 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
if (style()->logicalWidth().isSpecified() || style()->logicalWidth().isIntrinsic())
return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style()->logicalWidth()), shouldComputePreferred);
- RenderBox* contentRenderer = embeddedContentBox();
+ LayoutBox* contentRenderer = embeddedContentBox();
// 10.3.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width
double intrinsicRatio = 0;
FloatSize constrainedSize;
- computeAspectRatioInformationForRenderBox(contentRenderer, constrainedSize, intrinsicRatio);
+ computeAspectRatioInformationForLayoutBox(contentRenderer, constrainedSize, intrinsicRatio);
if (style()->logicalWidth().isAuto()) {
bool computedHeightIsAuto = hasAutoHeightOrContainingBlockWithAutoHeight();
@@ -334,12 +334,12 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalHeight() const
if (hasReplacedLogicalHeight())
return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight()));
- RenderBox* contentRenderer = embeddedContentBox();
+ LayoutBox* contentRenderer = embeddedContentBox();
// 10.6.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height
double intrinsicRatio = 0;
FloatSize constrainedSize;
- computeAspectRatioInformationForRenderBox(contentRenderer, constrainedSize, intrinsicRatio);
+ computeAspectRatioInformationForLayoutBox(contentRenderer, constrainedSize, intrinsicRatio);
bool widthIsAuto = style()->logicalWidth().isAuto();
bool hasIntrinsicHeight = constrainedSize.height() > 0;
@@ -423,7 +423,7 @@ PositionWithAffinity LayoutReplaced::positionForPoint(const LayoutPoint& point)
return createPositionWithAffinity(1, DOWNSTREAM);
}
- return RenderBox::positionForPoint(point);
+ return LayoutBox::positionForPoint(point);
}
LayoutRect LayoutReplaced::selectionRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const
@@ -461,7 +461,7 @@ LayoutRect LayoutReplaced::localSelectionRect(bool checkWhetherSelected) const
void LayoutReplaced::setSelectionState(SelectionState state)
{
// The selection state for our containing block hierarchy is updated by the base class call.
- RenderBox::setSelectionState(state);
+ LayoutBox::setSelectionState(state);
if (!inlineBoxWrapper())
return;
« no previous file with comments | « Source/core/layout/LayoutReplaced.h ('k') | Source/core/layout/LayoutReplica.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698