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

Issue 2797943002: Set plugin focus via element dispatch (Closed)

Created:
3 years, 8 months ago by joelhockey
Modified:
3 years, 8 months ago
Reviewers:
haraken, dcheng
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Update Document handling of Widget/FrameViewBase focus. Out of all FrameViewBase types, only plugin implemented the setFocus method, so Document checks if element is HTMLPlugInElement and calls plugin::setFocus directly. Added tests to ensure that if JS onfocus/onblur code changes element focus, the plugin stays in a consistent state of whether it thinks it is in focus. BUG=637460 Review-Url: https://codereview.chromium.org/2797943002 Cr-Commit-Position: refs/heads/master@{#462810} Committed: https://chromium.googlesource.com/chromium/src/+/7a66ab96e524e57f6717edb13f375d50f9cd89e8

Patch Set 1 #

Patch Set 2 : Remove testing var. #

Total comments: 12

Patch Set 3 : Remove FrameViewBase::setFocused #

Patch Set 4 : Dispatch to DOM onblur/onfocus first, then call plugin #

Total comments: 4

Patch Set 5 : Add comment for why call dom first, then plugin #

Patch Set 6 : Set plugin focus after dispatching DOM events and making sure focus has not changed. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -43 lines) Patch
A third_party/WebKit/LayoutTests/plugins/focus-change-1-no-change.html View 1 2 3 4 5 1 chunk +27 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/plugins/focus-change-1-no-change-expected.txt View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/plugins/focus-change-2-change-focus.html View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/plugins/focus-change-2-change-focus-expected.txt View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/plugins/focus-change-3-change-blur.html View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/plugins/focus-change-3-change-blur-expected.txt View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/plugins/focus-change-4-change-focus-and-blur.html View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/plugins/focus-change-4-change-focus-and-blur-expected.txt View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 4 chunks +6 lines, -39 lines 0 comments Download
M third_party/WebKit/Source/core/plugins/PluginView.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/FrameViewBase.h View 1 2 2 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/web/WebPluginContainerImpl.cpp View 1 2 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 41 (24 generated)
joelhockey
This change doesn't break anything in the fast layout tests, but I'm waiting to see ...
3 years, 8 months ago (2017-04-05 07:37:22 UTC) #7
dcheng
https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode4148 third_party/WebKit/Source/core/dom/Document.cpp:4148: view()->setFocused(true, params.type); I think we can delete setFocused() off ...
3 years, 8 months ago (2017-04-05 07:48:09 UTC) #8
haraken
This is a great CL! https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode4141 third_party/WebKit/Source/core/dom/Document.cpp:4141: updateStyleAndLayout(); Is it okay ...
3 years, 8 months ago (2017-04-05 11:59:00 UTC) #11
dcheng
https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp File third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp (right): https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp#newcode104 third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp:104: plugin->setFocused(false, type); On 2017/04/05 11:59:00, haraken wrote: > On ...
3 years, 8 months ago (2017-04-05 21:14:44 UTC) #12
joelhockey
https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode4141 third_party/WebKit/Source/core/dom/Document.cpp:4141: updateStyleAndLayout(); On 2017/04/05 at 11:59:00, haraken wrote: > Is ...
3 years, 8 months ago (2017-04-05 23:59:11 UTC) #13
haraken
On 2017/04/05 23:59:11, joelhockey wrote: > https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp > File third_party/WebKit/Source/core/dom/Document.cpp (left): > > https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode4141 > ...
3 years, 8 months ago (2017-04-06 02:39:52 UTC) #18
dcheng
https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp File third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp (right): https://codereview.chromium.org/2797943002/diff/20001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp#newcode104 third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp:104: plugin->setFocused(false, type); On 2017/04/05 23:59:11, joelhockey wrote: > On ...
3 years, 8 months ago (2017-04-06 03:01:33 UTC) #19
joelhockey
I've had some chat discussion with dcheng and agreement was to change order of calling ...
3 years, 8 months ago (2017-04-06 06:11:00 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797943002/60001
3 years, 8 months ago (2017-04-06 06:17:24 UTC) #23
joelhockey
On 2017/04/05 at 11:59:00, haraken wrote: > This is a great CL! Thanks for the ...
3 years, 8 months ago (2017-04-06 06:19:09 UTC) #24
haraken
https://codereview.chromium.org/2797943002/diff/60001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp File third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp (right): https://codereview.chromium.org/2797943002/diff/60001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp#newcode104 third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp:104: Element::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities); Can we add a comment on ...
3 years, 8 months ago (2017-04-06 06:20:27 UTC) #25
joelhockey
https://codereview.chromium.org/2797943002/diff/60001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp File third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp (right): https://codereview.chromium.org/2797943002/diff/60001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp#newcode104 third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp:104: Element::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities); On 2017/04/06 at 06:20:26, haraken wrote: ...
3 years, 8 months ago (2017-04-06 06:28:39 UTC) #26
dcheng
https://codereview.chromium.org/2797943002/diff/60001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp File third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp (right): https://codereview.chromium.org/2797943002/diff/60001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp#newcode104 third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp:104: Element::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities); Thinking about this more, either ordering ...
3 years, 8 months ago (2017-04-06 06:28:50 UTC) #27
joelhockey
The code is now casting element to HTMLPlugInElement and calling plugin()->setFocused which matches previous behaviour. ...
3 years, 8 months ago (2017-04-07 06:56:05 UTC) #31
dcheng
LGTM. Thanks for all the investigations and cleaning this up.
3 years, 8 months ago (2017-04-07 07:07:50 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797943002/100001
3 years, 8 months ago (2017-04-07 07:31:56 UTC) #38
commit-bot: I haz the power
3 years, 8 months ago (2017-04-07 08:39:54 UTC) #41
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/7a66ab96e524e57f6717edb13f37...

Powered by Google App Engine
This is Rietveld 408576698