Commit graph

247 commits

Author SHA1 Message Date
Ms2ger
829259fb79 Introduce abstractions for global scopes.
Part of #2811.
2014-07-15 15:33:57 +02:00
Ms2ger
ac5a2767bf Move the call to RegisterBindings::Register into WindowBinding::Wrap. 2014-07-13 15:45:16 +02:00
Ms2ger
5baff0cc2c Pass a JSContext and a reflector to RegisterBindings::Register.
This makes the generated code less dependent on the fact that all global
objects are Windows.
2014-07-13 15:45:16 +02:00
Ms2ger
fd167f8922 Store proxy handlers in a static array rather than a hashtable per window. 2014-07-12 15:26:36 +02:00
Tetsuharu OHZEKI
975fee82da Remove needless mutabilities from script crate. 2014-06-22 21:22:58 +09:00
Matt Brubeck
4fef0d1c1c Separate "desktop" and "mobile" zoom calculations.
This ensures that the layout viewport responds to each type of zoom correctly,
and lays the ground for CSS Media Queries and CSS Device Adaption.

Until we have proper touch support, mobile-style "pinch" zoom can be simulated
by holding Ctrl while scrolling with a mousewheel or trackpad gesture.
2014-06-20 16:33:57 -07:00
bors-servo
7ed5041891 auto merge of #2649 : ebalint/servo/2580_JS_T_unrooted_replace, r=jdm
removed .clone() calls
modified from_rooted method parameter: T to &T
2014-06-13 14:33:03 -04:00
Edit Balint
94ec3cde8a Split Page code out of script_task.rs #2530 2014-06-13 19:28:57 +02:00
Edit Balint
bda29ade09 Replace uses of JS<T>.unrooted() with JS::from_rooted #2580 2014-06-13 19:06:28 +02:00
Ms2ger
ed333ad8c3 Pass immutable document to parse_html. 2014-06-11 22:57:54 +02:00
Ms2ger
e9b64dc361 Use internal mutability for Window::{active_timers, next_timer_handle}. 2014-06-11 19:51:07 +02:00
Ms2ger
07c67a1d5a Use internal mutability for Window::browser_context. 2014-06-11 19:51:07 +02:00
Ms2ger
6df6a7d512 Use internal mutability for Node.flags. 2014-06-11 19:51:07 +02:00
Ms2ger
9acba1477c Use internal mutability for EventTarget. 2014-06-11 19:51:06 +02:00
Ms2ger
0b364d13b6 Use internal mutability for Event. 2014-06-11 19:51:06 +02:00
Ms2ger
44f57ae6da Pass a JSRef to RegisterBindings::Register.
JS<T> should only be used for members of traced structures; the correct type
for arguments is JSRef.
2014-06-11 12:40:12 +02:00
Matt Brubeck
89327aa5be Outside of compositor, store window size in CSS px
This fixes an issue where the CSS viewport was too large on high-DPI displays
because it was set to the window size in device pixels, instead of px.  This
patch ensures that the window size is converted from device pixels to px
before being passed to script/layout code.

The Window trait now exposes the window size in both device pixels and
density-independent screen coordinates, with clearer method names.
2014-06-09 15:46:51 -07:00
Jack Moffitt
629c4c6afe Upgrade Rust. 2014-06-05 09:58:59 -06:00
bors-servo
59cef940e8 auto merge of #2535 : saneyuki/servo/mut, r=jdm
Related #2514
2014-06-01 16:19:20 -04:00
Tetsuharu OHZEKI
b38f39ebe4 Fix regression that no update to Page.fragment_node. 2014-06-02 00:38:57 +09:00
Ms2ger
d896442a4a Implement Event::new_initialized and initialize the event in Event::new. 2014-05-31 10:42:21 +02:00
Tetsuharu OHZEKI
a1bf49c1ce Use Cell instead of RefCell for Page.fragment_node. 2014-05-30 03:54:24 +09:00
Manish Goregaokar
01ade04e01 Fix unused_result warning in script_task 2014-05-29 19:31:42 +05:30
Matt Brubeck
418d9d2e44 Remove unnecessary pubs from script_task 2014-05-28 10:21:01 -07: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
bors-servo
28e3c17340 auto merge of #2442 : Manishearth/servo/xhr-async, r=jdm
(Note that only `getAllResponseHeaders()` is supported at the moment, I'll be adding the other header methods later.)
2014-05-20 12:16:35 -04:00
Manish Goregaokar
533fab46f9 Async XHR GET with basic response header support 2014-05-20 21:01:12 +05:30
Ms2ger
765cea73d9 Implement iframe.contentWindow. 2014-05-14 17:58:40 +02:00
Ms2ger
85285113e4 Instate a pre-wrap hook that outerizes its argument, to satisfy an undocumented JSAPI requirement. 2014-05-14 17:39:13 +02:00
Ms2ger
8f63c9e1c8 Store the subpage id in the Page. 2014-05-14 17:23:18 +02:00
Ms2ger
b77869bd9a Add a subpage_id field to NewLayoutInfo. 2014-05-14 12:50:26 +02:00
Ms2ger
69172a1ae5 Rename the pipeline ID fields in NewLayoutInfo.
This will make the distinction clearer with the subpage ID field to be added.
2014-05-14 12:44:59 +02:00
bors-servo
049fa56fff auto merge of #2425 : saneyuki/servo/window_helper, r=jdm
Fix #2418
2014-05-14 00:55:17 -04:00
Tetsuharu OHZEKI
facffe0966 Move Window helper methods to a WindowHelpers trait 2014-05-14 13:14:29 +09:00
bors-servo
6871e4ccb6 auto merge of #2420 : Ms2ger/servo/merge-Page-PageTree, r=pcwalton 2014-05-13 23:52:21 -04:00
Ms2ger
c437bacfc8 fixup! Use a match rather than a for loop for last_loaded_url in ScriptTask::load. 2014-05-13 19:52:25 +02:00
Ms2ger
1bf270d369 Merge Page and PageTree. 2014-05-13 18:27:24 +02:00
Ms2ger
1d464abb5a Use a match rather than a for loop for last_loaded_url in ScriptTask::load. 2014-05-13 15:48:32 +02:00
Ms2ger
d095c42eaf Move the loading of documents in iframes into HTMLIFrameElement.
Right now, the load is kicked off inside the parser glue. This is unfortunate
for several reasons:

1) we'd like to replace the current parser (libhubbub) by our own parser,
   written in Rust, so code intertwined with the parser will have to be
   rewritten;
2) it is impossible to support dynamically (i.e. from script) created iframes
   in this way;
3) the code flow around loading subdocuments is complicated needlessly.

This commit adds the constellation channel (on which the message to actually
load the document is sent) as a field on the Page, to allow HTMLIFrameElement
to access it.

In rewriting the code, support for dynamically created iframes is added, and
a task failure is avoided when the value of the src attribute can not be
parsed.
2014-05-12 21:21:03 +02:00
bors-servo
9a71af38b9 auto merge of #2393 : Ms2ger/servo/initialize_js_info, r=jdm
There is no particular leason to initilaize js_info lazily.
2014-05-10 12:25:09 -04:00
Ms2ger
4b1b19fd11 Remove ScriptTask::initialize_js_info.
There is no particular leason to initilaize js_info lazily.
2014-05-10 09:37:24 +02:00
bors-servo
5334d8bb25 auto merge of #2384 : saneyuki/servo/2383, r=Ms2ger
Fix #2383

These changes introduce `FooEvent::new_uninitialized()` constructor. This constructor use to create `FooEvent` without calling `FooEvent::InitFooEvent`.

#2383 says integrating `FooEvent::new()` and `InitFooEvent`, but we need to preserve simple `FooEvent::new_uninitialized()` for `document.createEvent()`.

@jdm r?
2014-05-10 03:01:13 -04:00
Tetsuharu OHZEKI
ac288f6657 Add UIEvent::new_uninitialized(). 2014-05-10 13:55:19 +09:00
Guro Bokum
04c807dd53 Convert as many of Page's RefCell fields to Cell as possible (fixes #1990). 2014-05-09 23:52:06 +02:00
bors-servo
1477652295 auto merge of #2357 : Manishearth/servo/xhr-syncget, r=ms2ger
This gets a basic synchronous GET request working. I've also tried to implement a portion of the procedures mentioned in the spec.


Blocks #2282
2014-05-09 11:34:07 -04:00
Manish Goregaokar
b40d8b4d53 Basic synchronous GET with XHR 2014-05-09 20:39:54 +05:30
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
bors-servo
e9ac0d1e2c auto merge of #2339 : glennw/servo/js-event-assert, r=jdm 2014-05-07 03:04:21 -04:00