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

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

Issue 2555743005: Add iterator support to blink::EventPath. (Closed)
Patch Set: Exposed the vector Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6ac08cc971f34c3373be86f396648544d5374db0..50ca8a1d90987c19db8982a24d8d9e551acef7e3 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -410,14 +410,14 @@ Element* TreeScope::adjustedFocusedElement() const {
}
EventPath* eventPath = new EventPath(*element);
- for (size_t i = 0; i < eventPath->size(); ++i) {
- if (eventPath->at(i).node() == rootNode()) {
- // eventPath->at(i).target() is one of the followings:
+ for (const auto& context : eventPath->nodeEventContexts()) {
+ if (context.node() == rootNode()) {
+ // context.target() is one of the followings:
// - InsertionPoint
// - shadow host
// - Document::focusedElement()
// So, it's safe to do toElement().
- return toElement(eventPath->at(i).target()->toNode());
+ return toElement(context.target()->toNode());
}
}
return nullptr;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698