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

Issue 26149002: Don't dispatch blur/focus events if the element's page is not focused. (Closed)

Created:
7 years, 2 months ago by ljs
Modified:
7 years, 2 months ago
Reviewers:
tkent
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Don't dispatch blur/focus events if the element's page is not focused. When the page loses focus a blur event is dispatched once, prevent a second dispatch (via e.g. programmatic blur()-ing), when a page doesn't have focus, prevent a focus event dispatch (via e.g. programmatic focus()-ing), as it will receive a focus event when the page regains focus. R=tkent@chromium.org BUG=276757 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=160036

Patch Set 1 #

Patch Set 2 : Disallow focus event dispatch too. #

Total comments: 2

Patch Set 3 : Use page() consistently. #

Patch Set 4 : Rebase #

Total comments: 1

Patch Set 5 : Rebase, adding test. #

Patch Set 6 : Rebase, beenFocused #

Patch Set 7 : Rebase #

Patch Set 8 : Rebase #

Patch Set 9 : Track *dispatch* of window blurred event #

Patch Set 10 : Rebase #

Patch Set 11 : blur dispatch flag symmetry #

Patch Set 12 : Revert to original approach, update test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -43 lines) Patch
M LayoutTests/inspector-protocol/dom/dom-focus.html View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -7 lines 0 comments Download
M LayoutTests/inspector-protocol/dom/dom-focus-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +43 lines, -35 lines 0 comments Download
M Source/web/tests/WebViewTest.cpp View 1 2 3 4 5 6 1 chunk +14 lines, -0 lines 0 comments Download
A Source/web/tests/data/focus_blur_events.html View 1 2 3 4 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 54 (0 generated)
ljs
PTAL Apologies if I have made mistakes here, this is my first chromium/blink patch :-) ...
7 years, 2 months ago (2013-10-05 20:27:06 UTC) #1
tkent
This doesn't look a correct fix because focus and blur don't match in the following ...
7 years, 2 months ago (2013-10-07 04:49:38 UTC) #2
ljs
PTAL I have updated the patch to disallow dispatch of focus events as well as ...
7 years, 2 months ago (2013-10-07 18:50:44 UTC) #3
tkent
> I have updated the patch to disallow dispatch of focus events as well as ...
7 years, 2 months ago (2013-10-08 05:39:40 UTC) #4
ljs
On 8 October 2013 06:39, <tkent@chromium.org> wrote: > What about IE? > Both IE10 and ...
7 years, 2 months ago (2013-10-08 07:15:30 UTC) #5
tkent
On 2013/10/08 07:15:30, ljs wrote: > On 8 October 2013 06:39, <mailto:tkent@chromium.org> wrote: > > ...
7 years, 2 months ago (2013-10-08 08:36:50 UTC) #6
tkent
https://codereview.chromium.org/26149002/diff/5001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/26149002/diff/5001/Source/core/dom/Document.cpp#newcode3311 Source/core/dom/Document.cpp:3311: Page* oldPage = oldFocusedElement->document().page(); page() is enough because oldFocusedElement ...
7 years, 2 months ago (2013-10-08 08:41:43 UTC) #7
tkent
Also you need to sign Individual Contributor License Agreement or Corporate Contributor License Agreement, and ...
7 years, 2 months ago (2013-10-08 08:45:42 UTC) #8
ljs
On 8 October 2013 09:41, <tkent@chromium.org> wrote: > > https://codereview.chromium.**org/26149002/diff/5001/Source/** > core/dom/Document.cpp#**newcode3361<https://codereview.chromium.org/26149002/diff/5001/Source/core/dom/Document.cpp#newcode3361> > Source/core/dom/Document.cpp:**3361: if ...
7 years, 2 months ago (2013-10-08 11:41:23 UTC) #9
ljs
Apologies, looks like I pulled in some changes from a rebase as well as the ...
7 years, 2 months ago (2013-10-08 11:48:39 UTC) #10
ljs
On 2013/10/08 08:45:42, tkent wrote: > Also you need to sign Individual Contributor License Agreement ...
7 years, 2 months ago (2013-10-08 11:54:07 UTC) #11
tkent
I found dispatchEventsOnWindowAndFocusedNode in FocusController.cpp didn't dispatch focusout/DOMFocusOut/focusin/DOMFocusIn events. We need to fix it before ...
7 years, 2 months ago (2013-10-08 22:47:19 UTC) #12
tkent
On 2013/10/08 11:54:07, ljs wrote: > I guess I need to create a new patch ...
7 years, 2 months ago (2013-10-08 22:47:56 UTC) #13
ljs
On 2013/10/08 22:47:19, tkent wrote: > I found dispatchEventsOnWindowAndFocusedNode in FocusController.cpp didn't > dispatch focusout/DOMFocusOut/focusin/DOMFocusIn ...
7 years, 2 months ago (2013-10-08 22:56:21 UTC) #14
tkent
> Should this be done in a separate CL, or is it ok to attempt ...
7 years, 2 months ago (2013-10-08 23:32:41 UTC) #15
ljs
PTAL. I have added a test, and rebased against latest blink.
7 years, 2 months ago (2013-10-10 02:40:40 UTC) #16
tkent
lgtm
7 years, 2 months ago (2013-10-10 05:17:19 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/28001
7 years, 2 months ago (2013-10-10 05:17:32 UTC) #18
commit-bot: I haz the power
Retried try job too often on linux_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink_rel&number=7489
7 years, 2 months ago (2013-10-10 06:27:24 UTC) #19
tkent
On 2013/10/10 06:27:24, I haz the power (commit-bot) wrote: > Retried try job too often ...
7 years, 2 months ago (2013-10-10 07:33:04 UTC) #20
ljs
On 2013/10/10 07:33:04, tkent wrote: > On 2013/10/10 06:27:24, I haz the power (commit-bot) wrote: ...
7 years, 2 months ago (2013-10-10 23:29:04 UTC) #21
ljs
On 2013/10/10 23:29:04, ljs wrote: > It turns out that it's feasible for a page ...
7 years, 2 months ago (2013-10-10 23:31:16 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/42001
7 years, 2 months ago (2013-10-11 01:59:45 UTC) #23
commit-bot: I haz the power
Failed to apply patch for Source/core/dom/Document.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 2 months ago (2013-10-11 01:59:51 UTC) #24
ljs
PTAL. Presumably this was due to a merge issue, I have rebased.
7 years, 2 months ago (2013-10-11 07:54:48 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/50001
7 years, 2 months ago (2013-10-11 08:04:21 UTC) #26
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=10355
7 years, 2 months ago (2013-10-11 10:59:12 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/50001
7 years, 2 months ago (2013-10-11 11:13:18 UTC) #28
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=10414
7 years, 2 months ago (2013-10-11 12:42:50 UTC) #29
ljs
On 2013/10/11 12:42:50, I haz the power (commit-bot) wrote: > Retried try job too often ...
7 years, 2 months ago (2013-10-11 12:55:42 UTC) #30
ljs
On 2013/10/11 12:55:42, ljs wrote: > On 2013/10/11 12:42:50, I haz the power (commit-bot) wrote: ...
7 years, 2 months ago (2013-10-11 20:22:15 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/68001
7 years, 2 months ago (2013-10-11 23:31:23 UTC) #32
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=10671
7 years, 2 months ago (2013-10-12 06:57:35 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/68001
7 years, 2 months ago (2013-10-12 07:32:02 UTC) #34
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=10718
7 years, 2 months ago (2013-10-12 10:43:32 UTC) #35
ljs
On 2013/10/12 10:43:32, I haz the power (commit-bot) wrote: > Retried try job too often ...
7 years, 2 months ago (2013-10-12 10:51:35 UTC) #36
ljs
PTAL. I added code to track when the events are actually dispatched; because if they ...
7 years, 2 months ago (2013-10-14 22:12:51 UTC) #37
ljs
On 2013/10/14 22:12:51, ljs wrote: > PTAL. > > I added code to track when ...
7 years, 2 months ago (2013-10-15 07:50:43 UTC) #38
ljs
Could somebody with the appropriate permissions submit this to the trybots? :) Thanks!
7 years, 2 months ago (2013-10-15 19:13:22 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/100001
7 years, 2 months ago (2013-10-16 17:01:41 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/100001
7 years, 2 months ago (2013-10-16 20:36:25 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/100001
7 years, 2 months ago (2013-10-16 21:37:22 UTC) #42
tkent
not lgtm canceling a stale lgtm. I need to take a look at this again ...
7 years, 2 months ago (2013-10-16 21:41:36 UTC) #43
ljs
On 2013/10/16 21:41:36, tkent wrote: > not lgtm > > canceling a stale lgtm. I ...
7 years, 2 months ago (2013-10-16 21:45:12 UTC) #44
tkent
On 2013/10/14 22:12:51, ljs wrote: > PTAL. > > I added code to track when ...
7 years, 2 months ago (2013-10-18 00:00:45 UTC) #45
ljs
On 2013/10/18 00:00:45, tkent wrote: > On 2013/10/14 22:12:51, ljs wrote: > > PTAL. > ...
7 years, 2 months ago (2013-10-20 15:26:37 UTC) #46
ljs
On 2013/10/20 15:26:37, ljs wrote: > I have reverted the approach to the original one ...
7 years, 2 months ago (2013-10-20 21:21:09 UTC) #47
ljs
Some of those trybots are tryin' revisions prior to the pre-requisite commit's revision :) - ...
7 years, 2 months ago (2013-10-20 22:32:59 UTC) #48
ljs
On 2013/10/20 22:32:59, ljs wrote: > Some of those trybots are tryin' revisions prior to ...
7 years, 2 months ago (2013-10-20 22:55:49 UTC) #49
tkent
lgtm
7 years, 2 months ago (2013-10-21 00:08:39 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lstoakes@gmail.com/26149002/149001
7 years, 2 months ago (2013-10-21 00:08:51 UTC) #51
commit-bot: I haz the power
Change committed as 160036
7 years, 2 months ago (2013-10-21 01:15:07 UTC) #52
tkent
On 2013/10/21 01:15:07, I haz the power (commit-bot) wrote: > Change committed as 160036 Thank ...
7 years, 2 months ago (2013-10-21 01:18:36 UTC) #53
ljs
7 years, 2 months ago (2013-10-22 09:04:58 UTC) #54
Message was sent while issue was closed.
This has been reverted due to flakiness caused in
BrowserFocusTest.FocusTraversal on XP, I will investigate and patch ASAP.

Powered by Google App Engine
This is Rietveld 408576698