Commit graph

539 commits

Author SHA1 Message Date
Alan Jeffrey
43ca260689 Renamed BrowsingContext to WindowProxy in script. 2017-05-12 15:02:35 -05:00
Aaron Cunningham
f03ddf6c6c Fix various build warnings
This should remove six separate warnings when building servo. One of
the warnings was an unused mut, and the other were various dead code
warnings
2017-04-24 22:54:06 -07:00
mckaymatt
63f9ad022f Add way to get c_void ptr or c_char from caller 2017-04-04 16:46:52 -04:00
bors-servo
af6353df87 Auto merge of #15659 - gregkatz:eliminate_transmute_find_enum, r=Ms2ger
Eliminate a mem::transmute in CodeGen

<!-- Please describe your changes on the following line: -->
Eliminate a mem::transmute in CodeGen by changing the find_enum_string_index function to take a slice of pairs and return an enum value.

---
<!-- 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 #15587 (github issue number if applicable).

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

<!-- 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/15659)
<!-- Reviewable:end -->
2017-02-21 04:28:32 -08:00
Gregory Katz
214db8d9f0 Eliminate a mem::transmute in CodeGen 2017-02-20 12:24:45 -05:00
bors-servo
e52eb2a5e3 Auto merge of #15585 - servo:CGConstant, r=nox
Simplify CGConstant.

<!-- 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/15585)
<!-- Reviewable:end -->
2017-02-20 04:12:08 -08:00
bors-servo
28698dc8ba Auto merge of #15589 - servo:RootedTraceable-union, r=nox
Use RootedTraceableBox for unions.

<!-- 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/15589)
<!-- Reviewable:end -->
2017-02-19 05:56:01 -08:00
Gregory Katz
4d205f00b0 Adds an as_str() method to WebIDL enums to hide slice of strings from callers. Uses the new method in two places. 2017-02-16 10:59:07 -05:00
Ms2ger
d5f8b35a5f Use RootedTraceableBox for unions. 2017-02-16 15:27:16 +01:00
Ms2ger
890273e846 Simplify CGConstant. 2017-02-16 12:03:43 +01:00
Ms2ger
f7e2f0e641 Use RootedTraceableBox for dictionaries. 2017-02-16 11:03:26 +01:00
Ms2ger
8c8eb41cdf Use from_jsval for dictionaries. 2017-02-16 11:03:24 +01:00
Ms2ger
3613e8f231 Implement JSTraceable for more types. 2017-02-16 11:03:22 +01:00
Ms2ger
8ce9ca6243 Use Heap for dictionary and union members. 2017-02-16 11:03:21 +01:00
Ms2ger
5eaa19bdd4 Share a little less code between the branches for conversion to any. 2017-02-16 11:03:20 +01:00
Ms2ger
7d24cd7752 Pass isMember to getJSToNativeConversionInfo for unions.
Also includes a documentation update for isMember.
2017-02-16 11:03:19 +01:00
Zakor Gyula
f3ddee5dbc Modify CodegenRust.py to import structs from sequence return values 2017-02-13 14:35:52 +01:00
bors-servo
6d1d4b5783 Auto merge of #15453 - servo:unwrapCastableObject, r=nox
Inline unwrapCastableObject into its only caller.

<!-- 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/15453)
<!-- Reviewable:end -->
2017-02-08 06:38:44 -08:00
Ms2ger
350a970208 Inline unwrapCastableObject into its only caller. 2017-02-08 15:38:23 +01:00
Ms2ger
5230ad2c61 Remove typeNeedsRooting().
It is only used once, in a case where it can never have an effect: in case
for it to do something, both returnType.isDictionary() and
returnType.isGeckoInterface() would need to be true at the same time.
2017-02-08 12:39:38 +01:00
Ms2ger
7d5320f419 Remove pointless assertion in the typedef code. 2017-02-08 12:37:17 +01:00
Ms2ger
507b4bf05e Cleanup formatting for typedefs. 2017-02-08 12:31:56 +01:00
Ms2ger
8a5987c1db Fix typo in the non-union code path for typedefs. 2017-02-08 12:28:51 +01:00
Ms2ger
35bc171a05 Support using typedefs with nullable unions. 2017-02-08 12:18:24 +01:00
Ms2ger
bd431039b9 Properly root expando objects. 2017-02-07 11:35:55 +01:00
bors-servo
bac2f68b54 Auto merge of #15327 - servo:missing-newline-wrap-panic, r=jdm
Add a missing newline in wrap_panic() calls.

<!-- 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/15327)
<!-- Reviewable:end -->
2017-02-01 06:25:40 -08:00
Ms2ger
49ce1332e1 Add a missing newline in wrap_panic() calls. 2017-02-01 14:46:06 +01:00
Ms2ger
d9013e069c Root the arguments to callback functions.
Note that this relies on the fact that Heap<JSVal> and JSVal are binary
compatible.

Fixes #15324.
2017-02-01 14:27:37 +01:00
Ms2ger
f376f9c2d7 Improve the readability of dictionaries' new() method. 2017-01-31 16:37:31 +01:00
bors-servo
eade32ed16 Auto merge of #15099 - servo:phf-no-macros, r=jdm
Remove usage of phf_macros.

It’s a compiler plugin that uses unstable compiler APIs that are not on a path to stabilization.

With this changes, there is one less thing that might break when we update the compiler. For example: https://github.com/sfackler/rust-phf/pull/101

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

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

<!-- 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/15099)
<!-- Reviewable:end -->
2017-01-20 08:59:26 -08:00
Ms2ger
6a6f339b29 Support dictionaries in unions.
Fixes #11612.
2017-01-20 16:06:33 +01:00
Simon Sapin
0b9ff576e0 script codegen: Avoid modifying in-place a generated file. 2017-01-19 17:13:35 +01:00
bors-servo
e891277dd5 Auto merge of #14994 - jdm:callback_rooting, r=Manishearth,Ms2ger
Make WebIDL callbacks permanently rooted

This replicates the same model that Promise uses right now, because it requires less thinking than coming up with something else.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14447
- [ ] There are tests for these changes

<!-- 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/14994)
<!-- Reviewable:end -->
2017-01-16 10:16:44 -08:00
Josh Matthews
3f35c3eee2 Add a permanent root to WebIDL callbacks, ensuring they are always safe to store. 2017-01-13 09:59:57 -05:00
Ms2ger
e57b478710 Remove unused needsRooting field from JSToNativeConversionInfo. 2017-01-12 16:57:44 +01:00
Ms2ger
b8554abaa4 Expose CallbackObject more.
This will make it easier to use new fields added to it.
2017-01-09 14:17:41 +01:00
Ms2ger
baf4e17232 Avoid generating literal nulls in DOM bindings. 2017-01-06 14:24:13 +01:00
bors-servo
839b7fe8ef Auto merge of #14859 - servo:CallSetup, r=nox
Simplify CallSetup.

<!-- 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/14859)
<!-- Reviewable:end -->
2017-01-05 07:33:46 -08:00
Ms2ger
8d633fec42 Simplify CallSetup. 2017-01-05 13:55:10 +01:00
Eric Anholt
af380c2717 Fix JS_ObjectIsDate() call in webidl codegen.
We were missing the import, and the prototype of the function has
since changed.  Partial fix for #10675
2017-01-04 18:02:30 -08:00
Eric Anholt
d90499ab35 Fix is_null_or_undefined() call in codegen to be snake_case.
After a bit of digging, I couldn't find when it was camelCase.  This
started getting generated when I added an overload in webgl.
2017-01-04 09:57:39 -08:00
Anthony Ramine
3f91ce1d07 Don't generate constructor IDs for inline interfaces 2017-01-03 14:12:19 +01:00
Simon Sapin
53f5023685 Fix/silence some warnings 2016-12-20 07:07:06 +01:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
Anthony Ramine
ddfb8805dc Make WebIDL static methods take a more specific global if possible 2016-11-30 23:23:42 +01:00
Rohan Prinja
973f77c006 Make WebIDL constructors take a more specific global if possible (fixes #14071) 2016-11-30 23:23:41 +01:00
Anthony Ramine
445701d138 Update js, AGAIN 2016-11-27 12:19:19 +01:00
Ms2ger
e367822b3e Update js. 2016-11-27 12:19:19 +01:00
Abelardo E. Mendoza
b372e7c98f script creates methods taking '*mut JSContext' unsafe
rebase + marked the necessary new code as unsafe
2016-11-14 11:06:17 +01:00