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

Unified Diff: Source/core/css/resolver/StyleResolver.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: Merging ToT Created 7 years, 7 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/StyleResolver.h
diff --git a/Source/core/css/resolver/StyleResolver.h b/Source/core/css/resolver/StyleResolver.h
index 494525a5e20cbfef2a81719870ed801a0665a14d..db5443c4aeed9e4dcca72c2c740d46623ce9567b 100644
--- a/Source/core/css/resolver/StyleResolver.h
+++ b/Source/core/css/resolver/StyleResolver.h
@@ -160,7 +160,12 @@ public:
void popParentShadowRoot(const ShadowRoot*);
PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing,
- RuleMatchingBehavior = MatchAllRules, RenderRegion* regionForStyling = 0);
+ RuleMatchingBehavior = MatchAllRules, RenderRegion* regionForStyling = 0, int childIndex = 0);
+
+ PassRefPtr<RenderStyle> styleForElement(Element* element, int childIndex)
+ {
+ return styleForElement(element, 0, AllowStyleSharing, MatchAllRules, 0, childIndex);
+ }
void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList&);
@@ -198,7 +203,7 @@ public:
}
private:
- void initElement(Element*);
+ void initElement(Element*, int childIndex = 0);
RenderStyle* locateSharedStyle();
bool styleSharingCandidateMatchesRuleSet(RuleSet*);
Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const;

Powered by Google App Engine
This is Rietveld 408576698