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

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: You people refactor too quickly. (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 b8fce1c06eea82f7852039964551e7588a03e575..047afe9b3ac65d76c4ad8ffad28ab979ceb3c36d 100644
--- a/Source/core/css/resolver/StyleResolverState.h
+++ b/Source/core/css/resolver/StyleResolverState.h
@@ -60,8 +60,14 @@ public:
, m_styleMap(*this, m_elementStyleResources)
{ }
- void initForStyleResolve(Document*, Element*, int childIndex = 0, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
- void clear();
+public:
+ class ScopedStyleResolution {
dglazkov 2013/07/12 16:45:47 Can we un-nest this?
Jeffrey Yasskin 2013/07/12 19:41:28 Yep, done.
+ public:
+ ScopedStyleResolution(StyleResolverState*, Document*, Element*, int childIndex = 0, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
+ ~ScopedStyleResolution();
+ private:
+ StyleResolverState* m_state;
+ };
Document* document() const { return m_element->document(); }
Element* element() const { return m_element; }
@@ -142,6 +148,9 @@ public:
bool useSVGZoomRules() const { return m_element && m_element->isSVGElement(); }
private:
+ void initForStyleResolve(Document*, Element*, int childIndex = 0, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
+ void clear();
+
void initElement(Element*, int childIndex);
Element* m_element;

Powered by Google App Engine
This is Rietveld 408576698