Commit Graph

2325 Commits

Author SHA1 Message Date
Olli Pettay
4860c3877d Bug 1959303 - Avoid calling MicroTaskRunnable::Suppressed if it can't return true, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D244848
2025-04-10 01:08:37 +00:00
Emilio Cobos Álvarez
4c0adc7d53 Bug 1958965 - Change scroll event setup to match the spec better. r=smaug
This matches the spec (plus resolution at
https://github.com/w3c/csswg-drafts/issues/11164) better, by running the
events per document.

Same comments as D244655 regarding the delayed event stuff that's going
away.

Differential Revision: https://phabricator.services.mozilla.com/D244666
2025-04-10 01:07:15 +00:00
Emilio Cobos Álvarez
cc89fb812f Bug 1958942 - Refactor how we schedule and suppress rendering phases. r=smaug
This starts some of the needed refactoring towards having proper
rendering suppression, and in general aligning better with the HTML
spec's "update the rendering" section.

Behavior changes should be minimal:

 * We suppress rendering until the pres shell is initialized rather than
   just created. This matches how autofocus already works and in general
   we don't want to forcibly flush an uninitialized presshell.

 * We handle view transition suppression more correctly in some (but not
   all) phases.

 * Some of the steps do no longer recurse manually nor check the view
   transitions suppression, as that's done centrally.

 * mAutoFocusFlushDocuments isn't tracked separately.

Follow-up work will involve changing most of the "pending resize/scroll/etc"
events to be per-document as per spec, and also implement suppression for
painting.

Differential Revision: https://phabricator.services.mozilla.com/D244372
2025-04-09 23:51:01 +00:00
Emilio Cobos Álvarez
79aa0d7606 Bug 1958322 - Plumb pip mode to Gecko. r=padenot,hiro,geckoview-reviewers,webidl,saschanaz,smaug,calu
Differential Revision: https://phabricator.services.mozilla.com/D244794
2025-04-09 18:04:42 +00:00
Jan-Niklas Jaeschke
62670c535b Bug 1958601 - Text Fragments: Fixed broken use counter metric collection. r=emilio
Also did some cleaning up for duplicate tests.

Differential Revision: https://phabricator.services.mozilla.com/D244934
2025-04-09 15:05:48 +00:00
Cristina Horotan
88909b7d2a Backed out 4 changesets (bug 1948249, bug 1949204, bug 1897439, bug 1949499) for causign build bustage at NavigateEvent.h.
Backed out changeset 3d6f77552af3 (bug 1897439)
Backed out changeset a9843b92d309 (bug 1948249)
Backed out changeset cf1e6a0c7365 (bug 1949499)
Backed out changeset bd1a59a1dd98 (bug 1949204)
2025-04-09 18:22:09 +03:00
Andreas Farre
b407a6139e Bug 1948249 - Implement NavigateEvent.scroll. r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D242702
2025-04-09 14:19:38 +00:00
Florian Quèze
6147d3f360 Bug 1956726 - Migrate histograms to use Glean APIs in dom/, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D244177
2025-04-03 21:02:54 +00:00
Fatih Kilic
60a57c0757 Bug 1954188: bFPP Part 7 - Force refresh RTPCallerType on pref change. r=tjr
Now that we have some sort of fingerprinting protection enabled all the time, [`changed`](https://searchfox.org/mozilla-central/rev/3a0ca3dffd7ccf74a53066a097739f24dd8b6b10/dom/base/Document.cpp#17010-17015) isn't true when you enable/disable FPP or RFP. The way to trigger it would be also enabling/disabling bFPP with FPP or RFP in the tests, but instead forcing a RFP caller type refresh makes more sense, and is less hacky (but if anyone disagrees, we can also do the disabling/enabling bFPP with the tests)

Differential Revision: https://phabricator.services.mozilla.com/D242787
2025-04-03 17:30:19 +00:00
Cristina Horotan
b163893208 Backed out 7 changesets (bug 1954188) for causing bc failures at browser_preferences_usage.js
Backed out changeset dae6e2ec0b2d (bug 1954188)
Backed out changeset 47f683e9f0d6 (bug 1954188)
Backed out changeset 14ed1c70e1ec (bug 1954188)
Backed out changeset 291590143ed9 (bug 1954188)
Backed out changeset fbb4e968f0f1 (bug 1954188)
Backed out changeset 4c21e081561e (bug 1954188)
Backed out changeset 33e6088d8317 (bug 1954188)
2025-04-03 03:21:46 +03:00
Fatih Kilic
9302a00ffe Bug 1954188: bFPP Part 7 - Force refresh RTPCallerType on pref change. r=tjr
Now that we have some sort of fingerprinting protection enabled all the time, [`changed`](https://searchfox.org/mozilla-central/rev/3a0ca3dffd7ccf74a53066a097739f24dd8b6b10/dom/base/Document.cpp#17010-17015) isn't true when you enable/disable FPP or RFP. The way to trigger it would be also enabling/disabling bFPP with FPP or RFP in the tests, but instead forcing a RFP caller type refresh makes more sense, and is less hacky (but if anyone disagrees, we can also do the disabling/enabling bFPP with the tests)

Differential Revision: https://phabricator.services.mozilla.com/D242787
2025-04-02 17:26:36 +00:00
Emilio Cobos Álvarez
63d58a3537 Bug 1955697 - Store whether the canvas background is css-specified for both page and viewport canvases. r=mstange
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D242625
2025-03-24 18:54:34 +00:00
Benjamin De Kosnik
cc32a3e9ad Bug 1955402 - Adjust a11y metadata for activity, active AT use. r=denispal
Differential Revision: https://phabricator.services.mozilla.com/D242410
2025-03-24 18:09:15 +00:00
Randell Jesup
22a79bdf73 Bug 1955495: disable defer_during_load via a pref for specific sites/urls r=smaug
Sites with racy code can sometimes fail if we don't run timeouts
immediately.  Note that in most cases it will still be racy and can still
fail.

Differential Revision: https://phabricator.services.mozilla.com/D242628
2025-03-22 13:25:24 +00:00
Edgar Chen
3d0d8aa9c3 Bug 834208 - Align the document name getter with the spec and other browsers; r=smaug,devtools-reviewers,ochameau
Original patch: 7d93b7e3c1
Original author: Aryeh Gregor <ayg@aryeh.name>

According to the spec,
 - https://html.spec.whatwg.org/#dom-document-nameditem
 - https://html.spec.whatwg.org/#named-access-on-the-window-object

the document and window named getters return different values. This patch creates
a separated content list for document named getter while keeping the original
content list for the window named getter. Additionally, the content list now
includes both names and ids, in addition to the id list (which is still used for
other things like getElementById()).

This means one element might be on up to multiple lists, but this implementation
is necessary. Specifically, we must return a consistent live list for document.foo
and for window.foo, so they need to be stored separately and cannot be generated
on the fly from a single shared list.

Differential Revision: https://phabricator.services.mozilla.com/D240951
2025-03-20 15:42:43 +00:00
Norisz Fay
fbba6901d1 Backed out changeset c28cc6141d04 (bug 834208) for causing bustage on nsHTMLDocument.cpp 2025-03-20 15:50:36 +02:00
Edgar Chen
b60c7d8733 Bug 834208 - Align the document name getter with the spec and other browsers; r=smaug,devtools-reviewers,ochameau
Original patch: 7d93b7e3c1
Original author: Aryeh Gregor <ayg@aryeh.name>

According to the spec,
 - https://html.spec.whatwg.org/#dom-document-nameditem
 - https://html.spec.whatwg.org/#named-access-on-the-window-object

the document and window named getters return different values. This patch creates
a separated content list for document named getter while keeping the original
content list for the window named getter. Additionally, the content list now
includes both names and ids, in addition to the id list (which is still used for
other things like getElementById()).

This means one element might be on up to multiple lists, but this implementation
is necessary. Specifically, we must return a consistent live list for document.foo
and for window.foo, so they need to be stored separately and cannot be generated
on the fly from a single shared list.

Differential Revision: https://phabricator.services.mozilla.com/D240951
2025-03-20 11:41:46 +00:00
Sean
d7c1827508 Bug 1954216 - Add the time of the TLS handshake recorded for top-level documents via the pageload event r=acreskey,denispal,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D242043
2025-03-20 03:19:55 +00:00
Boris Chiou
3e0e99044c Bug 1951797 - Flush the pending update callbacks before capturing the old state. r=view-transitions-reviewers,emilio
Per spec, now we flush the update callback queue before scheduling the new
update callback in Setup() to make sure the previous update callbacks get
invoked before we do capturing.

Differential Revision: https://phabricator.services.mozilla.com/D241328
2025-03-18 19:31:48 +00:00
Norisz Fay
1ec853e4bf Backed out 2 changesets (bug 1951797) for causing wpt failures on start-view-transtion-skips-active.html CLOSED TREE
Backed out changeset 97f0dc799a56 (bug 1951797)
Backed out changeset 20d6fcfc4372 (bug 1951797)
2025-03-18 02:38:01 +02:00
Boris Chiou
b39e4558a2 Bug 1951797 - Flush the pending update callbacks before capturing the old state. r=view-transitions-reviewers,emilio
Per spec, now we flush the update callback queue before scheduling the new
update callback in Setup() to make sure the previous update callbacks get
invoked before we do capturing.

The test is in css-view-transitions/start-view-transtion-skips-active.html,
which is not merged into Gecko yet, so I only can verify it in the try server.

Differential Revision: https://phabricator.services.mozilla.com/D241328
2025-03-17 22:56:40 +00:00
Travis Long
5886328053 Bug 1947604 - Part 5: Glam Experiment temporary metric instrumentation (dom module). r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D241254
2025-03-13 13:17:27 +00:00
Sean
f7088cfaa1 Bug 1951765 - Fallback to net_GetDefaultStatusTextForCode in Document::GetNetErrorInfo when missing responseStatusText r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D241046
2025-03-12 13:22:40 +00:00
Emilio Cobos Álvarez
9d11085b44 Bug 1953413 - Suppress frame callbacks and intersection observer updates when rendering view transitions. r=view-transitions-reviewers,boris
Posting, because per spec we should do this, but we should also do much
more.

I can look into rejiggering the refresh driver set-up a bit more to make
this more generic if you want.

Differential Revision: https://phabricator.services.mozilla.com/D241067
2025-03-12 11:50:42 +00:00
Emilio Cobos Álvarez
3d57da7e38 Bug 1950791 - Avoid setting up view transition twice. r=view-transitions-reviewers,boris
See https://github.com/w3c/csswg-drafts/issues/11907

Differential Revision: https://phabricator.services.mozilla.com/D241038
2025-03-11 19:50:49 +00:00
Tim Huang
d64cfc5a5f Bug 1943536 - Part 2: Exclude the openerWithUserInteraction heuristic from first-party tracking windows. r=bvandersloot
Currently, we only allow openerWithUserInteraction heuristic for
trackering windows, which doesn't match the MDN article of SAA
heuristics.

In addition, we want to remove the opener heuristic in the future and
move to use the openerWithUserInteraction instead.

In this patch, we change the heuristic to allow it for non-tracking
windows and put it behind the pref.

Differential Revision: https://phabricator.services.mozilla.com/D238941
2025-03-04 13:16:08 +00:00
Tim Huang
2cce6e9f55 Bug 1943536 - Part 1: Fixing the name of the pref to exclude third-party trackers from SAA AutoGrants. r=anti-tracking-reviewers,bvandersloot
We used a wrong name for the pref that controls SAA AutoGrants for
third-party trackers. This patch fixes this by introducing a pref with a
properly. We will keep the pref that controls SAA heuristics for
third-party trackers.

Differential Revision: https://phabricator.services.mozilla.com/D238940
2025-03-04 13:16:08 +00:00
Nika Layzell
116da25334 Bug 1665474 - Part 11: Don't create DocGroups for cross-origin data documents, r=smaug,farre
This changes how DocGroups are created to make cross-origin data
documents share a DocGroup with their embedder.

This is required to better align DocGroups with Similar-origin Window
Agents (which correlate with DocGroups), which is required for other
parts of this patch stack.

Differential Revision: https://phabricator.services.mozilla.com/D239226
2025-03-03 22:51:32 +00:00
Nika Layzell
af7ebed65a Bug 1665474 - Part 10: Add a global list of all in-process documents, r=smaug
This is used to replace the places where all documents are iterated using
DocGroup. In another part, DocGroups are changed to hold Window Globals rather
than Document objects, so an alternative mechanism is required to allow for all
documents to be iterated.

A linked list is used to minimize document creation overhead.

Differential Revision: https://phabricator.services.mozilla.com/D238116
2025-03-03 22:51:31 +00:00
Nika Layzell
26d43d1b40 Bug 1665474 - Part 8: Update document.domain warning wording, r=farre,flod
Previously this warning could only fire in a cross-origin-isolated
context, but after the changes in this patch stack, it can also happen
if the webpage opts in with Origin-Agent-Cluster: ?1.

This updates the wording of the warning to more accurately reflect the
new situations which cause it to fire.

Differential Revision: https://phabricator.services.mozilla.com/D236977
2025-03-03 22:51:30 +00:00
Nika Layzell
e284750379 Bug 1665474 - Part 1: Make origin keying explicit in the DocGroup key, r=farre
The UsesOriginAgentCluster method returns a Maybe<bool>, to allow for an
uncertain state in the future (when the origin-agent-cluster status can be
unknown until a network request is received).

Differential Revision: https://phabricator.services.mozilla.com/D236970
2025-03-03 22:51:26 +00:00
Dana Keeler
5e3c261ad8 Bug 1486551 - turn cert revocation error pages into (non-overridable) certificate error pages r=jschanck,fluent-reviewers,webidl,bolsson,smaug
SEC_ERROR_REVOKED_CERTIFICATE is a certificate error, not a TLS protocol error.
This patch updates the categorization of this error while maintaining the
property that it cannot be overridden. This has the benefit of making it
possible to show more diagnostic information in the error page, which this
patch also adds.

Differential Revision: https://phabricator.services.mozilla.com/D239220
2025-02-27 22:12:46 +00:00
Emilio Cobos Álvarez
b8d8170320 Bug 1950362 - Fix transition-in-hidden-page.html. r=view-transitions-reviewers,boris
Reject InvalidStateError for this case as per spec, and run the view
transition page visibility change steps.

Differential Revision: https://phabricator.services.mozilla.com/D239529
2025-02-26 12:29:49 +00:00
Cristina Horotan
5bc51022a0 Backed out 9 changesets (bug 1922300, bug 1950362, bug 1919333, bug 1950176, bug 1948058, bug 1950177, bug 1922298) for causing multiple Wr failures
Backed out changeset 54c87e09251a (bug 1919333)
Backed out changeset 813274ba35a0 (bug 1919333)
Backed out changeset a37d91fc2a7a (bug 1950362)
Backed out changeset 97f67f9048b5 (bug 1922298)
Backed out changeset 4c11b366fcaf (bug 1919333)
Backed out changeset dbde76fa73a9 (bug 1948058)
Backed out changeset ba3d9d95cd56 (bug 1922300)
Backed out changeset 0fe786bf2709 (bug 1950177)
Backed out changeset 8d9f52e91779 (bug 1950176)
2025-02-26 06:23:09 +02:00
Emilio Cobos Álvarez
4f7bc12c71 Bug 1950362 - Fix transition-in-hidden-page.html. r=view-transitions-reviewers,boris
Reject InvalidStateError for this case as per spec, and run the view
transition page visibility change steps.

Differential Revision: https://phabricator.services.mozilla.com/D239529
2025-02-25 22:48:31 +00:00
Benjamin De Kosnik
e8fec12374 Bug 1932691 - Add a11y metadata for activity, active AT use. r=denispal
Differential Revision: https://phabricator.services.mozilla.com/D239284
2025-02-25 02:06:02 +00:00
Otto Länd
e3feec236d Bug 1947480, 1949804, 1949805: apply code formatting via Lando
# ignore-this-changeset
2025-02-24 12:09:43 +00:00
Benjamin VanderSloot
ca20904643 Bug 1949805 - Window opener heuristic with user interaction should not only work for trackers - r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D239165
2025-02-24 12:06:48 +00:00
Cristina Horotan
9975b38430 Backed out 5 changesets (bug 1949804, bug 1947480, bug 1949805) for causing mass failures. CLOSED TREE
Backed out changeset 835e4940c930 (bug 1947480)
Backed out changeset a48286b80385 (bug 1949804)
Backed out changeset b809946b04a9 (bug 1949805)
Backed out changeset e1d491ba00eb (bug 1947480)
Backed out changeset b2dc603aeb74 (bug 1947480)
2025-02-23 16:26:15 +02:00
Benjamin VanderSloot
5d1e346b26 Bug 1949805 - Window opener heuristic with user interaction should not only work for trackers - r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D239165
2025-02-23 13:40:19 +00:00
Emilio Cobos Álvarez
7f8821716f Bug 1949961 - Consistently set doc association of additional sheets. r=smaug
We had two codepaths, one failing if the sheet was associated, and one
doing the opposite. Make additional sheets never doc-associated.

Differential Revision: https://phabricator.services.mozilla.com/D239257
2025-02-22 23:30:46 +00:00
Emilio Cobos Álvarez
eb8b2b42cc Bug 1931789 - Fix an assert triggering in some devtools tests.
DOMWindoUtils.addSheet can add a sheet without associated doc
(extensions do this).

MANUAL PUSH: Trivial fix CLOSED TREE
2025-02-22 19:14:56 +01:00
Emilio Cobos Álvarez
507f709941 Bug 1931789 - Avoid quadratic behaviour of FindDocStyleSheetInsertionPoint in the common append case. r=smaug
This is about 0.75% of the full sp3 suite.

Co-authored-by: Timothy Nikkel <tnikkel@gmail.com>

Differential Revision: https://phabricator.services.mozilla.com/D229283
2025-02-22 16:23:12 +00:00
Timothy Nikkel
b91c21bf5e Bug 1931789. Change DocumentOrShadowRoot::StyleOrderIndexOfSheet to return size_t. r=emilio
size_t is the return type of nsTArray::IndexOf. NoIndex is defined as (size_t)-1. Implicitly converting this to int32_t which is signed and might be a different bit width seems sketchy to me. This makes this clear and explicit.

Differential Revision: https://phabricator.services.mozilla.com/D229282
2025-02-22 16:23:12 +00:00
Butkovits Atila
c7e8b2807a Backed out 5 changesets (bug 1947480, bug 1949804, bug 1949805) for causing build bustages. CLOSED TREE
Backed out changeset 50e0c799bfa8 (bug 1947480)
Backed out changeset 4f6f7fdd87bd (bug 1949804)
Backed out changeset d3d2625285aa (bug 1949805)
Backed out changeset 71c974d05b82 (bug 1947480)
Backed out changeset c67515b6e9e9 (bug 1947480)
2025-02-21 23:38:48 +02:00
Benjamin VanderSloot
94a7073583 Bug 1949805 - Window opener heuristic with user interaction should not only work for trackers - r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D239165
2025-02-21 20:12:12 +00:00
Botond Ballo
20586c03d8 Bug 1945717 - Add some logging to codepaths handling the 980px desktop viewport width. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D237991
2025-02-13 06:59:48 +00:00
Botond Ballo
10cd44fb94 Bug 1945717 - Use the larger of the screen width or 980px as the initial containing block size in desktop mode. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D237286
2025-02-13 06:59:47 +00:00
Adam Vandolder
23e9c9915a Bug 1890747 - Track Navigation history entries. r=dom-core,farre
Differential Revision: https://phabricator.services.mozilla.com/D219007
2025-02-13 03:11:20 +00:00
Emilio Cobos Álvarez
300a114109 Bug 1947023 - Propagate hidden-under-embedder properly to nested tops. r=nika,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D237502
2025-02-10 17:50:57 +00:00