Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDL of FormDataEvent constructor has an incorrect optionality #5064

Closed
saschanaz opened this issue Nov 7, 2019 · 1 comment · Fixed by #5073
Closed

IDL of FormDataEvent constructor has an incorrect optionality #5064

saschanaz opened this issue Nov 7, 2019 · 1 comment · Fixed by #5073
Labels
good first issue Ideal for someone new to a WHATWG standard or software project topic: forms

Comments

@saschanaz
Copy link
Member

The spec:

[Exposed=Window,
 Constructor(DOMString type, optional FormDataEventInit eventInitDict = {})]
interface FormDataEvent : Event {
  readonly attribute FormData formData;
};

dictionary FormDataEventInit : EventInit {
  required FormData formData;
};

It doesn't really make sense to mark eventInitDict as optional when real implementations require a value for the second argument, and the default empty dictionary value doesn't make sense either. This probably should be:

[Exposed=Window]
interface FormDataEvent : Event {
  constructor(DOMString type, FormDataEventInit eventInitDict);
  readonly attribute FormData formData;
};

cc @bzbarsky for whatwg/webidl#793 and immersive-web/webxr#811 (comment).

@annevk annevk added good first issue Ideal for someone new to a WHATWG standard or software project topic: forms labels Nov 7, 2019
@bzbarsky
Copy link
Contributor

bzbarsky commented Nov 7, 2019

Yeah, it would make more sense to make this dictionary arg non-optional.

TimvdLippe added a commit to TimvdLippe/html that referenced this issue Nov 9, 2019
TimvdLippe added a commit to TimvdLippe/html that referenced this issue Nov 14, 2019
domenic pushed a commit that referenced this issue Nov 18, 2019
It already was, effectively, since it had a required member, but this is
more explicit.

Fixes #5064. Also fixes the constructor syntax per #4870.
bors-servo pushed a commit to servo/servo that referenced this issue Nov 21, 2019
Require FormDataEventInit dictionary

<!-- Please describe your changes on the following line: -->

Should probably wait until whatwg/html#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. -->
bors-servo pushed a commit to servo/servo that referenced this issue Nov 24, 2019
Require FormDataEventInit dictionary

<!-- Please describe your changes on the following line: -->

Should probably wait until whatwg/html#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. -->
bors-servo pushed a commit to servo/servo that referenced this issue Nov 24, 2019
Require FormDataEventInit dictionary

<!-- Please describe your changes on the following line: -->

Should probably wait until whatwg/html#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. -->
bors-servo pushed a commit to servo/servo that referenced this issue Nov 24, 2019
Require FormDataEventInit dictionary

<!-- Please describe your changes on the following line: -->

Should probably wait until whatwg/html#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. -->
bors-servo pushed a commit to servo/servo that referenced this issue Nov 24, 2019
Require FormDataEventInit dictionary

<!-- Please describe your changes on the following line: -->

Should probably wait until whatwg/html#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. -->
bors-servo pushed a commit to servo/servo that referenced this issue Nov 24, 2019
Require FormDataEventInit dictionary

<!-- Please describe your changes on the following line: -->

Should probably wait until whatwg/html#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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Ideal for someone new to a WHATWG standard or software project topic: forms
Development

Successfully merging a pull request may close this issue.

3 participants