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

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

Issue 2821303005: [selectors4] Use common ancestor strategy for :focus-within (Closed)
Patch Set: Use EXPECT_EQ instead of ASSERT_EQ Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.h ('k') | third_party/WebKit/Source/core/dom/Document.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/ContainerNode.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index 3de58c2b8b065a3bc08c1e1f237b27374c12ecc8..1473d7c8d01bc6dffb15b32cb2714b340ea73385 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -1069,13 +1069,6 @@ void ContainerNode::SetFocused(bool received, WebFocusType focus_type) {
FocusStateChanged();
- UpdateDistribution();
- for (ContainerNode* node = this; node;
- node = FlatTreeTraversal::Parent(*node)) {
- node->SetHasFocusWithin(received);
- node->FocusWithinStateChanged();
- }
-
if (GetLayoutObject() || received)
return;
@@ -1100,6 +1093,14 @@ void ContainerNode::SetFocused(bool received, WebFocusType focus_type) {
}
}
+void ContainerNode::SetHasFocusWithinUpToAncestor(bool flag, Node* ancestor) {
+ for (ContainerNode* node = this; node && node != ancestor;
+ node = FlatTreeTraversal::Parent(*node)) {
+ node->SetHasFocusWithin(flag);
+ node->FocusWithinStateChanged();
+ }
+}
+
void ContainerNode::SetActive(bool down) {
if (down == IsActive())
return;
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.h ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698