Commit Graph

856 Commits

Author SHA1 Message Date
Cristian Tuns
d4d88e31ba Backed out changeset 1d4643ee0900 (bug 1267488) for causing mochitest failures in test_focus.xhtml CLOSED TREE 2024-03-05 23:24:53 -05:00
James Teh
e499f47e30 Bug 1267488: If no HTML input radio in a group is checked, only make the first radio in the group tabbable instead of all of them. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D202681
2024-03-05 23:51:48 +00:00
Gregory Pappas
48834b756d Bug 1881845 - Remove nsContentCID.h r=smaug,media-playback-reviewers,karlt
All of these components have been converted to static registration, making this
file unneeded.

Differential Revision: https://phabricator.services.mozilla.com/D202633
2024-03-04 23:41:05 +00:00
Gregory Pappas
3a68660a11 Bug 1878401 - part 1 - Pass BrowsingContext to nsIFilePicker::Init instead of mozIDOMWindow r=geckoview-reviewers,win-reviewers,emilio,nika,m_kato,rkraesig
This will improve the situation in bug 1878336

Differential Revision: https://phabricator.services.mozilla.com/D200546
2024-02-28 21:29:37 +00:00
Sandor Molnar
c853f2f3e9 Backed out 8 changesets (bug 1878401, bug 1879041) for causing build bustages on widget/nsBaseFilePicker.cpp CLOSED TREE
Backed out changeset 2e2b8df3bdd6 (bug 1879041)
Backed out changeset 6d6952f9df2c (bug 1878401)
Backed out changeset 30b5bb590d3e (bug 1878401)
Backed out changeset 9a4b830334b9 (bug 1878401)
Backed out changeset 3c3d67f1fcb7 (bug 1878401)
Backed out changeset c83ba4026822 (bug 1878401)
Backed out changeset 6bcb670ce475 (bug 1878401)
Backed out changeset f263b196df96 (bug 1878401)
2024-02-28 17:56:48 +02:00
Gregory Pappas
44b053ba1a Bug 1878401 - part 1 - Pass BrowsingContext to nsIFilePicker::Init instead of mozIDOMWindow r=geckoview-reviewers,win-reviewers,emilio,nika,m_kato,rkraesig
This will improve the situation in bug 1878336

Differential Revision: https://phabricator.services.mozilla.com/D200546
2024-02-28 15:07:44 +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
Edgar Chen
da474ad32d Bug 1871424 - Make input checkbox/radio in link element work again; r=vhilla,dom-core,smaug
The root cause of issue is that the link elements have not yet adopted the
activation behavior defined in the specification. The appropriate  behavior/model
for links is still under discussion, https://github.com/whatwg/html/issues/1576.
For now, we aim for making it consistent with other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D197393
2024-01-30 09:24:45 +00:00
Greg Stoll
df896d7e12 Bug 1872179 - Part 3: File picker file uploads consult content analysis r=rkraesig,win-reviewers
File picker upload operations check with any connected content analysis
tool before giving access to the web page.

Differential Revision: https://phabricator.services.mozilla.com/D198456
2024-01-22 13:56:07 +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
bc8e14504e Bug 1856156 - Make Directionality an enum class. r=smaug
A bit neater this way.

Differential Revision: https://phabricator.services.mozilla.com/D198590
2024-01-15 19:35:44 +00:00
Emilio Cobos Álvarez
08a8d2d9f1 Bug 1856156 - Recompute auto directionality on input type changes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D198588
2024-01-15 19:35:43 +00:00
Narcis Beleuzu
daaf82679b Backed out changeset 5431daa798c7 (bug 1871424) for causing Bug 1873472 2024-01-12 11:52:07 +02:00
Edgar Chen
1526bae510 Bug 1871424 - Make input checkbox/radio in link element work again; r=vhilla,dom-core
The root cause of issue is that the link elements have not yet adopted the
activation behavior defined in the specification. This patch add a hacky way to
avoid link elements perform activation behavior if it has a child input element
which will perform activation behavior. This patch introduces new flags instead of
reusing the exiting ones, allowing us to uplift this patch more safely.

Differential Revision: https://phabricator.services.mozilla.com/D197393
2024-01-02 15:52:25 +00:00
Vincent Hilla
44057faf90 Bug 1858084 - Make dir=auto and dirname apply to more input types. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D194878
2023-12-19 18:17:22 +00:00
Makoto Kato
7d0bbfd698 Bug 1853797 - HTMLInputElement.showPicker should show the picker on GeckoView even if type is month or week. r=geckoview-reviewers,emilio,ohall
This seems to be a regression by bug 1824323. If we turn on
`dom.forms.datetime.others=true`, we should dispatch `MozOpenDateTimePicker`
event simply.

Differential Revision: https://phabricator.services.mozilla.com/D194760
2023-12-06 02:46:30 +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
181cb4e37a Bug 1864379 - P3. Remove obsolete PWMGR_PASSWORD_INPUT_IN_FORM telemetry probe. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D194770
2023-12-04 11:39:20 +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
Olli Pettay
730a86dc37 Bug 1832026, create TextControlState lazily, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D195383
2023-12-04 10:59:34 +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
Sandor Molnar
0c4309d7be Backed out changeset 4c7dab5cb50c (bug 1864291) for causing multiple failures on test_input_color_picker_popup.html / forms/browser_selectpopup_invoke.js CLOSED TREE 2023-11-15 19:44:05 +02:00
Luke Warlow
66a5b77a67 Bug 1864291 - Implements HandleInvokeInternal for select and input elements. r=smaug
Implements invoketarget defaults for select and input element, as specified in the open-ui "Invokers explainer".

(https://open-ui.org/components/invokers.explainer/)

Differential Revision: https://phabricator.services.mozilla.com/D193363
2023-11-15 14:20:48 +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
Vincent Hilla
65acb7d75a Bug 1855633 - Part 2: Activation behavior method for button element. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D183989
2023-10-30 09:39:27 +00:00
Vincent Hilla
52cf75c910 Bug 1855633 - Part 1: Use activation behavior for submit and image input type. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D187185
2023-10-30 09:39:26 +00:00
Emilio Cobos Álvarez
55403532ed Bug 1861346 - Update indeterminate state when getting added or removed from a radio group. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D191949
2023-10-27 15:30:45 +00:00
Emilio Cobos Álvarez
6a490c3721 Bug 1857506 - Localize final value if needed for input value setter. r=edgar
This restores pre-existing behavior, and adds tests.

Differential Revision: https://phabricator.services.mozilla.com/D190581
2023-10-10 15:12:10 +00:00
Jan Varga
272327b326 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Adam Vandolder
a1cf2d6b5d Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-28 15:47:11 +00:00
Natalia Csoregi
51f7d1bb14 Backed out changeset 8f8492410799 (bug 1685926) for causing bustage on SVGAnimatedPathSegList.cpp. CLOSED TREE 2023-09-28 10:40:31 +03:00
Adam Vandolder
aee8834b7a Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-28 06:35:44 +00:00
Cristian Tuns
f84b646496 Backed out changeset 37ade77d181e (bug 1685926) for causing build bustages in PerformanceEventTiming.cpp CLOSED TREE 2023-09-25 12:40:22 -04:00
Adam Vandolder
305c6a88bf Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-25 14:39:08 +00:00
Vincent Hilla
f8db99493d Bug 1658996 - Part 2: Activation behavior method for non-form submission input elements. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D183988
2023-09-07 09:33:51 +00:00
Emilio Cobos Álvarez
6fd5ddc656 Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187108
2023-08-31 09:20:40 +00:00
Cristina Horotan
c37791a4a6 Backed out 3 changesets (bug 1850238, bug 1850161) for causing multiple failures at Element.cpp CLOSED TREE
Backed out changeset 30526c800ca7 (bug 1850161)
Backed out changeset ebc81e5e7750 (bug 1850161)
Backed out changeset e66a62c2f8c5 (bug 1850238)
2023-08-31 12:12:05 +03:00
Emilio Cobos Álvarez
01b6773528 Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187108
2023-08-31 07:46:24 +00:00
Olli Pettay
e4e84c6564 Bug 1834002 - Avoid InvalidateFrameSubtree in HTMLInputElement::SetCheckedInternal, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187103
2023-08-30 23:16:51 +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
127accb890 Bug 1850293 - Make indeterminate state non-intrinsic. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D187015
2023-08-30 09:18:32 +00:00
Emilio Cobos Álvarez
ff4402054b Bug 1850293 - Make in-range/out-of-range states non-intrinsic. r=smaug
These only apply to input, so it's rather trivial-ish.

Differential Revision: https://phabricator.services.mozilla.com/D186960
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
a6642d0eb9 Bug 1850293 - Make PLACEHOLDER_SHOWN not an intrinsic state. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186932
2023-08-29 00:32:41 +00:00
Markus Stange
70bd936589 Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the nsContentUtils::Dispatch methods. r=smaug
This saves a few queryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186976
2023-08-28 23:38:42 +00:00
serge-sans-paille
1a0259bae5 Bug 1845441 - get rid of global constructors in dom/html/HTMLInputElement.cpp r=mstange,dom-core,mccr8
This requires to make existing Decimal constructor constexpr, which is
incompatible with the weak linkage implied by MFBT_API.

As an alternative, provide a constexpr user-defined-literal that creates
a temporary DecimalLiteral that can be used by a new Decimal constexpr
constructor.

Differential Revision: https://phabricator.services.mozilla.com/D184552
2023-08-23 07:51:44 +00:00
Olli Pettay
22262b6f58 Bug 1843473 - Don't dispatch DOMActivate if there are no listeners for it, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D186473
2023-08-18 06:01:16 +00:00
Masayuki Nakano
33c777c972 Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-07 01:03:58 +00:00