Commit graph

136 commits

Author SHA1 Message Date
jneuberger
9fe5ac2c97 Bug 1863801 - P2. Add DOMFormRemoved event listener after successful fetch or XHR request r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D193308
2023-12-06 14:55:01 +00:00
Issam Mani
1149ca2518 Bug 1864379 - P1. Don't dispatch LoginManager DOM events for disconnected input elements. r=dimi,emilio
Differential Revision: https://phabricator.services.mozilla.com/D194768
2023-12-04 11:39:19 +00:00
Noemi Erli
cb5c9fb296 Backed out 7 changesets (bug 1863801, bug 1865876) for causing failures in browser_creditCard_doorhanger_iframe.js CLOSED TREE
Backed out changeset 395e2da83ee8 (bug 1865876)
Backed out changeset c27de56bd433 (bug 1863801)
Backed out changeset 8d297207efc7 (bug 1863801)
Backed out changeset 193d5c08a17f (bug 1863801)
Backed out changeset dd78261ec1d8 (bug 1863801)
Backed out changeset 5f6ad20da89e (bug 1863801)
Backed out changeset 31e08bae4ce6 (bug 1863801)
2023-12-01 22:16:15 +02:00
jneuberger
2b8f2f2621 Bug 1863801 - P2. Add DOMFormRemoved event listener after successful fetch or XHR request r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D193308
2023-12-01 19:12:54 +00:00
Vincent Hilla
2dcab181ae Bug 1648733 - Report invalid and hidden form controls to console. r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D189459
2023-10-30 11:48:49 +00:00
Adam Vandolder
3198d33ca2 Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-28 15:47:11 +00:00
Natalia Csoregi
1497f6f44d Backed out changeset 8f8492410799 (bug 1685926) for causing bustage on SVGAnimatedPathSegList.cpp. CLOSED TREE 2023-09-28 10:40:31 +03:00
Adam Vandolder
226c8aba6a Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-28 06:35:44 +00:00
Cristian Tuns
8ce555ea94 Backed out changeset 37ade77d181e (bug 1685926) for causing build bustages in PerformanceEventTiming.cpp CLOSED TREE 2023-09-25 12:40:22 -04:00
Adam Vandolder
190df7c40c Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162349
2023-09-25 14:39:08 +00:00
Vincent Hilla
1273773f91 Bug 1066940 - Align return type of HTMLFormElement::elements with spec. r=dom-core,webidl,peterv
Differential Revision: https://phabricator.services.mozilla.com/D188246
2023-09-14 16:37:14 +00:00
Emilio Cobos Álvarez
c27a2129fd Bug 1850293 - Make validity states non-intrinsic. r=smaug
Add a RAII helper to notify of multiple state changes together for
these.

The UpdateState CustomElementInternals calls that are getting removed
are unnecessary (the state should be up-to-date by then, there's nothing
changing there particularly).

Same for the call in nsGenericHTMLFormElement::UnbindFromTree. ClearForm
already does an state update.

Differential Revision: https://phabricator.services.mozilla.com/D187033
2023-08-30 09:18:32 +00:00
Emilio Cobos Álvarez
b1ad2fb6f3 Bug 1850293 - Make CHECKED/DEFAULT states not intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186933
2023-08-30 09:18:31 +00:00
avandolder
43c242a1b6 Bug 1837540 - Make radio button group navigation follow tree-order. r=sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183426
2023-08-03 01:52:19 +00:00
Narcis Beleuzu
53cd71602f Backed out changeset 013278adabc7 (bug 1837540) for build bustages on mochitest.ini . CLOSED TREE 2023-08-03 02:25:53 +03:00
avandolder
eff3063bb2 Bug 1837540 - Make radio button group navigation follow tree-order. r=sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183426
2023-08-02 23:04:07 +00:00
Emilio Cobos Álvarez
25b79c7b15 Bug 1829225 - Make BeforeSetAttr take the parsed nsAttrValue. r=smaug
ParseAttribute ideally would be const (see bug 1829138), but the SVG and
SMIL code is rather messy. Still, now that BeforeSetAttr can't really
fail, swapping the order of ParseAttribute and BeforeSetAttr shouldn't
really change behavior.

Sorry for the extra `virtual` keyword removal and such. I had to do this
one by hand unlike the dependent bugs, and I went a bit drive-by, lmk if
you want me to split those changes.

Differential Revision: https://phabricator.services.mozilla.com/D176086
2023-04-21 09:25:17 +00:00
Emilio Cobos Álvarez
ee4c38a50c Bug 1829189 - Make BeforeSetAttr infallible. r=smaug
rg BeforeSetAttr -l | xargs sed -i 's/nsresult BeforeSetAttr/void BeforeSetAttr/g'
  rg ::BeforeSetAttr -l | xargs sed -i 's/nsresult \(.*\)::BeforeSetAttr/void \1::BeforeSetAttr/g'

Plus trivial fixes, plus clang-format.

The only meaningful changes are in nsXULElement::BeforeSetAttr. Two
things could fail:

chromemargin: I removed it because we don't use the parsed attribute any
other place than here:

  https://searchfox.org/mozilla-central/rev/31f5847a4494b3646edabbdd7ea39cb88509afe2/dom/xul/ChromeObserver.cpp#136

And that deals just fine with it not being parsed.

usercontextid: We have a debug assertion that we don't dynamically change it.
I kept it but I don't think it's worth failing to set the attribute on release for that

Differential Revision: https://phabricator.services.mozilla.com/D176069
2023-04-21 08:56:27 +00:00
Adam Vandolder
1267f7d14f Bug 1509346 - Add support for <form rel>. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D166489
2023-01-18 16:41:04 +00:00
Butkovits Atila
a7d3e99d52 Backed out changeset 704407d7ca31 (bug 1509346) for causing wpt failures at put-forwards.html. 2023-01-17 20:04:52 +02:00
Adam Vandolder
629f0f42e1 Bug 1509346 - Add support for <form rel>. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D166489
2023-01-17 16:11:06 +00:00
Sandor Molnar
06e631d4a6 Backed out changeset 5ad22146a015 (bug 1509346) for causing failures in docshell/base/nsDocShell.cpp 2023-01-17 03:16:20 +02:00
Adam Vandolder
b2b544c7ed Bug 1509346 - Add support for <form rel>. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D166489
2023-01-16 21:32:19 +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
Kagami Sascha Rosylight
475159ad91 Bug 1539884 - Part 11: Mark HTMLFormElement::Reset as CAN_RUN_SCRIPT r=masayuki
Depends on D133921

Differential Revision: https://phabricator.services.mozilla.com/D133922
2021-12-16 17:17:08 +00:00
Butkovits Atila
125116c312 Backed out 8 changesets (bug 1539884) for causing build bustages at Document.cpp. CLOSED TREE
Backed out changeset ad65ce9208ce (bug 1539884)
Backed out changeset 15d728ef97ca (bug 1539884)
Backed out changeset de9e2829d42a (bug 1539884)
Backed out changeset a8cfa2201751 (bug 1539884)
Backed out changeset ca21c5838f37 (bug 1539884)
Backed out changeset 3d3019f61b5a (bug 1539884)
Backed out changeset ca7c808621d6 (bug 1539884)
Backed out changeset 57068a40f3c9 (bug 1539884)
2021-12-16 08:12:15 +02:00
Kagami Sascha Rosylight
e5856c694e Bug 1539884 - Part 11: Mark HTMLFormElement::Reset as CAN_RUN_SCRIPT r=masayuki
Depends on D133921

Differential Revision: https://phabricator.services.mozilla.com/D133922
2021-12-16 02:58:48 +00:00
Kagami Sascha Rosylight
d4de9cf54d Bug 1743439 - Part 5: Mark callers in dom/events and dom/html as MOZ_CAN_RUN_SCRIPT_BOUNDARY r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D133364
2021-12-09 19:56:09 +00:00
Alexandru Michis
8941bcbb1e Backed out 6 changesets (bug 1743439) for causing bustages in AnimationEventDispatcher.h
CLOSED TREE

Backed out changeset 792c405d4afc (bug 1743439)
Backed out changeset 0376e73c7dce (bug 1743439)
Backed out changeset 23202094bc00 (bug 1743439)
Backed out changeset ba0fa3a8fa0e (bug 1743439)
Backed out changeset 7ad2746ec876 (bug 1743439)
Backed out changeset a919ef50cf33 (bug 1743439)
2021-12-09 19:36:12 +02:00
Kagami Sascha Rosylight
b2f44fade5 Bug 1743439 - Part 5: Mark callers in dom/events and dom/html as MOZ_CAN_RUN_SCRIPT_BOUNDARY r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D133364
2021-12-09 17:16:50 +00:00
Emilio Cobos Álvarez
a5f66c95e1 Bug 1740230 - Remove some prefs for pseudo-classes that we have shipped/unshipped successfully. r=dholbert
And remove code for :-moz-submit-invalid completely.

Differential Revision: https://phabricator.services.mozilla.com/D130737
2021-11-10 13:27:47 +00:00
Edgar Chen
495e0b741d Bug 1556351 - Part 5: Make nsGenericHTMLFormControlElement implement nsIFormControl; r=smaug
nsGenericHTMLFormElement doesn't implement nsIFormControl now as HTMLElement would
inherit it to be able to be added into HTMLFormElement and HTMLFieldSetElement and
support some common form feature.

So some places that call the nsIFormControl method on nsGenericHTMLFormElement
directly would need to queryInterface it to nsIFormControl first, this should be
fine as those places are not in a hot path.

Differential Revision: https://phabricator.services.mozilla.com/D124788
2021-10-04 20:51:27 +00:00
Edgar Chen
71a718fbc8 Bug 1729008 - Part 2: Make HTMLFormElement::IsLastActiveElement take nsGenericHTMLFormElement as argument; r=smaug
Depends on D124459

Differential Revision: https://phabricator.services.mozilla.com/D124462
2021-09-03 17:21:44 +00:00
Edgar Chen
862d12eb53 Bug 1729008 - Part 1: Make HTMLFormElement::IsDefaultSubmitElement take nsGenericHTMLFormElement as argument; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124459
2021-09-03 17:21:44 +00:00
Edgar Chen
262f7ec893 Bug 1728081 - Part 4: Make HTMLFormElement::GetDefaultSubmitElement return nsGenericHTMLFormElement; r=smaug
so that the callers don't need to queryInterface it back to nsIContent.

Differential Revision: https://phabricator.services.mozilla.com/D123952
2021-08-30 18:44:51 +00:00
Edgar Chen
bae585f79e Bug 1728081 - Part 3: Merge nsIForm into HTMLFormElement; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D123951
2021-08-30 18:44:51 +00:00
Edgar Chen
09f6c7e2de Bug 1728081 - Part 2: Remove nsIForm::GetElementAt; r=smaug
as it is only used internally.

Depends on D123949

Differential Revision: https://phabricator.services.mozilla.com/D123950
2021-08-30 18:44:51 +00:00
Edgar Chen
bb4c23a6e6 Bug 1728081 - Part 1: Remove nsIForm::GetElementCount; r=smaug
as it is only used internally.

Differential Revision: https://phabricator.services.mozilla.com/D123949
2021-08-30 18:44:50 +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
Edgar Chen
b81b2affb2 Bug 1720314 - Part 2: Remove HTMLFormElement::mWebProgress; r=smaug
Depends on D119776

Differential Revision: https://phabricator.services.mozilla.com/D119777
2021-07-13 16:32:51 +00:00
Edgar Chen
2482297bf5 Bug 1720314 - Part 1: Remove HTMLFormElement::mSubmittingRequest; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D119776
2021-07-13 16:32:51 +00:00
Dimi Lee
a8a701a4a6 Bug 1708455 - P4. Add DOMFormHasPossibleUsernameField event to notify the password manager when a form has a text input or an email input. r=sfoster,tgiles,smaug
Right now, we limit the type of a username field in username-only forms to be either text or email.
This is different from what the password manager currently support in LoginHelper.isUsernameFieldType.
This is because text and email type are the most common cases for a username field, and we want to focus
on the cases that are more likely a username field.

This patch adds "DOMFormHasPossibleUsername" event to notify the password manager when a form has a possible
username field (text or email). The event works similar to the existing "DOMFormHasPassword" event.

Depends on D113797

Differential Revision: https://phabricator.services.mozilla.com/D113798
2021-06-11 11:56:03 +00:00
Kagami Sascha Rosylight
4d0c7b86de Bug 1708228 - Part 2: Remove redundant flush param from nsIRadioGroupContainer r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113806
2021-04-30 11:25:23 +00:00
Kagami Sascha Rosylight
ca32f5ec18 Bug 1708228 - Part 1: Remove redundant flushing from HTMLFormControlsCollection r=smaug
This was done in bug 324828 to workaround bug 22480 but shouldn't be needed anymore.

Differential Revision: https://phabricator.services.mozilla.com/D113805
2021-04-30 11:25:22 +00:00
Kagami Sascha Rosylight
bebdcea92b Bug 1707126 - Part 2: Use RadioGroupManager in HTMLFormElement r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113578
2021-04-28 16:01:35 +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
Simon Giesecke
ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Emilio Cobos Álvarez
b0bc0f75a5 Bug 1693969 - Remove <form novalidate> handling from :-moz-ui-{valid,invalid} pseudo-classes. r=smaug
There's no way to know whether the submission will actually be
validated, because formnovalidate on submit buttons is a thing (and even
if all the submit controls had formnovalidate, you could still submit
the form and validate it via form.submit()), so it seems better to make
these pseudo-classes not depend on this.

Differential Revision: https://phabricator.services.mozilla.com/D105968
2021-02-23 11:26:17 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Jeff Walden
933368cb18 Bug 1663365 - Move DOM proxy-related details (including expand support) to separate headers out of jsfriendapi.h. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89336
2020-09-08 22:57:14 +00:00