Closed Bug 1664838 Opened 4 years ago Closed 4 years ago

Sometimes content are not rendered after scrolling

Categories

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

Firefox 82
defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- unaffected
firefox82 --- fixed

People

(Reporter: Fanolian+BMO, Assigned: kats)

References

(Regression)

Details

(Keywords: nightly-community, regression, reproducible)

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0
Build ID: 20200914095101

Steps to reproduce

  1. Open this Wikipedia link 5 times in background tabs.
  2. Switch to those tabs.
  3. Scroll up and down.

Actual result

(Please refer to the attached videos.)

  1. In some tabs the content is not rendered after scrolling.
  2. For those tabs, the click position is wrong after scrolling. (This feels like bug 1662379 but I haven't encountered it before bug 1662013 is fixed.)
  3. After switch away and back to the tab, the content position is wrong.

Notes

  1. I cannot reproduce all the issues if I open the Wiki link in the current tab.
  2. The wrong click position issue is very easy to encounter. In YouTube, for example, scroll a little bit then click the video controls. Most of the time it misses.
  3. This does not always occur on all background tabs.
  4. Issues can be reproduced in a new profile.

System info

Windows 10 1909
Nvidia GTX 760. Driver v451.67.

Attached file about_support.txt (deleted) —

About:support for my system.

I'm seeing this too fwiw. Thanks for the bisection and the STR Fanolian!

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(kats)

I've also seen it in Phabricator, fwiw.

I'll take a look, thanks.

Assignee: nobody → kats
Flags: needinfo?(kats)
Severity: -- → S2
Priority: -- → P2

So the problem here is that we end up in a state where APZ has the wrong scroll generation. This results in the repaint request always failing to run this code and then APZCCallbackHelper::IsScrollInProgress() always returns true even when it shouldn't. This causes the APZ scroll change to not get applied to the main thread, getting things out of sync.

The APZ scroll generation is wrong because sometimes we get into NotifyLayersUpdated and take the isDefault branch here but there are no scroll position updates in the metadata. This ends up incorrectly preserving the "0" scroll generation on the metrics instead of adopting the updated generation from the incoming metrics.

I have a simple fix that I'd like to land quickly since this probably affects a lot of people. I can work on writing a test after. And I'll try to improve the code structure in bug 1662019 once the test is in place, to ensure this doesn't regress again.

https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=f799351ca3aa603fcb7b69ed89004497504892f7

Blocks: 1662019
Keywords: leave-open

I investigated this more with rr to get a better understanding of the exact mechanism that causes this scenario. Turns out that the main thread does a paint of the content, but before the parent process has updated the RefLayer to point to the new tab. So main thread paint (which has firstPaint=true and the ScrollPositionUpdate instances on the metadata) gets sent to the compositor, but APZ's UpdateHitTestingTree function doesn't actually walk into the layer subtree for that content process (because the RefLayer is still pointing to the old tab's content layer tree). Thus the paint is "dropped" from the APZ point of view, and then after the tab switch is complete the APZC instance gets created and gets a metadata from a new paint. This metadata doesn't have the ScrollPositionUpdates any more, but just has the latest generation number.

Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ba172dcd1f2f
Ensure APZ updates its scroll generation even when there are no scroll position updates. r=botond
Status: NEW → RESOLVED
Closed: 4 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: