This follows what we're already doing for EGL: a refcounted object
which can own the X connection, where we hold a weak reference from
the library object so that multiple contexts opportunistically share
the display but we close the connection when the last context is
freed/GCed.
In a process where GTK is initialized, we borrow its display instead of
opening a new one, which preserves the existing behavior.
Differential Revision: https://phabricator.services.mozilla.com/D112195
Currently we return an error when creating a WebGL context in headless
mode, but our WebGL implementation renders to an offscreen context, so
in theory it could work normally in a headless browser, and in practice
it already does work on some OSes. This patch removes that check; the
attempt to use GL may fail, in which case we'll return an error to
content.
The main purpose of this patch is to run content processes with headless
mode set in an otherwise non-headless browser, but it should also be
useful for fully headless mode. Comments in bug NNNNNNN indicate that
this change should be sufficient for headless WebGL on Windows and MacOS,
although it may not have been extensively tested.
Linux is more complicated. The EGL/X11 backend manages its own
connection to the X server (indirectly via the EGL library); a later
patch in this series allows doing that in GLX mode as well. Our Wayland
support can't do this yet, but it should be possible.
This patch also modifies the Linux sandbox policy so that content
processes can connect to a local X server (via the file broker) even when
the parent process is in headless mode.
Differential Revision: https://phabricator.services.mozilla.com/D118721
The background to have this assertion is that nsDeckFrame::HideBox calls
PresShell::ClearMouseCapture and ClearMouseCapture checks whether the
being-hidden panel has a content capturing mouse events or not but the check
doesn't work if the content is in a remote process. In our current
mozilla-central tree, there is no such nsDeckFrame other than our browser's
tab. In the case of our browser's tab when switching tabs, i.e. hiding an
active tab, clearing the mouse capturing state has (should have) worked since
E10S (Note for Fission cases it has worked since bug 1680405). So, because
nsDeckFrame will be obsoleted sooner or later, we disallow the situation
for other cases instead of adding special handling for the other case.
Differential Revision: https://phabricator.services.mozilla.com/D119067
We are going to disallow having any remote <browser>s or <iframe>s inside
nsDeckFrame, so this test is no longer necessary.
Differential Revision: https://phabricator.services.mozilla.com/D119066
We weren't checking properly undefined value, which was hiding issues in
some tests.
The helpers are fixed and a few test modified to make them pass.
Differential Revision: https://phabricator.services.mozilla.com/D119096
In most cases, it's called with selection range which is collapsed in a text
node, but otherwise, the selection may be in an element which cannot have
text nodes. Therefore, before handling the insertion, it should look for
ancestor element which can have text nodes.
Note that this patch makes inserting text immediately before an inclusive
ancestor element whose parent can have a text node. However, both Blink and
WebKit ignores if there are invisible/empty inline nodes. So, even with
this patch, Gecko keeps failing in some tests of the WPT. It should be handled
in a follow up bug because doing it requires complicated code.
Differential Revision: https://phabricator.services.mozilla.com/D119065
By bug 1697680, Gecko removes Presentation API. `Wifi:GetIPAddress` was only used on this API implementation.
So now, this is unused.
Differential Revision: https://phabricator.services.mozilla.com/D118911
This is useful for debugging problems on systems such as android
or windows which can sometimes be tricky to get reliable console
output logging.
Differential Revision: https://phabricator.services.mozilla.com/D118772
Because the build requires a version that is newer than the one
available in Debian jessie, we build a newer version. The exact minor
version doesn't matter, as long as it's 7.x, so we take the last version
that produced a libstdc++6 package (before Debian switched to GCC 8 as
the default), and add a few workarounds to fix the packaging that
doesn't quite work for jessie out of the box.
Differential Revision: https://phabricator.services.mozilla.com/D119124
When running `mach python-test` on a clobbered tree, we create both the
python-test and common virtualenvs, but the former should be enough. The
latter is only created when running tests that use the BaseConfigureTest
class, when it indirectly includes init.configure, which makes the
configure sandbox run the virtualenv_python3 function, which ends up
initializing the common virtualenv. We only don't end up re-executing
that virtualenv python thanks to 6680ca0acc27 which was a workaround
that would allow any virtualenv in $objdir/_virtualenvs, while still
creating a virtualenv it won't use.
Tests now tell virtualenv_python3 to not use the normal virtualenv
manager, and remove the workaround.
Differential Revision: https://phabricator.services.mozilla.com/D118775
* avoid unwatching DOCUMENT_EVENT in case of target-switching
* ensure emitting DevToolsFrameChild:destroy for all currently registered target actors
(didDestroy was clearing the list of actors used by _getTargetActorForWatcherActorID)
* do not try to stop and restart server side watchers in case of bfcache navigation
Differential Revision: https://phabricator.services.mozilla.com/D118795
These are enough for me to run bootstrap+configure+build.
Some touch third-party code (gyp), but per discussion in the earlier
versions of this revision that seems fine.
Differential Revision: https://phabricator.services.mozilla.com/D119080
When we customized the list of possible `applications` for M1 Macs, the
change was only applying to the displayed list, but not the actual
list that the choice was indexed against.
This is fixed by properly using `applications` instead of
`APPLICATIONS` where relevant.
Note that it's still possible to manually request an
`artifact_mode` if you provide it as an argument for `./mach bootstrap`,
but this workflow is usually only done by devs who are familiar with all
the applications, and therefore likely know what they're doing.
Differential Revision: https://phabricator.services.mozilla.com/D118625
Not a big deal, but given we have a lot of them, BrowserParent does it,
and it's low effort, seemed worth doing.
Depends on D118884
Differential Revision: https://phabricator.services.mozilla.com/D118885
GeckoView always calls preserveLayers(true) on all <browser> elements,
which causes the puppet widget to always be considered visible.
Given how the code worked before, aBrowsingContext.isActive = false
after that call would deactivate the pres shell, but after my patch it
stops doing so.
We don't really want to un-throttle the refresh driver etc just because
we're preserving layers, so propagate the state to the child process and
account for that in the logic to determine PresShell activeness.
Depends on D118703
Differential Revision: https://phabricator.services.mozilla.com/D118884
This moves the logic of whether a pres shell should be active to a
single place to make it sane to reason about, and fixes the
subdocument propagation when a BrowserChild becomes visible.
Differential Revision: https://phabricator.services.mozilla.com/D118703
I'm also removing the align=end, because the vbox is adjacent to a flex=1 vbox,
so all horizontal space will be eaten by that other box, meaning alignment of
the button is a no-op as its container is the same width as the button anyway.
Differential Revision: https://phabricator.services.mozilla.com/D119097
Move the counting of private browsing contexts to the parent
process. Also change to only consider non-chrome browsing contexts
when counting private contexts. The latter is possible due to bug
1528115, because we no longer need to support hidden private windows.
With counting in the parent process we can make sure that when we're
changing remoteness on a private browsing context the private browsing
context count never drops to zero. This fixes an issue with Fission,
where we remoteness changes could transiently have a zero private
browsing context count, that would be mistaken for the last private
browsing context going away.
Changing to only count non-chrome browsing contexts makes us only fire
'last-pb-context-exited' once, and since we count them in the parent
there is no missing information about contexts that makes us wait for
a content process about telling us about insertion or removal of
browsing contexts.
Differential Revision: https://phabricator.services.mozilla.com/D118182
Even if the old one isn't, otherwise we can leak.
This doesn't happen at the moment because our printing code creates its
own browser with the initial about:blank loaded (which not Destroy()ing
is fine), and then host the clone in there.
In bug 1666247, for simplify mode the front-end is creating a non-static
document with the simplify mode, then reusing the same docshell for the
static document. That means that we forget the non-static document and
we can leak.
In comment 16 on that bug, the leak comes from a <link rel=stylesheet>
whose SheetLoadData we keep in Document::mPreloadService (which uses
Document::Destroy() to call ClearAllPreloads() and break cycles).
To fix it, check aDocument->IsStaticDocument(), not just
mDocument->IsStaticDocument()... That's the right check since it is the
cloning codepath the one that otherwise doesn't care about what was in
the viewer before.
Differential Revision: https://phabricator.services.mozilla.com/D118809