Commit Graph

2015 Commits

Author SHA1 Message Date
Vincent Hilla
fe612b0aa1 Bug 1882344 - Have Document instead of WakeLockJS release locks on loss of activity. r=edgar,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D202853
2024-03-26 17:21:17 +00:00
Iulian Moraru
c22545e83d Backed out changeset a293e6927cab (bug 1882344) for causing multiple failures. CLOSED TREE 2024-03-26 13:41:00 +02:00
Vincent Hilla
b44fc6331a Bug 1882344 - Have Document instead of WakeLockJS release locks on loss of activity. r=edgar,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D202853
2024-03-26 10:00:45 +00:00
Emilio Cobos Álvarez
782cce08a3 Bug 1884792 - Remove chrome-only :-moz-lwtheme pseudo-class. r=desktop-theme-reviewers,dao
Behavior is effectively :root[lwtheme="true"]. Use the attribute
selector instead.

Differential Revision: https://phabricator.services.mozilla.com/D204315
2024-03-18 10:18:25 +00:00
Mark Banner
a27f34998d Bug 1884623 - Update more jsm references in production code and docs in dom/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D204183
2024-03-11 15:26:28 +00:00
Olli Pettay
d62c05df29 Bug 1882417 - Suspend DOM notifications while parsing innerHTML, r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D202891
2024-03-01 13:14:34 +00:00
Frédéric Wang
85bb4cfc81 Bug 1880928 - Make ResizeObserver::mCallback a ResizeObserverCallback again. r=Oriol
Essentially reverting D154324 since we no longer need it to accept
internal callback functions.

Differential Revision: https://phabricator.services.mozilla.com/D202555
2024-02-29 08:50:57 +00:00
Frédéric Wang
2c7f5be45e Bug 1880928 - Update some "last remembered sizes" before determining proximity to the viewport. r=emilio,layout-reviewers
We do it right after layout to make sure sizes are up-to-date and before
determining proximities to viewport of 'content-visibility: auto' to
make sure we are not incorrectly recording the size of a previously
"skipping its content" node.

This change is covered by tests added in D202403.

Differential Revision: https://phabricator.services.mozilla.com/D202731
2024-02-29 08:50:56 +00:00
Frédéric Wang
ea8819b5ee Bug 1880928 - Remove last remembered size observer, handle it in Document::DetermineProximityToViewportAndNotifyResizeObservers. r=emilio,layout-reviewers
The CSS Box Sizing specification indicates that last remembered sizes
are recorded "at the time that ResizeObserver events are determined and
delivered" [1].

In bug 1807253, we changed the implementation of when proximity to the
viewport of `content-visibility: auto` nodes are determined and of when
resize observations are broadcast, in order to align with the latest
version of the HTML specification [2]. We continue to use an internal
`Document::mLastRememberedSizeObserver` to update last remembered sizes
but it has been causing issues (e.g. bug 1867090 and bug 1880928) and
could be replaced by a direct update before broadcasting resize
observations.

This is what the current patch is doing. The elements currently observed
by `Document::mLastRememberedSizeObserver` are now stored on a
`Document::mElementsWithLastRememberedSize` hashset and a new function
`Document::UpdateLastRememberedSizes` is called before broadcasting
resize observations, and peforms the work of `LastRememberedSizeCallback`
and of `CalculateBoxSize` (with `aBox=Content_box`).

The only behavior change is in the `while(true)` loop from
`DetermineProximityToViewportAndNotifyResizeObservers`: at each step
we update the last remember sizes for elements of arbitrary depth, and
don't use these depths for calculating `shallowestTargetDepth`. This is
fine, since our `LastRememberedSizeCallback` only records current box
sizes without causing significant side effects (e.g. execution of
JavaScript code) that may require a relayout.

[1] https://drafts.csswg.org/css-sizing-4/#last-remembered
[2] https://html.spec.whatwg.org/#update-the-rendering

Differential Revision: https://phabricator.services.mozilla.com/D202571
2024-02-29 08:50:55 +00:00
Daniel Holbert
60f872aa72 Bug 1882425: Use a UniquePtr to manage Document::mSubDocuments. r=dom-core,edgar
This patch doesn't change behavior.

As noted in the code-comment: ideally we should fully-modernize to nsTHashMap
or similar, but that's a larger project and will require a bit of care to be
sure we're preserving the semantics that this struct imposes on itself right
now (e.g. subdocuments clearing their parent-document pointer, as part of
removal from the map). For now, I'm just taking the incremental/trivial win of
using UniquePtr to remove explicit `new`/`delete` statements.

Differential Revision: https://phabricator.services.mozilla.com/D202904
2024-02-28 20:35:54 +00:00
Makoto Kato
47906dde94 Bug 1872863 - Part 1. Ignore error of GetInlineSpellCheckek. r=masayuki
GeckoView disables spell checker. When disabling it and contenteditable
attribute is changed, we may not initialize editor.

So we should ignore an error of spell check.

Differential Revision: https://phabricator.services.mozilla.com/D202408
2024-02-27 15:00:33 +00:00
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