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

Unified Diff: Source/core/dom/Element.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix a crashers (everything is building!) 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/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 2161156c3a9d133da92e8dd6654880f081a3118f..ce27d1ff284e99c1ba04532fc206598d2feb2b0b 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1338,7 +1338,7 @@ bool Element::rendererIsNeeded(const RenderStyle& style)
return style.display() != NONE;
}
-RenderObject* Element::createRenderer(RenderStyle* style)
+RenderObject* Element::createRenderer(const RenderStyle* style)
{
return RenderObject::createObject(this, style);
}
@@ -1650,7 +1650,7 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
ASSERT(change >= Inherit || needsStyleRecalc());
ASSERT(parentRenderStyle());
- RefPtr<RenderStyle> oldStyle = renderStyle();
+ RefPtr<RenderStyle> oldStyle = mutableRenderStyle();
rune 2015/01/29 23:16:32 All use of oldStyle below looks const to me.
Julien - ping for review 2015/02/10 07:33:19 RefPtr modifies |oldStyle| so it's not const at al
RefPtr<RenderStyle> newStyle = styleForRenderer();
StyleRecalcChange localChange = RenderStyle::stylePropagationDiff(oldStyle.get(), newStyle.get());
@@ -1695,7 +1695,7 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
return localChange;
}
-void Element::updateCallbackSelectors(RenderStyle* oldStyle, RenderStyle* newStyle)
+void Element::updateCallbackSelectors(const RenderStyle* oldStyle, const RenderStyle* newStyle)
{
Vector<String> emptyVector;
const Vector<String>& oldCallbackSelectors = oldStyle ? oldStyle->callbackSelectors() : emptyVector;
@@ -1846,7 +1846,7 @@ bool Element::childTypeAllowed(NodeType type) const
void Element::checkForEmptyStyleChange()
{
- RenderStyle* style = renderStyle();
+ const RenderStyle* style = renderStyle();
if (!style && !styleAffectedByEmpty())
return;
@@ -2538,7 +2538,7 @@ RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)
// FIXME: Find and use the renderer from the pseudo element instead of the actual element so that the 'length'
// properties, which are only known by the renderer because it did the layout, will be correct and so that the
// values returned for the ":selection" pseudo-element will be correct.
- RenderStyle* elementStyle = renderStyle();
+ RenderStyle* elementStyle = mutableRenderStyle();
if (!elementStyle) {
ElementRareData& rareData = ensureElementRareData();
if (!rareData.computedStyle())
@@ -2621,7 +2621,7 @@ void Element::updatePseudoElement(PseudoId pseudoId, StyleRecalcChange change)
// Need to clear the cached style if the PseudoElement wants a recalc so it
// computes a new style.
if (element->needsStyleRecalc())
- renderer()->style()->removeCachedPseudoStyle(pseudoId);
+ renderer()->deprecatedMutableStyle()->removeCachedPseudoStyle(pseudoId);
// PseudoElement styles hang off their parent element's style so if we needed
// a style recalc we should Force one on the pseudo.

Powered by Google App Engine
This is Rietveld 408576698