| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 Element* adjustedFocusedElement() const; | 60 Element* adjustedFocusedElement() const; |
| 61 Element* getElementById(const AtomicString&) const; | 61 Element* getElementById(const AtomicString&) const; |
| 62 const HeapVector<Member<Element>>& getAllElementsById(const AtomicString&) c
onst; | 62 const HeapVector<Member<Element>>& getAllElementsById(const AtomicString&) c
onst; |
| 63 bool hasElementWithId(const AtomicString& id) const; | 63 bool hasElementWithId(const AtomicString& id) const; |
| 64 bool containsMultipleElementsWithId(const AtomicString& id) const; | 64 bool containsMultipleElementsWithId(const AtomicString& id) const; |
| 65 void addElementById(const AtomicString& elementId, Element*); | 65 void addElementById(const AtomicString& elementId, Element*); |
| 66 void removeElementById(const AtomicString& elementId, Element*); | 66 void removeElementById(const AtomicString& elementId, Element*); |
| 67 | 67 |
| 68 Document& document() const | 68 Document& document() const |
| 69 { | 69 { |
| 70 ASSERT(m_document); | 70 DCHECK(m_document); |
| 71 return *m_document; | 71 return *m_document; |
| 72 } | 72 } |
| 73 | 73 |
| 74 Node* ancestorInThisScope(Node*) const; | 74 Node* ancestorInThisScope(Node*) const; |
| 75 | 75 |
| 76 void addImageMap(HTMLMapElement*); | 76 void addImageMap(HTMLMapElement*); |
| 77 void removeImageMap(HTMLMapElement*); | 77 void removeImageMap(HTMLMapElement*); |
| 78 HTMLMapElement* getImageMap(const String& url) const; | 78 HTMLMapElement* getImageMap(const String& url) const; |
| 79 | 79 |
| 80 Element* elementFromPoint(int x, int y) const; | 80 Element* elementFromPoint(int x, int y) const; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 107 RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupSc
ope; } | 107 RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupSc
ope; } |
| 108 | 108 |
| 109 #if !ENABLE(OILPAN) | 109 #if !ENABLE(OILPAN) |
| 110 // Nodes belonging to this scope hold guard references - | 110 // Nodes belonging to this scope hold guard references - |
| 111 // these are enough to keep the scope from being destroyed, but | 111 // these are enough to keep the scope from being destroyed, but |
| 112 // not enough to keep it from removing its children. This allows a | 112 // not enough to keep it from removing its children. This allows a |
| 113 // node that outlives its scope to still have a valid document | 113 // node that outlives its scope to still have a valid document |
| 114 // pointer without introducing reference cycles. | 114 // pointer without introducing reference cycles. |
| 115 void guardRef() | 115 void guardRef() |
| 116 { | 116 { |
| 117 ASSERT(!deletionHasBegun()); | 117 DCHECK(!deletionHasBegun()); |
| 118 ++m_guardRefCount; | 118 ++m_guardRefCount; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void guardDeref() | 121 void guardDeref() |
| 122 { | 122 { |
| 123 ASSERT(m_guardRefCount > 0); | 123 DCHECK_GT(m_guardRefCount, 0); |
| 124 ASSERT(!deletionHasBegun()); | 124 DCHECK(!deletionHasBegun()); |
| 125 --m_guardRefCount; | 125 --m_guardRefCount; |
| 126 if (!m_guardRefCount && !refCount() && !rootNodeHasTreeSharedParent()) { | 126 if (!m_guardRefCount && !refCount() && !rootNodeHasTreeSharedParent()) { |
| 127 beginDeletion(); | 127 beginDeletion(); |
| 128 delete this; | 128 delete this; |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 void removedLastRefToScope(); | 133 void removedLastRefToScope(); |
| 134 | 134 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 Member<ScopedStyleResolver> m_scopedStyleResolver; | 198 Member<ScopedStyleResolver> m_scopedStyleResolver; |
| 199 | 199 |
| 200 mutable Member<DOMSelection> m_selection; | 200 mutable Member<DOMSelection> m_selection; |
| 201 | 201 |
| 202 RadioButtonGroupScope m_radioButtonGroupScope; | 202 RadioButtonGroupScope m_radioButtonGroupScope; |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 inline bool TreeScope::hasElementWithId(const AtomicString& id) const | 205 inline bool TreeScope::hasElementWithId(const AtomicString& id) const |
| 206 { | 206 { |
| 207 ASSERT(!id.isNull()); | 207 DCHECK(!id.isNull()); |
| 208 return m_elementsById && m_elementsById->contains(id); | 208 return m_elementsById && m_elementsById->contains(id); |
| 209 } | 209 } |
| 210 | 210 |
| 211 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co
nst | 211 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co
nst |
| 212 { | 212 { |
| 213 return m_elementsById && m_elementsById->containsMultiple(id); | 213 return m_elementsById && m_elementsById->containsMultiple(id); |
| 214 } | 214 } |
| 215 | 215 |
| 216 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) | 216 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) |
| 217 | 217 |
| 218 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ
est& = HitTestRequest::ReadOnly | HitTestRequest::Active); | 218 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ
est& = HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| 221 | 221 |
| 222 #endif // TreeScope_h | 222 #endif // TreeScope_h |
| OLD | NEW |