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..f107d5a35c9e2029cc8a032e57426f97ea900230 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 StyleResolveScope { |
+public: |
+ StyleResolveScope(StyleResolverState*, Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); |
+ ~StyleResolveScope(); |
+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 StyleResolveScope; |
+ |
+ void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); |
+ void clear(); |
+ |
void initElement(Element*); |
ElementResolveContext m_elementContext; |