Other browsers and iframes already keep non-initial about:blank documents in
session history. This change extends that to top-level about:blank loads.
In addition, nsDocShell::ShouldAddToSessionHistory is removed.
When browser.newtabpage.enabled=false, newly opened tabs continue to have their
initial about:newtab session history entry marked as transient. The logic is
moved from nsDocShell to AboutNewTabParent.
Differential Revision: https://phabricator.services.mozilla.com/D284624
Move setting up the success and failure callbacks for when committing a
navigate event to after the committed promise is certain to have been
resolved. This works because all same document navigations will sooner
or later end up calling #update-the-navigation-api-entries-for-a-same-document-navigation.
Differential Revision: https://phabricator.services.mozilla.com/D285524
Move setting up the success and failure callbacks for when committing a
navigate event to after the committed promise is certain to have been
resolved. This works because all same document navigations will sooner
or later end up calling #update-the-navigation-api-entries-for-a-same-document-navigation.
Differential Revision: https://phabricator.services.mozilla.com/D285524
This commit removes the unsuccessful deferring of notifications around
BrowserChild::Init and and narrows when we ignore a failure in
nsDocShell::Initialize.
Differential Revision: https://phabricator.services.mozilla.com/D279293
This patch updates the scroll position data of the "local" (i.e. not
SHIP/in parent process) navigation API entries at the right time and
removes restoring scroll position from mActiveEntry of nsDocShell and
instead uses the target history entry, i.e. the one we're navigating
towards and use that scroll that. This is technically spec compliant
since the active entry is supposed to be the target entry at that
moment.
SHIP still works as intended and is left unchanged by this patch.
Differential Revision: https://phabricator.services.mozilla.com/D272446
Having this tracker as part of the navigation state led to
broken state when reentering a navigation by triggering
a new navigation from a `navigateerror` handler.
This patch removes the upcoming non-traverse API method tracker
from `Navigation` and passes it as argument, hereby following the spec.
Differential Revision: https://phabricator.services.mozilla.com/D269448
This implements the basics of RestoreScrollPositionData.
It introduces the new method nsDocShell::RestoreScrollPosFromActiveSHE
which will set the scroll position to the position stored by the active
session history entry.
One could say this deviates slightly from the stated spec because the
spec suggests "HasBeenScrolledByUser" should be true/false if the "user"
has scrolled the document. This however, is a little ambiguous and
doesn't seem to correlate with behaviour from other browsers. Instead we
simply check if the scroll generation has changed since the navigation
event was fired.
It does not pass all scroll-behavior tests, as some rely on an unspecced
behaviour whereby the scroll restoration is deferred until the active
navigation interception promise has settled. We can resolve this in
another bug because this behaviour is not detailed in the spec.
Differential Revision: https://phabricator.services.mozilla.com/D266431
Implement #inform-the-navigation-api-about-child-navigable-destruction.
Add the final calls to #set-the-ongoing-navigation and tweak some of the
existing ones to only happen during history traversals or only during
navigation.
Differential Revision: https://phabricator.services.mozilla.com/D262564
Implement #inform-the-navigation-api-about-child-navigable-destruction.
Add the final calls to #set-the-ongoing-navigation and tweak some of the
existing ones to only happen during history traversals or only during
navigation.
Differential Revision: https://phabricator.services.mozilla.com/D262564
AppWindow::GetMainWidget() is just mWindow. Add a helper to simplify
GetMainWidget() usage and use it across the tree, simplifying users.
Differential Revision: https://phabricator.services.mozilla.com/D258744
`nsDocShell::Stop()` is called in `nsDocShell::InternalLoad()`, and would abort
ongoing navigations. Adding this flag to that specific call site
prevents this and keeps the intended behavior.
Differential Revision: https://phabricator.services.mozilla.com/D255144
We are making changes to many files. Very huge chunk of the changes are just renaming CSP -> PolicyContainer. Part 1 and part 2 are solely separated as frontend and backend. The unfortunate thing is, I mistakenly placed IDL changes in part 1, and many of those IDL changes affect frontend code too. I'm sorry for this inconvinience and hard to review patch(es).
(FWIW before this rewrite we had another patch stack. It is 25 patches and I believe isn't as comprehensive as this one. It also didn't replace CSP's inheritance but was copied alongside with CSP, but we decided to change our method and make policy conttainer contain CSP and copy it around after some discussion and reviews)
Differential Revision: https://phabricator.services.mozilla.com/D249248