Commit graph

393 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
39f7ce8fd4
webidl: Apply and update debug.patch, remove abstract.patch which was already upstream. 2016-07-12 14:07:03 -07:00
Emilio Cobos Álvarez
aa811be816
webidl: Update parser
Some patches failed to apply. I'll apply manually after this.
2016-07-12 13:58:26 -07:00
Emilio Cobos Álvarez
b5c9e8a58e
webidl: Update the update script now mxr is gone. 2016-07-12 13:57:42 -07:00
bors-servo
e2e7013e76 Auto merge of #12395 - jdm:nowrap, r=Ms2ger
Avoid calling JS_WrapValue for same-compartment DOM reflectors

This change shaves off 15-20ns per iteration of the node.firstChild getter test in tests/html/bindings_perf.html. Based on [similar Gecko code](http://searchfox.org/mozilla-central/rev/f43c9e0ffa92e72dbdbcbf57eecf04a43d46da63/dom/bindings/BindingUtils.h#781).

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix (partially) #12358

<!-- 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/12395)
<!-- Reviewable:end -->
2016-07-12 05:50:46 -07:00
Josh Matthews
fc3b785af1 Remove unused imports from codegen. 2016-07-12 08:22:51 -04:00
Ms2ger
d678b20616 Implement the [Exposed] extended attribute on interfaces.
Fixes #2823.
2016-07-12 13:06:56 +02:00
Ms2ger
c064c4950d Make sure that Descriptor.isGlobal() returns a bool. 2016-07-12 13:06:55 +02:00
Ms2ger
4c31c8ac7b Simplify CGConstructorEnabled. 2016-07-12 13:06:54 +02:00
Ms2ger
28630f5487 Make DefineDOMInterface and ConstructorEnabled unsafe functions. 2016-07-12 13:06:53 +02:00
Ms2ger
e99054f731 Add support for unsafe Rust-ABI functions to CGAbstractMethod. 2016-07-12 13:06:52 +02:00
Ms2ger
1dcdc2859c Generate 'pub' before 'unsafe extern', if both are used. 2016-07-12 13:06:51 +02:00
Ms2ger
b5412f3840 Correct indentation in the DOMClass function. 2016-07-12 13:06:50 +02:00
Ms2ger
7e7b97e869 Allow [Pref] annotations on worker-exposed interfaces.
Servo does not have the same main-thread limitation as Gecko here.
2016-07-12 13:06:47 +02:00
bors-servo
80cb0cf821 Auto merge of #11872 - eddyb:back-to-roots, r=Ms2ger
Replace return_address usage for rooting with stack guards and convenience macros.

The existing `Rooted` and `RootedVec` users were migrated the the following two macros:
```rust
let x = Rooted::new(cx, value);
// Was changed to:
rooted!(in(cx) let x = value);
// Which expands to:
let mut __root = Rooted::new_unrooted(value);
let x = RootedGuard::new(cx, &mut __root);
```
```rust
let mut v = RootedVec::new();
v.extend(iterator);
// Was changed to:
rooted_vec!(let v <- iterator);
// Which expands to:
let mut __root = RootableVec::new();
let v = RootedVec::new(&mut __root, iterator);
```

The `rooted!` macro depends on servo/rust-mozjs#272.
These APIs based on two types, a container to be rooted and a rooting guard, allow implementing both `Rooted`-style rooting and `Traceable`-based rooting in stable Rust, without abusing `return_address`.

Such macros may have been tried before, but in 1.9 their hygiene is broken, they work only since 1.10.

Sadly, `Rooted` is a FFI type and completely exposed, so I cannot prevent anyone from creating their own, although all fields but the value get overwritten by `RootedGuard::new` anyway.
`RootableVec` OTOH is *guaranteed* to be empty when not rooted, which makes it harmless AFAICT.

By fixing rust-lang/rust#34227, this PR enables Servo to build with `-Zorbit`.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix rust-lang/rust#34227
- [x] These changes do not require tests because they are not functional changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11872)
<!-- Reviewable:end -->
2016-07-04 11:03:35 -07:00
Eduard Burtescu
b79a7d468e Use a stack guard and a macro for RootedVec instead of return_address. 2016-07-04 20:59:06 +03:00
Eduard Burtescu
0db1faf876 Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
Corey Farwell
22928f50ac Refactor util::prefs operations to be methods on static struct. 2016-07-02 16:43:39 -04:00
Ms2ger
296afe4bc9 Use ObjectOpResult::succeed. 2016-06-27 17:59:08 +02:00
Ms2ger
300f2df203 Remove a useless local variable. 2016-06-27 17:59:07 +02:00
Josh Matthews
b8853554db Wrap executions of Rust code called from JS in catch_unwind. Propagate the interrupted panic to the origin of the JS execution via TLS before resuming. Fix #6462. 2016-06-22 09:35:19 -04:00
Jansen Jan
fda011923e Support WindowProxy return values in bindings
unscopable
2016-06-09 23:42:27 +02:00
Anthony Ramine
3529803975 Implement [Unscopable] (fixes #11583) 2016-06-07 15:34:44 +02:00
Anthony Ramine
3cc7b575fb Initialise reflector earlier for globals
This allows us to use global_root_from_object in the context of a Condition.
2016-05-27 14:11:34 +02:00
Anthony Ramine
e179cb02ff Implement [Func] 2016-05-27 00:55:02 +02:00
Anthony Ramine
fd7c4f8149 Remove utils::Prefable in favour of guard::Guard 2016-05-26 23:56:13 +02:00
Anthony Ramine
a20db08f06 Remove Prefable::terminator 🤖 2016-05-26 23:55:37 +02:00
Anthony Ramine
adcecda047 Simplify how Prefable arrays are passed in bindings::interface 2016-05-26 23:55:36 +02:00
Anthony Ramine
bee6f59b16 Use itertools.groupby in generatePrefableArray 2016-05-26 23:55:35 +02:00
Anthony Ramine
b094932d57 Make MemberCondition a function returning a plain string 2016-05-26 23:55:31 +02:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Anthony Ramine
c9af465ae8 Update the WebIDL parser 2016-05-18 11:30:53 +02:00
Anthony Ramine
60aaac5175 Remove the custom PartialEq implementations on TypeId enums
https://github.com/rust-lang/rust/pull/33593 made them useless.
2016-05-17 15:30:14 +02:00
Anthony Ramine
4af3e9028d Use JS_NewStringCopyN for the representation of interface objects
This removes the need for the final null byte and we can make
NonCallbackInterfaceObjectClass::new safe again I guess.
2016-05-16 15:22:07 +02:00
Ms2ger
735480c184 Stop using JSAutoRequest. 2016-05-13 15:34:38 +02:00
Emilio Cobos Álvarez
91101f6226
codegen: Throw a more descriptive invalid enum message 2016-05-13 11:44:39 +02:00
Emilio Cobos Álvarez
e50d4b7624
codegen: Throw on an invalid enum value when appropiate 2016-05-13 11:44:38 +02:00
Emilio Cobos Álvarez
92ba0b9c39
codegen: Don't unconditionally set non-required dictionary attributes 2016-05-13 09:42:51 +02:00
Emilio Cobos Álvarez
203898c941
codegen: Use the non-mangled name in set_dictionary_property
Fixes #11152
2016-05-12 15:39:54 +02:00
bors-servo
b054cb82a6 Auto merge of #9890 - AgostonSzepessy:update-webidl-tests, r=nox
update.sh downloads all *.py tests from mozilla central

components/script/dom/bindings/codegen/parser/update.sh downloads all *.py tests from https://dxr.mozilla.org/mozilla-central/source/dom/bindings/parser/tests

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9890)
<!-- Reviewable:end -->
2016-05-09 05:04:57 -07:00
bors-servo
2c69278067 Auto merge of #10756 - servo:smup, r=Ms2ger
Update SpiderMonkey

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10756)
<!-- Reviewable:end -->
2016-05-03 15:46:40 -07:00
Anthony Ramine
eb94f1a918 Update SpiderMonkey 2016-05-03 18:36:11 +02:00
Josh Matthews
cb5bad63dc Implement hiding of interface members via Pref annotations. 2016-05-02 14:32:56 -04:00
Josh Matthews
88059acd7e Start generating arrays of specs for easier implementation of preference checks. 2016-05-02 14:32:55 -04:00
Josh Matthews
f4c1529f56 Forbid unconditionally-exposed interfaces that inherit from conditionally-exposed ones. 2016-05-02 14:32:53 -04:00
Josh Matthews
bb47f72f25 Support controlling the visibility of WebIDL interfaces via the Pref annotation. 2016-04-29 11:03:15 -04:00
Anthony Ramine
4c2ca7a8c9 Refactor the call hook on non-callback interface objects (fixes #10744)
It's now set through the intermediate InterfaceConstructorBehavior structure,
which lets us improve the abstraction around NonCallbackInterfaceObjectClass
a bit better.

When the interface's constructor is supposed to always throw, the error for
calling `Foo()` without new is "Illegal constructor.". when the interface
actually defines an interface, the error is instead
"This constructor needs to be called with `new`.".
2016-04-25 11:44:59 +02:00
Anthony Ramine
a45f117838 Make NonCallbackInterfaceObjectClass::new unsafe 2016-04-25 10:51:07 +02:00
Keith Yeung
c6b6d2c84e Avoid generating parameter names that are Rust keywords 2016-04-17 19:37:42 -04:00
Zbynek Winkler
b6dc34862a Use os.path.basename instead of split('/')[-1]
Fixes #10596.
2016-04-17 17:37:29 +02:00
Arnaud Marant
315120d6e8 remove unreachable code in codegen
code is unreachable after return, and identical to the upper block
2016-04-12 19:10:10 +02:00