Commit graph

353 commits

Author SHA1 Message Date
Glenn Watson
1999ea5e43 Update servo to use published app units crate 2015-10-01 11:45:35 +10:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Patrick Walton
c72d0c2ed0 layout: Make the compositor rather than layout determine the position of
each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that both the sizes and positions of
iframes are determined by the compositor. Layout layerizes all iframes
and marks the iframe layers with the appropriate pipeline and subpage
IDs so that the compositor can place them correctly. This approach is
similar in spirit to Gecko's `RefLayer` infrastructure. The logic that
determines when it is time to take the screenshot for reftests has been
significantly revamped to deal with this change in delegation of
responsibility.

Additionally, this code removes the infrastructure that sends layout
data back to the layout task to be destroyed, since it is now all
thread-safe and can be destroyed on the script task.

The failing tests now fail because of a pre-existing bug related to
intrinsic heights and borders on inline replaced elements. They happened
to pass before because we never rendered the iframes at all, which meant
they never had a chance to draw the red border the tests expect to not
render!

Closes #7377.
2015-09-29 09:47:28 -07:00
Patrick Walton
9bb6acd690 layout: Load Web fonts asynchronously.
Improves page load times significantly.

Closes #7343.
2015-09-27 15:38:20 -07:00
Jaydeep
2a99915188 Check for Extra pointer dereferencing. Issue #7640. 2015-09-26 19:33:29 -07:00
James Graham
79e548905e Enable resetable and String prefs.
This allows both boolean and string-type preferences. It
also implements a system where prefs that are read from a
configuration file can be reset back to their initial value,
which is useful in a number of cases e.g. when running tests
to ensure that each test starts with the same values for
the prefs.
2015-09-25 00:58:48 +01:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Maciej Skrzypkowski
88815d21ba Add plugins for compositing and net crates #7699
Changed to_string calls to to_owned calls
where was a need.
2015-09-22 13:51:21 +02:00
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
Hugo Thiessard
6565e7b02f Issue #7390 correct the order of mod declaration 2015-09-18 22:02:04 +02:00
Matt Brubeck
8606a94722 Set default limits on page zoom and pinch zoom
Currently these both clamp to 100% in one direction and are unbounded in the
other direction.  This sets default zoom constraints of 10% to 800%.
2015-09-18 05:30:55 -07:00
bors-servo
2879da54f9 Auto merge of #7645 - nox:omtc-types, r=Ms2ger
Introduce structs for compositing and script task constructors' arguments

Extracted from @pcwalton's #4271.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7645)
<!-- Reviewable:end -->
2015-09-16 10:41:10 -06:00
Anthony Ramine
a7738a5eef Introduce InitialScriptState 2015-09-16 18:38:24 +02:00
bors-servo
6a12f00d6d Auto merge of #7605 - nox:skew, r=mbrubeck
Implement "transform: skew()"

Thanks to @Jinwoo-Song for the original commit, which I just rebased and cleaned up. Fixes #6237.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7605)
<!-- Reviewable:end -->
2015-09-16 06:31:48 -06:00
Anthony Ramine
9e1e2b8ed3 Introduce InitialConstellationState 2015-09-16 02:11:37 +02:00
Anthony Ramine
7d140113e7 Introduce InitialPipelineState 2015-09-15 23:14:56 +02:00
Anthony Ramine
5cf8d597e6 Introduce InitialCompositorState 2015-09-15 23:14:48 +02:00
bors-servo
b05f4aa3aa Auto merge of #7559 - ddrmanxbxfr:RFC-0344-Work, r=nox
Remove 'get_*' on getters as per RFC 0344 on canevas, compositing, devtools, gfx, layout, net, profile, servo and webdriver_server

Hi guys,

I just gave a big pass of RFC-0344 as per issue #6224 .

Pretty much renamed all the get_* fn that were used to fetch values. 

I hope I didn't rename too much. 

As said in the issue discussion, I didn't touch at the scripts folder so we keep the unsafe ones pretty explicit.

I've ran the whole pass of test, everything seems to be still working right :).

Please give feedback on this PR.

Thanks for looking into it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7559)
<!-- Reviewable:end -->
2015-09-12 18:29:56 -06:00
Mathieu Rheaume
7320433cca Remove 'get_*' on getters as per RFC 0344 on various components 2015-09-12 20:14:01 -04:00
Anthony Ramine
f11fcebd9c Bump euclid to 0.2 2015-09-12 01:06:26 +02:00
Bryan Bell
b7ea7de136 Improve err msg when failing to output png
Before on at least Linux the following failure is hard to root cause:

    [~/servo] ./target/debug/servo -o tmp.png ./tests/html/lipsum.html
    thread '<main>' panicked at 'assertion failed: res.is_ok()', .../compositor.rs:1508
    thread '<main>' panicked at 'You should have disposed of the
    pixmap...', .../rust-layers/.../surface.rs:166

Now:

    [~/servo] ./target/debug/servo -o tmp.png ./tests/html/lipsum.html
    thread '<main>' panicked at 'Error writing png: Permission
    denied (os error 13)', .../compositor.rs:1508
    thread '<main>' panicked at 'You should have disposed of the pixmap
    properly with destroy()! This pixmap will leak!', .../rust-layers/.../surface.rs:166
2015-09-10 21:45:58 -07:00
bors-servo
ca36779a7e Auto merge of #7547 - connorimes:move_script_profiling, r=jdm
Combine script profiling with profile crates. Fixes #7514.

The script crate had its own built-in profiling which was basically doing the same thing as the profile crate.  This wraps the internal profiling around the main profile functionality.  Script-related tasks are now added to the ProfilerCategory enum.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7547)
<!-- Reviewable:end -->
2015-09-08 09:32:56 -06:00
Connor Imes
d746835344 Combine script profiling with profile crates. Fixes #7514. 2015-09-04 16:09:44 -05:00
James Graham
a208379f46 Update prefs API to return an Option<bool>.
This allows for situations where there is no reasonable default
to apply for the pref value e.g. when we are just listing values
2015-09-04 15:55:29 +01:00
João Oliveira
4a305d1e62 Add style_traits crate to improve crate separation,
closes #7353
2015-09-04 12:59:37 +01:00
farodin91
f0987380dd Implement viewport functions for window #1718 2015-09-02 00:40:52 +02:00
erneyja
17663315dd make test-tidy check that = have space after them 2015-09-01 07:18:19 -04:00
bors-servo
064b72ac97 Auto merge of #7417 - glennw:headless-raf, r=pcwalton
Fix requestAnimationFrame in headless mode. Fixes #7296.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7417)
<!-- Reviewable:end -->
2015-08-28 11:26:09 -06:00
Josh Matthews
a3ee9b5dd9 Replace catch-all experimental flag with fine-grained boolean preferences initialized from a JSON document. 2015-08-28 10:30:04 -04:00
Glenn Watson
103feca08b Fix requestAnimationFrame in headless mode. Fixes #7296. 2015-08-28 07:55:18 +10:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
João Oliveira
067a22a868 Replace uses of for foo in bar.iter(),
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
2015-08-18 01:46:11 +01: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
João Oliveira
0038580abf Replace uses of for foo in bar.iter() and for foo in bar.iter_mut()
closes #7197
2015-08-15 02:27:39 +01:00
João Oliveira
9c11781880 replace .len() == 0 with is_empty()
closes #7198
2015-08-14 04:00:33 +01:00
bors-servo
7f0e62b6fb Auto merge of #7189 - Ms2ger:unsafe-compositing, r=larsbergstrom
Deny unsafe code in compositing.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7189)
<!-- Reviewable:end -->
2015-08-13 07:14:22 -06:00
Ms2ger
1abc7a6dab Deny unsafe code in compositing. 2015-08-13 10:52:29 +02:00
Ms2ger
ee702a7135 Use Iterator::any in collect_old_layers. 2015-08-13 10:02:33 +02:00
Glenn Watson
6506468e19 Ensure compositor layers are collected when removed from layout. 2015-08-13 09:46:58 +10:00
bors-servo
3ad49fc689 Auto merge of #7171 - Ms2ger:ScriptControlChan, r=jdm
Remove ScriptControlChan.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7171)
<!-- Reviewable:end -->
2015-08-12 08:28:29 -06:00
Ms2ger
0aae98e9c0 Pass a Sender<ConstellationControlMsg> to Pipeline::new. 2015-08-12 16:19:30 +02:00
Ms2ger
250fdc33f4 Store a Sender<ConstellationControlMsg> in Pipeline. 2015-08-12 16:15:21 +02:00
Ms2ger
fafcc0a5da Store a Sender<ConstellationControlMsg> in CompositionPipeline. 2015-08-12 16:03:38 +02:00
Ms2ger
9476474267 Store a Sender<ConstellationControlMsg> in PipelineContent. 2015-08-12 15:58:10 +02:00
Ms2ger
fdafc5c360 Store a Sender<ConstellationControlMsg> in LayoutTask. 2015-08-12 15:55:16 +02:00
Ms2ger
c05f0906d5 Store a Sender<ConstellationControlMsg> in ScriptTask. 2015-08-12 15:25:31 +02:00
Ms2ger
1ef10550b1 Avoid unwrap calls in handle_navigate_msg. 2015-08-12 15:10:03 +02:00
Patrick Walton
bf26a2373f layout: Carry out some minor style cleanups. 2015-08-10 21:27:05 -07:00
Patrick Walton
300315bb78 compositing: Add some layer tree debugging infrastructure. 2015-08-10 21:27:04 -07:00