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

Side by Side Diff: Source/core/css/SelectorChecker.h

Issue 16629006: Revert 151996 "Avoid N^2 walk placing renderers when building th..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Update to head 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 enum BehaviorAtBoundary { 51 enum BehaviorAtBoundary {
52 DoesNotCrossBoundary = 0, 52 DoesNotCrossBoundary = 0,
53 CrossesBoundary = 1, 53 CrossesBoundary = 1,
54 StaysWithinTreeScope = 2, 54 StaysWithinTreeScope = 2,
55 BoundaryBehaviorMask = 3, // 2bit for boundary behavior 55 BoundaryBehaviorMask = 3, // 2bit for boundary behavior
56 ScopeContainsLastMatchedElement = 4, 56 ScopeContainsLastMatchedElement = 4,
57 }; 57 };
58 58
59 struct SelectorCheckingContext { 59 struct SelectorCheckingContext {
60 // Initial selector constructor 60 // Initial selector constructor
61 SelectorCheckingContext(const CSSSelector* selector, Element* element, V isitedMatchType visitedMatchType, int childIndex = 0) 61 SelectorCheckingContext(const CSSSelector* selector, Element* element, V isitedMatchType visitedMatchType)
62 : selector(selector) 62 : selector(selector)
63 , element(element) 63 , element(element)
64 , scope(0) 64 , scope(0)
65 , visitedMatchType(visitedMatchType) 65 , visitedMatchType(visitedMatchType)
66 , pseudoId(NOPSEUDO) 66 , pseudoId(NOPSEUDO)
67 , elementStyle(0) 67 , elementStyle(0)
68 , scrollbar(0) 68 , scrollbar(0)
69 , scrollbarPart(NoPart) 69 , scrollbarPart(NoPart)
70 , isSubSelector(false) 70 , isSubSelector(false)
71 , hasScrollbarPseudo(false) 71 , hasScrollbarPseudo(false)
72 , hasSelectionPseudo(false) 72 , hasSelectionPseudo(false)
73 , behaviorAtBoundary(DoesNotCrossBoundary) 73 , behaviorAtBoundary(DoesNotCrossBoundary)
74 , childIndex(childIndex)
75 { } 74 { }
76 75
77 const CSSSelector* selector; 76 const CSSSelector* selector;
78 Element* element; 77 Element* element;
79 const ContainerNode* scope; 78 const ContainerNode* scope;
80 VisitedMatchType visitedMatchType; 79 VisitedMatchType visitedMatchType;
81 PseudoId pseudoId; 80 PseudoId pseudoId;
82 RenderStyle* elementStyle; 81 RenderStyle* elementStyle;
83 RenderScrollbar* scrollbar; 82 RenderScrollbar* scrollbar;
84 ScrollbarPart scrollbarPart; 83 ScrollbarPart scrollbarPart;
85 bool isSubSelector; 84 bool isSubSelector;
86 bool hasScrollbarPseudo; 85 bool hasScrollbarPseudo;
87 bool hasSelectionPseudo; 86 bool hasSelectionPseudo;
88 BehaviorAtBoundary behaviorAtBoundary; 87 BehaviorAtBoundary behaviorAtBoundary;
89 int childIndex;
90 }; 88 };
91 89
92 template<typename SiblingTraversalStrategy> 90 template<typename SiblingTraversalStrategy>
93 Match match(const SelectorCheckingContext&, PseudoId&, const SiblingTraversa lStrategy&) const; 91 Match match(const SelectorCheckingContext&, PseudoId&, const SiblingTraversa lStrategy&) const;
94 92
95 template<typename SiblingTraversalStrategy> 93 template<typename SiblingTraversalStrategy>
96 Match matchForShadowDistributed(const Element*, const SiblingTraversalStrate gy&, PseudoId&, SelectorCheckingContext& nextContext) const; 94 Match matchForShadowDistributed(const Element*, const SiblingTraversalStrate gy&, PseudoId&, SelectorCheckingContext& nextContext) const;
97 95
98 template<typename SiblingTraversalStrategy> 96 template<typename SiblingTraversalStrategy>
99 bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy &) const; 97 bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy &) const;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 const Attribute* attribute = element->attributeItem(i); 149 const Attribute* attribute = element->attributeItem(i);
152 if (attribute->matches(selectorAttributeName) && (!value || attribute->v alue().impl() == value)) 150 if (attribute->matches(selectorAttributeName) && (!value || attribute->v alue().impl() == value))
153 return true; 151 return true;
154 } 152 }
155 return false; 153 return false;
156 } 154 }
157 155
158 } 156 }
159 157
160 #endif 158 #endif
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/cache/subresource-expiration-2-expected.txt ('k') | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698