Closed Bug 1654427 Opened 4 years ago Closed 4 years ago

Fix failing Layout scroll position history mochitests

Categories

(Core :: DOM: Navigation, task, P2)

task

Tracking

()

RESOLVED FIXED
Fission Milestone M7

People

(Reporter: neha, Unassigned)

References

(Depends on 1 open bug)

Details

These tests are marked as skipped/failed for cross-origin and Fission, and need to be fixed
layout/base/tests/test_bug603550.html
layout/base/tests/test_bug842853-2.html
layout/base/tests/test_bug842853.html
layout/base/tests/test_bug849219.html
layout/base/tests/test_bug851445.html
layout/base/tests/test_bug851485.html
layout/generic/test/test_scroll_position_iframe.html
layout/base/tests/test_frame_reconstruction_scroll_restore.html

https://docs.google.com/spreadsheets/d/16G5AZhHWWow3rBgim4QBHzWXMIIJiky2SzXYgDMTTKY/edit#gid=1354562828&range=59:69

More info: https://wiki.mozilla.org/Project_Fission/Enabling_Tests_with_Fission#Cross-Origin_Mochitests

Fission Milestone: --- → M6b

Mats: Can you start taking a look at some of these?

Severity: -- → N/A
Type: defect → task
Flags: needinfo?(mats)
Priority: -- → P2

I debugged layout/base/tests/test_bug842853-2.html a bit and it seems the root cause is that scroll position restoration isn't working for the embedded <iframe> when running with --enable-xorigin-tests --enable-fission.
Here's what I get with MOZ_LOG=scrollrestore:5 normally:

0:17.96 TEST_START: layout/base/tests/test_bug842853-2.html
0:18.97 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e125fc260: Clearing mRestorePos (cur=0, dst=0)
0:21.31 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e10577260: Clearing mRestorePos (cur=0, dst=301640)
0:21.31 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e10577260: Clearing mRestorePos (cur=294280, dst=30000)
0:21.86 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e10577260: SaveState, pt.y=30000, mLastPos.y=-1, mRestorePos.y=-1
0:22.56 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e1257c260: RestoreState, set mRestorePos.y=30000 mLastPos.y=0
0:22.57 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e1257c260: SaveState, pt.y=0, mLastPos.y=0, mRestorePos.y=30000
0:22.57 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e1257c260: ScrollToRestoredPosition (mRestorePos.y=30000, mLastPos.y=0, layoutRestorePos.y=30000, visualRestorePos.y=30000, logicalLayoutScrollPos.y=0, GetLogicalVisualViewportOffset().y=0)
0:22.57 GECKO(5157) [Child 5250: Main Thread]: D/scrollrestore 0x7f2e1257c260: ScrollToRestoredPosition (mRestorePos.y=30000, mLastPos.y=30000, layoutRestorePos.y=30000, visualRestorePos.y=30000, logicalLayoutScrollPos.y=30000, GetLogicalVisualViewportOffset().y=30000)
0:22.58 PASS undefined assertion name

and here's what I get with --enable-xorigin-tests --enable-fission:

0:21.00 TEST_START: http://mochi.test:8888/tests/layout/base/tests/test_bug842853-2.html
0:22.02 GECKO(5508) [Child 5699: Main Thread]: D/scrollrestore 0x7f00b8ee8260: Clearing mRestorePos (cur=0, dst=0)
0:23.88 GECKO(5508) ### XPCOM_MEM_BLOAT_LOG defined -- logging bloat/leaks to /tmp/tmpTJYkgG.mozrunner/runtests_leaks_tab_pid5823.log
0:28.65 GECKO(5508) [Child 5748: Main Thread]: D/scrollrestore 0x7faf6a54c260: Clearing mRestorePos (cur=0, dst=301640)
0:28.65 GECKO(5508) [Child 5748: Main Thread]: D/scrollrestore 0x7faf6a54c260: Clearing mRestorePos (cur=294280, dst=30000)
0:30.51 GECKO(5508) [Child 5748: Main Thread]: D/scrollrestore 0x7faf6a56e260: Clearing mRestorePos (cur=0, dst=301640)
0:30.51 GECKO(5508) [Child 5748: Main Thread]: D/scrollrestore 0x7faf6a56e260: Clearing mRestorePos (cur=294280, dst=301640)
0:30.51 PASS undefined assertion name - got 4904.66650390625, expected 500

(it says PASS b/c I didn't update mochitest.ini -- it's really a FAIL as you can see from the numbers)

It appears that ScrollFrameHelper::SaveState/RestoreState isn't called at all with fission...
Is that a known bug?

Flags: needinfo?(mats) → needinfo?(bugs)

I am supposing that it's due to the lack of proper handling OOP iframes in session restore (bug 1572084).

Depends on: 1572084
Flags: needinfo?(bugs)

Thanks hiro, I'll move this to DOM/Navigation for now then. Let us know if there's anything Layout-related that needs fixing here.

Component: Layout → DOM: Navigation

Are all of these tests related to scroll position restoration? (A quick glance through a couple of them makes it seem so.) If so, then I think we should update the bug title accordingly.

Flags: needinfo?(mats)

Yes, I think all of them are, except the first one, but that one already PASS.

Flags: needinfo?(mats)
Fission Milestone: M6b → M7
Summary: Fix failing Layout mochitests with cross-origin and Fission enabled → Fix failing Layout scroll position history mochitests
Depends on: 1677543

Do we expect scroll restoration to work with ship now? If we do, this bug may be worth revisiting now.

Flags: needinfo?(peterv)

The remaining Layout tests that are still skipped for Fission are:
layout/base/tests/test_bug603550.html (Bug 1677543) --> Fission-Future
layout/base/tests/test_bug607529.html (Bug 1689677) --> Depends on BFCache for Fission and tracked with fission-bfcache meta bug
layout/base/tests/test_zoom_restore_bfcache.html (Bug 1654427) --> Depends on BFCache for Fission and tracked with fission-bfcache meta bug

Closing this meta as the rest are fixed.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(peterv)
Resolution: --- → FIXED
No longer depends on: 1687495
You need to log in before you can comment on or make changes to this bug.