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

Side by Side Diff: third_party/WebKit/Source/core/dom/TreeScope.h

Issue 1555653002: Handle some failing DocumentOrderedMap ID lookups across tree removals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test Created 4 years, 11 months 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
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 TreeScope* commonAncestorTreeScope(TreeScope& other); 136 TreeScope* commonAncestorTreeScope(TreeScope& other);
137 137
138 Element* getElementByAccessKey(const String& key) const; 138 Element* getElementByAccessKey(const String& key) const;
139 139
140 DECLARE_VIRTUAL_TRACE(); 140 DECLARE_VIRTUAL_TRACE();
141 141
142 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol ver.get(); } 142 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol ver.get(); }
143 ScopedStyleResolver& ensureScopedStyleResolver(); 143 ScopedStyleResolver& ensureScopedStyleResolver();
144 void clearScopedStyleResolver(); 144 void clearScopedStyleResolver();
145 145
146 #if ENABLE(ASSERT)
147 class RemoveScope {
148 STACK_ALLOCATED();
149 public:
150 explicit RemoveScope(ContainerNode*);
esprehn 2016/01/05 07:48:33 reference, this should also be nested inside the m
151 ~RemoveScope();
152 private:
153 RawPtrWillBeMember<DocumentOrderedMap> m_idMap;
154 };
155 #endif
156
146 protected: 157 protected:
147 TreeScope(ContainerNode&, Document&); 158 TreeScope(ContainerNode&, Document&);
148 TreeScope(Document&); 159 TreeScope(Document&);
149 virtual ~TreeScope(); 160 virtual ~TreeScope();
150 161
151 #if !ENABLE(OILPAN) 162 #if !ENABLE(OILPAN)
152 void destroyTreeScopeData(); 163 void destroyTreeScopeData();
153 #endif 164 #endif
154 165
155 void setDocument(Document& document) { m_document = &document; } 166 void setDocument(Document& document) { m_document = &document; }
156 void setParentTreeScope(TreeScope&); 167 void setParentTreeScope(TreeScope&);
157 168
158 #if !ENABLE(OILPAN) 169 #if !ENABLE(OILPAN)
159 bool hasGuardRefCount() const { return m_guardRefCount; } 170 bool hasGuardRefCount() const { return m_guardRefCount; }
160 #endif 171 #endif
161 172
162 void setNeedsStyleRecalcForViewportUnits(); 173 void setNeedsStyleRecalcForViewportUnits();
163 174
164 private: 175 private:
176 friend class RemoveScope;
177
165 #if !ENABLE(OILPAN) 178 #if !ENABLE(OILPAN)
166 virtual void dispose() { } 179 virtual void dispose() { }
167 180
168 int refCount() const; 181 int refCount() const;
169 182
170 #if ENABLE(SECURITY_ASSERT) 183 #if ENABLE(SECURITY_ASSERT)
171 bool deletionHasBegun(); 184 bool deletionHasBegun();
172 void beginDeletion(); 185 void beginDeletion();
173 #else 186 #else
174 bool deletionHasBegun() { return false; } 187 bool deletionHasBegun() { return false; }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 return m_elementsById && m_elementsById->containsMultiple(id); 221 return m_elementsById && m_elementsById->containsMultiple(id);
209 } 222 }
210 223
211 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) 224 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope)
212 225
213 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ est& = HitTestRequest::ReadOnly | HitTestRequest::Active); 226 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ est& = HitTestRequest::ReadOnly | HitTestRequest::Active);
214 227
215 } // namespace blink 228 } // namespace blink
216 229
217 #endif // TreeScope_h 230 #endif // TreeScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698