Bug 234978

Summary: Remove obsolete DOM Level 2 "DOMFocusIn" / "DOMFocusOut" events
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: DOMAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, cdumez, darin, enrica, ggaren, ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=235036
Bug Depends on:    
Bug Blocks: 234928    
Attachments:
Description Flags
Patch for landing none

Description Alexey Shvayka 2022-01-07 12:36:03 PST
Only 0.04% of page loads use them (https://chromestatus.com/metrics/feature/timeline/popularity/211).
Comment 1 Alexey Shvayka 2022-01-07 14:00:12 PST
Created attachment 448629 [details]
Patch for landing
Comment 2 Alexey Shvayka 2022-01-07 14:00:44 PST
Comment on attachment 448629 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=448629&action=review

> Source/WebCore/ChangeLog:6
> +        Reviewed by Geoff Garen.

In https://bugs.webkit.org/show_bug.cgi?id=234928.
Comment 3 EWS 2022-01-07 14:52:56 PST
Committed r287787 (245847@main): <https://commits.webkit.org/245847@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448629 [details].
Comment 4 Radar WebKit Bug Importer 2022-01-07 14:53:24 PST
<rdar://problem/87273766>
Comment 5 Alexey Proskuryakov 2022-01-07 17:43:57 PST
> Only 0.04% of page loads use them (https://chromestatus.com/metrics/feature/timeline/popularity/211).

0.04% is much smaller than 16% discussed in the other bug, but isn't that a huge number too, given the scale of the web?

I vaguely recall that even Chrome has a lower threshold for removing unpopular features. But not sure where to find their exact policy; or if ours should be informed by Chrome's.
Comment 6 Darin Adler 2022-01-07 17:48:00 PST
(In reply to Alexey Proskuryakov from comment #5)
> I vaguely recall that even Chrome has a lower threshold for removing
> unpopular features. But not sure where to find their exact policy; or if
> ours should be informed by Chrome's.

I wasn’t convinced by the 0.04% number alone, but also by the fact that Firefox has never implemented this.
Comment 7 Alexey Shvayka 2022-01-07 17:52:56 PST
Also, all other features with usage around 0.04% that I've checked on Chrome stats, have a few thousand "top sites using them" list, but for "DOMFocusIn" / "DOMFocusOut" it's 5 dead sites, which kinda sparks confidence?
Comment 8 Alexey Proskuryakov 2022-01-07 18:10:55 PST
> Firefox has never implemented this 

That's more convincing indeed. I didn't see that discussed, perhaps it was in Slack.

> it's 5 dead sites, which kinda sparks confidence

googlevideo.com is not exactly dead (redirects to a modern URL), but it doesn't appear to use these events now. I am not familiar with Chrome's popularity website enough to know if the fact that timeline starts in 2017 means that data aggregation code is lacking, or that the events haven't been used by any sites since 2017.
Comment 9 Alexey Shvayka 2022-01-07 18:19:26 PST
(In reply to Alexey Proskuryakov from comment #8)
> I am not familiar with Chrome's popularity website enough to know if the fact that timeline starts in 2017
> means that data aggregation code is lacking, or that the events haven't been used by any sites since 2017.

They've changed data collection around 2017.
There is "Show all historical data" checkbox at the top for metrics up to 2014, which seem steadily declining.
Comment 10 Tim Nguyen (:ntim) 2022-01-07 19:12:29 PST
Can you please create a WPT PR to replace usages of these:
- https://github.com/web-platform-tests/wpt/search?q=DOMFocusOut
- https://github.com/web-platform-tests/wpt/search?q=DOMFocusIn
Comment 11 Alexey Shvayka 2022-01-10 10:55:41 PST
(In reply to Alexey Proskuryakov from comment #8)
> > Firefox has never implemented this 

I'm rolling out this change, please see https://bugs.webkit.org/show_bug.cgi?id=235036 for details. In short: quite popular JS library used to do browser detection and relied on WebKit browsers emitting "DOMFocusIn" / "DOMFocusOut" events rather than actually testing the feature.

> That's more convincing indeed. I didn't see that discussed, perhaps it was
> in Slack.

No, just the ChangeLog.
For future, should I start a Slack / mail list discussion when removing a feature?
Comment 12 Alexey Proskuryakov 2022-01-10 13:26:03 PST
I was just particularly curious because the bug description was so short and somewhat unconvincing - and I failed to check the ChangeLog.

> For future, should I start a Slack / mail list discussion when removing a feature?

That can be a good idea if you are looking for some insight specific to the feature in question, but there is no such expectation in general. A reviewer can always suggest that if appropriate, too.
Comment 13 Ryosuke Niwa 2022-07-30 13:29:02 PDT
*** Bug 47014 has been marked as a duplicate of this bug. ***