| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class ContainerNode; | 36 class ContainerNode; |
| 37 class DOMSelection; | 37 class DOMSelection; |
| 38 class Document; | 38 class Document; |
| 39 class Element; | 39 class Element; |
| 40 class HitTestResult; | 40 class HitTestResult; |
| 41 class Node; | 41 class Node; |
| 42 class ScopedStyleResolver; | 42 class ScopedStyleResolver; |
| 43 class StyleSheetCollection; | |
| 44 | 43 |
| 45 // A class which inherits both Node and TreeScope must call clearRareData() in i
ts destructor | 44 // A class which inherits both Node and TreeScope must call clearRareData() in i
ts destructor |
| 46 // so that the Node destructor no longer does problematic NodeList cache manipul
ation in | 45 // so that the Node destructor no longer does problematic NodeList cache manipul
ation in |
| 47 // the destructor. | 46 // the destructor. |
| 48 class TreeScope { | 47 class TreeScope { |
| 49 public: | 48 public: |
| 50 TreeScope* parentTreeScope() const { return m_parentTreeScope; } | 49 TreeScope* parentTreeScope() const { return m_parentTreeScope; } |
| 51 | 50 |
| 52 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope&
) const; | 51 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope&
) const; |
| 53 | 52 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 105 |
| 107 bool isInclusiveAncestorOf(const TreeScope&) const; | 106 bool isInclusiveAncestorOf(const TreeScope&) const; |
| 108 unsigned short comparePosition(const TreeScope&) const; | 107 unsigned short comparePosition(const TreeScope&) const; |
| 109 | 108 |
| 110 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const; | 109 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const; |
| 111 TreeScope* commonAncestorTreeScope(TreeScope& other); | 110 TreeScope* commonAncestorTreeScope(TreeScope& other); |
| 112 | 111 |
| 113 Element* getElementByAccessKey(const String& key) const; | 112 Element* getElementByAccessKey(const String& key) const; |
| 114 | 113 |
| 115 ScopedStyleResolver& scopedStyleResolver() const { return *m_scopedStyleReso
lver; } | 114 ScopedStyleResolver& scopedStyleResolver() const { return *m_scopedStyleReso
lver; } |
| 116 StyleSheetCollection& styleSheets() const { return *m_styleSheets; } | |
| 117 | 115 |
| 118 protected: | 116 protected: |
| 119 TreeScope(ContainerNode&, Document&); | 117 TreeScope(ContainerNode&, Document&); |
| 120 explicit TreeScope(Document&); | 118 explicit TreeScope(Document&); |
| 121 virtual ~TreeScope(); | 119 virtual ~TreeScope(); |
| 122 | 120 |
| 123 #if !ENABLE(OILPAN) | 121 #if !ENABLE(OILPAN) |
| 124 void destroyTreeScopeData(); | 122 void destroyTreeScopeData(); |
| 125 #endif | 123 #endif |
| 126 | 124 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 148 #endif | 146 #endif |
| 149 #endif | 147 #endif |
| 150 | 148 |
| 151 bool rootNodeHasTreeSharedParent() const; | 149 bool rootNodeHasTreeSharedParent() const; |
| 152 | 150 |
| 153 RawPtr<ContainerNode> m_rootNode; | 151 RawPtr<ContainerNode> m_rootNode; |
| 154 RawPtr<Document> m_document; | 152 RawPtr<Document> m_document; |
| 155 RawPtr<TreeScope> m_parentTreeScope; | 153 RawPtr<TreeScope> m_parentTreeScope; |
| 156 | 154 |
| 157 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver; | 155 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver; |
| 158 OwnPtr<StyleSheetCollection> m_styleSheets; | |
| 159 | 156 |
| 160 OwnPtr<DocumentOrderedMap> m_elementsById; | 157 OwnPtr<DocumentOrderedMap> m_elementsById; |
| 161 OwnPtr<DocumentOrderedMap> m_imageMapsByName; | 158 OwnPtr<DocumentOrderedMap> m_imageMapsByName; |
| 162 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute; | 159 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute; |
| 163 | 160 |
| 164 mutable RefPtr<DOMSelection> m_selection; | 161 mutable RefPtr<DOMSelection> m_selection; |
| 165 | 162 |
| 166 int m_guardRefCount; | 163 int m_guardRefCount; |
| 167 }; | 164 }; |
| 168 | 165 |
| 169 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) | 166 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) |
| 170 | 167 |
| 171 HitTestResult hitTestInDocument(const Document*, int x, int y); | 168 HitTestResult hitTestInDocument(const Document*, int x, int y); |
| 172 TreeScope* commonTreeScope(Node*, Node*); | 169 TreeScope* commonTreeScope(Node*, Node*); |
| 173 | 170 |
| 174 } // namespace blink | 171 } // namespace blink |
| 175 | 172 |
| 176 #endif // SKY_ENGINE_CORE_DOM_TREESCOPE_H_ | 173 #endif // SKY_ENGINE_CORE_DOM_TREESCOPE_H_ |
| OLD | NEW |