Commit Graph

1188 Commits

Author SHA1 Message Date
Tom Schuster
ae7f13512d Bug 1959727 - Add the sanitizer option to setHTMLUnsafe. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D247109
2025-05-08 05:55:30 +00:00
Cristian Tuns
1beaa4e22e Revert "Bug 1959727 - Add the sanitizer option to setHTMLUnsafe. r=emilio" for causing wpt failures in Document-parseHTMLUnsafe.html
This reverts commit 1faeaa00f5.

Revert "Bug 1959727 - Implement ShadowRoot.setHTML and share more code. r=emilio"

This reverts commit 3a84b03088.

Revert "Bug 1959727 - Add the sanitizer option to parseHTMLUnsafe. r=emilio" for causing wpt failures in Document-parseHTMLUnsafe.html

This reverts commit 17ced5ec89.
2025-05-08 01:11:56 +00:00
Tom Schuster
3a84b03088 Bug 1959727 - Implement ShadowRoot.setHTML and share more code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D247110
2025-05-07 22:16:51 +00:00
Tom Schuster
17ced5ec89 Bug 1959727 - Add the sanitizer option to parseHTMLUnsafe. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D247109
2025-05-07 22:16:47 +00:00
Atila Butkovits
da71eedf0a Revert "Bug 1932150 - Fix build bustage" for causing build bustages.
This reverts commit 0681b181d6.

Revert "Bug 1932150 - Fix lint failure" for causing Build bustage.

This reverts commit 60cc0878d3.

Revert "Bug 1932150 - Add new test cases for selection in flat tree r=smaug"

This reverts commit 3dbe5fc183.

Revert "Bug 1932150 - Make selection code to correctly iterate flattened tree r=smaug"

This reverts commit 6f7a1e4886.

Revert "Bug 1932150 - ContentSubtreeIterator #3: Fix a bug in ContentSubtreeIterator where the end container is in the light DOM of a shadow host r=jjaschke"

This reverts commit 19ce2c5806.

Revert "Bug 1932150 - ContentSubtreeIterator #2: Allow ContentSubtreeIterator to iterate nodes in flattened tree r=jjaschke"

This reverts commit d9d192bc3a.

Revert "Bug 1932150 - ContentSubtreeIterator #1: Make the end container related logic in ContentSubtreeIterator more robust r=jjaschke,smaug,dom-core"

This reverts commit 2fbde5b84d.

Revert "Bug 1932150 - Update ranges to correctly set and update nodes for flattened selection r=jjaschke,smaug,dom-core"

This reverts commit 116d26c37f.

Revert "Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core"

This reverts commit 2ba73e1639.

Revert "Bug 1932150 - Fix some inconsistency about indicating whether the selection is allowed to cross the shadow boundary r=jjaschke,dom-core"

This reverts commit 793c2453f1.
2025-05-07 18:30:42 +00:00
Sean Feng
2ba73e1639 Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D231588
2025-05-07 15:08:34 +00:00
Andreas Farre
d72145c63c Bug 1964671 - Fire download request navigate event. r=smaug
Download request navigate events are fired from
turn is called e.g from the activation behavior of a and area elements
in the case of a download attribute being present.

Also split nsContentUtils::TriggerLink into separate click and
mouse-over cases.

Differential Revision: https://phabricator.services.mozilla.com/D247903
2025-05-07 11:14:19 +00:00
Tom Schuster
761f25981c Bug 1963545 - Replace nsContentUtils::SpoofLocaleEnglish with ShouldResistFingerprinting(RFPTarget::JSLocale). r=fkilic
Differential Revision: https://phabricator.services.mozilla.com/D247246
2025-05-02 14:25:01 +00:00
Tom Schuster
edaa914b45 Bug 1947732 - Provide nsIPrincipal to GetTrustedTypesCompliantString. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D246424
2025-04-30 11:09:07 +00:00
Vincent Hilla
6af72126fa Bug 1356293 - Make touch and wheel events without non-passive listeners uncancelable. r=dom-core,edgar
According to the spec https://w3c.github.io/touch-events/#cancelability,
the touchstart, touchend and touchmove events should be uncancelable if
there are no non-passive listeners.

According to https://w3c.github.io/uievents/#cancelability-of-wheel-events,
this also holds for wheel events.

Differential Revision: https://phabricator.services.mozilla.com/D218199
2025-04-28 14:24:45 +00:00
Jonathan Kew
d5085e747b Bug 1957384 - Allow Unicode whitespace characters intervening between punctuation and letter in ::first-letter range. r=dshin
And allow multiple punctuation elements, with potential intervening whitespace,
both before and after the letter.

Tests to be added once https://github.com/web-platform-tests/wpt/pull/51361 is merged.

Differential Revision: https://phabricator.services.mozilla.com/D243674
2025-04-22 08:40:09 +00:00
Cristina Horotan
f349b08b9a Backed out changeset a59c7ce8c81e (bug 1957384) for causing reftest failures 2025-04-11 22:19:36 +03:00
Jonathan Kew
6338019d7b Bug 1957384 - Allow Unicode whitespace characters intervening between punctuation and letter in ::first-letter range. r=dshin
And allow multiple punctuation elements, with potential intervening whitespace,
both before and after the letter.

Tests to be added once https://github.com/web-platform-tests/wpt/pull/51361 is merged.

Differential Revision: https://phabricator.services.mozilla.com/D243674
2025-04-11 16:57:46 +00:00
Edgar Chen
82d780e44e Bug 1954685 - Unship onafterscriptexecute and onbeforescriptexecute events on Nightly; r=dom-core,webidl,saschanaz,devtools-reviewers,ochameau,hsivonen,jandem
Differential Revision: https://phabricator.services.mozilla.com/D241940
2025-03-31 19:10:02 +00:00
Emilio Cobos Álvarez
65f7282704 Bug 1947516 - Avoid unstable ordering in OwningElementRef comparisons. r=boris,smaug
Use shadow-dom aware ordering, and pick an order for disconnected elements
based on subtree root, because there's not too much useful things to do.

The spec should probably define what happens in those cases I guess...

That's not a useful order, mind you, but it prevents breaking the invariants
the sort algorithms rely on.

Change the comparison to return an int just because it's easier to debug.

Differential Revision: https://phabricator.services.mozilla.com/D237878
2025-03-25 12:14:03 +00:00
Dimi
f4df2a801c Bug 1928604 - P3. Make FormFillController to support textarea r=NeilDeakin,credential-management-reviewers,edgar
Depends on D240335

Differential Revision: https://phabricator.services.mozilla.com/D240337
2025-03-25 08:17:48 +00:00
Butkovits Atila
d85f8b4768 Backed out 4 changesets (bug 1928604) for causing bustages at nsFormFillController.cpp. CLOSED TREE
Backed out changeset 54c49c533ff8 (bug 1928604)
Backed out changeset 5ae41b722e12 (bug 1928604)
Backed out changeset 17a7695b985e (bug 1928604)
Backed out changeset 26743d6375e9 (bug 1928604)
2025-03-21 14:07:13 +02:00
Dimi
58b355e290 Bug 1928604 - P3. Make FormFillController to support textarea r=NeilDeakin,credential-management-reviewers,edgar
Differential Revision: https://phabricator.services.mozilla.com/D240337
2025-03-21 09:30:49 +00:00
Emilio Cobos Álvarez
2a07359ed7 Bug 1954552 - Implement PositionIsBefore in terms of CompareTreePosition. r=smaug,firefox-animation-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D241965
2025-03-19 20:54:08 +00:00
Emilio Cobos Álvarez
df3801a5f9 Bug 1954552 - Support passing a NodeIndexCache to CompareTreePosition. r=smaug
And use it in a couple places where it makes sense.

Differential Revision: https://phabricator.services.mozilla.com/D241964
2025-03-19 20:54:08 +00:00
Tom Schuster
7507c4ce14 Bug 1952250 - Implement the Sanitizer removeUnsafe method. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241071
2025-03-14 12:22:56 +00:00
pstanciu
27356d401d Backed out 4 changesets (bug 1952276, bug 1953720, bug 1952250) for causing build bustages
Backed out changeset a70b7694f15c (bug 1952250)
Backed out changeset aa124f6837c9 (bug 1953720)
Backed out changeset 7d1e8538f4ae (bug 1952250)
Backed out changeset 54b93f81594f (bug 1952276)
2025-03-14 12:47:03 +02:00
Tom Schuster
04410ddaa1 Bug 1952250 - Implement the Sanitizer removeUnsafe method. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241071
2025-03-14 08:57:34 +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
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
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
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
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
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
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
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
Frédéric Wang
776e152a71 Bug 1925952 - Implement attribute waitingforkey on audio/video elements. r=smaug
IDL attribute was added in bug 1304247 but we are missing corresponding
content attribute: https://w3c.github.io/encrypted-media/#attributes-3

Differential Revision: https://phabricator.services.mozilla.com/D226298
2024-10-22 22:33:56 +00:00
Tom Schuster
a8bd3c545f Bug 1917555 - Remove unused nsContentUtils::CanLoadImage method. r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D221438
2024-09-11 08:00:47 +00:00