Commit graph

324 commits

Author SHA1 Message Date
Adam Vandolder
151aa8e164 Bug 1575154 - Add autofocus attribute to HTMLOrForeignElement. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D163753
2022-12-19 15:09:15 +00:00
Narcis Beleuzu
6da804aed4 Backed out changeset 34ec63cced63 (bug 1575154) for causing wpt failures on idlharness.https.html . CLOSED TREE 2022-12-15 23:10:35 +02:00
Adam Vandolder
8a69b66390 Bug 1575154 - Add autofocus attribute to HTMLOrForeignElement. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D163753
2022-12-15 18:37:28 +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
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
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
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
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
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
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
6123594d4f 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
Kagami Sascha Rosylight
05393198e0 Bug 1539884 - Part 12: Mark HTMLInputElement::DispatchSelectEvent as CAN_RUN_SCRIPT r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D134103
2021-12-17 13:27:50 +00:00
Edgar Chen
531ef37175 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
807599b18f 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
ab401654c2 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
Emilio Cobos Álvarez
2dca36cb25 Bug 502258 - Add a Show Password button to <input type=password> controls. r=Gijs
It's controlled by the pref:
layout.forms.input-type-show-password-button.enabled

Differential Revision: https://phabricator.services.mozilla.com/D130407
2021-11-25 20:12:05 +00:00
Edgar Chen
6c7f4da558 Bug 1556351 - Part 3: Rename nsGenericHTMLFormElementWithState to nsGenericHTMLFormControlElementWithState; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124786
2021-10-04 20:51:26 +00:00
Makoto Kato
e63a60f263 Bug 1731931 - More clean up IMEStateManager::SetIMEState. r=masayuki
Depends on D126574

Differential Revision: https://phabricator.services.mozilla.com/D126575
2021-09-27 12:41:40 +00:00
Sean Feng
c01f1a8018 Bug 1729342 - Use delegatesFocus for <input type=date/time/datetime-local> widget r=emilio
Currently datetimebox uses some hardcoded logic to find the edit
field inside the shadow tree and focus it.

Since we have delegatesFocus implemented, we could just use it without
these logic.

Differential Revision: https://phabricator.services.mozilla.com/D125440
2021-09-20 18:33:41 +00:00
Emilio Cobos Álvarez
5b32ac83c1 Bug 1729343 - Use CamelCase in HTMLInputElement::FromClone. r=smaug
That's what the code style asks for. All-lowercase is unseen elsewhere afaict.

Differential Revision: https://phabricator.services.mozilla.com/D124689
2021-09-07 08:25:38 +00:00
Emilio Cobos Álvarez
e20f6d4cce Bug 1729343 - Remove unneeded virtual keywords in HTMLInputElement.h. r=smaug
That's what our code style asks for. Also remove some redundant argument names
but let me know if you'd rather keep them.

Differential Revision: https://phabricator.services.mozilla.com/D124688
2021-09-07 08:25:38 +00:00
Edgar Chen
4c2790a161 Bug 1728664 - Move IsDisabledForEvents out of nsIFormControl; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124319
2021-09-02 13:26:09 +00:00
Edgar Chen
b946d3b81b Bug 1728537 - Part 2: Move RestoreState out of nsIFormControl; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124180
2021-09-01 16:51:58 +00:00
Edgar Chen
7d1d31d3e9 Bug 1728537 - Part 1: Move SaveState out of nsIFormControl; r=smaug
And make it return void as the return value isn't used at callsites.

Differential Revision: https://phabricator.services.mozilla.com/D124179
2021-09-01 16:51:58 +00:00
Edgar Chen
af2f2867e6 Bug 1721349 - Move mSubmitter from HTMLFormSubmission to FormData and make it participate in cycle collection; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D120334
2021-07-21 09:52:20 +00:00
Tom Schuster
b5d465f4cc Bug 1719703 - Implement cancel event on <input type=file>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D119437
2021-07-11 20:05:03 +00:00
Emilio Cobos Álvarez
2b0eae6061 Bug 1715134 - Make form control type an enum class. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117087
2021-06-08 09:43:59 +00:00
Kagami Sascha Rosylight
7185cfec97 Bug 1708228 - Part 3: Remove aNotify from HTMLInputElement::VisitGroup r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113807
2021-04-30 11:25:23 +00:00
Andi-Bogdan Postelnicu
2508edc4c5 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,geckoview-reviewers,agi
Updated with clang-format version 11.0.1 (taskcluster-GI8pmG3eQ_OSXfjFfr2yFw)

\# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D113294
2021-04-26 15:52:25 +00:00
Emilio Cobos Álvarez
c5e28b2599 Bug 1705946 - Add some prefs for datetime-local. r=smaug
This is a bit subtler than needed (ideally we'd just need one pref)
because android enables the support for the type even if it only creates
a textbox.

Co-Authored-By: Fernando García <fernando.garciagomez.01@telefonica.com>

Differential Revision: https://phabricator.services.mozilla.com/D112488
2021-04-18 18:05:54 +00:00
Emilio Cobos Álvarez
737b09dc24 Bug 1702670 - Fix some orange by keeping the UpdateState() call from SetValueChanged unconditionally.
Because the ui-validity bits depend on it.

MANUAL PUSH: Mochitest failures on a CLOSED TREE
2021-04-08 19:05:00 +02:00
Emilio Cobos Álvarez
bae4f3b10e Bug 1702670 - Fix state management for "last value change was interactive" for inputs / textareas. r=smaug
This and "value changed" affect the "too long" and "too short" validity
states.

The validity state tracking code is quite messy...

Differential Revision: https://phabricator.services.mozilla.com/D111254
2021-04-08 16:02:17 +00:00
Dimi Lee
f39a177e9a Bug 1166995 - P2. Call onFormSubmit when a form or a password field is removed from the DOM tree r=sfoster,tgiles,smaug
This patch adds two events - `DOMFormRemoved` and `DOMInputPasswordRemoved`.
These events are notified when a form/password field is removed from
the DOM tree. When the LoginManagerChild receives the event, it calls
_onFormSubmit as the form is submitted.

This patch also adds a WeakFieldSet formlessModifiedPasswordFields to
record all the form-less password fields that users have interacted
with to track whether a formless password is removed

Depends on D106024

Differential Revision: https://phabricator.services.mozilla.com/D106025
2021-03-16 09:15:19 +00:00
Emilio Cobos Álvarez
678b10493d Bug 1698315 - Manage placeholder and autofill preview visibility using CSS rather than custom code. r=masayuki
Should be much simpler and doesn't need to deal with the different
stuff. We already have pseudo-classes for this, :autofill and
:placeholder-shown.

I initially wrote this because this is the only limitation that forces
us to have the placeholder text as a direct child of the text control
frame. In the end I kept that as-is, but this simplification is still
worth it.

We remove dom.placeholder.show_on_focus because it doesn't behave
correctly (it doesn't match the :placeholder-shown pseudo-class and it
should). It was introduced in bug 807613 and never turned to false by
default. I suspect nobody will miss this, but if somebody complains
about it we can reintroduce it properly (handling the pref in DOM
instead, changing the right state bits).

Differential Revision: https://phabricator.services.mozilla.com/D108304
2021-03-15 08:52:43 +00:00
Masayuki Nakano
81be9a4e86 Bug 1681240 - Make TextControlState::SetValueFlags an enum class r=saschanaz
Using integer as a bit field may cause simple mistake and may not be easy
to read, and we have `EnumSet` class which can treat an `enum class` as
a bit flags so that we should make it an `enum class` and use it with the
`EnumSet` class.

Differential Revision: https://phabricator.services.mozilla.com/D99172
2020-12-09 23:34:28 +00:00
Kagami Sascha Rosylight
a2aec71886 Bug 1679461 - Use SetSelectionRange in Select(), regardless of focus state r=masayuki
SelectAll() also is no-op without a frame, so this replaces it with SetSelectionRange.

Differential Revision: https://phabricator.services.mozilla.com/D98184
2020-12-02 19:27:19 +00:00
Bogdan Tara
225a24f0bc Backed out 3 changesets (bug 1677263, bug 1679460, bug 1679461) for test_focus.xhtml failures CLOSED TREE
Backed out changeset 03db12dabc63 (bug 1677263)
Backed out changeset 75de13448090 (bug 1679460)
Backed out changeset 4f4fd8e7ce93 (bug 1679461)
2020-12-02 21:16:28 +02:00