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