Commit graph

538 commits

Author SHA1 Message Date
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
Bruno de Oliveira Abinader
bb577968e5 Codegen style fix 2014-12-30 12:40:49 -04:00
Bruno de Oliveira Abinader
7cca51b3b4 Codegen empty lines fix 2014-12-30 12:40:48 -04:00
Bruno de Oliveira Abinader
0721c624d9 Codegen indent fixes 2014-12-30 12:40:48 -04:00
Bruno de Oliveira Abinader
c950e3d61e Codegen whitespace fixes 2014-12-30 11:28:59 -04:00
bors-servo
2c259f477c auto merge of #4057 : jdm/servo/refcountdom, r=Ms2ger
This replaces the specialized TrustedXHRAddress and TrustedWorkerAddress code that was used for the same purpose. A non-zero refcount pins the given DOM object's reflector and prevents it from being GCed even when there are no other outstanding references visible to SpiderMonkey. This will enable us to implement asynchronous operations that refer to particular DOM objects (such as "queue a task to fire a simple event named load at the iframe element" from the spec) safely and conveniently, and paves the way for things like asynchronous network responses.

Some concerns about the resulting size of XHR progress messages have been expressed, but I believe optimizations to reduce that can be implemented in subsequent PRs.

r? @Ms2ger - note in particular the changes to the worker lifetime code. I couldn't figure out how to achieve an identical lifetime to the previous addref/release pairing, and I also was having trouble figuring out why the existing setup was safe. The new implementation now holds the main script task Worker object alive via the TrustedWorkerAddress field in the dedicated worker global scope, which is a significant difference.
2014-12-29 11:57:45 -07:00
Josh Matthews
9a7cd31134 Force all messages to worker tasks to send a TrustedWorkerAddress along with the ScriptMsg. This ensures that the main-thread Worker object is rooted for as long as there are events in flight or being processed. 2014-12-29 13:53:49 -05:00
Josh Matthews
2f059c15e7 Allow refcounting arbitrary DOM objects in concert with the GC to enable safe, asynchronous/cross-task references to pinned objects. 2014-12-29 13:53:48 -05:00
Bruno de Oliveira Abinader
ab618dd9c7 Add support for named deleter
Closes #4469.
2014-12-29 12:58:48 -04:00
ProgramFOX
18d8ee6ce0 Added readonly flag for CSSStyleDeclaration 2014-12-28 17:39:07 +01:00
bors-servo
56d1b16d1b auto merge of #4173 : Manishearth/servo/a-more-dom-struct, r=kmcallister
Now `#[dom_struct]` also generates Reflectable impls, and there's another lint to ensure that a DOM struct only contains one bare DOM field (as the first field) or a Reflector.

A lot of this was generated by sed -- each autogenerated change has its own commit for easy review; these will be squashed later.
2014-12-27 22:12:45 -07:00
Manish Goregaokar
e9d1740e19 script: to_string() -> into_string() 2014-12-27 14:48:36 +01:00
Manish Goregaokar
d761877ef6 Add inheritance-checking lint 2014-12-27 02:53:35 +05:30
bors-servo
0e6304dcf7 auto merge of #4467 : servo/servo/dataset, r=Ms2ger 2014-12-25 02:27:43 -07:00
Matt McCoy
bdb75c2146 This fixes #4166. throw_dom_exception will take the GlobalRef by value, and all generated code will pass it by value. 2014-12-24 17:16:48 -05:00
Ms2ger
919f2217f0 Implement dummy getOwnPropertyNames and enumerate traps. 2014-12-24 17:17:40 +01:00
thiagopnts
271aa277e9 Replace XHR events for generic ones in ScriptTask
fixup! Replace XHR events for generic ones in ScriptTask

fixup! Replace XHR events for generic ones in ScriptTask
2014-12-23 23:53:38 -02:00
Bruno de Oliveira Abinader
e0bab08754 Correct the generated code for NamedSetter calls. 2014-12-23 14:23:22 +01:00
Bruno de Oliveira Abinader
ade0b7be8e Use the custom defineProperty trap when it exists. 2014-12-23 14:22:30 +01:00
Bruno de Oliveira Abinader
c82eb3b1a4 Call the NamedGetter method from the get trap in proxy bindings. 2014-12-23 13:02:52 +01:00
Ms2ger
dc63735ca7 Revert PR #4038 for causing WPT failures. 2014-12-23 09:53:12 +01:00
bors-servo
a773bd5c45 auto merge of #4454 : amwatson/servo/global_update, r=jdm
Changed fn_wrap argument in reflect_dom_object() and reflect_node() to pass GlobalRef by value rather than by reference.  Fixes #4165
2014-12-20 17:51:44 -07:00
bors-servo
6efa7eedbc auto merge of #4452 : Ms2ger/servo/_obj_toString, r=jdm 2014-12-20 17:24:44 -07:00
Amanda Watson
582ba9d796 GlobalRef passed by value in reflect_dom_object, reflect_node #4165 2014-12-20 16:20:53 -08:00
bors-servo
b4025f167f auto merge of #4451 : Ms2ger/servo/bytestring-doc, r=jdm 2014-12-20 16:57:43 -07:00
Ms2ger
8b3d64f8e3 Reindent _obj_toString. 2014-12-20 16:44:24 +01:00
Ms2ger
ef3901fceb Simplify _obj_toString by using JS_NewStringCopyN. 2014-12-20 16:40:20 +01:00
bors-servo
661144d285 auto merge of #4450 : Ms2ger/servo/domrefcell-doc, r=jdm 2014-12-20 08:36:43 -07:00
Ms2ger
ca2ce8e5b8 Require documentation for ByteString. 2014-12-20 16:12:13 +01:00
bors-servo
1f74e54bb2 auto merge of #4038 : brunoabinader/servo/dataset, r=Ms2ger
Spec: https://html.spec.whatwg.org/multipage/dom.html#dom-dataset

Closes #2974.
2014-12-20 08:06:44 -07:00
Ms2ger
7ec11b22b4 Document DOMRefCell.
Based on the RefCell documentation.
2014-12-20 15:11:20 +01:00
Ms2ger
0274978a08 Remove the unused DOMRefCell::unwrap method. 2014-12-20 15:03:11 +01:00
Ms2ger
96180ec3ad Move unwrap_jsmanaged and related machinery to conversions.rs. 2014-12-20 14:51:14 +01:00
Ms2ger
73c236ce3b Use unwrap() when finalizing.
This allows us to duplicate a little less code.
2014-12-20 14:07:23 +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
e1dae2f59b Use the try macro in unwrap_jsmanaged. 2014-12-20 13:42:38 +01:00
Bruno de Oliveira Abinader
1533c07453 CodegenRust fixes for NamedGetter 2014-12-19 14:07:43 -04:00
Josh Matthews
8ff3e6bbdc Create a replacement for Cell<SM primitive>. Fixes #4337. 2014-12-19 11:17:02 -05:00
Tetsuharu OHZEKI
a7bb436177 script: Remove glob imports added in #4405 2014-12-19 04:52:48 +09: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
Edit Balint
3036c8d21d Fixed codegen error regarding Uint8ClampedArray 2014-12-16 11:03:01 +01:00
Patrick Walton
a1ea44b294 style: Address review comments relating to bgcolor and column spans 2014-12-15 18:09:44 -08:00
Patrick Walton
14bafb11be style: Parse the legacy bgcolor attribute per the HTML5 specification.
Additionally, this patch cleans up some miscellaneous formatting issues.
2014-12-15 17:41:44 -08:00
Joseph Crail
c254d195ad Fix spelling mistakes in comments. 2014-12-11 23:56:29 -05:00
Manish Goregaokar
5511e02a78 Add Comparable trait to js.rs; fixups 2014-12-06 02:51:52 -08:00
bors-servo
6bd9bf979b auto merge of #4198 : Manishearth/servo/hyper-droid, r=Manishearth
This is the Hyper pull request, plus the set up for OpenSSL on Android to make it merge.

Sean's commits have been reviewed in #4065 (My Android changes were reviewed by Glenn)
2014-12-05 04:16:11 -07:00
Sean McArthur
4ee8c3a60b convert script crate to use hyper 2014-12-04 10:06:41 -08:00
Ms2ger
d26283c065 Implement MutNullableJS::or_init.
This will make it easier to implement lazy getters.
2014-12-04 15:49:29 +01:00