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

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

Issue 1423053002: Make document.activeElement work with OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-preserve-page-focus-on-subframe-navigations
Patch Set: Created 5 years, 2 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/TreeScope.cpp
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp
index 81f97184077e74281496dadfa852f8d5a23fbd50..0d93f1c2f1d952a88fed29191ea7a46bb53e6c9f 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -414,11 +414,11 @@ void TreeScope::adoptIfNeeded(Node& node)
adopter.execute();
}
-static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFrame)
+static Element* focusedFrameOwnerElement(Frame* focusedFrame, LocalFrame* currentFrame)
{
for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) {
if (focusedFrame->tree().parent() == currentFrame) {
- // FIXME: This won't work for OOPI.
+ ASSERT(focusedFrame->owner()->isLocal());
return focusedFrame->deprecatedLocalOwner();
}
}
@@ -430,7 +430,7 @@ Element* TreeScope::adjustedFocusedElement() const
Document& document = rootNode().document();
Element* element = document.focusedElement();
if (!element && document.page())
- element = focusedFrameOwnerElement(document.page()->focusController().focusedFrame(), document.frame());
+ element = focusedFrameOwnerElement(document.page()->focusController().focusedFrameEvenIfRemote(), document.frame());
if (!element)
return 0;

Powered by Google App Engine
This is Rietveld 408576698