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

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. Created 5 years, 11 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
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index cf24fe15393189a91617230898c2c689c7730fb0..9864e8c59bb5a8151488b74d77d391485449c36a 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -170,7 +170,7 @@ void RenderBox::removeFloatingOrPositionedChildFromBlockLists()
void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
- RenderStyle* oldStyle = style();
+ const RenderStyle* oldStyle = style();
if (oldStyle) {
// The background of the root element or the body element could propagate up to
// the canvas. Just dirty the entire canvas when our style changes substantially.
@@ -211,7 +211,7 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
RenderBoxModelObject::styleDidChange(diff, oldStyle);
- RenderStyle* newStyle = style();
+ const RenderStyle* newStyle = style();
if (needsLayout() && oldStyle)
RenderBlock::removePercentHeightDescendantIfNeeded(this);
@@ -298,7 +298,7 @@ void RenderBox::updateFromStyle()
{
RenderBoxModelObject::updateFromStyle();
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
bool isRootObject = isDocumentElement();
bool isViewObject = isRenderView();
bool rootLayerScrolls = document().settings() && document().settings()->rootLayerScrolls();
@@ -570,7 +570,7 @@ void RenderBox::updateLayerTransformAfterLayout()
LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, LayoutUnit availableWidth, RenderBlock* cb) const
{
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
if (!styleToUse->logicalMaxWidth().isMaxSizeNone())
logicalWidth = std::min(logicalWidth, computeLogicalWidthUsing(MaxSize, styleToUse->logicalMaxWidth(), availableWidth, cb));
return std::max(logicalWidth, computeLogicalWidthUsing(MinSize, styleToUse->logicalMinWidth(), availableWidth, cb));
@@ -578,7 +578,7 @@ LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, Lay
LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, LayoutUnit intrinsicContentHeight) const
{
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
if (!styleToUse->logicalMaxHeight().isMaxSizeNone()) {
LayoutUnit maxH = computeLogicalHeightUsing(styleToUse->logicalMaxHeight(), intrinsicContentHeight);
if (maxH != -1)
@@ -589,7 +589,7 @@ LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, L
LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, LayoutUnit intrinsicContentHeight) const
{
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
if (!styleToUse->logicalMaxHeight().isMaxSizeNone()) {
LayoutUnit maxH = computeContentLogicalHeight(styleToUse->logicalMaxHeight(), intrinsicContentHeight);
if (maxH != -1)
@@ -1231,7 +1231,7 @@ bool RenderBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c
static bool isCandidateForOpaquenessTest(RenderBox* childBox)
{
- RenderStyle* childStyle = childBox->style();
+ const RenderStyle* childStyle = childBox->style();
if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent())
return false;
if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside())
@@ -1543,7 +1543,7 @@ LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const
if (cb->hasOverrideHeight())
return cb->overrideLogicalContentHeight();
- RenderStyle* containingBlockStyle = cb->style();
+ const RenderStyle* containingBlockStyle = cb->style();
Length logicalHeightLength = containingBlockStyle->logicalHeight();
// FIXME: For now just support fixed heights. Eventually should support percentage heights as well.
@@ -1790,7 +1790,7 @@ void RenderBox::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
// RenderView::computeRectForPaintInvalidation then converts the rect to physical coordinates. We also convert to
// physical when we hit a paintInvalidationContainer boundary. Therefore the final rect returned is always in the
// physical coordinate space of the paintInvalidationContainer.
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
EPosition position = styleToUse->position();
@@ -1966,7 +1966,7 @@ void RenderBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues)
bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
Length logicalWidthLength = treatAsReplaced ? Length(computeReplacedLogicalWidth(), Fixed) : styleToUse->logicalWidth();
RenderBlock* cb = containingBlock();
@@ -2434,7 +2434,7 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
}
cb->addPercentHeightDescendant(const_cast<RenderBox*>(this));
- RenderStyle* cbstyle = cb->style();
+ const RenderStyle* cbstyle = cb->style();
// A positioned element that specified both top/bottom or that specifies height should be treated as though it has a height
// explicitly specified that can be used for any percentage computations.
@@ -3199,7 +3199,7 @@ void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& comp
const LayoutUnit containerLogicalHeight = containingBlockLogicalHeightForPositioned(containerBlock);
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight();
const Length marginBefore = styleToUse->marginBefore();
const Length marginAfter = styleToUse->marginAfter();
@@ -4295,7 +4295,7 @@ RenderLayer* RenderBox::enclosingFloatPaintingLayer() const
return 0;
}
-LayoutRect RenderBox::logicalVisualOverflowRectForPropagation(RenderStyle* parentStyle) const
+LayoutRect RenderBox::logicalVisualOverflowRectForPropagation(const RenderStyle* parentStyle) const
{
LayoutRect rect = visualOverflowRectForPropagation(parentStyle);
if (!parentStyle->isHorizontalWritingMode())
@@ -4303,7 +4303,7 @@ LayoutRect RenderBox::logicalVisualOverflowRectForPropagation(RenderStyle* paren
return rect;
}
-LayoutRect RenderBox::visualOverflowRectForPropagation(RenderStyle* parentStyle) const
+LayoutRect RenderBox::visualOverflowRectForPropagation(const RenderStyle* parentStyle) const
{
// If the writing modes of the child and parent match, then we don't have to
// do anything fancy. Just return the result.
@@ -4321,7 +4321,7 @@ LayoutRect RenderBox::visualOverflowRectForPropagation(RenderStyle* parentStyle)
return rect;
}
-LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation(RenderStyle* parentStyle) const
+LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation(const RenderStyle* parentStyle) const
{
LayoutRect rect = layoutOverflowRectForPropagation(parentStyle);
if (!parentStyle->isHorizontalWritingMode())
@@ -4329,7 +4329,7 @@ LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation(RenderStyle* paren
return rect;
}
-LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle) const
+LayoutRect RenderBox::layoutOverflowRectForPropagation(const RenderStyle* parentStyle) const
{
// Only propagate interior layout overflow if we don't clip it.
LayoutRect rect = borderBoxRect();

Powered by Google App Engine
This is Rietveld 408576698