Commit graph

110 commits

Author SHA1 Message Date
Tetsuharu OHZEKI
1f8eda957d Use Cell/RefCell for interior mutability of Window. 2014-05-30 03:54:24 +09:00
Josh Matthews
003e5bcd46 Port modern callback handling code from Gecko, and copy related WebIDL parser bits too. 2014-05-27 20:43:52 +02:00
Josh Matthews
2d6153772c Add stubs for inline event handler manipulation. 2014-05-27 20:43:48 +02:00
Ms2ger
d5cb4377ef Use *mut T for the T* pointers in SpiderMonkey. 2014-05-26 18:19:44 +02:00
Tetsuharu OHZEKI
46d31632e0 Initial spec-incompliant implementation of default click action for anchor elements.
This is cherry-picked from https://github.com/mozilla/servo/pull/1688:

  * Initial spec-incompliant implementation of default click action for anchor elements.
  * Add documentation; gut the new document URL loading method
    and move it all into the new Window method.
  * Add test for default event prevention.

Original developer: Josh Matthews <josh@joshmatthews.net>
2014-05-23 23:30:09 +09:00
Ms2ger
eaedeb07cb Update Rust. 2014-05-22 16:36:40 -06:00
Ms2ger
44fb9eb28f Avoid unnecessary Rc clone in Window::new. 2014-05-14 12:26:24 +02:00
Tetsuharu OHZEKI
facffe0966 Move Window helper methods to a WindowHelpers trait 2014-05-14 13:14:29 +09:00
Ms2ger
ab5bf80447 Drop the pointless indirection in Window::active_timers. 2014-05-12 17:15:35 +02:00
Ms2ger
30055d9820 Move debug functions to Window IDL.
This is a cleaner way to expose those functions, and makes it possible to
remove a significant amount code in rust-mozjs.

The assert() function is no longer exposed, as it was unused and not very
useful.
2014-05-09 14:44:07 +02:00
Gulshan Singh
fb0c433b70 Add Performance object to Window and implement Performance::Now() 2014-05-07 17:30:33 -04:00
Ms2ger
243814022e Replace all ~"" with "".to_owned(). 2014-05-03 22:17:45 +02:00
Josh Matthews
0f2d0b1dc3 Address review comments. 2014-05-03 14:18:31 -04:00
Josh Matthews
a09a4bd297 Root Temporary values for the duration of their lifetime. 2014-05-03 14:18:31 -04:00
Josh Matthews
522d3f167b s/Unrooted/Temporary/g 2014-05-03 14:18:31 -04:00
Josh Matthews
7daa97c7e5 Remove abstract_self. 2014-05-03 14:18:30 -04:00
Josh Matthews
76783b029e Move WebIDL methods to traits implemented by JSRef types. 2014-05-03 14:18:30 -04:00
Josh Matthews
d7b96db33c Implement safe rooting strategy via Unrooted, Root, JSRef, and JS. 2014-05-03 14:18:30 -04:00
Josh Matthews
ffdc3f5b32 Turn on GC all the time. Fix rooting errors during parsing and storing timers. Fix borrow errors during tracing. 2014-05-03 14:18:30 -04:00
Tetsuharu OHZEKI
78856c87a4 Remove the 'pub use self::BindingDeclarations::*;' export. 2014-05-01 18:49:16 +09:00
Ms2ger
3ecfb9197f Remove unused support for passing extra arguments for timers. 2014-04-28 23:06:25 +02:00
Lars Bergstrom
948daf2422 This batch of changes upgrades Servo to work with the Rust upgrade as of
April 10, 2014. The main changes are to privacy, to work around the
issues with incorrect bounds on the libstd `Arc<Mutex<T>>`, and the
various API changes strewn throughout the libraries.
2014-04-27 15:46:12 -05:00
Josh Matthews
be2b983ec1 Make the I Tried star appear when a top-level page load fails for network-related reasons.
Under the hood, this requires treating the I Tried pipeline as a new load instead of a replacement, since the failure-handling code interacts poorly with the rest of the replacement code when we get a series of staggered failures over time from the various pipeline components.
2014-04-24 01:07:52 -04:00
Josh Matthews
94dffca1e1 Remove all traces of WindowProxy. Implement basic browser context concept and outerizing of inner windows. 2014-04-22 10:57:25 -04:00
Ms2ger
4f9e119334 Remove JSPageInfo::js_compartment.
A js::rust::Compartment is little more than a glorified pointer to the
reflector of a window, so there's no good reason to use it. Instead, this
commit passes a JS<Window> directly when it's necessary.

This also means that we now have to use JS_DefineFunctions rather than
Compartment::define_functions; I believe the former is clearer to the reader
than the extra indirection involved in the latter calling through three
reopsitories.

This commit also simplifies ScriptTask::load to reuse the 'cx' local that is
in scope already, rather than refetching it through js_info.
2014-04-21 13:43:18 +02:00
Josh Matthews
742f73ded5 Add transparent Traceable and Untraceable types to aid proper rooting practices, and replace ad-hoc Untraceable structs with empty Encodable implementations. 2014-04-17 17:41:09 -04:00
lpy
b7dcf62ed0 Implement Window.set/clearInterval.(fixes #2116) 2014-04-18 01:30:39 +08:00
Josh Matthews
b87d351fee Remove all traces of C wrappers for SpiderMonkey class stubs. 2014-04-08 10:15:12 -04:00
Ms2ger
31eee791dd Upgrade rust. 2014-04-04 20:10:32 +02:00
Martin Robinson
1a8a3cc271 Store Window.active_timers in a HashMap
A HashMap allows easily looking up a timer and canceling it in
Window.ClearTimeout.

Fixes #1477.
2014-03-31 15:07:50 -07:00
bors-servo
7f188500a1 auto merge of #1915 : Ms2ger/servo/wrap-return-js, r=jdm
This lets us avoid the sketchy tricks in JS::new and Window::new, where we
kept an unsafe pointer to the native object across the Wrap call that
consumed the owned pointer.
2014-03-19 19:01:48 -04:00
Josh Matthews
64c0de9fe7 Warning police. 2014-03-18 09:31:22 -05:00
Lars Bergstrom
bbac8aa5c3 Rust upgrades 2014-03-18 09:30:35 -05:00
Ms2ger
4ad3b6ccd1 Return a JS<T> from *Binding::Wrap rather than a JSObject.
This lets us avoid the sketchy tricks in JS::new and Window::new, where we
kept an unsafe pointer to the native object across the Wrap call that
consumed the owned pointer.
2014-03-14 13:06:51 +01:00
Ms2ger
a15cac53bc Don't use the Untraceable fields outside the module they're defined in.
This pattern will become illegal with the next Rust upgrade.
2014-03-12 14:30:19 +01:00
Ms2ger
84b0f45ed5 Use FooValue() functions. 2014-03-09 18:51:38 +01:00
Ms2ger
9fbfb1909c Move JSVal into the jsval module. 2014-03-08 18:49:55 +01:00
Ms2ger
971a4c58bb Pass Option<JSVal> for optional JSVals. 2014-03-07 12:40:25 +01:00
Ms2ger
6291aac170 Pass &JS<Window> to some constructors. 2014-03-04 14:10:33 +01:00
Ms2ger
b6138580d3 Stop passing the scope argument to global object bindings' Wrap functions. 2014-03-04 13:24:16 +01:00
Josh Matthews
fa542e5de7 De-@mut the script crate. 2014-02-28 13:42:03 -05:00
lpy
8fc5ba5dc6 Add url getter to Page and fix users of Page url with it.(fixes #1762) 2014-02-28 14:13:08 +08:00
Josh Matthews
625325434b Implement JSManaged for DOM objects. 2014-02-24 15:16:42 -05:00
Ms2ger
59184bf6e1 Move DOMString into servo_util. 2014-02-14 12:48:51 +01:00
Austin King
b1b481f3f3 Adding most commonly used parts of window.console. Fixes Issue#506. r=Ms2ger 2014-02-11 09:55:29 -08:00
zmike
193b6d2635 add names for all servo spawned tasks
* add servo_util::task::{spawn_named,spawn_with_named} functions

* add name param for spawn_listener and spawn_conversation functions

this should resolve #1169
2014-01-13 13:12:48 -05:00
Jack Moffitt
a7ef1cd35e Upgrade to latest Rust. 2014-01-12 19:45:45 -07:00
Patrick Walton
be69a503fe script: Eliminate the phantom type in favor of just whitelisting methods
that layout can safely call.

This is simpler. Currently, the set of methods is not safe, but I plan
to lock it down more soon.
2013-12-17 18:07:12 -08:00
Keegan McAllister
0238410b47 Allow setting id, class, style without a full reflow
Instead we do selector matching again, then diff the style structs to set the
"restyle damage" bits which are used to prune reflow traversals.

Also don't force a reflow when timers finish, because individual DOM methods
should already take care of that.
2013-12-12 14:43:26 -08:00
Keegan McAllister
39fc9eb868 Get rid of reflow_all
This refactoring should not alter behavior.
2013-12-12 14:43:26 -08:00