Closed Bug 2061547 Opened 2 months ago Closed 1 month ago

Restrict ::-webkit-scrollbar support to a pref-controlled site list instead of enabling it for all sites

Categories

(Core :: Layout: Scrolling and Overflow, task, P2)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
relnote-firefox --- 155+
firefox155 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

(Keywords: dev-doc-complete, webcompat:platform-bug)

Attachments

(1 file)

No description provided.
Blocks: 2061121
No longer depends on: 2061121

So for now we need these two sites:

See Also: → 1977511

Claude told me this script to tell whether ::-webkit-scrollbar style comes from on each site:

  [...document.styleSheets].forEach(s => {
    let hit = false;
    try { hit = [...s.cssRules].some(r => r.cssText.includes("-webkit-scrollbar")); }
    catch (e) { console.log("(cross-origin, unreadable)", s.href); return; }
    if (hit) console.log(s.href ?? "(inline)", "<- has ::-webkit-scrollbar");
  });

On slack.com:

  https://a.slack-edge.com/bv1-13-br/client-boot-styles.40cc7d7614a9b06b.min.css?cacheKey=gantry-1786049259 <- has ::-webkit-scrollbar
  https://a.slack-edge.com/bv1-13-br/client-boot-styles.40cc7d7614a9b06b.min.css?cacheKey=gantry-1786049259 <- has ::-webkit-scrollbar
  https://a.slack-edge.com/canvas_blob/zu8N7bpmeEk-PCuY7SrT5Q-gecko <- has ::-webkit-scrollbar

On mail.google.com:

  (inline) <- has ::-webkit-scrollbar                         
  (cross-origin, unreadable) https://www.gstatic.com/og/_/ss/k=og.qtm.BpAJnjypRUQ.L.F4.O/m=q_sf_gm3,qmd,qcwid,qba,d_b_gm3,d_da_gm3,d_wi_gm3,d_lo_gm3/exc  m=qaaw,qabr,qadd,qaid,qalo,qebr,qein,qhaw,qhawgm3,qhba,qhbr,qhbrgm3,qhch,qhchgm3,qhga,qhid,qhidgm3,qhin,qhlo,qhlogm3,qhmn,qhpc,qhsf,qhsfgm3,qhtt/d=1/e  d=1/ct=zgms/rs=AA2YrTuwV5mgBz8T3b5AQkiXjNbz_VVtzQ
  (cross-origin, unreadable) https://fonts.googleapis.com/css2?family=Google+Sans+Mono&display=block

So I hope "slack-edge.com,mail.google.com" works.

Okay as I understand https://bugzilla.mozilla.org/show_bug.cgi?id=2016775#c10 , the slack case is no longer a case.

See Also: → 2056897

There are also other sites which have webcompat issues with webkit-scrollbar. I will need to make sure the interventions for them start working again when we make this change (they presently check layout.css.fake-webkit-scrollbar.enabled).

Adds an enabled_domains_pref counterpart to the existing
disabled_domains_pref plumbing: when
layout.css.fake-webkit-scrollbar.enabled-domains is non-empty, the
pseudo-element is treated as unsupported on every domain that is not
listed. The blocklist is applied on top of the allowlist.

The list starts with mail.google.com (bug 1973196). Its
::-webkit-scrollbar rules live in an inline stylesheet, so the URL
being matched is the document's. Slack (bug 2016775) is deliberately
not listed: that bug was resolved in February when Slack moved the
native scrollbar out of view, so it no longer relies on this feature.
Its rules also come from a.slack-edge.com rather than slack.com, so
listing it would mean allowlisting a CDN.

The pre-existing ::-webkit-scrollbar reftests load over file://, which
an allowlist never matches, so they now set enabled-domains to the
empty string explicitly.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P2
Pushed by hikezoe.birchill@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4225b4048e5c https://hg.mozilla.org/integration/autoland/rev/8c6e520baf70 Restrict ::-webkit-scrollbar to a pref-controlled site list. r=layout-reviewers,firefox-style-system-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

Did you want to nominate this for the Fx155 relnotes? If so, set the relnote-firefox flag to "?"
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination

Possible wording:

Support for the non-standard ::-webkit-scrollbar pseudo-element, added in Firefox 153, is now limited to a small list of sites rather than applying to the whole web.

Flags: needinfo?(hikezoe.birchill)

Release Note Request (optional, but appreciated)
[Why is this notable]: This partially reverses a change that shipped to users in Firefox 153
[Affects Firefox for Android]: Yes
[Suggested wording]: Support for the non-standard ::-webkit-scrollbar pseudo-element, added in Firefox 153, is now limited to a small list of sites rather than applying to the whole web
[Links (documentation, blog post, etc)]: None

Thank you, Ryan!

relnote-firefox: --- → ?
Flags: needinfo?(hikezoe.birchill)

Added to the Fx155 relnotes.

This caused bug 1836872 (docs.google.com) to regress.

Blocks: 2063926
Blocks: 2064225
Regressions: 2064635
QA Whiteboard: [qa-triage-done-c156/b155]
Blocks: 2056897
See Also: 2056897 →
Keywords: dev-doc-needed
Duplicate of this bug: 2061121
Blocks: 2057397
No longer duplicate of this bug: 2061121
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: