1103 Commits

Author SHA1 Message Date
serge-sans-paille
bf3516e81e Bug 1964489 - Avoid duplication in NS_DECLARE_STATIC_IID_ACCESSOR / NS_DEFINE_STATIC_IID_ACCESSOR r=nika,necko-reviewers,media-playback-reviewers,places-reviewers,win-reviewers,dom-storage-reviewers,xpcom-reviewers,gstoll,janv,emilio,padenot,valentin,asuth
In modern C++, static constexpr member variables are automatically
inline (aka weak) so the template trick is not needed. This also avoid
duplication and reduces the amount of parsed code. No impact on
generated binary (actually: smaller debuginfo, close to identical
binary).

Differential Revision: https://phabricator.services.mozilla.com/D247825
2025-05-08 08:05:51 +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
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
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
8487400e45 Bug 1947732 - Provide nsIPrincipal to GetTrustedTypesCompliantAttributeValue. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D246745
2025-04-30 11:09:08 +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
longsonr
e69829766c Bug 1847712 - support fetchpriority for SVG image, feImage and script elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D246863
2025-04-29 03:35:00 +00:00
Goloman Adrian
8262016029 Backed out changeset 63b702867240 (bug 1847712) for causing wpt failures @ttr-image-fetchpriority.html. CLOSED TREE 2025-04-28 12:41:32 +03:00
longsonr
ef3debc812 Bug 1847712 - support fetchpriority for SVG image, feImage and script elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D246863
2025-04-28 08:19:38 +00:00
Masayuki Nakano
6fb3e56ba6 Bug 1961318 - Make PointerEventHandler::UpdateActivePointerState register synthesized mouse info if there is not r=edgar,dom-core
Despite the name, `sActivePointersIds` is a list of all pointers which is either
active or inactive.

`Element::SetPointerCapture` checks whether the given `pointerId` is known one
or not.  However, we register mouse pointer when entering over the document
and unregister it when leaving from the document.

However, they are handled when `eMouseEnterIntoWidget` and
`eMouseExitFromWidget` are fired, however, they are not fired automatically
if the mouse events are synthesized on a document which does not contain the
system cursor position.

So, we need to make the method register the `PointerInfo` when
`EventStateManager` receives `eMouseOver` or `ePointerMove` which is caused only
by mouse.

For making any `PointerEventHandler::GetPointerInfo()` callers can distinguish
whether the pointer is registered or updated by a synthesized mouse events,
`PointerInfo` should have the information as a `bool` member.

Differential Revision: https://phabricator.services.mozilla.com/D246027
2025-04-26 06:13:25 +00:00
Alexandru Marc
97c99ebc6d Backed out changeset caa8ce8bc2e9 (bug 1961318) for causing build bustages @ PointerEventHandler.cpp CLOSED TREE 2025-04-25 09:35:52 +03:00
Masayuki Nakano
27bccee9ae Bug 1961318 - Make PointerEventHandler::UpdateActivePointerState register synthesized mouse info if there is not r=edgar,dom-core
Despite the name, `sActivePointersIds` is a list of all pointers which is either
active or inactive.

`Element::SetPointerCapture` checks whether the given `pointerId` is known one
or not.  However, we register mouse pointer when entering over the document
and unregister it when leaving from the document.

However, they are handled when `eMouseEnterIntoWidget` and
`eMouseExitFromWidget` are fired, however, they are not fired automatically
if the mouse events are synthesized on a document which does not contain the
system cursor position.

So, we need to make the method register the `PointerInfo` when
`EventStateManager` receives `eMouseOver` or `ePointerMove` which is caused only
by mouse.

For making any `PointerEventHandler::GetPointerInfo()` callers can distinguish
whether the pointer is registered or updated by a synthesized mouse events,
`PointerInfo` should have the information as a `bool` member.

Differential Revision: https://phabricator.services.mozilla.com/D246027
2025-04-25 05:48:22 +00:00
Emilio Cobos Álvarez
e94e1dd416 Bug 1960473 - Update content relevancy only once per tick. r=fredw
Otherwise we can end up with dirty frames at the end of a flush. This
doesn't fix bug 1958522 (I think we need either height: fit-content to
work, or IntersectionObserver.scrollMargin). But matches the HTML spec:

> The intent of this step is for the initial viewport proximity
> determination, which takes effect immediately, to be reflected in the
> style and layout calculation which is carried out in a previous step of
> this loop. Proximity determinations other than the initial one take
> effect at the next rendering opportunity.

Differential Revision: https://phabricator.services.mozilla.com/D245489
2025-04-21 11:08:27 +00:00
Tom Schuster
bdc45a47aa Bug 1959725 - Implement Document.parseHTML. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D245705
2025-04-16 13:52:29 +00:00
Tom Schuster
74c1e0dbaa Bug 1959678 - Sanitizer: Update handling of comments/dataAttributes in (default) config. r=emilio
This implements:
https://github.com/WICG/sanitizer-api/pull/254
https://github.com/WICG/sanitizer-api/pull/284

Differential Revision: https://phabricator.services.mozilla.com/D245067
2025-04-10 15:04:06 +00:00
Jan-Niklas Jaeschke
55155aeb3d Bug 1761043, part 4 - hidden=until-found: Implement reveal algorithm and the beforematch event. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241450
2025-04-02 08:22:47 +00:00
Tom Schuster
06920243ef Bug 1956310 - Sanitizer: Parse as HTML even in XML documents. r=emilio
Implements https://github.com/WICG/sanitizer-api/pull/276

Differential Revision: https://phabricator.services.mozilla.com/D243108
2025-03-31 08:07:26 +00:00
Tom Schuster
f269ef0615 Bug 1953720 - In SetHTML create the inert document by inherting from the current document. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241363
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
f6239c2706 Bug 1953720 - In SetHTML create the inert document by inherting from the current document. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241363
2025-03-14 08:57:35 +00:00
Tom Schuster
99e27e3f3a Bug 1953356 - Update Element setHTML. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241175
2025-03-12 13:22:47 +00:00
Tom Schuster
3a0a0b59d4 Bug 1950605 - Sanitizer: Implement most of the sanitize algorithm. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D240019
2025-03-05 16:36:24 +00:00
Jonathan Kew
6ab1148377 Bug 1789464 - Resolve logical axes in PresShell::ScrollFrameIntoView according to the target's writing mode. r=emilio,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D239516
2025-02-26 07:35:33 +00:00
Cristina Horotan
02ec389420 Backed out changeset 68a1543cecb8 (bug 1789464) for causing Wr failures at massive-element-left-of-viewport-partially-onscreen-new.html 2025-02-26 06:17:58 +02:00
Jonathan Kew
b56aae5bc5 Bug 1789464 - Resolve logical axes in PresShell::ScrollFrameIntoView according to the target's writing mode. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D239516
2025-02-25 17:12:58 +00:00
Tom Schuster
ecd1f97654 Bug 1948896 - Update the Sanitizer WebIDL. r=freddyb,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D238613
2025-02-24 11:28:29 +00:00
Emilio Cobos Álvarez
ecc0677523 Bug 1947961 - Implement basic "update pseudo-element styles" steps. r=view-transitions-reviewers,boris
Pretty bare bones (some properties missing), but this allows the
transition pseudo-elements to be in the right place.

We need to implement live capturing / integrate nical's work to display
the "new" image properly, but we'll get to that. Meanwhile this should
be uncontroversial.

Differential Revision: https://phabricator.services.mozilla.com/D238005
2025-02-14 07:50:18 +00:00
Frédéric Wang
fd4d501294 Bug 1944511 Implement remaining Trusted Type support for attribute changes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D236107
2025-02-14 06:49:12 +00:00
Nicolas Chevobbe
9df8db8f22 Bug 1934619 - Make Element::GetElementsWithGrid go through display: contents elements. r=layout-reviewers,emilio.
Differential Revision: https://phabricator.services.mozilla.com/D230799
2025-02-11 06:45:49 +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
Boris Chiou
c873020ab9 Bug 1921109 - Support {Element|DocumentOrShadowRoot}.getAnimations({subtree: true}) for view-transitions. r=view-transitions-reviewers,emilio
There are two reasons we cannot use the original version of
pseudo-element-animaiton.html:
1. Our finished promise is never resolved (Bug 1914322).
2. We haven't imported the UA stylesheet (Bug 1914323, Bug 1914324).

So I need to write a new test based on our current implementation, and
rename the original pseudo-element-animations.html as
pseudo-element-animations-rerun.html.

Differential Revision: https://phabricator.services.mozilla.com/D231345
2025-01-21 22:38: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
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
Eitan Isaacson
22d305c374 Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-11-29 03:26:35 +00:00
Eitan Isaacson
fe237f4955 Bug 1769586 - P1: Implement ARIA element reflection in Element and ElementInternals. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D209767
2024-11-29 03:26:34 +00:00
Boris Chiou
20caebdd21 Bug 1919347 - Fix Element::GetPseudoElement() to retrieve the computed style from the pseudo-element direcly. r=view-transitions-reviewers,emilio
In order to retrieve the current computed style, we have to look up the
view transition pseudo-element. This patch focus on the search code
mainly.

Note that it's unfortunate we cannot pass the wpt,
css/css-view-transitions/pseudo-get-computed-style.html,
because there is a JS error when running this test, and the static UA
stylesheet hasn't been imported yet.

Differential Revision: https://phabricator.services.mozilla.com/D230459
2024-11-28 22:19:46 +00:00
Frédéric Wang
5259d9162c Bug 1925468 - Implement Trusted Type support for setAttribute/setAttributeNS. r=smaug
See
https://github.com/whatwg/dom/pull/1268
https://w3c.github.io/trusted-types/dist/spec/#validate-attribute-mutation
https://w3c.github.io/trusted-types/dist/spec/#get-trusted-type-data-for-attribute

Differential Revision: https://phabricator.services.mozilla.com/D227943
2024-11-28 09:21:58 +00:00
Stanca Serban
d6c931fe75 Backed out 3 changesets (bug 1925468) for causing multiple failures. CLOSED TREE
Backed out changeset db598441827d (bug 1925468)
Backed out changeset 37b01d6a0d0d (bug 1925468)
Backed out changeset 0efe13efdebc (bug 1925468)
2024-11-27 14:06:45 +02:00
Frédéric Wang
b5b7345d6f Bug 1925468 - Implement Trusted Type support for setAttribute/setAttributeNS. r=smaug
See
https://github.com/whatwg/dom/pull/1268
https://w3c.github.io/trusted-types/dist/spec/#validate-attribute-mutation
https://w3c.github.io/trusted-types/dist/spec/#get-trusted-type-data-for-attribute

Differential Revision: https://phabricator.services.mozilla.com/D227943
2024-11-27 09:56:36 +00:00
Frédéric Wang
ecc1cbf6d6 Bug 1928991 - Implement Trusted Types support for outerHTML IDL attribute. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D227827
2024-11-27 05:06:18 +00:00
Boris Chiou
bca6a096a1 Bug 1921553 - Use PseudoStyleRequest in Element::GetAnimationsWithoutFlush(). r=view-transitions-reviewers,layout-reviewers,emilio
We will support `getAnimations()` for view transitions. For now just use
`PseudoStyleRequest` for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D228244
2024-11-25 23:46:34 +00:00
Boris Chiou
dac5d98343 Bug 1921553 - Use PseudoStyleRequest in EffectSet. r=view-transitions-reviewers,layout-reviewers,emilio
Use `PseudoStyleRequest` in the APIs of EffectSet. We would like to
store the animation in the originating element, so need to use
`PseudoStyleRequest`.

Differential Revision: https://phabricator.services.mozilla.com/D228226
2024-11-25 23:46:32 +00:00
Boris Chiou
611b6b2ec3 Bug 1921553 - Use PseudoStyleRequest in AnimationTarget. r=view-transitions-reviewers,layout-reviewers,emilio
And also update some related functions.

We will udpate `EffectSet::Get()` in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D228225
2024-11-25 23:46:32 +00:00