Commit Graph
939 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 4ee57eaa25 Bug 1974833 - Don't localize numbers on HTML input value setter. r=masayuki,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D256094
2025-07-04 23:00:59 +00:00
Emilio Cobos Álvarez ea8f2f73aa Bug 1974833 - Make StringToDecimal follow HTML rules for what a floating point number is. r=masayuki,dom-core
Without this, the next patch in this series causes failures in
html/semantics/forms/the-input-element/number.html and co.

Differential Revision: https://phabricator.services.mozilla.com/D256137
2025-07-04 23:00:56 +00:00
Vincent Hilla 48dc6f0385 Bug 1970030 - Let input element keep a wheel event cancelable. r=edgar
When a user sets the pref dom.input.number_and_range_modified_by_mousewheel,
the input element needs to default prevent the wheel event to cancel scrolling.

Therefore it has to prevent the event from becoming uncancelable if there is no
passive listener.

Differential Revision: https://phabricator.services.mozilla.com/D253132
2025-06-17 09:10:26 +00:00
Keith Cirkel 99d03f00d6 Bug 1950338 - Part 7: Move command&commandfor logic to HTMLButtonElement r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D252517
2025-06-12 15:00:50 +00:00
agoloman 025ccdad29 Revert "Bug 1950338: apply code formatting via Lando" for causing build bustages @CommandEvent.cpp.
This reverts commit d33dcda2c6.

Revert "Bug 1950338 - Part 8: Rename invoketarget->commandfor, invokeaction->command r=webidl,devtools-reviewers,nchevobbe,smaug"

This reverts commit 0fe8930d32.

Revert "Bug 1950338 - Part 7: Move command&commandfor logic to HTMLButtonElement r=smaug"

This reverts commit 5a9255cd0b.

Revert "Bug 1950338 - Part 6: Rename invoker functions to command functions r=dom-core,masayuki"

This reverts commit 76f840a55a.

Revert "Bug 1950338 - Part 5: Remove InvokeEvent, migrate .invoker to CommandEvent .source r=webidl,devtools-reviewers,nchevobbe,emilio,smaug"

This reverts commit f7d2727969.

Revert "Bug 1950338 - Part 4: Move invokeTargetElement, invokeAction to HTMLButtonElement IDL r=webidl,smaug"

This reverts commit a7a025a843.

Revert "Bug 1950338 - Part 3: Expose CommandEvent in commandfor pref; move from chrome-webidl to webidl r=webidl,emilio"

This reverts commit eb133a45e6.

Revert "Bug 1950338 - Part 2: Move invokers meta ini to correct directory r=dom-core,sefeng"

This reverts commit face866adb.

Revert "Bug 1950338 - Part 1: Rename `dom.element.invokers` flag to `dom.element.commandfor` r=webidl,devtools-reviewers,nchevobbe,smaug"

This reverts commit 532bb887b5.
2025-06-12 14:53:31 +00:00
Keith Cirkel 5a9255cd0b Bug 1950338 - Part 7: Move command&commandfor logic to HTMLButtonElement r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D252517
2025-06-12 12:57:33 +00:00
Sajid Anwar 7b80b1b2b7 Bug 825197 - Throw TypeError when providing infinite number to HTMLInputElement.valueAsNumber. r=avandolder
Also added two new Web Platform Tests to validate TypeError from `valueAsNumber` and `valueAsDate`, which are the
only two TypeError conditions in the HTML Input specification: https://html.spec.whatwg.org/multipage/input.html

Differential Revision: https://phabricator.services.mozilla.com/D252270
2025-06-10 16:25:36 +00:00
Edgar Chen e63758d5b1 Bug 1960003 - Stop including UnionTypes.h from some headers; r=saschanaz,core-sessionstore-reviewers,farre
Differential Revision: https://phabricator.services.mozilla.com/D245261
2025-06-07 21:01:07 +00:00
Emilio Cobos Álvarez a3456a90a9 Bug 1055085 - Clear input search on esc keydown. r=smaug,masayuki
This matches Blink and WebKit, with the difference that this preserves
the undo stack (which I think is useful and mitigates a bit the
double-esc concerns Masayuki had in bug 1936648).

Keydown because it matches both other engines, though I think keypress
would've been more consistent...

Differential Revision: https://phabricator.services.mozilla.com/D251563
2025-05-30 09:11:01 +00:00
Jan-Niklas Jaeschke b3debf824d Bug 1963845 - Use Span for EnumTable. r=emilio,smaug
This patch makes the usage of `EnumTable`s safer
by using `Span`s instead of relying on an empty
element at the end.
Also the name has been changed from `EnumTable`
to `EnumTableEntry` to be more precise.

Differential Revision: https://phabricator.services.mozilla.com/D247453
2025-05-06 08:28:23 +00:00
pstanciu 7d79502fbe Revert "Bug 1963845 - Use Span for EnumTable. r=emilio,smaug" for Build Bustages on HTMLSharedListElement.cpp
This reverts commit eebbccf7b9.
2025-05-05 13:48:07 +00:00
Jan-Niklas Jaeschke eebbccf7b9 Bug 1963845 - Use Span for EnumTable. r=emilio,smaug
This patch makes the usage of `EnumTable`s safer
by using `Span`s instead of relying on an empty
element at the end.
Also the name has been changed from `EnumTable`
to `EnumTableEntry` to be more precise.

Differential Revision: https://phabricator.services.mozilla.com/D247453
2025-05-05 12:49:25 +00:00
Tim Giles e6871be33e Bug 1739522 - Prevent losing focus on clear search and password reveal buttons. r=emilio,accessibility-frontend-reviewers,ayeddi
By utilizing -moz-user-focus: none, we can prevent the clear search and
the password reveal button from blurring the input. This ensures focus
is not moved from these buttons if you click on them.

Differential Revision: https://phabricator.services.mozilla.com/D243387
2025-05-01 15:24:42 +00:00
Tim Giles cad8dc1154 Bug 1655503 - Remove clear search button from a11y tree. r=accessibility-frontend-reviewers,desktop-theme-reviewers,emilio,smaug
The clear search button is not exposed to assistive technologies
and is not able to receive focus. This is to ensure a positive user
experience when navigating through the search input.

Move prefs to default section in test/forms/chrome.toml

Differential Revision: https://phabricator.services.mozilla.com/D240396
2025-05-01 15:24:31 +00:00
Butkovits Atila 8c1f64e7a5 Backed out 5 changesets (bug 1936648, bug 1958971, bug 1655503, bug 1739522) for causing mass failures. CLOSED TREE
Backed out changeset 11f55b37b32b (bug 1739522)
Backed out changeset 4d6fea6e4d54 (bug 1958971)
Backed out changeset 0ee8cef5e12f (bug 1936648)
Backed out changeset 3eba4ee39f74 (bug 1936648)
Backed out changeset 0ab023489eaa (bug 1655503)
2025-04-23 00:15:57 +03:00
Tim Giles 46ba743817 Bug 1739522 - Prevent losing focus on clear search and password reveal buttons. r=emilio,accessibility-frontend-reviewers,ayeddi
By utilizing -moz-user-focus: none, we can prevent the clear search and
the password reveal button from blurring the input. This ensures focus
is not moved from these buttons if you click on them.

Differential Revision: https://phabricator.services.mozilla.com/D243387
2025-04-22 20:18:49 +00:00
Tim Giles a147b7e16b Bug 1655503 - Remove clear search button from a11y tree. r=accessibility-frontend-reviewers,desktop-theme-reviewers,emilio,smaug
The clear search button is not exposed to assistive technologies
and is not able to receive focus. This is to ensure a positive user
experience when navigating through the search input.

Differential Revision: https://phabricator.services.mozilla.com/D240396
2025-04-22 20:18:48 +00:00
Florian Quèze 6147d3f360 Bug 1956726 - Migrate histograms to use Glean APIs in dom/, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D244177
2025-04-03 21:02:54 +00:00
Edgar Chen ec7c6d4801 Bug 1957956 - Make legacy canceled activation behavior for radio buttons work again; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D244320
2025-04-03 19:37:26 +00:00
Masayuki Nakano 80089dd884 Bug 1946001 - Rename methods which return an independent nsFrameSelection to GetIndependentFrameSelection() r=emilio
The methods are now, `GetConstFrameSelection()` etc, but does not return
`const nsFrameSelection*`.  I believe that `GetIndependentFrameSelection()` is
clearer than the old names.

And also this patch adds `IsIndependentSelection()` and
`GetIndependentSelectionRootParentElement()` to make some callers of
`GetLimiter()` easier to read.

For the consistency, `GetLimiter()` should be renamed too, but I already have
a patch doing it in bug 1954020 and it's bigger.  Therefore, I leave it as-is
for now.

Differential Revision: https://phabricator.services.mozilla.com/D241774
2025-03-17 12:49:57 +00:00
Benjamin VanderSloot ac264e6ddf Bug 1952115 - Remove image.input.telemetry.image_input before it expires - r=anti-tracking-reviewers,emz
This reverts 7b781e92d67cbe2d16181016163ceeea0f249012.

Differential Revision: https://phabricator.services.mozilla.com/D241191
2025-03-14 16:06:25 +00:00
Tom Schuster b8d11d463f Bug 1951893 - Remove unneeded StaticAtom suffixes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D240598
2025-03-11 11:36:09 +00:00
Makoto Kato b441849346 Bug 1674428 - Part 2. Add method to collect files that is selected WebKitDirectory. r=dom-core,sefeng
When using Android 13 or later, there is no permission to enumerate
directories if on user storage. So `GetFilesHelper` and etc won't work on
Android.

We have to use content resolver APIs to enumerate files in directory.
So I have to add a method to collect files in FilePicker and return
DOM Files.

Differential Revision: https://phabricator.services.mozilla.com/D228761
2025-03-07 12:44:07 +00:00
Edgar Chen 2afeef63bd Bug 1947446 - Part 2: Input element should always defer the form submission during click event; r=smaug
As the input type can be changed to "submit" type during the click event, it may
end up triggering the form submission as the default action.

Differential Revision: https://phabricator.services.mozilla.com/D238781
2025-02-25 22:30:48 +00:00
Edgar Chen 9f0edddf04 Bug 1947446 - Part 1: Input element should always have activation behavior; r=smaug
See https://html.spec.whatwg.org/multipage/input.html#the-input-element.

Differential Revision: https://phabricator.services.mozilla.com/D238780
2025-02-25 22:30:47 +00:00
Edgar Chen 4ac8a8da39 Bug 1949439 - Part 1: Stop dispatching unused DOMFormSubmit chrome-only event; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D239150
2025-02-25 11:23:37 +00:00
Masayuki Nakano 4e6fcb1183 Bug 1943228 - Rename methods GetSomethingWithoutCreation() to GetExtantSomething() r=edgar,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D235256
2025-01-23 23:47:28 +00:00
Masayuki Nakano a3db2f157c Bug 1941140 - Make TextControlState::UnbindFromFrame clean up controllers if and only if they are exist r=edgar
`HTMLInputElement::GetControllers()` and `HTMLTextAreaElement::GetControllers()`
initializes their controllers before returning the `nsIControllers` instance
[1][2].  Typically, they are initialized at creating their `TextEditor`
instance is initialized [3].  A `TextEditor` for an `HTMLInputElement` is
initialized when it gets focus first time after the `nsTextControlFrame` is
created [4][5].  Therefore, when `TextControlState::UnbindFromFrame` is called,
the element may not have controllers yet.  So, the elements should have simple
getters of their controllers and `UnbindFromFrame` should use them instead.

1. https://searchfox.org/mozilla-central/rev/eb80f267aabbf90ac66ebbed77b6d33592eb2be0/dom/html/HTMLInputElement.cpp#5658-5660
2. https://searchfox.org/mozilla-central/rev/eb80f267aabbf90ac66ebbed77b6d33592eb2be0/dom/html/HTMLTextAreaElement.cpp#502-503
3. https://searchfox.org/mozilla-central/rev/eb80f267aabbf90ac66ebbed77b6d33592eb2be0/dom/html/TextControlState.cpp#1826-1827,1832,1837-1838,1857-1858
4. https://searchfox.org/mozilla-central/rev/eb80f267aabbf90ac66ebbed77b6d33592eb2be0/layout/forms/nsTextControlFrame.cpp#447
5. https://searchfox.org/mozilla-central/rev/eb80f267aabbf90ac66ebbed77b6d33592eb2be0/dom/html/TextControlState.cpp#1640-1641,1655-1656

Differential Revision: https://phabricator.services.mozilla.com/D234307
2025-01-19 23:34:07 +00:00
Jonathan Kew 6d25ae0f09 Bug 1936113 - Hook up :open to details, select, dialog, and input elements. r=webidl,emilio
Most of these elements are simple to support.

One slightly tricky item was <input type=date>, as testing indicates that the
front-end code usually (consistently?) hides the picker using setPickerState(),
which does not end up calling closeDateTimePicker() as might be expected.
So to properly track the open/closed state, I had to add a SetDateTimePickerState
webidl method, rather than just patching into the existing Open/Close calls.

Differential Revision: https://phabricator.services.mozilla.com/D234093
2025-01-17 13:49:56 +00:00
Butkovits Atila 530d9d432d Backed out 5 changesets (bug 1936113) for causing failures at select-inside-top-layer.tentative.html. CLOSED TREE
Backed out changeset 2b07b9e7bf57 (bug 1936113)
Backed out changeset a88e93dff614 (bug 1936113)
Backed out changeset 9cfc0a675a42 (bug 1936113)
Backed out changeset 716bdadbea2a (bug 1936113)
Backed out changeset 4ee0855e448f (bug 1936113)
2025-01-17 12:34:24 +02:00
Jonathan Kew a4d8e36aff Bug 1936113 - Hook up :open to details, select, dialog, and input elements. r=webidl,emilio
Most of these elements are simple to support.

One slightly tricky item was <input type=date>, as testing indicates that the
front-end code usually (consistently?) hides the picker using setPickerState(),
which does not end up calling closeDateTimePicker() as might be expected.
So to properly track the open/closed state, I had to add a SetDateTimePickerState
webidl method, rather than just patching into the existing Open/Close calls.

Differential Revision: https://phabricator.services.mozilla.com/D234093
2025-01-17 09:17:28 +00:00
Edgar Chen bd5595be28 Bug 1938489 - Don’t update other radio inputs in the same radio group when a radio input is appended to a disconnected subtree; r=avandolder
See https://github.com/whatwg/html/issues/10897.

Differential Revision: https://phabricator.services.mozilla.com/D233421
2025-01-13 09:42:01 +00:00
Emilio Cobos Álvarez d839027bf7 Bug 1939880 - Make UA widget content use regular shadow dom event retargetting, not NAC retargetting. r=smaug
This allows removing the special case for focus inside the datetime
widget (and fixes similar issues on video when you tab through
the video controls).

This is covered by test_input_datetime_focus_blur_events.html, but happy
to add a <video>-specific event if you think it'd be useful..

Differential Revision: https://phabricator.services.mozilla.com/D233180
2025-01-11 00:08:01 +00:00
Emilio Cobos Álvarez 19b8476a6c Bug 1935672 - Restore a chunk of code that is still needed apparently.
This fixes failures in test_input_datetime_focus_blur_events.html and
such, but it seems like the shadow DOM retargetting should handle
this?

MANUAL PUSH: Orange fix CLOSED TREE
2025-01-03 15:40:59 +01:00
Emilio Cobos Álvarez cf971e2352 Bug 1935672 - Handle blur on the datetime box earlier. r=smaug
We want the blur handling to happen before the website has seen the
event, so that the value it sees is correct.

It also prevents the input to remain in the `:focus-visible` state
during blur.

Differential Revision: https://phabricator.services.mozilla.com/D233087
2025-01-03 13:17:20 +00:00
Masayuki Nakano 71ada507bb Bug 1680669 - part 6: Make methods of MouseEvent and static methods of Event aware of fractional coordinates r=smaug,emilio,webdriver-reviewers
`screenX`, `screenY`, `clientX`, `clientY`, `x`, `y`, `offsetX` and `offsetY`
are now `double`.  This patch makes the event classes aware of DOM events.

Currently, Chrome allows fractional values only for pointer events whose type
is not `click`, `auxclick` nor `contextmenu` (this exception is defined by the
Pointer Events spec).  Therefore, this patch follows them.

I'm not sure about the untrusted events of non-pointer events, `click`,
`auxclick` and `contextmenu`. Chrome does check whether it's trusted or not
before applying `std::floor` or `std::round` at getter methods (I think that
using `std::round` in `offsetX` and `offsetY` is their bug at least for
untrusted events).  This patch follows them for now but has a pref to allow
for all untrusted events.

Finally, for aligning to Chrome, this patch makes `click`, `auxclick` and
`contextmneu` keep using integer coordinates because it's recommended by the
Pointer Events spec.

Note that this changes the logic in `Event::GetPageCoords`.  It rounded the
client point and scroll point before adding them.  Similarly,
`Event::GetOffsetCoords` too.  It rounded the client point before transforming
it.  Therefore, in strictly speaking, this changes the behavior of other events
which keep returning integer coordinates.  However, I don't see any issues in
our CI.  So, for making the code simpler, let's use it and once we got some
regression reports caused by this, let's make them take additional param to
round the points to integer done in the traditional code.

Differential Revision: https://phabricator.services.mozilla.com/D222728
2024-12-03 07:10:05 +00:00
Oliver Old 054846ec0f Bug 1240005 - Users of do_CreateInstance or InitWithNativePath/InitWithPath not checking return value r=necko-reviewers,xpcom-reviewers,media-playback-reviewers,emilio,karlt,valentin
Differential Revision: https://phabricator.services.mozilla.com/D227280
2024-11-25 16:54:11 +00:00
Oliver Old 82cc01210e Bug 1776893 - Replace do_CreateInstance for nsIFile with NS_NewLocalFile (part 2) r=emilio,necko-reviewers,win-reviewers,handyman,valentin
Differential Revision: https://phabricator.services.mozilla.com/D227297
2024-11-25 16:54:10 +00:00
Edgar Chen 997fb832b3 Bug 1932512 - Pass BrowsingContext to nsIColorPicker::Init; r=geckoview-reviewers,win-reviewers,mac-reviewers,emilio,spohl,m_kato,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D229682
2024-11-25 14:03:25 +00:00
Mike Hommey dfcbbb2394 Bug 1930836 - Initialize returned values in GetSelection{Start,End}IgnoringType. r=dom-core,jjaschke
Returning uninitialized values is undefined behavior, and while the API
is such that the caller code wouldn't use the value in the case it's not
initialized, the C++ standard doesn't allow it and now clang 19 has a
change in an optimization pass that can end up miscompiling the code as
result.

Differential Revision: https://phabricator.services.mozilla.com/D228769
2024-11-15 08:14:47 +00:00
Leander Schwarz 7fec00d6b7 Bug 1899117 - Add file and input type telemetry for EXIF metadata stripper project. r=bvandersloot,anti-tracking-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D226524
2024-10-29 12:49:37 +00:00
Alexandru Marc f6aed66e52 Backed out 2 changesets (bug 1899117) for causing py3 failures @ test_yaml_indices.py::test_yamls_sorted. CLOSED TREE
Backed out changeset 814c8b5c6837 (bug 1899117)
Backed out changeset 270d18416ca7 (bug 1899117)
2024-10-29 10:21:33 +02:00
Leander Schwarz c103134216 Bug 1899117 - Add file and input type telemetry for EXIF metadata stripper project. r=bvandersloot,anti-tracking-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D226524
2024-10-29 07:48:34 +00:00
serge-sans-paille 262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille 07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc 004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille 2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Vincent Hilla e68a44cb57 Bug 868874 - Remove Decimal::toString(char*, size_t). r=jwatt,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D216041
2024-10-22 13:21:56 +00:00
Vincent Hilla 257d5eb9f2 Bug 1888507 - Do not dispatch input, change for detached checkbox, radio. r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D217408
2024-10-22 13:21:16 +00:00