Commit Graph

2004 Commits

Author SHA1 Message Date
Frédéric Wang
ae0b7271b8 Bug 1872657 - Add fetchpriority support for <link rel=preload as=image>. r=valentin,smaug,manuel
This patch adds fetchpriority support for `<link rel=preload as=image>`
and equivalent HTTP Link header. The fetchpriority value is passed from
where the link is parsed down to `NewImageChannel` where the priority
is initially set. Currently, the default equals PRIORITY_LOW, but is
decreased a bit if LOAD_BACKGROUND flag is set (this is always the case
for link preload images, see `imgLoader::LoadImage`). Later, the
priority can be increased again depending on the category (see
`imgRequest::BoostPriority`).

In order to minimize the changes, the new calculation is to keep the
initial setting to PRIORITY_LOW, adjust it using a new
`network.fetchpriority.adjustments.*` preference depending on the
fetchpriority attributes, and then preserve further adjustments for
LOAD_BACKGROUND and `BoostPriority`.

For the default value `fetchpriority=auto`, there is no adjustment
i.e. we continue to start with PRIORITY_LOW. `fetchpriority=low/high`
are respectively mapped to PRIORITY_LOW/PRIORITY_HIGH which is simple
and consistent with the "Image" cases from Google's web.dev article
https://web.dev/articles/fetch-priority. These values could of course
be revised in the future after more experiments.

This change is covered by the following tests below. The expectations
is modified to match what is described above (i.e. map to PRIORITY_LOW
or PRIORITY_HIGH with adjustment due to LOAD_BACKGROUND):
- `link-initial-preload-image.h2.html`
- `link-dynamic-preload-image.h2.html`
- `kPipeHeaderPreloadImageLinks`

Based on a patch by Mirko Brodesser (mbrodesser@igalia.com)

Differential Revision: https://phabricator.services.mozilla.com/D197493
2024-02-27 06:33:48 +00:00
Stanca Serban
08a6b4e21b Backed out changeset 621c8480cd35 (bug 1872657) for causing FetchPriority related bp-nu bustages in IconLoader.cpp. CLOSED TREE 2024-02-26 18:15:18 +02:00
Frédéric Wang
b4d37da144 Bug 1872657 - Add fetchpriority support for <link rel=preload as=image>. r=valentin,smaug,manuel
This patch adds fetchpriority support for `<link rel=preload as=image>`
and equivalent HTTP Link header. The fetchpriority value is passed from
where the link is parsed down to `NewImageChannel` where the priority
is initially set. Currently, the default equals PRIORITY_LOW, but is
decreased a bit if LOAD_BACKGROUND flag is set (this is always the case
for link preload images, see `imgLoader::LoadImage`). Later, the
priority can be increased again depending on the category (see
`imgRequest::BoostPriority`).

In order to minimize the changes, the new calculation is to keep the
initial setting to PRIORITY_LOW, adjust it using a new
`network.fetchpriority.adjustments.*` preference depending on the
fetchpriority attributes, and then preserve further adjustments for
LOAD_BACKGROUND and `BoostPriority`.

For the default value `fetchpriority=auto`, there is no adjustment
i.e. we continue to start with PRIORITY_LOW. `fetchpriority=low/high`
are respectively mapped to PRIORITY_LOW/PRIORITY_HIGH which is simple
and consistent with the "Image" cases from Google's web.dev article
https://web.dev/articles/fetch-priority. These values could of course
be revised in the future after more experiments.

This change is covered by the following tests below. The expectations
is modified to match what is described above (i.e. map to PRIORITY_LOW
or PRIORITY_HIGH with adjustment due to LOAD_BACKGROUND):
- `link-initial-preload-image.h2.html`
- `link-dynamic-preload-image.h2.html`
- `kPipeHeaderPreloadImageLinks`

Based on a patch by Mirko Brodesser (mbrodesser@igalia.com)

Differential Revision: https://phabricator.services.mozilla.com/D197493
2024-02-26 15:03:58 +00:00
Emilio Cobos Álvarez
fd8c2b41de Bug 1881074. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D202329
2024-02-22 16:53:57 +00:00
Timothy Nikkel
cd247c160a Bug 1836801. If the order of top layer items changes make sure to mark the frame modified. r=gfx-reviewers,aosmond
The order of items in the mTopLayer array determines the order that we build display items, so if it changes we need to mark the frames as modified so that retained display list partial updates can properly merge.

Differential Revision: https://phabricator.services.mozilla.com/D201214
2024-02-22 10:09:18 +00:00
Ziran Sun
3a8f8fc630 Bug 1879173 - Hide all popovers when beforetoggle shows a popover. r=emilio
https://github.com/whatwg/html/pull/10015

Differential Revision: https://phabricator.services.mozilla.com/D201772
2024-02-16 15:31:30 +00:00
Olli Pettay
a51be41851 Bug 1879562 - Consider to optimize the default character set accesses in Document::RecomputeLanguageFromCharset(), r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D201221
2024-02-12 11:58:54 +00:00
Gregory Pappas
d3e6179e5a Bug 1873137 - Remove dom.animations-api.getAnimations.enabled pref r=webidl,emilio,firefox-animation-reviewers,devtools-reviewers,nchevobbe,boris
Differential Revision: https://phabricator.services.mozilla.com/D201162
2024-02-09 22:00:23 +00:00
Chris H-C
0d6eaa8089 Bug 1877843 - Migrate javascript.pageload GVST metrics r=perry.mcmanis,denispal
Differential Revision: https://phabricator.services.mozilla.com/D200974
2024-02-09 21:11:06 +00:00
Chris H-C
1c0270168b Bug 1877842 - Migrate performance GVST probes r=perry.mcmanis,denispal
Most are brought over straightforwardly, their Telemetry callsites reworded
to use Glean, with mirroring to the Telemetry probes taken care of by the Glean
Interface For Firefox Telemetry (see the telemetry_mirror property).

There were two special cases: PERF_DOM_CONTENT_LOADED_FROM_RESPONSESTART_MS,
and PERF_DOM_CONTENT_LOADED_MS. Both were removed as they were unused.

Differential Revision: https://phabricator.services.mozilla.com/D200867
2024-02-09 21:11:05 +00:00
Cristian Tuns
2510756258 Backed out changeset ccc6ced28d4d (bug 1873137) for causing reftest failures in crashtests.list CLOSED TREE 2024-02-09 13:43:10 -05:00
Gregory Pappas
eb2fefb256 Bug 1873137 - Remove dom.animations-api.getAnimations.enabled pref r=webidl,emilio,firefox-animation-reviewers,devtools-reviewers,nchevobbe,boris
Differential Revision: https://phabricator.services.mozilla.com/D201162
2024-02-09 17:57:16 +00:00
Paul Zuehlcke
3ca315fcd6 Bug 1865749 - Update CookieServiceChild cookie list on storage access grant. r=cookie-reviewers,bvandersloot,valentin
Differential Revision: https://phabricator.services.mozilla.com/D199266
2024-02-09 17:28:06 +00:00
Stanca Serban
7c361328fa Backed out 2 changesets (bug 1865749) for causing mochitests failures.
Backed out changeset 967745446a3f (bug 1865749)
Backed out changeset 77f629fe7298 (bug 1865749)
2024-02-08 21:15:38 +02:00
Paul Zuehlcke
caf4932531 Bug 1865749 - Update CookieServiceChild cookie list on storage access grant. r=cookie-reviewers,bvandersloot,valentin
Differential Revision: https://phabricator.services.mozilla.com/D199266
2024-02-08 15:26:21 +00:00
Emilio Cobos Álvarez
8b123421cc Bug 1877672 - Simplify some uses of FunctionRef that now can use lambdas. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D200158
2024-02-02 19:21:20 +00:00
Hiroyuki Ikezoe
e5970cab67 Bug 1875274 - Remove the workaround for bug 1875274. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D200256
2024-02-01 21:03:25 +00:00
Chris H-C
017bebdfaa Bug 1877273 - Remove Telemetry-based Use Counters r=emilio
Glean-based Use Counter metrics are cheaper and work as well,
so let's use them instead.

Though we do have metric name strings available in a string table in GleanJSMetrics.cpp,
access is through metric_entry_t which has information not available to usecounters.py.
So for now we return char* literals from the use counter increment fns.

Differential Revision: https://phabricator.services.mozilla.com/D199933
2024-02-01 19:45:33 +00:00
Emilio Cobos Álvarez
6e5b4a02e3 Bug 1877531 - Don't flush throttled animations from DetermineProximityToViewportAndNotifyResizeObservers. r=fredw
This code runs unconditionally from "update the rendering". It flushing
throttled animations kinda defeats the point of throttled animations.

This was kind of papered before bug 1807253 because we didn't
unconditionally flush if there were resize observers.

Differential Revision: https://phabricator.services.mozilla.com/D200194
2024-02-01 08:31:53 +00:00
Sandor Molnar
943b4f1994 Backed out changeset 2ee5ce9b3c67 (bug 1877273) for causing build bustage at UseCounterMetrics CLOSED TREE 2024-02-01 00:35:37 +02:00
Chris H-C
8a9cf51a59 Bug 1877273 - Remove Telemetry-based Use Counters r=emilio
Glean-based Use Counter metrics are cheaper and work as well,
so let's use them instead.

Though we do have metric name strings available in a string table in GleanJSMetrics.cpp,
access is through metric_entry_t which has information not available to usecounters.py.
So for now we return char* literals from the use counter increment fns.

Differential Revision: https://phabricator.services.mozilla.com/D199933
2024-01-31 21:37:29 +00:00
Iulian Moraru
585f090514 Backed out changeset f334593f5b54 (bug 1877273) for causing non-unified build bustages on UseCounterMetrics.cpp. 2024-01-31 19:26:17 +02:00
Chris H-C
97e6afec9c Bug 1877273 - Remove Telemetry-based Use Counters r=emilio
Glean-based Use Counter metrics are cheaper and work as well,
so let's use them instead.

Though we do have metric name strings available in a string table in GleanJSMetrics.cpp,
access is through metric_entry_t which has information not available to usecounters.py.
So for now we return char* literals from the use counter increment fns.

Differential Revision: https://phabricator.services.mozilla.com/D199933
2024-01-31 16:04:45 +00:00
Tom Schuster
2b5651c78d Bug 1876276 - Remove dead nsIDocShell allowPlugins code. r=emilio,sessionstore-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D199491
2024-01-31 13:23:52 +00:00
Iulian Moraru
8caca1df07 Backed out changeset 4871c819b21e (bug 1876276) for causing multiple bc failures. CLOSED TREE 2024-01-31 14:25:42 +02:00
Tom Schuster
00fcd6f011 Bug 1876276 - Remove dead nsIDocShell allowPlugins code. r=emilio,sessionstore-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D199491
2024-01-31 09:36:36 +00:00
Emilio Cobos Álvarez
ca8e85e34b Bug 1877242 - Avoid some unnecessary refcounting churn when accessing parent-cross-chrome-boundary. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D199901
2024-01-30 23:24:43 +00:00
Olli Pettay
fcb8ce6b24 Bug 1876539, drop styleset only if presshell has been disconnected, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D199674
2024-01-25 23:56:37 +00:00
Cosmin Sabou
8c442450b2 Backed out changeset 88fbb17e3c20 (bug 1865637) for causing animation related mochitest plain failures. CLOSED TREE 2024-01-24 19:04:25 +02:00
Emilio Cobos Álvarez
72df5210e2 Bug 1865637 - Make sure animation ticks are consistent. r=hiro
This makes ticking the document timeline happens only when we make
forward progress. It seems otherwise we can end up with an extra no-op
tick which might resolve the ready time unexpectedly.

It's also cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D194406
2024-01-24 16:15:54 +00:00
Emilio Cobos Álvarez
f67c9a08e8 Bug 1875822 - nsObjectLoadingContent doesn't need to inherit from nsImageLoadingContent anymore. r=smaug
After bug 1875466, this is no longer needed and simplifies the code
quite a bit.

Differential Revision: https://phabricator.services.mozilla.com/D199252
2024-01-22 23:15:17 +00:00
Christian Holler (:decoder)
6512c73962 Bug 1875498 - Make URI non-nullable in some WindowGlobal methods. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D199108
2024-01-22 18:57:20 +00:00
Tom Schuster
f20ecbedcd Bug 1875466 - Remove nsContentUtils::ShouldHideObjectOrEmbedImageDocument. r=emilio
Depends on D199114

Differential Revision: https://phabricator.services.mozilla.com/D199115
2024-01-22 14:26:10 +00:00
Leander Schwarz
b2d5ab281c Bug 1870067 - Refactor StorageAccessAPIHelper into Parent and Child functions. r=bvandersloot,anti-tracking-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D197673
2024-01-19 19:18:45 +00:00
Emilio Cobos Álvarez
18a29a0e52 Bug 1874766 - Make title change events block onload in chrome docshells. r=smaug
See the comment as for why.

Differential Revision: https://phabricator.services.mozilla.com/D198684
2024-01-18 13:11:53 +00:00
Greg Tatum
290e0906df Bug 1873772 - Only report XULStore load errors in the parent process; r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D198086
2024-01-17 17:18:47 +00:00
Norisz Fay
96399d6060 Backed out changeset 2e5c6f0706b8 (bug 1870067) for causing assertion failure on StorageAccessAPIHelper.cpp 2024-01-18 01:45:22 +02:00
Leander Schwarz
b94e714b93 Bug 1870067 - Refactor StorageAccessAPIHelper into Parent and Child functions. r=bvandersloot,anti-tracking-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D197673
2024-01-17 16:26:22 +00:00
Nicolas Chevobbe
8385ae28f0 Bug 1857523 - Pass PropertyDefinition in csscustompropertyregistered event. r=emilio.
Differential Revision: https://phabricator.services.mozilla.com/D196828
2024-01-16 19:31:05 +00:00
Nicolas Chevobbe
aa46055693 Bug 1857523 - Add ChromeOnly csscustompropertyregistered event. r=emilio.
The event is emitted when a property is registered via `CSS.registerProperty`.
This will be used by DevTools so we can update the Rules view when a property
is registered.

Differential Revision: https://phabricator.services.mozilla.com/D196204
2024-01-16 19:31:04 +00:00
Cosmin Sabou
45679835e9 Backed out 4 changesets (bug 1874766) for causing frequent crashes @nsBaseWidget::UpdateZoomConstraints. CLOSED TREE
Backed out changeset b6caaf7b98e6 (bug 1874766)
Backed out changeset ab8632fd1236 (bug 1874766)
Backed out changeset f2bfe7d3bd10 (bug 1874766)
Backed out changeset 830a664759c7 (bug 1874766)
2024-01-16 21:52:28 +02:00
Emilio Cobos Álvarez
b65538912f Bug 1874776 - Ignore all extension pages from use counters. r=smaug
It seems the discussion in the bug goes in this direction, and I think
it's the right call as described there.

Depends on D198630

Differential Revision: https://phabricator.services.mozilla.com/D198669
2024-01-16 18:41:58 +00:00
Emilio Cobos Álvarez
14118fd8f7 Bug 1874776 - Ignore built-in extension pages from telemetry. r=smaug
Just like we ignore chrome pages. This should be uncontroversial, even
though it might be the case that we don't want any of these to show up.

Not sure how to best test this...

Differential Revision: https://phabricator.services.mozilla.com/D198630
2024-01-16 17:03:00 +00:00
Emilio Cobos Álvarez
5f0bf1df23 Bug 1874766 - Add a missing null-check.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2024-01-16 17:45:48 +01:00
Emilio Cobos Álvarez
b2c4527b4b Bug 1874766 - Fix win32 build.
MANUAL PUSH: Trivial fix CLOSED TREE
2024-01-16 17:24:51 +01:00
Emilio Cobos Álvarez
21ecde1794 Bug 1874766 - Fix build with -WError.
MANUAL PUSH: Trivial fix CLOSED TREE
2024-01-16 17:00:18 +01:00
Emilio Cobos Álvarez
336c3bcf83 Bug 1874766 - Make title change events block onload in chrome docshells. r=smaug
See the comment as for why.

Differential Revision: https://phabricator.services.mozilla.com/D198684
2024-01-16 14:30:12 +00:00
Masayuki Nakano
ec47e76714 Bug 1871987 - Make Document::ExecCommand treat first call by addon as a user input r=smaug
`beforeinput` event shouldn't be fired if it's caused by JS.  However, we
dispatch it when the call is by chrome script or an addon because there is
no user input emulation API for WebExtension and builtin editors make the
change undoable only when JS changes the editor value with
`Document.execCommand`.  Therefore, addons may want to use
`Document.execCommand` for making the change undoable.

On the other hand, nested calls of `Document.execCommand` makes the error
handlings in editor classes too complicated.  Therefore, we don't allow that.
However, this causes that if web apps intercept `beforeinput` events and
prevents the default and calls `document.execCommand`, the first call of
web apps may be first nested call if the `beforeinput` event is caused by
a call of `Document.execCommand` in addon.

Therefore, this patch makes `Document` stores whether `ExecCommand` is called
by content or chrome/addon.  And if the call is improperly nested, keep stopping
handling the command, but allows if and only if the first call is by
chrome/addon.

Differential Revision: https://phabricator.services.mozilla.com/D198357
2024-01-14 03:06:25 +00:00
Tooru Fujisawa
95bdb671e8 Bug 1873330 - Part 4: Add UserActivation::Modifiers getters. r=smaug
In order to use the modifiers in nsGlobalWindowOuter::OpenInternal, add accessor
methods to BrowsingContext, Document, and WindowContext.
Those accessors behave in the same way as ConsumeTransientUserGestureActivation
and RevisePopupAbuseLevel, except for checking the PopupBlocker state.

Differential Revision: https://phabricator.services.mozilla.com/D197862
2024-01-11 17:24:02 +00:00
Tooru Fujisawa
293b0ae3cb Bug 1873330 - Part 3: Store modifiers for user activation with input event. r=smaug
Depends on D197860

Differential Revision: https://phabricator.services.mozilla.com/D197861
2024-01-11 17:24:02 +00:00