Closed Bug 1627362 Opened 5 years ago Closed 4 years ago

Fix sticky handling more with dynamic toolbar

Categories

(Core :: Panning and Zooming, defect, P3)

All
Android
defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- verified

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(8 files)

I was doing some additional manual testing with the position:sticky support in bug 1610731 and found at least one bug with sticky positioned items. It happens primarily with WebRender enabled but also manifests transiently with WebRender disabled.

STR:

  • load the attached page in Fenix (I was using the emulator) with the dynamic toolbar at the bottom.
  • Scroll down to where the text "top of next div" is visible.
  • Scroll up and down with that text on-screen to show and hide the dynamic toolbar.

Expected:

  • the red sticky div never covers up the "top of next div" text

Actual:

  • the red sticky div can end up getting shifted down to cover the "top of next div" text.

I think this might be because the red div is at outside its sticky range, and so shouldn't behave "sticky" any more. But we apply the compositor transform to it anyway

Ah! We have a check for "currently stuck" that we probably need to use in some other codepaths, including the WR one.

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

Ah! We have a check for "currently stuck" that we probably need to use in some other codepaths, including the WR one.

And the issue in bug 1627326 may well be that that check only handles bottom and not top.

Assignee: nobody → kats

We can use the map lock to do a lookup in mApzcMap, instead of requiring the
tree lock to call GetTargetAPZC.

This will make future patches simpler, as we can now create these info objects
more easily for the non-WR codepath as well.

Depends on D70906

This sets us up to be able to use these helper methods on WR sampling codepath.

Depends on D70907

I couldn't understand what it was doing before, but conceptually it should
be pretty simple.

Depends on D70908

The semantics of sticky items are somewhat different from the semantics of
fixed items. For fixed items, if an item is fixed to eTop or eBottom or
eTopBottom, it is always fixed to those sides. For sticky items, however,
the sides actively stuck to are dependent on the scroll position. So we need
a mechanism to dynamically figure out which sides are stuck, and use those
sides when computing the fixed margins to apply. This patch implements that
by modifying the IsStuckToRootContentAtBottom method into a
SidesStuckToRootContent method.

Depends on D70909

This patch just ensures the changes in the previous patches get applied
to the WR codepath, and is sufficient to make all the remaining sticky
tests pass on Android+WR.

Depends on D70910

Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b6821fad28e5 Remove the tree lock requirement for a couple of functions. r=botond https://hg.mozilla.org/integration/autoland/rev/882b9adeff90 Have (Fixed|Sticky)PositionInfo take a HTTN in the constructor. r=botond https://hg.mozilla.org/integration/autoland/rev/35144abc5266 Allow calling fixed/sticky helpers with (Fixed|Sticky)PositionInfo. r=botond https://hg.mozilla.org/integration/autoland/rev/ec1127afc8ad Rewrite IsStuckAtBottom to be simpler and clearer. r=botond https://hg.mozilla.org/integration/autoland/rev/2348d884d386 Properly support items stuck to both bottom and top. r=botond https://hg.mozilla.org/integration/autoland/rev/5bbfa16aa52d Fix WR codepath. r=botond https://hg.mozilla.org/integration/autoland/rev/ba223c9eb4fd Improve logging for fixed/sticky data on the WR codepath. r=botond
Flags: qe-verify+

Tested on the latest Fenix Nightly build (78.0a1-5/12) following the steps from the description and the issue is still reproducible (the red sticky div is covering the "top of next div" text) if the toolbar is not displayed. Video: https://drive.google.com/open?id=1BH5rHaeuHa-XA_VKfmqAXRl6urNcB_i2.

Please note that this is reproducible only when scrolling slowly up with the toolbar hidden.

Flags: needinfo?(kats)

I see that as well, but it's actually a separate issue from what I meant in comment 0. In your video it's the "transition point" that's glitchy but in comment 0 I was referring to jiggling up and down rapidly while the "top of next div" was already near the middle of the screen. The thing in your video should probably be filed as another bug, but it's more of an edge case.

Flags: needinfo?(kats)
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: