Commit Graph

894 Commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
4c840d573b Bug 1925866 - NS_NewLocalFile's aFollowSymlinks arg is unused. r=xpcom-reviewers,necko-reviewers,valentin,media-playback-reviewers,win-reviewers,karlt,nika,rkraesig
Remove it and related functions, and update the callers.

Differential Revision: https://phabricator.services.mozilla.com/D226261
2024-10-22 09:38:16 +00:00
Zach Hoffman
b335283083 Bug 282266 - Populate imageClickedPoint when submitter is an image button. r=dom-core,layout-reviewers,emilio,masayuki
If the form submission originated from an event dispatch, this patch
ensures that the submitted image button coordinate is not the default.

Differential Revision: https://phabricator.services.mozilla.com/D224651
2024-10-15 12:27:57 +00:00
Masayuki Nakano
528d09c312 Bug 1904279 - Get rid of dom.w3c_pointer_events.dispatch_click_as_pointer_event pref r=smaug,pip-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,nchevobbe,dao,jteow,mconley
Keep supporting the pref makes a lot of `click`, `auxclick` and `contextmenu`
event creators complicated (and look messy).  So, let's delete it as soon as
possible.

Differential Revision: https://phabricator.services.mozilla.com/D217225
2024-07-30 06:49:42 +00:00
Masayuki Nakano
44aae6e962 Bug 1909577 - Make some nsFocusManager::GetFocusedElement() users use its static version instead r=emilio,credential-management-reviewers,issammani
Now, we have `nsFocusManager::GetFocusedElementStatic()` which returns focused
element if the `nsFocusManager` instance is available.  Therefore, if
`nsFocusManager::GetFocusedElement()` users do not use other methods of
`nsFocusManager`, they can use `nsFocusManager::GetFocusedElementStatic()` and
make themselves simpler.

Note that some callers return early if `nsFocusManager` is not available, but
they do not return error and `nsFocusManager` instance is available in most
time of the life time of the process.  Therefore, we can simply stop using the
early return.

Differential Revision: https://phabricator.services.mozilla.com/D217527
2024-07-25 00:33:58 +00:00
Emilio Cobos Álvarez
d25d53b6fc Bug 1909311 - Remove nsIFormControlFrame and nsITextControlFrame. r=masayuki,layout-reviewers,dholbert
It's a rather useless interface:

 * nsITextControlFrame is only implemented by nsTextControlFrame, so we
   can just use that.
 * nsIFormControlFrame had very few actual functionality, mostly
   scattered around:
    * SetFormProperty(select) was only useful for nsTextControlFrame.
    * SetFormProperty(value) was only called on file controls.
    * SetFocus() did mostly nothing, or things that can be done in
      ElementStateChanged instead.

There are some do_QueryFrame calls that I replaced for better checks in
font inflation and nsIFrame, but I'll adjust to preserve behavior if you
insist (it just such a somewhat-random check).

Differential Revision: https://phabricator.services.mozilla.com/D217322
2024-07-23 16:16:18 +00:00
Neil Deakin
c18a0f1d1f Bug 1904593, don't clear the autofill state when modified by script, r=dom-core,credential-management-reviewers,dimi,sefeng
It turns out that many sites are modifying the field state immediately after a value has been autofilled, typically to format the value such as add spaces between parts of a credit card number

Differential Revision: https://phabricator.services.mozilla.com/D215113
2024-07-22 14:33:14 +00:00
Daniel Holbert
4267e2c406 Bug 1741469 part 3: Add an off-by-default pref to control whether input type="number"/"range" fields are modified when mousewheel-scrolled. r=smaug
The C++ code change here is simply replacing an ifdef with a pref-check (and
associated reindentation for being placed in an "if"-block).

The pref is off-by-default for now, since no other browser seems to modify
these fields through mousewheel scrolling, and users seem to be surprised when
they encounter the behavior in Firefox.  See discussion on the bugzilla page.

Note: now that this behavior is controlled by a pref, we don't need to have
platform-specific #ifdefs and "skip-if" test exemptions. If we decide to bring
this behavior back on certain platforms, we can do so by simply changing the
default value of the pref on those platforms.

Differential Revision: https://phabricator.services.mozilla.com/D175719
2024-07-16 16:35:26 +00:00
Ryan Safaeian
ccd363c347 Bug 1900009 - Dispatch DOMPossibleUsernameInputAdded event for valid text and email inputs. r=dimi,edgar
Differential Revision: https://phabricator.services.mozilla.com/D214821
2024-07-12 17:38:48 +00:00
Vincent Hilla
2ddf8f16af Bug 1876163 - Part 5: Consider input / textarea children of dir=auto slot. r=smaug
This patch implements step 2.3.2 from https://html.spec.whatwg.org/#auto-directionality for the special case where the child is an auto-directionality form-associated element according to step 1 of the algorithm.

Depends on D208339

Differential Revision: https://phabricator.services.mozilla.com/D208340
2024-07-09 08:00:35 +00:00
Emilio Cobos Álvarez
87e50520af Bug 1905743 - Tweak TextControlElement to be able to tell if column count is explicit or not. r=dholbert
This is needed because we want implicit width of number and text
controls be the same, but explicit width be different to account for the
spinners. See:

  data:text/html,<input type="number"><br><input type="text"><br><input type="number" min="1" max="9"><br><input type="text" size="1">

For example. This patch on its own shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D215549
2024-07-02 21:17:34 +00:00
Emilio Cobos Álvarez
f925429501 Bug 1905743 - Unify text control button storage. r=dholbert
Split out from the other patch for readability. This doesn't change
behavior but unifies where we store the buttons of
number/search/password inputs.

Differential Revision: https://phabricator.services.mozilla.com/D215548
2024-07-02 21:17:34 +00:00
Edgar Chen
2b74067abf Bug 1904719 - Remove unused HTMLInputElement::mHandlingSelectEvent; r=dom-core,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D214896
2024-06-26 06:41:00 +00:00
Oliver Medhurst
cbcf563dc9 Bug 1877969 - Consume user activation when showing any picker r=dom-core,edgar,geckoview-reviewers,m_kato
Consume transient user activation when showing file/color picker
at any time. Do not open if there is no transent user activation.

Fixed various internal tests broken by this change.

Spec PR: https://github.com/whatwg/html/pull/10344

Differential Revision: https://phabricator.services.mozilla.com/D201096
2024-06-24 10:53:24 +00:00
Cristian Tuns
1613f5053a Backed out changeset 46970b1c1903 (bug 1877969) for causing xpcshell failures in test_bug1086684.js CLOSED TREE 2024-06-21 11:48:23 -04:00
Oliver Medhurst
d62e94c895 Bug 1877969 - Consume user activation when showing any picker r=dom-core,edgar,geckoview-reviewers,m_kato
Consume transient user activation when showing file/color picker
at any time. Do not open if there is no transent user activation.

Fixed various internal tests broken by this change.

Spec PR: https://github.com/whatwg/html/pull/10344

Differential Revision: https://phabricator.services.mozilla.com/D201096
2024-06-21 14:17:22 +00:00
Andrea Marchesini
c6f1009e59 Bug 1860321 - Check the return value of nsIFilePicker::GetDomFileOrDirectory, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D214265
2024-06-19 16:08:21 +00:00
Masayuki Nakano
e1fd41420f Bug 1675847 - part 3: Make ePointerClick event dispatchers and handlers use WidgetPointerEvent r=smaug,search-reviewers,devtools-reviewers,nchevobbe,jteow
This patch makes the all `ePointerClick` event dispatcher in C++ code use
`WidgetPointerEvent` instead of `WidgetMouseEvent`.

Then, this patch also makes the all `click` event dispatcher in chrome code use
`PointerEvent` instead of `MouseEvent`.  For detecting wrong trusted event
dispatching of `click` event, this patch adds assertion into `MouseEvent`.
Therefore, all chrome test dispatchers also changed to use `PointerEvent`.

Finally, this patch includes a change of a WPT.  That checks the `pointerId`
caused by executing an access key.  In this case, the value should be `-1`
rather than the default value `0` because Pointer Event spec defines so for
synthetic pointer events caused by non-pointing devices [1].  Chrome also
sets it to `-1` and fails [2].  Therefore, the new assertion will pass on both
Firefox and Chrome.

1. https://w3c.github.io/pointerevents/#dom-pointerevent-pointerid
2. https://wpt.fyi/results/uievents/interface/keyboard-accesskey-click-event.html?run_id=5087897523060736&run_id=5136270464647168&run_id=5163620816388096&run_id=5201281304231936

Differential Revision: https://phabricator.services.mozilla.com/D213001
2024-06-14 00:18:47 +00:00
Masayuki Nakano
fb5048e05b Bug 1675847 - part 1: Rename eMouseClick and eMouseAuxClick r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D212999
2024-06-14 00:18:46 +00:00
James Teh
5ec975e7d7 Bug 1901633: Focus the first possible radio button in a group if the selected radio button is disabled or hidden. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D213180
2024-06-13 02:35:06 +00:00
Emilio Cobos Álvarez
8b01085e4f Bug 1898214 - Implement min/max-derived sizing for <input type=number>. r=smaug
See https://github.com/whatwg/html/issues/10390 for the spec issue.

Differential Revision: https://phabricator.services.mozilla.com/D212545
2024-06-06 17:38:26 +00:00
Stanca Serban
1e7737760a Backed out changeset cd09151a1c46 (bug 1898214) for causing OS X wpt failures in transform-input-014.html. 2024-06-05 18:46:28 +03:00
Emilio Cobos Álvarez
736a195c9d Bug 1898214 - Implement min/max-derived sizing for <input type=number>. r=smaug
See https://github.com/whatwg/html/issues/10390 for the spec issue.

Differential Revision: https://phabricator.services.mozilla.com/D212545
2024-06-05 11:47:14 +00:00
Iulian Moraru
0783092d02 Backed out changeset a00be88f3708 (bug 1877969) for causing multiple failures. CLOSED TREE 2024-06-04 16:49:11 +03:00
Oliver Medhurst
4bf748dbcb Bug 1877969 - Consume user activation when showing any picker r=dom-core,edgar
Consume transient user activation when showing file/color picker
at any time. Do not open if there is no transent user activation.

Spec PR: https://github.com/whatwg/html/pull/10344

Differential Revision: https://phabricator.services.mozilla.com/D201096
2024-06-04 11:33:36 +00:00
Neil Deakin
e9102d05aa Bug 1849122, allowing getting and modifying the autofill state directly within the input and select elements, and reset this state when its value changes, r=webidl,emilio
Resetting the state when the value is modified is bug 1359355.

Differential Revision: https://phabricator.services.mozilla.com/D210999
2024-05-28 23:39:59 +00:00
Olli Pettay
c5e80af013 Bug 1897194 - Form-associated custom elements shouldn't have special handling for :read-write, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D210868
2024-05-21 12:53:14 +00:00
James Teh
6367099168 Bug 1892529: Skip hidden radio buttons when determining which radio button to focus. r=smaug
This fixes two problems:
1. If no radio button is checked and the first radio button is hidden, tabbing will reach the first visible radio button in the group, rather than just skipping the group.
2. If you press down arrow or up arrow and the next/previous radio button is hidden, focus will move to the next/previous visible radio button in the group, rather than doing nothing.

Differential Revision: https://phabricator.services.mozilla.com/D208092
2024-05-09 00:14:55 +00:00
Emilio Cobos Álvarez
bf22d33f87 Bug 1895208 - Refactor IsFocusable checks to take flags rather than bool arguments. r=smaug
This doesn't change behavior on its own, but it's likely we want to make
the tab focusability more complicated in bug 1895184, and this will make
changes to this area less painful.

Differential Revision: https://phabricator.services.mozilla.com/D209525
2024-05-06 21:54:37 +00:00
Emilio Cobos Álvarez
4a29b211db Bug 1893532 - Improve error message of HTMLInputElement.stepUp/stepDown. r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D208671
2024-05-01 00:11:33 +00:00
Emilio Cobos Álvarez
d1ebf6e756 Bug 1888595 - Auto directionality of non-value-associated form elements should always be LTR. r=smaug
https://html.spec.whatwg.org/#auto-directionality always returns null,
effectively, so should default to always LTR. Inheriting of the parent
directionality wouldn't be handled correctly because we stop the
inheritance on dir=auto boundaries.

Differential Revision: https://phabricator.services.mozilla.com/D206236
2024-04-02 17:38:03 +00:00
James Teh
0cab7c24b4 Bug 1267488: If no HTML input radio in a group is checked, only make the first radio in the group tabbable instead of all of them. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D202681
2024-03-08 07:03:28 +00:00
pstanciu
c54b13cea6 Backed out changeset cb88e52676eb (bug 1267488) for causing bc failures on browser_quicksuggest_onboardingDialog.js. CLOSED TREE 2024-03-07 10:52:55 +02:00
James Teh
698ae8925d Bug 1267488: If no HTML input radio in a group is checked, only make the first radio in the group tabbable instead of all of them. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D202681
2024-03-07 05:27:32 +00:00
Cristian Tuns
d4d88e31ba Backed out changeset 1d4643ee0900 (bug 1267488) for causing mochitest failures in test_focus.xhtml CLOSED TREE 2024-03-05 23:24:53 -05:00
James Teh
e499f47e30 Bug 1267488: If no HTML input radio in a group is checked, only make the first radio in the group tabbable instead of all of them. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D202681
2024-03-05 23:51:48 +00:00
Gregory Pappas
48834b756d Bug 1881845 - Remove nsContentCID.h r=smaug,media-playback-reviewers,karlt
All of these components have been converted to static registration, making this
file unneeded.

Differential Revision: https://phabricator.services.mozilla.com/D202633
2024-03-04 23:41:05 +00:00
Gregory Pappas
3a68660a11 Bug 1878401 - part 1 - Pass BrowsingContext to nsIFilePicker::Init instead of mozIDOMWindow r=geckoview-reviewers,win-reviewers,emilio,nika,m_kato,rkraesig
This will improve the situation in bug 1878336

Differential Revision: https://phabricator.services.mozilla.com/D200546
2024-02-28 21:29:37 +00:00
Sandor Molnar
c853f2f3e9 Backed out 8 changesets (bug 1878401, bug 1879041) for causing build bustages on widget/nsBaseFilePicker.cpp CLOSED TREE
Backed out changeset 2e2b8df3bdd6 (bug 1879041)
Backed out changeset 6d6952f9df2c (bug 1878401)
Backed out changeset 30b5bb590d3e (bug 1878401)
Backed out changeset 9a4b830334b9 (bug 1878401)
Backed out changeset 3c3d67f1fcb7 (bug 1878401)
Backed out changeset c83ba4026822 (bug 1878401)
Backed out changeset 6bcb670ce475 (bug 1878401)
Backed out changeset f263b196df96 (bug 1878401)
2024-02-28 17:56:48 +02:00
Gregory Pappas
44b053ba1a Bug 1878401 - part 1 - Pass BrowsingContext to nsIFilePicker::Init instead of mozIDOMWindow r=geckoview-reviewers,win-reviewers,emilio,nika,m_kato,rkraesig
This will improve the situation in bug 1878336

Differential Revision: https://phabricator.services.mozilla.com/D200546
2024-02-28 15:07:44 +00:00
Emilio Cobos Álvarez
7506fc5879 Bug 1881011 - Refactor UnbindFromTree to take a context argument. r=smaug
Much like BindToTree.

This will be useful because I need to pass more information through
UnbindFromTree() to speed up dir=auto for bug 1874040.

Differential Revision: https://phabricator.services.mozilla.com/D202215
2024-02-20 15:05:40 +00:00
Edgar Chen
da474ad32d Bug 1871424 - Make input checkbox/radio in link element work again; r=vhilla,dom-core,smaug
The root cause of issue is that the link elements have not yet adopted the
activation behavior defined in the specification. The appropriate  behavior/model
for links is still under discussion, https://github.com/whatwg/html/issues/1576.
For now, we aim for making it consistent with other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D197393
2024-01-30 09:24:45 +00:00
Greg Stoll
df896d7e12 Bug 1872179 - Part 3: File picker file uploads consult content analysis r=rkraesig,win-reviewers
File picker upload operations check with any connected content analysis
tool before giving access to the web page.

Differential Revision: https://phabricator.services.mozilla.com/D198456
2024-01-22 13:56:07 +00:00
Emilio Cobos Álvarez
b9aedffc24 Bug 1850295 - Update :user-{valid,invalid} to follow the spec. r=smaug
(Modulo open spec issues linked in comments)

Differential Revision: https://phabricator.services.mozilla.com/D196986
2024-01-16 11:09:01 +00:00
Emilio Cobos Álvarez
bc8e14504e Bug 1856156 - Make Directionality an enum class. r=smaug
A bit neater this way.

Differential Revision: https://phabricator.services.mozilla.com/D198590
2024-01-15 19:35:44 +00:00
Emilio Cobos Álvarez
08a8d2d9f1 Bug 1856156 - Recompute auto directionality on input type changes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D198588
2024-01-15 19:35:43 +00:00