Commit Graph
230 Commits
Author SHA1 Message Date
Keith Cirkel a804178a61 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-12 02:15:08 +00:00
Silaghi 98bf5b0321 Revert "Bug 204494, Bug 2041004 - Add <select> pseudo elements to devtools style inspector r=devtools-reviewers,nchevobbe"
This reverts commit 739a225b8a.

Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit 4b7b2a4083.
2026-06-10 16:55:02 +00:00
Keith Cirkel 4b7b2a4083 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-10 15:27:45 +00:00
Silaghi 50913f8313 Revert "Bug 2044945, Bug 2041004 - Add <select> psuedo elements to devtools style inspector r=devtools-reviewers,nchevobbe" for causing wr failures at select-appearance-disabled.html
This reverts commit 6b8775f47f.

Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit e3529d76f3.
2026-06-10 10:08:51 +00:00
Keith Cirkel e3529d76f3 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-10 08:20:21 +00:00
Alexandru Marc ca229e12ac Revert (Bug 2044945, Bug 2041004) for causing wr failures @ select-explicit-size.html
This reverts commit b434b10988.

Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit e92bda8433.
2026-06-09 19:14:13 +00:00
Keith Cirkel e92bda8433 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-09 17:37:46 +00:00
Sandor Molnar 15b6e590cd Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio" for causing wpt failures
This reverts commit 8ecfcdcb81.
2026-06-08 17:32:43 +00:00
Keith Cirkel 8ecfcdcb81 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-08 16:00:35 +00:00
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
Jan-Niklas Jaeschke 64079ed7ab Bug 1974784 - Customizable Select: Support options inside wrapper elements. r=emilio
Extends the option list, disabled state, and optgroup notification logic to
handle options nested inside wrapper elements (e.g. <div> inside <select>),
per the spec's "list of options" and "concept-option-disabled" algorithms.

Differential Revision: https://phabricator.services.mozilla.com/D290555
2026-06-03 19:06:13 +00:00
Jan-Niklas Jaeschke 03b7ff43b3 Bug 2038588 - Customizable Select: Implement selectedcontent update machinery. r=emilio
Implements the algorithms that keep <selectedcontent> elements in sync with
the selected <option>: RunSelectednessSettingAlgorithm (replaces
CheckSelectSomething), ScheduleSelectedContentUpdate /
UpdateDescendantSelectedContentElements (microtask-based), per-element
CloneOptionIntoSelectedContent, and HTMLSelectedContentElement BindToTree
disabled computation per PR #12263.

Differential Revision: https://phabricator.services.mozilla.com/D290554
2026-06-03 19:06:11 +00:00
Alexandru Marc 244264d460 Revert (Bug 1974784, Bug 2038588) for causing wpt failures @ options-length-too-large.html
This reverts commit f8f9651896.

Revert "Bug 2038588 - Customizable Select: Implement selectedcontent update machinery. r=emilio"

This reverts commit 0d1eba0a10.
2026-06-02 15:29:25 +00:00
Jan-Niklas Jaeschke f8f9651896 Bug 1974784 - Customizable Select: Support options inside wrapper elements. r=emilio
Extends the option list, disabled state, and optgroup notification logic to
handle options nested inside wrapper elements (e.g. <div> inside <select>),
per the spec's "list of options" and "concept-option-disabled" algorithms.

Differential Revision: https://phabricator.services.mozilla.com/D290555
2026-06-01 12:55:52 +00:00
Jan-Niklas Jaeschke 0d1eba0a10 Bug 2038588 - Customizable Select: Implement selectedcontent update machinery. r=emilio
Implements the algorithms that keep <selectedcontent> elements in sync with
the selected <option>: RunSelectednessSettingAlgorithm (replaces
CheckSelectSomething), ScheduleSelectedContentUpdate /
UpdateDescendantSelectedContentElements (microtask-based), per-element
CloneOptionIntoSelectedContent, and HTMLSelectedContentElement BindToTree
disabled computation per PR #12263.

Differential Revision: https://phabricator.services.mozilla.com/D290554
2026-06-01 12:55:50 +00:00
Keith Cirkel 34e36f0ceb Bug 2012698 - Part 3 - Introduce UA styles for button>select r=layout-reviewers,firefox-style-system-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D295336
2026-05-19 11:20:42 +00:00
Keith Cirkel cdaa222e55 Bug 2012698 - Part 2 - Introduce <button> slotting logic for <select> r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D295335
2026-05-19 11:20:38 +00:00
Serban Stanca 7fa5be89eb Revert "Bug 2012698 - Part 3 - Introduce UA styles for button>select r=layout-reviewers,firefox-style-system-reviewers,dshin" for causing wpt failures in select-keyboard-behavior.optional.html.
This reverts commit 156e44f134.

This reverts commit 605aec697f.
2026-05-18 19:09:54 +00:00
Keith Cirkel 156e44f134 Bug 2012698 - Part 3 - Introduce UA styles for button>select r=layout-reviewers,firefox-style-system-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D295336
2026-05-18 14:31:26 +00:00
Keith Cirkel 605aec697f Bug 2012698 - Part 2 - Introduce <button> slotting logic for <select> r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D295335
2026-05-18 14:31:22 +00:00
Jan-Niklas Jaeschke 4ad66d8a49 Bug 2039471 - Fix AssertedCast crash in HTMLSelectElement::GetCurrentOption. r=keithamus
With lifted select parser restrictions, non-option content like <math> inside
<select> can trigger scrollBy() during parsing, which sets mEndSelectionIndex
to the raw negative value from JS. GetCurrentOption only checked for the -1
sentinel, not arbitrary negatives. Check >= 0 instead.

Differential Revision: https://phabricator.services.mozilla.com/D300539
2026-05-14 13:40:38 +00:00
agoloman 26bd847339 Revert "Bug 2012698 - Part 3 - Introduce UA styles for button>select r=layout-reviewers,firefox-style-system-reviewers,dshin" for causing reftest failures @combobox-zoom.html.
This reverts commit e4e3c6dc79.

Revert "Bug 2012698 - Part 2 - Introducing `<button>` slotting logic for `<select>` r=dom-core,jjaschke"

This reverts commit 7350d4683b.
2026-05-05 20:59:12 +00:00
Keith Cirkel 7350d4683b Bug 2012698 - Part 2 - Introducing <button> slotting logic for <select> r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D295335
2026-05-05 19:31:04 +00:00
Emilio Cobos Álvarez 1ddad57128 Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug
Make them concrete classes rather than interfaces, and make the
inheritance chain simpler.

Differential Revision: https://phabricator.services.mozilla.com/D296484
2026-04-28 07:38:27 +00:00
Emilio Cobos Álvarez b9a0d71900 Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug
Make nsIHTMLCollection the first base for nsContentList and co, since
it's needed for WebIDL bindings to work properly and shouldn't change
behavior in practice.

Move the handling of selected option and validity to HTMLSelectElement's
mutation observer.

Differential Revision: https://phabricator.services.mozilla.com/D295818
2026-04-28 07:38:24 +00:00
agoloman 8d40053465 Revert "Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug" for causing failures @nsContentList.cpp.
This reverts commit fd37a5a8cb.
2026-04-28 06:17:53 +00:00
Silaghi ce61f876cc Revert "Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug" for causing wpt failures at BaseContentList
This reverts commit cde3e5607b.
2026-04-28 03:43:46 +00:00
Emilio Cobos Álvarez cde3e5607b Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug
Make them concrete classes rather than interfaces, and make the
inheritance chain simpler.

Differential Revision: https://phabricator.services.mozilla.com/D296484
2026-04-28 00:24:11 +00:00
Emilio Cobos Álvarez fd37a5a8cb Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug
Make nsIHTMLCollection the first base for nsContentList and co, since
it's needed for WebIDL bindings to work properly and shouldn't change
behavior in practice.

Move the handling of selected option and validity to HTMLSelectElement's
mutation observer.

Differential Revision: https://phabricator.services.mozilla.com/D295818
2026-04-27 23:07:56 +00:00
Emilio Cobos Álvarez 6bab8418f9 Bug 2028130 - Introduce a select picker. r=keithamus,jjaschke
This fixes display: inherit on options while at it but I think it's
worth doing as-is.

Differential Revision: https://phabricator.services.mozilla.com/D294212
2026-04-14 23:46:46 +00:00
Emilio Cobos Álvarez fe182cca64 Bug 2025271 - Simplify DOMString. r=smaug,nika,extension-reviewers,core-sessionstore-reviewers,dom-worker-reviewers,robwu,asuth
Make DOMString a regular nsAutoTString with some special methods for
performance in some hot getters. For that, we need to change a bit
nsTString:

 * Support for unowned buffers: Owned buffers now are represented by
   STRINGBUFFER|OWNED flags, rather than REFCOUNTED.

 * Inlining of the destructor: It showed up in profiles, it's also just
   a few instructions, so probably worth it. We could OOL the owned path
   I guess, if we wanted to.

 * Inlinling and reordering of NonVoidStringToJsval. Old code had
   special DOMString path inline with [buffer, literal, copy] paths,
   then out of line code with [literal, buffer, copy]. Instead,
   consolidate everything in a [buffer, literal, copy] inline path.
   Do the same for UTF8/Latin1 strings too for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D288148
2026-04-13 09:33:54 +00:00
Emilio Cobos Álvarez 9998e4c779 Bug 2023453 - Remove HTMLSelectEventListener. r=dom-core,keithamus
This will allow events to get handled with customizable select.

HasPrimaryAction for listboxes needs to be overridden since before it
was returning true because of the listener:

  https://searchfox.org/firefox-main/rev/7b08fa00f500ed877b16983a6a77d2c852aad1d0/accessible/generic/LocalAccessible.cpp#3433-3435

Without that, we fail
devtools/server/tests/browser/browser_accessibility_keyboard_audit.js

Differential Revision: https://phabricator.services.mozilla.com/D287830
2026-03-26 13:29:14 +00:00
Emilio Cobos Álvarez 540e192403 Bug 2025402. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D289495
2026-03-26 12:28:34 +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
Emilio Cobos Álvarez 714d4253e0 Bug 2023454 - Rename ::-moz-select-picker-icon to just ::picker-icon. r=keithamus
And expose it with the custom select flag enabled.

We need to tweak parsing to avoid parsing it as a fully element-backed
pseudo-element (per spec).

Differential Revision: https://phabricator.services.mozilla.com/D287827
2026-03-17 15:48:27 +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
rperta cf745cdb89 Revert "Bug 2023454 - Rename ::-moz-select-picker-icon to just ::picker-icon. r=keithamus" for causing wpt failures at picker-icon-pseudo-element.html
This reverts commit 1769a0c24a.
2026-03-16 20:53:17 +00:00
Emilio Cobos Álvarez 1769a0c24a Bug 2023454 - Rename ::-moz-select-picker-icon to just ::picker-icon. r=keithamus
And expose it with the custom select flag enabled.

We need to tweak parsing to avoid parsing it as a fully element-backed
pseudo-element (per spec).

Differential Revision: https://phabricator.services.mozilla.com/D287827
2026-03-16 19:44:53 +00:00
Emilio Cobos Álvarez 51daf85573 Bug 2018033 - Attach <select> shadow DOM on bind. r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D284184
2026-02-25 02:06:55 +00:00
Cristian Tuns 547f489db1 Revert "Bug 2018033 - Attach <select> shadow DOM on bind. r=dom-core,smaug" for causing multiple failures on debug.
This reverts commit 54b0d5da03.

Revert "Bug 2018033 - Tweak an assertion."

This reverts commit cae353e821.
2026-02-24 11:07:57 +00:00
Emilio Cobos Álvarez cae353e821 Bug 2018033 - Tweak an assertion. 2026-02-24 10:45:15 +00:00
Emilio Cobos Álvarez 54b0d5da03 Bug 2018033 - Attach <select> shadow DOM on bind. r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D284184
2026-02-24 10:07:59 +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 adf12b1d41 Bug 2014604 - Prevent empty select when inserting with selected attribute via the parser. r=dom-core,smaug
It seems this is a somewhat-known behavior of our implementation (see
the comments before the code I just added).

Basically the parser inserts an (empty) <option selected>, but then
doesn't notify when it appends the option text, so we fail to update the
value. Since validation and such deals with it in DoneAddingChildren,
seems fair to do the same here.

Differential Revision: https://phabricator.services.mozilla.com/D282094
2026-02-06 14:43:03 +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
Emilio Cobos Álvarez 3271cb4e57 Bug 2013887 - Remove nsISelectControlFrame. r=layout-reviewers,jfkthame
After bug 2011709, there's only one implementation of this.

Differential Revision: https://phabricator.services.mozilla.com/D281453
2026-02-04 12:00:31 +00:00
Emilio Cobos Álvarez 4021464773 Bug 2011709 - Make combobox select use a shadow tree for its contents. r=jjaschke,layout-reviewers,firefox-style-system-reviewers,accessibility-platform-reviewers,smaug,Jamie,jfkthame,dshin
For now, replicate the label + icon structure.

Use pseudo-elements for them. We could use select.css instead, but we
need a way to to prevent the display fix-up from applying (this is
needed because otherwise <select style=display:flex> starts getting the
label and button on different lines), and pseudo-elements is easier.

Use a <span> for the icon since we basically otherwise have a hidden,
unfocusable button and it simplifies the styling that way.

Use the same for the input file content since it simplifies the logic on
the frame constructor.

nsListControlFrame gets some clean-up as well since I was trying to make
sense of nsISelectFrame, but I could split that out if needed.

Tests for bug 323656 fail now because it tests explicit inheritance from
the <select> to the <option>, and now that goes through a <slot>.

Other elements have the same issue, see
https://github.com/whatwg/html/issues/3748. So for now remove those
tests.

Differential Revision: https://phabricator.services.mozilla.com/D280041
2026-02-03 14:33:36 +00:00
serge-sans-paille 1f953987a5 Bug 1993127 - Remove unused inclusion of Attributes.h from dom/* r=emilio,media-playback-reviewers,webrtc-reviewers,firefox-svg-reviewers,mjf,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D269713
2025-10-24 08:54:35 +00:00