Closed Bug 1449770 Opened 6 years ago Closed 1 year ago

position:sticky inside of position:fixed does't async-scroll in Firefox for Android (and asserts in ActiveScrolledRoot::PickDescendant() in debug build)

Categories

(Core :: Web Painting, defect, P2)

61 Branch
Unspecified
Android
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: nolan, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file sticky-repro.html
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17635

Steps to reproduce:

1. In Firefox for Android, navigate to https://bl.ocks.org/nolanlawson/raw/ef8106169c85d6acc3be8a1213d14342/
2. Scroll down using touch


Actual results:

The sticky button doesn't change its position smoothly as you scroll. Instead it janks and flickers, only landing at the correct position after a visible delay.


Expected results:

The sticky element should scroll smoothly with the page. This same demo works fine in Safari for iOS, Chrome for Android, and desktop versions of Chrome/Edge/Firefox/Safari.

Removing position:fixed from the <body> element appears to fix the issue, which indicates to me that this is some interplay between position:fixed and position:sticky.

I tested using Firefox Nightly 61.0a1 on a Samsung GS5 running Android 7.1.2.
James, can you or someone on your team get a profile?

Kat's, do you think this could be related to the fennec apz?
Flags: needinfo?(snorp)
Flags: needinfo?(bugmail)
Yeah this looks like an async scrolling bug. It's not jank, no need to get a profile.
Status: UNCONFIRMED → NEW
Component: Graphics: Layers → Panning and Zooming
Ever confirmed: true
Flags: needinfo?(snorp)
Flags: needinfo?(bugmail)
OS: Unspecified → Android
I ran a debug android build and tried scrolling this test case on that. It immediately crashed with an assertion failure at https://searchfox.org/mozilla-central/rev/d0413b711da4dac72b237d0895daba2537f1514c/layout/painting/nsDisplayList.h#292 so it seems like the root cause here might be invalid assumptions in the layout ASR code.
Component: Panning and Zooming → Layout
Summary: position:sticky inside of position:fixed causes jank in Firefox for Android → position:sticky inside of position:fixed does't async-scroll in Firefox for Android (and asserts in debug build)
Component: Layout → Layout: Web Painting
Attached file display-list
This reproduces on desktop with layout.scroll.root-frame-containers=true.

frame #1: 0x0000000113d14eb6 XUL`mozilla::ContainerState::ProcessDisplayItems(this=0x00007fff5aca31f0, aList=0x000000013142f6b8) at FrameLayerBuilder.cpp:4593
   4590	      ContainerLayerParameters params = mParameters;
   4591	      params.mBackgroundColor = uniformColor;
   4592	      params.mLayerCreationHint = GetLayerCreationHint(animatedGeometryRoot);
-> 4593	      params.mScrollMetadataASR = ActiveScrolledRoot::PickDescendant(mContainerScrollMetadataASR, scrollMetadataASR);
   4594	      params.mCompositorASR = params.mScrollMetadataASR != mContainerScrollMetadataASR
   4595	                                ? params.mScrollMetadataASR
   4596	                                : mContainerCompositorASR;
(lldb) p item
(nsDisplayStickyPosition *) $0 = 0x000000013142f020
(lldb) p mContainerScrollMetadataASR
(const mozilla::ActiveScrolledRoot *) $1 = 0x00000001082a7a80
(lldb) p scrollMetadataASR
(const mozilla::ActiveScrolledRoot *) $2 = 0x00000001082b7140
(lldb) p *mContainerScrollMetadataASR
(const mozilla::ActiveScrolledRoot) $3 = {
  mParent = {
    mRawPtr = 0x0000000000000000
  }
  mScrollableFrame = 0x000000013444b158
  mRefCnt = (mValue = 4)
  _mOwningThread = (mThread = 0x0000000105759080)
  mViewId = (mStorage = unsigned char [8] @ 0x00007fdb56dd6e30, mIsSome = '\0')
  mDepth = 1
  mRetained = true
}
(lldb) p *scrollMetadataASR
(const mozilla::ActiveScrolledRoot) $4 = {
  mParent = {
    mRawPtr = 0x0000000000000000
  }
  mScrollableFrame = 0x000000013444bbb8
  mRefCnt = (mValue = 16)
  _mOwningThread = (mThread = 0x0000000105759080)
  mViewId = (mStorage = unsigned char [8] @ 0x00007fdb568d98a0, mIsSome = '\0')
  mDepth = 1
  mRetained = true
}
Markus, Timothy, do either of you know what the expected behaviour is for fixed + sticky, with containerful scrolling?
Flags: needinfo?(tnikkel)
Flags: needinfo?(mstange)
Priority: -- → P2
Summary: position:sticky inside of position:fixed does't async-scroll in Firefox for Android (and asserts in debug build) → position:sticky inside of position:fixed does't async-scroll in Firefox for Android (and asserts in ActiveScrolledRoot::PickDescendant() in debug build)
Severity: normal → S3

Botond, can you check if this still reproduces?

Flags: needinfo?(tnikkel)
Flags: needinfo?(mstange.moz)
Flags: needinfo?(botond)

The attached testcase seems to be well-behaved for me. I suspect this was fixed by WebRender.

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

Attachment

General

Creator:
Created:
Updated:
Size: