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

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

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/Node.cpp ('k') | Source/core/dom/PseudoElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeLayoutStyle.h
diff --git a/Source/core/dom/NodeLayoutStyle.h b/Source/core/dom/NodeLayoutStyle.h
index e5094a9ddf5212fa3469515f7abb9b854043e99d..feaa0d5caec5ca5417b104e16bd7f8a87c881eb3 100644
--- a/Source/core/dom/NodeLayoutStyle.h
+++ b/Source/core/dom/NodeLayoutStyle.h
@@ -33,10 +33,10 @@
namespace blink {
-inline LayoutStyle* Node::layoutStyle() const
+inline LayoutStyle* Node::mutableLayoutStyle() const
{
if (LayoutObject* renderer = this->renderer())
- return renderer->style();
+ return renderer->mutableStyle();
// <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 LayoutStyle* Node::layoutStyle() const
return 0;
}
-inline LayoutStyle* Node::parentLayoutStyle() const
+inline const LayoutStyle* Node::layoutStyle() const
+{
+ return mutableLayoutStyle();
+}
+
+inline const LayoutStyle* Node::parentLayoutStyle() const
{
ContainerNode* parent = NodeRenderingTraversal::parent(*this);
return parent ? parent->layoutStyle() : 0;
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/PseudoElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698