Chromium Code Reviews| Index: Source/core/css/resolver/StyleResolverState.h |
| diff --git a/Source/core/css/resolver/StyleResolverState.h b/Source/core/css/resolver/StyleResolverState.h |
| index b8bb0368bc0e9d502caab302da68ab5ccf15caa0..e04ed7a3d084d161d5f85cf66cbb408f7312f994 100644 |
| --- a/Source/core/css/resolver/StyleResolverState.h |
| +++ b/Source/core/css/resolver/StyleResolverState.h |
| @@ -82,6 +82,15 @@ private: |
| bool m_resetStyleInheritance; |
| }; |
| +// Initializes a StyleResolverState within a scope. |
| +class ScopedStyleResolution { |
|
Jeffrey Yasskin
2013/07/12 19:58:27
In a subsequent change, we could remove this entir
|
| +public: |
| + ScopedStyleResolution(StyleResolverState*, Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); |
| + ~ScopedStyleResolution(); |
| +private: |
| + StyleResolverState* m_state; |
| +}; |
| + |
| class StyleResolverState { |
| WTF_MAKE_NONCOPYABLE(StyleResolverState); |
| public: |
| @@ -94,9 +103,6 @@ public: |
| , m_styleMap(*this, m_elementStyleResources) |
| { } |
| - void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); |
| - void clear(); |
| - |
| // These are all just pass-through methods to ElementResolveContext. |
| Document* document() const { return m_elementContext.document(); } |
| Element* element() const { return m_elementContext.element(); } |
| @@ -176,6 +182,11 @@ public: |
| bool useSVGZoomRules() const { return element() && element()->isSVGElement(); } |
| private: |
| + friend class ScopedStyleResolution; |
| + |
| + void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); |
| + void clear(); |
| + |
| void initElement(Element*); |
| ElementResolveContext m_elementContext; |