Commit Graph
171 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 d3d14120cf Bug 2032024 - Clean up dom.element.commandfor.enabled flag r=dom-core,webidl,devtools-reviewers,nchevobbe,smaug
Differential Revision: https://phabricator.services.mozilla.com/D294405
2026-04-15 18:50:23 +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
serge-sans-paille 314b019211 Bug 2012139 - #undef macro definitions shared across CU when FILES_PER_UNIFIED_FILE increases r=xpcom-reviewers,dom-core,smaug,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D280248
2026-01-27 09:22:50 +00:00
Alice Boxhall bfd95616d0 Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley
Add referenceTarget support for single element attributes: list, popoverTarget and commandFor.

Differential Revision: https://phabricator.services.mozilla.com/D261365
2026-01-14 18:03:34 +00:00
Alice Boxhall 76fdac1bd4 Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D261542
2026-01-14 18:03:30 +00:00
Sandor Molnar 8faede9a1f Revert "Bug 1981349 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug" for causing accessibility crashes (bug 2008970)
This reverts commit d46abe6d76.

Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"

This reverts commit df11a4666d.

Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"

This reverts commit 89cc779f5e.

Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"

This reverts commit 33130e712d.

Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"

This reverts commit d6440c4cae.

Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"

This reverts commit 83b70e0645.

Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"

This reverts commit 3a0b29121e.
2026-01-07 16:08:51 +00:00
Alice Boxhall d6440c4cae Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley
Add referenceTarget support for single element attributes: list, popoverTarget and commandFor.

Differential Revision: https://phabricator.services.mozilla.com/D261365
2026-01-06 16:16:16 +00:00
Alice Boxhall 83b70e0645 Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D261542
2026-01-06 16:16:13 +00:00
iulian moraru e162366a25 Revert "Bug 1981349, Bug 1981346, Bug 1981345, Bug 1984685, Bug 1981344, Bug 1983766, Bug 1989323 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug" for causing android build bustages.
This reverts commit 1b5cf4cdf8.

Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"

This reverts commit 2394d9205a.

Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"

This reverts commit 571a17ff82.

Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"

This reverts commit 3b389fdd62.

Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"

This reverts commit 5cc2a12756.

Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"

This reverts commit 68e2d26aa9.

Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"

This reverts commit 1234b31599.
2025-12-24 15:16:52 +00:00
Alice Boxhall 5cc2a12756 Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley
Add referenceTarget support for single element attributes: list, popoverTarget and commandFor.

Differential Revision: https://phabricator.services.mozilla.com/D261365
2025-12-24 13:41:45 +00:00
Alice Boxhall 68e2d26aa9 Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D261542
2025-12-24 13:41:42 +00:00
Denis Palmeiro 66b973dc4f Bug 1995614: Use atoms for attributes if available instead of expecting a StringBuffer. r=hsivonen,media-playback-reviewers,firefox-svg-reviewers,karlt,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D271244
2025-11-13 04:18:51 +00:00
Keith Cirkel 4df4280e52 Bug 1983512 - Make command events not composed r=smaug,dom-core
See https://github.com/whatwg/html/pull/11255 for more.

Differential Revision: https://phabricator.services.mozilla.com/D261393
2025-08-27 16:11:11 +00:00
Alexandru Marc e3d869de57 Revert (Bug 1983523, Bug 1983512) for causing wpt failures @ math-global-event-handlers.tentative.html
This reverts commit aa0b3f5dfe.

Revert "Bug 1983512 - Make command events not composed r=smaug,dom-core"

This reverts commit 0df6cdf132.
2025-08-26 23:26:08 +00:00
Keith Cirkel 0df6cdf132 Bug 1983512 - Make command events not composed r=smaug,dom-core
See https://github.com/whatwg/html/pull/11255 for more.

Differential Revision: https://phabricator.services.mozilla.com/D261393
2025-08-26 10:16:32 +00:00
Keith Cirkel cb4a19d822 Bug 1932700 - Fix edge case: click events inside buttons with popover descendants r=dom-core,smaug
Given a structure like:

```
<button popovertarget=foo>Activate
  <div popover id=foo>Clicking me shouldn't close me</div>
</button>
```

With the popover open, clicking the popover will propagate a click
upward to the button, which will close the button. This change ensures
that the original target is checked, and if it is a
ShadowIncludingDescendantOf the button then the popover behaviour is not
invoked.

Differential Revision: https://phabricator.services.mozilla.com/D259955
2025-08-07 10:28:18 +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
Keith Cirkel 28201964af Bug 1950359 - Implement request-close invoker command r=dom-core,edgar
This Implements the new `request-close` invoker command, as specified
recently in https://github.com/whatwg/html/pull/11045

Differential Revision: https://phabricator.services.mozilla.com/D256032
2025-07-04 15:43:49 +00:00
Keith Cirkel cfe5a38af5 Bug 1975522 - Properly reflect button command values r=dom-core,edgar
This now uses an EnumTable rather than custom code, which simplifies the
logic while also enabling case insensitivity for the enumerated values.

Differential Revision: https://phabricator.services.mozilla.com/D256015
2025-07-04 15:43:44 +00:00
Keith Cirkel 6edf052c97 Bug 1974427 - Implement button "Auto" state r=dom-core,edgar
Differential Revision: https://phabricator.services.mozilla.com/D255288
2025-07-03 13:15:17 +00:00
Keith Cirkel 6282a5468b Bug 1973497 - Refactor HTMButtonElement::ActivationBehavior r=dom-core,edgar
This refactoring aligns the button activation behaviour to the exact
steps specified in HTML, which has some small changes from the prior
implementation:

- button activation returns early after submitting, or resetting, not
  triggering popovers or command/commandfor.
- buttons with form owners and a type attribute in the Auto state must
  return early, not triggering popovers or command/commandfor.

This also has some other non-observable changes to the code:

- collapses the HandleCommandForAction method directly into
  ActivationBehavior.
- adds code comments for each of the spec steps

Differential Revision: https://phabricator.services.mozilla.com/D254715
2025-06-27 12:44:45 +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
Keith Cirkel 1d585db7d9 Bug 1973496 - Use dashes for command attribute enumerations r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D254698
2025-06-26 10:34:04 +00:00
Keith Cirkel bdea3b4044 Bug 1973494 - Only mark Custom commands as attrs that start with two dashes r=dom-core,edgar
Differential Revision: https://phabricator.services.mozilla.com/D254707
2025-06-26 10:34:00 +00:00
Alexandru Marc f853b72f0f Revert "Bug 1973494 - Only mark Custom commands as attrs that start with two dashes r=dom-core,edgar" for causing wpt failures @ command-and-commandfor/on-dialog-behavior.html
This reverts commit 41e61fa7f5.
2025-06-24 22:04:24 +00:00
Keith Cirkel 41e61fa7f5 Bug 1973494 - Only mark Custom commands as attrs that start with two dashes r=dom-core,edgar
Differential Revision: https://phabricator.services.mozilla.com/D254707
2025-06-24 20:07:52 +00:00
Alexandru Marc d5979c2a5c Revert "Bug 1973496 - Use dashes for command attribute enumerations r=emilio" for causing dt failures @ browser_dbg-event-breakpoints.js
This reverts commit 037e8a482d.
2025-06-24 17:27:37 +00:00
Keith Cirkel 037e8a482d Bug 1973496 - Use dashes for command attribute enumerations r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D254698
2025-06-24 12:04:54 +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
Keith Cirkel 5d5b9bb121 Bug 1950338 - Part 8: Rename invoketarget->commandfor, invokeaction->command r=webidl,devtools-reviewers,nchevobbe,smaug
Differential Revision: https://phabricator.services.mozilla.com/D252518
2025-06-12 15:00:53 +00:00
Keith Cirkel 99d03f00d6 Bug 1950338 - Part 7: Move command&commandfor logic to HTMLButtonElement r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D252517
2025-06-12 15:00:50 +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
Keith Cirkel 0fe8930d32 Bug 1950338 - Part 8: Rename invoketarget->commandfor, invokeaction->command r=webidl,devtools-reviewers,nchevobbe,smaug
Differential Revision: https://phabricator.services.mozilla.com/D252518
2025-06-12 12:57:36 +00:00
Keith Cirkel 5a9255cd0b Bug 1950338 - Part 7: Move command&commandfor logic to HTMLButtonElement r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D252517
2025-06-12 12:57:33 +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
Edgar Chen 4ac8a8da39 Bug 1949439 - Part 1: Stop dispatching unused DOMFormSubmit chrome-only event; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D239150
2025-02-25 11:23:37 +00:00
Emilio Cobos Álvarez d25d53b6fc Bug 1909311 - Remove nsIFormControlFrame and nsITextControlFrame. r=masayuki,layout-reviewers,dholbert
It's a rather useless interface:

 * nsITextControlFrame is only implemented by nsTextControlFrame, so we
   can just use that.
 * nsIFormControlFrame had very few actual functionality, mostly
   scattered around:
    * SetFormProperty(select) was only useful for nsTextControlFrame.
    * SetFormProperty(value) was only called on file controls.
    * SetFocus() did mostly nothing, or things that can be done in
      ElementStateChanged instead.

There are some do_QueryFrame calls that I replaced for better checks in
font inflation and nsIFrame, but I'll adjust to preserve behavior if you
insist (it just such a somewhat-random check).

Differential Revision: https://phabricator.services.mozilla.com/D217322
2024-07-23 16:16:18 +00:00
Emilio Cobos Álvarez bf22d33f87 Bug 1895208 - Refactor IsFocusable checks to take flags rather than bool arguments. r=smaug
This doesn't change behavior on its own, but it's likely we want to make
the tab focusability more complicated in bug 1895184, and this will make
changes to this area less painful.

Differential Revision: https://phabricator.services.mozilla.com/D209525
2024-05-06 21:54:37 +00:00
Emilio Cobos Álvarez 7506fc5879 Bug 1881011 - Refactor UnbindFromTree to take a context argument. r=smaug
Much like BindToTree.

This will be useful because I need to pass more information through
UnbindFromTree() to speed up dir=auto for bug 1874040.

Differential Revision: https://phabricator.services.mozilla.com/D202215
2024-02-20 15:05:40 +00:00
Stanca Serban 8d6a9ece7a Backed out 3 changesets (bug 1851970) for causing mochitests failures in browser_aboutNetError_csp_iframe.js.
Backed out changeset a2536c6c6c23 (bug 1851970)
Backed out changeset 23ddc229d1a1 (bug 1851970)
Backed out changeset b99a620a535c (bug 1851970)
2023-11-28 18:43:55 +02:00
Vincent Hilla 4a2ca2ff09 Bug 1851970 - Part 2: Activation behavior method for links. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D183991
2023-11-28 14:09:02 +00:00
keithamus 7f87d7a0b3 Bug 1857887 - Add invoketarget & invoketarget action attributes r=smaug
This adds support for the experimental `invoketarget` and `invokeaction`
attributes, as specified in the open-ui "Invokers" explainer.

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

The `invoketarget` attribute maps to the IDL `invokeTargetElement`,
similar to `popoverTargetElement`, and the `invokeaction` is a freeform
string.

The Button behaviour checks for `invokeTargetElement` in its activation
behaviour, and dispatches an `InvokeEvent` if there is one.

This also adds some basic scaffolding for `handleInvokeInternal` which
will allow elements to provide their own invocation action algorithms.

Differential Revision: https://phabricator.services.mozilla.com/D190449
2023-11-08 13:41:51 +00:00
Vincent Hilla 65acb7d75a Bug 1855633 - Part 2: Activation behavior method for button element. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D183989
2023-10-30 09:39:27 +00:00
Emilio Cobos Álvarez 72f00fc947 Bug 1850293 - Make validity states non-intrinsic. r=smaug
Add a RAII helper to notify of multiple state changes together for
these.

The UpdateState CustomElementInternals calls that are getting removed
are unnecessary (the state should be up-to-date by then, there's nothing
changing there particularly).

Same for the call in nsGenericHTMLFormElement::UnbindFromTree. ClearForm
already does an state update.

Differential Revision: https://phabricator.services.mozilla.com/D187033
2023-08-30 09:18:32 +00:00
Olli Pettay 22262b6f58 Bug 1843473 - Don't dispatch DOMActivate if there are no listeners for it, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D186473
2023-08-18 06:01:16 +00:00