Commit graph

174 commits

Author SHA1 Message Date
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
2015-11-04 12:09:11 +01:00
rohan.prinja
7032a5d1de more cleanup 2015-10-30 22:57:59 +09:00
rohan.prinja
51df8e310b rearrange imports to be in alphabetical order 2015-10-30 20:28:59 +09:00
rohan.prinja
9fd823e449 replace InheritTypes imports with inheritance imports 2015-10-30 20:26:30 +09:00
rohan.prinja
45224028db more refactoring 2015-10-30 20:26:29 +09:00
bors-servo
30ce2a84c1 Auto merge of #8242 - Ms2ger:update-js, r=metajack
Update js.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8242)
<!-- Reviewable:end -->
2015-10-28 23:35:40 +05:30
Ms2ger
2a2ab23dfb Update js. 2015-10-28 18:02:10 +01:00
Nathan Froyd
c82b6ce843 move reserved slot setting for DOM globals
Moving this slot setting prior to initializing standard classes and
other initialization tasks means that we can effectively use JS_GC_ZEAL.

Fixes #6057.
2015-10-27 18:08:35 -04:00
Ms2ger
54d3462fa5 Use the new define_methods and define_properties functions from js. 2015-10-25 19:50:10 +01:00
Ms2ger
970b8aa8bc Remove the unused default implementation of Reflectable::init_reflector. 2015-10-23 17:21:04 +02:00
Anthony Ramine
c77d3b965f Introduce IDLInterface::derives()
This method is given a DOMClass value and returns whether it derives from Self.

Interfaces with no descendants directly check whether the given DOMClass is the
same as their own.
2015-10-21 10:59:36 +02:00
bors-servo
6111cf9ffc Auto merge of #7943 - pierrechevalier83:fix_issue_7941, r=Ms2ger
Clarify some code in do_create_interface_objects

rval.get() is believed to be always null upon entering this function.
This assumption is verified by the added assertion.
It makes more sense to move the block of code that was moved inside
the if statement which is the only place where it can be initialized.

Fixes #7941.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7943)
<!-- Reviewable:end -->
2015-10-19 09:37:03 -06:00
bors-servo
5a0a91eba7 Auto merge of #7972 - nox:codegen-heapsize, r=Ms2ger
Introduce DOMClass::heap_size_of

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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7972)
<!-- Reviewable:end -->
2015-10-15 07:13:55 -06:00
Anthony Ramine
da67630931 Introduce DOMClass::heap_size_of
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.
2015-10-14 21:52:16 +02:00
Michael Wu
e733a7c46a Support the updated spidermonkey bindings 2015-10-14 15:30:52 -04:00
Anthony Ramine
aab2c40389 Generate the TypeId enums in codegen 2015-10-14 18:45:35 +02:00
Pierre Chevalier
a6a685e954 Clarify some code in do_create_interface_objects
rval.get() is believed to be always null upon entering this function.
This assumption is verified by the added assertion.
It makes more sense to move the block of code that was moved inside
the if statement which is the only place where it can be initialized.

Fixes #7941.
2015-10-10 18:13:37 +01:00
Andriy Kunitsin
7301609c18 Changed dom_class type to Option<&'static DOMClass> 2015-10-09 19:57:22 +03:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Michael Wu
941f7dc04b Move EventTargetTypeId/NodeTypeId to DOMClass 2015-09-12 01:09:46 +02:00
Manish Goregaokar
e94df1ed5c Remove needless returns 2015-09-04 09:13:48 +05:30
Manish Goregaokar
54c036cd66 Elide most 'a lifetimes 2015-09-04 08:55:51 +05:30
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Ms2ger
a9671550ff Update js. 2015-08-18 12:21:03 +02:00
João Oliveira
067a22a868 Replace uses of for foo in bar.iter(),
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
2015-08-18 01:46:11 +01:00
João Oliveira
0038580abf Replace uses of for foo in bar.iter() and for foo in bar.iter_mut()
closes #7197
2015-08-15 02:27:39 +01:00
Josh Matthews
8620fe5995 Start reporting memory usage for Window and all nodes in all DOM trees for frame treese in script tasks. 2015-08-03 23:05:00 -04:00
bors-servo
4837dd9a1c Auto merge of #6850 - servo:rustup_2015-07-30, r=SimonSapin
Upgrade to rustc 1.3.0-dev (87055a68c 2015-07-30)

This builds and passes unit tests.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6850)
<!-- Reviewable:end -->
2015-07-30 14:46:13 -06:00
Simon Sapin
2b62041997 Remove usage of the deprecated box () (expr) syntax. 2015-07-30 18:01:44 +02:00
Josh Matthews
b2cf27ba5d Use an actual byte string when defining the prototype of named constructors. Fixes #6730. 2015-07-29 12:39:26 -04:00
Akos Kiss
fa86ea4f6f Add aarch64-unknown-linux-gnu support
* Adding dependencies
* Replacing `i8` with `libc::c_char` to build properly on platforms
  where char is unsigned.
2015-07-23 22:52:17 +00:00
Manish Goregaokar
f6f0a7e4aa Make stmt part of unrooted_must_root handle type parameters (fixes #6651) 2015-07-22 00:00:14 +05:30
Ms2ger
6d7bc2cffe Rename browser_context identifiers to browsing_context. 2015-07-20 15:56:32 +02:00
Simon Sapin
83d2a11d86 Upgrade to rustc 1.3.0-dev (fddfd089b 2015-07-10) 2015-07-15 00:46:43 +02:00
bors-servo
bbb39082e0 Auto merge of #6529 - dwins:master, r=Manishearth
Refactor #[jstraceable] to #[derive(JSTraceable)]

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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6529)
<!-- Reviewable:end -->
2015-07-01 18:27:40 -06:00
David Winslow
4cf46bff2d Refactor #[jstraceable] to #[derive(JSTraceable)]
fixes #6524
2015-07-01 18:27:06 -04:00
Matt Brubeck
13072c7b0c Remove string_cache dependency from util.
Move `namespace::from_domstring` from util to script::dom, because it is used
only in that crate.
2015-07-01 10:04:53 -07:00
Ms2ger
28086f3c75 Use Box::into_raw rather than boxed::into_raw.
The latter is deprecated.
2015-06-25 23:03:54 +02:00
bors-servo
57cc84b293 Auto merge of #6110 - klusark:NamedConstructor, r=Ms2ger
Implement Named constructors and the Image constructor for HTMLImageElement

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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6110)
<!-- Reviewable:end -->
2015-06-25 02:18:06 -06:00
Corey Farwell
1bd171e782 Remove unused js::JS_ARGV import in script component 2015-06-24 21:48:51 -07:00
Joel Teichroeb
012be81eab Add support for NamedConstructor in webidls 2015-06-24 10:42:53 -07:00
bors-servo
6247a96761 Auto merge of #6223 - nox:merge-generic-functions, r=Ms2ger
Merge generic funs to share them across all bindings (fixes #2684)



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6223)
<!-- Reviewable:end -->
2015-06-24 03:54:56 -06:00
Anthony Ramine
a90983553b Merge generic funs to share them across all bindings (fixes #2684) 2015-06-24 11:34:30 +02:00
Michael Wu
b7301ca06c Fix some warnings caused by the SM upgrade 2015-06-19 22:07:08 -04:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Daniel Le
15c4f7fe2d Avoid casting in the callers
get_proto_or_iface_array now returns *mut ProtoOrIfaceArray

Fix #6271
2015-06-06 12:22:18 +08:00
Josh Matthews
453679fd1f Trace the prototype array on the global object. 2015-06-01 18:36:57 -04:00
ecoal95
b3ac346749 Add WebGLContextAttributes support
This commit also:
* Allows to return non-rootable dictionaries from
Codegen.
* Merges the two context types in an enum type.
2015-06-01 15:29:38 +02:00
Tamir Duberstein
a3d463093e Avoid extra O(n) scan in validate_and_extract
Also `debug_assert!`s that `splitn` was called with the
correct `count` argument.
2015-05-26 13:26:26 -04:00