Commit graph

176 commits

Author SHA1 Message Date
Josh Matthews
b54ed93b4a servo: Merge #8827 - Avoid a null-dereference using debug mozjs builds. This matches the e… (from jdm:debugmozjscrash); r=Ms2ger
…quivalent code upstream in Gecko.

Source-Repo: https://github.com/servo/servo
Source-Revision: 59029325c04d94af636e0b48478b00404afc4f7c
2015-12-08 11:42:53 +05:01
Anthony Ramine
192fe9ad11 servo: Merge #7988 - Implement [Unforgeable] (from nox:unforgeable); r=jdm
This is mostly stolen from Gecko. As there, we define the unforgeable members
on an object stored in the slots of the prototype object. They are then copied
onto instance objects when they are instantiated. It should be noted that
proxy objects see their unforgeable memebers defined on their expando object.

Unforgeable attributes aren't properly inherited in codegen (in a similar
fashion as getters and setters as filed in #5875) and require to be redefined
in derived interfaces. Fortunately, there are currently no such interfaces.

No unforgeable members can be included into the TestBinding interfaces for good
measure because they are not compatible with setters.

Source-Repo: https://github.com/servo/servo
Source-Revision: 20df7fb7c82a5501342ac85278294e4bcb5b1ab7
2015-12-03 10:34:05 +05:01
Anthony Ramine
0d9105190f servo: Merge #8751 - Remove unused slot in prototype object (fixes #8588) (from nox:rm-prototype-slot); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 29c42a9f78a20ddeb5aa89b79d578a039c087967
2015-11-30 18:58:57 +05:01
Alan Jeffrey
f8093754b7 servo: Merge #8477 - Opaque DOMString (from asajeffrey:opaque-domstring); r=asajeffrey
This patch makes DOMString an opaque wrapper round String (currently it's a transparent wrapper).

The changes are:

* Replacing DOMString(foo) by DOMString::from(foo).
* Replacing foo.0 by String::from(foo).
* Adding functions clear, push_str and extend for in-place mutation of DOMStrings.
* Replacing DOMString by String in other threads (devtools, storage and filereader).
* Making DOMString implement !Send.
* Removing the pub attribute from the contents of DOMString.

This enables experimenting with other string representations in the DOM.

Source-Repo: https://github.com/servo/servo
Source-Revision: 62acdd303b78951885c2c90747b31f318907d6c9
2015-11-13 06:48:30 +05:01
Anthony Ramine
628d175690 servo: Merge #8147 - Implement weak-referenceable JS-managed objects (from nox:weakref); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: e63b1e83d4acd272cdf293292f2a496455405098
2015-11-13 05:53:40 +05:01
Anthony Ramine
a0a6e0cd40 servo: Merge #8498 - Properly handle variadic arguments preceded by default values (from nox:fix-variadic-and-default-arguments); r=jdm
I broke that in #8197.

Source-Repo: https://github.com/servo/servo
Source-Revision: c44c73aa00ced6235266bd692833e22018f31138
2015-11-13 03:53:11 +05:01
Ms2ger
3890fca29d servo: Merge #8428 - Update js (from Ms2ger:conversions); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: b40882093a306032d38ad02e30f0095e0a49ec21
2015-11-13 00:44:52 +05:01
Emilio Cobos Álvarez
1f31ca57ca servo: Merge #8412 - Add WebIDL sequence return values (from emilio:webidl-sequence-return); r=jdm
And use it for `WebGLRenderingContext::getSupportedExtensions`.
Part of #544

Source-Repo: https://github.com/servo/servo
Source-Revision: 12f6ba29a74029fa8c83cc7274181d441e1e52dd
2015-11-11 22:46:15 +05:01
Anthony Ramine
b98af75b92 servo: Merge #8197 - Support variadic interface arguments (fixes #8159) (from nox:variadic-interface-argument); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: f03a8261c58f650eda789b1f9f5363af6e15f59c
2015-11-11 19:03:26 +05:01
Eli Friedman
86523168cb servo: Merge #8286 - Remove unnecessary uses of #[no_move] (from eefriedman:no-move); r=nox
The patch makes RootCollection a bit safer by making the StackRootTLS hold
it in place.

RootedVec was doing an extremely delicate dance and just hoping nobody
messed it up; switch to a Box to be safe.

CodeGenRust seemed to be using no_move for no particularly good reason.

Source-Repo: https://github.com/servo/servo
Source-Revision: 92f9e58310f1b7c3925882979ae9352967866b66
2015-11-08 12:22:00 +05:01
Ms2ger
7cb2a13f43 servo: Merge #8312 - Make DOMString a newtype around String, rather than a typedef (from Ms2ger:DOMString); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: abfd1fb1bf071961bc8a581927eaa96a2d3e2cba
2015-11-04 16:18:41 +05:01
rohan.prinja
e8b504412b servo: Merge #8221 - move modules around (from ajnirp:8130-reorganise); r=jdm
for #8130

Source-Repo: https://github.com/servo/servo
Source-Revision: daad09d44245228fba9118316937add71bec7c58
2015-11-04 02:27:02 +05:01
Ms2ger
4c8234b842 servo: Merge #8267 - Various improvements (from Ms2ger:cleanup); r=frewsxcv
Source-Repo: https://github.com/servo/servo
Source-Revision: 1dfc0481efd4687658ab34e68c883caeadd8b20f
2015-10-30 23:26:34 +05:01
Nathan Froyd
0e1dc5b616 servo: Merge #8226 - unblock using JS_GC_ZEAL (from froydnj:gc-zeal); r=Ms2ger
I think these patches move the `JS_SetReservedSlot` call to the right place for #6057.  I'm not sure that the interface to `create_dom_global` is the best; passing a `JSVal` or a `*libc::c_void` seemed about equal, so I'd welcome feedback there.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3efa74997626afb3eda0f34842a4969da468dff0
2015-10-28 16:55:36 +05:01
Nathan Froyd
cb4c680b95 servo: Merge #8040 - generate JIT argument type information for methods (from froydnj:codegen-arg-info); r=jdm
This enhances `CodegenRust.py` to output `JSTypedMethodJitInfo` structures where appropriate.  This brings a notable speedup to tests like Dromaeo's `dom-attr/getAttribute`, which improves by several orders of magnitude with these patches applied.

If there are tricks for addressing the XXX comments, I would appreciate hearing them.

I think this addresses all of #6904.

Source-Repo: https://github.com/servo/servo
Source-Revision: d1295e9e7d0acfa32a55827fa8e28a297dbcf214
2015-10-28 00:37:06 +05:01
Akos Kiss
5eb76ac9ed servo: Merge #8132 - Fix char types in script binding codegen (from akosthekiss:codegen-u8); r=Ms2ger
Use `libc::c_char` instead of `i8` for character data since that's more
portable. (Some architectures, e.g. AArch64, have unsigned characters,
i.e. `u8`.)

Source-Repo: https://github.com/servo/servo
Source-Revision: 3342cd9531c1f3c0419a0733b73c65838780a0f7
2015-10-21 10:44:14 -06:00
Anthony Ramine
bb8125a3da servo: Merge #8041 - Introduce trait Castable (from nox:castable); r=jdm
Removes all those messy FooCast structures in InheritTypes.rs.

Source-Repo: https://github.com/servo/servo
Source-Revision: 674589c370d978f543e71f995d58c5b28e6e9842
2015-10-21 07:57:32 -06:00
Corey Farwell
f73c951c58 servo: Merge #8059 - Fix formatting for variable in doc-comment within codegen (from frewsxcv:fix-codegen-docs); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: b847e4dd778e49ba60c786da4aa77813dee8b553
2015-10-18 07:55:48 -06:00
Anthony Ramine
06fd534a1b servo: Merge #8020 - Generate all Derived implementations in codegen (from nox:codegen-derived); r=Ms2ger
Follow-up of #7873.

@Ms2ger r? :)

Source-Repo: https://github.com/servo/servo
Source-Revision: 417cf5738e4609f4b2e34e9e0c4f7ef68f087432
2015-10-15 12:53:08 -06:00
Anthony Ramine
9be943ec1a servo: Merge #7972 - Introduce DOMClass::heap_size_of (from nox:codegen-heapsize); r=Ms2ger
It holds a function pointer to the HeapSizeOf::heap_size_of_children()
implementation corresponding to that IDL interface.

This removes the need for a clumsly TypeId-based match expression in the
former heap_size_of_eventtarget() function.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5a0a91eba794af027723051c7f039cb22088aa65
2015-10-15 07:13:55 -06:00
Michael Wu
e4dfd5fc9a servo: Merge #7727 - Support the updated spidermonkey bindings (from michaelwu:update-bindings); r=jdm
Still need to finish the rust-mozjs update and make cargo use it, but it's close enough that I don't expect much to change on the servo side.

Some changes here
- bools are properly translated now
- char16_t is handled as u16 now
- JS_GlobalObjectTraceHook isn't mangled now
- JSJitInfo has been adjusted
- A const fn is used to generate bitfields in JSJitInfo
- Manually generating handles now requires calling an unsafe function. It's not actually required, but it's too much of a hassle to generate them manually now due to bindgen++ adding base classes now.

Source-Repo: https://github.com/servo/servo
Source-Revision: b34fd5bd7e55be1d577df5cf70b41af8a6cc716b
2015-10-14 14:48:44 -06:00
Anthony Ramine
d5038d123e servo: Merge #7873 - Generate the various TypeId enums in codegen (from nox:codegen-typeid); r=Ms2ger
This frees us forever from caring about maintaining these enums. The last commit removes their use from the initialisation of interface objects derived from Node.

Source-Repo: https://github.com/servo/servo
Source-Revision: 32daa17d5cbcad02db0713e21e52410cdc60480e
2015-10-14 12:47:48 -06:00
Andriy Kunitsin
d8ffd6e1db servo: Merge #7948 - Changed dom_class type to Option<&'static DOMClass> to fix #7942 (from kunitsyn:master); r=Manishearth
I have a feeling that converting `Option<&T>` to `*const libc::c_void` could be less explicit.
Was there any way to do it shorter?

Source-Repo: https://github.com/servo/servo
Source-Revision: 9cccd98254191b1663dcaee9010eee63fa8074a3
2015-10-09 23:22:59 -06:00
Ms2ger
2127faec58 servo: Merge #7903 - Add support for documenting CGAbstractMethods (from Ms2ger:codegen-docs); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: 745635a706223df3d0f6db927cf1f547d948be87
2015-10-07 06:20:20 -06:00
Anthony Ramine
c2667cecbc servo: Merge #7735 - Don't generate useless InheritTypes interfaces (from nox:rm-useless-casts); r=Ms2ger
Interfaces with no descendant need neither a Base trait nor upcast functions, and interfaces with no ancestors neither a Derived trait nor downcast functions.

Source-Repo: https://github.com/servo/servo
Source-Revision: 243647d15a48b2b7008657d321dead9912347d03
2015-10-05 06:09:56 -06:00
Corey Farwell
91eafe9f20 servo: Merge #7691 - Remove deprecated 'creator' WebIDL attribute (from frewsxcv:rm-creator-webidl-attribute); r=nox
According to @Ms2ger, the 'creator' attribute was merged into 'setter'

Source-Repo: https://github.com/servo/servo
Source-Revision: 291fa888326e743a1e59aa7c06d5288a0643cbb7
2015-09-21 05:45:30 -06:00
Corey Farwell
7eef01d9ec servo: Merge #7690 - Minor DOM codegen cleanup (from frewsxcv:codegen-cleanup); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: ec9aa9ace024470363ff227b97fb442a400fe496
2015-09-21 01:53:56 -06:00
Anthony Ramine
6953aa403a servo: Merge #7606 - Move the type_id fields to DOMClass (from nox:move-typeid); r=jdm
Cc @michaelwu.

Source-Repo: https://github.com/servo/servo
Source-Revision: d5ee58caf269779e86b2efc50ddf37d3e4eba9b9
2015-09-13 11:53:42 -06:00
Corey Farwell
54e55fc66f servo: Merge #7591 - Link to Servo issue instead of Gecko bug (from frewsxcv:servo-issue); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: d64331b7d27189e6620d7df61e82cf59e776a2ff
2015-09-10 02:56:11 -06:00
Corey Farwell
22eaaf37cf servo: Merge #7568 - Use OS-agnostic filesystem paths in Python (from frewsxcv:os-agnostic-paths); r=jdm
This will eventually need to be done for #1908

Source-Repo: https://github.com/servo/servo
Source-Revision: 83972196600f04e817ddb53fda18142778905307
2015-09-08 22:29:04 -06:00
Corey Farwell
116fee3cab servo: Merge #7516 - Allow 'script' component to enter a 'built' state (from frewsxcv:dirty-script-dir); r=metajack
After this pull request merged:

https://github.com/servo/servo/pull/7209

the 'script' component would never enter a 'built' state. In other
words, if one calls `mach build`, lets it complete, then calls `mach
build` again, the 'script' component would rebuild even though we
supposedly just built it. This was due to the `ParserResults.pkl`
getting placed in the `components/script` directory instead of the
output directory, causing cargo to think that there were unbuilt files.

Source-Repo: https://github.com/servo/servo
Source-Revision: ded6159d48901fc814d4b4395102fdbe0d9e5817
2015-09-02 14:29:21 -06:00
Corey Farwell
52d08c3cd3 servo: Merge #7209 - Cleanup/refactor build scripts for DOM codegen (from frewsxcv:codegen-build-cleanup); r=metajack
Prior to this commit, the script codegen makefile relied on an
intermediary pythonpath.py file that handled python dependencies and
incorporated a couple hacks to get the codegen building working. This
commit removes that intermediary file and attempts to make the script
codegen build process cleaner.

Source-Repo: https://github.com/servo/servo
Source-Revision: 493da96cae7cc0e3b533fc1f01cc0c5e38a27e02
2015-09-01 13:53:49 -06:00
Anthony Ramine
43d95e4258 servo: Merge #7455 - Do not allow some warnings in codegen anymore (from nox:rm-unused-warnings); r=jdm
This fixes #395.

Source-Repo: https://github.com/servo/servo
Source-Revision: a855669d4ff3ff635cfb84c072ba68650525f275
2015-08-30 11:37:04 -06:00
Josh Matthews
e97b25662a servo: Merge #7432 - Add dashed CSS properties in CSSStyleDeclaration (from jdm:dashedprops); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 940bcadc134d1cf123518bebd84635b0053d6858
2015-08-30 08:20:57 -06:00
Corey Farwell
2d6351b526 servo: Merge #7439 - Prefer JSTrue/JSFalse to 1/0 (from frewsxcv:jsfalse-jstrue); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 67cbda4be35a63222553ca806d475581030bea4e
2015-08-28 22:15:21 -06:00
Anthony Ramine
c327bc7867 servo: Merge #7416 - Make the traits for the IDL interfaces take &self (from nox:methods-ref); r=frewsxcv
Source-Repo: https://github.com/servo/servo
Source-Revision: 71b277d5675556e61a82ae9dbf3105449c3a8275
2015-08-27 15:08:41 -06:00
David Rajchenbach-Teller
d56115cce8 servo: Merge #7387 - Fixes #2240 - NamedGetter and NamedSetter do not assume that the arg is named name (from Yoric:2240-2); r=Ms2ger
I'm not totally sure about how to test this.

Source-Repo: https://github.com/servo/servo
Source-Revision: a897795dabf8d84c2da2935c54346a75987bcec5
2015-08-27 00:38:46 -06:00
Manish Goregaokar
672b1a1667 servo: Merge #7395 - Document InheritTypes (from Manishearth:doc-inherit); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 98728a6c751a8959459f80286833152e21fa6cfc
2015-08-26 20:56:02 -06:00
Manish Goregaokar
8c0333b4f1 servo: Merge #7397 - Remove doublepointer in VirtualMethods, and from_borrowed_ref (from Manishearth:doublepointer-meet-fire); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 48945b0fc1b1f1bee77f6cb30ac10e17614ef283
2015-08-26 15:01:12 -06:00
Corey Farwell
815476c7cf servo: Merge #7315 - Don't use is operatory to compare Python strings (from frewsxcv:python-is); r=SimonSapin
`is` checks identity. `==` checks value. I can't think of a reason why
we would want the former in these scenarios.

More info:

* http://stackoverflow.com/a/1504742
* https://docs.python.org/2/reference/expressions.html#is

Source-Repo: https://github.com/servo/servo
Source-Revision: 60140ad2942ae5d73c22963775b8f7529965fdb4
2015-08-22 09:26:34 -06:00
Corey Farwell
38ac5971e8 servo: Merge #7305 - Utilize Python context managers for opening/closing files (from frewsxcv:python-context-managers); r=Ms2ger
In some of these cases, files were not being closed

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a48e04caffa4ba25854a4190883d1985845a359
2015-08-21 09:30:06 -06:00
Corey Farwell
7fb2f8eb04 servo: Merge #7254 - Initial implementation of ownPropertyKeys proxy handler (from frewsxcv:own-property-keys); r=Ms2ger
Generates `SupportedPropertyNames` on DOM structs that should implement
it. Most of them are unimplemented now (which can be implemented in
later PRs), with the exception of `HTMLCollection`. Also added a couple
relevant WPT tests.

Closes #6390

Closes #2215

Source-Repo: https://github.com/servo/servo
Source-Revision: d2a8c278eaa159ceacffee767523d4ad0cf83da2
2015-08-20 10:00:44 -06:00
Anthony Ramine
3c5a2d72f0 servo: Merge #7230 - Support required dictionary members (fixes #7216) (from nox:required-dictionary-member); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: ef98e574297ed738f3b117c128bc578f623a35d5
2015-08-18 12:58:09 -06:00
Anthony Ramine
f79b4bd4b2 servo: Merge #7236 - Fix dictionary member conversion failure (fixes #7231) (from nox:dictionary-failure-code); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: a2978f2add3a9c828b7bb701cb2d04318e5c0b45
2015-08-16 06:39:56 -06:00
Anthony Ramine
ea3b1cdfb8 servo: Merge #7233 - Support default values for restricted float members (fixes #7217) (from nox:default-float-value); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 55e755e35ac8622a80cbebe3395aae44a0239b4f
2015-08-15 10:59:44 -06:00
Corey Farwell
1b3761b963 servo: Merge #7199 - Prefer if..let over if..is_some..unwrap in codegen (from frewsxcv:codegen-if-let); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: 2e1ca10eeaf6a62326c1b864345f624ed2974a52
2015-08-13 15:35:21 -06:00
Corey Farwell
9ea1ff0919 servo: Merge #7196 - Avoid marking codegen method bodies as unsafe twice (from frewsxcv:double-unsafe); r=jdm
`CGAbstractMethod` takes a couple boolean parameters, among others:

* `extern`: will mark the method as `unsafe` and `extern`
* `unsafe`: will wrap the method body in an `unsafe` block

Passing both as `True` should not mark it as `unsafe` twice.

Example from a generated `HTMLCollectionBinding.rs`:

Before:

```
unsafe extern fn get_length(..) -> u8 {
    unsafe {
        // code here
    }
}
```

After

```
unsafe extern fn get_length(..) -> u8 {
    // code here
}
```

Source-Repo: https://github.com/servo/servo
Source-Revision: 289decb064b44937f570fdc299de9af961296dd6
2015-08-13 15:00:37 -06:00
Corey Farwell
975ba6831a servo: Merge #6993 - Remove dead Python code in binding generating code (from frewsxcv:rm-dead-codegen); r=Ms2ger
Fixes #6956

Source-Repo: https://github.com/servo/servo
Source-Revision: 9ed2df3de704261399942b82a047a6a757501d53
2015-08-07 04:51:31 -06:00
Josh Matthews
2f1aaef81d servo: Merge #6874 - Start reporting memory usage for Window and all nodes in all DOM tree… (from jdm:domreporting); r=njn
…s for frame treese in script tasks.

This underreports by a significant amount, since only Document, Window and CharacterData (ie. text) nodes are fully represented. That being said, every HTML element in the tree is measured, but only counted as a Node. It's easy to improve this, it just requires adding the appropriate HeapSizeOf derives and increasing the granularity of `measure_memory_for_eventtarget`. google.com shows a dom-tree value of 0.24 MB for me at the moment.

r? @nnethercote

Source-Repo: https://github.com/servo/servo
Source-Revision: 84e25befdd97cf74fb00707dbe150d59d980e977
2015-08-03 21:24:41 -06:00
Ms2ger
cb152d0eb4 servo: Merge #6846 - Remove an obsolete comment I missed in #6804 (from Ms2ger:2661-comment); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: c5060fce9fa6e4b5b06ffd76d1e52bb74d00461c
2015-07-30 06:10:56 -06:00