Commit graph

3197 commits

Author SHA1 Message Date
Patrick Walton
d10627a2b3 layout: Implement 2D CSS transforms per CSS-TRANSFORMS § 5, 6, 7, and 8. 2015-03-17 11:30:55 -07:00
Matt Brubeck
531bcb12ae Fixes for positioning of RTL blocks.
This fixes a bug in finding the top left corner of an RTL block in physical
coordinates.  (The old code used the `start` point of the `position` rect,
which is not always the top left.)

It also fixes the setting of `position.start.i` in certain mixed LTR/RTL
cases.

There is still a bug related to `position.size` for RTL blocks with margins.
See the FIXME comments for details.
2015-03-17 10:18:17 -07:00
Mátyás Mustoha
2817f2e066 Canvas: implement quadraticCurveTo(). 2015-03-17 16:05:36 +01:00
bors-servo
7bd6cb0091 auto merge of #5219 : doublec/servo/view_source_protocol_and_plain_text, r=jdm
Implements view-source protocol by having a view-source handler, and modifying the content type to be text/plain if that is used. 

Implements text/plain handling. This allows view-source content to display as plain text.

Example usage:

    ./mach run http://cd.pn/x.txt
    ./mach run view-source:http://tinyvid.tv/

This fixes issue #4181. Issue #3649 includes "support text/plain" so this possibly fixes some of that issue as well.
2015-03-17 07:18:51 -06:00
Chris Double
618142fac7 Implement displaying of text/plain documents
This is done by detecting the content type as text/plain
and following the requirements from:
https://html.spec.whatwg.org/multipage/browsers.html#read-text
2015-03-17 18:11:33 +13:00
bors-servo
0888a3a16d auto merge of #5226 : glennw/servo/fix-compositor-layers, r=larsbergstrom 2015-03-16 16:57:50 -06:00
Glenn Watson
591b10aa58 Fix for race condition causing reftests to hang under load.
If the root layer has a zero size rectangle, it will never be
painted, so assume the pipeline is idle in that case.

Re-enable two reftests that were disabled due to this issue.
2015-03-17 08:48:45 +10:00
bors-servo
b8e87ea020 auto merge of #5217 : zslayton/servo/master, r=jdm
@jdm This initial version has a few outstanding issues that I wanted to invite input on. Specifically:

1. I had some difficulty finding a home for the `StorageType` enum. Structs defined outside of the `script` module don't seem to be able to use the `#[jstraceable]` annotation and the `net` module (where `StorageTask` lives) doesn't have access to `script`. Per Simon Sapin's suggestion, I worked around this temporarily by creating a `TraceableStorageType` stand-in struct that was traceable and which could be translated into a regular `StorageType` when being sent to the `StorageTask`. Unsure of the best way to resolve this hack. Thoughts?

2. Apart from the `Storage` constructor used in `Window::SessionStorage` and the new `Window::LocalStorage`, there's also a method called `Storage::Constructor`. I'm unclear on what (if anything) will actually invoke this, so I'm not sure which variant of `StorageType` to use here. I've temporarily created an `Unknown` variant of `StorageType` as a placeholder.

3. I discovered that the web platform tests directory's localStorage tests. Many of them now pass despite the configured expectation that they fail. However, several do not pass. Is there a good way for me to add debug logging or otherwise get a sense of which assertion failed / what went wrong?

Thanks for your continued help!
2015-03-16 14:48:51 -06:00
Zack Slayton
323baf92db localStorage shim, fixes #5195 2015-03-16 13:33:55 -07:00
bors-servo
cf39c672b6 auto merge of #5210 : GreenRecycleBin/servo/#4968, r=jdm
`./mach test tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/security_location_0.sub.htm` is still failing with the same message as reported in #3219.
2015-03-16 11:42:59 -06:00
Mikko Perttunen
51ceaed0d0 Add reftest for media queries in link and style tags 2015-03-16 17:19:28 +02:00
Diego Marcos
cd84ab2ddc Fixes the problem with canvas not being rendered when displayed as block level elements 2015-03-15 22:10:06 -07:00
Daniel Le
0aa727e5b6 Add HOST_FILE environment variable for test-wpt 2015-03-14 18:45:34 +08:00
James Gilbertson
d80abce13e Reftests for viewport percentage length units 2015-03-13 10:27:27 -06:00
bors-servo
5f439e7eaa auto merge of #5204 : ehegnes/servo/squelch_contenttest, r=jdm
This actually fixes 5159.
2015-03-12 20:48:47 -06:00
Eric Hegnes
6208eaa628 Further squelch warnings from contenttest.rs
This actually fixes 5159
2015-03-12 20:38:49 -04:00
Peter Reid
8c5f9bb806 Fix warnings in tests/reftest.rs 2015-03-12 19:06:12 -04:00
bors-servo
8e811229ba auto merge of #4417 : pcwalton/servo/border-spacing, r=larsbergstrom
Table layout code has been refactored to push the spacing down to
rowgroups and rows; this will aid the implementation of
`border-collapse` as well.

r? @SimonSapin
2015-03-12 13:03:49 -06:00
Patrick Walton
586c12ccc4 layout: Implement border-spacing per CSS 2.1 § 17.6.1 and the legacy
`cellspacing` attribute per HTML5 § 14.3.9.

Table layout code has been refactored to push the spacing down to
rowgroups and rows; this will aid the implementation of
`border-collapse` as well.

This commit also fixes two nasty issues in table layout:

* In fixed layout, extra space would not be divided among columns that
  had auto width but had nonzero minimum width.

* In automatic layout, extra space would be distributed to constrained
  columns as well even if unconstrained columns with percentage equal to
  zero were present.
2015-03-12 12:00:40 -07:00
hirschenberger
2a91c317c0 Add reftest for issue #5176 2015-03-12 11:02:29 +01:00
bors-servo
e8f1a046c6 auto merge of #5185 : mmatyas/servo/canvas_arc, r=pcwalton
This patch enables the use of `arc()` on the canvas.
I couldn't add reftest this time, as it involves some antialiasing issues, and so the reference doesn't match.
2015-03-10 09:45:49 -06:00
Patrick Walton
8703cd9747 Update WPT expectations 2015-03-09 20:54:13 -07:00
Patrick Walton
64abea5780 Add a Japanese Web font 2015-03-09 20:50:39 -07:00
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00
Matt Brubeck
8221bfc3ef Layout fixes for RTL child flows in LTR parents
...and vice-versa.  This is not a complete fix for all mixed-direction layout
cases, but it fixes enough problems to make some simple test cases pass, like
tha attached reftest.

There are FIXME comments for many of the remaining issues.  In particular,
this does not yet handle RTL layout of fixed/absolute elements.
2015-03-09 14:21:26 -07:00
Mátyás Mustoha
c98bca6130 Canvas: added arc(). 2015-03-09 21:55:40 +01:00
Ms2ger
8343eb0b8a Disable intermittently failing canvas_transformations_scale_001.htm. 2015-03-09 18:16:08 +01:00
Eric Hegnes
20cb2c395d Fixes #5159
Fix warnings and introduce usage of `std::env` over deprecated `std::os`
functions.
2015-03-08 01:37:48 -05:00
Simon Sapin
f770dbabd7 Warn about sorting alphabetically in the reftest list file. 2015-03-07 17:58:00 +01:00
Gilles Leblanc
54dfb659ec Organize reftest list alphabetically and make the tidy script check it
Reftest list check is checked using Python's default string comparison.
Also added a notice in the tidy script when there are no errors.

Fixes #5092
2015-03-07 17:51:17 +01:00
bors-servo
a557b51c28 auto merge of #5154 : luniv/servo/viewpoint-percent-lengths, r=SimonSapin
Spec: http://dev.w3.org/csswg/css-values-3/#viewport-relative-lengths
2015-03-05 18:55:02 -07:00
Glenn Watson
14e438391a Disable flaky reftests until a proper solution is found.
A race condition exists where pipelines that are removed from a document
may not ever trigger a paint for that pipeline. The compositor relies
on a paint occurring for each pipeline before outputting the image when
in reftest mode.
2015-03-06 10:24:20 +10:00
Simon Sapin
c066377fc5 Add support for changing the viewport size in reftests.
Usage example, in `*.list` files:

    resolution=200x300 == something.html something_ref.html
2015-03-05 16:52:16 +01:00
bors-servo
9d58c086e7 auto merge of #5128 : bjwbell/servo/inline-block_fix_min-width, r=jdm
With inline-block elements set the width to max(min width,
specified width) instead of only using the specified width.

Fixes https://github.com/servo/servo/issues/4945
2015-03-03 22:24:44 -07:00
Bryan Bell
a35ffe1c6e For inline-block correctly use min-width
With inline-block elements set the width to max(min width,
specified width) instead of only using the specified width.
2015-03-03 21:06:57 -08:00
bors-servo
07a3ce2ce1 auto merge of #5130 : bjwbell/servo/inline_block_overflow_ref_test, r=glennw
For https://github.com/servo/servo/issues/3725
2015-03-03 21:48:43 -07:00
Bryan Bell
3b32178962 Add inline-block overflow ref test
For https://github.com/servo/servo/issues/3725
2015-03-03 20:44:49 -08:00
bors-servo
72f8898990 auto merge of #5118 : jdm/servo/pageload, r=Ms2ger
Rebased and improved version of #4967.
2015-03-03 16:03:45 -07:00
bors-servo
e19fbc686c auto merge of #5125 : glennw/servo/remove-iframe-layers, r=larsbergstrom 2015-03-03 15:12:45 -07:00
Glenn Watson
86baef2cc0 Remove compositor layers when iframes are removed from doc or display:none. 2015-03-04 07:51:46 +10:00
Josh Matthews
9a3d58032d Update WPT expectations. 2015-03-03 16:25:40 -05:00
Dan Fox
522b0ea3b9 uint -> usize 2015-03-03 20:27:19 +00:00
Simon Sapin
4c1d778ced Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d107.
2015-03-03 21:16:24 +01:00
Simon Sapin
e1b5acb56c Revert "Remove expected failure markers on a couple of WPT reftests that now pass."
This reverts commit 4c8bde5736.
2015-03-03 21:15:49 +01:00
bors-servo
e1a50c7719 auto merge of #5133 : servo/servo/background-size, r=SimonSapin
`background-size` per CSS-BACKGROUNDS § 3.9.

Nearest neighbor interpolation is used for `crisp-edges`, like Firefox.
A note has been added that we could do better if we wanted to.

Multiple backgrounds are not yet supported.

Rebase of #4368. Fixes #4368.
2015-03-03 11:48:54 -07:00
bors-servo
5cd6316add auto merge of #5067 : servo/servo/counters, r=SimonSapin
Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.

Moved from #4544, because Critic.

Fixes #4544.
2015-03-03 10:42:52 -07:00
Simon Sapin
4c8bde5736 Remove expected failure markers on a couple of WPT reftests that now pass. 2015-03-03 18:24:33 +01:00
Patrick Walton
09c53f461d layout: Implement image-rendering per CSS-IMAGES-3 § 5.3 and
`background-size` per CSS-BACKGROUNDS § 3.9.

Nearest neighbor interpolation is used for `crisp-edges`, like Firefox.
A note has been added that we could do better if we wanted to.

Multiple backgrounds are not yet supported.
2015-03-03 17:54:12 +01:00
Patrick Walton
30fd28d107 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-03 17:31:19 +01:00
Patrick Walton
a82fc00806 layout: Implement overflow-x and overflow-y per CSS-OVERFLOW § 3.
Fragmentation is not yet supported.
2015-03-03 17:03:27 +01:00