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

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

Issue 5216392399814656: Clear StyleResolverState after each resolve. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Sync 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698