Commit Graph

2325 Commits

Author SHA1 Message Date
Jan-Niklas Jaeschke
d006e0761b Bug 1903086: Use script blocker in Document::DoUpdateSVGElementShadowTrees(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D213997
2024-06-19 10:11:25 +00:00
Masayuki Nakano
ddb1689f64 Bug 1897865 - Make TextEditor stop dispatching beforeinput/input events during committing composition caused by setting its value r=m_kato
As far as testing on Chrome, they don't dispatch any events during setting
text control value (including `compositionupdate` and `compositionend`).
However, we dispatch `compositionupdate`, `compositionend`, `beforeinput` and
`input` synchronously.  Therefore, `input` event listener may run again with
the old value.  This may make web apps confused because they may not expect
the nested `input` event listener call which is not caused by user intention
nor a `Document.execCommand` call.  Therefore, we should stop dispatching
the nested `beforeinput` and `input` events which are caused by committing
composition for setting value since the value will be updated soon, so,
the input caused by committing composition does not occur actually.  However,
`compositionend` event should be fired even in the nested event loop because
the web apps may manage whether they has a composition with a pair of
`compositionstart` and `compositionend` event listeners even though that won't
work on Chrome.

Additionally, the nested `compositionupdate` and `compositionend` event may
cause a `Document.execCommand` call.  However, that must be unexpected behavior
for web apps and anyway the value will be overwritten to the new value.
Therefore, let's make `Document::ExecCommand` do nothing in the situation.

Differential Revision: https://phabricator.services.mozilla.com/D213756
2024-06-18 00:30:49 +00:00
Stanca Serban
2c7403182a Backed out changeset 5c96ab83cfe9 (bug 1903086) for causing reftests failures. 2024-06-18 05:10:06 +03:00
Dana Keeler
0984c1a24b Bug 1902134 - include failedChannel.status in certificate and tls error page event telemetry r=Gijs,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D213480
2024-06-17 16:56:41 +00:00
Jan-Niklas Jaeschke
6bfff4911c Bug 1903086: Use script blocker in Document::DoUpdateSVGElementShadowTrees(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D213997
2024-06-17 16:31:42 +00:00
Sean
b67ef76afc Bug 1898245 - Migrate HTTP3_PERF_FIRST_CONTENTFUL_PAINT_MS, H3P_PERF_FIRST_CONTENTFUL_PAINT_MS, and EH_PERF_FIRST_CONTENTFUL_PAINT_MS probes to glean r=valentin,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D211278
2024-06-17 09:54:15 +00:00
Iulian Moraru
a9377e5b95 Backed out 4 changesets (bug 1898321, bug 1897942, bug 1897956) for causing multiple failures.
Backed out changeset ec3fcdcbfbd7 (bug 1897942)
Backed out changeset 279025d15551 (bug 1898321)
Backed out changeset a239855b02ea (bug 1897942)
Backed out changeset aab98ffe0ee9 (bug 1897956)
2024-06-14 18:43:03 +03:00
Jan-Niklas Jaeschke
a70a790e2a Bug 1898321 - Text Fragments: Correctly find text fragments if there are DOM changes during page load. r=farre,dom-core
Before this patch, the first call to `Document::ScrollToRef()` would attempt to find all text directives in the document, and, if found, highlight + scroll to them. Then, it would clear the list of uninvoked directives.

However, `ScrollToRef()` is called multiple times during a page load, and the DOM can change (e.g. if `DOMContentLoaded` does some changes).

This patch fixes this by only removing the text directives which were found in the document from the list of uninvoked directives.
This way, subsequent calls to `ScrollToRef()` would ensure that all text directives are highlighted, and the first text directive is scrolled to.
Additionally, all remaining uninvoked text directives at the end of a page load (ie. text directives that are not on the page) are cleared.

A test was added as well.

Differential Revision: https://phabricator.services.mozilla.com/D211260
2024-06-14 12:20:48 +00:00
Jan-Niklas Jaeschke
8c4f317e30 Bug 1897956 - Text Fragments: Set text fragment as :target. r=farre,dom-core
This patch makes some adjustments to follow the spec more strictly by
separating highlighting a text fragment (ie. adding the ranges to a `eTargetText` Selection)
from scrolling to it.

Scrolling to the text fragment now follows the steps given in [0] more closely,
in particular now the closest common ancestor of the target range is being used
as `:target` element.

This change also sets the focus to the start of the first text fragment, as indicated by the spec.
This resets the normal selection on the page.
The wpt test in /css/css-pseudo/target-text-005.html is based on the idea of having a same-doc
text fragment navigation with a selection.
This test fails with this patch applied, because the selection is reset.
It is currently unclear what behavior is correct here, thus the test is kept for now.

[0]: https://wicg.github.io/scroll-to-text-fragment/#invoking-text-directives

Differential Revision: https://phabricator.services.mozilla.com/D211025
2024-06-14 12:20:47 +00:00
Gregory Pappas
71145eb0d1 Bug 1880782 - Remove dom.animations-api.compositing.enabled and dom.animations-api.timelines.enabled prefs r=webidl,devtools-reviewers,firefox-animation-reviewers,nchevobbe,smaug,boris
Differential Revision: https://phabricator.services.mozilla.com/D211505
2024-06-05 19:13:23 +00:00
Gregory Pappas
78d78a35da Bug 1848966 - Remove dom.document.exec_command.nested_calls_allowed pref r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D212578
2024-06-05 02:48:31 +00:00
Nika Layzell
11d3698341 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
23266c76a6 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
39f756dabc 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
ed9f22a2fc 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
f42df8021b 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
7025bc892e 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
ce526f805f 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
b66f6322f2 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
bd73be20f9 Backed out changeset a710fd347db2 (bug 1890748) for causing bustages at Document.cpp. CLOSED TREE 2024-05-24 18:06:30 +03:00
Andreas Farre
bcf940af03 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
cce5c1992a 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
923e754906 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
b78b4a3fe3 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
d554a723e9 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
0dfa4982e1 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
f8e75c3dc1 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
8f5767fb6f 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
30ae40026f 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
9eec100155 Backed out changeset 1ed5eea3a1e1 (bug 1892231) for causing mochitests failures in test_focus.xhtml. 2024-04-26 09:05:08 +03:00
Denis Palmeiro
b77357778c 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
2b5dc70e7d 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
88d6e87c9d Backed out changeset 28b2b5bfbed5 (bug 1885949) for causing http related mochitest failures CLOSED TREE 2024-04-17 19:32:37 +03:00
Malte Juergens
8f650f7866 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
46a31e3de5 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
08f3f6051f 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
e59fd12d73 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
6019fb9e6a 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
1edea30ba5 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
de09ab0dd6 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
ce5dc60809 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
4117054bb6 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
26e6e2df74 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
7a867184d3 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
80de9c4dac 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
dadf0fbdef 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
a6845cd22c 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
536f0daa27 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
16ac4d3300 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
9a4d6d56af 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