| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope&
) const; | 57 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope&
) const; |
| 58 | 58 |
| 59 Element* adjustedFocusedElement() const; | 59 Element* adjustedFocusedElement() const; |
| 60 Element* getElementById(const AtomicString&) const; | 60 Element* getElementById(const AtomicString&) const; |
| 61 const WillBeHeapVector<RawPtrWillBeMember<Element>>& getAllElementsById(cons
t AtomicString&) const; | 61 const WillBeHeapVector<RawPtrWillBeMember<Element>>& getAllElementsById(cons
t AtomicString&) const; |
| 62 bool hasElementWithId(const AtomicString& id) const; | 62 bool hasElementWithId(const AtomicString& id) const; |
| 63 bool containsMultipleElementsWithId(const AtomicString& id) const; | 63 bool containsMultipleElementsWithId(const AtomicString& id) const; |
| 64 void addElementById(const AtomicString& elementId, Element*); | 64 void addElementById(const AtomicString& elementId, Element*); |
| 65 void removeElementById(const AtomicString& elementId, Element*); | 65 void removeElementById(const AtomicString& elementId, Element*); |
| 66 | 66 |
| 67 Document& document() const; | 67 Document& document() const |
| 68 { |
| 69 ASSERT(m_document); |
| 70 return *m_document; |
| 71 } |
| 68 | 72 |
| 69 Node* ancestorInThisScope(Node*) const; | 73 Node* ancestorInThisScope(Node*) const; |
| 70 | 74 |
| 71 void addImageMap(HTMLMapElement*); | 75 void addImageMap(HTMLMapElement*); |
| 72 void removeImageMap(HTMLMapElement*); | 76 void removeImageMap(HTMLMapElement*); |
| 73 HTMLMapElement* getImageMap(const String& url) const; | 77 HTMLMapElement* getImageMap(const String& url) const; |
| 74 | 78 |
| 75 Element* elementFromPoint(int x, int y) const; | 79 Element* elementFromPoint(int x, int y) const; |
| 76 Element* hitTestPoint(int x, int y, const HitTestRequest&) const; | 80 Element* hitTestPoint(int x, int y, const HitTestRequest&) const; |
| 77 WillBeHeapVector<RawPtrWillBeMember<Element>> elementsFromPoint(int x, int y
) const; | 81 WillBeHeapVector<RawPtrWillBeMember<Element>> elementsFromPoint(int x, int y
) const; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 90 // for an anchor with the given name. ID matching is always case sensitive,
but | 94 // for an anchor with the given name. ID matching is always case sensitive,
but |
| 91 // Anchor name matching is case sensitive in strict mode and not case sensit
ive in | 95 // Anchor name matching is case sensitive in strict mode and not case sensit
ive in |
| 92 // quirks mode for historical compatibility reasons. | 96 // quirks mode for historical compatibility reasons. |
| 93 Element* findAnchor(const String& name); | 97 Element* findAnchor(const String& name); |
| 94 | 98 |
| 95 // Used by the basic DOM mutation methods (e.g., appendChild()). | 99 // Used by the basic DOM mutation methods (e.g., appendChild()). |
| 96 void adoptIfNeeded(Node&); | 100 void adoptIfNeeded(Node&); |
| 97 | 101 |
| 98 ContainerNode& rootNode() const { return *m_rootNode; } | 102 ContainerNode& rootNode() const { return *m_rootNode; } |
| 99 | 103 |
| 100 IdTargetObserverRegistry& idTargetObserverRegistry() const; | 104 IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTar
getObserverRegistry.get(); } |
| 101 | 105 |
| 102 #if !ENABLE(OILPAN) | 106 #if !ENABLE(OILPAN) |
| 103 // Nodes belonging to this scope hold guard references - | 107 // Nodes belonging to this scope hold guard references - |
| 104 // these are enough to keep the scope from being destroyed, but | 108 // these are enough to keep the scope from being destroyed, but |
| 105 // not enough to keep it from removing its children. This allows a | 109 // not enough to keep it from removing its children. This allows a |
| 106 // node that outlives its scope to still have a valid document | 110 // node that outlives its scope to still have a valid document |
| 107 // pointer without introducing reference cycles. | 111 // pointer without introducing reference cycles. |
| 108 void guardRef() | 112 void guardRef() |
| 109 { | 113 { |
| 110 ASSERT(!deletionHasBegun()); | 114 ASSERT(!deletionHasBegun()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 128 bool isInclusiveAncestorOf(const TreeScope&) const; | 132 bool isInclusiveAncestorOf(const TreeScope&) const; |
| 129 unsigned short comparePosition(const TreeScope&) const; | 133 unsigned short comparePosition(const TreeScope&) const; |
| 130 | 134 |
| 131 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const; | 135 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const; |
| 132 TreeScope* commonAncestorTreeScope(TreeScope& other); | 136 TreeScope* commonAncestorTreeScope(TreeScope& other); |
| 133 | 137 |
| 134 Element* getElementByAccessKey(const String& key) const; | 138 Element* getElementByAccessKey(const String& key) const; |
| 135 | 139 |
| 136 DECLARE_VIRTUAL_TRACE(); | 140 DECLARE_VIRTUAL_TRACE(); |
| 137 | 141 |
| 138 ScopedStyleResolver* scopedStyleResolver() const; | 142 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol
ver.get(); } |
| 139 ScopedStyleResolver& ensureScopedStyleResolver(); | 143 ScopedStyleResolver& ensureScopedStyleResolver(); |
| 140 void clearScopedStyleResolver(); | 144 void clearScopedStyleResolver(); |
| 141 | 145 |
| 142 protected: | 146 protected: |
| 143 TreeScope(ContainerNode&, Document&); | 147 TreeScope(ContainerNode&, Document&); |
| 144 TreeScope(Document&); | 148 TreeScope(Document&); |
| 145 virtual ~TreeScope(); | 149 virtual ~TreeScope(); |
| 146 | 150 |
| 147 #if !ENABLE(OILPAN) | 151 #if !ENABLE(OILPAN) |
| 148 void destroyTreeScopeData(); | 152 void destroyTreeScopeData(); |
| 149 #endif | 153 #endif |
| 150 | 154 |
| 151 void setDocument(Document&); | 155 void setDocument(Document& document) { m_document = &document; } |
| 152 void setParentTreeScope(TreeScope&); | 156 void setParentTreeScope(TreeScope&); |
| 153 | 157 |
| 154 #if !ENABLE(OILPAN) | 158 #if !ENABLE(OILPAN) |
| 155 bool hasGuardRefCount() const { return m_guardRefCount; } | 159 bool hasGuardRefCount() const { return m_guardRefCount; } |
| 156 #endif | 160 #endif |
| 157 | 161 |
| 158 void setNeedsStyleRecalcForViewportUnits(); | 162 void setNeedsStyleRecalcForViewportUnits(); |
| 159 | 163 |
| 160 private: | 164 private: |
| 161 #if !ENABLE(OILPAN) | 165 #if !ENABLE(OILPAN) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return m_elementsById && m_elementsById->containsMultiple(id); | 208 return m_elementsById && m_elementsById->containsMultiple(id); |
| 205 } | 209 } |
| 206 | 210 |
| 207 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) | 211 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) |
| 208 | 212 |
| 209 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ
est& = HitTestRequest::ReadOnly | HitTestRequest::Active); | 213 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ
est& = HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 210 | 214 |
| 211 } // namespace blink | 215 } // namespace blink |
| 212 | 216 |
| 213 #endif // TreeScope_h | 217 #endif // TreeScope_h |
| OLD | NEW |