| Index: Source/core/css/resolver/StyleResolver.h
|
| diff --git a/Source/core/css/resolver/StyleResolver.h b/Source/core/css/resolver/StyleResolver.h
|
| index 0649cd877901e607ee48c4fe7b0f3c0ad949cbba..003e55dd61e342bd2d7fe54a4256022193609396 100644
|
| --- a/Source/core/css/resolver/StyleResolver.h
|
| +++ b/Source/core/css/resolver/StyleResolver.h
|
| @@ -148,7 +148,13 @@ 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);
|
| +
|
| + // childIndex's origin is 1, and avoids unnecessary tree walks to resolve nth/nth-last selectors.
|
| + PassRefPtr<RenderStyle> styleForElement(Element* element, int childIndex)
|
| + {
|
| + return styleForElement(element, 0, AllowStyleSharing, MatchAllRules, 0, childIndex);
|
| + }
|
|
|
| void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList&);
|
|
|
| @@ -186,7 +192,7 @@ public:
|
| }
|
|
|
| private:
|
| - void initElement(Element*);
|
| + void initElement(Element*, int childIndex = 0);
|
| RenderStyle* locateSharedStyle();
|
| bool styleSharingCandidateMatchesRuleSet(RuleSet*);
|
| Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const;
|
|
|