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

Issue 2810593002: Set plugin focus by implementing HTMLPlugInElement::SetFocused. (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

Set plugin focus by implementing HTMLPlugInElement::SetFocused. Set plugin focus in HTMLPlugInElement::SetFocused rather than an explicit check and call in Document::SetFocusedElement. This causes plugins to have DidFocusChange executed twice (true/false), if the DOM plugin element changes focus in onblur or onfocus, but the plugin does remain in a consistent state as to whether it has focus or not. BUG=637460 Review-Url: https://codereview.chromium.org/2810593002 Cr-Commit-Position: refs/heads/master@{#463917} Committed: https://chromium.googlesource.com/chromium/src/+/e7aa842423521bcc232e2f0c3070196038f92f25

Patch Set 1 #

Patch Set 2 : Call to Node::SetFocused after updating plugin. #

Patch Set 3 : HTMLFrameOwnerElement::SetFocused rather than Node::SetFocused #

Total comments: 2

Patch Set 4 : Remove focus type from API. #

Patch Set 5 : Node::SetFocused includes WebFocusType #

Patch Set 6 : fix comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -55 lines) Patch
M third_party/WebKit/LayoutTests/plugins/focus-change-2-change-focus-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/plugins/focus-change-4-change-focus-and-blur-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ContainerNode.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ContainerNode.cpp View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 4 chunks +2 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Node.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLAreaElement.h View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLAreaElement.cpp View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFrameElementBase.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLPlugInElement.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/TextControlElement.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/TextControlElement.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.h View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp View 1 2 3 4 3 chunks +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.h View 1 2 3 4 3 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.cpp View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.h View 1 2 3 4 3 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.cpp View 1 2 3 4 1 chunk +10 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.cpp View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/page/FocusController.cpp View 1 2 3 4 5 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (19 generated)
joelhockey
It has occurred to me that HTMLPlugInElement can also set the plugin focus by hooking ...
3 years, 8 months ago (2017-04-10 02:29:42 UTC) #3
haraken
(I'll defer this review to dcheng@.)
3 years, 8 months ago (2017-04-10 03:52:21 UTC) #4
dcheng
LGTM (Followup is OK for the comment) https://codereview.chromium.org/2810593002/diff/40001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp File third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp (right): https://codereview.chromium.org/2810593002/diff/40001/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp#newcode162 third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp:162: plugin_->SetFocused(focused, kWebFocusTypeNone); ...
3 years, 8 months ago (2017-04-11 05:36:55 UTC) #13
dcheng
To elaborate a bit, I feel this is OK because there are other SetFocused() things ...
3 years, 8 months ago (2017-04-11 05:37:19 UTC) #14
joelhockey
I've tried removing WebFocusType from the various plugin related focus methods: components/plugins/renderer/webview_plugin::UpdateFocus content/renderer/browser_plugin/browser_plugin::UpdateFocus content/renderer/pepper/pepper_webplugin_impl::UpdateFocus content/shell/test_runner/test_plugin::UpdateFocus ...
3 years, 8 months ago (2017-04-11 07:08:23 UTC) #15
dcheng
Ah... I think we need to plumb through the focus type for now then =/ ...
3 years, 8 months ago (2017-04-11 07:29:33 UTC) #16
joelhockey
On 2017/04/11 at 07:29:33, dcheng wrote: > Ah... I think we need to plumb through ...
3 years, 8 months ago (2017-04-11 08:56:49 UTC) #21
dcheng
LGTM
3 years, 8 months ago (2017-04-11 23:40:52 UTC) #24
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/2810593002/100001
3 years, 8 months ago (2017-04-12 03:18:18 UTC) #26
commit-bot: I haz the power
3 years, 8 months ago (2017-04-12 03:24:38 UTC) #29
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/e7aa842423521bcc232e2f0c3070...

Powered by Google App Engine
This is Rietveld 408576698