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

Unified Diff: third_party/WebKit/Source/core/dom/TreeScope.cpp

Issue 2905043002: Make DocumentOrderedMap take a const reference for scope (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/TreeScope.cpp
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp
index f1aeb2839c84de87fb26f1e7857026b44f2f1f61..4df48fd20c3bb623e90a8d9e70842e78e84a0401 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -123,7 +123,7 @@ Element* TreeScope::getElementById(const AtomicString& element_id) const {
return nullptr;
if (!elements_by_id_)
return nullptr;
- return elements_by_id_->GetElementById(element_id, this);
+ return elements_by_id_->GetElementById(element_id, *this);
}
const HeapVector<Member<Element>>& TreeScope::GetAllElementsById(
@@ -134,7 +134,7 @@ const HeapVector<Member<Element>>& TreeScope::GetAllElementsById(
return empty_vector;
if (!elements_by_id_)
return empty_vector;
- return elements_by_id_->GetAllElementsById(element_id, this);
+ return elements_by_id_->GetAllElementsById(element_id, *this);
}
void TreeScope::AddElementById(const AtomicString& element_id,
@@ -192,7 +192,7 @@ HTMLMapElement* TreeScope::GetImageMap(const String& url) const {
size_t hash_pos = url.find('#');
String name = hash_pos == kNotFound ? url : url.Substring(hash_pos + 1);
return toHTMLMapElement(
- image_maps_by_name_->GetElementByMapName(AtomicString(name), this));
+ image_maps_by_name_->GetElementByMapName(AtomicString(name), *this));
}
static bool PointWithScrollAndZoomIfPossible(const Document& document,
@@ -453,11 +453,10 @@ unsigned short TreeScope::ComparePosition(const TreeScope& other_scope) const {
// There was no difference between the two parent chains, i.e., one was a
// subset of the other. The shorter chain is the ancestor.
- return index1 < index2
- ? Node::kDocumentPositionFollowing |
- Node::kDocumentPositionContainedBy
- : Node::kDocumentPositionPreceding |
- Node::kDocumentPositionContains;
+ return index1 < index2 ? Node::kDocumentPositionFollowing |
+ Node::kDocumentPositionContainedBy
+ : Node::kDocumentPositionPreceding |
+ Node::kDocumentPositionContains;
}
const TreeScope* TreeScope::CommonAncestorTreeScope(

Powered by Google App Engine
This is Rietveld 408576698