Commit Graph
73 Commits
Author SHA1 Message Date
Daniel Holbert 648f3a95c5 Bug 2044510: Pass already_AddRefed types by-value instead of by rvalue reference, in dom/html. r=dom-core-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D304360
2026-06-05 21:06:40 +00:00
Keith Cirkel f502ae4b7a Bug 2012698 - Part 1 - Refactor Element, abstracting Details Shadow tree branches to virtual methods r=dom-core,jjaschke,emilio
Currently Element has the SHADOW_ROOT_IS_DETAILS_SHADOW_TREE flag, which
determines if the element is a Details element and allows branching for specific
shadow root operations, such as getting the slot names, and handlers for slot
changed and unslotted.

This change refactors this to be more generic: switching this branching for
virtual methods instead, while dropping the flag. It also then co-locates the
Details specific shadow root operations into HTMLDetailsElement.cpp.

This will allow us to introduce more element specific Shadow Root behaviours,
such as those for the `<select>` element.

Differential Revision: https://phabricator.services.mozilla.com/D295337
2026-04-29 20:20:27 +00:00
Emilio Cobos Álvarez 5016086e1a Bug 2025089 - Remove some includes from nsINode.h and Element.h. r=dom-core,dom-storage-reviewers,firefox-svg-reviewers,janv,smaug
Differential Revision: https://phabricator.services.mozilla.com/D289049
2026-03-22 23:45:55 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Emilio Cobos Álvarez 5624defbfd Bug 2016280 - Use shadow DOM for editor. r=masayuki,dom-core,smaug,Jamie
There's still a ton of things that can be cleaned up after this, but
this setup is nicer.

For now, editor keeps getting set-up / torn down on BindToFrame. Seems
all that could be untangled, but step by step.

The preview stuff and placeholder can just be created on demand now,
rather than requiring frame reconstruction.

Also, nsSearchControlFrame and co no longer do anything of interest, so
move the still relevant bits elsewhere and remove them.

test_bug1248459.html is removed because it messes with the editor
selection using SpecialPowers, in a way such that it crosses shadow
boundaries, and messes up the selected state triggering debug asserts.

test_focus_docnav.xhtml now triggers a different code-path because of
the shadow root (rather than the frame tree traversal). Keep it working
for now by replacing it with something that isn't a shadow root.

Differential Revision: https://phabricator.services.mozilla.com/D282953
2026-02-17 09:53:01 +00:00
Emilio Cobos Álvarez 11fe7131f6 Bug 2017011 - Less pointer chasing to get to a NodeInfoManager. r=dom-core,smaug
Noticed from the previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D283481
2026-02-16 11:05:58 +00:00
Keith Cirkel 18a45f3398 Bug 2014599 - Switch assert to if in details HandleCommand steps r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D281969
2026-02-06 11:33:06 +00:00
Emilio Cobos Álvarez 30b7a3d89a Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 07:39:54 +00:00
Norisz Fay 27f4694604 Revert "Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika" for causing bustage @ ElementAnimationData.h
This reverts commit c70290c619.
2026-02-06 05:34:42 +00:00
Emilio Cobos Álvarez c70290c619 Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 03:42:45 +00:00
Keith Cirkel 90c4ed44a7 Bug 1968987 - Part 2 - Set ToggleEvent source on Popover/Dialog r=smaug,dom-core
This uses the implicit "invoker" from each element to set the
ToggleEvent Source, so that toggle events dispatched from Dialogs &
Popovers include the `source` attribute.

Differential Revision: https://phabricator.services.mozilla.com/D265435
2025-09-30 16:33:25 +00:00
agoloman 654ef74068 Revert "Bug 1968987: apply code formatting via Lando" for causing wpt failures @details-toggle-source.html.
This reverts commit 4c94fd990e.

Revert "Bug 1968987 - Part 2 - Set ToggleEvent source on Popover/Dialog r=smaug,dom-core"

This reverts commit f322cfc77f.

Revert "Bug 1968987 - Part 1 - Add Source to ToggleEvent, no longer generate. r=smaug,dom-core,webidl,saschanaz"

This reverts commit 7df5d3019b.
2025-09-30 16:25:03 +00:00
Keith Cirkel f322cfc77f Bug 1968987 - Part 2 - Set ToggleEvent source on Popover/Dialog r=smaug,dom-core
This uses the implicit "invoker" from each element to set the
ToggleEvent Source, so that toggle events dispatched from Dialogs &
Popovers include the `source` attribute.

Differential Revision: https://phabricator.services.mozilla.com/D265435
2025-09-30 15:00:28 +00:00
Serban Stanca 9ecc18eebf Revert "Bug 1968987 - fix linting failure in details-toggle-source.html." for causing wpt failures in details-toggle-source.html .
This reverts commit 37b12c48c7.

This reverts commit a9742e4fb6.

This reverts commit abd05d12c3.

This reverts commit d251e1c53c.
2025-09-23 12:37:58 +00:00
Keith Cirkel abd05d12c3 Bug 1968987 - Part 2 - Set ToggleEvent source on Popover/Dialog r=smaug,dom-core
This uses the implicit "invoker" from each element to set the
ToggleEvent Source, so that toggle events dispatched from Dialogs &
Popovers include the `source` attribute.

Differential Revision: https://phabricator.services.mozilla.com/D265435
2025-09-23 08:45:08 +00:00
Alexandru Marc 4dd97b58ef Revert "Bug 1968987 - Part 2 - Set ToggleEvent source on Popover/Dialog r=smaug,dom-core" for causing build bustages @ ToggleEvent.cpp
This reverts commit f66dd32b15.

Revert "Bug 1968987 - Part 1 - Add Source to ToggleEvent, no longer generate. r=smaug,dom-core,webidl,saschanaz"

This reverts commit 89ee599ac8.
2025-09-22 16:47:49 +00:00
Keith Cirkel f66dd32b15 Bug 1968987 - Part 2 - Set ToggleEvent source on Popover/Dialog r=smaug,dom-core
This uses the implicit "invoker" from each element to set the
ToggleEvent Source, so that toggle events dispatched from Dialogs &
Popovers include the `source` attribute.

Differential Revision: https://phabricator.services.mozilla.com/D265435
2025-09-22 15:27:39 +00:00
Masayuki Nakano 72d659449a Bug 1987568 - Make HTMLDetailsElement stop using AutoSuppressNotifyingDevToolsOfNodeRemovals r=smaug,dom-core
They are replacements of a set of calls of
`Document::SetFireMutationEvents()` before removing the legacy DOM
mutation events.  The methods where there is an instance of
`AutoSuppressNotifyingDevToolsOfNodeRemovals` only modify the `open`
attribute.  So, they are not required anymore.

Differential Revision: https://phabricator.services.mozilla.com/D264180
2025-09-09 08:08:07 +00:00
Masayuki Nakano 2e2cb7cb9a Bug 769207 - part 12: Get rid of DOMNodeRemoved event r=smaug,dom-core,devtools-reviewers,toolkit-telemetry-reviewers,janerik,bomsy
Unfortunately, we need to keep dispatching `devtoolschildremoved` event
to the DevTools.  Therefore, this patch renames the `DOMNodeRemoved`
event dispatcher and related methods.

Differential Revision: https://phabricator.services.mozilla.com/D263063
2025-09-08 00:28:16 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Keith Cirkel e97372a849 Bug 1867785 - Move details commandfor commands behind flag r=dom-core,edgar
These commands are not spec compliant, but are proposed features in the
"future commands" proposal under Open-UI. As they're not spec compliant,
they should only be exposed flagged.
(https://open-ui.org/components/future-invokers.explainer/)

Differential Revision: https://phabricator.services.mozilla.com/D256133
2025-07-07 13:24:29 +00:00
Emilio Cobos Álvarez 0fb5512190 Bug 1922586 - More explicitly opt in into bindings for UniquePtr. r=sergesanspaille
std::unique_ptr's subtleties are hard for bindgen to cope with.

Bug 1973598 was going to make this workaround even uglier by having to figure
out the specific path for std::unique_ptr in the standard library.

Rather than assuming that all usage bindgen sees is simple, explicitly opt in
the few pointers that we need via a new BindgenUniquePtr, and make opaque the
rest.

Differential Revision: https://phabricator.services.mozilla.com/D255568
2025-07-01 08:30:38 +00:00
Keith Cirkel 818ce65d6b Bug 1970331 - Drop "Auto" value from command&commandfor r=emilio,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D254685
2025-06-26 10:34:08 +00:00
Sandor Molnar e053dddd84 Revert "Bug 1970331 - Drop "Auto" value from command&commandfor r=emilio" for causing perma dt failures @ browser_dbg-event-breakpoints.js.js
This reverts commit e3bc176127.
2025-06-23 20:48:50 +00:00
Keith Cirkel e3bc176127 Bug 1970331 - Drop "Auto" value from command&commandfor r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D254685
2025-06-23 19:01:59 +00:00
Lando c3c6824fd2 Bug 1950338: apply code formatting via Lando
# ignore-this-changeset
2025-06-12 15:01:02 +00:00
Keith Cirkel d78e18b0a5 Bug 1950338 - Part 6: Rename invoker functions to command functions r=dom-core,masayuki
Renames:
- IsValidInvokeAction->IsValidCommandAction
- HandleInvokeInternal->HandleCommandInternal
- InvokeAction->CommandAction

Differential Revision: https://phabricator.services.mozilla.com/D252516
2025-06-12 15:00:47 +00:00
agoloman 025ccdad29 Revert "Bug 1950338: apply code formatting via Lando" for causing build bustages @CommandEvent.cpp.
This reverts commit d33dcda2c6.

Revert "Bug 1950338 - Part 8: Rename invoketarget->commandfor, invokeaction->command r=webidl,devtools-reviewers,nchevobbe,smaug"

This reverts commit 0fe8930d32.

Revert "Bug 1950338 - Part 7: Move command&commandfor logic to HTMLButtonElement r=smaug"

This reverts commit 5a9255cd0b.

Revert "Bug 1950338 - Part 6: Rename invoker functions to command functions r=dom-core,masayuki"

This reverts commit 76f840a55a.

Revert "Bug 1950338 - Part 5: Remove InvokeEvent, migrate .invoker to CommandEvent .source r=webidl,devtools-reviewers,nchevobbe,emilio,smaug"

This reverts commit f7d2727969.

Revert "Bug 1950338 - Part 4: Move invokeTargetElement, invokeAction to HTMLButtonElement IDL r=webidl,smaug"

This reverts commit a7a025a843.

Revert "Bug 1950338 - Part 3: Expose CommandEvent in commandfor pref; move from chrome-webidl to webidl r=webidl,emilio"

This reverts commit eb133a45e6.

Revert "Bug 1950338 - Part 2: Move invokers meta ini to correct directory r=dom-core,sefeng"

This reverts commit face866adb.

Revert "Bug 1950338 - Part 1: Rename `dom.element.invokers` flag to `dom.element.commandfor` r=webidl,devtools-reviewers,nchevobbe,smaug"

This reverts commit 532bb887b5.
2025-06-12 14:53:31 +00:00
Lando d33dcda2c6 Bug 1950338: apply code formatting via Lando
# ignore-this-changeset
2025-06-12 12:57:45 +00:00
Keith Cirkel 76f840a55a Bug 1950338 - Part 6: Rename invoker functions to command functions r=dom-core,masayuki
Renames:
- IsValidInvokeAction->IsValidCommandAction
- HandleInvokeInternal->HandleCommandInternal
- InvokeAction->CommandAction

Differential Revision: https://phabricator.services.mozilla.com/D252516
2025-06-12 12:57:30 +00:00
Emilio Cobos Álvarez 7c0d4089c5 Bug 1968202 - Generalize GlobalStyleSheetCache to support author stylesheets. r=smaug
In bug 1967507 I changed the timing of AnonymousContent stylesheet
loading in a way that it perturbed a css cache test because of
accessiblecaret.css

  https://hg.mozilla.org/mozilla-central/rev/a6a294ae1d18

However that made me realize that accessiblecaret.css is loaded
virtually in all processes, and it should be using the same mechanism we
use for UA sheets, rather than using all the CSS loader machinery
in-content. Same goes for details.css.

Expand GlobalStyleSheetCache to allow UA and Author sheets, and allow
ShadowRoot to get built-in stylesheets appended.

This allows accessiblecaret.css and details.css not to be marked as
content-accessible.

We could do the same at the document level for plaintext.css and co, but
that seems a bit less common, so maybe fine.

Differential Revision: https://phabricator.services.mozilla.com/D250909
2025-05-24 11:27:14 +00:00
Serban Stanca 4c663869d9 Revert "Bug 1968202 - Generalize GlobalStyleSheetCache to support author stylesheets. r=smaug" for causing wpt failures in prefetch-transfer-size-executor.html.
This reverts commit e2ac38c2a8.
2025-05-24 01:53:53 +00:00
Emilio Cobos Álvarez e2ac38c2a8 Bug 1968202 - Generalize GlobalStyleSheetCache to support author stylesheets. r=smaug
In bug 1967507 I changed the timing of AnonymousContent stylesheet
loading in a way that it perturbed a css cache test because of
accessiblecaret.css

  https://hg.mozilla.org/mozilla-central/rev/a6a294ae1d18

However that made me realize that accessiblecaret.css is loaded
virtually in all processes, and it should be using the same mechanism we
use for UA sheets, rather than using all the CSS loader machinery
in-content. Same goes for details.css.

Expand GlobalStyleSheetCache to allow UA and Author sheets, and allow
ShadowRoot to get built-in stylesheets appended.

This allows accessiblecaret.css and details.css not to be marked as
content-accessible.

We could do the same at the document level for plaintext.css and co, but
that seems a bit less common, so maybe fine.

Differential Revision: https://phabricator.services.mozilla.com/D250909
2025-05-23 13:30:13 +00:00
Luke Warlow 4467217321 Bug 1901037: Implement ::details-content pseudo element r=emilio,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D241100
2025-03-17 22:17:22 +00:00
Alexandru Marc c9c8c944b9 Backed out changeset 26b1240bfca3 (bug 1901037) for causing multiple rendering related wpt failures 2025-03-15 01:33:00 +02:00
Luke Warlow 268b0361ba Bug 1901037: Implement ::details-content pseudo element r=emilio,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D241100
2025-03-14 21:58:28 +00:00
Jonathan Kew 6d25ae0f09 Bug 1936113 - Hook up :open to details, select, dialog, and input elements. r=webidl,emilio
Most of these elements are simple to support.

One slightly tricky item was <input type=date>, as testing indicates that the
front-end code usually (consistently?) hides the picker using setPickerState(),
which does not end up calling closeDateTimePicker() as might be expected.
So to properly track the open/closed state, I had to add a SetDateTimePickerState
webidl method, rather than just patching into the existing Open/Close calls.

Differential Revision: https://phabricator.services.mozilla.com/D234093
2025-01-17 13:49:56 +00:00
Butkovits Atila 530d9d432d Backed out 5 changesets (bug 1936113) for causing failures at select-inside-top-layer.tentative.html. CLOSED TREE
Backed out changeset 2b07b9e7bf57 (bug 1936113)
Backed out changeset a88e93dff614 (bug 1936113)
Backed out changeset 9cfc0a675a42 (bug 1936113)
Backed out changeset 716bdadbea2a (bug 1936113)
Backed out changeset 4ee0855e448f (bug 1936113)
2025-01-17 12:34:24 +02:00
Jonathan Kew a4d8e36aff Bug 1936113 - Hook up :open to details, select, dialog, and input elements. r=webidl,emilio
Most of these elements are simple to support.

One slightly tricky item was <input type=date>, as testing indicates that the
front-end code usually (consistently?) hides the picker using setPickerState(),
which does not end up calling closeDateTimePicker() as might be expected.
So to properly track the open/closed state, I had to add a SetDateTimePickerState
webidl method, rather than just patching into the existing Open/Close calls.

Differential Revision: https://phabricator.services.mozilla.com/D234093
2025-01-17 09:17:28 +00:00
Olli Pettay acecfeab93 Bug 1856460, add support for HTMLDetailsElement.name, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D215847
2024-07-08 20:39:44 +00:00
keithamus af4755d972 Bug 1860457 - implement popover invoke defaults r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D206184
2024-05-24 08:41:03 +00:00
Sandor Molnar a9eee12a7d Backed out changeset 4cce744a9cbb (bug 1860457) for causing wpt failures. CLOSED TREE 2024-05-24 07:07:16 +03:00
keithamus 05c91c9f0e Bug 1860457 - implement popover invoke defaults r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D206184
2024-05-23 20:56:58 +00:00
keithamus 1df93584c8 Bug 1867786 - Only dispatch for valid invoke actions r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D206183
2024-05-16 09:49:50 +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
Pier Angelo Vendrame 4323c13ff9 Bug 1880988 - Apply spoof English to the default detail summary. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D202203
2024-03-11 12:29:38 +00:00
Luke Warlow 9bdefe2698 Bug 1864331 - Implements HandleInvokeInternal for details element. r=smaug,CanadaHonk
Implements invoketarget defaults for details element, as specified in the open-ui "Invokers explainer".

(https://open-ui.org/components/invokers.explainer/)

Differential Revision: https://phabricator.services.mozilla.com/D193382
2023-11-13 23:12:15 +00:00
Emilio Cobos Álvarez 2835e108b2 Bug 1817122 - Use a ToggleEvent for <details> toggle event. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D190060
2023-10-05 11:43:45 +00:00
Norisz Fay 85de591c5d Backed out changeset a879c4fcdc4f (bug 1817122) for causing multiple failures CLOSED TREE 2023-10-05 04:29:13 +03:00
Emilio Cobos Álvarez 0ba6d614b7 Bug 1817122 - Use a ToggleEvent for <details> toggle event. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D190060
2023-10-04 22:01:20 +00:00