Commit Graph

2121 Commits

Author SHA1 Message Date
Sean Feng
32e4783ab2 Bug 1897248 - Make GetCommonFlattenedTreeAncestorForSelection stop crashing when two contents are equal r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D211036
2024-05-21 15:29:18 +00:00
keithamus
dbce97da92 Bug 1888774 - make InvokeAction an enum, "auto" now implicit r=dom-core,sefeng
Only "custom" invoke actions (those with a dash) or well-defined built-in
actions can be defined. Auto action is now implicit from empty/null atom.

Differential Revision: https://phabricator.services.mozilla.com/D206182
2024-05-15 21:38:06 +00:00
Adam Vandolder
a47cef74ff Bug 1890428 - Add serialization support for Declarative Shadow DOM. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D206955
2024-05-15 16:40:21 +00:00
Tamas Szentpeteri
2b8d8ca135 Backed out 2 changesets (bug 1890428) for causing wpt failures on idlharness.https.html. CLOSED TREE
Backed out changeset 1954ce9669b8 (bug 1890428)
Backed out changeset 3e45e3d15eed (bug 1890428)
2024-05-15 11:19:46 +03:00
Adam Vandolder
a54c0a7578 Bug 1890428 - Add serialization support for Declarative Shadow DOM. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D206955
2024-05-15 03:01:19 +00:00
Cristian Tuns
badab1c1b7 Backed out 2 changesets (bug 1890428) for causing failures in idlharness.window.html?exclude=Node CLOSED TREE
Backed out changeset f9cf0740eef2 (bug 1890428)
Backed out changeset 37e2a10a9022 (bug 1890428)
2024-05-14 19:42:37 -04:00
Adam Vandolder
35af9c2203 Bug 1890428 - Add serialization support for Declarative Shadow DOM. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D206955
2024-05-14 16:43:28 +00:00
Emilio Cobos Álvarez
2808374848 Bug 1892257 - Move nsStringBuffer to mfbt. r=nika,xpcom-reviewers,glandium
Inline Create() and Realloc() so that we don't get negative leaks, since
were that code end up in mozglue, it wouldn't have access to the logging
machinery.

Differential Revision: https://phabricator.services.mozilla.com/D209663
2024-05-14 14:24:26 +00:00
Emilio Cobos Álvarez
85ab2ab799 Bug 1893683 - Remove ns{A,C}String and other xpcom dependencies from nsStringBuffer. r=smaug,media-playback-reviewers,karlt
* nsStringBuffer::FromString -> nsTSubString::GetStringBuffer
 * nsStringBuffer::ToString -> nsTSubString::Assign(nsStringBuffer*, len)
 * Move refcounting inline but refcount-logging and other XPCOM-related
   things out-of-line.

Differential Revision: https://phabricator.services.mozilla.com/D208771
2024-05-09 08:34:35 +00:00
Edgar Chen
d86554eb85 Bug 1781280 - Reuse IPCImage for IPCDataTransferImageContainer; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D208074
2024-04-22 19:09:47 +00:00
Edgar Chen
546880ae4d Bug 1867636 - Rename nsITransferable::requestingPrincipal; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D207272
2024-04-18 10:06:07 +00:00
Sean Feng
af64dc7f02 Bug 1881097 - Ensure nsContentUtils::IsPointInSelection works for point in selection that crosses the boundary r=smaug
Ths patch introduces a new class called `CrossShadowBoundaryRange` to
make cross shadow boundary range related stuff can be isolated into a
single class.

It also tweaks a few functions along the call stack, the goal here
is to make sure nsContentUtils::IsPointInSelection can detect points
in ShadowDOM selection.

There's an additional change to `SelectionUtils.sys.mjs` to make sure
the correct context menu items are displayed when the current selection
crosses the boundary.

Differential Revision: https://phabricator.services.mozilla.com/D204080
2024-04-15 13:09:08 +00:00
Masayuki Nakano
712be54db4 Bug 1890918 - Make ContentComparator::LessThan() check whether the content nodes are different before calling nsContentUtils::CompareTreePosition r=emilio
It seems that it's okay to remove `NS_WARN_IF` in
`nsContentUtils::CompareTreePosition`, but in theory, the comparator should
check it first to save the cost of calling the method.  Although it may be
optimized by the compiler.

Differential Revision: https://phabricator.services.mozilla.com/D207242
2024-04-11 23:53:08 +00:00
Jonathan Kew
ac182b0589 Bug 1888941 - Ensure any potential emergency-wrap positions are marked in nsTransformedTextRun instances. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206363
2024-04-04 17:44:27 +00:00
Sean Feng
4fb0ce5eeb Bug 1887963 - Fix a bug where the commonAncestor could be null when range boundaries are not in flat tree. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D205905
2024-04-03 20:15:40 +00:00
Adam Vandolder
ff13a04474 Bug 1876885 - Implement modified behaviour for doubly-attached declarative shadow roots. r=dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D200026
2024-03-18 15:36:56 +00:00
Jan-Niklas Jaeschke
f48048966b Bug 1881695: Implemented a new Cache to store the index of a node in a parent. r=smaug
This new cache implementation keeps the last N node/index combos in a stack-allocated array, which will be queried before calling nsINode::ComputeIndexOf().

Differential Revision: https://phabricator.services.mozilla.com/D203900
2024-03-11 19:02:11 +00:00
Natalia Csoregi
bda037520e Backed out changeset 37af5c6d011a (bug 1881695) for causing Bug 1884602 and Bug 1884601. CLOSED TREE 2024-03-11 10:47:07 +02:00
Jan-Niklas Jaeschke
9542d9c0d0 Bug 1881695: Implemented a new Cache to store the index of a node in a parent. r=smaug
This new cache implementation keeps the last N node/index combos in a stack-allocated array, which will be queried before calling nsINode::ComputeIndexOf().

Differential Revision: https://phabricator.services.mozilla.com/D203900
2024-03-09 11:13:55 +00:00
Cristina Horotan
a77498aaf0 Backed out changeset e72815765675 (bug 1881695) for causing Hazard failure at nsContentUtils.h 2024-03-07 23:47:13 +02:00
Jan-Niklas Jaeschke
4bc4c58c44 Bug 1881695: Implemented a new Cache to store the index of a node in a parent. r=smaug
This new cache implementation keeps the last N node/index combos in a stack-allocated array, which will be queried before calling nsINode::ComputeIndexOf().

Differential Revision: https://phabricator.services.mozilla.com/D203900
2024-03-07 16:57:16 +00:00
Narcis Beleuzu
0acdaa9355 Backed out changeset cc11e54ef4b1 (bug 1881695) for bustages on nsContentUtils.h 2024-03-07 18:01:44 +02:00
Jan-Niklas Jaeschke
7b6a9412e4 Bug 1881695: Implemented a new Cache to store the index of a node in a parent. r=smaug
This new cache implementation keeps the last N node/index combos in a stack-allocated array, which will be queried before calling nsINode::ComputeIndexOf().

Differential Revision: https://phabricator.services.mozilla.com/D203900
2024-03-07 15:14:06 +00:00
Adam Vandolder
f6565c9ebc Bug 1880188 - Add shadowrootclonable attribute support. r=webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D202357
2024-02-28 19:00:34 +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
Andrew McCreight
4203fbfd88 Bug 1880692, part 2 - Use an estimate for encoded characters. r=smaug
This makes the calculation simpler and faster, at a hopefully small
cost in space. Idea by peterv.

This reduced the time to run a microbenchmark locally by around 12%.

Differential Revision: https://phabricator.services.mozilla.com/D202281
2024-02-22 16:57:14 +00:00
Andrew McCreight
88c3e406d8 Bug 1880692, part 1 - Make StringBuilder::Unit::mLength specific to literals. r=smaug
That is the only case that uses it. This might save a bit of space
and avoids some useless stores. Idea by peterv.

Differential Revision: https://phabricator.services.mozilla.com/D202344
2024-02-22 16:57:13 +00:00
Adam Vandolder
6614d4bf45 Bug 1879921 - Fix failure caused by re-entry of SetHTMLUnsafe. r=peterv,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D202251
2024-02-21 16:11:04 +00:00
Emilio Cobos Álvarez
1df8c0453d Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 20:01:36 +00:00
Noemi Erli
1637a997a2 Backed out changeset 1acc95286189 (bug 1879579) for causing mass failures CLOSED TREE 2024-02-12 17:25:21 +02:00
Emilio Cobos Álvarez
97dc4d46da Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 00:01:23 +00:00
Adam Vandolder
b4f66cbdac Bug 1877025 - Make declarative shadow roots of custom elements available to element internals. r=peterv,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D200177
2024-02-06 18:38:40 +00:00
Narcis Beleuzu
30e52324c7 Backed out changeset b34477dd4ac2 (bug 1877025) for lint failure on shadow-dom/declarative/declarative-shadow-dom-available-to-element-internals.html . CLOSED TREE 2024-02-06 18:25:18 +02:00
Adam Vandolder
0aefcdfa0f Bug 1877025 - Make declarative shadow roots of custom elements available to element internals. r=peterv,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D200177
2024-02-06 15:48:52 +00:00
Benjamin VanderSloot
5618be732a Bug 1876275 - Reduce copies in nsContentUtils::IsURIInList for performance - r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D200633
2024-02-05 15:02:50 +00:00
Emilio Cobos Álvarez
679a43f9a1 Bug 1876702 - Remove unnecessary distinction between TYPE_FALLBACK and TYPE_NULL. r=smaug
The frame constructor always treats them the same nowadays
(TYPE_FALLBACK used to mean "show the pluginproblem code").

Differential Revision: https://phabricator.services.mozilla.com/D199719
2024-01-29 16:14:09 +00:00
Emilio Cobos Álvarez
a310b17d3f Bug 1875822 - Remove a bunch of dead JS plugin code. r=nika
Also bonus clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D199272
2024-01-25 21:02:21 +00:00
Emilio Cobos Álvarez
e10cc9b317 Bug 1875822 - Remove unused TYPE_FAKE_PLUGIN from nsObjectLoadingContent. r=dom-core,webidl,peterv,smaug
Bonus clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D199271
2024-01-25 18:41:16 +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
Tom Schuster
c39ac3e87f Bug 1875466 - Remove nsContentUtils::ResolveObjectType. r=emilio
Depends on D199113

Differential Revision: https://phabricator.services.mozilla.com/D199114
2024-01-22 14:26:10 +00:00
Tom Schuster
694c3e8534 Bug 1872839 - Remove aMimeTypeGuess parameter from nsIContentPolicy. r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D197794
2024-01-08 15:47:42 +00:00
Gregory Pappas
011ba89996 Bug 1870498 - Let WebExtension content scripts access getCoalescedEvents in non-secure contexts r=smaug,robwu
Differential Revision: https://phabricator.services.mozilla.com/D197255
2024-01-02 20:50:27 +00:00
Edgar Chen
3d56f815a9 Bug 1833172 - Remove unused data from PasteTransferable IPC; r=masayuki
The PasteTransferable IPC is used for sending the nsITransferable in paste
command to content process. And the nsITransferable in paste command is from
 - https://searchfox.org/mozilla-central/rev/eb07633057d66ab25f9db4c5900eeb6913da7579/widget/android/GeckoEditableSupport.cpp#1685
 - https://searchfox.org/mozilla-central/rev/eb07633057d66ab25f9db4c5900eeb6913da7579/widget/cocoa/nsChildView.mm#4528
 - or from nsIDOMWindowUtils::sendContentCommandEvent which is used for tests.

None of them have valid requesting principal and content policy type set.

Differential Revision: https://phabricator.services.mozilla.com/D195948
2023-12-20 13:18:23 +00:00
Tom Ritter
6fb74fab49 Bug 1851816: Pass PBM Status into RFPIsEnabledFor r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D192501
2023-12-18 18:39:33 +00:00
Chris H-C
d0af16fc99 Bug 1869004 - On Android submit 'use-counters' ping also around startup r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195933
2023-12-12 17:22:20 +00:00
Gregory Pappas
9110f4fa02 Bug 1868677 - Re-enable HTML fragment sanitization on about:newtab and about:home r=Gijs
In bug 1600941, HTML fragment sanitization was enabled in about: pages.
Sadly, it had to be disabled on about:newtab and about:home in bug 1609635
because remote snippets could contain arbitrarily placed anchor tags in
their content. Now that remote snippets are gone (bug 1715158), we can
re-enable HTML fragment sanitization on about:newtab and about:home!

Differential Revision: https://phabricator.services.mozilla.com/D195736
2023-12-08 04:35:36 +00:00
Adam Vandolder
b9bbd3c2cc Bug 1712140 - Part 3: Add support for parsing and building Declarative ShadowDOMs. r=dom-core,webidl,saschanaz,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D193675
2023-12-07 21:27:10 +00:00
Iulian Moraru
8d186a8450 Backed out 6 changesets (bug 1712140) for causing sanitizer failures on nsHtml5TreeBuilder.cpp. CLOSED TREE
Backed out changeset b374469160e9 (bug 1712140)
Backed out changeset dfc44cccff32 (bug 1712140)
Backed out changeset 3a35e1401130 (bug 1712140)
Backed out changeset a93481858c38 (bug 1712140)
Backed out changeset a861fd445f56 (bug 1712140)
Backed out changeset dc1dc389f2dc (bug 1712140)
2023-12-07 08:16:23 +02:00