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

Unified Diff: Source/core/dom/NodeRenderStyle.h

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/NodeRenderStyle.h
diff --git a/Source/core/dom/NodeRenderStyle.h b/Source/core/dom/NodeRenderStyle.h
index 5a38d3a1b810438000f3e81529da1a2b20510afd..35317250a84e6dde67082b39c67f357694394fcf 100644
--- a/Source/core/dom/NodeRenderStyle.h
+++ b/Source/core/dom/NodeRenderStyle.h
@@ -33,10 +33,10 @@
namespace blink {
-inline RenderStyle* Node::renderStyle() const
+inline RenderStyle* Node::mutableRenderStyle() const
{
if (RenderObject* renderer = this->renderer())
- return renderer->style();
+ return renderer->deprecatedMutableStyle();
// <option> and <optgroup> can be styled even if they don't get renderers,
// so they store their style internally and return it through nonRendererStyle().
// We check here explicitly to avoid the virtual call in the common case.
@@ -45,7 +45,12 @@ inline RenderStyle* Node::renderStyle() const
return 0;
}
-inline RenderStyle* Node::parentRenderStyle() const
+inline const RenderStyle* Node::renderStyle() const
+{
+ return mutableRenderStyle();
+}
+
+inline const RenderStyle* Node::parentRenderStyle() const
{
ContainerNode* parent = NodeRenderingTraversal::parent(*this);
return parent ? parent->renderStyle() : 0;

Powered by Google App Engine
This is Rietveld 408576698