Commit Graph

316 Commits

Author SHA1 Message Date
Olli Pettay
c5e80af013 Bug 1897194 - Form-associated custom elements shouldn't have special handling for :read-write, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D210868
2024-05-21 12:53:14 +00:00
keithamus
dbce97da92 Bug 1888774 - make InvokeAction an enum, "auto" now implicit r=dom-core,sefeng
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
2024-05-15 21:38:06 +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
de09ab0dd6 Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen
Sorry for the massive patch but I found it hard to split without
introducing a bunch of copies around...

This mostly makes necko and DOM agree on which strings to use, which
should result on less copies and conversions.

Differential Revision: https://phabricator.services.mozilla.com/D205601
2024-04-04 11:49:57 +00:00
Vincent Hilla
8cd8ba4bdf Bug 1873738 - Make non-html elements have a directionality. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D204384
2024-03-26 12:54:25 +00:00
Emilio Cobos Álvarez
9b561b6f99 Bug 1881075 - Fix popovertarget attribute update steps. r=zsun
See https://github.com/whatwg/html/issues/10150. Per spec these run even
if the attribute doesn't change.

Differential Revision: https://phabricator.services.mozilla.com/D202240
2024-02-20 18:52: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
Peter Van der Beken
16490228cf Bug 1878045 - Progress element's max property should ignore non-positive values on setting. r=dom-core,edgar
Tests will be in WPT (https://github.com/web-platform-tests/wpt/pull/44355)

Differential Revision: https://phabricator.services.mozilla.com/D200619
2024-02-13 09:02:20 +00:00
Emilio Cobos Álvarez
b9aedffc24 Bug 1850295 - Update :user-{valid,invalid} to follow the spec. r=smaug
(Modulo open spec issues linked in comments)

Differential Revision: https://phabricator.services.mozilla.com/D196986
2024-01-16 11:09:01 +00:00
Emilio Cobos Álvarez
71e771518b Bug 1868552 - Refactor nsIContent::IsFocusable for clarity. r=masayuki
Make it be output-only, not having that confusing in-out tab-index
parameter that is special for XUL to become focusable with
-moz-user-focus: normal. Instead, do that explicitly in
nsIFrame::IsFocusable().

Also, call it IsFocusableWithoutStyle(), since that's what it is.

Differential Revision: https://phabricator.services.mozilla.com/D195644
2023-12-08 11:34:06 +00:00
Masayuki Nakano
fc0a220bac Bug 1863759 - Make IMEStateManager recreate IMEContentObserver if the active one is not observing editable content of focused element r=smaug,m_kato
The test case is a special case that changes focused element from a text control
to an editing host.  Therefore, without a focus change, focused editor is
changed from a `TextEditor` to `HTMLEditor`.  At this time, `IMEContentObserver`
needs to switch the observing target from the anonymous content if `<input>` to
children of it.

However, the editable content becomes completely changed without a focus change
in the DOM.  Therefore, `IMEStateManager` needs to synthesize a fake focus move
for IME.  Therefore, this patch make `IMEStateManager` recreate
`IMEContentObserver` if active one is not observing editable content for the
focused element under "current" conditions at checking it.  (When
`IMEContentObserver` is being destroyed, it sends "blur" notification to IME
and the new `IMEContentObserver` instance posts "focus" notification with
all editable content data.  I.e., recreating `IMEContentObserver` generates
a fake focus move from IME point of view.)

Additionally, there is the opposite case, that is, editing host of an `<input>`
whose type is not a text control may become a text control.  Therefore, this
adds new WPTs to check the handler is the text editor for the text control or
the HTML editor.  The tests passed on Firefox and Chrome at least.

FYI: I guess that in this case, we need to kick `focus` event listener of the
`HTMLEditor`, but anyway, users cannot change the content because it's the
case that an atomic content is the editing host.  Therefore, I don't touch
about that in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D193262
2023-12-05 02:33:18 +00:00
Issam Mani
03b2ed51e3 Bug 1864379 - P1. Don't dispatch LoginManager DOM events for disconnected input elements. r=dimi,emilio
Differential Revision: https://phabricator.services.mozilla.com/D194768
2023-12-04 11:39:19 +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
Mirko Brodesser
2a72b3ab97 Bug 1865610: part 1) Add partial support for the "fetchpriority" attribute for loading style sheets from <link> elements or Link header fields. r=smaug,emilio,valentin
Includes only support for dynamically loading style sheets from `<link>`
elements and `Link` header fields.
The remaining support, including preloading, is completed in part 3.

Differential Revision: https://phabricator.services.mozilla.com/D191745
2023-11-23 14:36:11 +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
Ziran Sun
5fc0e2fb86 Bug 1858912 - Refine popover focusing steps to follow the specs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190917
2023-10-27 13:02:17 +00:00
Mirko Brodesser
c9f82f9c46 Bug 1839315: part 6) Lift code for fetchpriority attribute from nsGenericHTMLElementWithFetchPriorityAttribute to nsGenericHTMLElement. r=smaug
As requested in the review of part 1.

Differential Revision: https://phabricator.services.mozilla.com/D191274
2023-10-23 08:14:51 +00:00
Mirko Brodesser
510fb3abb6 Bug 1839315: part 1) Lift code for fetchpriority attribute from HTMLScriptElement to nsGenericHTMLElementWithFetchPriorityAttribute. r=smaug
Since the HTMLLinkElement requires it too, see part 2.

Differential Revision: https://phabricator.services.mozilla.com/D189935
2023-10-23 08:14:49 +00:00
Emilio Cobos Álvarez
2835e108b2 Bug 1817122 - Use a ToggleEvent for <details> toggle event. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D190060
2023-10-05 11:43:45 +00:00
Norisz Fay
85de591c5d Backed out changeset a879c4fcdc4f (bug 1817122) for causing multiple failures CLOSED TREE 2023-10-05 04:29:13 +03:00
Emilio Cobos Álvarez
0ba6d614b7 Bug 1817122 - Use a ToggleEvent for <details> toggle event. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D190060
2023-10-04 22:01:20 +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
Emilio Cobos Álvarez
76e9b5e83c Bug 1850293 - Make CHECKED/DEFAULT states not intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186933
2023-08-30 09:18:31 +00:00
Emilio Cobos Álvarez
3e9e56e2c8 Bug 1850293 - Make editable states not intrinsic. r=smaug,masayuki
This one is tricky because form controls, though I think I got it right...

This fixes a pre-existing bug where we're not following the spec for readonly
inside content-editable.

I filed this as bug 1850390 but other browsers match the spec so add a test and
fix it while at it. This allows cheaper checks for readonlyness in a couple
places.

Differential Revision: https://phabricator.services.mozilla.com/D186896
2023-08-30 09:18:31 +00:00
Emilio Cobos Álvarez
393b3c94fc Bug 1850293 - Make directionality state not intrinsic. r=smaug
Allows us to reclaim some node bits too.

Differential Revision: https://phabricator.services.mozilla.com/D186893
2023-08-28 23:39:11 +00:00
Sandor Molnar
24e7457734 Backed out 2 changesets (bug 1843035) for causing assertion failures in dom/html/nsGenericHTMLElement.cpp CLOSED TREE
Backed out changeset d44bf85938f0 (bug 1843035)
Backed out changeset 238e99b4449c (bug 1843035)
2023-07-18 17:30:09 +03:00
Mirko Brodesser
9dc774c63c Bug 1843035: part 1) Align unbinding a popover node from the tree closer to the spec. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183381
2023-07-18 08:57:25 +00:00
Ziran Sun
659099f91f Bug 1842845 - Update the togglePopover function to follow the spec updates. r=emilio
https://html.spec.whatwg.org/multipage/popover.html#dom-togglepopover

Differential Revision: https://phabricator.services.mozilla.com/D183572
2023-07-17 08:21:41 +00:00
Mirko Brodesser
5beede8d62 Bug 1841505: postpone setting the popover invoker in the "show popover" algo. r=emilio
See
<https://github.com/whatwg/html/issues/9383#issuecomment-1602227494>.

Differential Revision: https://phabricator.services.mozilla.com/D182709
2023-07-12 10:12:23 +00:00
avandolder
f102e83b63 Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-28 04:31:22 +00:00
Masayuki Nakano
38e75d9885 Bug 1839555 - Get rid of nsIFormControl::AllowDrop r=dom-core,peterv
It was introduced in bug 206859, but the `<input type="text">` in
`<input type="file">` was replaced with `<label>` in bug 345195.
Additionally, it's used only by `EditorBase` to check `<input type="text">`
is in `<input type="file">`.  Therefore, we don't need it anymore.

Differential Revision: https://phabricator.services.mozilla.com/D181599
2023-06-24 00:58:44 +00:00
Emilio Cobos Álvarez
529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Emilio Cobos Álvarez
a1007b18c6 Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 17:22:03 +00:00
Cristian Tuns
f54a728824 Backed out changeset a3e55d5f9f13 (bug 1839223) for causing multiple failures in Document.cpp CLOSED TREE 2023-06-22 11:34:15 -04:00
Emilio Cobos Álvarez
a28183ac0e Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 14:31:16 +00:00
Iulian Moraru
946fa366f4 Backed out changeset 9fb58fa7b8b6 (bug 1556358) for causing wpt failures on ElementInternals-setFormValue.html. CLOSED TREE 2023-06-20 08:16:50 +03:00
avandolder
ebc03e8550 Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-20 01:29:58 +00:00
Natalia Csoregi
0b693ec882 Backed out changeset 08f12e7fa5f0 (bug 1556358) for causing bustage on ElementInternals.cpp. CLOSED TREE 2023-06-19 21:15:17 +03:00
avandolder
23dce8037c Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-19 17:22:01 +00:00
Norisz Fay
496c99b742 Backed out changeset 1680323680fe (bug 1556358) for causing Bb bustages on ElementInternals.cpp CLOSED TREE 2023-06-19 18:33:35 +03:00
Adam Vandolder
c1d69f579f Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Depends on D175542

Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-19 13:44:15 +00:00
Stanca Serban
3b192df9e2 Backed out 3 changesets (bug 1556358) for causing Bb build bustages in ElementInternals.cpp. CLOSED TREE
Backed out changeset f7e94ea82252 (bug 1556358)
Backed out changeset c80f29a9cefc (bug 1556358)
Backed out changeset 413225d91666 (bug 1556358)
2023-06-16 19:46:02 +03:00
Adam Vandolder
de0a2c439f Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Depends on D175542

Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-16 15:02:11 +00:00
Noemi Erli
4d4d467468 Backed out 3 changesets (bug 1556358) for causing bustages in ElementInternals.cpp CLOSED TREE
Backed out changeset 0ebda393786b (bug 1556358)
Backed out changeset c41794eef66a (bug 1556358)
Backed out changeset a07e3e226569 (bug 1556358)
2023-06-15 01:32:38 +03:00
Adam Vandolder
138ee92ee6 Bug 1556358 - Part 2: Save and restore custom element form data. r=edgar
Depends on D175542

Differential Revision: https://phabricator.services.mozilla.com/D174115
2023-06-14 20:59:29 +00:00
Ziran Sun
244d435de7 Bug 1833570 - Reset the popover invoker in showPopover(). r=emilio
As discussed in [1], we need to reset invoker in showPopover(). If not,
It's possible that a closed popover still has an invoker.

[1] https://github.com/whatwg/html/issues/9152

Differential Revision: https://phabricator.services.mozilla.com/D179195
2023-06-06 10:50:33 +00:00
Vincent Hilla
366864bd8a Bug 675943 - Part 3: Clean up after implementing dirname. r=edgar
Depends on D178164

Differential Revision: https://phabricator.services.mozilla.com/D178278
2023-06-06 07:51:37 +00:00
Cosmin Sabou
f429c7dc71 Backed out 3 changesets (bug 675943) for causing wpt unexpected passes.
Backed out changeset 56d084bfc8b8 (bug 675943)
Backed out changeset 8f514549a81c (bug 675943)
Backed out changeset 33fabcece85d (bug 675943)
2023-05-24 14:43:06 +03:00
Mirko Brodesser
896dabd637 Bug 1834493: part 1) Rename PopoverState to PopoverAttributeState. r=emilio
Less confusing.

Differential Revision: https://phabricator.services.mozilla.com/D178770
2023-05-24 10:48:04 +00:00