Commit Graph

750 Commits

Author SHA1 Message Date
Zach Hoffman
9f047ec938 Bug 1805105 - Drive-by: Remove an unused include leftover from D163780 r=emilio
Depends on D164424

Differential Revision: https://phabricator.services.mozilla.com/D164944
2022-12-19 13:06:50 +00:00
Tom Schuster
cdeab032f9 Bug 960984 - Implement the list attribute for <input type=color>. r=emilio,geckoview-reviewers,m_kato
UI support on Windows and Linux. macOS and Android are not supported.

Differential Revision: https://phabricator.services.mozilla.com/D163796
2022-12-14 18:17:59 +00:00
Adam Vandolder
98d413b5a9 Bug 1804270 - Sanitize multiple values in an email input correctly. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D163965
2022-12-12 16:07:56 +00:00
Zach Hoffman
4a78925c90 Bug 1803118 - Snap mouse to <input type=range> tick marks r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163780
2022-12-08 12:27:22 +00:00
Stanca Serban
ea282bb530 Backed out changeset 4970c9b75aad (bug 1803118) for causing wpt failures on range-snap-to-tick-marks. CLOSED TREE 2022-12-08 10:22:52 +02:00
Zach Hoffman
95e70080c4 Bug 1803118 - Snap mouse to <input type=range> tick marks r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163780
2022-12-08 04:01:28 +00:00
Zach Hoffman
a16737a3eb Bug 1803303 - Make HTMLInputElement::ValueIsStepMismatch() parameter constant r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163760
2022-12-03 08:57:28 +00:00
Zach Hoffman
a316eff7b0 Bug 1803303 - Do not display input range tick marks that are step mismatches r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163521
2022-12-02 16:48:40 +00:00
Zach Hoffman
67f7af1ef8 Bug 841942 - Display tick marks for <input type=range> when @list/<datalist> is used r=emilio,credential-management-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D162882
2022-11-28 22:06:33 +00:00
Jonathan Kew
d23245129e Bug 1801380 - Don't call RecomputeDirectionality() if the element has dir=auto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D162462
2022-11-19 21:06:04 +00:00
Jonathan Kew
1ab520226e Bug 1665655 - Implement the HTML spec special-case of directionality for <input type=tel>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D162133
2022-11-16 15:42:17 +00:00
Norisz Fay
53a2157449 Backed out changeset 37b80bf4bf5a (bug 1665655) for causing multiple StyleSheet related failures CLOSED TREE 2022-11-16 16:57:27 +02:00
Jonathan Kew
3633364c03 Bug 1665655 - Implement the HTML spec special-case of directionality for <input type=tel>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D162133
2022-11-16 14:12:16 +00:00
Masayuki Nakano
62fe803013 Bug 1795620 - Make it work better to activate/inactivate checkboxes and radio buttons like the other browsers r=smaug
First, the test compares `document.querySelector(":active")` and a checkbox or
a radio button.  However, Gecko activates ancestor elements too.  Therefore,
Gecko returns `<html>` element or `null` for the selector.  However, this is
an issue of CSS pseudo class compatibility which is **not** scope of the test.
Therefore, this patch makes it compare `document.querySelector("input:active")`
and a checkbox or a radio button instead.

Next, Gecko does not activate checkboxes and radio buttons when user presses
the space key, but the other browsers do it.  Therefore, this patch makes
`HTMLInputElement::PostHandleEvent` do it and
`EventStateManager::PostHandleEvent` clear it at `keyup` of the space key.

Next, Gecko does not inactive active elements when it gets lost focus.
Therefore, this patch makes `nsFocusManager::NotifyFocusStateChange` do it
like the other browsers.

Finally, with manual testing of draft patches, I found some issues of
inactivating them when they are activated by `<label>`s.  Therefore, I add new
tests in a separate file.  Note that Chrome fails only in the cases testing
`<input type="radio">` with `<label>`.

Differential Revision: https://phabricator.services.mozilla.com/D160494
2022-11-11 13:55:14 +00:00
Adam Vandolder
357062f28e Bug 1795887 - Fix IsValueMissing update for certain input types. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D159592
2022-10-22 16:34:48 +00:00
Emilio Cobos Álvarez
3be7ef3b4c Bug 1788698 - Force focus rings when focused input switches to text control. r=smaug
Seems somewhat reasonable to do this, if we wanted to, since
nsFocusManager also makes these always match :focus-visible.

If you think it's worth doing I can add a test quite trivially.

Differential Revision: https://phabricator.services.mozilla.com/D158186
2022-10-13 14:57:35 +00:00
Jan-Niklas Jaeschke
88991698bc Bug 1679474 - Removed DispatchSelectEvent from HTMLInputElement::PostHandleEvent. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D154776
2022-08-24 09:23:39 +00:00
Adam Vandolder
3eba65a5b1 Bug 1749677 - Do not trigger change, input, or focus events on untrusted keypress events for input elements. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D154854
2022-08-18 13:15:12 +00:00
Emilio Cobos Álvarez
b7aeba4a07 Bug 1779348 - Clear FileList after files changed. r=smaug
This matches Chrome and Safari. Also add a test for FileList being
shareable between DataTransfer and input, which seems to be in the
intention of the spec and matches our pre-existing behavior, the
behavior of input-to-input FileList handling, and Safari, but not
Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D152367
2022-07-21 11:06:18 +00:00
Emilio Cobos Álvarez
35e57869d6 Bug 1771806 - Record last interactive value in TextControlState. r=masayuki
One unfortunate-ish thing of storing it in TextControlState is that we
can't preserve it across type changes, but that seems ok for now
according to my conversations with Serg.

In the future we might want to move the value to HTMLInputElement itself
or something, we'll see, but this should help folks fix some
long-standing quality issues in the password manager / autofill
implementation.

Differential Revision: https://phabricator.services.mozilla.com/D150148
2022-06-28 08:49:12 +00:00
Kagami Sascha Rosylight
263a1b33af Bug 1774035 - Stop opening pickers from disabled input elements r=smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D149157
2022-06-14 18:31:09 +00:00
Cristian Tuns
c74c6ccaa9 Backed out changeset f7603664ef19 (bug 1774035) for causing wpt failures on spelling-markers-009.html CLOSED TREE 2022-06-14 13:59:02 -04:00
Kagami Sascha Rosylight
86fe2bd8dc Bug 1774035 - Stop opening pickers from disabled input elements r=smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D149157
2022-06-14 17:27:22 +00:00
Butkovits Atila
0e2671bd63 Backed out changeset 84317cf0446c (bug 1774035) for causing crashes at mozilla::dom::HTMLInputElement. CLOSED TREE 2022-06-14 17:58:59 +03:00
Kagami Sascha Rosylight
b146681511 Bug 1774035 - Stop opening pickers from disabled input elements r=smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D149157
2022-06-14 14:14:21 +00:00
Emilio Cobos Álvarez
54fb7a2e28 Bug 1773070 - While at it rename ContentStateChanged to ElementStateChanged, and make it take elements. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148553
2022-06-07 23:09:54 +00:00
Emilio Cobos Álvarez
9decd52335 Bug 1773070 - While at it use some better names for some bits. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148538
2022-06-07 23:09:53 +00:00
Emilio Cobos Álvarez
1c58e2a928 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Emilio Cobos Álvarez
86e6e57ba0 Bug 1766395 - Remove dom.forms.datetime-local prefs. r=edgar
We shipped this a while ago.

Differential Revision: https://phabricator.services.mozilla.com/D144800
2022-04-27 14:10:27 +00:00
Tom Schuster
74ad5c289f Bug 1745005 - Add showPicker() to <input> elements. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142754
2022-04-22 18:43:48 +00:00
criss
a2a5bc115b Backed out changeset fa6795d107b1 (bug 1745005) for causing multiple failures. CLOSED TREE 2022-04-13 13:23:03 +03:00
Tom Schuster
70f5031d8c Bug 1745005 - Add showPicker() to <input> elements. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142754
2022-04-13 07:35:57 +00:00
Edgar Chen
5b3d18e3a9 Bug 1760560 - Remove directory upload API; r=smaug
HTMLInputElement.getFilesAndDirectories is used for testing Directory API, so
still keep it but mark as chrome only.

Differential Revision: https://phabricator.services.mozilla.com/D142444
2022-04-04 09:54:34 +00:00
Emilio Cobos Álvarez
62cddf479c Bug 1760709 - Take directionality into account when handling left/right on radios. r=smaug
We have similar code for range inputs. This matches Blink (but not
WebKit), but I think it's a better default.

The spec seems to leave this up to UAs, so for now landing a
moz-specific WPT. Should be trivial to upstream if we want.

Depends on D141705

Differential Revision: https://phabricator.services.mozilla.com/D141706
2022-03-22 11:10:54 +00:00
Emilio Cobos Álvarez
4975a01d8f Bug 1760709 - Remove some useless namespacing in HTMLInputElement. r=smaug
Drive-by cleanups.

Differential Revision: https://phabricator.services.mozilla.com/D141705
2022-03-22 11:10:53 +00:00
Sylvestre Ledru
35a175aa33 Bug 1754767 - Remove duplicate includes r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D138441
2022-02-11 10:01:15 +00:00
Emilio Cobos Álvarez
7817a9157e Bug 1752651 - Clone indeterminateness of input elements. r=smaug
Matches other browsers and makes sense.

Differential Revision: https://phabricator.services.mozilla.com/D137442
2022-01-31 13:14:46 +00:00
Ting-Yu Lin
e2882f10c3 Bug 1751473 Part 2 - Use CSSIntPoint instead of nsIntPoint in image event handling code. r=emilio
The old code operates in the CSS pixel coordinate, so we should use the type
system to express that. With this patch, nsImageControlFrame, nsImageFrame, and
nsImageMap now have no usage of nsIntPoint.

Differential Revision: https://phabricator.services.mozilla.com/D136647
2022-01-22 01:07:19 +00:00
Emilio Cobos Álvarez
c6ab316b20 Bug 1743047 - Use "reveal" rather than show terminology consistently for the reveal password button. r=Gijs,fluent-reviewers
The pseudo-class and nsContextMenu context attribute were using reveal,
the pseudo-element and webidl attribute were using "show".

Use reveal consistently and update the accesskey so that there aren't
conflicts with existing commands. Also enable the feature in
browser_contextmenu_input.js so that this change is tested.

Differential Revision: https://phabricator.services.mozilla.com/D136086
2022-01-17 14:18:51 +00:00
Edgar Chen
a64fa1be22 Bug 1695636 - Part 3: Do not trigger form submission or click event for untrusted key event; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D135464
2022-01-12 14:24:02 +00:00
Edgar Chen
907da6d2bb Bug 1695636 - Part 2: Handle form submission for keypress event in a central place; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D135675
2022-01-12 14:24:02 +00:00
Edgar Chen
e28e8ef0c3 Bug 1695636 - Part 1: Remove nsresult return value from HTMLInputElement::MaybeSubmitForm; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D135226
2022-01-12 14:24:01 +00:00
Emilio Cobos Álvarez
004bc91c2f Bug 1749590 - Don't do localization shenanigans for <input type=range>. r=edgar
It should never need to deal with a localized value, unlike
<input type=number>.

Differential Revision: https://phabricator.services.mozilla.com/D135673
2022-01-12 04:42:43 +00:00
Emilio Cobos Álvarez
8b56890b85 Bug 1735076 - Use ProgrammaticFocusFlags from nsXULCommandDispatcher. r=smaug
Relevant calls are here:

  https://searchfox.org/mozilla-central/rev/21a9b72545da06681db97c4b3a2a6be761f4aae5/toolkit/content/widgets/button.js#42-68

This makes sure to set the FLAG_BYKEY properly if needed, instead of passing
down raw flags to nsFocusManager. Clean up a bit while at it.

Let me know if you want a test for this, but we have tests for programmatic
focus and :focus-visible already, so my gut feeling is that testing this
particular XUL-specific change is not super-worth-it...

Differential Revision: https://phabricator.services.mozilla.com/D133690
2021-12-23 18:34:05 +00:00
Noemi Erli
bbc247e24d Backed out changeset 93b9da069dde (bug 1735076) for causing failures in browser_searchbar_openpopup.js CLOSED TREE 2021-12-21 21:53:42 +02:00
Emilio Cobos Álvarez
b25df9b5ea Bug 1735076 - Use ProgrammaticFocusFlags from nsXULCommandDispatcher. r=smaug
Relevant calls are here:

  https://searchfox.org/mozilla-central/rev/21a9b72545da06681db97c4b3a2a6be761f4aae5/toolkit/content/widgets/button.js#42-68

This makes sure to set the FLAG_BYKEY properly if needed, instead of passing
down raw flags to nsFocusManager. Clean up a bit while at it.

Let me know if you want a test for this, but we have tests for programmatic
focus and :focus-visible already, so my gut feeling is that testing this
particular XUL-specific change is not super-worth-it...

Differential Revision: https://phabricator.services.mozilla.com/D133690
2021-12-21 18:22:30 +00:00
championshuttler
099fc2222d Bug 1724706 - Remove Obsolete comment in HTMLInputElement::AfterSetFilesOrDirectories.r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132394
2021-11-29 23:18:27 +00:00
Edgar Chen
c0e4a58a2e Bug 1556364 - Part 2-1: Split nsGenericHTMLFormControlElement-only members from nsIConstraintValidation to a separated class; r=smaug
As ElementInternal has it own implmentation.

Differential Revision: https://phabricator.services.mozilla.com/D130259
2021-11-26 11:47:39 +00:00
Marian-Vasile Laza
1e7f538843 Backed out 5 changesets (bug 1556364) for causing web-platform test failures. CLOSED TREE
Backed out changeset dabffbe71a31 (bug 1556364)
Backed out changeset 76fc30f27c39 (bug 1556364)
Backed out changeset f6f7f949551f (bug 1556364)
Backed out changeset c77ef41d43d4 (bug 1556364)
Backed out changeset 2c8c74e99e47 (bug 1556364)
2021-11-26 05:01:08 +02:00
Edgar Chen
d577441402 Bug 1556364 - Part 2-1: Split nsGenericHTMLFormControlElement-only members from nsIConstraintValidation to a separated class; r=smaug
As ElementInternal has it own implmentation.

Differential Revision: https://phabricator.services.mozilla.com/D130259
2021-11-25 21:58:04 +00:00