Closed Bug 1611872 Opened 4 years ago Closed 3 years ago

The scrollbar that displayed by the overflow property is overlaid above the front layer

Categories

(DevTools :: Responsive Design Mode, defect, P2)

72 Branch
defect

Tracking

(firefox-esr68 wontfix, firefox74 wontfix, firefox75 wontfix, firefox76 wontfix, firefox77 wontfix, firefox78 fix-optional)

RESOLVED DUPLICATE of bug 1730503
Tracking Status
firefox-esr68 --- wontfix
firefox74 --- wontfix
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- wontfix
firefox78 --- fix-optional

People

(Reporter: lichunbin814, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36

Steps to reproduce:

  1. switch to RWD design mode
  2. open the link https://www.w3schools.com/cssref/pr_pos_overflow.asp
  3. scrolling down to 'Browser Support' node
  4. click top menu

Actual results:

  1. The back layer's scroll bar overlap is overlap on the front layer

Expected results:

  1. The front layer should show higher order than the back layer's scroll bar ( like chrome behavior)
Summary: Display the scrollbar that displayed by the overflow property to the bottom layer → The scrollbar that displayed by the overflow property is overlap on the front layer
Summary: The scrollbar that displayed by the overflow property is overlap on the front layer → The scrollbar that displayed by the overflow property is Overlaid above the front layer
Summary: The scrollbar that displayed by the overflow property is Overlaid above the front layer → The scrollbar that displayed by the overflow property is overlaid above the front layer
Component: Untriaged → Responsive Design Mode
Product: Firefox → DevTools

Hi lichunbin814,

We tried but we couldn't reproduce the issue. Are you able to test in the latest Firefox Nightly and let us know if the issue is still happening?

Anything particular about your settings, like "Always Show Scrollbars" option set on the OS?

Flags: needinfo?(lichunbin814)

We haven't received updated information about how to reproduce this.
I will close this now, but feel free to reopen if there is a list of steps to reproduce consistently.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE

I can reproduce the issue on Nightly76.0a1(20200326093308) Wndows10.

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---

Matt, we are having trouble reproducing this (on macOS), but it's apparently still happening for the reporter on a Windows 10 machine. The regression window points to Bug 1450360. Can you please test and see if you can reproduce and/or determine if there's a need to update the work done in Bug 1450360?

Flags: needinfo?(lichunbin814) → needinfo?(matt.woodrow)

Miko, any chance you can look at this?

I think the issue is that ScrollFrameHelper::BuildDisplayList is calling MaybeAddTopLayerItems as well as AppendScrollPartsTo.

MaybeAddTopLayerItems is setting the max possible z-index value to try be on top, but AppendScrollParts to scans the list and tries to match the highest value in the list so that it's on top.

We might need something smarter to stop the scrollbars from overlaying the top layer content.

Flags: needinfo?(matt.woodrow) → needinfo?(mikokm)

hi :gl, could you assign a priority for this one, please?

Flags: needinfo?(gl)
Flags: needinfo?(gl)
Priority: -- → P2

Botond seems to have worked on this code recently and might know it better.

Flags: needinfo?(mikokm) → needinfo?(botond)

Hmm. I did change the place where BuildDisplayListForTopLayer() is called, from ViewportFrame::BuildDisplayList() to ScrollFrameHelper::BuildDisplayList(), in bug 1528743. However, that change happened more recently than bug 1450360 (the change identified as regressing this), so I don't think that's the issue.

Flags: needinfo?(botond)

I can reproduce the issue on Linux, and I can verify that backing out bug 1528743 locally does not fix it.

Attached file Display list dump

Attached is a display list dump. I believe display item 0x7f14e23aa0c8 is one of the offending horizontal scrollbars. It does indeed have a z-index of 2147483647.

It's unclear to me which are the top-layer items in the display list, but I guess it's one of the earlier items with z=2147483647.

This comment says:

// We want overlay scrollbars to always be on top of the scrolled content,
// but we don't want them to unnecessarily cover overlapping elements from
// outside our scroll frame.

and in the overlay scrollbar case, it computes the z-index via MaxZIndexInList(aLists.PositionedDescendants(), aBuilder).

I guess, since 0x7f14e23aa0c8 is a top-level item in the display list, the preceding items with z=2147483647 will be among aLists.PositionedDescendants()?

I'm not deeply familiar with display list building, so what I'm wondering about is: should subframe scrollbars end up as top-level items in the display list, as opposed to being descendants of some item representing the subframe ("subframe" meaning non-root scrollable frame)?

Conceptually, I feel like what we would like to do, is restrict this maximum to only consider the items inside the scroll frame whose scrollbars we are building, and not enclosing scroll frames (like the root).

(In reply to Botond Ballo [:botond] from comment #11)

I'm not deeply familiar with display list building, so what I'm wondering about is: should subframe scrollbars end up as top-level items in the display list, as opposed to being descendants of some item representing the subframe ("subframe" meaning non-root scrollable frame)?

Unfortunately not. Scrollable subframes aren't stacking contexts (unless other css properties make them one), so content from outside the scrollframe can interleave with content inside. Given that, we generally expect scrollbars (and the rest of the scrolled content) to be in the same display list as their nearest stacking context ancestor (often the top-level).

Conceptually, I feel like what we would like to do, is restrict this maximum to only consider the items inside the scroll frame whose scrollbars we are building, and not enclosing scroll frames (like the root).

I would have expected, at the time we build the scrollbars for subframes, we wouldn't have yet built the top-layer content for the root scroll frame. So it's not obvious why the computation of z-index for subframe scrollbar is coming up with such a high number, nor why they get sorted to be after the top-layer (sorting should be stable, so even with the same z-index, I'd expect top-layer to stay top).

Note: this issue is specific to RDM. On other platforms with overlay scrollbars (e.g. Android), the scrollbars disappear after interacting with them, so by the time you open the menu and it renders, the subframe's horizontal scrollbar will have disappeared.

I attempted to get an rr recording for the issue so we can see where we diverge from expectations, but the combination of RDM + a relatively heavy page with a bunch of script makes it really unwieldy to work with. A minimal testcase demonstrating the issue would help a lot.

(In reply to Botond Ballo [:botond] from comment #13)

I attempted to get an rr recording for the issue so we can see where we diverge from expectations, but the combination of RDM + a relatively heavy page with a bunch of script makes it really unwieldy to work with. A minimal testcase demonstrating the issue would help a lot.

I've posted a minimal testcase over on duplicate bug 1731880: https://bugzilla.mozilla.org/attachment.cgi?id=9242361
It's just a scrollable element, which is covered up by some other element. In this case I didn't cover it up entirely, just so you could see a little bit of the scrollbar even in non-RDM mode to get an idea of what's going on; but the bug happens regardless of whether the element is partially or fully covered up.

Would you mind circling back to take a look here, with that testcase?

Flags: needinfo?(botond)

This issue appears to be fixed in latest nightly.

I will get a fix range.

This was fixed by bug 1730503.

Status: NEW → RESOLVED
Closed: 4 years ago3 years ago
Flags: needinfo?(botond)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: