WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
125393
Don't dispatch blur/focus events if the element's page is not focused
https://bugs.webkit.org/show_bug.cgi?id=125393
Summary
Don't dispatch blur/focus events if the element's page is not focused
Ryosuke Niwa
Reported
2013-12-07 12:17:46 PST
Consider merging
https://chromium.googlesource.com/chromium/blink/+/60ed87d48e7c337cada58f2ae25da4d9eb426207
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2013-12-07 12:20:40 PST
Got reverted in
http://src.chromium.org/viewvc/blink?view=revision&revision=160140
. But the concept of the change seems correct. Also see
https://code.google.com/p/chromium/issues/detail?id=276757
Ahmad Saleem
Comment 2
2022-08-22 16:15:58 PDT
It landed in this commit:
https://src.chromium.org/viewvc/blink?view=revision&revision=164069
I took a test case from the above and changed it into JSFiddle:
https://jsfiddle.net/8ueL62kx/
*** Firefox Nightly 105 *** Load test, it would be focused in input field but no event is fired and then click any where besides "input" field, it will fire "blur" event. *** Chrome Canary 106 *** Load test, it would be focused in input field but no event is fired and then click any where besides "input" field, it will fire "blurfocus" event. *** Safari Technology Preview 151 *** Load test, it would be focused in input field but no event is fired and then click any where besides "input" field, it will fire "blurfocus" event. _______ I am not sure on web-spec or whether something else is required but just going to share what I tested or observed. Thanks!
Radar WebKit Bug Importer
Comment 3
2022-08-23 12:25:26 PDT
<
rdar://problem/99045743
>
Ahmad Saleem
Comment 4
2022-09-29 10:42:47 PDT
I tried to land this change in following PR based
Comment 03
- commit of Chromium: Link -
https://github.com/WebKit/WebKit/pull/4774
and these are learnings: 1) Fixing Developer Tools test case is easy and can be followed from Chromium patch without any issue. 2) Someone need to update "TestRunner" - testRunner.focusWebView part to accommodate this change to ensure that the focus work properly since it leads to 77 API failures on iOS:
https://ews-build.webkit.org/#/builders/9/builds/81789
____ Since it is beyond my capability to update (2), I will leave it for someone else to fix this bug but will document my attempt for others. Thanks!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug