Commit Graph

2222 Commits

Author SHA1 Message Date
Alex Franchuk
da658fa4b2 Bug 1942129 pt4 - Convert old shmem call sites to use the new shmem classes r=ipc-reviewers,media-playback-reviewers,padenot,lsalzman,aosmond,nika
While much of this is simply converting code (and removing extraneous
`size` parameters), toolkit/xre/GeckoArgs.{h,cpp} has some significant
changes to support sending read-only handles (which is all we need!).

Differential Revision: https://phabricator.services.mozilla.com/D236750
2025-03-04 22:11:12 +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
Butkovits Atila
2406ce261c Backed out 8 changesets (bug 1942129) for causing bustages at SharedMemoryMapping.h. CLOSED TREE
Backed out changeset 8d9053f1c203 (bug 1942129)
Backed out changeset 393e3c507c27 (bug 1942129)
Backed out changeset 8240d353d224 (bug 1942129)
Backed out changeset 8c4cd026b720 (bug 1942129)
Backed out changeset 742634b0d6e9 (bug 1942129)
Backed out changeset d16857f9812f (bug 1942129)
Backed out changeset 7ff7af041ee7 (bug 1942129)
Backed out changeset ef41d9e4c7de (bug 1942129)
2025-03-04 00:43:23 +02:00
Alex Franchuk
f7ee08eef3 Bug 1942129 pt4 - Convert old shmem call sites to use the new shmem classes r=ipc-reviewers,media-playback-reviewers,padenot,lsalzman,aosmond,nika
While much of this is simply converting code (and removing extraneous
`size` parameters), toolkit/xre/GeckoArgs.{h,cpp} has some significant
changes to support sending read-only handles (which is all we need!).

Differential Revision: https://phabricator.services.mozilla.com/D236750
2025-03-03 19:53:20 +00:00
Emilio Cobos Álvarez
2cc5638753 Bug 1951420 - Micro-optimize nsContentUtils::ContentIsHostIncludingDescendantOf. r=sefeng,dom-core
Avoid pointer-chasing the node type if we can find a parent, which is
the common case.

Differential Revision: https://phabricator.services.mozilla.com/D240172
2025-03-03 17:51:16 +00:00
Emilio Cobos Álvarez
fb77fe56ff Bug 1950631 - Add a few fast paths to CompareTreePosition that CompareDocumentPosition has. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D239762
2025-02-26 21:07:03 +00:00
Emilio Cobos Álvarez
87e0d13be7 Bug 1949893 - Paper over node comparison mid unbind. r=smaug
This restores the behavior but it is not great.

Differential Revision: https://phabricator.services.mozilla.com/D239316
2025-02-25 13:35:10 +00:00
Hiroyuki Ikezoe
b2869a6f87 Bug 1943597 - Add an optional Element in SendMouseEventOptions to make sendMozMouseHitTestEvent work for popups. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D236809
2025-02-14 02:26:55 +00:00
Norisz Fay
2ba59a28fb Backed out 6 changesets (bug 1943597) for causing Wd,bc process-crashes
Backed out changeset 198a709574b4 (bug 1943597)
Backed out changeset bed944b2f025 (bug 1943597)
Backed out changeset 6bf1e7b3c631 (bug 1943597)
Backed out changeset ef120d0f1555 (bug 1943597)
Backed out changeset a8d8fc79f935 (bug 1943597)
Backed out changeset d3daad7d905d (bug 1943597)
2025-02-13 13:14:26 +02:00
Hiroyuki Ikezoe
b42402eb4e Bug 1943597 - Add an optional Element in SendMouseEventOptions to make sendMozMouseHitTestEvent work for popups. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D236809
2025-02-13 08:26:02 +00:00
Alexandru Marc
4e77c545ce Backed out 6 changesets (bug 1943597) for causing bc failures @ browser_test_popup_menu_in_position_fixed.js CLOSED TREE
Backed out changeset e08b121d73a9 (bug 1943597)
Backed out changeset 805c841108cf (bug 1943597)
Backed out changeset 4ab954f5a0e7 (bug 1943597)
Backed out changeset 58dded9a06f8 (bug 1943597)
Backed out changeset fabc3f833a51 (bug 1943597)
Backed out changeset 77607ad7a2c2 (bug 1943597)
2025-02-12 09:03:24 +02:00
Hiroyuki Ikezoe
dde7fb6f9e Bug 1943597 - Add an optional Element in SendMouseEventOptions to make sendMozMouseHitTestEvent work for popups. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D236809
2025-02-12 05:30:31 +00:00
Masayuki Nakano
da4abce2d9 Bug 1945714 - Rename RangeBoundaryBase::Container() to GetContainer() r=jjaschke,dom-core
Usually, we name methods as `GetFoo()` if they may return `nullptr`, on the
other hand, we name methods as `Foo()` if they won't return `nullptr`.

`RangeBoundaryBase::Container()` may return `nullptr`.  So, this name may cause
misleading of some developers.  Let's rename it as `GetContainer()`.

This does not change anything for avoiding merge conflict with the other
landings.

Differential Revision: https://phabricator.services.mozilla.com/D236796
2025-02-10 01:29:40 +00:00
Masayuki Nakano
01bac70fb9 Bug 1945711 - part 4: Rename the aParent/aOffset version of nsContentUtils::ComparePoints to ComparePointsWithIndices r=jjaschke,dom-core
To make it easier to find the callers, we should give different name instead
of overloading.

Differential Revision: https://phabricator.services.mozilla.com/D236794
2025-02-10 01:29:40 +00:00
Masayuki Nakano
e595f1e9aa Bug 1945711 - part 3: Make some callers of nsContentUtils::ComparePoints use the RangeBoundaryBase version r=jjaschke,dom-core
There are some callers of parent/offset version which computes offset before.
However, the offset may not be used.  Therefore, the callers should use
`RangeBoundaryBase` version.

Additionally, if only one of the pairs is computed from `RangeBoundaryBase`,
such callers should use the `RangeBoundaryBase` version too because the offset
computation may be skipped.  In this case, temporary `RangeBoundaryBase` should
be a `RawRangeBoundary` and whose `aRangeIsMutationObserver` should be set to
`RangeBoundaryIsMutationObserved::No` to avoid immediately to compute the child
node from `aOffset`.  I think that this should be default to
`RangeBoundaryIsMutationObserved::No` in the future, but for now, we should just
make the users explicitly set it to `RangeBoundaryIsMutationObserved::No` for
avoiding regressions.

Differential Revision: https://phabricator.services.mozilla.com/D236793
2025-02-10 01:29:39 +00:00
Masayuki Nakano
cdc2c516ae Bug 1945711 - part 2: Get rid of nsContentUtils::ComparePoints_Deprecated r=jjaschke,dom-core
All their users should use the newer one which does not have the out-param
for "disconnected" case and indicates that with `Nothing` of `Maybe`.

Differential Revision: https://phabricator.services.mozilla.com/D236792
2025-02-10 01:29:39 +00:00
Masayuki Nakano
58081ead33 Bug 1945711 - part 1: Make nsContentUtils::ComparePoints compare child nodes without computing offset if it's reasonable r=jjaschke,dom-core
The `RangeBoundaryBase` version of `nsContentUtils::ComparePoints_Deprecated()`
calls the parent/offset pair version of it with computing the offsets.
However, the offset is used only when the parent node is the closest common
ancestor.  Therefore, the offset may be unnecessary in a lot of cases, but
we pay expensive cost to compute the unnecessary index.

This patch creates a utility class, `CommonAncestors` for computing common
ancestors and children of the closest common ancestor, and creates 3 methods
which compare a child node and offset or another (or same) child node without
computing index of the given child node if it's possible and reasonable.

So, in the advantageous situations, this makes the comparison faster.  However,
the case is not so many according to the benchmark results.

Differential Revision: https://phabricator.services.mozilla.com/D236791
2025-02-10 01:29:38 +00:00
Emilio Cobos Álvarez
859d47914c Bug 1946399 - Deal with all anon kids in CompareTreePosition. r=smaug
Otherwise we might not have the right ordering guarantees.

Differential Revision: https://phabricator.services.mozilla.com/D237212
2025-02-07 17:37:33 +00:00
Fatih Kilic
58fd0bcfac Bug 1922093: Check ContentBlockingAllowList in CookieJarSettings::Create(nsIPrincipal*). r=tjr,valentin,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D224358
2025-01-27 18:06:23 +00:00
Masayuki Nakano
4e6fcb1183 Bug 1943228 - Rename methods GetSomethingWithoutCreation() to GetExtantSomething() r=edgar,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D235256
2025-01-23 23:47:28 +00:00
Emilio Cobos Álvarez
3198f0989e Bug 1940412 - Remove children from the back in unobservable SetNodeTextContent code-path. r=dom-core,sefeng
See bug. This path is not observable by mutation observers so we can do
this.

Differential Revision: https://phabricator.services.mozilla.com/D233546
2025-01-13 12:55:36 +00:00
Emilio Cobos Álvarez
981aa4c547 Bug 1940412 - Add nsINode::RemoveAllChildren, and use it in relevant places. r=dom-core,sefeng
This is in preparation for passing more information about this kind of
mutation down for optimization purposes, see bug comments.

Differential Revision: https://phabricator.services.mozilla.com/D233545
2025-01-09 23:22:37 +00:00
Hiroyuki Ikezoe
226a634183 Bug 1938265 - Move PreventDefaultResult into APZCallbackHelper.h. r=masayuki
And revert some of relevant changes what we did in DOM code [1].

[1] https://hg.mozilla.org/integration/autoland/rev/2cdf4ddd5141

Differential Revision: https://phabricator.services.mozilla.com/D232881
2025-01-07 00:32:07 +00:00
Frédéric Wang
9ef2f97e49 Bug 1939802: nsContentUtils::SetHTMLUnsafe: Remove superflous whitespace from sink names. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D233139
2025-01-03 20:54:01 +00:00
smayya
02902b6414 Bug 1830022 - add Idempotency-Key header to post request. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D227801
2024-12-13 23:39:50 +00:00
Norisz Fay
7a512577e9 Backed out 3 changesets (bug 1830022) for causing Wd assertion failures on nsHttpChannel.cpp
Backed out changeset 0e63fe79ee46 (bug 1830022)
Backed out changeset 8eac77ee30b8 (bug 1830022)
Backed out changeset 1c2d7061c4c1 (bug 1830022)
2024-12-13 02:42:34 +02:00
smayya
eaba74b348 Bug 1830022 - add Idempotency-Key header to post request. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D227801
2024-12-12 20:14:49 +00:00
Jonatan Klemets
d60f6391b3 Bug 1858078 - Part 1: Add nsIContentPolicy::{TYPE_JSON,TYPE_INTERNAL_JSON_PRELOAD} r=extension-reviewers,webidl,devtools-reviewers,dom-core,smaug,robwu,tschuster,nchevobbe,farre
Differential Revision: https://phabricator.services.mozilla.com/D229524
2024-12-12 17:39:18 +00:00
Stanca Serban
db7f01b4f8 Backed out 3 changesets (bug 1830022) for causing multiple failures. CLOSED TREE
Backed out changeset e3b4f68850a3 (bug 1830022)
Backed out changeset 1418de170250 (bug 1830022)
Backed out changeset 046fbeb93400 (bug 1830022)
2024-12-12 12:36:12 +02:00
smayya
e5361438a1 Bug 1830022 - add Idempotency-Key header to post request. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D227801
2024-12-12 08:55:31 +00:00
Timothy Nikkel
954d9f6331 Bug 1934164. Remove unused scroll grab code. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D230635
2024-12-05 12:05:38 +00:00
Frédéric Wang
3bc91f6fe5 Bug 1931276 - Implement Trusted Types support for Element/ShadowRoot's setHTMLUnsafe(). r=smaug,dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D229136
2024-11-29 10:09:57 +00:00
Emilio Cobos Álvarez
feebe3d11d Bug 1930292 - Turn chromemargin into a boolean attribute. r=win-reviewers,desktop-theme-reviewers,pip-reviewers,firefox-desktop-core-reviewers ,dao,mconley,rkraesig
There are probably other simplifications that can be done after this on the
windows side of things, but I tried to keep this minimal.

Differential Revision: https://phabricator.services.mozilla.com/D229765
2024-11-28 12:12:50 +00:00
Cristina Horotan
bb08cc9f1d Backed out 5 changesets (bug 1930292, bug 1932600) for causing chrome failures at test_maximized_persist.xhtml on a CLOSED TREE
Backed out changeset 2418bfee53f1 (bug 1932600)
Backed out changeset 3297e990715a (bug 1932600)
Backed out changeset 24a670dea977 (bug 1930292)
Backed out changeset 7dd9f48216dd (bug 1930292)
Backed out changeset 15a85ec739dd (bug 1930292)
2024-11-28 06:57:35 +02:00
Emilio Cobos Álvarez
67678746e6 Bug 1930292 - Turn chromemargin into a boolean attribute. r=win-reviewers,desktop-theme-reviewers,pip-reviewers,firefox-desktop-core-reviewers ,dao,mconley,rkraesig
There are probably other simplifications that can be done after this on the
windows side of things, but I tried to keep this minimal.

Differential Revision: https://phabricator.services.mozilla.com/D229765
2024-11-28 03:26:50 +00:00
Oliver Medhurst
55e56cc12f Bug 1879820 - Consume user activation when clicking link opens a new window; r=smaug,zcorpan
Differential Revision: https://phabricator.services.mozilla.com/D201373
2024-11-19 08:19:04 +00:00
Emilio Cobos Álvarez
11a8b7baf2 Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-14 10:17:52 +00:00
Butkovits Atila
3616798bb1 Backed out changeset cb8acf4c8893 (bug 1914321) for causing failures at browser_markup_search_01.js. CLOSED TREE 2024-11-14 02:42:39 +02:00
Emilio Cobos Álvarez
f475361154 Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-13 22:11:58 +00:00
Butkovits Atila
6ae954d86e Backed out changeset 4fc43467210b (bug 1914321) for causing failures at PresShell.cpp. CLOSED TREE 2024-11-13 21:24:29 +02:00
Emilio Cobos Álvarez
3f41e0c52d Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-13 18:06:34 +00:00
Andreas Farre
f5d70ba842 Bug 1724924 - Disallow displaying PDFs in sandboxed iframes. r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D227826
2024-11-13 09:42:06 +00:00
Emilio Cobos Álvarez
30929e04af Bug 1930476 - Improve units in nsFrameLoader and related code. r=geckoview-reviewers,jwatt,ohall
Use LayoutDevice units for most these things, since it's what they are:

  ScreenIntSize(presContext->AppUnitsToDevPixels(size.width), ...

Is clearly a lie :)

Differential Revision: https://phabricator.services.mozilla.com/D228586
2024-11-12 15:16:50 +00:00
Timothy Nikkel
657c5b6cc5 Bug 1863046. Remove redundant nsContentUtils::IsInPrivateBrowsing (it's also slow). r=tjr,media-playback-reviewers,anti-tracking-reviewers,karlt,pbz
Those query interfaces on image load show up in profiles, eg it's about 0.05% of total time of the NewsSite test on sp3.

Differential Revision: https://phabricator.services.mozilla.com/D192726
2024-11-08 10:11:13 +00:00
Fatih
267c85c60c Bug 1924087: Check language spoofing in SVG's switch element. r=tjr,longsonr
Differential Revision: https://phabricator.services.mozilla.com/D225358
2024-11-07 12:58:10 +00:00
longsonr
843d861ed7 Bug 1929338 - convert more mozilla:clamped to std:clamp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228069
2024-11-05 18:52:41 +00:00
Alexandru Marc
0765edc157 Backed out changeset e374514be19b (bug 1863046) for causing Bug 1863046 . CLOSED TREE 2024-11-05 14:49:01 +02:00
Timothy Nikkel
72a73550dd Bug 1863046. Remove redundant nsContentUtils::IsInPrivateBrowsing (it's also slow). r=tjr,media-playback-reviewers,anti-tracking-reviewers,karlt,pbz
Those query interfaces on image load show up in profiles, eg it's about 0.05% of total time of the NewsSite test on sp3.

Differential Revision: https://phabricator.services.mozilla.com/D192726
2024-11-05 01:53:54 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00