Commit Graph

763 Commits

Author SHA1 Message Date
Alexander Surkov
be39f08c40 Bug 1823757 - use parsed atoms for popovertarget attribute, r=emilio
Use parsed atoms to store popovertarget attributes as more effective mechanism to search for ID match in attr associated elements implementation. Followup from D173337.

Differential Revision: https://phabricator.services.mozilla.com/D174786
2023-04-11 00:53:28 +00:00
Tom Schuster
2b97e58ebf Bug 1824323 - Open picker from datetimebox to get current date/time value. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173959
2023-03-29 19:18:41 +00:00
Emilio Cobos Álvarez
18811e46d5 Bug 1750072 - Allow to prevent password revealing/unrevealing. r=mtigley
The idea is that chrome code would be able to call preventDefault(),
then run primary password authentication when needed, then setRevealPassword
again.

Differential Revision: https://phabricator.services.mozilla.com/D173491
2023-03-27 23:30:33 +00:00
Andi-Bogdan Postelnicu
fccbbc6b44 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
011e3fc2d9 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
98c675ed3f 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
2e64d79ba8 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
5e0156c1e4 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
587ddbb864 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
3641a399e3 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
eb8a5041cb 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
c192386b3f 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
817af689cd 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
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