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

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: Remove some plumbing that should instead be introduced in the window.focus() CL. Created 5 years, 1 month 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..4e41d759821826a0196dce177264e89c3c324f80 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -414,23 +414,12 @@ void TreeScope::adoptIfNeeded(Node& node)
adopter.execute();
}
-static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFrame)
-{
- for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) {
- if (focusedFrame->tree().parent() == currentFrame) {
- // FIXME: This won't work for OOPI.
- return focusedFrame->deprecatedLocalOwner();
- }
- }
- return 0;
-}
-
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 = document.page()->focusController().focusedFrameOwnerElement(*document.frame());
if (!element)
return 0;

Powered by Google App Engine
This is Rietveld 408576698