OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 enum Mode { ResolvingStyle = 0, CollectingStyleRules, CollectingCSSRules, Qu
eryingRules, SharingRules }; | 48 enum Mode { ResolvingStyle = 0, CollectingStyleRules, CollectingCSSRules, Qu
eryingRules, SharingRules }; |
49 explicit SelectorChecker(Document&, Mode); | 49 explicit SelectorChecker(Document&, Mode); |
50 enum ContextFlags { | 50 enum ContextFlags { |
51 // FIXME: Revmoe DefaultBehavior. | 51 // FIXME: Revmoe DefaultBehavior. |
52 DefaultBehavior = 0, | 52 DefaultBehavior = 0, |
53 ScopeContainsLastMatchedElement = 1, | 53 ScopeContainsLastMatchedElement = 1, |
54 TreatShadowHostAsNormalScope = 2, | 54 TreatShadowHostAsNormalScope = 2, |
55 }; | 55 }; |
56 | 56 |
57 struct SelectorCheckingContext { | 57 struct SelectorCheckingContext { |
| 58 STACK_ALLOCATED(); |
| 59 public: |
58 // Initial selector constructor | 60 // Initial selector constructor |
59 SelectorCheckingContext(const CSSSelector& selector, Element* element, V
isitedMatchType visitedMatchType) | 61 SelectorCheckingContext(const CSSSelector& selector, Element* element, V
isitedMatchType visitedMatchType) |
60 : selector(&selector) | 62 : selector(&selector) |
61 , element(element) | 63 , element(element) |
62 , previousElement(0) | 64 , previousElement(nullptr) |
63 , scope(0) | 65 , scope(nullptr) |
64 , visitedMatchType(visitedMatchType) | 66 , visitedMatchType(visitedMatchType) |
65 , pseudoId(NOPSEUDO) | 67 , pseudoId(NOPSEUDO) |
66 , elementStyle(0) | 68 , elementStyle(0) |
67 , scrollbar(0) | 69 , scrollbar(0) |
68 , scrollbarPart(NoPart) | 70 , scrollbarPart(NoPart) |
69 , isSubSelector(false) | 71 , isSubSelector(false) |
70 , hasScrollbarPseudo(false) | 72 , hasScrollbarPseudo(false) |
71 , hasSelectionPseudo(false) | 73 , hasSelectionPseudo(false) |
72 , isUARule(false) | 74 , isUARule(false) |
73 , contextFlags(DefaultBehavior) | 75 , contextFlags(DefaultBehavior) |
74 { } | 76 { |
| 77 } |
75 | 78 |
76 const CSSSelector* selector; | 79 const CSSSelector* selector; |
77 Element* element; | 80 RawPtrWillBeMember<Element> element; |
78 Element* previousElement; | 81 RawPtrWillBeMember<Element> previousElement; |
79 const ContainerNode* scope; | 82 RawPtrWillBeMember<const ContainerNode> scope; |
80 VisitedMatchType visitedMatchType; | 83 VisitedMatchType visitedMatchType; |
81 PseudoId pseudoId; | 84 PseudoId pseudoId; |
82 RenderStyle* elementStyle; | 85 RenderStyle* elementStyle; |
83 RenderScrollbar* scrollbar; | 86 RenderScrollbar* scrollbar; |
84 ScrollbarPart scrollbarPart; | 87 ScrollbarPart scrollbarPart; |
85 bool isSubSelector; | 88 bool isSubSelector; |
86 bool hasScrollbarPseudo; | 89 bool hasScrollbarPseudo; |
87 bool hasSelectionPseudo; | 90 bool hasSelectionPseudo; |
88 bool isUARule; | 91 bool isUARule; |
89 ContextFlags contextFlags; | 92 ContextFlags contextFlags; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 177 } |
175 | 178 |
176 inline bool SelectorChecker::isHostInItsShadowTree(const Element& element, const
ContainerNode* scope) | 179 inline bool SelectorChecker::isHostInItsShadowTree(const Element& element, const
ContainerNode* scope) |
177 { | 180 { |
178 return scope && scope->isInShadowTree() && scope->shadowHost() == element; | 181 return scope && scope->isInShadowTree() && scope->shadowHost() == element; |
179 } | 182 } |
180 | 183 |
181 } | 184 } |
182 | 185 |
183 #endif | 186 #endif |
OLD | NEW |