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

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

Issue 1870583002: Update the behavior of ShadowRoot.activeElement to match the latest spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | 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 b7b72b8f4f9f5b7eefbd57ba33144125439dc7a5..64707e75a5b5a26443738d5c541f20682e1d6e10 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -429,6 +429,14 @@ Element* TreeScope::adjustedFocusedElement() const
if (!element)
return nullptr;
+ if (rootNode().isInV1ShadowTree()) {
+ if (Node* retargeted = rootNode().retarget(*element)) {
+ DCHECK(retargeted->isElementNode());
+ return this == &retargeted->treeScope() ? toElement(retargeted) : nullptr;
+ }
+ return nullptr;
+ }
+
RawPtr<EventPath> eventPath = new EventPath(*element);
for (size_t i = 0; i < eventPath->size(); ++i) {
if (eventPath->at(i).node() == rootNode()) {
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698