Commit graph

2014 commits

Author SHA1 Message Date
Nika Layzell
524e4f032a Bug 1681457 - Allow non-auxiliary BrowsingContexts created by script to close themselves, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211792
2024-06-05 00:06:48 +00:00
Nika Layzell
855d5761c0 Bug 196078 - Part 2: Support displaying arbitrary text/* MIME types as plain text, r=smaug,necko-reviewers,valentin
This patch refactors how we check for text formats when deciding how to handle
resources, such that more text MIME types will be rendered in-browser, rather
than downloaded.

This change requires us to move more away from using the Gecko-Content-Viewers
category in the category manager for this decision, as we need to handle an
unlimited number of MIME types behind the scenes.

Support for Gecko-Content-Viewers was left in for both the in-tree use for
application/http-index-format and dynamically determining whether image/avif
and image/jxl are supported, as well as for the message/rfc822 type used by
Thunderbird.

Differential Revision: https://phabricator.services.mozilla.com/D212078
2024-06-05 00:05:58 +00:00
Norisz Fay
f31e183290 Backed out 3 changesets (bug 1718673, bug 196078) for causing wpt failures on report-frame-ancestors-with-x-frame-options.sub.html CLOSED TREE
Backed out changeset 6a54aa5039e7 (bug 196078)
Backed out changeset 0582d2fa1401 (bug 196078)
Backed out changeset d8d9a0fe366b (bug 1718673)
2024-06-01 03:33:07 +03:00
Norisz Fay
b8a048f1f4 Backed out changeset 1034029ae9ed (bug 1681457) for causing failures on test_window_close.html CLOSED TREE 2024-06-01 00:10:26 +03:00
Nika Layzell
58ee355a1b Bug 196078 - Part 2: Support displaying arbitrary text/* MIME types as plain text, r=smaug,necko-reviewers,valentin
This patch refactors how we check for text formats when deciding how to handle
resources, such that more text MIME types will be rendered in-browser, rather
than downloaded.

This change requires us to move more away from using the Gecko-Content-Viewers
category in the category manager for this decision, as we need to handle an
unlimited number of MIME types behind the scenes.

Support for Gecko-Content-Viewers was left in for both the in-tree use for
application/http-index-format and dynamically determining whether image/avif
and image/jxl are supported, as well as for the message/rfc822 type used by
Thunderbird.

Differential Revision: https://phabricator.services.mozilla.com/D212078
2024-05-31 17:30:23 +00:00
Nika Layzell
a562668089 Bug 1681457 - Allow non-auxiliary BrowsingContexts created by script to close themselves, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211792
2024-05-31 17:27:15 +00:00
Cristian Tuns
fc392b89ab Backed out changeset 9b708a1dc402 (bug 1890748) for causing bc failures in browser_permission_delegate_geo.js CLOSED TREE 2024-05-27 12:25:10 -04:00
Andreas Farre
ec8d5be38a Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-05-27 10:06:58 +00:00
Butkovits Atila
f967675ec8 Backed out changeset a710fd347db2 (bug 1890748) for causing bustages at Document.cpp. CLOSED TREE 2024-05-24 18:06:30 +03:00
Andreas Farre
031a90d97c Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-05-24 14:28:47 +00:00
Bas Schouten
0e9f98bc02 Bug 1898384: Collect LCP under the same conditions as we collect other pageload telemetry. r=sefeng
Differential Revision: https://phabricator.services.mozilla.com/D211302
2024-05-23 11:24:59 +00:00
Adam Vandolder
6f7c97773b Bug 1887817 - Create document for parseHTMLUnsafe within the correct docgroup. r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D210556
2024-05-21 14:37:29 +00:00
Jan-Niklas Jaeschke
8726853107 Bug 1895555 - Text Fragments: Implement same-document navigation. r=farre,dom-core
Same-document navigation follows a different code path than normal navigation
and was therefore not covered in the initial implementation for text fragments.
Same-document navigation does not set a URI in the `Document`, which
is the way cross-document navigation would parse text directives from the URL.

Instead, `nsDocShell::ScrollToAnchor()` is called via
`nsDocShell::InternalLoad()`-> `nsDocShell::HandleSameDocumentNavigation()`.
This code path needs to parse and remove the fragment directive from the new
fragment to be able to find text fragments and to allow for element-id fallback.
`nsDocShell::ScrollToAnchor()` needs to start an attempt to scroll to the text fragment
if it exists. It must not, however, clear the uninvoked text directives,  because a
same-document navigation could happen before the document is fully loaded,
hence the target text might not be part of the DOM tree.

As per spec, a second attempt to scroll to the text fragment is done after the load
is completed. This is done by `Document::ScrollToRef()`, which is called by
`nsDocumentViewer::LoadComplete()` after the load has finished.
This call will clear the uninvoked directives.

Differential Revision: https://phabricator.services.mozilla.com/D209726
2024-05-17 12:16:00 +00:00
Emilio Cobos Álvarez
a774f79b6b Bug 1897322 - More consistently deal with pres shell style observers. r=smaug
Much like we deal with resize events.

Differential Revision: https://phabricator.services.mozilla.com/D210776
2024-05-17 11:56:36 +00:00
Emilio Cobos Álvarez
8bb4e85b36 Bug 1848899 - Remove widget.non-native-theme.enabled. r=desktop-theme-reviewers,dao,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D209537
2024-05-07 08:32:14 +00:00
Norisz Fay
388713c6ce Backed out changeset 9500b79c1ab4 (bug 1848899) for causing failures on test_bug869314.html CLOSED TREE 2024-05-07 06:13:38 +03:00
Emilio Cobos Álvarez
e3d5cf0e8e Bug 1848899 - Remove widget.non-native-theme.enabled. r=desktop-theme-reviewers,dao,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D209537
2024-05-06 20:44:34 +00:00
Tom Ritter
fa7ae97f0d Bug 1878716: Copy the randomization key from the opener r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D201087
2024-05-02 13:55:36 +00:00
Stanca Serban
55b1d9feb2 Backed out changeset 1ed5eea3a1e1 (bug 1892231) for causing mochitests failures in test_focus.xhtml. 2024-04-26 09:05:08 +03:00
Denis Palmeiro
eb8068f09a Bug 1892231: Add a flag to the page load event indicating whether a webdriver is running. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D207992
2024-04-25 12:09:10 +00:00
Malte Juergens
10eef3283f Bug 1885949 - Do not copy over HTTPS-First upgrade flag into new loadinfo r=necko-reviewers,freddyb,simonf,jesup r=reland
Differential Revision: https://phabricator.services.mozilla.com/D205048
2024-04-17 12:35:56 +00:00
Noemi Erli
d859c2989e Backed out changeset 28b2b5bfbed5 (bug 1885949) for causing http related mochitest failures CLOSED TREE 2024-04-17 19:32:37 +03:00
Malte Juergens
0b87e0cf2a Bug 1885949 - Do not copy over HTTPS-First upgrade flag into new loadinfo r=necko-reviewers,freddyb,simonf,jesup
Differential Revision: https://phabricator.services.mozilla.com/D205048
2024-04-17 12:35:56 +00:00
Emilio Cobos Álvarez
bcc3a3b993 Bug 1891597 - Simplify IntersectionObserver notifications. r=smaug
DOMIntersectionObserver::Update doesn't run script, so we can write this
code in a more straight-forward way.

Differential Revision: https://phabricator.services.mozilla.com/D207478
2024-04-16 02:58:10 +00:00
Pier Angelo Vendrame
83c0fe30b5 Bug 1886687: Report document.lastModified in UTC when using RFP. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D205289
2024-04-10 13:54:22 +00:00
keithamus
2696b59113 Bug 1888088 - Allow nested fullscreen elements r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D205802
2024-04-09 21:08:20 +00:00
Jan-Niklas Jaeschke
fda59c7c38 Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-04 14:39:33 +00:00
Jan-Niklas Jaeschke
64a2d399d6 Bug 1867939, part 1: Add FragmentDirective webidl and pref. r=dom-core,webidl,emilio,hsivonen
This patch also adds the empty shell of the `FragmentDirective` class to the `Document`.

Differential Revision: https://phabricator.services.mozilla.com/D195684
2024-04-04 14:39:31 +00:00
Emilio Cobos Álvarez
e4ddf24147 Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen
Sorry for the massive patch but I found it hard to split without
introducing a bunch of copies around...

This mostly makes necko and DOM agree on which strings to use, which
should result on less copies and conversions.

Differential Revision: https://phabricator.services.mozilla.com/D205601
2024-04-04 11:49:57 +00:00
Stanca Serban
c9bea63c35 Backed out 6 changesets (bug 1867939) for causing wpt failures in target-text-010.html. CLOSED TREE
Backed out changeset 44101c258e52 (bug 1867939)
Backed out changeset c53267e1b460 (bug 1867939)
Backed out changeset 0748839408e5 (bug 1867939)
Backed out changeset 38631fbd2f2f (bug 1867939)
Backed out changeset d77b9257c842 (bug 1867939)
Backed out changeset 0d269b891421 (bug 1867939)
2024-04-04 00:50:50 +03:00
Jan-Niklas Jaeschke
8863bf3e8d Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-03 15:23:02 +00:00
Jan-Niklas Jaeschke
66763e5c1f Bug 1867939, part 1: Add FragmentDirective webidl and pref. r=dom-core,webidl,emilio,hsivonen
This patch also adds the empty shell of the `FragmentDirective` class to the `Document`.

Differential Revision: https://phabricator.services.mozilla.com/D195684
2024-04-03 15:23:00 +00:00
Sandor Molnar
8340afd1fb Backed out 6 changesets (bug 1867939) for causing a top crash in nightly Bug 1889393 CLOSED TREE
Backed out changeset 2110f57e928c (bug 1867939)
Backed out changeset 51890598ecb4 (bug 1867939)
Backed out changeset 839bc1b11a2c (bug 1867939)
Backed out changeset bb88c4d09e82 (bug 1867939)
Backed out changeset 27c76e65cf58 (bug 1867939)
Backed out changeset c3e3c81f9ceb (bug 1867939)
2024-04-03 17:31:56 +03:00
Benjamin VanderSloot
e4261f900b Bug 1876575, part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers
Storage Access API should auto-grant in ABA frames, but should not initially "haveStorageAccess".

This does that!

Differential Revision: https://phabricator.services.mozilla.com/D205370
2024-04-02 18:53:27 +00:00
Emilio Cobos Álvarez
8d73fd209e Bug 1888242 - Simplify viewport handling in RDM. r=bradwerth,devtools-reviewers,ochameau
In particular:

 * Always handle meta viewport in RDM. This fixes bug 1625999 too by
   making touch simulation enabled and disabled consistent.

 * Restore the resolution to 1 when toggling RDM. This is just simpler,
   and we're not keeping around the visual viewport offsets anyways
   so...

 * Deal with the change more easily, at the same point we switch
   scrollbars etc.

Differential Revision: https://phabricator.services.mozilla.com/D206266
2024-04-02 15:21:04 +00:00
Jan-Niklas Jaeschke
6895c14804 Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-02 13:44:25 +00:00
Jan-Niklas Jaeschke
48c61f0bee Bug 1867939, part 1: Add FragmentDirective webidl and pref. r=dom-core,webidl,emilio,hsivonen
This patch also adds the empty shell of the `FragmentDirective` class to the `Document`.

Differential Revision: https://phabricator.services.mozilla.com/D195684
2024-04-02 13:44:24 +00:00
Cristian Tuns
3ba835953e Backed out 6 changesets (bug 1876574, bug 1876575) for causing multiple failures in TestGetPrincipalCookieBehavior5 CLOSED TREE
Backed out changeset f00e9fde550f (bug 1876575)
Backed out changeset ca1c6f8819f7 (bug 1876575)
Backed out changeset d65ac05bd9f8 (bug 1876575)
Backed out changeset 5dcfe3aa8497 (bug 1876575)
Backed out changeset 9ae9252761ac (bug 1876575)
Backed out changeset 704e94d28ad7 (bug 1876574)
2024-04-02 09:58:52 -04:00
Cristian Tuns
a1bb69acae Backed out 6 changesets (bug 1867939) for causing build bustages in Document.h CLOSED TREE
Backed out changeset 0853f9a7a06c (bug 1867939)
Backed out changeset 2279e6577c13 (bug 1867939)
Backed out changeset 1b3af4b6a27b (bug 1867939)
Backed out changeset 2fbe643ca483 (bug 1867939)
Backed out changeset 575873406614 (bug 1867939)
Backed out changeset 82f99c0210b0 (bug 1867939)
2024-04-02 09:15:46 -04:00
Benjamin VanderSloot
6fd7c69ce2 Bug 1876575, part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers
Storage Access API should auto-grant in ABA frames, but should not initially "haveStorageAccess".

This does that!

Differential Revision: https://phabricator.services.mozilla.com/D205370
2024-04-02 12:50:03 +00:00
Jan-Niklas Jaeschke
af01f056e5 Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-02 11:43:21 +00:00
Jan-Niklas Jaeschke
f7ad61ddd9 Bug 1867939, part 1: Add FragmentDirective webidl and pref. r=dom-core,webidl,emilio,hsivonen
This patch also adds the empty shell of the `FragmentDirective` class to the `Document`.

Differential Revision: https://phabricator.services.mozilla.com/D195684
2024-04-02 11:43:20 +00:00
Stanca Serban
23caed9eac Backed out 6 changesets (bug 1876574, bug 1876575) for causing multiple failures. CLOSED TREE
Backed out changeset 8c7a9f405031 (bug 1876575)
Backed out changeset 49739f9ec590 (bug 1876575)
Backed out changeset 1c49f0c3b677 (bug 1876575)
Backed out changeset 1ca7a0f27bc0 (bug 1876575)
Backed out changeset bfa9862e3480 (bug 1876575)
Backed out changeset 58576ed7eb22 (bug 1876574)
2024-03-29 20:52:30 +02:00
Benjamin VanderSloot
e94b51a39c Bug 1876575, part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers
Storage Access API should auto-grant in ABA frames, but should not initially "haveStorageAccess".

This does that!

Differential Revision: https://phabricator.services.mozilla.com/D205370
2024-03-29 17:12:16 +00:00
Sandor Molnar
09e7cbd0b7 Backed out 6 changesets (bug 1876575, bug 1876574) for causing build bustages @ toolkit/components/resistfingerprinting/nsRFPService.cpp CLOSED TREE
Backed out changeset 455ce831c73c (bug 1876575)
Backed out changeset 4fa3fbf3a3ae (bug 1876575)
Backed out changeset ac4c41cb3b67 (bug 1876575)
Backed out changeset 15e06d10788e (bug 1876575)
Backed out changeset dcd6bbea816a (bug 1876575)
Backed out changeset cc547125fda9 (bug 1876574)
2024-03-29 16:29:47 +02:00
Benjamin VanderSloot
1956955ce2 Bug 1876575, part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers
Storage Access API should auto-grant in ABA frames, but should not initially "haveStorageAccess".

This does that!

Differential Revision: https://phabricator.services.mozilla.com/D205370
2024-03-29 13:11:28 +00:00
Tim Huang
20abf29fd1 Bug 1873682 - Fallback to use partitionKey as the top URI when getting the fingerprinting override if the top-level window has been navigated away. r=tjr,anti-tracking-reviewers,cookie-reviewers,pbz
This patch introduces a mTopLevelWindowContextId field to
cookieJarSettings. The field caches the top-level window context id. We
use this field to check whether the top-level window is navigated away.
If so, we fallback to use partitionKey as the top URI when getting the
fingerprinting override because the top-level URI could be different in
this case.

Differential Revision: https://phabricator.services.mozilla.com/D203889
2024-03-27 22:40:54 +00:00
Norisz Fay
d96ee25bcf Backed out changeset 0cda2285fb46 (bug 1873682) for causing process-crash in mochitest.toml 2024-03-27 20:29:59 +02:00
Tim Huang
f9b0f1afcf Bug 1873682 - Fallback to use partitionKey as the top URI when getting the fingerprinting override if the top-level window has been navigated away. r=tjr,anti-tracking-reviewers,cookie-reviewers,pbz
This patch introduces a mTopLevelWindowContextId field to
cookieJarSettings. The field caches the top-level window context id. We
use this field to check whether the top-level window is navigated away.
If so, we fallback to use partitionKey as the top URI when getting the
fingerprinting override because the top-level URI could be different in
this case.

Differential Revision: https://phabricator.services.mozilla.com/D203889
2024-03-27 15:24:46 +00:00
Vincent Hilla
b1bad88980 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