Commit Graph
66 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 b18abd792a Bug 2045080 - Reset mReqeustCloseReturnValue during SetRequestCloseReturnValue r=dom-core-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D304848
2026-06-04 21:21:58 +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
Keith Cirkel d019676b9c Bug 2014549 - Refactor Optional<nsAString> to Maybe<nsAutoString> HTMLDialogElement r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D281977
2026-02-06 21:02:11 +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
Keith Cirkel 76027b3aad Bug 1987440 - Tidy up HTMLDialogElement.cpp r=smaug,dom-core
This mostly adds code comments, slightly reorganises some code (in
non-user impacting ways) and removes some TODOs which are now done.

Differential Revision: https://phabricator.services.mozilla.com/D264097
2025-09-16 08:49:49 +00:00
Sandor Molnar d77b410bd9 Revert "Bug 1987440 - Tidy up HTMLDialogElement.cpp r=smaug,dom-core" for causing wpt failures @ /html/semantics/the-button-element/command-and-commandfor/on-dialog-behavior.html
This reverts commit 7bf002d547.
2025-09-11 17:24:38 +00:00
Keith Cirkel 7bf002d547 Bug 1987440 - Tidy up HTMLDialogElement.cpp r=smaug,dom-core
This mostly adds code comments, slightly reorganises some code (in
non-user impacting ways) and removes some TODOs which are now done.

Differential Revision: https://phabricator.services.mozilla.com/D264097
2025-09-11 10:02:34 +00:00
Serban Stanca f01d101e1c Revert "Bug 1987440 - Tidy up HTMLDialogElement.cpp r=smaug,dom-core" for causing wpt failures.
This reverts commit 8ce5433353.
2025-09-11 02:12:28 +00:00
Keith Cirkel 8ce5433353 Bug 1987440 - Tidy up HTMLDialogElement.cpp r=smaug,dom-core
This mostly adds code comments, slightly reorganises some code (in
non-user impacting ways) and removes some TODOs which are now done.

Differential Revision: https://phabricator.services.mozilla.com/D264097
2025-09-11 00:41:26 +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
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
Keith Cirkel 265b3e9f14 Bug 1963847 - Use ElementState::OPEN in Open() over GetBoolAttr() r=smaug
See: https://phabricator.services.mozilla.com/D235504#inline-1362631

Differential Revision: https://phabricator.services.mozilla.com/D247458
2025-05-02 12:55:06 +00:00
Steve Fink cd64d0fb7d Revert "Bug 1963847 - Use ElementState::OPEN in Open() over GetBoolAttr() r=smaug" for asserting at dom/html/HTMLDialogElement.cpp:287
This reverts commit 527fa0b956.
2025-05-02 11:25:53 +00:00
Keith Cirkel 527fa0b956 Bug 1963847 - Use ElementState::OPEN in Open() over GetBoolAttr() r=smaug
See: https://phabricator.services.mozilla.com/D235504#inline-1362631

Differential Revision: https://phabricator.services.mozilla.com/D247458
2025-05-02 10:36:00 +00:00
keithamus a74f91b8cf Bug 1936940 - Implement dialog light dismiss r=webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D235504
2025-05-01 19:05:50 +00:00
Sebastian Hengst ac85dfe9e5 Revert "Bug 1936940 - Implement dialog light dismiss r=webidl,emilio" for failing two html/semantics/interactive-elements/the-dialog-element/ tests
This reverts commit 0c65e1c7da.
2025-05-01 13:56:58 +00:00
keithamus 0c65e1c7da Bug 1936940 - Implement dialog light dismiss r=webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D235504
2025-05-01 03:51:09 +00:00
Alexandru Marc ce0a455f47 Backed out changeset 307ff391dd02 (bug 1936940) for causing wpt failures @ dialog-closedby.html 2025-04-30 13:35:19 +03:00
keithamus 129d6b84a4 Bug 1936940 - Implement dialog light dismiss r=webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D235504
2025-04-30 08:53:12 +00:00
keithamus 803154a9f6 Bug 1960556 - Implement Dialog requestClose r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D245566
2025-04-23 16:44:25 +00:00
pstanciu 97c7232c9d Backed out changeset 6bf58ecf3d6d (bug 1960556) for causing wpt failures on dialog-requestclose.html CLOSED TREE 2025-04-23 14:42:52 +03:00
keithamus 82d3e600e7 Bug 1960556 - Implement Dialog requestClose r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D245566
2025-04-23 08:25:14 +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
Keith Cirkel 2a2c55a3ac Bug 1876762 - Implement togggle events for Dialog show/showModal/close r=smaug
https://github.com/whatwg/html/pull/10091

This also slightly refactors FireToggleEvent to allow to to
accomodate both popovers and now also dialogs

Differential Revision: https://phabricator.services.mozilla.com/D225449
2024-10-14 13:19:57 +00:00
keithamus a155da2430 Bug 1888728 - Use CloseWatcher machinery for Dialogs & Popovers r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D206170
2024-09-24 16:48:09 +00:00
keithamus bc09bf7036 Bug 1888776 - Add invoke defaults for dialog elements r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D206185
2024-05-24 09:48:49 +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
keithamus d5efc74a38 Bug 1878708 - Dialogs HideAllPopoversUntil nearest popover, not document. r=smaug
Given some markup like:

```html
<div id=popover popover>
  <button id="openDialog">Open Dialog</button>
  <dialog id=dialog>
    I'm a dialog!
  </dialog>
</div>
<button id="openPopover">Open Popover</button>
<button>I do nothing!</button>
```

With some JS like

```js
openDialog.onclick = () => {
  dialog.showModal();
}

openPopover.onclick = () => {
  popover.showPopover();
}
```

Clicking the "Open Popover" button followed by the "Open Dialog" button results in both the Dialog and Popover being hidden, however the dialog will still be open as modal, rendering the whole page inert, nothing is clickable and there seems to be no way to undo this (unless you use a CloseWatcher gesture such as the Esc key - if you have one available on your device).

It is expected that the popover should not close the dialog, as it causes the invisible Modal Dialog to make the whole page inert, and it is very difficult for users (and developers) to discover how to undo this action (pressing escape).

This was reported in https://github.com/whatwg/html/issues/9998, and WhatWG resolved to fix this, which in https://github.com/whatwg/html/pull/10116.

Differential Revision: https://phabricator.services.mozilla.com/D200686
2024-02-05 23:58:42 +00:00
Sean Feng 5b22ce2910 Bug 1811129 - Implement the new dialog initial focus algorithm r=emilio
The main changes of the new algorithm are

* Make the dialog focusing steps look at sequentially focusable elements instead of any focusable element.
* Make the dialog element itself get focus if it has the autofocus attribute set.
* Make the dialog element itself get focus as a fallback instead of focus being "reset" to the body element.

Spec PR (merged): https://github.com/whatwg/html/pull/8199

Differential Revision: https://phabricator.services.mozilla.com/D181263
2023-08-02 13:35:47 +00:00
Gregory Pappas 853e673a0f Bug 1842974 - Remove dom.dialog_element.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183711
2023-07-17 10:02:53 +00:00
Norisz Fay 984233a612 Backed out changeset cbf5ea1b17d2 (bug 1811129) for causing failures on modal-dialog-backdrop-opacity.html CLOSED TREE 2023-07-06 20:28:17 +03:00
Sean Feng c57066bb2b Bug 1811129 - Implement the new dialog initial focus algorithm r=emilio
The main changes of the new algorithm are

* Make the dialog focusing steps look at sequentially focusable elements instead of any focusable element.
* Make the dialog element itself get focus if it has the autofocus attribute set.
* Make the dialog element itself get focus as a fallback instead of focus being "reset" to the body element.

Spec PR (merged): https://github.com/whatwg/html/pull/8199

Differential Revision: https://phabricator.services.mozilla.com/D181263
2023-07-06 15:33:33 +00:00
Cathie Chen 0bb97e3d56 Bug 1836057 - Popover: Use dialog initial focus for dialog popovers, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D179580
2023-06-01 18:16:53 +00:00
Ziran Sun a1e6bb46ed Bug 1829318 - Throw exception when calling dialog.show() on an open popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176141
2023-04-28 14:17:51 +00:00
Masayuki Nakano 60e856a8ab Bug 1680611 - part 8: Mark nsFocusManager::Blur and its callers in nsFocusManager as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147067
2022-05-26 04:37:20 +00:00
Kagami Sascha Rosylight 2919553b00 Bug 1768189 - Part 12: Apply modernize-concat-nested-namespaces to dom/gamepad/windows/WindowsGamepad.cpp ... r=andi
Depends on D145745

Differential Revision: https://phabricator.services.mozilla.com/D145746
2022-05-09 20:41:07 +00:00
Sean Feng eeab40a6f4 Bug 1660271 - Move the focus to the previously focused element when <dialog> is closed r=smaug
This change is based on the latest changes for the <dialog> element in
https://github.com/whatwg/html/pull/6531, such that closing
<dialog> should move the focus to the previously focused element.

Differential Revision: https://phabricator.services.mozilla.com/D109726
2021-04-29 19:35:23 +00:00
Sean Feng a230dc3241 Bug 1200896 - Make the document blocked by the topmost element in the top layer r=emilio
Spec: https://html.spec.whatwg.org/multipage/#blocked-by-a-modal-dialog

Depends on D86392

Differential Revision: https://phabricator.services.mozilla.com/D86227
2020-08-17 15:41:19 +00:00
Mihai Alexandru Michis 74951e33d2 Backed out 3 changesets (Bug 1200896) for causing Bug 1659042.
CLOSED TREE

Backed out changeset 17df14f0b129 (bug 1200896)
Backed out changeset 5d9e9bd12cd2 (bug 1200896)
Backed out changeset 7f016de8d52f (bug 1200896)
2020-08-14 09:06:45 +03:00
Sean Feng 7cf70f6198 Bug 1200896 - Make the document blocked by the topmost element in the top layer r=emilio
Spec: https://html.spec.whatwg.org/multipage/#blocked-by-a-modal-dialog

Differential Revision: https://phabricator.services.mozilla.com/D86227
2020-08-13 19:05:37 +00:00