OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 13 matching lines...) Expand all Loading... |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef TreeScope_h | 27 #ifndef TreeScope_h |
28 #define TreeScope_h | 28 #define TreeScope_h |
29 | 29 |
30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
31 #include "core/dom/DocumentOrderedMap.h" | 31 #include "core/dom/DocumentOrderedMap.h" |
32 #include "core/html/forms/RadioButtonGroupScope.h" | 32 #include "core/html/forms/RadioButtonGroupScope.h" |
33 #include "core/layout/HitTestRequest.h" | 33 #include "core/layout/HitTestRequest.h" |
| 34 #include "core/svg/SVGTreeScopeResources.h" |
34 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
35 #include "wtf/text/AtomicString.h" | 36 #include "wtf/text/AtomicString.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 class ContainerNode; | 40 class ContainerNode; |
40 class DOMSelection; | 41 class DOMSelection; |
41 class Document; | 42 class Document; |
42 class Element; | 43 class Element; |
43 class HTMLMapElement; | 44 class HTMLMapElement; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 TreeScope* commonAncestorTreeScope(TreeScope& other); | 109 TreeScope* commonAncestorTreeScope(TreeScope& other); |
109 | 110 |
110 Element* getElementByAccessKey(const String& key) const; | 111 Element* getElementByAccessKey(const String& key) const; |
111 | 112 |
112 DECLARE_VIRTUAL_TRACE(); | 113 DECLARE_VIRTUAL_TRACE(); |
113 | 114 |
114 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol
ver.get(); } | 115 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol
ver.get(); } |
115 ScopedStyleResolver& ensureScopedStyleResolver(); | 116 ScopedStyleResolver& ensureScopedStyleResolver(); |
116 void clearScopedStyleResolver(); | 117 void clearScopedStyleResolver(); |
117 | 118 |
| 119 const SVGTreeScopeResources* svgTreeScopedResources(); |
| 120 SVGTreeScopeResources& accessSVGTreeScopedResources(); |
| 121 |
118 protected: | 122 protected: |
119 TreeScope(ContainerNode&, Document&); | 123 TreeScope(ContainerNode&, Document&); |
120 TreeScope(Document&); | 124 TreeScope(Document&); |
121 virtual ~TreeScope(); | 125 virtual ~TreeScope(); |
122 | 126 |
123 void setDocument(Document& document) { m_document = &document; } | 127 void setDocument(Document& document) { m_document = &document; } |
124 void setParentTreeScope(TreeScope&); | 128 void setParentTreeScope(TreeScope&); |
125 void setNeedsStyleRecalcForViewportUnits(); | 129 void setNeedsStyleRecalcForViewportUnits(); |
126 | 130 |
127 private: | 131 private: |
128 Member<ContainerNode> m_rootNode; | 132 Member<ContainerNode> m_rootNode; |
129 Member<Document> m_document; | 133 Member<Document> m_document; |
130 Member<TreeScope> m_parentTreeScope; | 134 Member<TreeScope> m_parentTreeScope; |
131 | 135 |
132 Member<DocumentOrderedMap> m_elementsById; | 136 Member<DocumentOrderedMap> m_elementsById; |
133 Member<DocumentOrderedMap> m_imageMapsByName; | 137 Member<DocumentOrderedMap> m_imageMapsByName; |
134 | 138 |
135 Member<IdTargetObserverRegistry> m_idTargetObserverRegistry; | 139 Member<IdTargetObserverRegistry> m_idTargetObserverRegistry; |
136 | 140 |
137 Member<ScopedStyleResolver> m_scopedStyleResolver; | 141 Member<ScopedStyleResolver> m_scopedStyleResolver; |
138 | 142 |
139 mutable Member<DOMSelection> m_selection; | 143 mutable Member<DOMSelection> m_selection; |
140 | 144 |
141 RadioButtonGroupScope m_radioButtonGroupScope; | 145 RadioButtonGroupScope m_radioButtonGroupScope; |
| 146 |
| 147 Member<SVGTreeScopeResources> m_svgTreeScopedResources; |
| 148 |
142 }; | 149 }; |
143 | 150 |
144 inline bool TreeScope::hasElementWithId(const AtomicString& id) const | 151 inline bool TreeScope::hasElementWithId(const AtomicString& id) const |
145 { | 152 { |
146 DCHECK(!id.isNull()); | 153 DCHECK(!id.isNull()); |
147 return m_elementsById && m_elementsById->contains(id); | 154 return m_elementsById && m_elementsById->contains(id); |
148 } | 155 } |
149 | 156 |
150 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co
nst | 157 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co
nst |
151 { | 158 { |
152 return m_elementsById && m_elementsById->containsMultiple(id); | 159 return m_elementsById && m_elementsById->containsMultiple(id); |
153 } | 160 } |
154 | 161 |
155 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) | 162 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) |
156 | 163 |
157 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ
est& = HitTestRequest::ReadOnly | HitTestRequest::Active); | 164 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ
est& = HitTestRequest::ReadOnly | HitTestRequest::Active); |
158 | 165 |
159 } // namespace blink | 166 } // namespace blink |
160 | 167 |
161 #endif // TreeScope_h | 168 #endif // TreeScope_h |
OLD | NEW |