Commit graph

138 commits

Author SHA1 Message Date
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
Ms2ger
e4397aa49e servo: Merge #6809 - Remove unrooted_must_root annotation from unions (fixes #2661) (from Ms2ger:unrooted_must_root); r=metajack
The unsafety was fixed as part of the SpiderMonkey upgrade; this removes the
now unused annotation.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7adc336aaacfb5e544a9c8c4e0387afa457e5d72
2015-07-29 13:20:20 -06:00
Akos Kiss
b185c71656 servo: Merge #6718 - Add aarch64-unknown-linux-gnu support (from akosthekiss:aarch64-support); r=jdm
* Adding dependencies
* Replacing `i8` with `libc::c_char` to build properly on platforms
  where char is unsigned.

Source-Repo: https://github.com/servo/servo
Source-Revision: b386d7ae444af868907b9faff44e8432469160bd
2015-07-23 17:17:18 -06:00
snf
062b7d8932 servo: Merge #6582 - Add Clamp and EnforceRange support for webidl arguments (from servo:clamp-enforce-range); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 36d732a60a39140806b4113d58a6b00e6b1931da
2015-07-22 11:03:05 -06:00
Corey Farwell
a5ddc4d3c6 servo: Merge #6592 - Use NotImplementedError for Python base class methods (from frewsxcv:notimplementederror); r=Ms2ger
From the Python docs:

https://docs.python.org/2/library/exceptions.html#exceptions.NotImplementedError

"In user defined base classes, abstract methods should raise this
exception when they require derived classes to override the method."

Source-Repo: https://github.com/servo/servo
Source-Revision: a9f12da4f8a48daa197ff8bbc2021009fe6e2711
2015-07-21 11:28:21 -06:00
Ms2ger
2fa4baeb5d servo: Merge #6621 - Move away from the repeat().take().collect() pattern (from Ms2ger:repeat); r=SimonSapin
This was the preferred pattern between the deprecation of Vec::from_elem and
the addition of the count argument to the vec![] macro.

Source-Repo: https://github.com/servo/servo
Source-Revision: 556c0e1509cb48b90f492bcf0f25d0ed14b015d1
2015-07-14 02:42:26 -06:00
Corey Farwell
78f93158a2 servo: Merge #6580 - Remove tidy blacklist for 'script/dom/bindings/*' (from frewsxcv:lint-codegen); r=Ms2ger
Recently, I found myself reading through the Python codegen scripts that
live in 'components/script/dom/bindings/*' and noticed that there were
many tidy violations: unnecessary semicolons, weird spacing, unused
variables, lack of license headers, etc. Considering these files are now
living in our tree and mostly maintained directly by contributors of
Servo (as opposed to being from upstream), I feel these files should not
be excluded from our normal tidy process. This commit removes the
blacklist on these files and fixes all tidy violations.

I added these subdirectories to the blacklist because they appear to be
maintained upstream somewhere else:

* "components/script/dom/bindings/codegen/parser/*",
* "components/script/dom/bindings/codegen/ply/*",

Also, I added a few '# noqa' comments which tells us to ignore the
flake8 errors for that line; they are mostly for unused/undefined
variables. I chose to ignore these (instead of fixing them) to make the
work for this commit simpler for me.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2d2a340633dcc73e458a8454b78e26ba93511d37
2015-07-09 07:55:27 -06:00
Ms2ger
d7892fb4aa servo: Merge #6549 - Remove *Cast::from_actual (from Ms2ger:from_actual); r=nox
Since JSRef was removed, from_actual duplicates from_ref.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0298c92670bee90c06f98fac2e8469d1238d1bd4
2015-07-03 22:56:17 -06:00
David Winslow
b9c1f245a1 servo: Merge #6529 - Refactor #[jstraceable] to #[derive(JSTraceable)] (from dwins:master); r=Manishearth
fixes #6524.  I had to make an additional change not mentioned in the ticket - adding the `#[feature]` to enable deriving custom traits but I assume that's expected at this time.

Source-Repo: https://github.com/servo/servo
Source-Revision: bbb39082e0f640400546d2084a450a8675820a82
2015-07-01 18:27:40 -06:00
Mukilan Thiyagarajan
54306745e4 servo: Merge #6496 - CGImports must consider special operations to generate required 'use' items (from mukilan:fix_import_codegen); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: b7923547a77a2d887805ba67f688d297e34647c1
2015-06-27 07:51:37 -06:00
Ms2ger
4ac16d06ff servo: Merge #6469 - Use Rc::get_mut rather than deprecated rc::get_mut (from Ms2ger:rc-mut); r=saneyuki
Source-Repo: https://github.com/servo/servo
Source-Revision: ef97879c273e9eed3b4dece07813c2d4e6eb2c38
2015-06-26 09:26:55 -06:00
Ms2ger
99cf771646 servo: Merge #6464 - Use Box::into_raw rather than boxed::into_raw (from Ms2ger:into_raw); r=saneyuki
The latter is deprecated.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9eb3cc2a241dff4df57d644fa5257fcf3a52325f
2015-06-26 04:50:54 -06:00
Joel Teichroeb
c23dfd93eb servo: Merge #6110 - Implement Named constructors and the Image constructor for HTMLImageElement (from klusark:NamedConstructor); r=Ms2ger
I'm not sure if I like how I mostly just duplicated the code in CodegenRust.py, so that might need to be refactored.

Instead of just calling it Image, we might want to call it ConstructorImage, to make it clear that it's a constructor. Anyone have an opinion on that?

There seems to be a bug in the HTMLImageElement getter/setter as the value is 0 regardless of what I do. This seems to be unrelated to my commits, so I'll investigate that separately.

Source-Repo: https://github.com/servo/servo
Source-Revision: 57cc84b2935c429c92774649275625a7fd63973c
2015-06-25 02:18:06 -06:00
Anthony Ramine
e6ba88516e servo: Merge #6223 - Merge generic funs to share them across all bindings (fixes #2684) (from nox:merge-generic-functions); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 6247a96761279979412fb49fa4fbca2fd9a82e1b
2015-06-24 03:54:56 -06:00
Michael Wu
7512d04e93 servo: Merge #6150 - Upgrade to Spidermonkey 39 (from servo:smupgrade3); r=mbrubeck
> Here it is.
>
> ~~There's two major things that are unfinished here:~~
> - ~~Dealing with the unroot_must_root lint. I'm not sure about the value of this lint with the new rooting API.~~ Done.
> - ~~Updating the Cargo.locks to point to the new SM and SM binding.~~ Done.
>
> I also included my fixes for the rust update, but these will disappear in a rebase. A rust update is necessary to support calling `Drop` on `Heap<T>` correctly when `Heap<T>` is inside a `Rc<T>`. Otherwise `&self` points to the wrong location.
>
> Incremental GC is disabled here. I'm not sure how to deal with the incremental barriers so that's left for later.
>
> Generational GC works. SM doesn't work without it.
>
> The biggest change here is to the rooting API. `Root` was made movable, and `Temporary` and `JSRef` was removed. Movable `Root`s means there's no need for `Temporary`, and `JSRef`s aren't needed generally since it can be assumed that being able to obtain a reference to a dom object means it's already rooted. References have their lifetime bound to the Roots that provided them. DOM objects that haven't passed through `reflect_dom_object` don't need to be rooted, and DOM objects that have passed through `reflect_dom_object` can't be obtained without being rooted through `native_from_reflector_jsmanaged` or `JS::<T>::root()`.
>
> Support for `Heap<T>` ended up messier than I expected. It's split into two commits, but only because it's a bit difficult to fold them together. Supporting `Heap<T>` properly requires that that `Heap::<T>::set()` be called on something that won't move. I removed the Copy and Clone trait from `Heap<T>` so `Cell` can't hold `Heap<T>` - only `UnsafeCell` can hold it.
>
> `CallbackObject` is a bit tricky - I moved all callbacks into `Rc<T>` in order to make sure that the pointer inside to a `*mut JSObject` doesn't move. This is necessary for supporting `Heap<T>`.
>
> `RootedCollectionSet` is very general purpose now. Anything with `JSTraceable` can be rooted by `RootedCollectionSet`/`RootedTraceable`. Right now, `RootedTraceable` is only used to hold down dom objects before they're fully attached to their reflector. I had to make a custom mechanism to dispatch the trace call - couldn't figure out how to get trait objects working for this case.
>
> This has been tested with the following zeal settings:
>
> GC after every allocation
> JS_GC_ZEAL=2,1
>
> GC after every 100 allocations (important for catching use-after-free bugs)
> JS_GC_ZEAL=2,100
>
> Verify pre barriers
> JS_GC_ZEAL=4,1
>
> Verify post barriers
> JS_GC_ZEAL=11,1

Source-Repo: https://github.com/servo/servo
Source-Revision: e7808c526c348fea5e3b48af70b7f1a066652097
2015-06-19 16:46:55 -06:00
Jack Moffitt
85fd686b68 servo: Merge #6408 - Generate code into OUT_DIR (from metajack:script-outdir); r=SimonSapin
This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but https://github.com/rust-lang/cargo/issues/1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.

Source-Repo: https://github.com/servo/servo
Source-Revision: ff59e1b8de67f1988522d6b6e6c4adda957fad5b
2015-06-17 16:36:05 -06:00
Ms2ger
758ff53bd9 servo: Merge #6378 - TreeWalker-acceptNode-filter.html fixes (from Ms2ger:callable); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 24af4c4ec638b0484c8acacdf7cb9acb87da24ff
2015-06-14 12:17:21 -06:00
Mukilan Thiyagarajan
d0d7a0e325 servo: Merge #6319 - Fix codegen for overload resolution. Fixes #6300 (from mukilan:overload-codegen); r=Ms2ger
The cause of the issue is that the index of the overload to be invoked was being derived from the wrong lists (that contain only a subset of the overloads)  - `possibleOverloads` and `interfaceSigs` rather than the `method.signatures()` (which contains all possible overloads).

Source-Repo: https://github.com/servo/servo
Source-Revision: b46ab0c60d53461d639c74d9c6b39d0c6c2d78c9
2015-06-10 03:50:42 -06:00
Daniel Le
40dcea91f9 servo: Merge #6299 - Avoid casting in the callers (from GreenRecycleBin:#6271); r=Ms2ger
get_proto_or_iface_array now returns *mut ProtoOrIfaceArray

Fix #6271

Source-Repo: https://github.com/servo/servo
Source-Revision: ca6a34a1cdf3b74f9eab04cf6ff914e47b37b640
2015-06-07 10:47:14 -05:00
Brian Anderson
72f556065f servo: Merge #6297 - Convert inline(always) to inline in CodegenRust and jstraceable (from brson:inline); r=jdm
This results in a 14% compile time improvement.

See https://gist.github.com/brson/b48dd03b06c406be68e6

I'm not suggesting you merge this as-is, but you might consider whether removing some of these is worth pursuing.

Source-Repo: https://github.com/servo/servo
Source-Revision: 78665336e6a3d57e43610365f52ce038ba0d9e8b
2015-06-06 08:25:29 -05:00
Josh Matthews
c4cc28789a servo: Merge #6247 - Trace the prototype array on the global object (from jdm:tracefix); r=Ms2ger
This should allow the jQuery testsuite to complete.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9edc296c46b05606c74920a42ba0effb5c953db0
2015-06-03 05:26:26 -05:00
ecoal95
73d5e20fe6 servo: Merge #6183 - Add WebGLContextAttributes support (from emilio:webglcontextattributes); r=nox
r? @jdm

I couldn't add the `getContextAttributes` method since `CodegenRust`
doesn't know how to return a dictionary value, I'll take a look at it ASAP.

I think the helper functions can return directly the renderer, since they're used just for that, but I wanted to hear your opinions about this.

By the way I'm interested in adding more serious tests for WebGL, and I think the [khronos conformance suit](https://github.com/KhronosGroup/WebGL/tree/master/conformance-suites/1.0.3) should be the best option.

Should I try to integrate it in wpt, or making a `tests/webgl` directory (or similar) inside the servo tree? (Maybe this question should be for @Ms2ger)

Source-Repo: https://github.com/servo/servo
Source-Revision: 0de09b936e5e37c15b7865157a98ad78b1077659
2015-06-01 08:37:48 -05:00
Philipp Hartwig
5fd9e25365 servo: Merge #6179 - Use byte string instead of handcrafted byte array (from aopicier:byte_strings); r=jdm
Fixes #3257
In eventtarget.rs I'm not sure whether ARG_NAMES actually needs to be static!?

Source-Repo: https://github.com/servo/servo
Source-Revision: 999325460ecc71b02160e8c79e71a694987d9acd
2015-05-25 17:13:27 -05:00
Anthony Ramine
cf915bf9ce servo: Merge #5902 - Fix length value of interface methods (from nox:length); r=jdm
Blocked by https://github.com/w3c/testharness.js/pull/124.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8faa9f877df67ad6bced9b5ec4ae580c042bfa45
2015-05-14 13:37:10 -05:00
Anthony Ramine
b5ec349295 servo: Merge #5894 - Implement WebIDL attribute PutForwards (from nox:putforwards); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 29a43a00b39e544596e3bcce9bdfca2159313ba5
2015-05-07 09:07:12 -05:00
Anthony Ramine
55930d5b87 servo: Merge #5896 - Properly generate proxy stringifiers (from nox:stringifier-proxy); r=jdm
The proxy stringifiers called through {}.toString.call() (obj_toString) shouldn't use the stringifier.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2c177794408bfbb5f8d6042f38639a5cba5eb2e5
2015-04-30 04:33:32 -05:00
Ms2ger
33e1b9c8ab servo: Merge #5888 - Prepare for the rustup (from Ms2ger:prepare-rustup); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: ab2d07db1fabd7ad9590aa7296038bbc91806c3f
2015-04-28 17:52:49 -05:00
snf
758d239681 servo: Merge #5845 - Fix defineProperty codegen (from snf:defineProperty_fix); r=jdm
This patch should get rid of #5223.

Source-Repo: https://github.com/servo/servo
Source-Revision: 01925f0f8f65be177e0c2d9bab14b091bf67b220
2015-04-28 07:51:31 -05:00
Anthony Ramine
39e9571d13 servo: Merge #5871 - Cleanup JS traits and methods (from nox:rootable); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: b8ae33e510ea30e3200834fc2f7fbc426b86701e
2015-04-28 04:23:05 -05:00
Manish Goregaokar
e158f4fca9 servo: Merge #5855 - Add move protection to Root and friends (from Manishearth:nomove); r=kmc,munksgaard
fixes #5724, #5737


uses https://github.com/Manishearth/rust-tenacious (can be moved in-tree if needed)

I can make it `Deny` by default too (I'll add a cargo feature to tenacious), though we might want it on
`Warn` until we get some mileage on it.

Source-Repo: https://github.com/servo/servo
Source-Revision: d7987e43c944eb9b156bf3244c08fce4cb570db4
2015-04-27 23:14:25 -05:00
Anthony Ramine
ba829d0432 servo: Merge #5850 - Fix generation of nullary callbacks (from nox:nullary-callbacks); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 92359c7b9addfe7ee161760aad20368bafd76c26
2015-04-27 08:42:42 -05:00
Anthony Ramine
d4b6a6316e servo: Merge #5852 - Remove unsafe transmute functions in JS and LayoutJS (from nox:rm-unsafe-transmute); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 56a7981c9c9c6df30fbb3add3d8d0085916fe313
2015-04-26 14:40:31 -05:00
Anthony Ramine
6c157bacf0 servo: Merge #5779 - Implement the CSS interface (from nox:css-escape); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 1f9de5ee2ce4dc039b01e575d60a4fee41a0b8b8
2015-04-25 05:42:41 -05:00