New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify addEventListener default passive hack for smoothscroll.js #1088
Comments
As noted in https://bugs.chromium.org/p/chromium/issues/detail?id=501568
Removing support for Chromium has use counters for only
Pretty high numbers... How come Firefox is able to not support the In httparchive (total of 14,951,058 pages), there are 0 pages that hit the SmoothScrollJSInterventionActivated. querySELECT
url
FROM
`httparchive.pages.2022_06_09_mobile`
WHERE
STRPOS(payload, r'SmoothScrollJSInterventionActivated') > 0 |
Hmm. I wonder if the SmoothScrollJSInterventionActivated is broken. The sample URLs chart in https://chromestatus.com/metrics/feature/timeline/popularity/2020 had a sudden cutoff in April 2019. When looking for the pragma that would invoke it ( querySELECT
page,
url
FROM
`httparchive.sample_data.response_bodies_mobile_10k`
WHERE
REGEXP_CONTAINS(body, r'\(\s*["\']mousewheel["\']\s*,\s*ssc_wheel\s*\)') |
Ooooh, I finally get it. It's dead code! Since the intervention we're specifying for #365 already makes all |
Oh, very cool! Sorry none of us put that together Simon! I was going to chime in here to say that back when I was looking into this I found a LOT of UA sniffing treating Firefox differently, and so I did expect that we'd need to specify this hack just for browsers claiming to be WebKit. But removing it is, of course, even better. Thanks for filing the issue! |
Note that the problematic listener gets installed on |
Yes, all of window, document, root element and "the body element" |
Yes this hack forged the path for the larger intervention proving it was doable. I've removed it from blink. |
Really great find Simon!! I guess we can close this issue now :). |
Yep. I've also filed an issue for WebKit: https://bugs.webkit.org/show_bug.cgi?id=241782 |
https://bugs.webkit.org/show_bug.cgi?id=241782 rdar://95972172 Reviewed by Antti Koivisto. In whatwg/dom#1088, Simon Pieters analyzed the hack introduced by WebKit and Blink to determine if it was necessary to implement it in Gecko, but during the investigation he discovered that a part of the Quirk being dead code. Blink removed this hack on June 2022. https://bugs.chromium.org/p/chromium/issues/detail?id=1337217 It should be possible to remove it on WebKit as well. * Source/WebCore/dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): * Source/WebCore/page/Quirks.cpp: (WebCore::Quirks::shouldMakeEventListenerPassive): * Source/WebCore/page/Quirks.h: Canonical link: https://commits.webkit.org/270987@main
…gi?id=241782 Remove Quirk dead code: passive mousewheel event for smoothscroll.js https://bugs.webkit.org/show_bug.cgi?id=241782 rdar://95972172 Reviewed by Antti Koivisto. In whatwg/dom#1088, Simon Pieters analyzed the hack introduced by WebKit and Blink to determine if it was necessary to implement it in Gecko, but during the investigation he discovered that a part of the Quirk being dead code. Blink removed this hack on June 2022. https://bugs.chromium.org/p/chromium/issues/detail?id=1337217 It should be possible to remove it on WebKit as well. * Source/WebCore/dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): * Source/WebCore/page/Quirks.cpp: (WebCore::Quirks::shouldMakeEventListenerPassive): * Source/WebCore/page/Quirks.h: Canonical link: https://commits.webkit.org/270987@main
So, Chromium and WebKit also implement this hack for smoothscroll.js:
https://bugs.chromium.org/p/chromium/issues/detail?id=501568
https://github.com/WebKit/WebKit/blob/dd956d5e74249681ddf904e0bbe401f308b65e0f/Source/WebCore/page/Quirks.cpp#L929-L946
As far as I can tell, Gecko does not. https://searchfox.org/mozilla-central/source/dom/events/EventListenerManager.cpp#1593 (and no search results for "ssc_wheel")
Should we put this in the spec?
The use counter is currently at ~0.01% of page views. But scrolling the page doesn't work at all without the hack.
https://chromestatus.com/metrics/feature/timeline/popularity/2020
Originally posted by @zcorpan in #365 (comment)
@domenic said
The text was updated successfully, but these errors were encountered: