Commit graph

90 commits

Author SHA1 Message Date
Matt Brubeck
8c4fed42b0 Minor refactoring of mouse event types
* Move some types into the `msg` crate so they can be shared more.
* Use MouseEventType instead of duplicating it in other enums.
2015-12-03 08:19:40 -08:00
Josh Matthews
c23cbd4163 Dispatch load events for cross origin iframes. Resolves #6672. 2015-11-30 17:37:16 -05:00
Brandon Fairchild
341e66f66d Remove #[allow(raw_pointer_derive)] attributes
The attributes are unused.

Fixes #8699.
2015-11-27 14:32:57 -05:00
Patrick Walton
1c130819ca compositing: Split Servo up into multiple sandboxed processes.
Multiprocess mode is enabled with the `-M` switch, and sandboxing is
enabled with the `-S` switch.
2015-11-19 16:38:04 -05:00
Keith Yeung
19294db6e5 Split ConstellationMsg into ScriptMsg and CompositorMsg 2015-11-16 23:10:53 -08:00
Patrick Walton
1dc0d61c3c script: Make timer events e10s-safe.
Closes #8235.
2015-11-12 14:30:25 -05:00
bors-servo
7ff3a17524 Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm
Move Stylesheet loading and ownership from the layout task into HTML elements

Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.

Depends on #7979 because without that loading stylesheets asynchronously breaks lots of content.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8039)
<!-- Reviewable:end -->
2015-11-08 01:11:54 +05:30
Till Schneidereit
543703e3d8 Move Stylesheet loading and ownership from the layout task into HTML elements
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.
2015-11-07 18:11:29 +01:00
bors-servo
9a465c5842 Auto merge of #8355 - Ms2ger:Exit, r=nox
Cleanup exit messages and related code.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8355)
<!-- Reviewable:end -->
2015-11-07 22:34:45 +05:30
Ms2ger
7d3f7220f7 Remove the unused PipelineExitType field from LayoutControlMsg::ExitNow. 2015-11-05 16:32:47 +01:00
Ms2ger
85a762a31a Remove the unused PipelineExitType field from ConstellationControlMsg::ExitPipeline. 2015-11-05 16:32:44 +01:00
Josh Matthews
9529196d2f Send mouse move events to the the previous layer when directing events to a new one for the first time. Resolves #7865. 2015-11-04 03:40:13 -05:00
Matt Brubeck
ef93650db9 Handle multi-touch events from glutin 2015-11-03 08:56:34 -08:00
bors-servo
4d737b51bb Auto merge of #8155 - Ms2ger:join, r=jdm
Remove Window::layout_join_port.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8155)
<!-- Reviewable:end -->
2015-10-23 04:50:38 -06:00
Matt Brubeck
fe7460f34d Dispatch touch events and perform default touch actions.
This is currently limited to simple single-touch actions. It does not include
momentum scrolling or pinch zooming.
2015-10-22 10:37:03 -07:00
Ms2ger
9ad69586d1 Remove the ConstellationControlMsg::ReflowComplete message. 2015-10-22 16:12:58 +02:00
benshu
553a0dbefd Timers are scheduled by a dedicated per-constellation thread. 2015-10-21 16:40:49 +02:00
Glenn Watson
5645dba1fa Make it possible for iframes to create their own pipeline ID.
This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.
2015-10-06 17:06:53 +10:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Patrick Walton
9bb6acd690 layout: Load Web fonts asynchronously.
Improves page load times significantly.

Closes #7343.
2015-09-27 15:38:20 -07:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Anthony Ramine
a7738a5eef Introduce InitialScriptState 2015-09-16 18:38:24 +02:00
Connor Imes
d746835344 Combine script profiling with profile crates. Fixes #7514. 2015-09-04 16:09:44 -05:00
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
vectorijk
14ac1ef75a remove ScriptListener
ref #7175
2015-08-16 01:34:55 -07:00
Ms2ger
2cdc043fcf Remove ScriptControlChan. 2015-08-12 16:24:09 +02:00
Ms2ger
c05f0906d5 Store a Sender<ConstellationControlMsg> in ScriptTask. 2015-08-12 15:25:31 +02:00
Patrick Walton
164e10202c devtools: Convert the developer tools to run over IPC. 2015-07-27 09:10:01 -07:00
Glenn Watson
2e074ce452 Implement mouseevent.which (needed for enyojs sampler). 2015-07-22 08:20:06 +10:00
Nicholas Nethercote
7429b90e02 Wire up the JS engine's memory reporting.
SpiderMonkey provides an extremely fine-grained breakdown of memory
usage, but for Servo we aggregate the measurements into a small number
of coarse buckets, which seems appropriate for the current level of
detail provided by Servo's memory profiler. Sample output:
```
|   10.99 MiB -- pages
|       7.75 MiB -- url(http://html5demos.com/worker)
|          4.63 MiB -- js
|             2.00 MiB -- gc-heap
|                0.94 MiB -- decommitted
|                0.92 MiB -- used
|                0.09 MiB -- unused
|                0.05 MiB -- admin
|             1.44 MiB -- malloc-heap
|             1.19 MiB -- non-heap
|          [...]
|       3.24 MiB -- url(http://html5demos.com/js/worker-cruncher.js)
|          3.24 MiB -- js
|             1.17 MiB -- malloc-heap
|             1.06 MiB -- non-heap
|             1.00 MiB -- gc-heap
|                0.69 MiB -- used
|                0.19 MiB -- decommitted
|                0.09 MiB -- unused
|                0.03 MiB -- admin
```
Most of the changes are plumbing to get the script and worker tasks
communicating with the memory profiler task.
2015-07-15 21:58:20 -07:00
Patrick Walton
e5b1ec4078 script: Split Pipeline::create into chrome process and content
process parts.

This will make it easier to adapt to IPC.

The trickiest part here was to make script tasks spawn new layout tasks
directly instead of having the pipeline do it for them. The latter
approach will not work in multiprocess mode, because layout and script
must run in the same address space and the pipeline cannot inject tasks
into another process.
2015-07-14 15:09:16 -07:00
Patrick Walton
e841065351 compositing: Move messages that go over the ScriptListener to go over
an IPC channel instead.

Because this used a boxed trait object to invoke messages across a
process boundary, and boxed trait objects are not supported across IPC,
we spawn a helper thread inside the compositor to perform the marshaling
for us.
2015-07-14 12:12:19 -07:00
Ms2ger
417305d719 Really require documentation in the script_traits crate.
My previous attempt (1303dd6e2e) was foiled by
a typo that made the requirement only apply to the next item.
2015-07-08 11:21:09 +02:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
James Graham
49f1b13ad9 Add support for switching frames with the webdriver API.
This moves webdriver_traits into msg to avoid a circular dependency.
2015-06-01 23:18:55 +01:00
James Graham
28ac0abf6a Make WebDriver Get() command wait on pages loading before returning.
This makes using WebDriver significantly less racy. Also
refactors the message structure a little
2015-05-14 10:59:10 +01:00
Glenn Watson
eec3fad93d Fixes a number of race conditions and reliability issues with reftests and compositor.
The basic idea is it's safe to output an image for reftest by testing:
 - That the compositor doesn't have any animations active.
 - That the compositor is not waiting on any outstanding paint messages to arrive.
 - That the script tasks are "idle" and therefore won't cause reflow.
    - This currently means page loaded, onload fired, reftest-wait not active, first reflow triggered.
    - It could easily be expanded to handle pending timers etc.
 - That the "epoch" that the layout tasks have last laid out after script went idle, is reflected by the compositor in all visible layers for that pipeline.
2015-05-14 09:35:53 +10:00
Josh Matthews
f3cdba6b8b Make link elements fire a load event. 2015-05-11 13:41:52 -04:00
Josh Matthews
32a89c9455 Make stylesheets block page load. 2015-05-11 13:41:52 -04:00
Guro Bokum
be2cb665de Start using on_refresh_driver_tick #5681
Final
2015-05-06 02:08:39 +07:00
Ms2ger
1303dd6e2e Require documentation in script_traits. 2015-04-30 20:48:21 +02:00
Prabhjyot Singh Sodhi
b980278d90 Uniformise the various Msg types [#5882] 2015-04-30 01:22:16 +05:30
James Graham
c2fc6e311a Add script execution support via WebDriver 2015-04-23 16:14:27 +01:00
Glenn Watson
d8aef7208e Refactored image cache task - details below.
* Simpler image cache API for clients to use.
 * Significantly fewer threads.
   * One thread for image cache task (multiplexes commands, decoder threads and async resource requests).
   * 4 threads for decoder worker tasks.
 * Removed ReflowEvent hacks in script and layout tasks.
   * Image elements pass a Trusted<T> to image cache, which is used to dirty nodes via script task. Previous use of Untrusted addresses was unsafe.
   * Image requests such as background-image on layout / paint threads trigger repaint only rather than full reflow.
 * Add reflow batching for when multiple images load quickly.
   * Reduces the number of paints loading wikipedia from ~95 to ~35.
 * Reasonably simple to add proper prefetch support in a follow up PR.
 * Async loaded images always construct Image fragments now, instead of generic.
   * Image fragments support the image not being present.
 * Simpler implementation of synchronous image loading for reftests.
 * Removed image holder.
 * image.onload support.
 * image NaturalWidth and NaturalHeight support.
 * Updated WPT expectations.
2015-04-23 09:40:24 +10:00
Glenn Watson
18d465bcd2 Support focus management and keyboard events for iframes. 2015-04-20 07:52:22 +10:00
Gilles Leblanc
ba36a108c1 Split out shared networking code into net_traits crate
Fixes #4476
2015-04-03 13:38:10 -04:00
Ms2ger
eefb0773a0 Remove the unsafe impl Send for ConstellationControlMsg.
This impl made it possible to put raw pointers in ConstellationControlMsg and
send them across threads without considering the consequences.

This required making SmallVec1<T> Send if T is Send.
2015-04-03 13:32:51 +02:00
Ms2ger
6b127a8df8 Introduce a MouseButton enum. 2015-04-03 01:24:33 +02:00
Ms2ger
54c006d159 Use u32 for reflow ids. 2015-03-28 15:36:36 +01:00