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

Side by Side Diff: Source/core/css/resolver/StyleResolverState.h

Issue 20112002: Have const StyleResolverState return const RenderStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 class StyleResolverState { 75 class StyleResolverState {
76 WTF_MAKE_NONCOPYABLE(StyleResolverState); 76 WTF_MAKE_NONCOPYABLE(StyleResolverState);
77 public: 77 public:
78 StyleResolverState(const Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); 78 StyleResolverState(const Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
79 ~StyleResolverState(); 79 ~StyleResolverState();
80 80
81 // These are all just pass-through methods to ElementResolveContext. 81 // These are all just pass-through methods to ElementResolveContext.
82 Document* document() const { return m_elementContext.document(); } 82 Document* document() const { return m_elementContext.document(); }
83 Element* element() const { return m_elementContext.element(); } 83 Element* element() const { return m_elementContext.element(); }
84 const ContainerNode* parentNode() const { return m_elementContext.parentNode (); } 84 const ContainerNode* parentNode() const { return m_elementContext.parentNode (); }
85 RenderStyle* rootElementStyle() const { return m_elementContext.rootElementS tyle(); } 85 const RenderStyle* rootElementStyle() const { return m_elementContext.rootEl ementStyle(); }
86 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt ate(); } 86 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt ate(); }
87 bool distributedToInsertionPoint() const { return m_elementContext.distribut edToInsertionPoint(); } 87 bool distributedToInsertionPoint() const { return m_elementContext.distribut edToInsertionPoint(); }
88 88
89 const ElementResolveContext& elementContext() const { return m_elementContex t; } 89 const ElementResolveContext& elementContext() const { return m_elementContex t; }
90 90
91 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } 91 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; }
92 RenderStyle* style() const { return m_style.get(); } 92 const RenderStyle* style() const { return m_style.get(); }
93 RenderStyle* style() { return m_style.get(); }
93 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } 94 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); }
94 95
95 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; } 96 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; }
96 RenderStyle* parentStyle() const { return m_parentStyle.get(); } 97 const RenderStyle* parentStyle() const { return m_parentStyle.get(); }
98 RenderStyle* parentStyle() { return m_parentStyle.get(); }
97 99
98 const RenderRegion* regionForStyling() const { return m_regionForStyling; } 100 const RenderRegion* regionForStyling() const { return m_regionForStyling; }
99 101
100 // FIXME: These are effectively side-channel "out parameters" for the variou s 102 // FIXME: These are effectively side-channel "out parameters" for the variou s
101 // map functions. When we map from CSS to style objects we use this state ob ject 103 // map functions. When we map from CSS to style objects we use this state ob ject
102 // to track various meta-data about that mapping (e.g. if it's cache-able). 104 // to track various meta-data about that mapping (e.g. if it's cache-able).
103 // We need to move this data off of StyleResolverState and closer to the 105 // We need to move this data off of StyleResolverState and closer to the
104 // objects it applies to. Possibly separating (immutable) inputs from (mutab le) outputs. 106 // objects it applies to. Possibly separating (immutable) inputs from (mutab le) outputs.
105 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; } 107 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; }
106 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; } 108 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 179
178 ElementStyleResources m_elementStyleResources; 180 ElementStyleResources m_elementStyleResources;
179 // CSSToStyleMap is a pure-logic class and only contains 181 // CSSToStyleMap is a pure-logic class and only contains
180 // a back-pointer to this object. 182 // a back-pointer to this object.
181 CSSToStyleMap m_styleMap; 183 CSSToStyleMap m_styleMap;
182 }; 184 };
183 185
184 } // namespace WebCore 186 } // namespace WebCore
185 187
186 #endif // StyleResolverState_h 188 #endif // StyleResolverState_h
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/scripts/templates/StyleBuilderFunctions.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698