Auto merge of #27100 - muodov:master, r=gterzian

Implement HTMLFormElement.requestSubmit()

<!-- Please describe your changes on the following line: -->
This PR contains an implementation of [HTMLFormElement.requestSubmit()](https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit)

This is literally my first hundred lines of Rust code, so if I crossed a few sacred lines here and there, please go easy on me :)

---
<!-- 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 #23417

<!-- Either: -->
- [x] [WPT tests](https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html) for these changes
There are two tests that still fail because we don't support `:invalid` CSS selector (see #10781). I verified that they pass if you change them to not use `:invalid`. Should be unlocked by #26729.

<!-- 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:
bors-servo 2020-07-02 09:54:47 -04:00 committed by GitHub
commit 3bc4a935f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 143 additions and 80 deletions

View file

@ -1650,9 +1650,6 @@
[idlharness.https.html?include=HTML.*]
[HTMLFormElement interface: calling requestSubmit(optional HTMLElement?) on document.createElement("form") with too few arguments must throw TypeError]
expected: FAIL
[HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "align" with the proper type]
expected: FAIL
@ -2307,9 +2304,6 @@
[HTMLObjectElement interface: document.createElement("object") must inherit property "archive" with the proper type]
expected: FAIL
[HTMLFormElement interface: operation requestSubmit(optional HTMLElement?)]
expected: FAIL
[HTMLTableColElement interface: document.createElement("col") must inherit property "chOff" with the proper type]
expected: FAIL

View file

@ -3621,9 +3621,6 @@
[HTMLAreaElement interface: document.createElement("area") must inherit property "download" with the proper type]
expected: FAIL
[HTMLFormElement interface: calling requestSubmit(HTMLElement) on document.createElement("form") with too few arguments must throw TypeError]
expected: FAIL
[HTMLProgressElement interface: attribute value]
expected: FAIL
@ -3711,9 +3708,6 @@
[HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type]
expected: FAIL
[HTMLFormElement interface: calling requestSubmit(optional HTMLElement?) on document.createElement("form") with too few arguments must throw TypeError]
expected: FAIL
[HTMLSlotElement interface: calling assignedNodes(optional AssignedNodesOptions) on document.createElement("slot") with too few arguments must throw TypeError]
expected: FAIL
@ -3732,18 +3726,12 @@
[HTMLAllCollection interface: document.all must inherit property "item(optional DOMString)" with the proper type]
expected: FAIL
[HTMLFormElement interface: operation requestSubmit(optional HTMLElement?)]
expected: FAIL
[HTMLAllCollection interface: calling item(optional DOMString) on document.all with too few arguments must throw TypeError]
expected: FAIL
[HTMLAllCollection interface: operation item(optional DOMString)]
expected: FAIL
[HTMLFormElement interface: document.createElement("form") must inherit property "requestSubmit(optional HTMLElement?)" with the proper type]
expected: FAIL
[HTMLCanvasElement interface: document.createElement("canvas") must inherit property "toBlob(BlobCallback, optional DOMString, optional any)" with the proper type]
expected: FAIL

View file

@ -1,19 +1,3 @@
[form-submission-algorithm.html]
[If form's firing submission events is true, then return; 'invalid' event]
expected: FAIL
[firing an event named submit; form.requestSubmit(submitter)]
expected: FAIL
[firing an event named submit; form.requestSubmit(null)]
expected: FAIL
[firing an event named submit; form.requestSubmit()]
expected: FAIL
[Submission URL should always have a non-null query part]
expected: FAIL
[If firing submission events flag of form is true, then return]
expected: FAIL

View file

@ -1,22 +1,6 @@
[form-requestsubmit.html]
[requestSubmit() doesn't run interactive validation reentrantly]
expected: FAIL
[The value of the submitter should be appended, and form* attributes of the submitter should be handled.]
expected: FAIL
[Passing a submit button not owned by the context object should throw]
expected: FAIL
[requestSubmit() for a disconnected form should not submit the form]
expected: FAIL
[requestSubmit() should trigger interactive form validation]
expected: FAIL
[requestSubmit() doesn't run form submission reentrantly]
expected: FAIL
[requestSubmit() should accept button[type=submit\], input[type=submit\], and input[type=image\]]
expected: FAIL