2275 Commits

Author SHA1 Message Date
Kagami Sascha Rosylight
85d13ee19d Bug 1967520 - Add WindowMediatorFilter r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D250305
2025-05-23 16:37:28 +00:00
Emilio Cobos Álvarez
8ff4a65ffa Bug 1967507 - Simplify custom content container set-up. r=smaug,devtools-reviewers,nchevobbe
I haven't been able to reproduce this locally, but I see what's going
on, and I think we could do better.

This avoids the frame flush from nsCanvasFrame::CreateAnonymousContent,
and in general makes the anonymous content timing a lot more reasonable
(see the FlushPendingNotifications call that's getting removed).

The ServoStyleSet changes are needed now that there are multiple style
roots that can be unstyled like that.

It also simplifies the API as now it's not dependent on having a canvas
frame around (and thus doesn't need to flush layout).

Differential Revision: https://phabricator.services.mozilla.com/D250531
2025-05-22 13:06:12 +00:00
Sean Feng
71756fd1bc Bug 1966466 - Fix the strict weak order crash introduced by flattened tree selection r=jjaschke,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D249653
2025-05-20 14:49:54 +00:00
Alexandru Marc
43acd12a3b Revert "Bug 1955685 - Improve cookie validation - part 7 - Fix existing tests, r=valentin,webdriver-reviewers,extension-reviewers,settings-reviewers,devtools-reviewers,cookie-reviewers,sessionstore-reviewers,migration-reviewers,backup-reviewers,sthompson,robwu,ochameau" for causing multiple failures
This reverts commit 585626d8fc.

Revert "Bug 1955685 - Improve cookie validation - part 6 - CookieValidation for web-ext, r=robwu,cookie-reviewers,valentin"

This reverts commit b38d308433.

Revert "Bug 1955685 - Improve cookie validation - part 5 - 0x20 as invalid chars for cookie names and values r=valentin,cookie-reviewers"

This reverts commit 3578880f65.

Revert "Bug 1955685 - Improve cookie validation - part 4 - expiry validation, r=edgul,cookie-reviewers,valentin"

This reverts commit 26e16d402f.

Revert "Bug 1955685 - Improve cookie validation - part 3 - nsICookieValidation in cookieManager.add, r=edgul,extension-reviewers,settings-reviewers,search-reviewers,devtools-reviewers,cookie-reviewers,sessionstore-reviewers,backup-reviewers,nchevobbe,mconley,Standard8,webdriver-reviewers,whimboo,valentin,sfoster,robwu"

This reverts commit 433a4d736d.

Revert "Bug 1955685 - Improve cookie validation - part 2 - nsICookieValidation in cookieManager.addNative, r=edgul,cookie-reviewers,geckoview-reviewers,nalexander,glandium"

This reverts commit 818c2c1769.

Revert "Bug 1955685 - Improve cookie validation - part 1 - nsICookieValidation, r=edgul,cookie-reviewers"

This reverts commit 55ad680779.
2025-05-20 09:31:40 +00:00
Andrea Marchesini
818c2c1769 Bug 1955685 - Improve cookie validation - part 2 - nsICookieValidation in cookieManager.addNative, r=edgul,cookie-reviewers,geckoview-reviewers,nalexander,glandium
Differential Revision: https://phabricator.services.mozilla.com/D244895
2025-05-20 08:01:59 +00:00
Sean Feng
97c334db09 Bug 1966135 - Allow CompareChildOffsetAndChildNode to do flattened tree comparison r=jjaschke,dom-core
If the element is slotted and the aKind == TreeKind::Flat, it should
use the index of AssignedNodes of the slot element to do the
comparison.

Differential Revision: https://phabricator.services.mozilla.com/D249427
2025-05-16 16:04:51 +00:00
Sean Feng
ebb4c0813e Bug 1966135 - Make CompareToRange{Start|End} explicit about the ordering r=jjaschke,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D249426
2025-05-16 16:04:47 +00:00
Sean Feng
59893c42dc 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-09 18:19:00 +00:00
Serban Stanca
5691c4beb2 Revert "Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core"
This reverts commit 8d55fdef16.
2025-05-08 20:00:31 +00:00
Sean Feng
8d55fdef16 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-08 13:40:01 +00:00
Tom Schuster
cd9b0be71c Bug 1959727 - Implement ShadowRoot.setHTML and share more code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D247110
2025-05-08 05:55:33 +00:00
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
Jan-Niklas Jaeschke
b3debf824d Bug 1963845 - Use Span for EnumTable. r=emilio,smaug
This patch makes the usage of `EnumTable`s safer
by using `Span`s instead of relying on an empty
element at the end.
Also the name has been changed from `EnumTable`
to `EnumTableEntry` to be more precise.

Differential Revision: https://phabricator.services.mozilla.com/D247453
2025-05-06 08:28:23 +00:00
pstanciu
7d79502fbe Revert "Bug 1963845 - Use Span for EnumTable. r=emilio,smaug" for Build Bustages on HTMLSharedListElement.cpp
This reverts commit eebbccf7b9.
2025-05-05 13:48:07 +00:00
Jan-Niklas Jaeschke
eebbccf7b9 Bug 1963845 - Use Span for EnumTable. r=emilio,smaug
This patch makes the usage of `EnumTable`s safer
by using `Span`s instead of relying on an empty
element at the end.
Also the name has been changed from `EnumTable`
to `EnumTableEntry` to be more precise.

Differential Revision: https://phabricator.services.mozilla.com/D247453
2025-05-05 12:49:25 +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
Boris Chiou
6167f461bd Bug 1922299 - Add ::-moz-snapshot-containing-block to wrap the view transition pseudo element tree. r=view-transitions-reviewers,emilio
We introduce `::-moz-snapshot-containing-block` pseudo-element to wrap
the view transition pseudo-element tree. This pseudo-element is only for
internal usage and cannot be accessed from outside.

Note that the related wpt,
`snapshot-containing-block-static.html`
`snapshot-containing-block-absolute.html`
are still failed because of Bug 1960755.

Also, add a test to check the snapshot containing block in the iframe,
and avoid hitting the issue of Bug 1960755.

There is no better way to verify that we do establish the fixed
positioning containing block, because it's unlikely to make the size of the
snapshot containing block be different from the viewport size on desktop
(note: this pseudo-element doesn't expose to the web), so I verified this
patch by changing the size of snapshot containing block manually in the UA
stylesheet, to see if it establish the fixed positioning containing block.

Differential Revision: https://phabricator.services.mozilla.com/D245648
2025-05-01 02:29:10 +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
Kagami Sascha Rosylight
bbc18cbf9e Bug 1957934 - Part 2: Rename FormDataValue to IPCFormDataValue r=webidl,smaug
This name collides with the same-named Web IDL union type.

Differential Revision: https://phabricator.services.mozilla.com/D244386
2025-04-29 14:28:50 +00:00
smolnar
0bebc8845c Backed out 1 changesets (bug 1957934) for causing win build bustages. CLOSED TREE
Backed out changeset 90524890ff3a (bug 1957934)
2025-04-30 00:57:16 +03:00
Kagami Sascha Rosylight
ed35cd49e1 Bug 1957934 - Part 2: Rename FormDataValue to IPCFormDataValue r=webidl,smaug
This name collides with the same-named Web IDL union type.

Differential Revision: https://phabricator.services.mozilla.com/D244386
2025-04-29 14:28:50 +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
Tom Schuster
88eb91346d Bug 1941347 - Escape "<" and ">" in attributes when serializing HTML. r=dom-core,devtools-reviewers,nchevobbe,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D243769
2025-04-23 09:19:02 +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
Tom Schuster
020bae66d9 Bug 1960678 - Make DocumentFlavor an enum class. r=emilio,necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D245599
2025-04-16 07:42:49 +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
Emilio Cobos Álvarez
079db7104d Bug 1856674 - Make GenerateStateKey deal with shadow DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D244633
2025-04-07 20:16:50 +00:00
Fatih Kilic
60a57c0757 Bug 1954188: bFPP Part 7 - Force refresh RTPCallerType on pref change. r=tjr
Now that we have some sort of fingerprinting protection enabled all the time, [`changed`](https://searchfox.org/mozilla-central/rev/3a0ca3dffd7ccf74a53066a097739f24dd8b6b10/dom/base/Document.cpp#17010-17015) isn't true when you enable/disable FPP or RFP. The way to trigger it would be also enabling/disabling bFPP with FPP or RFP in the tests, but instead forcing a RFP caller type refresh makes more sense, and is less hacky (but if anyone disagrees, we can also do the disabling/enabling bFPP with the tests)

Differential Revision: https://phabricator.services.mozilla.com/D242787
2025-04-03 17:30:19 +00:00
Fatih Kilic
b0162ee293 Bug 1954188: bFPP Part 1 - Implement globally enabled base and aggressive fingerprinting protections. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D241850
2025-04-03 17:30:18 +00:00
Cristina Horotan
b163893208 Backed out 7 changesets (bug 1954188) for causing bc failures at browser_preferences_usage.js
Backed out changeset dae6e2ec0b2d (bug 1954188)
Backed out changeset 47f683e9f0d6 (bug 1954188)
Backed out changeset 14ed1c70e1ec (bug 1954188)
Backed out changeset 291590143ed9 (bug 1954188)
Backed out changeset fbb4e968f0f1 (bug 1954188)
Backed out changeset 4c21e081561e (bug 1954188)
Backed out changeset 33e6088d8317 (bug 1954188)
2025-04-03 03:21:46 +03:00
Fatih Kilic
9302a00ffe Bug 1954188: bFPP Part 7 - Force refresh RTPCallerType on pref change. r=tjr
Now that we have some sort of fingerprinting protection enabled all the time, [`changed`](https://searchfox.org/mozilla-central/rev/3a0ca3dffd7ccf74a53066a097739f24dd8b6b10/dom/base/Document.cpp#17010-17015) isn't true when you enable/disable FPP or RFP. The way to trigger it would be also enabling/disabling bFPP with FPP or RFP in the tests, but instead forcing a RFP caller type refresh makes more sense, and is less hacky (but if anyone disagrees, we can also do the disabling/enabling bFPP with the tests)

Differential Revision: https://phabricator.services.mozilla.com/D242787
2025-04-02 17:26:36 +00:00
Fatih Kilic
cf094c69fe Bug 1954188: bFPP Part 1 - Implement globally enabled base and aggressive fingerprinting protections. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D241850
2025-04-02 17:26:35 +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
Jeff Muizelaar
65376991a7 Bug 1948177 - Add a flow marker for blocked script runners. r=dom-core,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D238149
2025-03-31 15:53:29 +00:00
kernp25
4d18975ff5 Bug 1945924 - Replace SchemeIsFoo functions with the inlined SchemeIs() call. r=valentin,emilio,necko-reviewers,geckoview-reviewers,anti-tracking-reviewers,core-sessionstore-reviewers,ohall,farre
No behavior change intended.

Differential Revision: https://phabricator.services.mozilla.com/D236756
2025-03-31 14:25:54 +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
Emilio Cobos Álvarez
3618e5ed50 Bug 1955591 - Make LookAndFeel APIs safe to call off the main thread. r=jfkthame
Make IntID::AlertNotificationOrigin not terribly slow on windows, since
that's the only thing we had a carveout for avoid querying on startup:

 * Modern windows doesn't let you move the taskbar to a separate side.
 * Even with that, on a multi-monitor setup there are multiple taskbars.
 * More importantly, even with that, now we have native notifications by
   default, so this is less important (this is only useful for the
   non-native alerts).

Avoid GTK CRITICALs and crashes when calling into LookAndFeel from
XPCShell, which now happens.

Differential Revision: https://phabricator.services.mozilla.com/D242566
2025-03-22 03:24:00 +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