Auto merge of #25432 - warren-fisher:HTMLConstructor, r=jdm

Extract some of CGClassConstructHook to utils.rs

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

Moving some of the functionality from the massive tripled quoted string in CGClassConstructHook in `components/script/dom/bindings/codegen/CodegenRust.py` to `components/script/dom/bindings/utils.rs`. Must be made unsafe because of UnwrapObjectDynamic and other functions. Added imports as necessary as well, as well as cleaning up using test-tidy.

---
<!-- 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 #25395 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because the issue says so

<!-- 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-06-03 16:59:32 -04:00 committed by GitHub
commit 7758d4ff62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 144 additions and 116 deletions

View file

@ -1,13 +0,0 @@
[HTMLElement-constructor.html]
[HTMLElement constructor must not get .prototype until it finishes its extends sanity checks, calling proxy constructor directly]
expected: FAIL
[HTMLElement constructor must not get .prototype until it finishes its extends sanity checks, calling via Reflect]
expected: FAIL
[HTMLElement constructor must not get .prototype until it finishes its registration sanity checks, calling proxy constructor directly]
expected: FAIL
[HTMLElement constructor must not get .prototype until it finishes its registration sanity checks, calling via Reflect]
expected: FAIL

View file

@ -1,10 +1,4 @@
[newtarget.html]
[HTMLParagraphElement constructor must not get .prototype until it finishes its extends sanity checks, calling proxy constructor directly]
expected: FAIL
[HTMLParagraphElement constructor must not get .prototype until it finishes its extends sanity checks, calling via Reflect]
expected: FAIL
[Custom Elements: [HTMLConstructor\] derives prototype from NewTarget]
expected: FAIL