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
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.
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
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.
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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