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

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: Updated change after Doug's review. 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/dom/Element.h ('k') | Source/core/dom/FirstLetterPseudoElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 7ed385f12649b8ee4e6a28001d6003723a18e56c..dfe0b23285104ef3e7ce5bbe7287a2a4e3a841c2 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1634,7 +1634,7 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
ASSERT(change >= Inherit || needsStyleRecalc());
ASSERT(parentLayoutStyle());
- RefPtr<LayoutStyle> oldStyle = layoutStyle();
+ RefPtr<LayoutStyle> oldStyle = mutableLayoutStyle();
RefPtr<LayoutStyle> newStyle = styleForRenderer();
StyleRecalcChange localChange = LayoutStyle::stylePropagationDiff(oldStyle.get(), newStyle.get());
@@ -1679,7 +1679,7 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
return localChange;
}
-void Element::updateCallbackSelectors(LayoutStyle* oldStyle, LayoutStyle* newStyle)
+void Element::updateCallbackSelectors(const LayoutStyle* oldStyle, const LayoutStyle* newStyle)
{
Vector<String> emptyVector;
const Vector<String>& oldCallbackSelectors = oldStyle ? oldStyle->callbackSelectors() : emptyVector;
@@ -1830,7 +1830,7 @@ bool Element::childTypeAllowed(NodeType type) const
void Element::checkForEmptyStyleChange()
{
- LayoutStyle* style = layoutStyle();
+ const LayoutStyle* style = layoutStyle();
if (!style && !styleAffectedByEmpty())
return;
@@ -2522,7 +2522,7 @@ LayoutStyle* 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.
- LayoutStyle* elementStyle = layoutStyle();
+ LayoutStyle* elementStyle = mutableLayoutStyle();
if (!elementStyle) {
ElementRareData& rareData = ensureElementRareData();
if (!rareData.computedStyle())
@@ -2605,7 +2605,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()->mutableStyleRef().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.
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/FirstLetterPseudoElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698