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

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

Issue 705473004: Remove most of DocumentOrderedMap. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/DocumentOrderedMap.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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // the destructor. 46 // the destructor.
47 class TreeScope : public DummyBase<void> { 47 class TreeScope : public DummyBase<void> {
48 public: 48 public:
49 TreeScope* parentTreeScope() const { return m_parentTreeScope; } 49 TreeScope* parentTreeScope() const { return m_parentTreeScope; }
50 50
51 TreeScope* olderShadowRootOrParentTreeScope() const; 51 TreeScope* olderShadowRootOrParentTreeScope() const;
52 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope& ) const; 52 bool isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope& ) const;
53 53
54 Element* adjustedFocusedElement() const; 54 Element* adjustedFocusedElement() const;
55 Element* getElementById(const AtomicString&) const; 55 Element* getElementById(const AtomicString&) const;
56 const Vector<RawPtr<Element> >& getAllElementsById(const AtomicString&) cons t;
57 bool hasElementWithId(const AtomicString& id) const;
58 bool containsMultipleElementsWithId(const AtomicString& id) const;
59 void addElementById(const AtomicString& elementId, Element*); 56 void addElementById(const AtomicString& elementId, Element*);
60 void removeElementById(const AtomicString& elementId, Element*); 57 void removeElementById(const AtomicString& elementId, Element*);
61 58
62 Document& document() const 59 Document& document() const
63 { 60 {
64 ASSERT(m_document); 61 ASSERT(m_document);
65 return *m_document; 62 return *m_document;
66 } 63 }
67 64
68 Node* ancestorInThisScope(Node*) const; 65 Node* ancestorInThisScope(Node*) const;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 164
168 OwnPtr<DocumentOrderedMap> m_elementsById; 165 OwnPtr<DocumentOrderedMap> m_elementsById;
169 OwnPtr<DocumentOrderedMap> m_imageMapsByName; 166 OwnPtr<DocumentOrderedMap> m_imageMapsByName;
170 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute; 167 OwnPtr<DocumentOrderedMap> m_labelsByForAttribute;
171 168
172 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver; 169 OwnPtr<ScopedStyleResolver> m_scopedStyleResolver;
173 170
174 mutable RefPtr<DOMSelection> m_selection; 171 mutable RefPtr<DOMSelection> m_selection;
175 }; 172 };
176 173
177 inline bool TreeScope::hasElementWithId(const AtomicString& id) const
178 {
179 ASSERT(!id.isNull());
180 return m_elementsById && m_elementsById->contains(id);
181 }
182
183 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co nst
184 {
185 return m_elementsById && m_elementsById->containsMultiple(id);
186 }
187
188 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) 174 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope)
189 175
190 HitTestResult hitTestInDocument(const Document*, int x, int y); 176 HitTestResult hitTestInDocument(const Document*, int x, int y);
191 TreeScope* commonTreeScope(Node*, Node*); 177 TreeScope* commonTreeScope(Node*, Node*);
192 178
193 } // namespace blink 179 } // namespace blink
194 180
195 #endif // TreeScope_h 181 #endif // TreeScope_h
OLDNEW
« no previous file with comments | « sky/engine/core/dom/DocumentOrderedMap.cpp ('k') | sky/engine/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698