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

Unified Diff: Source/core/rendering/RenderInline.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/RenderInline.cpp
diff --git a/Source/core/rendering/RenderInline.cpp b/Source/core/rendering/RenderInline.cpp
index a431a76f93976c69a50e131323494e28f3e980ad..a779d6584169564b0ca28e70031ac47a5c74d5a9 100644
--- a/Source/core/rendering/RenderInline.cpp
+++ b/Source/core/rendering/RenderInline.cpp
@@ -196,7 +196,8 @@ void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
// e.g., <font>foo <h4>goo</h4> moo</font>. The <font> inlines before
// and after the block share the same style, but the block doesn't
// need to pass its style on to anyone else.
- RenderStyle* newStyle = style();
+ // FIXME: For setStyle below.
+ RenderStyle* newStyle = deprecatedMutableStyle();
RenderInline* continuation = inlineElementContinuation();
for (RenderInline* currCont = continuation; currCont; currCont = currCont->inlineElementContinuation()) {
RenderBoxModelObject* nextCont = currCont->continuation();
@@ -233,7 +234,7 @@ void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout)
if (alwaysCreateLineBoxes())
return;
- RenderStyle* parentStyle = parent()->style();
+ const RenderStyle* parentStyle = parent()->style();
RenderInline* parentRenderInline = parent()->isRenderInline() ? toRenderInline(parent()) : 0;
bool checkFonts = document().inNoQuirksMode();
bool alwaysCreateLineBoxesNew = (parentRenderInline && parentRenderInline->alwaysCreateLineBoxes())
@@ -246,7 +247,7 @@ void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout)
if (!alwaysCreateLineBoxesNew && checkFonts && document().styleEngine()->usesFirstLineRules()) {
// Have to check the first line style as well.
parentStyle = parent()->style(true);
- RenderStyle* childStyle = style(true);
+ const RenderStyle* childStyle = style(true);
alwaysCreateLineBoxesNew = !parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle->font().fontMetrics())
|| childStyle->verticalAlign() != BASELINE
|| parentStyle->lineHeight() != childStyle->lineHeight();
@@ -364,7 +365,7 @@ void RenderInline::addChildIgnoringContinuation(RenderObject* newChild, RenderOb
RenderInline* RenderInline::clone() const
{
RenderInline* cloneInline = new RenderInline(node());
- cloneInline->setStyle(style());
+ cloneInline->setStyle(deprecatedMutableStyle());
cloneInline->setFlowThreadState(flowThreadState());
return cloneInline;
}
@@ -1316,7 +1317,7 @@ InlineFlowBox* RenderInline::createAndAppendInlineFlowBox()
LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
{
if (firstLine && document().styleEngine()->usesFirstLineRules()) {
- RenderStyle* s = style(firstLine);
+ const RenderStyle* s = style(firstLine);
if (s != style())
return s->computedLineHeight();
}

Powered by Google App Engine
This is Rietveld 408576698