Lots of these callbacks have a non-`void*` final parameter, which UBSAN
complains about. This commit changes them to have a `void*` parameter.
This requires undoing the machinery added in the first two commits of bug
1473631: `TypePrefChangeFunc` and `PREF_CHANGE_METHOD`. The resulting code is
simpler (which is good) and more boilerplate-y (which is bad) but avoids the
undefined behaviour (which is good).
Differential Revision: https://phabricator.services.mozilla.com/D50901
--HG--
extra : moz-landing-system : lando
the URL moz://a redirects to mozilla's website, Because it redirects to
https we want to use documentchannel.
Depends on D49100
Differential Revision: https://phabricator.services.mozilla.com/D51227
--HG--
extra : moz-landing-system : lando
I rewrote BrowserUtils.addContentEventListener(), and that caused an
intermittent failure in browser_bug343515.js. The use of
addContentEventListener in the test is questionable, and the test as a
whole is old, so I freshened it up.
Instead of nShotsListener (and oneShotListener, which is a special
case of that) which waits for a hard coded number of load events to
fire to ensure that a page and its subframes are all loaded, I use
BrowserTestUtils.browserLoaded().
Instead of waitForPageshow, which runs a script in the content process
that waits for an event, it uses BrowserTestUtils.waitForContentEvent,
which does the same thing in a hopefully more resilient fashion.
The largest change in terms of number of characters changed is that I
rewrote the test so that it is written inside of a single add_task
async function, instead of being split into a chain of async
functions. I also used await to flatten a lot of .then() chained
things.
I fixed up some variable shadowing. There was some trickiness around
shadowed variable names being used as field names, so I introduced an
intermediate 'data' variable to hold the structure.
Finally, I call BrowserTestUtils.removeTab() instead of calling
removeTab() directly on the browser. I figured that was probably
better, though maybe it does not matter.
I added a check after each step that the URI is correct, where
missing, which would have caught a bug in an earlier version of this
patch.
Differential Revision: https://phabricator.services.mozilla.com/D51183
--HG--
extra : moz-landing-system : lando
Any number of outer windows may be attached to a BrowsingContext over its
lifetime. While the BrowsingContext is alive, it's easy to keep track of which
of these is active, and therefore which of its inner windows is active. After
it has been discarded, though, it discards its docShell reference, so all we
can tell about an inner window is whether it is active for its own outer
window, but not whether it should be considered active for its
BrowsingContext.
This patch updates the BrowsingContext detach logic to store a flag on the
current inner window recording that it was active when its BrowsingContext was
detached, and then later checks that flag to determine if it is the current
window for a detached BrowsingContext.
Differential Revision: https://phabricator.services.mozilla.com/D49032
--HG--
extra : moz-landing-system : lando
The changes try to ensure we haven't really started load process of the new page, just that
there is ongoing active request. history.back() will then only affect to the fragment navigation.
Differential Revision: https://phabricator.services.mozilla.com/D50220
--HG--
rename : docshell/test/navigation/file_fragment_handling_during_load_frame2.html => docshell/test/navigation/file_fragment_handling_during_load_frame2.sjs
extra : moz-landing-system : lando
Also some minor cleanup in nsWindowWatcher, as well as a small fix,
where GetWindowByName forgot to addref its return value (as changed in
Part 1).
Differential Revision: https://phabricator.services.mozilla.com/D48976
--HG--
extra : moz-landing-system : lando
This was copied verbatim from places, but the only thing the code can do is
schedule runnables, which outlive the function, so there's no script that can
run.
Depends on D50502.
Differential Revision: https://phabricator.services.mozilla.com/D50503
--HG--
extra : moz-landing-system : lando
GeckoView does this link clearing stuff (which is somewhat dubious), but always
used to return NS_OK.
The error handling case in Link.cpp was pretty broken anyway (it'd leave the
link marked as registered), so make that infallible, given we fatally assert in
the non-android case.
NotifyVisited is also infallible so make that infallible too.
There's no need to use NS_IMETHOD gunk when not using scriptable XPCOM, and
these functions are not called from script, so make them regular pure-virtual
functions.
Depends on D50478.
Differential Revision: https://phabricator.services.mozilla.com/D50480
--HG--
extra : moz-landing-system : lando
Interestingly the android implementation had a potentially serious bug (was
missing a script blocker).
Differential Revision: https://phabricator.services.mozilla.com/D50263
--HG--
extra : moz-landing-system : lando
In this patch, we add the propagation of the first party domain through
the tabContext while creating OOP browsers. In the window.open() case,
we will propagate the first party domain from the opener's browser parent.
And in the frame case, we will propagate it from the manager of the
browserBridgeParent of the OOP frame.
Differential Revision: https://phabricator.services.mozilla.com/D49886
--HG--
extra : moz-landing-system : lando
Depends on D49870
We fail coop-sandbox.https.html without this, since the changes in bug 1566868 don't apply to DocumentChannel.
Differential Revision: https://phabricator.services.mozilla.com/D49871
--HG--
extra : moz-landing-system : lando
We want this to run in both processes so that we set the cspToInherit on the LoadInfo within the child as well as the parent.
Differential Revision: https://phabricator.services.mozilla.com/D47355
--HG--
extra : moz-landing-system : lando
Depends on D49870
We fail coop-sandbox.https.html without this, since the changes in bug 1566868 don't apply to DocumentChannel.
Differential Revision: https://phabricator.services.mozilla.com/D49871
--HG--
extra : moz-landing-system : lando