Closed Bug 1742241 Opened 3 years ago Closed 3 years ago

page partial render or not render when switch to tabs util scroll in that tab

Categories

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

Firefox 96
defect

Tracking

()

VERIFIED FIXED
99 Branch
Tracking Status
firefox-esr91 --- verified
firefox94 --- wontfix
firefox95 --- wontfix
firefox96 --- wontfix
firefox97 --- wontfix
firefox98 --- verified
firefox99 --- verified

People

(Reporter: mix5003, Assigned: tnikkel)

References

(Regression)

Details

(Keywords: regression)

Attachments

(4 files)

Attached video 20211120_212729.mp4

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0

Steps to reproduce:

  1. open google.com for 2 tabs
  2. open https://phabricator.services.mozilla.com/D128992 and wait for it loaded and scroll to bottom
  3. switch to first google tab
  4. right click at phabricator tab and click "Reload Tab". wait until it reloaded
  5. addition wait for 5 second
  6. switch to phabricator you can see that tab not render anything. but if you scroll down it will render properly

please try 2-3 times if it not happen. sometime it can works normally.

i attach video, so you can see reproduce step.

Actual results:

some tab not render (some tab still partial render) after reload in background.

for me i can see this many times when i open firefox and tab just restore from previous session. (it works normally you just need a little scroll in that tab)

Expected results:

tab should render normally when switch to that tab

because reproduce step may not reliable (sometime tab can render normally), so this mozregression may not correctly but you can take a look it may able to help you

2021-11-20T21:37:31.395000: DEBUG : Found commit message:
Bug 1687926. Don't request a repaint and set a display port if it's the first time for an azpc getting metrics always via the visualScrollOffsetUpdated path. r=botond

https://searchfox.org/mozilla-central/rev/2c06b16a0c15ae340a0532e319cbf89ef9d21b68/gfx/layers/apz/src/AsyncPanZoomController.cpp#5034

That RequestContentRepaint call gets executed every time isDefault is true (and ignoreVisualUpdate is false), ie whenever the azpc gets metrics for the first time. RequestContentRepaint causes a full display port to be set on the content. That is undesirable because we set zero margin display ports (via SetZeroMarginDisplayPortOnAsyncScrollableAncestors) and we don't want to expand them to full display ports

This bug is to fix the regression caused by bug 1627012. Two other bugs also regressed this (bug 1662013 and bug 1667475), and we need to fix all of them to fix the problem. Bug 1687886 is filed for the regression from bug 1667475. Bug 1687927 is filed for the regression from bug 1662013.

https://hg.mozilla.org/integration/autoland/rev/47328d6c1b40 made us request a repaint any time we have default metrics because we might get a new visual scroll offset, but if our visual scroll offset doesn't change we shouldn't need to do anything.

Differential Revision: https://phabricator.services.mozilla.com/D102586

2021-11-20T21:37:31.395000: DEBUG : Did not find a branch, checking all integration branches
2021-11-20T21:37:31.398000: INFO : The bisection is done.
2021-11-20T21:37:31.400000: INFO : Stopped

The Bugbug bot thinks this bug should belong to the 'Firefox::Session Restore' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Session Restore
Component: Session Restore → Graphics
Product: Firefox → Core
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
See Also: → 1741297

Thanks for filing this. I think I've seen something like this on macos, but haven't been able to pin down steps to reproduce. Your regression range actually makes sense to me.

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 10 → All
Hardware: x86_64 → All
Component: Graphics → Panning and Zooming
Regressed by: 1687926
Has Regression Range: --- → yes

Set release status flags based on info from the regressing bug 1687926

See Also: 1741297
Severity: -- → S3
Priority: -- → P2
See Also: → 1745108

i think this bug may relate to https://bugzilla.mozilla.org/show_bug.cgi?id=1742274 .
because in some website. that use position: fixed to bottom: 0, it render at middle of page.

See Also: → 1746425

Glenn, this looks like an issue with WR picture invalidation. Just pinging in case you have some thoughts :)
One particularly interesting case is https://bugzilla.mozilla.org/attachment.cgi?id=9255716, where one of the tiles shows but others do not.

Flags: needinfo?(gwatson)

Checked with tnikkel in matrix, and it sounds like this is APZ related rather than WR.

Flags: needinfo?(gwatson)
Blocks: 1745108

We get a couple of ScrollToImpl calls with origin == Restore, that scroll the page to about halfway to the final destination. They don't update the visual viewport offset here because of the origin

https://searchfox.org/mozilla-central/rev/e3a7a72713e1ba8696cb2af55e928059bc822572/layout/generic/nsGfxScrollFrame.cpp#3238

Then we get some ScrollToImpl calls with origin that does clobber apz so we update the visual scroll offset, but because he visual scroll offset is zero and we have a large scroll offset on the scrollframe already relativeOffset is large. We end up with a very large difference between the scroll position of the scroll frame and the visual viewport offset.

The regressing changeset removed a repaint request which would have reconciled this, without that we have a problem.

I think the problem is that we're calling PresShell()->GetVisualViewportOffset(), that returns (0,0) if the visual viewport offset hasn't been set, but here we want the layout scroll offset if we haven't set a visual scroll offset. This is what ScrollFrameHelper::GetVisualViewportOffset does. If this is correct, an audit of the other callers should be done to see if they suffer this same problem.

Okay, I think I have a workable fix for that specific issue, but I want to also look into teaching NotifyLayersUpdated to detect this situation and ask for a repaint, even if we think that it is a bug on the content side, so that if there are other similar bugs on the content side we handle it robustly and the user sees no breakage.

See Also: → 1753279
See Also: → 1752942

I think bug 1543485 introduced the bug here, it's just that bug 1687926 removed an (unnecessary) repaint request that "fixed" the problem.

Regressed by: 1543485

If the visual viewport offset is not set on the presshell then calling GetVisualViewportOffset returns (0, 0). This then causes us to introduce an incorrect offset between the layout scroll offset and the visual viewport offset that didn't exist before.

Logically we want to treat an unset visual viewport offset as the layout scroll offset.

Other possible fixes:
-make PresShell::GetVisualViewportOffset return the layout scroll offset if a visual viewport offset is not set
-make this if conditional on a visual viewport offset already being set
-the combination of the two above
All of these fail some tests on try server. I haven't investigated why. If we want to go with any of those potential fixes in the future then this patch is a step on the way there

Assignee: nobody → tnikkel
Status: NEW → ASSIGNED
See Also: 1753279
See Also: 1752942
See Also: → 1753881
Pushed by tnikkel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ba1e8079ac3a Don't access the PresShell's visual viewport offset if we haven't set one. r=botond https://hg.mozilla.org/integration/autoland/rev/d7e1407dbefe Add test. r=botond
Regressions: 1754998
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

Comment on attachment 9262387 [details]
Bug 1742241. Don't access the PresShell's visual viewport offset if we haven't set one. r?botond

Beta/Release Uplift Approval Request

  • User impact if declined: switching back to a tab, or after session restore, half of tab will be blank until the user scrolls
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): simple fix to not use a value that has not been set
  • String changes made/needed:
Attachment #9262387 - Flags: approval-mozilla-beta?
Attachment #9262571 - Flags: approval-mozilla-beta?

Comment on attachment 9262387 [details]
Bug 1742241. Don't access the PresShell's visual viewport offset if we haven't set one. r?botond

Fix for an old regression with multiple duplicates, we are still in early betas, approved for 98 beta 5, thanks.

Attachment #9262387 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9262571 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9262387 [details]
Bug 1742241. Don't access the PresShell's visual viewport offset if we haven't set one. r?botond

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: simple patch to fix a case that looks bad
  • User impact if declined: switching back to a tab, or after session restore, half of tab will be blank until the user scrolls
  • Fix Landed on Version: 99
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): simple fix to not use a value that has not been set
Attachment #9262387 - Flags: approval-mozilla-esr91?
Attachment #9262571 - Flags: approval-mozilla-esr91?
Flags: in-testsuite+
QA Whiteboard: [qa-triaged]

I have reproduced the issue on Firefox 97.0 and verified the fix on Firefox Beta 98.0b5 and Firefox Nightly 99.0a1.

Regressions: 1755844

Comment on attachment 9262387 [details]
Bug 1742241. Don't access the PresShell's visual viewport offset if we haven't set one. r?botond

Approved for the ESR91 branch

Attachment #9262387 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+
Attachment #9262571 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+

Verified the fix on Firefox 91.7.0esr (20220218112705)

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
Depends on: 1756762
See Also: → 1757176
Depends on: 1757314
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: