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

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

Issue 1932523003: Introduce NodeTraversal::ancestorsOf() and inclusiveAncestors() for range-based for loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-04-28T16:44:17 Created 4 years, 8 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/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 45a91520ec31434010ac96e70b77e51e429b7f9c..34ff07c2cf14906e0cb1c837812569039532a851 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5610,8 +5610,8 @@ void Document::updateHoverActiveState(const HitTestRequest& request, Element* in
// (for instance by setting display:none in the :hover pseudo-class). In this case, the old hovered element (and its ancestors)
// must be updated, to ensure it's normal style is re-applied.
if (oldHoverNode && !oldHoverObj) {
- for (Node* node = oldHoverNode; node; node = node->parentNode()) {
- if (!mustBeInActiveChain || (node->isElementNode() && toElement(node)->inActiveChain()))
+ for (Node& node : NodeTraversal::ancestorsOrSelfOf(oldHoverNode)) {
+ if (!mustBeInActiveChain || (node.isElementNode() && toElement(node).inActiveChain()))
nodesToRemoveFromChain.append(node);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | third_party/WebKit/Source/core/dom/NodeTraversal.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698