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

Side by Side Diff: Source/core/css/resolver/StyleResolver.h

Issue 18147020: Remove broken sibling selector optimization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 StyleResolver(Document*, bool matchAuthorAndUserStyles); 176 StyleResolver(Document*, bool matchAuthorAndUserStyles);
177 ~StyleResolver(); 177 ~StyleResolver();
178 178
179 // Using these during tree walk will allow style selector to optimize child and descendant selector lookups. 179 // Using these during tree walk will allow style selector to optimize child and descendant selector lookups.
180 void pushParentElement(Element*); 180 void pushParentElement(Element*);
181 void popParentElement(Element*); 181 void popParentElement(Element*);
182 void pushParentShadowRoot(const ShadowRoot*); 182 void pushParentShadowRoot(const ShadowRoot*);
183 void popParentShadowRoot(const ShadowRoot*); 183 void popParentShadowRoot(const ShadowRoot*);
184 184
185 PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing, 185 PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing,
186 RuleMatchingBehavior = MatchAllRules, RenderRegion* regionForStyling = 0 , int childIndex = 0); 186 RuleMatchingBehavior = MatchAllRules, RenderRegion* regionForStyling = 0 );
187
188 // childIndex's origin is 1, and avoids unnecessary tree walks to resolve nt h/nth-last selectors.
189 PassRefPtr<RenderStyle> styleForElement(Element* element, int childIndex)
190 {
191 return styleForElement(element, 0, AllowStyleSharing, MatchAllRules, 0, childIndex);
192 }
193 187
194 void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList&) ; 188 void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList&) ;
195 189
196 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, RenderStyle* parentStyle); 190 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, RenderStyle* parentStyle);
197 191
198 PassRefPtr<RenderStyle> styleForPage(int pageIndex); 192 PassRefPtr<RenderStyle> styleForPage(int pageIndex);
199 PassRefPtr<RenderStyle> defaultStyleForElement(); 193 PassRefPtr<RenderStyle> defaultStyleForElement();
200 PassRefPtr<RenderStyle> styleForText(Text*); 194 PassRefPtr<RenderStyle> styleForText(Text*);
201 195
202 static PassRefPtr<RenderStyle> styleForDocument(Document*, CSSFontSelector* = 0); 196 static PassRefPtr<RenderStyle> styleForDocument(Document*, CSSFontSelector* = 0);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 PseudoId ignoreDynamicPseudo = NOPSEUDO; 406 PseudoId ignoreDynamicPseudo = NOPSEUDO;
413 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) 407 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches)
414 return true; 408 return true;
415 } 409 }
416 return false; 410 return false;
417 } 411 }
418 412
419 } // namespace WebCore 413 } // namespace WebCore
420 414
421 #endif // StyleResolver_h 415 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698