Closed Bug 1013377 Opened 10 years ago Closed 9 years ago

Non-overlay scrollbars and APZ interact badly

Categories

(Core :: Panning and Zooming, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mstange, Unassigned)

References

Details

With the patches from bug 944938 applied, and the system scrollbar visibility pref set to "always visible", strange things happen.

For example:
 - In the resting position, the purple layer border does not separate the scrollbars from the page (as it should), but instead reaches halfway into the scrollbars. This may be related to HiDPI.
 - When both horizontal and vertical scrollbars are visible, parts of the scrolled page sometimes show through the scroll corner. Instead, the page should be clipped to the inner rect that is framed by the scrollbars.
 - Also with both scrollbars visible, when scrolled to the very end, the scrollbars themselves are clipped away by the purple layer border.
Assignee: nobody → mstange
Status: NEW → ASSIGNED
Depends on: 1016569
(In reply to Markus Stange [:mstange] from comment #0)
> With the patches from bug 944938 applied, and the system scrollbar
> visibility pref set to "always visible", strange things happen.
> 
> For example:
>  - In the resting position, the purple layer border does not separate the
> scrollbars from the page (as it should), but instead reaches halfway into
> the scrollbars. This may be related to HiDPI.

It is, and there's this helpful comment in nsLayoutUtils.cpp near one of the callers of GetActualScrollbarSizes() (but both callers are affected):
// Scrollbars are not subject to scaling, so CSS pixels = layer pixels for them.

>  - When both horizontal and vertical scrollbars are visible, parts of the
> scrolled page sometimes show through the scroll corner. Instead, the page
> should be clipped to the inner rect that is framed by the scrollbars.
>  - Also with both scrollbars visible, when scrolled to the very end, the
> scrollbars themselves are clipped away by the purple layer border.

In order to fix this, I think we need to get rid of the distinction between display ports on root sub documents and display ports on subframes. The APZ-scrollable ContainerLayer really needs to have composition bounds that only cover the area without scrollbars. If the scrollbars themselves are inside that container layer, they'll be clipped away. So what we want is a layer tree like this:
- ContainerLayer for nsDisplaySubdocument that covers viewport + scrollbars
  - ContainerLayers for scrollbars (nsDisplayOwnLayer) (either under the scrollable layer or on top, depending on whether they're overlay scrollbars)
  - ContainerLayer for scroll frame (nsDisplayScrollLayer)
    - layers for page content
This seems mostly fixed now.
Assignee: mstange → nobody
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.