Closed Bug 2057921 Opened 22 days ago Closed 20 days ago

Consider not disabling overlay scrollbars on the top level root scroll container on mobile even if there's non-zero width/hight ::-webkit-scrollbar styles

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Looks like that's what Chrome does.

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc;l=1565-1569;drc=ba690bcd46efc8ee9453e480770b5cb080824dea

      VisualViewport& viewport = frame->GetPage()->GetVisualViewport();
      if (!settings->GetAllowCustomScrollbarInMainFrame() &&
          frame->IsMainFrame() && viewport.IsActiveViewport()) {
        return layout_box;
      }

IIUC, layout_box is not the one used for resolving ::-webkit-scrollbar styles, rather it's for scrollbar-color etc.

In fact below the above code there's:

    // If the <body> didn't have a custom style, then the root element might.
    Element* doc_element = doc.documentElement();
    if (doc_element && doc_element->GetLayoutObject() &&
        doc_element->GetLayoutObject()->StyleRef().HasCustomScrollbarStyle(
            doc_element) &&
        !layout_box.StyleRef().UsesStandardScrollbarStyle()) {
      return *doc_element->GetLayoutObject();
    }

doc_element->GetLayoutObject() is the one.

Anyway, an important thing is GetAllowCustomScrollbarInMainFrame returns false on Android, the flag is forcibly set to false:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/exported/web_view_impl.cc;l=1795-1796;drc=752ca13a20a10b696b4525287b4a75f2d0f04f1c

#if BUILDFLAG(IS_ANDROID)
  settings->SetAllowCustomScrollbarInMainFrame(false);
Severity: -- → S3
Priority: -- → P2
Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Pushed by hikezoe.birchill@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0f4e0830528e https://hg.mozilla.org/integration/autoland/rev/dd86d8376718 Stop disabling overlay scrollbars on the root scroll container on mobile even with a ::-webkit-scrollbar style. r=layout-reviewers,emilio
Pushed by pstanciu@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ab3bfd4d1a4e https://hg.mozilla.org/integration/autoland/rev/027e6efbe932 Revert "Bug 2057921 - Stop disabling overlay scrollbars on the root scroll container on mobile even with a ::-webkit-scrollbar style. r=layout-reviewers,emilio" for causing reftest failures @ webkit-scrollbar-on-root-on-mobile.html

Backed out for causing reftest failures @ webkit-scrollbar-on-root-on-mobile.html

Flags: needinfo?(hikezoe.birchill)

Filed bug 2058388. For some reasons with reftest.use-draw-snapshot=true the root scrollbars are not rendered at all.

Flags: needinfo?(hikezoe.birchill)
Pushed by hikezoe.birchill@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2bcc5c1a352d https://hg.mozilla.org/integration/autoland/rev/3a0ed263e80d Stop disabling overlay scrollbars on the root scroll container on mobile even with a ::-webkit-scrollbar style. r=layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 20 days ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Blocks: 2016890
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: