Commit graph

642 commits

Author SHA1 Message Date
bors-servo
1a61937031
Auto merge of #26718 - jdm:codegen-sequence, r=Manishearth
Improve precision of sequence types for WebIDL codegen.

Unlike #26699, this doesn't attempt to improve any of the resulting types and only maintains the status quo.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
2020-05-29 22:10:21 -04:00
Josh Matthews
c4f8167b6f dom: Improve precision of sequence types for WebIDL codegen. 2020-05-29 15:16:55 -04:00
Simon Sapin
d103e06ba9 Use dynamic dispatch in mozjs::panic::wrap_panic
Pick up https://github.com/servo/rust-mozjs/pull/512

Fixes https://github.com/servo/servo/issues/26585

This diff is best viewed with "ignore whitespace changes", because of indentation change.
2020-05-25 20:34:05 +02:00
Simon Sapin
6175a68c10 Replace a transmute with .to_ne_bytes() + constructor 2020-04-15 17:54:04 +02:00
bors-servo
3abbfdf278
Auto merge of #26170 - Manishearth:enum-convertible, r=asajeffrey
Add FromJSValConvertible for enums

Fixes https://github.com/servo/servo/issues/26169

This adds FromJSValConvertible implementations for webidl enums, which allows them to be used within `sequence<>`, etc.

This also uses these implementations when converting arguments.
2020-04-12 11:47:43 -04:00
Manish Goregaokar
242b7f8fdc Use FromJSValConvertible impls when converting arguments 2020-04-11 00:15:43 -07:00
Manish Goregaokar
10a13ffa20 Implement FromJSValConvertible on enums 2020-04-11 00:15:43 -07:00
Manish Goregaokar
c24481ab9c Do not filter out platform objects when doing dictionary conversions
https://heycam.github.io/webidl/#es-overloads

In step 12, the platform object check is for substep 4, but importantly it only matters if `V` implements the matching interface. If not, it should be able to fall back to substep 10 and attempt conversion to a dictionary.
2020-04-08 23:15:57 -07:00
Shinichi Morimoto
74995a5287 fixed CGCollectJSONAttributesMethod 2020-03-31 09:37:07 +09:00
Shinichi Morimoto
d8c1dc60e8 fixed is_satisfied condition 2020-03-30 02:32:46 +09:00
Shinichi Morimoto
f7d4a37f78 fixed fmt 2020-03-28 23:21:35 +09:00
Shinichi Morimoto
80b2a87be7 fixed #25281 2020-03-28 20:18:30 +09:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Anthony Ramine
3f30c7d8be Do not do weird scope things in MethodDefiner
Variable `m` comes from a previous list comprehension earlier in the
function is not actually properly defined.
2020-03-14 12:17:48 +01:00
Anthony Ramine
4930479ac8 Update the WebIDL parser
Upstream doesn't allow downloading .tar.gz archives so update.sh was changed
to use unzip.
2020-03-14 12:17:48 +01:00
Anthony Ramine
05077d31c8 Change how we reflect DOM objects in codegen
We now go through <Root<MaybeUnreflectedDom<T>>>::reflect_with,
to decrease the amount of bad stuff we can end up doing. This
avoids a source of vtable pointer instability that could cause
issues down the road.
2020-03-06 18:45:29 +01:00
Anthony Ramine
5a4f8cf93f Update SpiderMonkey 2020-03-06 11:13:28 +01:00
Anthony Ramine
14846d0567 Introduce a new type MaybeUnreflectedDom<T> (fixes #25701) 2020-02-17 10:17:47 +01:00
Kunal Mohan
5a3e1b8e69
rename compartment to realm 2020-01-24 20:52:36 +05:30
bors-servo
fdfc840bac
Auto merge of #25446 - pshaughn:fixme11868, r=jdm
Make getOwnPropertyDescriptor hold the correct value for indexed/named properties

This is towards #25036 and #25415; it could have far-reaching implications so I want to test it in isolation and see the results on the full test suite.

A few lines of code had a FIXME(#11868) despite that issue being closed, and looking for the pattern that was marked that way, I found one other unmarked instance of it. It doesn't immediately crash, and maybe it will pass some tests or fail some tests in informative ways.

EDIT: After adding an overlooked extended attribute to HTMLFormElement, this works very well indeed and seems to be worth merging!

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

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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. -->
2020-01-10 15:18:10 -05:00
Patrick Shaughnessy
111ede9c77 Make property descriptors hold named/indexed property values 2020-01-10 12:32:08 -05:00
Patrick Shaughnessy
c1b71fcc4d Implement HTMLSelectElement.add() and indexed setter, fix test that was relying on add to be a stub 2020-01-07 11:05:31 -05:00
marmeladema
7b5fabe855 Fix tidiness errors for Python3 compatibility across whole repo 2019-12-11 16:03:20 +00:00
Manish Goregaokar
d233558b9b Fix iterator invalidation in our forEach implementation. 2019-11-25 19:56:14 -08:00
Kagami Sascha Rosylight
22278a8895 Require PromiseRejectionEventInit dictionary 2019-11-22 10:18:11 +09:00
bors-servo
a7008d1cf7
Auto merge of #24665 - saschanaz:timerhandler, r=nox
Use TimerHandler IDL union type

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

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

<!-- 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. -->
2019-11-17 10:30:51 -05:00
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
bors-servo
df9065afb6
Auto merge of #24636 - saschanaz:windowproxy, r=nox,jdm
Use MessageEventSource on MessageEvent IDL

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

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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. -->
2019-11-07 22:35:43 -05:00
Kagami Sascha Rosylight
1b22c10483 Use TimerHandler IDL union type 2019-11-05 23:55:15 +09:00
Kagami Sascha Rosylight
01e0b2cb5e Use IDL sequence default value 2019-11-04 23:39:37 +09:00
Kagami Sascha Rosylight
f8b61c0315 Use MessageEventSource on MessageEvent IDL 2019-11-04 23:12:52 +09:00
Kagami Sascha Rosylight
691af0e98b Support stringifier attributes 2019-10-29 21:35:40 +09:00
bors-servo
5011e9c21c
Auto merge of #24471 - saschanaz:enum-default, r=ferjm
Support enum value as a union default value

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

Didn't implement the actual latency thing because the relevant things are already marked as TODO.

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

<!-- 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. -->
2019-10-21 03:27:18 -04:00
Kagami Sascha Rosylight
40ee701283 Support enum value as a union default value 2019-10-19 12:19:25 +09:00
Kagami Sascha Rosylight
e81b678645 Support [LegacyWindowAlias] 2019-10-19 12:01:00 +09:00
bors-servo
118a9ecdfe
Auto merge of #24476 - saschanaz:nonenumerable, r=jdm
Mark @@iterator as nonenumerable

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

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

<!-- 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. -->
2019-10-18 16:31:17 -04:00
bors-servo
32eb858a6a
Auto merge of #24469 - saschanaz:urp-default, r=Manishearth
Support USVString as default value of a union argument

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

I don't expect this fixes any test though...

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

<!-- 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. -->
2019-10-18 04:02:13 -04:00
Kagami Sascha Rosylight
1c717bc086 Mark @@iterator as nonenumerable 2019-10-17 22:08:14 +09:00
Kagami Sascha Rosylight
e905a4606a Support USVString as default value of a union argument 2019-10-17 12:06:41 +09:00
bors-servo
aa916ad20e
Auto merge of #24429 - saschanaz:getpropertykeys, r=jdm
Return false when GetPropertyKeys fails

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

As stated in https://github.com/servo/servo/pull/24377#discussion_r333844560.

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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. -->
2019-10-15 11:59:09 -04:00
Kagami Sascha Rosylight
b697621b05 Support WebIDL record<> 2019-10-15 17:14:00 +09:00
Kagami Sascha Rosylight
764f1a3724 Return false when GetPropertyKeys fails 2019-10-12 18:57:05 +09:00
Kagami Sascha Rosylight
2660f35925 Remove [PrimaryGlobal] 2019-10-03 14:25:23 +09:00
Simon Sapin
5c60023cb8 WebIDL codegen: Replace cmake with a single Python script
When playing around with Cargo’s new timing visualization:
https://internals.rust-lang.org/t/exploring-crate-graph-build-times-with-cargo-build-ztimings/10975/21

… I was surprised to see the `script` crate’s build script take 76 seconds.
I did not expect WebIDL bindings generation to be *that* computationally
intensive.

It turns out almost all of this time is overhead. The build script uses CMake
to generate bindings for each WebIDL file in parallel, but that causes a lot
of work to be repeated 366 times:

* Starting up a Python VM
* Importing (parts of) the Python standard library
* Importing ~16k lines of our Python code
* Recompiling the latter to bytecode, since we used `python -B` to disable
  writing `.pyc` file
* Deserializing with `cPickle` and recreating in memory the results
  of parsing all WebIDL files

----

This commit remove the use of CMake and cPickle for the `script` crate.
Instead, all WebIDL bindings generation is done sequentially
in a single Python process. This takes 2 to 3 seconds.
2019-09-27 13:53:19 +02:00
bors-servo
2be3c2a1af
Auto merge of #23987 - saschanaz:update-webidl, r=jdm
Update WebIDL parser

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

This includes IDL mixin support.

---
<!-- 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 does not fix but helps #22539 / fixes #16244

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23987)
<!-- Reviewable:end -->
2019-09-25 00:59:36 -04:00
bors-servo
8eddb60150
Auto merge of #24137 - gterzian:fix_error_throwing_on_unknown_js_arg, r=jdm
Codegen: throw type error when encountering an unknown argument

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

FIX #24130

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24137)
<!-- Reviewable:end -->
2019-09-05 13:39:52 -04:00
Gregory Terzian
5149aefd85 codegen: throw type error when encountering an unknown argument 2019-09-05 18:29:02 +08:00
Kagami Sascha Rosylight
5695ee94a5 Add [Default] toJSON() to performance interfaces 2019-09-01 23:23:57 +09:00
Simon Sapin
98e4a53b72 Upgrade to rustc 1.39.0-nightly (f7af19c27 2019-08-15) 2019-08-23 08:23:21 +02:00
bors-servo
4275420a56
Auto merge of #23844 - saschanaz:tojson, r=Manishearth
Support default toJSON in WebIDL

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

Ported related lines from gecko.

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

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23844)
<!-- Reviewable:end -->
2019-08-20 17:27:14 -04:00