Commit graph

97 commits

Author SHA1 Message Date
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Ms2ger
84b1b52682 Replace ByteString::as_slice() by a Deref implementation. 2015-05-01 21:19:11 +02:00
Ms2ger
a862479ca8 Remove as_slice() calls from script. 2015-04-26 10:52:55 +02:00
Ms2ger
6b79d57920 When converting a non-finite float, throw the TypeError from the FromJSValConvertible implementation.
This removes some unnecessary custom code in the codegen and makes this
implementation follow the convention of having thrown an exception when
returning Err() from FromJSValConvertible.
2015-04-07 14:16:34 +02:00
Ms2ger
e3683c8598 Merge the To/FromJSValConvertible implementations for Finite<T>. 2015-04-07 13:34:06 +02:00
Ms2ger
58a8cfda52 Drop the FromJSValConvertible implementation for interfaces.
It doesn't really fit in the design, and native_from_reflector_jsmanaged has
gained the usability improvements that it used to lack.
2015-04-07 13:11:45 +02:00
Tetsuharu OHZEKI
9cd1b2c158 Use Finite<T> for our dom code (excluding CanvasRenderingContext2D) 2015-03-25 10:45:30 +09:00
Tetsuharu OHZEKI
f7fd34c0aa Introduce Finite<T: Float> for restricted values defined in WebIDL. 2015-03-25 10:45:30 +09:00
Tetsuharu OHZEKI
2bf2c0020b Add bindings support for unrestricted float/double values. 2015-03-25 10:45:30 +09:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
Ms2ger
2345f5461b Null-check the result of JS_GetStringCharsAndLength. 2015-03-13 21:27:58 +01:00
Ms2ger
bbbdb98897 Implement USVString. 2015-03-13 21:27:58 +01:00
Chris Double
2af19b2675 Fix #2108 by renaming unwrap functions to native_from_reflector
As noted by @bholley. "unwrap" is confusing because we are
both stripping off wrappers *and* getting a native from a
reflector. Changing the "unwrap" usage to "native_from_reflector"
for clarity.

This renames 'unwrap' to 'native_from_reflector' and
'unwrap_jsmanaged' to 'native_from_reflector_jsmanaged'.
2015-03-12 19:15:12 +13:00
Ms2ger
10ddb86d61 Remove the implementation of ToJSValConvertible for JS<T>.
It is unused and doesn't serve a purpose.
2015-02-21 11:09:06 +01:00
Ms2ger
6d30ec77c8 Replace uint/int by usize/isize in various places. 2015-02-20 14:45:47 +01:00
Ms2ger
a3fedee46e Return usize from IDLInterface::get_prototype_depth.
It is used as an index into an array.
2015-02-20 14:45:47 +01:00
Ms2ger
21a1143dd1 Use u32 for reserved slot indices.
This is what the JSAPI expects.
2015-02-20 14:45:46 +01:00
Ms2ger
c58213b698 Remove the Option<Self> arguments from IDLInterface. 2015-02-19 09:52:48 +01:00
Ms2ger
e921ce859e Fix some warnings in script. 2015-02-12 20:05:14 +01:00
Ms2ger
147dadce89 Implement an Unrooted smart pointer to replace JS when it is not traced. 2015-02-06 12:33:32 +01:00
Ms2ger
e596afe22d Document the DOM.
This is by no means complete, but it is a good place to start.
2015-02-05 14:41:12 +01:00
Manish Goregaokar
5c9b1019a9 Move FromJSValConvertible to associated types (avoids old impl check) 2015-01-31 16:05:16 +05:30
Ms2ger
dac0190b6d Use snake case for the argument to from_jsval for DOMString. 2015-01-29 21:07:46 +01:00
Ms2ger
505159a464 Import the util crate as util rather than servo_util.
This used to conflict with the util crate from the standard library, which
has long since been removed.

The import in layout has not been changed because of a conflict with the
util mod there.
2015-01-29 12:16:41 +01:00
bors-servo
1a2a08aa50 auto merge of #4717 : Ms2ger/servo/doc-proxy, r=saneyuki 2015-01-28 01:48:52 -07:00
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Ms2ger
238f3e2d91 Require documentation for all code in dom::bindings (excluding dom::bindings::codegen). 2015-01-25 22:01:04 +01:00
Ms2ger
01ed338746 Move to to_owned rather than into_string.
into_string has been removed from Rust.
2015-01-20 14:49:07 +01:00
Matthew Rasmus
7bbce60e43 Fix renamed to slice::from_raw_buf warning 2015-01-08 08:51:11 -08:00
Guillaume Bort
5fe3a3e54f Fix #3936 – {Window,WorkerGlobalScope}.set{Timeout,Interval}(DOMString) 2015-01-07 11:39:15 +01:00
bors-servo
141b5d038f auto merge of #4526 : servo/servo/deref-1, r=Manishearth
This is a start towards fixing #3868. Not all callers have been fixed yet, so the `Deref` implementation remains for now.
2015-01-02 09:22:51 -07:00
Ms2ger
43eecf6e7a Stop using ptr.is_not_null() in script.
This method is deprecated in rust master; removing its users in advance will
make a future rust upgrade smoother.
2015-01-01 22:19:34 +01:00
Ms2ger
1dad710063 Replace Root::deref() calls by Root::r() calls where possible.
This changes those calls that were already sound.
2015-01-01 20:36:43 +01:00
Ms2ger
1290c18794 Remove the 'b lifetime from Root.
It does not add any safety, as the reference is constructed from a raw pointer
without limiting the lifetime in any way.
2015-01-01 20:36:43 +01:00
Ms2ger
95ec20bd97 Remove the 'a lifetime from Root.
It does not add any safety, as the reference is constructed from a raw pointer
without limiting the lifetime in any way.
2015-01-01 20:36:43 +01:00
yodalee
bb087c238b use str to_jsval() now
xmlhttprequest.rs, CodegenRust.py
replace into_string().to_jsval() to to_jsval()

conversions.rs
DOMString to_jsval() use as_slice().tojsval() now
2015-01-01 02:17:33 +08:00
yodalee
6f569dee92 add str ToJSValConvertible for str type 2014-12-31 20:20:44 +08:00
Manish Goregaokar
e9d1740e19 script: to_string() -> into_string() 2014-12-27 14:48:36 +01:00
Ms2ger
96180ec3ad Move unwrap_jsmanaged and related machinery to conversions.rs. 2014-12-20 14:51:14 +01:00
Ms2ger
b8c2573f4d Remove the proto_{id,depth} arguments from unwrap_jsmanaged.
Instead, we infer them from the type we're unwrapping into. This will prevent
any mismatches between the type we return and the type we check for.
2014-12-20 13:48:21 +01:00
Ms2ger
e2b75670bd Rename the PrototypeList enums to fix case build warnings. 2014-12-18 10:33:57 +01:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Ms2ger
3ed3c9a978 Document bindings/conversions.rs. 2014-11-07 18:33:38 +01:00
Ms2ger
b60a601f56 Move jsstring_to_str and jsid_to_str to conversions.rs.
This appears to be a more sensible location for them.

Relevant to #433.
2014-10-16 10:42:09 +02:00
Simon Sapin
b3245fa407 Upgrade to rustc d2b30f7d3 2014-09-23 2014-09-29 17:41:45 +01:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/script/dom/bindings/conversions.rs (Browse further)