This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.
Differential Revision: https://phabricator.services.mozilla.com/D117663
When we duplicate a tab, we don't need to have about:blank load in it, because
we are going to use restore mechanism to copy data into the new tab. If we
don't skip the superfluous load, the restoring process might race with the
loading of about:blank, and sometimes we might try to destroy the
WindowGlobalChild actor just as SessionStore is trying to restore docshell
capabilities for that tab resulting in a rejected promise in _restoreHistory
and `_restoreHistoryComplete` not getting called.
Differential Revision: https://phabricator.services.mozilla.com/D119313
I was unable to reproduce this locally, but looking to the logs from the failures tracked by this bug
I did notice this logged error which suspiciously point in the direction of a race between registering
a browser.runtime.onMessage listener and sending a message to that listner from the content script "script.js":
```
Console message: [JavaScript Error: "Error: Could not establish connection. Receiving end does not exist."
{file: "moz-extension://f0d0d3ec-6815-4d78-aa83-3516814353a2/script.js" line: 2}]
```
This patch just change the order of those two promise, making sure that the browser.runtime.onMessage will be registered by the time the content script is going to be executed.
Differential Revision: https://phabricator.services.mozilla.com/D119175
I was unable to reproduce this locally, but looking to the logs from the failures tracked by this bug
I did notice this logged error which suspiciously point in the direction of a race between registering
a browser.runtime.onMessage listener and sending a message to that listner from the content script "script.js":
```
Console message: [JavaScript Error: "Error: Could not establish connection. Receiving end does not exist."
{file: "moz-extension://f0d0d3ec-6815-4d78-aa83-3516814353a2/script.js" line: 2}]
```
This patch just change the order of those two promise, making sure that the browser.runtime.onMessage will be registered by the time the content script is going to be executed.
Differential Revision: https://phabricator.services.mozilla.com/D119175
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.
Differential Revision: https://phabricator.services.mozilla.com/D117663
Also switch to removing the quotes and command-line parameters from the command
string obtained from the registry before comparing it to our path, instead of
*adding* those things to our path, to make the comparison more reliable.
Differential Revision: https://phabricator.services.mozilla.com/D114383
This patch moves code that sets the background of the browser toolbars into
one place. It also removes some non-Proton Windows-only code rather than
updating it for this.
Differential Revision: https://phabricator.services.mozilla.com/D118658
We need to first add the scrolling metrics (scrolling_time and scrolling_distance) to the DB so we can complete the capturing and tests for those metrics (see Bug 1717920)
Differential Revision: https://phabricator.services.mozilla.com/D119119
The URLQueryStrippingListService will get initialized too late in
Fission because the 'profile-after-change' won't be triggered for
content processes in Fission. So, it won't have a complete list when the
query stripping happens because it will be initalized by then.
To address this issue, we add a content process script which will run
during the creation of content processes and it will get the service to
initialize it early so that we will have a complete list when doing the
stripping.
Differential Revision: https://phabricator.services.mozilla.com/D117376
This is the main part to address bug 1701368.
Before this patch, `nsAvailableMemoryWatcher` directly broadcasted a memory-pressure
event when we enter into a low-memory situation and `TabUnloader` unloaded a tab in
response to the memory-pressure message. We want to decouple `TabUnloader` from
memory-pressure listeners because unloading a tab may solve a low-memory situation
alone.
With this patch, if `nsAvailableMemoryWatcher` detects a low-memory situation,
it invokes `TabUnloader` synchronously via an XPCOM interface. If `TabUnloader`
unloads a tab, we don't do any further action. If there is no discardable tab,
`TabUnloader` notifies back `nsAvailableMemoryWatcher` via another XPCOM interface,
so that `nsAvailableMemoryWatcher` can notify of a memory-pressure event.
Differential Revision: https://phabricator.services.mozilla.com/D117673
This patch introduces an XPCOM object which is represented by the single instance of
`nsAvailableMemoryWatcherBase` so that `nsAvailableMemoryWatcher` can synchronously
access `TabUnloader`.
We currently implement a watcher class for Windows only. For other platforms, what
we need to do is to define a class inherinting `nsAvailableMemoryWatcherBase` and
a simple factory method `CreateAvailableMemoryWatcher()` returning an instance of
that class.
Differential Revision: https://phabricator.services.mozilla.com/D118393
This is the main part to address bug 1701368.
Before this patch, `nsAvailableMemoryWatcher` directly broadcasted a memory-pressure
event when we enter into a low-memory situation and `TabUnloader` unloaded a tab in
response to the memory-pressure message. We want to decouple `TabUnloader` from
memory-pressure listeners because unloading a tab may solve a low-memory situation
alone.
With this patch, if `nsAvailableMemoryWatcher` detects a low-memory situation,
it invokes `TabUnloader` synchronously via an XPCOM interface. If `TabUnloader`
unloads a tab, we don't do any further action. If there is no discardable tab,
`TabUnloader` notifies back `nsAvailableMemoryWatcher` via another XPCOM interface,
so that `nsAvailableMemoryWatcher` can notify of a memory-pressure event.
Differential Revision: https://phabricator.services.mozilla.com/D117673
This patch introduces an XPCOM object which is represented by the single instance of
`nsAvailableMemoryWatcherBase` so that `nsAvailableMemoryWatcher` can synchronously
access `TabUnloader`.
We currently implement a watcher class for Windows only. For other platforms, what
we need to do is to define a class inherinting `nsAvailableMemoryWatcherBase` and
a simple factory method `CreateAvailableMemoryWatcher()` returning an instance of
that class.
Differential Revision: https://phabricator.services.mozilla.com/D118393
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
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
This is the only usage of viewport units in the whole browser window and
we could live without it trivially. It avoids otherwise-unnecessary
style invalidation.
In the cloned bug I've improved the style system so that we do a lot
less work, but we still need to do a full DOM walk.
Instead let's use percentages, which only need re-layout, not restyle
(viewport units compute to a pixel value, percentages compute to
themselves).
Differential Revision: https://phabricator.services.mozilla.com/D118879
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
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.
Differential Revision: https://phabricator.services.mozilla.com/D117663
This also removes code that handled the case where a Send Tab or Send Link to Device
menu needed to be populated when in the STATUS_NOT_CONFIGURED state. Since those menus
should be unavailable when in the STATUS_NOT_CONFIGURED state, we throw instead.
Depends on D118622
Differential Revision: https://phabricator.services.mozilla.com/D118623
This patch will reduce the number of TTS results we show, because we will no longer allow some partially matched hosts. Previously, we let some TTS results through the muxer even when a domain was not autofilled because we thought the user might be typing a subdomain of the TTS domain. However, this created false positives, as demonstrated in the bug. This patch strikes a compromise by retaining the satisfiesAutofillThreshold property, but requires the heuristic result to be a URL result. That way, we can ensure the TTS engine domain has the same hostname as the heuristic URL. This patch still handles the Wikipedia and eBay cases that satisfiesAutofillThreshold was designed to address.
Differential Revision: https://phabricator.services.mozilla.com/D116644
We kept this class around so that we could toggle back and forth between the
Photon-era footer button style, and the Proton-era menuitem style for footer
buttons.
Now that v89 has shipped, we can remove that class and switch the markup and
styling over completely to the Proton styling.
Differential Revision: https://phabricator.services.mozilla.com/D117553
CLOSED TREE
Ensure we only remove the DoH config update observer once in the connection dialog code.
await resetPrefs when cleaning up in the dialog test - it's an async function.
Don't forget to reset the regional pref in browser_remoteSettings_newProfile.js
Use the new default provider pref in test_trr_confirmation.js
* Removes the fallback to the old sent-tab
* Deletes the api to send URIs using commands
* Modifies tests that depended on that api to now use
other commands, namely the wipeEngine command
Differential Revision: https://phabricator.services.mozilla.com/D118086
This patch will reduce the number of TTS results we show. Previously, we let some TTS results through the muxer even when the heuristic URL was not similar to the tab-to-search engine. We did this because ProviderTabToSearch thought the user might be typing part of a TTS domain, but we didn't check that the actual heuristic result was for that domain. This patch allows tab-to-search results only when (1) the heuristic result is not a URL result or (2) the heuristic URL resembles the tab-to-search engine domain. This patch still handles the Wikipedia and eBay cases that satisfiesAutofillThreshold was designed to address.
Differential Revision: https://phabricator.services.mozilla.com/D116644
This patch creates a blocklist of sites that should not be saved as keyframes. The blocklist maps hostnames to regular expressions. While the map is a bit of an awkward structure, it lets us avoid checking every URL against a list of regular expressions. This performance gain will be more apparent as the list expands.
Differential Revision: https://phabricator.services.mozilla.com/D117543
Currently, we set DPI awareness in the manifest files for firefox.exe.
Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.
This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.
Differential Revision: https://phabricator.services.mozilla.com/D116433
The problem in this bug is that the sum of the available spans of child buckets
is not necessarily equal to the available span of the parent bucket. That's
because each child span must be an integer, but a child's ideal span may not be
an integer, so we have to round and an error can accumulate.
This fixes it by detecting that case and then tweaking child spans until their
sum is equal to the parent's available span. If the sum is smaller than the
parent span, then we increment child spans until it's equal; if the sum is
larger than the parent span, then we decrement instead. (The case where the sum
is larger isn't as much of a problem as when it's smaller. We still correctly
limit the total result span due to logic elsewhere, but the bucket's final
result composition may not reflect flex ratios as accurately as it could.)
I added some logic so that the child spans we choose to tweak are the ones that
minimize the mathematical error between the final integer spans and the ideal
unrounded spans. In other words, we pick the best spans possible given that they
must be integers.
We need to do this tweaking when we try to overfill buckets too, not only on the
first pass for a bucket. Currently the second pass is hardcoded in
`_fillBuckets`. Rather than hardcoding the tweaking in both places, I added an
`_updateFlexData` helper method. While I was doing that, I realized we may need
more than two passes per parent bucket in order to optimally fill the children.
So I modified `_fillBuckets` so it recurses with the parent bucket itself when
we need to overfill any of its children.
I also added support for both `availableSpan` and `maxResultCount`. That lets us
get rid of the ugly heuristic special case in `_addResults`. A bucket will be
filled while both its used span and result count are under both these limits.
This also removes support for zero flex. I got really annoyed with it while I
was working on earlier versions of this. It made the code unnecessarily complex.
I added zero flex kind of as a hack to support tail suggestions, but we don't
actually need it at all. We can just move the tail suggestions bucket out of the
main suggestions bucket with form history and remote suggestions.
Finally while I was here I switched from "bucket" to "group" in light of the
renaming in bug 1715484 and bug 1715822.
Differential Revision: https://phabricator.services.mozilla.com/D117582
Currently, we set DPI awareness in the manifest files for firefox.exe.
Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.
This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.
Differential Revision: https://phabricator.services.mozilla.com/D116433
When session history (and bfcache) run in the parent process, things happening there are less asynchronous vs. having session history
in the child process.
The fix is such that if the disabled state doesn't change, then the test will just time out.
Differential Revision: https://phabricator.services.mozilla.com/D117891
We kept this class around so that we could toggle back and forth between the
Photon-era footer button style, and the Proton-era menuitem style for footer
buttons.
Now that v89 has shipped, we can remove that class and switch the markup and
styling over completely to the Proton styling.
Differential Revision: https://phabricator.services.mozilla.com/D117553
- expand the API surface that is stubbed out more completely to account for sites relying on deprecated or more obscure functionality.
- have the shim perform basic content placement as some sites expect GPT to do.
Differential Revision: https://phabricator.services.mozilla.com/D118098
I removed the part of the test that checks for a history result. That was there to test _filterOnHost, which was removed. See Part 2.
Depends on D116763
Differential Revision: https://phabricator.services.mozilla.com/D116764
I didn't port _filterOnHost, which searches for history from an engine's domain when its alias is typed. It is no longer relevant: a heuristic alias search result puts the user in search mode.
Depends on D116762
Differential Revision: https://phabricator.services.mozilla.com/D116763
If we're destroying the frame loader of a replaced browsing context we'll end up
firing browser-shutdown-tabstate-updated for a tab that wasn't actually closed.
This results in us cleaning up Session Store state earlier than expected, which
means we drop future updates to SessionStoreInternal._closedTabs.
Fixes browser_sessionHistory.js, browser_async_remove_tab.js, and possibly
browser_491168.js for SHIP+BFCache.
Differential Revision: https://phabricator.services.mozilla.com/D117944
Update yamscripts to use sass command line interface with input:output args and appropriate --options, and also fix incorrect watchmc as bundle:css was && chained. Fix up sass errors (multiline string variable) and warnings (divide vs css / separator).
Differential Revision: https://phabricator.services.mozilla.com/D117484
Update yamscripts to use sass command line interface with input:output args and appropriate --options, and also fix incorrect watchmc as bundle:css was && chained. Fix up sass errors (multiline string variable) and warnings (divide vs css / separator).
Differential Revision: https://phabricator.services.mozilla.com/D117484
- add wildcards to the URLs, as some sites access the scripts with GET parameters.
- we don't actually need a standalone Tag Manager shim, so just re-use the GA one.
- this will also mitigate breakage on some sites which load only one of the two scripts.
- more thoroughly stub out the Analytics window object to mitigate more site breakage.
Differential Revision: https://phabricator.services.mozilla.com/D117678
Not setting mIsSrcdocEntry causes us to drop srcdoc data and not set
INTERNAL_LOAD_FLAGS_IS_SRCDOC in FillLoadInfo for srcdoc restores.
Differential Revision: https://phabricator.services.mozilla.com/D117479
This is slightly complicated by the fact that the editor code wants to be able
to set this from the content process, so we really need separate
BrowsingContext and WindowContext flags, the latter of which can be set by the
owning process.
Differential Revision: https://phabricator.services.mozilla.com/D114899
Currently, we set DPI awareness in the manifest files for firefox.exe.
Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.
This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.
Differential Revision: https://phabricator.services.mozilla.com/D116433
Also remove some associated `color: inherit` properties that don't appear
necessary; as far as I can tell, equivalent rules already exist everywhere
that these ones would match, so they're not having any effect.
Differential Revision: https://phabricator.services.mozilla.com/D117572
The public key pinning implementation is much less complex than the HSTS
implementation, and only needs a small subset of the parameters of the latter.
Furthermore, the information it relies on is static, and so is safe to access
from content processes. This patch separates the two implementations, thus
simplifying both of them and avoiding some unnecessary IPC calls in the
process.
Differential Revision: https://phabricator.services.mozilla.com/D117096