Commit graph

318 commits

Author SHA1 Message Date
Tom Schuster
9ead66a33a Bug 1835157 - Ignore target names which contain both newline and < characters. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D210480
2024-05-24 08:09:36 +00:00
Vincent Hilla
99993cda5e Bug 1876792 - Report invisible input fields only when invalid. r=jjaschke,dom-core,edgar
Differential Revision: https://phabricator.services.mozilla.com/D199962
2024-03-05 11:51:09 +00:00
Emilio Cobos Álvarez
8925ee2d3d 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
Emilio Cobos Álvarez
a4d842c063 Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 20:01:36 +00:00
Noemi Erli
f92d721721 Backed out changeset 1acc95286189 (bug 1879579) for causing mass failures CLOSED TREE 2024-02-12 17:25:21 +02:00
Emilio Cobos Álvarez
068080982b Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 00:01:23 +00:00
Emilio Cobos Álvarez
450b8e97d3 Bug 1878900 - Simplify AnchorAreaFormRelValues. r=dom-core,edgar
Having a base class with a single static member doesn't buy us much, and
actually MSVC-compatible compilers don't optimize empty base classes out
(plus the empty base is at the end so it might even take space on Linux
and macOS, untested).

Just put the values in Element.h / Element.cpp which is the common base
class of the relevant elements.

Differential Revision: https://phabricator.services.mozilla.com/D200825
2024-02-06 16:47:38 +00:00
Emilio Cobos Álvarez
71838e2f11 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
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
Tooru Fujisawa
8c59289f4f Bug 1864168 - Part 1: Use 1-origin column number in nsIContentSecurityPolicy. r=smaug,devtools-reviewers,ochameau,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D193369
2023-11-22 12:31:30 +00:00
Natalia Csoregi
705aa81869 Backed out 14 changesets (bug 1865005, bug 1864168, bug 1864155, bug 1862814, bug 1862693) for causing bustage on nsRFPService.cpp. CLOSED TREE
Backed out changeset a4f3e7625abf (bug 1865005)
Backed out changeset ab38141e470b (bug 1862814)
Backed out changeset a679b50dc4a9 (bug 1862814)
Backed out changeset e340886ce62a (bug 1862814)
Backed out changeset 1378502e64b0 (bug 1862814)
Backed out changeset 8ee94e5e79c2 (bug 1862814)
Backed out changeset 6d4ef1cdfabb (bug 1864168)
Backed out changeset 2c30c4d757fc (bug 1864168)
Backed out changeset d4db9576559b (bug 1864168)
Backed out changeset 8ffec0d83028 (bug 1864168)
Backed out changeset fa77d852b494 (bug 1864168)
Backed out changeset f6646771a26a (bug 1864168)
Backed out changeset 7bd0ff6986df (bug 1864155)
Backed out changeset 39867b503289 (bug 1862693)
2023-11-22 14:01:55 +02:00
Tooru Fujisawa
a4a513ad86 Bug 1864168 - Part 1: Use 1-origin column number in nsIContentSecurityPolicy. r=smaug,devtools-reviewers,ochameau,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D193369
2023-11-22 11:13: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
Markus Stange
d89c20090c Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the EventDispatcher::Dispatch methods. r=smaug
This saves a few QueryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186977
2023-08-28 23:38:43 +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
Peter Van der Beken
dfce7f40b3 Bug 1843968 - Hold some strong references. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D184803
2023-08-01 12:09:36 +00:00
Vincent Hilla
683c902afb Bug 1820403 - Skip parts of form submission when the method is dialog. r=dom-core,sefeng
https://github.com/whatwg/html/pull/8943 moved dialog submission in the form submission algorithm from step 24 to step 11.

Differential Revision: https://phabricator.services.mozilla.com/D183168
2023-07-18 13:00:27 +00:00
Gregory Pappas
6f7cbf8d5a Bug 1842974 - Remove dom.dialog_element.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183711
2023-07-17 10:02:53 +00:00
Emilio Cobos Álvarez
4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Peter Van der Beken
4ac9139cc3 Bug 1825745 - Fix intermittent failure of testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D181792
2023-06-22 18:32:21 +00:00
june wilde
d4e5590f40 Bug 1550743 - Change DoSecureToInsecureSubmitCheck to use IsSecureContext; r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D176319
2023-06-06 15:04:41 +00:00
Masayuki Nakano
e16a783838 Bug 1829570 - part 2: Add an overload of AsyncEventDispatcher::RunDOMEventWhenSafe r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D176488
2023-05-15 01:07:29 +00:00
Adam Vandolder
020a417143 Bug 1653625 - Make the submission from default action of a submit button also deferred. r=edgar
The submission from requestSubmit() call is non-deferred due to
mDeferSubmission
being cleared in HTMLFormElement::PostHandleEvent when handling a submit
event. The
mDeferSubmission clearing is also to make the submission from the default
action
of a submit button non-deferred.

This patch makes the submission from default action of a submit button
deferred
which could fix this bug, and also simplify the logic a bit.

Since gecko would also trigger submission for untrusted submit event,
see
bug 1370630, we need to handle that case specially.

Differential Revision: https://phabricator.services.mozilla.com/D170941
2023-05-12 23:11:28 +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
Jon Jensen
159a19ad5c Bug 1812696 - Implement FormData constructor submitter parameter r=webidl,smaug
Also improve error messages for current submitter validations

Spec PR: https://github.com/whatwg/xhr/pull/366
WPT PR: https://github.com/web-platform-tests/wpt/pull/37895

Differential Revision: https://phabricator.services.mozilla.com/D167576
2023-02-02 12:26:50 +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
Mark Banner
9594c03938 Bug 1808115 - Remove the separate EmbedPrompter wrapper, use Prompter instead. r=Gijs,necko-reviewers,geckoview-reviewers,valentin,m_kato
We no longer support the legacy add-ons, so this should not be necessary.

Differential Revision: https://phabricator.services.mozilla.com/D165764
2023-01-03 17:19:48 +00:00
Edgar Chen
e054662a5a Bug 1793075 - Part 2: Do not clear pending submission in HTMLFormElement.submit(); r=smaug
So if the submit call doesn't trigger a submission, it won't clear the existing
pending submission.

Now we allow to override the unflushed pending submission, and add some assertion to
ensure form won't submit a submission if it is in defer state or there is an
unflushed pending submission.

Differential Revision: https://phabricator.services.mozilla.com/D121765
2022-10-05 12:24:28 +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
Jan Varga
3127935527 Bug 1757575 - Fix non-unified-build bustage in dom/html/HTMLFormElement.cpp; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139947
2022-03-01 17:39:18 +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