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

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

Issue 15871005: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding a mitigation for the perf regression to Element::recalcStyle. Created 7 years, 6 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
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/css/resolver/StyleResolverState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolverState.h
diff --git a/Source/core/css/resolver/StyleResolverState.h b/Source/core/css/resolver/StyleResolverState.h
index 2c87baed4f633f6fcf50e8ff4d22548059c004d6..728f85c0a0dcfdd8dabd6bdd359c660e413fccd3 100644
--- a/Source/core/css/resolver/StyleResolverState.h
+++ b/Source/core/css/resolver/StyleResolverState.h
@@ -47,6 +47,7 @@ WTF_MAKE_NONCOPYABLE(StyleResolverState);
public:
StyleResolverState()
: m_element(0)
+ , m_childIndex(0)
, m_styledElement(0)
, m_parentNode(0)
, m_parentStyle(0)
@@ -64,7 +65,7 @@ public:
, m_backgroundData(BackgroundFillLayer) { }
public:
- void initElement(Element*);
+ void initElement(Element*, int childIndex);
void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
void clear();
@@ -72,6 +73,7 @@ public:
Document* document() const { return m_element->document(); }
Element* element() const { return m_element; }
+ int childIndex() const { return m_childIndex; }
Element* styledElement() const { return m_styledElement; }
void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; }
RenderStyle* style() const { return m_style.get(); }
@@ -120,6 +122,7 @@ public:
private:
Element* m_element;
+ int m_childIndex;
RefPtr<RenderStyle> m_style;
Element* m_styledElement;
ContainerNode* m_parentNode;
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/css/resolver/StyleResolverState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698