| 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;
|
|
|