Commit graph

760 commits

Author SHA1 Message Date
Andi-Bogdan Postelnicu
fa5d4cca1f Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 11:35:33 +00:00
Andi-Bogdan Postelnicu
10f49d4180 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Stanca Serban
e31a178029 Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu
0b692b5a96 Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 09:27:57 +00:00
Andi-Bogdan Postelnicu
a5d28acdd6 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
Adam Vandolder
cef37d1f81 Bug 1821569 - Align number input sanitization with the spec. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D172198
2023-03-13 18:37:30 +00:00
Ray Kraesig
7b51dc72b7 Bug 1816740 [5/6] - convert nsIFilePicker::capture* to a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
Convert the various capture* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.

Additionally, unlike the previous two enums, reduce the size of
CaptureTarget to 8 bits. This is a workaround for its use with
nsAttrValue, which at present very specifically requires that parseable
enums' values fit within an `int16_t` -- and a `uint16_t` does not.

Differential Revision: https://phabricator.services.mozilla.com/D169854
2023-02-22 21:05:24 +00:00
Ray Kraesig
fa4832237d Bug 1816740 [4/6] - convert nsIFilePicker::mode* into a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
Convert the various mode* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.

Differential Revision: https://phabricator.services.mozilla.com/D169853
2023-02-22 21:05:24 +00:00
Ray Kraesig
8ff42fa236 Bug 1816740 [3/6] - convert nsIFilePicker::result* into a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
Convert the various result* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.

Differential Revision: https://phabricator.services.mozilla.com/D169852
2023-02-22 21:05:23 +00:00
Adam Vandolder
1e9c502e31 Bug 1809689 - Activate first checkbox with activation behaviour. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D166569
2023-01-16 15:32:17 +00:00
Zach Hoffman
54c46a0d93 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
a93e3a2add 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
354351ea87 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
56a611456b 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
0310ad663a 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
515316f6d4 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
955f66c74f 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
2079ccbe42 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
6978315eec 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
75c3be2a1e 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
06ebad6fd8 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
8cfe1317c1 Backed out changeset 37b80bf4bf5a (bug 1665655) for causing multiple StyleSheet related failures CLOSED TREE 2022-11-16 16:57:27 +02:00
Jonathan Kew
03faf8f9cb 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
f22596686b 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
f7d84f0ab3 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
d6826d19e4 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
44ff67ed82 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
141360cc00 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
76c821a68d 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
569a522d01 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
e6f990030e 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
2d9984e456 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
9976ecf87c 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
7b1c9fc461 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
7fc6a55ae2 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
12bd84f0c5 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
47afabb81a 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
255763ef57 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
72d2420c2b 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
eed1aead2d 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
1ce796a4ee Backed out changeset fa6795d107b1 (bug 1745005) for causing multiple failures. CLOSED TREE 2022-04-13 13:23:03 +03:00
Tom Schuster
43b158ae1a 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
c82b0711e1 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
5101af9a94 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
0b00fcf9fd 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
98949ee751 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
fcbb87eb0f 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
03683daeeb 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
8ce808ebbd 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
8936a84092 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