OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 class SelectorFilter; | 41 class SelectorFilter; |
42 class StaticCSSRuleList; | 42 class StaticCSSRuleList; |
43 | 43 |
44 // ElementRuleCollector is designed to be used as a stack object. | 44 // ElementRuleCollector is designed to be used as a stack object. |
45 // Create one, ask what rules the ElementResolveContext matches | 45 // Create one, ask what rules the ElementResolveContext matches |
46 // and then let it go out of scope. | 46 // and then let it go out of scope. |
47 // FIXME: Currently it modifies the RenderStyle but should not! | 47 // FIXME: Currently it modifies the RenderStyle but should not! |
48 class ElementRuleCollector { | 48 class ElementRuleCollector { |
49 WTF_MAKE_NONCOPYABLE(ElementRuleCollector); | 49 WTF_MAKE_NONCOPYABLE(ElementRuleCollector); |
50 public: | 50 public: |
51 // FIXME: This should not need an InspectorCSSOMWrappers parameter. | 51 ElementRuleCollector(const ElementResolveContext&, const SelectorFilter&, Re
nderStyle*); |
52 ElementRuleCollector(const ElementResolveContext&, const SelectorFilter&, Re
nderStyle*, InspectorCSSOMWrappers&); | |
53 | 52 |
54 void setBehaviorAtBoundary(SelectorChecker::BehaviorAtBoundary boundary) { m
_behaviorAtBoundary = boundary; } | 53 void setBehaviorAtBoundary(SelectorChecker::BehaviorAtBoundary boundary) { m
_behaviorAtBoundary = boundary; } |
55 SelectorChecker::BehaviorAtBoundary behaviorAtBoundary() const { return m_be
haviorAtBoundary; } | 54 SelectorChecker::BehaviorAtBoundary behaviorAtBoundary() const { return m_be
haviorAtBoundary; } |
56 void setCanUseFastReject(bool canUseFastReject) { m_canUseFastReject = canUs
eFastReject; } | 55 void setCanUseFastReject(bool canUseFastReject) { m_canUseFastReject = canUs
eFastReject; } |
57 bool canUseFastReject() const { return m_canUseFastReject; } | 56 bool canUseFastReject() const { return m_canUseFastReject; } |
58 | 57 |
59 void setMode(SelectorChecker::Mode mode) { m_mode = mode; } | 58 void setMode(SelectorChecker::Mode mode) { m_mode = mode; } |
60 void setPseudoStyleRequest(const PseudoStyleRequest& request) { m_pseudoStyl
eRequest = request; } | 59 void setPseudoStyleRequest(const PseudoStyleRequest& request) { m_pseudoStyl
eRequest = request; } |
61 void setSameOriginOnly(bool f) { m_sameOriginOnly = f; } | 60 void setSameOriginOnly(bool f) { m_sameOriginOnly = f; } |
62 void setRegionForStyling(const RenderRegion* regionForStyling) { m_regionFor
Styling = regionForStyling; } | 61 void setRegionForStyling(const RenderRegion* regionForStyling) { m_regionFor
Styling = regionForStyling; } |
(...skipping 20 matching lines...) Expand all Loading... |
83 | 82 |
84 void sortMatchedRules(); | 83 void sortMatchedRules(); |
85 | 84 |
86 void addMatchedRule(const RuleData*); | 85 void addMatchedRule(const RuleData*); |
87 | 86 |
88 StaticCSSRuleList* ensureRuleList(); | 87 StaticCSSRuleList* ensureRuleList(); |
89 | 88 |
90 private: | 89 private: |
91 const ElementResolveContext& m_context; | 90 const ElementResolveContext& m_context; |
92 const SelectorFilter& m_selectorFilter; | 91 const SelectorFilter& m_selectorFilter; |
93 InspectorCSSOMWrappers& m_inspectorCSSOMWrappers; // This should not be need
ed. | |
94 RefPtr<RenderStyle> m_style; // FIXME: This can be mutated during matching! | 92 RefPtr<RenderStyle> m_style; // FIXME: This can be mutated during matching! |
95 | 93 |
96 const RenderRegion* m_regionForStyling; | 94 const RenderRegion* m_regionForStyling; |
97 PseudoStyleRequest m_pseudoStyleRequest; | 95 PseudoStyleRequest m_pseudoStyleRequest; |
98 SelectorChecker::Mode m_mode; | 96 SelectorChecker::Mode m_mode; |
99 SelectorChecker::BehaviorAtBoundary m_behaviorAtBoundary; | 97 SelectorChecker::BehaviorAtBoundary m_behaviorAtBoundary; |
100 bool m_canUseFastReject; | 98 bool m_canUseFastReject; |
101 bool m_sameOriginOnly; | 99 bool m_sameOriginOnly; |
102 bool m_matchingUARules; | 100 bool m_matchingUARules; |
103 | 101 |
104 OwnPtr<Vector<const RuleData*, 32> > m_matchedRules; | 102 OwnPtr<Vector<const RuleData*, 32> > m_matchedRules; |
105 | 103 |
106 // Output. | 104 // Output. |
107 RefPtr<StaticCSSRuleList> m_ruleList; | 105 RefPtr<StaticCSSRuleList> m_ruleList; |
108 MatchResult m_result; | 106 MatchResult m_result; |
109 }; | 107 }; |
110 | 108 |
111 } // namespace WebCore | 109 } // namespace WebCore |
112 | 110 |
113 #endif // ElementRuleCollector_h | 111 #endif // ElementRuleCollector_h |
OLD | NEW |