Commit graph

85 commits

Author SHA1 Message Date
benshu
0785d91ae4 Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
Emilio Cobos Álvarez
dd503dfacb Refactor style to be completely backend-independent
This commit refactors the style crate to be completely independent of
the actual implementation and pseudo-elements supported.

This also adds a gecko backend which introduces parsing for the
anonymous box pseudo-elements[1], although there's still no way of
querying them.

https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
2016-02-13 16:05:14 +01:00
Emilio Cobos Álvarez
a1c830f1c1 Update rust-selectors
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
bors-servo
47617578af Auto merge of #9245 - Ms2ger:reexports, r=nox
Stop reexporting style types from layout_interface.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9245)
<!-- Reviewable:end -->
2016-01-11 23:57:51 +05:30
Ms2ger
9dc85e0d40 Stop reexporting ReflowGoal from layout_interface. 2016-01-11 10:00:17 +01:00
Ms2ger
39ba25572b Stop reexporting Animation from layout_interface. 2016-01-11 09:47:08 +01:00
John DeSilva
f32995543d Move Epoch to gfx_traits
Resolves #9222. Moved Epoch from components/msg/compositor_msg to
components/gfx_traits/lib. Updated use statements to reflect the move.
2016-01-10 17:36:52 -05:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
bors-servo
3f407ea3d6 Auto merge of #9077 - bholley:split_layout_context_etc, r=SimonSapin
Split the style-related bits out of LayoutContext and hoist more stuff into style/

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9077)
<!-- Reviewable:end -->
2015-12-30 11:01:23 +05:30
bors-servo
0f5c614609 Auto merge of #9051 - bholley:split_style_and_layout_wrappers, r=SimonSapin
Split layout wrappers into style+layout and layout-only functionality

This is a step towards removing the dependency of stylo on layout/.

This PR depends on #9004.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9051)
<!-- Reviewable:end -->
2015-12-30 10:04:14 +05:30
Bobby Holley
a05d7f1dfd Hoist style-related context bits into style/.
We do a few things-here:
* Hoist non-layout-dependent fields in SharedLayoutData and LocalLayoutData into style/.
* Hoist parts of css/matching.rs into style/.
* Hoist parts of layout/animation.rs into style/animation.rs.
* Remove the duplicated-but-slightly-different definition of OpaqueNode.
2015-12-29 12:07:07 -08:00
Bobby Holley
47059d2d26 Separate style+layout and layout-specific wrapper functionality.
This patch does a number of things, unfortunately all at once:
* Hoists a large subset of the layout wrapper functionality into the style system.
* Merges TElementAttributes into the newly-created TElement.
* Reorganizes LayoutData by style vs layout, and removes LayoutDataShared.
* Simplifies the API for borrowing style/layout data.

There's still more to do to make the style system usable standalone, but
this is a good start.
2015-12-29 11:50:03 -08:00
Joe Kachmar
655268d111 Separate script and layout messages, issue #8843 2015-12-26 12:24:51 -05:00
Brandon Fairchild
637afecec9 Move LayerKind and ScrollPolicy enums to gfx_traits
This also moves LayerId and LayerProperties to gfx_traits.

Fixes #8836.
2015-12-20 20:43:31 -05:00
bors-servo
bc7158310c Auto merge of #8903 - KiChjang:layout-reporter-redirect, r=nox
fix for Layout memory reporter uses pre-redirect url

Rebase of #7612.

Fixes #6872.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8903)
<!-- Reviewable:end -->
2015-12-16 23:18:30 +05:30
Tomas Cernaj
5507be2653 Move ScriptMsg from msg crate into script_traits 2015-12-09 20:50:11 +01:00
Arnaud Marant
239f1ae1a7 fix for Layout memory reporter uses pre-redirect url #6872 2015-12-09 01:58:11 -08: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
bors-servo
20d26853e1 Auto merge of #8548 - Ms2ger:unused-tna, r=pcwalton
Remove the unused arguments to hit_test and mouse_over.

I don't think this code is called when there is no document element, but I
added assertions to make sure we notice in case I was wrong.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8548)
<!-- Reviewable:end -->
2015-11-17 02:05:52 +05:30
Ms2ger
4e60412c6d Remove the unused arguments to hit_test and mouse_over.
I don't think this code is called when there is no document element, but I
added assertions to make sure we notice in case I was wrong.
2015-11-16 15:53:49 +01:00
Ms2ger
a2c08413dd Remove AutoJoinScriptTask.
I don't believe there is a case where it would make sense to drop the
ScriptReflow struct without joining the script thread. This approach should
be somewhat more robust, and avoids the code smell of a RAII guard in an
otherwise unused variable.
2015-11-16 12:41:25 +01: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
Ms2ger
ad33d920e7 Remove the unused PipelineExitType field from layout_interface::Msg::ExitNow. 2015-11-05 16:17:51 +01:00
bors-servo
9a800becdf Auto merge of #8239 - Ms2ger:ScriptReflow, r=pcwalton
Remove unused code around ScriptReflow.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8239)
<!-- Reviewable:end -->
2015-11-03 15:29:17 +05:30
Olivia Nordquist
aebf87cf5b Un-boxed ScriptReflow 2015-10-31 22:29:16 -07:00
Ms2ger
40b3b749bf Remove unused fields from ScriptReflow. 2015-10-31 12:40:14 +01:00
Bobby Holley
441c84d75d Pass the document instead of the documentElement to reflow. 2015-10-27 12:41:16 -07:00
James Gilbertson
d0ace58452 Handle <meta name=viewport> elements when added to document 2015-09-30 20:31:35 -07: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
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
Ms2ger
4f9ec8915d Store a Sender<ConstellationControlMsg> in ScriptReflow. 2015-08-12 15:47:35 +02:00
Glenn Watson
9e5687e3e7 Implement offsetParent/Top/Left/Width/Height. 2015-08-03 11:55:38 +10:00
Patrick Walton
cac01edf80 style: Switch animation timestamps to be doubles instead of floats.
32-bit floats are not enough to hold timestamps since the epoch and
result in jank.
2015-08-01 17:46:39 -07:00
David Zbarsky
e484d6b5e3 Implement getComputedStyle 2015-07-29 20:17:50 -04:00
bors-servo
e0bd80f807 Auto merge of #6662 - tschneidereit:client-geometry, r=glennw,pcwatson
Implement Element.client{Top,Left,Width,Height}

This isn't done, but contains a working implementation of at least `clientTop`. Feedback would be much appreciated: it's probably far from ideal.

Implementing `clientLeft` is straight-forward, I think, but `clientWidth` and `clientHeight` require accessing the `border_box` - and I don't know how that works, yet.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6662)
<!-- Reviewable:end -->
2015-07-27 20:45:05 -06:00
Patrick Walton
f10c076180 profile: Make the time and memory profilers run over IPC.
Uses the `Router` abstraction inside `ipc-channel` to avoid spawning new
threads.
2015-07-24 17:02:17 -07:00
Till Schneidereit
126938a963 Address review comments 2015-07-21 22:56:26 +02:00
Till Schneidereit
162ecd0aac Implement client{Top, Left, Height, Width} element properties 2015-07-19 15:04:50 +02: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
9ce65c08a5 layout: Make the LayoutControlChan use IPC. 2015-07-14 13:45:52 -07:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
Patrick Walton
6a197719b3 compositing: Implement display ports and avoid creating display lists
for items outside it.

This improves Servo's performance on large pages.
2015-05-19 16:53:51 -07: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