Commit graph

125 commits

Author SHA1 Message Date
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
Ms2ger
5c93d47292 servo: Merge #2055 - Remove trailing whitespace (from Ms2ger:trws); r=jdm
Done with `git ls-tree --name-only -r HEAD . | grep "\.rs" | xargs sed -i 's/\s\+$//g'`

Source-Repo: https://github.com/servo/servo
Source-Revision: bf405ac81ff965c0370743185b9685b7a1de8c17
2014-04-07 10:52:26 -04:00
Josh Matthews
a3b4dbff7f servo: Merge #2041 - Upgrade rust (from servo:rustup_20140321b); r=larsbergstrom
Source-Repo: https://github.com/servo/servo
Source-Revision: 83aabe327d3b713581a4183b7f23cea0c39a94c9
2014-04-04 18:52:50 -04:00
Simon Sapin
0297c25705 servo: Merge #1988 - Acid2 2 (from pcwalton:acid2-2); r=SimonSapin
r? @metajack @SimonSapin @larsbergstrom @june0cho @hyunjunekim

Source-Repo: https://github.com/servo/servo
Source-Revision: 3ec22157ca20227cd2d648744b6c711ed0ae8366
2014-04-03 21:01:48 -04:00
lpy
7c07adb1d9 servo: Merge #2022 - Get rid of match statements in Layout queries.(fixes #2019) (from lpy:issue2019); r=jdm
see #2019

Source-Repo: https://github.com/servo/servo
Source-Revision: e3bf08ea537366a1624a082999c3548fa07d4650
2014-04-01 15:31:50 -04:00
Martin Robinson
33cb8edba0 servo: Merge #2002 - Store Window.active_timers in a HashMap (from mrobinson:issue-1477); r=jdm
A HashMap allows easily looking up a timer and canceling it in
Window.ClearTimeout.

Fixes #1477.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3eac31394cb509ce7e4fa61a3543f6ec22c8bde4
2014-03-31 19:07:50 -04:00
Ms2ger
b0c7fbe938 servo: Merge #1913 - Move attributes-related functions onto JS<Element> (from Ms2ger:attributes); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 509ff7e52f6ea4f2f736d13f124c854d80c316c9
2014-03-20 14:46:34 -04:00
Tetsuharu OHZEKI
cb6991627c servo: Merge #1864 - Split TCast::to into TCast::to_unchecked and TCast::to (from saneyuki:split_cast_to); r=jdm
fix #1836

Source-Repo: https://github.com/servo/servo
Source-Revision: 831712206865e2c0516009b16e2ac60f754dd1a8
2014-03-20 10:58:36 -04:00
Lars Bergstrom
382dd8c9ba servo: Merge #1934 - Rust upgrade (from larsbergstrom:rust_20140224_squashed); r=jdm
For review only - don't approve yet (need to squash and land submodule updates first).

critic? @metajack

Source-Repo: https://github.com/servo/servo
Source-Revision: f7aa6e3d9b8bfcc0565624f1094241b3b8658bd8
2014-03-19 12:35:17 -04:00
Ms2ger
0728d02843 servo: Merge #1868 - Use the improved JSVal interfaces (from Ms2ger:JSVal); r=jdm
Requires https://github.com/mozilla-servo/rust-mozjs/pull/54.

Source-Repo: https://github.com/servo/servo
Source-Revision: 654f3db29511d3b7b7a49a875b86a8538d111bcf
2014-03-10 10:22:51 -04:00
Ms2ger
8a6b3d8aae servo: Merge #1829 - Remove page_from_context (from Ms2ger:page_from_context); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: b9b4eebab5664d026435d70bf3f2ac40c5b56826
2014-03-05 15:13:29 -05:00
Ms2ger
098edf1c89 servo: Merge #1811 - Cleanup the *Binding::Wrap functions (from Ms2ger:Wrap_); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: da6a571f9e147d884bf0fe0017204321f5d75f5d
2014-03-05 09:31:44 -05:00
lpy
c678726e97 servo: Merge #1802 - Remove next_subpage_id argument from parse_html.(fixes #1801) (from lpy:issue1801); r=kmcallister
see #1801

Source-Repo: https://github.com/servo/servo
Source-Revision: 4a6077ca4cb6e2d54e2f558c18f45849c9d3c47d
2014-03-03 19:58:28 -05:00
Keegan McAllister
030c0fa802 servo: Merge #1800 - Fix a dynamic borrow failure with iframes (from kmcallister:subpage-id); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: a30041e9608b041dcf2a46f6b9f5e183817a55ae
2014-03-03 18:16:27 -05:00
Josh Matthews
1101a9f707 servo: Merge #1755 - De-@mut the script crate (from jdm:demut); r=jdm,metajack
Requires https://github.com/mozilla-servo/rust-mozjs/pull/49.

Source-Repo: https://github.com/servo/servo
Source-Revision: ea29e3a001fb70b5e94af7a676345b4046771315
2014-02-28 13:46:38 -05:00
Tetsuharu OHZEKI
a010046858 servo: Merge #1783 - Implement "resize" DOM Event (from saneyuki:resize); r=jdm
#1715

Source-Repo: https://github.com/servo/servo
Source-Revision: def5483579fad1e7f77ca96bd10fc5eb85e37740
2014-02-28 11:07:43 -05:00
lpy
042d6c49af servo: Merge #1776 - Add url getter to Page.(fixes #1762) (from lpy:issue1762); r=jdm
see #1762

Source-Repo: https://github.com/servo/servo
Source-Revision: 82b74a373a404c334ae711ec78dd4d06690f2cbb
2014-02-28 02:04:49 -05:00
Ms2ger
ea8e887ed8 servo: Merge #1751 - Handle removing the src attribute from an img element (from Ms2ger:image-loading); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e006c111f583bb327f9b83cedcbf7a7fbcc3123c
2014-02-25 13:49:34 -05:00
Ms2ger
63a5574635 servo: Merge #1739 - Merge HTMLDocument into Document (from Ms2ger:document-cleanup); r=jdm
The specs currently have only Document; this may well change, but the split won't be along the lines we've implemented right now. In the meantime, this simplifies our code quite a bit.

Source-Repo: https://github.com/servo/servo
Source-Revision: 22760b6665c75f6908bcfd7cad4de111187ac6f7
2014-02-24 17:13:46 -05:00
Josh Matthews
6ce95abf91 servo: Merge #1591 - Convert all DOM types from @mut to JSManaged (from jdm:jsmanaged); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: ffcf3b2905b7f9e886904015b1583e93f78f1199
2014-02-24 15:19:51 -05:00
Ms2ger
3f6bd354a8 servo: Merge #1703 - Various cleanup related to strings (from Ms2ger:strings-cleanup); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 41f55059a80156408368e375c2118066798958b9
2014-02-16 06:02:05 -05:00
Keegan McAllister
3a87a6327c servo: Merge #1691 - Restore failure handling (from kmcallister:linked-failure); r=pcwalton
We probably leak some threads and resources, e.g. when the script task crashes and doesn't get a chance to send layout data back to layout to be deallocated.

Not tested with iframes yet.

Source-Repo: https://github.com/servo/servo
Source-Revision: f1de0b738134f153a398866f76d1b5d0213d3c02
2014-02-13 18:08:07 -05:00
HyunJune Kim
4f88a0031b servo: Merge #1633 - Pseudo class hover (from parkjaeman:pseudo-class-hover); r=larsbergstrom
Fix #790 partially.
I am sure I need to merge with @jdm's event handler for dom.
As son as the event handler is implemented, I will fix.
And this is implement Hover Event. If over element, Currently Full reflow.
After PR, will make partial reflow.
Thank you!

Source-Repo: https://github.com/servo/servo
Source-Revision: ccfd595d6ebd0dcd7a81d1ef9fa05801cd955f8a
2014-02-09 21:35:09 -05:00
Tetsuharu OHZEKI
93bf096dc6 servo: Merge #1642 - Reduce copying on parse_url() call sites (from saneyuki:1535); r=SimonSapin
this will fix #1535

r?

Source-Repo: https://github.com/servo/servo
Source-Revision: aae5be557af75263b764f010857561059a57d38f
2014-02-08 15:10:43 -05:00
Simon Sapin
c43dc93fa3 servo: Merge #1608 - Rename make_url/current_url to parse_url/base_url (from SimonSapin:url); r=metajack
Align with spec terminology.

Source-Repo: https://github.com/servo/servo
Source-Revision: fe1bb6a325a750566afaa26158b8ad5ab6cec59a
2014-02-07 14:31:35 -05:00
Lars Bergstrom
77a80051d5 servo: Merge #1597 - Ensure ref tests wait to write their PNG until the page has fully loaded and reflowed (from larsbergstrom:add_page_loaded); r=pcwalton
Add a LoadComplete message so that script informs the constellation, which can then inform the compositor (and anyone else, later) about the completion of loading a page. This is important for ref tests, which should not emit a PNG until load has completed, even if we perform a composite before then.

Note that we must *also* wait for the `ready_state` to indicate that additionally layout has completed any associated reflow with the page, otherwise we could get the `LoadComplete` while the final reflow is still in progress and thus would write out the `n-1`'th reflow result.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: e9a0c8184f1af460583fe5ab2615e01d08ffc22f
2014-01-30 12:49:28 -08:00
Bruno de Oliveira Abinader
452407e34c servo: Merge #1583 - Implement document.URL & document.documentURI (from brunoabinader:document-url); r=Ms2ger
Specs:
http://dom.spec.whatwg.org/#dom-document-url
http://dom.spec.whatwg.org/#dom-document-documenturi

This is a sub-task for #1428.

Source-Repo: https://github.com/servo/servo
Source-Revision: 572959c3e6d233f470f7851b470bf3f73f8d4191
2014-01-30 08:58:40 -08:00
Simon Sapin
21cb888158 servo: Merge #1561 - Refactor namespaces (from SimonSapin:refactor-namespace); r=pcwalton
This builds on top of #1560 (… which I realize now may confuse Critic)

This refactors Namespace to reduce the overall amount of copying and conversion. In particular, it makes parsed selectors contain Namespace enums rather than strings.

Source-Repo: https://github.com/servo/servo
Source-Revision: edda06115ac61c691e7762bcdb3e70b48b1c65bc
2014-01-25 13:19:02 -08:00
Jack Moffitt
ca21b7bc1d servo: Merge #1533 - Change get_attr() to get_attr_val_for_layout() (from metajack:unsafe-get-attr); r=jdm
The old code was used by both layout and script, but was erroneously
borrowing for the layout case (which causes parallelism
problems). script now uses only `value_ref()` or `get_attribute()`, and
layout now has its own unsafe version that dances around the borrows of
`@mut Attr`.

Source-Repo: https://github.com/servo/servo
Source-Revision: d11e4318871e8ed237292985f30063f719bbfb0d
2014-01-22 16:28:20 -08:00
Lars Bergstrom
7611e8ef3f servo: Merge #1500 - Fix crashes and deadlocks when running the content tests (from larsbergstrom:content_fixup); r=metajack
r? @metajack

Source-Repo: https://github.com/servo/servo
Source-Revision: 9b7425000b6b5df1e409699f8faead47eb9e41a8
2014-01-15 19:40:00 -08:00
Patrick Walton
0f1886c8bb servo: Merge #1490 - script: Stop trusting pointers to DOM nodes that layout provides (from pcwalton:distrust-layout-new); r=jdm
Pointers to DOM nodes from layout could go stale if incremental reflow
does not correctly destroy dead nodes. Therefore, we ask the JavaScript
garbage collector to verify that each DOM node is indeed a valid pointer
before calling event handlers on it, and fail otherwise.

Depends on the `get-addressable-gc-thing` branches of `mozjs` and `rust-mozjs`.

r? @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: c876335d227d4f826b5ece66fb388134cf29fce4
2014-01-14 22:06:56 -08:00
zmike
d37a94aca8 servo: Merge #1457 - add names for all servo spawned tasks (from zmike:master); r=jdm
this should resolve #1169

Source-Repo: https://github.com/servo/servo
Source-Revision: 563d6ef91a43a4ebefb87281db7e4813d2afcee6
2014-01-13 12:11:35 -08:00