On Wednesday, February 9, 2022 at 2:49:55 AM UTC+1 Mike Taylor wrote:

> Hey Xiaocheng,
>
> Thanks for working on improving interop! A few thoughts and questions 
> below.
>
> On 2/8/22 7:25 PM, Xiaocheng Hu wrote:
>
> Contact emails xiaoche...@chromium.org
>
> Explainer None
>
> Specification None. Not a standard feature.
>
> Summary 
>
> Event.path is a non-standard API that returns the event's path, which is 
> an array of the objects on which listeners will be invoked. It is supported 
> by Blink only, causing web compatibility issues. Web developers should 
> switch to the equivalent standard API Event.composedPath(), which returns 
> the same result. 
>
>
> Blink component Blink>DOM 
> <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EDOM>
>
> TAG review 
>
> TAG review status Not applicable
>
> Risks 
>
>
> Interoperability and Compatibility 
>
> The removal of this API should improve interoperability, as it's supported 
> by Blink only. It still has 18% usage as of Feb 2022 (
> https://chromestatus.com/metrics/feature/timeline/popularity/345), so we 
> will only deprecate it for now, and will not remove it before the usage 
> drops low enough. We expect low compatibility risks, since there is an 
> equivalent standard API (Event.composedPath()) by all browsers, and the 
> following polyfill should also keep existing sites functioning with minimum 
> changes:
>
> 18% is a _lot_ of usage. So much that I'm surprised there aren't dozens of 
> compat bugs reported against Firefox. In 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1697590#c0 there are only 2 
> linked site bugs. And there's only 3 in 
> https://github.com/webcompat/web-bugs/issues?q=is%3Aissue+composedPath 
> (the last one being from 2019). 
>
> I wonder how much of that 18% is feature detection and fallback codepaths 
> <https://github.com/search?l=JavaScript&q=composedPath+event.path&type=Code>
> .
>

Yeah, that 18% is unreasonably high...
I think it'd be good to add a non-IDL based counter that counts when both 
Event::path 
<https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/events/event.cc;l=287;bpv=1;bpt=0>
 and 
Event::composedPath 
<https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/events/event.cc;l=293;bpv=1;bpt=0>
 are 
accessed. (e.g. by adding 2 booleans or a bitmask on Event indicating when 
any of them was touched and triggering the counter when both have been)
Then we can assume that counts feature-detection/fallback and subtract that 
counter from the 18%.


> Are we aware of bug reports from Apple caused by event.path? I'm not able 
> to find any on bugs.webkit.org, but I could be doing it wrong.
>
> Have you thought of ways to measure when event.path is called, and 
> event.composedPath isn't (not sure if that's even possible)? Maybe that 
> would show it's actually safe to remove.
>
> if (!Event.prototype.path) { Object.defineProperty(Event.prototype, 
> 'path', { get() { return this.composedPath(); } }); }
>
> Given how simple this appears to be, I wonder if a better approach would 
> be to ask Mozilla and Apple if they would be willing to accept patches to 
> make event.path a legacy alias to event.composedPath - and then we can spec 
> it in DOM or Compat. The alternative is to send deprecation messages for 
> possibly a very long time, which doesn't really improve the compat 
> situation for a very long time. Or, we can figure out how to measure the 
> actual non-fallback usage of event.path and go from there.
>
>
>
> Gecko: No signal Firefox does not support Event.path
>
> WebKit: No signal Safari does not support Event.path
>
> Web developers: Positive (
> https://github.com/web-platform-tests/interop-2022/issues/26)
>
> That should probably be counted as positive support from Mozilla, rather 
> than webdev support (no offense to James).
>
>
> Other signals:
>
>
> Debuggability 
>
> Usage of this deprecated feature will be reported to the DevTools Issues 
> Tab.
>
>
> Is this feature fully tested by web-platform-tests 
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>
> ? No
>
> Flag name 
>
> Requires code in //chrome? False
>
> Tracking bug https://bugs.chromium.org/p/chromium/issues/detail?id=1277431
>
> Estimated milestones 
>
> No milestones specified
>
>
> Link to entry on the Chrome Platform Status 
> https://chromestatus.com/feature/5726124632965120
>
> This intent message was generated by Chrome Platform Status 
> <https://chromestatus.com/>.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to blink-dev+unsubscr...@chromium.org.
> To view this discussion on the web visit 
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFqEGha_iNax9r8%2BXVQK%2Bf3hEdu5z-MDAh44FbKMOuAnrHL2Ew%40mail.gmail.com
>  
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFqEGha_iNax9r8%2BXVQK%2Bf3hEdu5z-MDAh44FbKMOuAnrHL2Ew%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7ea2aa86-12e7-49f6-bca1-9d39fe15e41fn%40chromium.org.

Reply via email to