mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #24680 - saschanaz:formdataevent, r=jdm
Require FormDataEventInit dictionary <!-- Please describe your changes on the following line: --> Should probably wait until https://github.com/whatwg/html/issues/5064 be fixed. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix __ (#22670 mentions `FormDataEvent` but the codegen itself still has a problem, in e.g. `PromiseRejectionEventInit`) <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
c8791c0dbb
3 changed files with 4 additions and 16 deletions
|
@ -5,7 +5,7 @@
|
||||||
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
|
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::FormDataEventBinding;
|
use crate::dom::bindings::codegen::Bindings::FormDataEventBinding;
|
||||||
use crate::dom::bindings::codegen::Bindings::FormDataEventBinding::FormDataEventMethods;
|
use crate::dom::bindings::codegen::Bindings::FormDataEventBinding::FormDataEventMethods;
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
|
@ -56,21 +56,12 @@ impl FormDataEvent {
|
||||||
let bubbles = EventBubbles::from(init.parent.bubbles);
|
let bubbles = EventBubbles::from(init.parent.bubbles);
|
||||||
let cancelable = EventCancelable::from(init.parent.cancelable);
|
let cancelable = EventCancelable::from(init.parent.cancelable);
|
||||||
|
|
||||||
let form_data = match init.formData {
|
|
||||||
Some(ref form_data) => form_data.clone(),
|
|
||||||
None => {
|
|
||||||
return Err(Error::Type(
|
|
||||||
"required member formData is undefined".to_string(),
|
|
||||||
));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
let event = FormDataEvent::new(
|
let event = FormDataEvent::new(
|
||||||
&window.global(),
|
&window.global(),
|
||||||
Atom::from(type_),
|
Atom::from(type_),
|
||||||
bubbles,
|
bubbles,
|
||||||
cancelable,
|
cancelable,
|
||||||
&*form_data,
|
&*init.formData.clone(),
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(event)
|
Ok(event)
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
// https://html.spec.whatwg.org/multipage/#the-formdataevent-interface
|
// https://html.spec.whatwg.org/multipage/#the-formdataevent-interface
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface FormDataEvent : Event {
|
interface FormDataEvent : Event {
|
||||||
[Throws] constructor(DOMString type, optional FormDataEventInit eventInitDict = {});
|
[Throws] constructor(DOMString type, FormDataEventInit eventInitDict);
|
||||||
readonly attribute FormData formData;
|
readonly attribute FormData formData;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary FormDataEventInit : EventInit {
|
dictionary FormDataEventInit : EventInit {
|
||||||
/*required*/ FormData formData;
|
required FormData formData;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1409,9 +1409,6 @@
|
||||||
[SubmitEvent interface: existence and properties of interface prototype object's "constructor" property]
|
[SubmitEvent interface: existence and properties of interface prototype object's "constructor" property]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[FormDataEvent interface object length]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[idlharness.https.html?include=(Document|Window)]
|
[idlharness.https.html?include=(Document|Window)]
|
||||||
[Document interface: documentWithHandlers must inherit property "queryCommandEnabled(DOMString)" with the proper type]
|
[Document interface: documentWithHandlers must inherit property "queryCommandEnabled(DOMString)" with the proper type]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue