Chromium Code Reviews| 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 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class ContainerNode; | 39 class ContainerNode; |
| 40 class DOMSelection; | 40 class DOMSelection; |
| 41 class Document; | 41 class Document; |
| 42 class Element; | 42 class Element; |
| 43 class HTMLMapElement; | 43 class HTMLMapElement; |
| 44 class HitTestResult; | 44 class HitTestResult; |
| 45 class IdTargetObserverRegistry; | 45 class IdTargetObserverRegistry; |
| 46 class SVGTreeScopeResources; | |
| 46 class ScopedStyleResolver; | 47 class ScopedStyleResolver; |
| 47 class Node; | 48 class Node; |
| 48 | 49 |
| 49 // A class which inherits both Node and TreeScope must call clearRareData() in | 50 // A class which inherits both Node and TreeScope must call clearRareData() in |
| 50 // its destructor so that the Node destructor no longer does problematic | 51 // its destructor so that the Node destructor no longer does problematic |
| 51 // NodeList cache manipulation in the destructor. | 52 // NodeList cache manipulation in the destructor. |
| 52 class CORE_EXPORT TreeScope : public GarbageCollectedMixin { | 53 class CORE_EXPORT TreeScope : public GarbageCollectedMixin { |
| 53 public: | 54 public: |
| 54 TreeScope* parentTreeScope() const { return m_parentTreeScope; } | 55 TreeScope* parentTreeScope() const { return m_parentTreeScope; } |
| 55 | 56 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 Element* getElementByAccessKey(const String& key) const; | 121 Element* getElementByAccessKey(const String& key) const; |
| 121 | 122 |
| 122 DECLARE_VIRTUAL_TRACE(); | 123 DECLARE_VIRTUAL_TRACE(); |
| 123 | 124 |
| 124 ScopedStyleResolver* scopedStyleResolver() const { | 125 ScopedStyleResolver* scopedStyleResolver() const { |
| 125 return m_scopedStyleResolver.get(); | 126 return m_scopedStyleResolver.get(); |
| 126 } | 127 } |
| 127 ScopedStyleResolver& ensureScopedStyleResolver(); | 128 ScopedStyleResolver& ensureScopedStyleResolver(); |
| 128 void clearScopedStyleResolver(); | 129 void clearScopedStyleResolver(); |
| 129 | 130 |
| 131 const SVGTreeScopeResources* svgExtensions(); | |
| 132 SVGTreeScopeResources& accessSVGTreeScopedResources(); | |
|
pdr.
2017/01/23 04:34:12
optional: ensureSVGTreeScopedResources so it's mor
fs
2017/01/23 11:18:24
I don't see why not - we're replacing all instance
| |
| 133 | |
| 130 protected: | 134 protected: |
| 131 TreeScope(ContainerNode&, Document&); | 135 TreeScope(ContainerNode&, Document&); |
| 132 TreeScope(Document&); | 136 TreeScope(Document&); |
| 133 virtual ~TreeScope(); | 137 virtual ~TreeScope(); |
| 134 | 138 |
| 135 void setDocument(Document& document) { m_document = &document; } | 139 void setDocument(Document& document) { m_document = &document; } |
| 136 void setParentTreeScope(TreeScope&); | 140 void setParentTreeScope(TreeScope&); |
| 137 void setNeedsStyleRecalcForViewportUnits(); | 141 void setNeedsStyleRecalcForViewportUnits(); |
| 138 | 142 |
| 139 private: | 143 private: |
| 140 Member<ContainerNode> m_rootNode; | 144 Member<ContainerNode> m_rootNode; |
| 141 Member<Document> m_document; | 145 Member<Document> m_document; |
| 142 Member<TreeScope> m_parentTreeScope; | 146 Member<TreeScope> m_parentTreeScope; |
| 143 | 147 |
| 144 Member<DocumentOrderedMap> m_elementsById; | 148 Member<DocumentOrderedMap> m_elementsById; |
| 145 Member<DocumentOrderedMap> m_imageMapsByName; | 149 Member<DocumentOrderedMap> m_imageMapsByName; |
| 146 | 150 |
| 147 Member<IdTargetObserverRegistry> m_idTargetObserverRegistry; | 151 Member<IdTargetObserverRegistry> m_idTargetObserverRegistry; |
| 148 | 152 |
| 149 Member<ScopedStyleResolver> m_scopedStyleResolver; | 153 Member<ScopedStyleResolver> m_scopedStyleResolver; |
| 150 | 154 |
| 151 mutable Member<DOMSelection> m_selection; | 155 mutable Member<DOMSelection> m_selection; |
| 152 | 156 |
| 153 RadioButtonGroupScope m_radioButtonGroupScope; | 157 RadioButtonGroupScope m_radioButtonGroupScope; |
| 158 | |
| 159 Member<SVGTreeScopeResources> m_svgTreeScopedResources; | |
| 154 }; | 160 }; |
| 155 | 161 |
| 156 inline bool TreeScope::hasElementWithId(const AtomicString& id) const { | 162 inline bool TreeScope::hasElementWithId(const AtomicString& id) const { |
| 157 DCHECK(!id.isNull()); | 163 DCHECK(!id.isNull()); |
| 158 return m_elementsById && m_elementsById->contains(id); | 164 return m_elementsById && m_elementsById->contains(id); |
| 159 } | 165 } |
| 160 | 166 |
| 161 inline bool TreeScope::containsMultipleElementsWithId( | 167 inline bool TreeScope::containsMultipleElementsWithId( |
| 162 const AtomicString& id) const { | 168 const AtomicString& id) const { |
| 163 return m_elementsById && m_elementsById->containsMultiple(id); | 169 return m_elementsById && m_elementsById->containsMultiple(id); |
| 164 } | 170 } |
| 165 | 171 |
| 166 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) | 172 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) |
| 167 | 173 |
| 168 HitTestResult hitTestInDocument( | 174 HitTestResult hitTestInDocument( |
| 169 const Document*, | 175 const Document*, |
| 170 int x, | 176 int x, |
| 171 int y, | 177 int y, |
| 172 const HitTestRequest& = HitTestRequest::ReadOnly | HitTestRequest::Active); | 178 const HitTestRequest& = HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 173 | 179 |
| 174 } // namespace blink | 180 } // namespace blink |
| 175 | 181 |
| 176 #endif // TreeScope_h | 182 #endif // TreeScope_h |
| OLD | NEW |