Commit Graph

2916 Commits

Author SHA1 Message Date
Kashav Madan
2fdef46f8f Bug 1690134 - Fix flakiness in browser_history_persist.js, r=annyG
Waiting for the about:robots load explicitly ensures we don't proceed until all
history changes have fully propagated.

Differential Revision: https://phabricator.services.mozilla.com/D113686
2021-04-28 21:49:15 +00:00
Butkovits Atila
80c415a4fc Backed out 4 changesets (bug 1702055) for causing failures on /browser_UsageTelemetry_private_and_restore.js. CLOSED TREE
Backed out changeset af21e2d8324e (bug 1702055)
Backed out changeset ff67df9befe5 (bug 1702055)
Backed out changeset b5f0638dcbc4 (bug 1702055)
Backed out changeset bffaa2c203b3 (bug 1702055)
2021-04-28 04:42:09 +03:00
Kashav Madan
ed25699760 Bug 1702055 - Only call setInitialTabTitle() if the label hasn't yet been set, r=nika
With the new "restore docshell state" codepath, we may be calling
updateTabLabelAndIcon() later than we did before, which means we may have
already set the tab label (in tabbrowser.init()), and it's incorrect to override
that label value with the session history entry's title.

Differential Revision: https://phabricator.services.mozilla.com/D111456
2021-04-27 19:54:58 +00:00
Kashav Madan
5032f65750 Bug 1702055 - Move the "restore DocShell state" process out of ContentSessionStore.jsm, r=nika
This also makes it so that we will never fire SSTabRestored without first having
sent the associated SSTabRestoring event.

Differential Revision: https://phabricator.services.mozilla.com/D110335
2021-04-27 19:54:57 +00:00
Kashav Madan
f163b81676 Bug 1702055 - Ensure that ContentSessionStore's epoch is updated for tab flushes, r=nika
With the removal of the SessionStore:RestoreDocShellState message, the epoch
will no longer be updated otherwise, so we should include it in the Flush
message to ensure that messages are not being dropped.

Differential Revision: https://phabricator.services.mozilla.com/D110334
2021-04-27 19:54:57 +00:00
Kashav Madan
079d321f9d Bug 1702055 - Replace CallRestoreTabContentComplete with a Promise, r=nika
This should help avoid message ordering issues in the next patches. To ensure
that we're not firing events too early, we now do a "full" restore even if we
don't have form or scroll data, including for about:blank URIs.

This also moves all restore state on the CanonicalBrowsingContext into a
separate `mRestoreState` struct.

Differential Revision: https://phabricator.services.mozilla.com/D110333
2021-04-27 19:54:56 +00:00
Kashav Madan
4abf228317 Bug 1696137 - Fix timeouts in browser_reopen_all_windows.js, r=annyG
We currently wait for the "sessionstore-single-window-restored" notification and
*then* start listening for individual "SSTabRestored" events. This doesn't work
because we may fire those events before we get the chance to create the listener.

Listening for "browser-window-before-show" works consistently, but we need
references to the windows *before* they start restoring, so we have
to manually run the "Restore All Windows" code, instead of clicking the Library
button.

Originally part of the patch stack for bug 1703556.

Differential Revision: https://phabricator.services.mozilla.com/D112887
2021-04-26 18:08:11 +00:00
Joel Maher
5a5bc0c176 Bug 1706716 green up mda, xpcshell, browser-chrome, reftest for apple silicon. r=necko-reviewers,extension-reviewers,preferences-reviewers,application-update-reviewers,zombie,ahal,bytesized
Differential Revision: https://phabricator.services.mozilla.com/D113001
2021-04-22 18:39:40 +00:00
Anny Gakhokidze
b5550e7d69 Bug 1701735 - Skip browser_scrollPositions.js when fission is disabled, r=nika
We have fixed this test previously for fission, and it's only failing without
it.

Differential Revision: https://phabricator.services.mozilla.com/D113044
2021-04-22 17:42:10 +00:00
Kashav Madan
991fe1e4cc Bug 1702797 - Split up the SingleSelect and MultipleSelect cases in RestoreFormEntry, r=nika
A document that changes the "multiple" attribute of the <select> element after
the load event (eg., perhaps in response to user action) will crash the browser
since we will attempt to restore data collected for a multi-select into a
single-select.

Differential Revision: https://phabricator.services.mozilla.com/D112057
2021-04-20 16:01:10 +00:00
Alexandru Michis
922ef41b13 Backed out changeset ead1910420a0 (bug 1702797) for causing bc failures in browser_multiple_select_after_load.js
CLOSED TREE
2021-04-16 19:42:35 +03:00
Kashav Madan
4180e5f2c6 Bug 1702797 - Split up the SingleSelect and MultipleSelect cases in RestoreFormEntry, r=nika
A document that changes the "multiple" attribute of the <select> element after
the load event (eg., perhaps in response to user action) will crash the browser
since we will attempt to restore data collected for a multi-select into a
single-select.

Differential Revision: https://phabricator.services.mozilla.com/D112057
2021-04-16 15:59:27 +00:00
Kashav Madan
e7ef1c3516 Bug 1705547 - Null check the SessionHistory object before attempting to collect, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D112290
2021-04-16 12:02:17 +00:00
Kashav Madan
e520e16620 Bug 1700963 - Stop relying on the "SessionStore:addSHistoryListener" message, r=nika
We now create the listener after receiving a "browsing-context-did-set-embedder"
and destroy it after receiving "browsing-context-discarded".

Differential Revision: https://phabricator.services.mozilla.com/D110337
2021-04-14 23:36:10 +00:00
Kashav Madan
afd185bd3b Bug 1700963 - Clean up SessionStore's SHistoryListener, r=nika
This does a few things:

1. Gets rid of the listener's `_sHistoryChanges` property, which is possible
   because _sHistoryChanges == false <-> _fromIdx == kNoIndex.
2. Simplifies the code that interacts with SHistoryListener in
   UpdateSessionStoreFromTablistener, and attempts to make that function a
   little more readable.
3. Ensures we're only doing the SessionHistory bit of
   UpdateSessionStoreFromTablistener for toplevel frames, and if SHIP is
   enabled.

Differential Revision: https://phabricator.services.mozilla.com/D110336
2021-04-14 23:36:10 +00:00
Dorel Luca
2cbd35f354 Backed out 3 changesets (bug 1700963) for Browser-chrome failures in docshell/test/browser/browser_bug1309900_crossProcessHistoryNavigation.js. CLOSED TREE
Backed out changeset cda35e554327 (bug 1700963)
Backed out changeset fbafd75b06d3 (bug 1700963)
Backed out changeset 8b922e4f612b (bug 1700963)
2021-04-14 23:26:05 +03:00
Kashav Madan
e672ad7710 Bug 1700963 - Stop relying on the "SessionStore:addSHistoryListener" message, r=nika
We now create the listener after receiving a "browsing-context-did-set-embedder"
and destroy it after receiving "browsing-context-discarded".

Differential Revision: https://phabricator.services.mozilla.com/D110337
2021-04-14 18:53:06 +00:00
Kashav Madan
e8bc18afcf Bug 1700963 - Clean up SessionStore's SHistoryListener, r=nika
This cleans up the SHistoryListener class and does a few things:

1. Gets rid of the listener's `_sHistoryChanges` property, which is possible
   because _sHistoryChanges == false <-> _fromIdx == kNoIndex.
2. Simplifies the code that interacts with SHistoryListener in
   UpdateSessionStoreFromTablistener, and attempts to make that function a
   little more readable.
3. Ensures we're only doing the SessionHistory bit of
   UpdateSessionStoreFromTablistener for toplevel frames.

Differential Revision: https://phabricator.services.mozilla.com/D110336
2021-04-14 18:53:05 +00:00
Kashav Madan
67b28ebc8d Bug 1704553 - Fix browser_frametree.js and browser_sessionHistory.js for BFCache+Fission, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D111685
2021-04-12 17:05:29 +00:00
Anny Gakhokidze
780445a687 Bug 1698601 - Part 1: Extend existing session store test files with COOP document testing, r=smaug
Modify related test files to test documents with COOP headers enabled.

There are some tests that fail when run with new COOP configurations without
Fission enabled, prior to fixes that come in part 2. This means that some of
the COOP behaviour was already broken. Since fixing non-Fission COOP
behaviour prior to this patch is out of scope, I skipped calling `addCoopTask`
to test COOP documents in non Fission cases for such tests.

Even with COOP headers disabled, some tests fail when the document they load
is served over httpS and not http. For a single test where this behaviour was
occuring prior to fixes in part 2, I skipped testing an HTTPS non-COOP
document and filed 1703351 to fix such behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D110993
2021-04-09 17:46:52 +00:00
Kashav Madan
0d84c0d1e4 Bug 1602687 - Re-enable some sessionstore tests, r=farre
These were fixed by bug 1572084 and bug 1597499. Two are still skipped and will
be fixed in bug 1700623 and bug 1703556.

Differential Revision: https://phabricator.services.mozilla.com/D110999
2021-04-07 15:30:26 +00:00
Emma Malysz
a5a8f40979 Bug 1692176, add restore previous session to history panel r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D110178
2021-03-31 16:22:52 +00:00
Gijs Kruitbosch
baf37ddb29 Bug 1701202 - fix some browser mochitests to pass with proton enabled, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D109910
2021-03-26 21:37:18 +00:00
Rob Wu
878b74f39d Bug 1698192 - Use correct currentURI during swapping of lazy browsers r=dao
Re-order calls in SessionStore.jsm to invoke the side-effect-free logic
before triggering observable events.

Clear (likely) stale value of the cached currentURI when lazy browsers
are swapped.

And while I was at it, I also fixed a bug that caused a lazy browser to
eagerly be unlazified because the unneeded mute() call on a lazy browser
unlazifies it (discovered when I added complete test coverage for this
change).

Differential Revision: https://phabricator.services.mozilla.com/D108260
2021-03-26 19:51:15 +00:00
Csoregi Natalia
e4acbbb296 Backed out changeset d885acd20f7e (bug 1701202) for causing failures on browser_synced_tabs_menu.js. CLOSED TREE 2021-03-26 21:42:09 +02:00
Gijs Kruitbosch
31c59a7040 Bug 1701202 - fix some browser mochitests to pass with proton enabled, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D109910
2021-03-26 17:13:27 +00:00
Andreas Farre
2d0871a066 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Instead of collecting data from the entire tree of documents, we
collect data per document. The collected data is sent to the
corresponding parent window context and is applied incrementally to
the tab state cache.

Differential Revision: https://phabricator.services.mozilla.com/D107814
2021-03-26 08:59:33 +00:00
Bogdan Tara
6ed704c1ea Backed out 3 changesets (bug 1572084) for WindowGlobalParent.cpp related failures CLOSED TREE
Backed out changeset d42a68132e7e (bug 1572084)
Backed out changeset 4d5a5ac074e6 (bug 1572084)
Backed out changeset 5aa59e106a42 (bug 1572084)
2021-03-25 18:56:02 +02:00
Andreas Farre
e8713aa001 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Instead of collecting data from the entire tree of documents, we
collect data per document. The collected data is sent to the
corresponding parent window context and is applied incrementally to
the tab state cache.

Differential Revision: https://phabricator.services.mozilla.com/D107814
2021-03-25 15:36:38 +00:00
ankur
0b7d4e68ba Bug 1695253 - Replaced DTD/xhtml1-strict.dtd which lead to broken network loads. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D109379
2021-03-24 16:52:06 +00:00
Anny Gakhokidze
af797a1153 Bug 1698104 - Fix session restore for about:reader, r=nika,kashav
Implement an observer to wait for correct window events in order to restore tab
content.  Non-SHIP code restores about:reader scroll position after receiving
"AboutReaderContentReady" event, so to achieve the same thing with session
history in parent enabled, we can wait for "AboutReader:Ready" event.

Differential Revision: https://phabricator.services.mozilla.com/D108712
2021-03-23 18:01:23 +00:00
Kashav Madan
86731a9e7f Bug 1597499 - Enable some sessionstore Fission/SHIP tests, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D108693
2021-03-23 18:01:22 +00:00
Kashav Madan
b912b90222 Bug 1597499 - Make Session Restore work in Fission, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D107883
2021-03-23 18:01:21 +00:00
smolnar
ede838631a Backed out 4 changesets (bug 1597499) for causing Fission crashes (bug 1699349). a=backout
Backed out changeset 0df7b8660446 (bug 1597499)
Backed out changeset d015ba9097c5 (bug 1597499)
Backed out changeset e84054ccadb0 (bug 1597499)
Backed out changeset 12762a25c4fa (bug 1597499)
2021-03-18 11:29:08 +02:00
Florian Quèze
ad3686bdc1 Bug 1689570 - browser/components/sessionstore/test/browser_590563.js should not rely on an implicit timer from waitForCondition, r=Gijs.
Depends on D108017

Differential Revision: https://phabricator.services.mozilla.com/D108018
2021-03-17 17:39:33 +00:00
Kashav Madan
18a73aabff Bug 1597499 - Enable some sessionstore Fission/SHIP tests, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D108693
2021-03-17 16:43:05 +00:00
Kashav Madan
ad57811557 Bug 1597499 - Make Session Restore work in Fission, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D107883
2021-03-17 16:43:05 +00:00
Paul Bone
b1e1ee5aed Bug 1697738 - Some refactoring in SessionStore.jsm r=nika
* Remove lastKnownURI from SHistoryListener
 * Remove some dead code
 * Move some code out of a condition

Differential Revision: https://phabricator.services.mozilla.com/D107974
2021-03-15 02:08:41 +00:00
Paul Bone
bb4e53396b Bug 1691135 - pt 1. SHistoryListeners track browser ID as it is constant r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106841
2021-03-12 01:16:15 +00:00
Kagami Sascha Rosylight
b2e70ed01b Bug 1697253 - Hide VisualViewport interface behind the existing pref r=edgar
Bug 1357785 accidentally omitted the flag on the interface itself. This patch makes thing consistent to prevent potential confusion in feature detection.

Differential Revision: https://phabricator.services.mozilla.com/D107742
2021-03-11 20:51:51 +00:00
Dorel Luca
d87de7d014 Backed out changeset e780bd8fa66a (bug 1697253) for Mochitest failures in dom/base/test/test_domwindowutils.html. CLOSED TREE 2021-03-11 01:24:46 +02:00
Kagami Sascha Rosylight
cd5a6a8a43 Bug 1697253 - Hide VisualViewport interface behind the existing pref r=edgar
Bug 1357785 accidentally omitted the flag on the interface itself. This patch makes thing consistent to prevent potential confusion in feature detection.

Differential Revision: https://phabricator.services.mozilla.com/D107742
2021-03-10 21:20:30 +00:00
Anny Gakhokidze
c52cdbd749 Bug 1692501 - Fix timing issues when reopening all closed windows, r=kashav
In bug 1589102, changes were made to how about:blank and about:srcdoc load,
making them go via DocumentChannel and thus slightly increasing documents' load
times.  This causes some timing issues in SessionStore code.

When we click to "Reopen all (closed) Windows", undoCloseWindow() is called for
each window that we have to restore. The following scenario can occur - we are
restoring window 1, and undoCloseWindow() has already called restoreWindows,
after receiving the window showing promise, and in the meantime
undoCloseWindow() has been called for window 2, and there is now a promise in
the WINDOW_SHOWING_PROMISES. But now restoreWindows() for window1 calls
_openWindows(), where root.windows length is 0, but WINDOW_SHOWING_PROMISES is
not empty (because of window 2's undoCloseWindow), and the resolve callback for
_openWindows() gets called with wrong arg. To solve this, ensure that the
promises returned from _openWindows() correspond to the windows opened
within the body of the function.

Differential Revision: https://phabricator.services.mozilla.com/D106304
2021-03-01 19:44:13 +00:00
Tom Tung
561095f59d Bug 1666584 - Remove the code for updating _lastKnownUserContextId because it's not needed; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D105334
2021-02-23 08:28:57 +00:00
Tom Tung
b4f2f352b8 Bug 1665942 - Collect userContextId from tab in _collectBaseTabData and stop collecting it in the session history collection; r=nika,geckoview-reviewers,agi
### Story

When a COOP+COEP page is opened, we change the remoteness of the tab. After
changing the remoteness, the tab is then restored by its TabState. However,
we haven't collected userContextId through the current mechanism.

To fix that, this patch changes the way to collect userContextId.

### Test Plan

Test: D98296

Depends on D98296

Differential Revision: https://phabricator.services.mozilla.com/D98468
2021-02-23 08:28:57 +00:00
Tom Tung
9a732b018b Bug 1683713 - Ensure the restoring tab is not reused in addMultipleTabs; r=dao
Differential Revision: https://phabricator.services.mozilla.com/D100249
2021-02-23 08:28:56 +00:00
Neil Deakin
2991c9affc Bug 1676943, add telemetry for how often tab or subframe crash ui is presented to the user. In addition, add telemetry to indicate that the user is shown the unsubmitted crashes notification bar, r=mconley
The telemetry is triggered either when the user is shown the tab crashed page, or when the subframe notification is displayed and the crash occurs in an active tab, or when the user switches to a tab that has a subframe crash notification displayed. The telemetry only applies the first time the tab is switched to. The unsubmitted crashes notification bar appears after 10 minutes or so and is shown in the top-most browser window, if one exists, and telemetry applies once when this occurs.

Differential Revision: https://phabricator.services.mozilla.com/D100349
2021-02-19 19:24:17 +00:00
Csoregi Natalia
133796a67b Backed out 2 changesets (bug 1665942, bug 1683713) for failures on browser_cookies_legacy.js. CLOSED TREE
Backed out changeset d2f4a6c7e9ca (bug 1665942)
Backed out changeset b04fe74185a0 (bug 1683713)
2021-02-17 13:28:09 +02:00
Tom Tung
ad4752a452 Bug 1665942 - Collect userContextId from tab in _collectBaseTabData and stop collecting it in the session history collection; r=nika,geckoview-reviewers,agi
### Story

When a COOP+COEP page is opened, we change the remoteness of the tab. After
changing the remoteness, the tab is then restored by its TabState. However,
we haven't collected userContextId through the current mechanism.

To fix that, this patch changes the way to collect userContextId.

### Test Plan

Test: D98296

Depends on D98296

Differential Revision: https://phabricator.services.mozilla.com/D98468
2021-02-17 07:45:13 +00:00
Tom Tung
2bd4876456 Bug 1683713 - Ensure the restoring tab is not reused in addMultipleTabs; r=dao
Differential Revision: https://phabricator.services.mozilla.com/D100249
2021-02-17 07:45:12 +00:00