This behavior was already agreed upon in
<https://github.com/whatwg/html/issues/7386>, but bug 1544428 was an
implementation edge case needing to be fixed.
An exception is when the fragment contains a directive, in which case a
difference in `hasRef` is sufficient, to retain existing behavior WRT
directives.
Although bug 1544428 is about popstate, hashchange was erroneously being
dispatched, as well, which this patch fixes.
Some tests that depended on the old behavior are updated.
Differential Revision: https://phabricator.services.mozilla.com/D225567
To implement BFCache in Gecko, we complete loads in new
BrowsingContextGroups when it would be invisible to the site. This
allows us to suspend the previous document and its entire
BrowsingContextGroup and restore it when navigating back through
history.
Unfortunately the current logic does not catch one web-visible case,
which is when a document is put into the BFCache, and then the next page
opens a named pop-up window. After navigating back to the previous page,
we switch back to the previous BrowsingContextGroup, and opening the
same named window will create a distinct pop-up.
This patch proposes avoiding this by not restoring a session history
entry from the BFCache when the navigating BrowsingContext has auxiliary
BrowsingContexts. This is done lazily, so if the pop-up is closed before
the back navigation (e.g. due to it being used for an oauth flow), it
will not invalidate the BFCache entry.
Differential Revision: https://phabricator.services.mozilla.com/D226184
Currently DevTools doesn't do it, but it feels like the right API and is
already there. This allows fixing this on the devtools side however you
want :)
Differential Revision: https://phabricator.services.mozilla.com/D223627
This is all super-hacky (see a lot of the XXXcjones comments).
Simplify it... We never create widgets with a bare native parent but no
nsIWidget parent. Pass nsIWidgets and deal with things correctly.
There were also things that were dealing with stuff that can't happen,
like top level popups, children of PuppetWidgets, or such.
Instead of overriding Create(), let's just teach nsBaseWidget about
non-native (headless/puppet) widgets.
Remove lots of old APIs for the native window stuff that are unused
and/or unimplemented.
Differential Revision: https://phabricator.services.mozilla.com/D224613
Much like we do with downloads (bug 1656925), these don't unload the
current document.
This prevents them from having mismatched flags, which asserts, see the
test-case.
Differential Revision: https://phabricator.services.mozilla.com/D224606
Don't limit recursive checks to only happen for original src
loads. They're very likely to be loads of 'about:blank' and later
followed by the actual load. Make sure to check the following loads as
well.
Differential Revision: https://phabricator.services.mozilla.com/D222485
Previously, this was passed around using the nsHashPropertyBag base
class on HTTP channels. In bug 1907269, this base was added to
nsExtProtocolChannel to support reading this property for external
protocols.
This unfortunately ended up not working when a HTTP channel redirects to
an external protocol, as the hash property propagation logic in
nsHttpChannel happens after the check that the target channel is a HTTP
channel, so the property was lost when redirecting to an external
protocol.
Rather than refactoring HTTP redirect logic, this patch simplifies by
moving the property onto the LoadInfo where it will be trivially
preserved across redirects, and available in the places which need it.
Because the nsHashPropertyBag base is no longer required for
nsExtProtocolChannel, it is also removed.
Differential Revision: https://phabricator.services.mozilla.com/D220744
It would seem sometimes in Firefox 77 we regressed the ability to set the TRR
mode for a browsing context when opening a new tab.
I confirmed that this bug didn't happen in Fx 77 when setting the
`browser.tabs.documentchannel.parent-initiated` pref to `false`.
The nsIWebNavigation::LOAD_FLAGS_DISABLE_TRR is correctly passed into
CanonicalBrowsingContext, but it doesn't end up getting used.
This sets the appropriate DefaultLoadFlags for BrowsingContext
when the LOAD_FLAGS_DISABLE_TRR or LOAD_TRR_ONLY_MODE flags are present
in nsDocShellLoadState::LoadFlags()
Differential Revision: https://phabricator.services.mozilla.com/D220550