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

Unified Diff: trunk/Source/core/css/resolver/StyleResolverState.h

Issue 948053002: Revert 190605 "Make RenderObject::style() return a const object" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: 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
Index: trunk/Source/core/css/resolver/StyleResolverState.h
===================================================================
--- trunk/Source/core/css/resolver/StyleResolverState.h (revision 190671)
+++ trunk/Source/core/css/resolver/StyleResolverState.h (working copy)
@@ -45,8 +45,8 @@
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(StyleResolverState);
public:
- StyleResolverState(Document&, const ElementResolveContext&, const LayoutStyle* parentStyle);
- StyleResolverState(Document&, Element*, const LayoutStyle* parentStyle = 0);
+ StyleResolverState(Document&, const ElementResolveContext&, LayoutStyle* parentStyle);
+ StyleResolverState(Document&, Element*, LayoutStyle* parentStyle = 0);
~StyleResolverState();
// In FontFaceSet and CanvasRenderingContext2D, we don't have an element to grab the document from.
@@ -83,13 +83,9 @@
const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get(); }
PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> takeAnimationUpdate();
- void setParentStyle(PassRefPtr<LayoutStyle> parentStyle) { m_overrideParentStyle = parentStyle; }
- const LayoutStyle* parentStyle() const
- {
- if (m_overrideParentStyle)
- return m_overrideParentStyle.get();
- return m_parentStyle;
- }
+ void setParentStyle(PassRefPtr<LayoutStyle> parentStyle) { m_parentStyle = parentStyle; }
+ const LayoutStyle* parentStyle() const { return m_parentStyle.get(); }
+ LayoutStyle* parentStyle() { return m_parentStyle.get(); }
// FIXME: These are effectively side-channel "out parameters" for the various
// map functions. When we map from CSS to style objects we use this state object
@@ -132,7 +128,7 @@
// set these directly on the LayoutStyle w/o telling us. Presumably we'll
// want to design a better wrapper around LayoutStyle for tracking these mutations
// and separate it from StyleResolverState.
- const FontDescription& parentFontDescription() { return parentStyle()->fontDescription(); }
+ const FontDescription& parentFontDescription() { return m_parentStyle->fontDescription(); }
void setZoom(float f)
{
@@ -166,8 +162,7 @@
// m_parentStyle is not always just ElementResolveContext::parentStyle,
// so we keep it separate.
- const LayoutStyle* m_parentStyle;
- RefPtr<LayoutStyle> m_overrideParentStyle;
+ RefPtr<LayoutStyle> m_parentStyle;
OwnPtrWillBeMember<CSSAnimationUpdate> m_animationUpdate;
« no previous file with comments | « trunk/Source/core/css/resolver/StyleResolver.cpp ('k') | trunk/Source/core/css/resolver/StyleResolverState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698