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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
`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
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