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

Issue 1423053002: Make document.activeElement work with OOPIF (Closed)

Created:
5 years, 1 month ago by alexmos
Modified:
5 years, 1 month ago
Reviewers:
Charlie Reis, dcheng
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, eae+blinkwatch, jam, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src.git@focus-preserve-page-focus-on-subframe-navigations
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make document.activeElement work with OOPIF. When a subframe is focused, the parent frame's document.activeElement needs to return the <iframe> element of that subframe. This CL adds logic to make this work for cross-process frames. Specifically, when the focused frame changes across processes, we now send the new (remote) focused frame to the other SiteInstances in the same FrameTree. This remote frame is then set by the FocusController as its current focused frame. The Blink logic used by document.activeElement is in TreeScope::adjustedFocusedElement(). To make it work properly with remote focused frames, this CL also introduces a new FocusController accessor for getting the focused <iframe> element and moves TreeScope's focusedFrameOwnerElement logic there. BUG=341918, 339659 Committed: https://crrev.com/b1dc216a10cbc9367118071e5bf43b2d15de6013 Cr-Commit-Position: refs/heads/master@{#357962}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Change plumbing a bit: use focusDocumentView on WebView and remove clearFocus from WebLocalFrame #

Total comments: 4

Patch Set 3 : Move focusedFrameOwnerElement to FocusController #

Total comments: 2

Patch Set 4 : Send focused frame updates to all SiteInstance in the tree, not just the old focused frame. #

Patch Set 5 : Rebase #

Patch Set 6 : Address Daniel's feedback #

Patch Set 7 : Remove some plumbing that should instead be introduced in the window.focus() CL. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -60 lines) Patch
M content/browser/frame_host/frame_tree.cc View 1 2 3 4 1 chunk +15 lines, -9 lines 2 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 4 chunks +130 lines, -10 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 1 chunk +3 lines, -2 lines 2 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 2 chunks +0 lines, -5 lines 0 comments Download
M content/renderer/render_frame_proxy.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/TreeScope.cpp View 1 2 3 4 5 1 chunk +1 line, -12 lines 0 comments Download
M third_party/WebKit/Source/core/page/FocusController.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/FocusController.cpp View 1 2 3 4 5 2 chunks +14 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 1 chunk +0 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebLocalFrame.h View 1 2 3 4 1 chunk +0 lines, -5 lines 0 comments Download
M third_party/WebKit/public/web/WebView.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
alexmos
Daniel, can you please take an initial look at the Blink bits? Turns out if ...
5 years, 1 month ago (2015-10-26 22:33:22 UTC) #2
dcheng
https://codereview.chromium.org/1423053002/diff/1/third_party/WebKit/Source/core/page/FocusController.h File third_party/WebKit/Source/core/page/FocusController.h (right): https://codereview.chromium.org/1423053002/diff/1/third_party/WebKit/Source/core/page/FocusController.h#newcode55 third_party/WebKit/Source/core/page/FocusController.h:55: Frame* focusedFrameEvenIfRemote() const { return m_focusedFrame.get(); } On 2015/10/26 ...
5 years, 1 month ago (2015-10-28 00:34:15 UTC) #3
alexmos
Daniel, can you please take another look? Some explanations below. Plumbing which remote frames are ...
5 years, 1 month ago (2015-11-02 23:23:51 UTC) #4
dcheng
https://codereview.chromium.org/1423053002/diff/20001/third_party/WebKit/Source/core/page/FocusController.h File third_party/WebKit/Source/core/page/FocusController.h (right): https://codereview.chromium.org/1423053002/diff/20001/third_party/WebKit/Source/core/page/FocusController.h#newcode55 third_party/WebKit/Source/core/page/FocusController.h:55: Frame* focusedFrameEvenIfRemote() const { return m_focusedFrame.get(); } Crazy idea: ...
5 years, 1 month ago (2015-11-04 01:46:21 UTC) #5
alexmos
https://codereview.chromium.org/1423053002/diff/20001/third_party/WebKit/Source/core/page/FocusController.h File third_party/WebKit/Source/core/page/FocusController.h (right): https://codereview.chromium.org/1423053002/diff/20001/third_party/WebKit/Source/core/page/FocusController.h#newcode55 third_party/WebKit/Source/core/page/FocusController.h:55: Frame* focusedFrameEvenIfRemote() const { return m_focusedFrame.get(); } On 2015/11/04 ...
5 years, 1 month ago (2015-11-04 18:08:12 UTC) #6
dcheng
third_party/WebKit lgtm https://codereview.chromium.org/1423053002/diff/40001/third_party/WebKit/Source/core/page/FocusController.h File third_party/WebKit/Source/core/page/FocusController.h (right): https://codereview.chromium.org/1423053002/diff/40001/third_party/WebKit/Source/core/page/FocusController.h#newcode56 third_party/WebKit/Source/core/page/FocusController.h:56: Element* focusedFrameOwnerElement(LocalFrame* currentFrame) const; Nit: LocalFrame& since ...
5 years, 1 month ago (2015-11-04 19:16:47 UTC) #7
alexmos
https://codereview.chromium.org/1423053002/diff/40001/third_party/WebKit/Source/core/page/FocusController.h File third_party/WebKit/Source/core/page/FocusController.h (right): https://codereview.chromium.org/1423053002/diff/40001/third_party/WebKit/Source/core/page/FocusController.h#newcode56 third_party/WebKit/Source/core/page/FocusController.h:56: Element* focusedFrameOwnerElement(LocalFrame* currentFrame) const; On 2015/11/04 19:16:47, dcheng wrote: ...
5 years, 1 month ago (2015-11-04 21:33:41 UTC) #8
alexmos
Charlie, can you please review the content/ side? The overall goal here is to propagate ...
5 years, 1 month ago (2015-11-04 21:53:59 UTC) #10
Charlie Reis
Thanks for the explanation! document.activeElement is kind of unfortunate for us (in terms of the ...
5 years, 1 month ago (2015-11-04 22:23:42 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1423053002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1423053002/120001
5 years, 1 month ago (2015-11-04 23:30:20 UTC) #14
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 1 month ago (2015-11-05 00:59:27 UTC) #15
commit-bot: I haz the power
5 years, 1 month ago (2015-11-05 01:00:46 UTC) #16
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/b1dc216a10cbc9367118071e5bf43b2d15de6013
Cr-Commit-Position: refs/heads/master@{#357962}

Powered by Google App Engine
This is Rietveld 408576698