Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: sky/engine/core/dom/TreeScope.h

Issue 815653002: Remove global list map of TreeScope to StyleSheetCollection. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/StyleEngine.cpp ('k') | sky/engine/core/dom/TreeScope.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
43 44
44 // A class which inherits both Node and TreeScope must call clearRareData() in i ts destructor 45 // A class which inherits both Node and TreeScope must call clearRareData() in i ts destructor
45 // so that the Node destructor no longer does problematic NodeList cache manipul ation in 46 // so that the Node destructor no longer does problematic NodeList cache manipul ation in
46 // the destructor. 47 // the destructor.
47 class TreeScope { 48 class TreeScope {
48 public: 49 public:
49 TreeScope* parentTreeScope() const { return m_parentTreeScope; } 50 TreeScope* parentTreeScope() const { return m_parentTreeScope; }
50 51
51 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope& ) const; 52 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope& ) const;
52 53
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 108
108 bool isInclusiveAncestorOf(const TreeScope&) const; 109 bool isInclusiveAncestorOf(const TreeScope&) const;
109 unsigned short comparePosition(const TreeScope&) const; 110 unsigned short comparePosition(const TreeScope&) const;
110 111
111 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const; 112 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const;
112 TreeScope* commonAncestorTreeScope(TreeScope& other); 113 TreeScope* commonAncestorTreeScope(TreeScope& other);
113 114
114 Element* getElementByAccessKey(const String& key) const; 115 Element* getElementByAccessKey(const String& key) const;
115 116
116 ScopedStyleResolver& scopedStyleResolver() const { return *m_scopedStyleReso lver; } 117 ScopedStyleResolver& scopedStyleResolver() const { return *m_scopedStyleReso lver; }
118 StyleSheetCollection& styleSheets() const { return *m_styleSheets; }
117 119
118 protected: 120 protected:
119 TreeScope(ContainerNode&, Document&); 121 TreeScope(ContainerNode&, Document&);
120 explicit TreeScope(Document&); 122 explicit TreeScope(Document&);
121 virtual ~TreeScope(); 123 virtual ~TreeScope();
122 124
123 #if !ENABLE(OILPAN) 125 #if !ENABLE(OILPAN)
124 void destroyTreeScopeData(); 126 void destroyTreeScopeData();
125 #endif 127 #endif
126 128
(...skipping 21 matching lines...) Expand all
148 #endif 150 #endif
149 #endif 151 #endif
150 152
151 bool rootNodeHasTreeSharedParent() const; 153 bool rootNodeHasTreeSharedParent() const;
152 154
153 RawPtr<ContainerNode> m_rootNode; 155 RawPtr<ContainerNode> m_rootNode;
154 RawPtr<Document> m_document; 156 RawPtr<Document> m_document;
155 RawPtr<TreeScope> m_parentTreeScope; 157 RawPtr<TreeScope> m_parentTreeScope;
156 158
157 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver; 159 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver;
160 OwnPtr<StyleSheetCollection> m_styleSheets;
158 161
159 OwnPtr<DocumentOrderedMap> m_elementsById; 162 OwnPtr<DocumentOrderedMap> m_elementsById;
160 OwnPtr<DocumentOrderedMap> m_imageMapsByName; 163 OwnPtr<DocumentOrderedMap> m_imageMapsByName;
161 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute; 164 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute;
162 165
163 mutable RefPtr<DOMSelection> m_selection; 166 mutable RefPtr<DOMSelection> m_selection;
164 167
165 int m_guardRefCount; 168 int m_guardRefCount;
166 }; 169 };
167 170
168 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) 171 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope)
169 172
170 HitTestResult hitTestInDocument(const Document*, int x, int y); 173 HitTestResult hitTestInDocument(const Document*, int x, int y);
171 TreeScope* commonTreeScope(Node*, Node*); 174 TreeScope* commonTreeScope(Node*, Node*);
172 175
173 } // namespace blink 176 } // namespace blink
174 177
175 #endif // SKY_ENGINE_CORE_DOM_TREESCOPE_H_ 178 #endif // SKY_ENGINE_CORE_DOM_TREESCOPE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/dom/StyleEngine.cpp ('k') | sky/engine/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698