Commit graph

156 commits

Author SHA1 Message Date
Ms2ger
c9cd9cc007 servo: Merge #2820 - Move the call to RegisterBindings::Register into WindowBinding::Wrap; r=jdm (from Ms2ger:RegisterBindings)
Source-Repo: https://github.com/servo/servo
Source-Revision: a7447a4302a5daef992431058073e3917928ee5d
2014-07-13 17:21:23 +02:00
Ms2ger
39fb2af19b servo: Merge #2810 - Store proxy handlers in a static array rather than a hashtable per window (from Ms2ger:proxy-handlers)
Source-Repo: https://github.com/servo/servo
Source-Revision: cb10614355c5dcbd097b6063fbd217d3d1302e87
2014-07-13 09:17:12 -04:00
Tetsuharu OHZEKI
96fccfa6c2 servo: Merge #2697 - Remove "DerefMut" implementation from Root/JSRef; r=jdm (from saneyuki:js)
Source-Repo: https://github.com/servo/servo
Source-Revision: 927ae398170a9ab0e7692901a84100f6e580bb36
2014-06-22 15:10:17 +02:00
Matt Brubeck
b019b34994 servo: Merge #2666 - Separate "desktop" and "mobile" zoom calculations (from mbrubeck:pinch)
Source-Repo: https://github.com/servo/servo
Source-Revision: 6c150724f46b2626fd2395899d0a9468e1427b28
2014-06-21 08:06:26 -05:00
Edit Balint
a07db23157 servo: Merge #2649 - Replace uses of JS<T>.unrooted() with JS::from_rooted #2580 (from ebalint:2580_JS_T_unrooted_replace); r=jdm
removed .clone() calls
modified from_rooted method parameter: T to &T

Source-Repo: https://github.com/servo/servo
Source-Revision: 7ed504189198ac2f59c396d5872046ac7c9578b3
2014-06-13 14:33:03 -04:00
Edit Balint
04e66ace81 servo: Merge #2585 - Split Page code out of script_task.rs #2530 (from ebalint:2530); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: c0576108c5fb82410faa23dc1cccff2dce56d698
2014-06-13 14:04:45 -04:00
Ms2ger
adc977b214 servo: Merge #2640 - Use more internal mutability for DOM objects (from Ms2ger:derefmut); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 897e39dcf35ff27bc41ccb7990c5d82bb2adf15c
2014-06-11 17:19:51 -04:00
Ms2ger
6eb5883693 servo: Merge #2633 - Use more internal mutability for DOM objects (from Ms2ger:derefmut); r=jdm
Part of #1854.

Source-Repo: https://github.com/servo/servo
Source-Revision: cc23f3c4360a37e4dc763d4eade779a411a6d97a
2014-06-11 13:59:01 -04:00
Ms2ger
1754b1ee90 servo: Merge #2636 - Pass a JSRef to RegisterBindings::Register (from Ms2ger:registerbindings); r=larsbergstrom
JS<T> should only be used for members of traced structures; the correct type
for arguments is JSRef.

Source-Repo: https://github.com/servo/servo
Source-Revision: d255a83a48388c0720cc7e495aac15f9ebcf2a7b
2014-06-11 13:09:05 -04:00
Matt Brubeck
2390dd1e44 servo: Merge #2624 - Convert window size to px before passing to script or layout (from mbrubeck:units); r=pcwalton
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: f359bc93376a42a6dfefd0e2759d660d751a35aa
2014-06-09 18:52:41 -04:00
Jack Moffitt
0efdf108b8 servo: Merge #2538 - Upgrade Rust (from servo:rustup-20140528); r=SimonSapin
Not yet ready for merge, but you can start reviewing.

Still need to fix linux and some make check code.

Source-Repo: https://github.com/servo/servo
Source-Revision: b2e7e67087370e30a310bb3673b074c97c19d548

--HG--
rename : servo/src/components/style/common_types.rs => servo/src/components/style/properties/common_types.rs
rename : servo/src/components/style/properties.rs.mako => servo/src/components/style/properties/mod.rs.mako
rename : servo/src/components/util/debug.rs => servo/src/components/util/debug_utils.rs
2014-06-05 13:58:44 -04:00
Tetsuharu OHZEKI
ec4745d550 servo: Merge #2535 - Remove needless '&mut self' from node.rs (from saneyuki:mut); r=jdm
Related #2514

Source-Repo: https://github.com/servo/servo
Source-Revision: 59cef940e899a900b4601dbbc9b4d4bd96a96687
2014-06-01 16:19:20 -04:00
Ms2ger
ec199a1227 servo: Merge #2528 - Implement Event::new_initialized and initialize the event in Event::new (from Ms2ger:event-new); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: facc15f5fdd1db654090146e0901f7f12c7c0fcd
2014-05-31 10:01:08 -04:00
Tetsuharu OHZEKI
5788f29d55 servo: Merge #2490 - Make 'JS<T>' smart pointers a POD type (from saneyuki:js); r=jdm
This only change to make `JS<T> ` to a POD type about #1854, except using `Cell`/`RefCell` for interior mutability.

Fix #1854

@jdm r?

Source-Repo: https://github.com/servo/servo
Source-Revision: e511c04935b1009d09ee7c11ad293fa404687909
2014-05-29 16:21:57 -04:00
Manish Goregaokar
a50015b7e1 servo: Merge #2506 - Fix unused_result warning in script_task (from Manishearth:clickevent-warning); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 02e92d0457b228596f2f94c2e749a2757f62cf41
2014-05-29 12:52:01 -04:00
Matt Brubeck
066e8db6b1 servo: Merge #2499 - Remove unnecessary pubs from script_task (from mbrubeck:unpub); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 23a63ef4ae5bea0418aebd5aa55f98100291582d
2014-05-28 18:31:07 -04:00
Ms2ger
4f41f0d3e5 servo: Merge #2487 - Use *mut T for the T* pointers in SpiderMonkey (from Ms2ger:sm-mut); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: f057719bf88eb72daba799d59edce718221610ba
2014-05-26 14:25:35 -04:00
Tetsuharu OHZEKI
3ea694b552 servo: Merge #2441 - Cherry-pick the HandleEvent changes from the original vtable PR (from saneyuki:event); r=jdm
- Fix #2118
- Take over from #2293

Source-Repo: https://github.com/servo/servo
Source-Revision: e59557e3bbea1f8ba809f42cec15a72b27ad1655
2014-05-23 17:01:50 -04:00
Ms2ger
9cfa16cd52 servo: Merge #2433 - Rust upgrade (from mozilla:rustup_20140511)
Source-Repo: https://github.com/servo/servo
Source-Revision: c753f3ee05a25b2bb756c3b0c3131eac7ad58f1a
2014-05-22 18:14:24 -06:00
Manish Goregaokar
2390c2c203 servo: Merge #2442 - Async XHR GET with basic response header support (from Manishearth:xhr-async); r=jdm
(Note that only `getAllResponseHeaders()` is supported at the moment, I'll be adding the other header methods later.)

Source-Repo: https://github.com/servo/servo
Source-Revision: 28e3c1734048217cd2194ea37c887911ad03e894
2014-05-20 12:16:35 -04:00
Ms2ger
fa162ae0e7 servo: Merge #2434 - Implement iframe.contentWindow (from Ms2ger:contentWindow); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: ca9396ff9c7ebeea48d881b421854168b9afb825
2014-05-20 11:43:46 -04:00
Tetsuharu OHZEKI
c04abf198b servo: Merge #2425 - Move Window helper methods to a WindowHelpers trait (from saneyuki:window_helper); r=jdm
Fix #2418

Source-Repo: https://github.com/servo/servo
Source-Revision: 049fa56fff3493ccba4e4fe6dab49c141b35d766
2014-05-14 00:55:17 -04:00
Ms2ger
1f70f5aa30 servo: Merge #2420 - Merge Page and PageTree (from Ms2ger:merge-Page-PageTree); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 6871e4ccb653c3b5a351e4d64ebf09de9af2acc0
2014-05-13 23:52:21 -04:00
Ms2ger
349e98a113 servo: Merge #2417 - Use a match rather than a for loop for last_loaded_url in ScriptTask::lo (from Ms2ger:scripttask-load-option-iter); r=pcwalton
...ad.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6640f2edd88622ceb392272716ed9db2133cabb6
2014-05-13 17:43:47 -04:00
Ms2ger
e839758a57 servo: Merge #2403 - Move the loading of documents in iframes into HTMLIFrameElement (from Ms2ger:iframe-loading); r=jdm
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 1e361e8b6f04d7848d40fd19090511c0c3f16a97
2014-05-12 15:25:14 -04:00
Ms2ger
eed32bc919 servo: Merge #2393 - Remove ScriptTask::initialize_js_info (from Ms2ger:initialize_js_info); r=jdm
There is no particular leason to initilaize js_info lazily.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9a71af38b98560376d3db2c210f91c1cf0770acd
2014-05-10 12:25:09 -04:00
Tetsuharu OHZEKI
f1429c0329 servo: Merge #2384 - Add UIEvent::new_uninitialized() and MouseEvent::new_uninitialized() (from saneyuki: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?

Source-Repo: https://github.com/servo/servo
Source-Revision: 5334d8bb255c64f6d33250972a7ccf22de2afe34
2014-05-10 03:01:13 -04:00
Guro Bokum
c8c8024c22 servo: Merge #2390 - Convert as many of Page's RefCell fields to Cell as possible (fixes #1990) (from Ms2ger:1990-Page-RefCell); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: d985b6d7c233ba55175f66545bb79efbca741676
2014-05-09 18:01:16 -04:00
Manish Goregaokar
a5ae316ba0 servo: Merge #2357 - Basic synchronous GET with XHR (from Manishearth: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

Source-Repo: https://github.com/servo/servo
Source-Revision: 14776522952df9990685e20151e74f4fed8742c9
2014-05-09 11:34:07 -04:00
Ms2ger
5e2e3c3c06 servo: Merge #2381 - Move debug functions to Window IDL (from Ms2ger:mozjs-spring-cleanup); r=jdm
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 78917f4e0f15c7e0dad3c9a1fc07c005bd090487
2014-05-09 10:28:10 -04:00
Glenn Watson
4cc79f8a27 servo: Merge #2339 - Modify node traversal loop to avoid JS roots assertion. Fixes #2321 (from glennw:js-event-assert); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e9ac0d1e2cab62cbef2b23bd7ba93374b52f4c02
2014-05-07 03:04:21 -04:00
Glenn Watson
b85da72874 servo: Merge #2340 - Fix JS roots assertion when clicking on an element (from glennw:js-click-assert); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: dc49e7d1a021f0b1513492a9f01febae66796712
2014-05-07 00:46:21 -04:00
Josh Matthews
eba6928518 servo: Merge #2344 - Force a GC when shutting down each layout task. Fixes #2342 (from jdm:iframefail); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 03e0f911ec5ba005881cd4b1cc121b66648e51d6
2014-05-06 12:58:18 -04:00
Ms2ger
37492638e4 servo: Merge #2331 - Use a single JSContext per JSRuntime (from Ms2ger:global-cx-3); r=jdm
The long-term plan for SpiderMonkey is to eliminate JSContexts by merging
(most of) it into JSRuntime, so to future-proof our code, we should avoid
creating multiple JSContexts for the same JSRuntime.

However, this implies we'll have to use the same JSContext for objects in
different compartments, so we need to enter compartments. This is done by
using the with_compartment function.

Source-Repo: https://github.com/servo/servo
Source-Revision: d66197ae406e252c51bda48611ddfce78ecedb02
2014-05-06 09:58:33 -04:00
Ms2ger
6b4df23ee7 servo: Merge #2312 - Remove most ~"string"s (from Ms2ger:owned-strings); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: b1d0dac50d30506f85c7711437eb4957ee59cc0b
2014-05-04 06:22:21 -04:00
Josh Matthews
0c3a130356 servo: Merge #2101 - Implement a safe, mostly-sound rooting rooting strategy (from jdm:newroot_rebase); r=Ms2ger
As described in #1764, this strategy uses the following properties:
* DOM members are `JS<T>` types. These cannot be used with being explicitly rooted, but they are required for compiler-derived trace hooks.
* Methods that take DOM type arguments receive `&[mut] JSRef<T>`. These are rooted value references that are cloneable but cannot escape.
* Methods that return DOM values use `Unrooted<T>`. These are values that may or may not be rooted elsewhere, but callers must root them in order to interact with them in any way. One unsoundness hole exists - `Unrooted` values must be rooted ASAP, or there exists the danger that JSAPI calls could be made that could cause the underlying JS value to be GCed.
* All methods are implemented on `JSRef<T>`, enforcing the requirement that all DOM values are rooted for the duration of a method call (with a few exceptions for layout-related code, which cannot root values and therefore interacts with `JS<T>` and `&T` values - this is safe under the assumption that layout code interacts with DOM nodes that are in the tree, therefore rooted, and does not run concurrently with content code)

Source-Repo: https://github.com/servo/servo
Source-Revision: 731e66ff132e41cdc49bc5324c0e15be19c46ec2
2014-05-03 14:25:22 -04:00
Ms2ger
9a38a7b37e servo: Merge #2297 - Stop passing owned strings to fail!() (from Ms2ger:fail-owned-str); r=jdm
The ~"string" expression is being removed in upstream rust.

Source-Repo: https://github.com/servo/servo
Source-Revision: 09374f07e2cd152b2126c49c623f00997c36cfb2
2014-05-03 11:25:22 -04:00
Ms2ger
4c28ea9b9e servo: Merge #2236 - Replace ~[T] by Vec<T> (from Ms2ger:Vec); r=jdm
I'd rather do this before it turns out that a rust upgrade removed `~[T]` behind our back.

Source-Repo: https://github.com/servo/servo
Source-Revision: 77d9f7294799459b126e61b2dc0b0b27b74a6ba7
2014-04-28 17:10:41 -04:00
Lars Bergstrom
0c4d69cdc5 servo: Merge #2238 - Rust upgrade to April 10th, 2014 (from servo:rustup_20140410c); r=Ms2ger
r? @metajack

Note that all pending submodule PRs must be landed before this should be given r+.

Source-Repo: https://github.com/servo/servo
Source-Revision: 493aa2cdf30fb2ff5886c714030a20d714764b67
2014-04-27 18:52:39 -04:00
Tetsuharu OHZEKI
254e72bd4c servo: Merge #2210 - Add APIs to abstract Page::query_layout() (from saneyuki:query); r=jdm
- see #356
- To decrease the conversion code, `JS<Node>` -> `Node`, I added API methods to `NodeHelpers`.
- I added APIs to `Page` not `Document` because I had thought that their APIs returns the hitted nodes address in the "page".

Source-Repo: https://github.com/servo/servo
Source-Revision: 6d89e67194acef35c40d03e5889dfa3c6af1502a
2014-04-24 09:52:11 -04:00
Josh Matthews
eb2497dec7 servo: Merge #2200 - Make the I Tried star appear when a top-level page load fails for networ (from jdm:loadfail); r=mbrubeck
...k-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.

Source-Repo: https://github.com/servo/servo
Source-Revision: cc33a721ab3cf777becf51cddbfd8fe2c1eba568
2014-04-24 01:10:12 -04:00
Matt Brubeck
244491cd63 servo: Merge #2203 - Crash when navigating back with "RefCell is already borrowed" (from mbrubeck:back-crash); r=jdm
This fixes two `RefCell<T> is already borrowed` failures when reloading an
existing pipeline, both caused by functions trying to modify `Pipeline::url`
or `ScriptTask::url` while a reference to a previous borrow is still in scope.

Note: After applying this patch, there are some painting issues after navigating back.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7326df044c8f1badf8c37a16cdf31caf446b66df
2014-04-23 14:10:21 -04:00
lpy
8e35afc846 servo: Merge #2209 - Implement Element.localName.(fixes #2188) (from lpy:issue2188); r=Ms2ger
see #2188

Source-Repo: https://github.com/servo/servo
Source-Revision: 3fc2c119103ce743bda53d1ef25c360bc6c713a7
2014-04-23 03:19:23 -04:00
Josh Matthews
adad662c76 servo: Merge #2111 - Add WindowProxy support and basic browsing context concept (from jdm:browsercontext); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: bdcd8dd0c2fb9d94d3be60ebf525112417d17e51
2014-04-22 11:01:18 -04:00
Josh Matthews
da88337c6d servo: Merge #2202 - Ensure JS-owned memory is not leaked if a script task fails. Fixes #2201 (from jdm:scriptleak); r=Ms2ger
....

Source-Repo: https://github.com/servo/servo
Source-Revision: c6bdc7b7f2d39b522be5767f09f88b1b4ca5577a
2014-04-21 17:13:22 -04:00
Ms2ger
245ddf1be5 servo: Merge #2198 - Remove JSPageInfo::js_compartment (from Ms2ger:js_compartment); r=jdm
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 77b5c1f4f63c59ee88ad26363420fef6e2468ce1
2014-04-21 09:40:27 -04:00
Josh Matthews
c0df29bf3a servo: Merge #2147 - Add transparent Traceable and Untraceable types to aid proper rooting pr (from jdm:untraceable); r=Ms2ger
...actices, and replace ad-hoc Untraceable structs with empty Encodable implementations.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b1c8bf8d6a628c9483e94f048d1ff95e65d5da8
2014-04-17 18:04:10 -04:00
lpy
e0d65bced0 servo: Merge #2129 - Implement Window.set/clearInterval.(fixes #2116) (from lpy:issue2116); r=jdm
see #2116
I add an `is_interval` field, so that when the `TimerData` is passed by `SetInterval`, we will not delete it from `active_timers`.
Also I think maybe we can extract the code in `ClearTimeout` and `ClearInterval` into another method to avoid duplicate.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7441dae1aff4966e40ef3cf4129f307d23e2eeba
2014-04-17 13:34:09 -04:00
Josh Matthews
e6188ce3b2 servo: Merge #2076 - Make find_fragment_node a method of Page (from Ms2ger:find_fragment_node); r=Ms2ger
This was part of @jdm's vtable branch, but I think it makes sense regardless of how we deal with that branch.

Source-Repo: https://github.com/servo/servo
Source-Revision: 69fbbbdf339c370b2eeb87983b550b9055ee6f83
2014-04-09 09:28:19 -04:00
Ms2ger
e2ea16582e servo: Merge #2057 - Handle an exception from cx.evaluate_script more gracefully (from Ms2ger:evaluate_script); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 3d1a4324b771db0a7babc5800c20f4bf520412ba
2014-04-07 11:19:26 -04:00