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

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

Issue 810893002: Remove global set of ScopedStyleResolvers. (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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void removedLastRefToScope(); 106 void removedLastRefToScope();
107 107
108 bool isInclusiveAncestorOf(const TreeScope&) const; 108 bool isInclusiveAncestorOf(const TreeScope&) const;
109 unsigned short comparePosition(const TreeScope&) const; 109 unsigned short comparePosition(const TreeScope&) const;
110 110
111 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const; 111 const TreeScope* commonAncestorTreeScope(const TreeScope& other) const;
112 TreeScope* commonAncestorTreeScope(TreeScope& other); 112 TreeScope* commonAncestorTreeScope(TreeScope& other);
113 113
114 Element* getElementByAccessKey(const String& key) const; 114 Element* getElementByAccessKey(const String& key) const;
115 115
116 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol ver.get(); } 116 ScopedStyleResolver& scopedStyleResolver() const { return *m_scopedStyleReso lver; }
117 ScopedStyleResolver& ensureScopedStyleResolver();
118 void clearScopedStyleResolver();
119 117
120 protected: 118 protected:
121 TreeScope(ContainerNode&, Document&); 119 TreeScope(ContainerNode&, Document&);
122 explicit TreeScope(Document&); 120 explicit TreeScope(Document&);
123 virtual ~TreeScope(); 121 virtual ~TreeScope();
124 122
125 #if !ENABLE(OILPAN) 123 #if !ENABLE(OILPAN)
126 void destroyTreeScopeData(); 124 void destroyTreeScopeData();
127 #endif 125 #endif
128 126
(...skipping 20 matching lines...) Expand all
149 void beginDeletion() { } 147 void beginDeletion() { }
150 #endif 148 #endif
151 #endif 149 #endif
152 150
153 bool rootNodeHasTreeSharedParent() const; 151 bool rootNodeHasTreeSharedParent() const;
154 152
155 RawPtr<ContainerNode> m_rootNode; 153 RawPtr<ContainerNode> m_rootNode;
156 RawPtr<Document> m_document; 154 RawPtr<Document> m_document;
157 RawPtr<TreeScope> m_parentTreeScope; 155 RawPtr<TreeScope> m_parentTreeScope;
158 156
159 #if !ENABLE(OILPAN) 157 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver;
160 int m_guardRefCount;
161 #endif
162 158
163 OwnPtr<DocumentOrderedMap> m_elementsById; 159 OwnPtr<DocumentOrderedMap> m_elementsById;
164 OwnPtr<DocumentOrderedMap> m_imageMapsByName; 160 OwnPtr<DocumentOrderedMap> m_imageMapsByName;
165 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute; 161 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute;
166 162
167 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver; 163 mutable RefPtr<DOMSelection> m_selection;
168 164
169 mutable RefPtr<DOMSelection> m_selection; 165 int m_guardRefCount;
170 }; 166 };
171 167
172 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) 168 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope)
173 169
174 HitTestResult hitTestInDocument(const Document*, int x, int y); 170 HitTestResult hitTestInDocument(const Document*, int x, int y);
175 TreeScope* commonTreeScope(Node*, Node*); 171 TreeScope* commonTreeScope(Node*, Node*);
176 172
177 } // namespace blink 173 } // namespace blink
178 174
179 #endif // SKY_ENGINE_CORE_DOM_TREESCOPE_H_ 175 #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