Commit graph

467 commits

Author SHA1 Message Date
bors-servo
ea690a2dff Auto merge of #8622 - frewsxcv:url-plugin, r=SimonSapin
Implement 'url!(..)' macro

https://github.com/servo/rust-url/issues/136

https://github.com/servo/rust-url/pull/137

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8622)
<!-- Reviewable:end -->
2015-11-21 21:10:52 +05:30
Corey Farwell
f34da4120d Implement 'url!(..)' macro
https://github.com/servo/rust-url/issues/136

https://github.com/servo/rust-url/pull/137
2015-11-21 08:15:56 -05:00
bors-servo
c19b01c2f4 Auto merge of #8559 - glennw:transform-layers, r=pcwalton
Include transform changes in list that cause incremental reflows.

Also ensure that 3d translations get layers.

Fixes #8329.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8559)
<!-- Reviewable:end -->
2015-11-21 02:28:18 +05:30
Glenn Watson
f555e3861c Include transform changes in list that cause incremental reflows.
Also ensure that 3d translations get layers.

Fixes #8329.
2015-11-18 10:28:37 +10:00
Brandon Fairchild
7f75a881a4 Make Stylesheet::is_effective_for_device more idiomatic 2015-11-17 17:02:01 -05:00
Ms2ger
f2be9eb735 Move the from_declaration to its only caller and remove the empty legacy module. 2015-11-15 13:57:22 +01:00
Ms2ger
1154cf51c8 Inline PresentationalHintSynthesis::synthesize_presentational_hints_for_legacy_attributes. 2015-11-15 13:46:55 +01:00
Ms2ger
9c1d678b1b Remove get_unsigned_integer_attribute. 2015-11-15 11:24:03 +01:00
Alan Jeffrey
84bde75b42 Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00
Bobby Holley
7fa7936657 Implement attribute restyle hints.
Fixes #6942.
2015-11-10 11:57:24 -08:00
Bobby Holley
c9704992a9 Factor the name-related fields of Attr into a struct and move it to style. 2015-11-09 21:40:22 -08:00
Bobby Holley
488c1291d4 Hoist AttrValue into style. 2015-11-09 21:40:22 -08: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
Till Schneidereit
068e6a8e9f Derive HeapSizeOf on more Stylesheet-related types
In preparation of storing `Stylesheet`s on nodes.
2015-11-07 16:19:23 +01:00
Till Schneidereit
f1b6c7cc99 Let Stylist compute and store viewport constraints when setting the device 2015-11-07 16:19:13 +01:00
Till Schneidereit
f173504ded Make UA and user stylesheets static and shared by all Stylist instances 2015-11-07 15:45:27 +01:00
bors-servo
65c3185b20 Auto merge of #8341 - bholley:state_hint_selector_ordering, r=pcwalton
Fix restyle hints to handle non-last psuedo-selectors, and track pristine state values rather than changesets

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8341)
<!-- Reviewable:end -->
2015-11-07 09:53:19 +05:30
Simon Sapin
3973085cb6 Fix double /**//**/ 2015-11-06 23:01:55 +01:00
Simon Sapin
40e6cc118e Detect var() in shorthand declarations. 2015-11-06 23:01:54 +01:00
Simon Sapin
6ed5b561df Derive more Debug impls. 2015-11-06 23:01:12 +01:00
Simon Sapin
886459de6b Fix serialization of shorthands pending var() substitution. 2015-11-06 23:01:11 +01:00
Simon Sapin
020d03b656 Custom properties: handle premature EOF correctly. 2015-11-06 23:01:10 +01:00
Simon Sapin
69d398f29a Update to rust-cssparser 0.4.0 2015-11-05 08:57:01 +01:00
Bobby Holley
7dba4447f1 Store pristine element state rather than a set of changes.
This is the strategy we'll need to take for attributes, and so this change
puts us in a position to handle attributes and state the same way.

This does mean that we stop taking care to track the situations where our
state has reverted to the original state, with no net change. I think that's
probably of negligible value though.
2015-11-04 19:09:58 -08:00
Bobby Holley
d89816bb5f Consider all the pseudo-classes in a given compound selector when computing restyle hints, not just the rightmost one.
For some reason when I wrote this code I mixed up the rules for pseudo-elements
(rightmost, maximum of one) with those of pseudo-classes (which have no such
restriction). This caused a correctness issue which can be demonstrated with the
associated reftest modification.
2015-11-04 19:01:50 -08:00
Simon Sapin
80dbd29528 counter-reset defaults to 0, not 1. 2015-11-04 10:55:16 +01:00
Simon Sapin
75bc88b3d4 Counter names serialize as identifiers, not strings. 2015-11-04 10:29:25 +01:00
bors-servo
5070c873d0 Auto merge of #8111 - gilles-leblanc:issue-8002, r=SimonSapin
Compute value of float according to position value

According to CSS2 Section 9.7, if 'position' has a value of 'absolute'
or 'fixed' the computed value of 'float' should be 'none'.

This changes the float to a single_keyword_computed which checks the
positioned value of the element to compute the float value.

Fixes #8002

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8111)
<!-- Reviewable:end -->
2015-11-03 21:39:32 +05:30
David Zbarsky
00980ea595 Implement calc expressions for more value types 2015-11-01 23:16:14 -08:00
Bobby Holley
45fc7f2930 Implement restyle hints for state changes. 2015-10-31 14:28:52 -07:00
Manish Goregaokar
184b2bacf3 Fix serde_macros 2015-10-28 21:53:15 +05:30
Manish Goregaokar
ce5586f74a Update euclid to 0.3 2015-10-28 21:34:23 +05:30
Gilles Leblanc
725484d619 Compute value of float according to position value
According to CSS2 Section 9.7, if 'position' has a value of 'absolute'
or 'fixed' the computed value of 'float' should be 'none'.

This changes the float to a single_keyword_computed which checks the
positioned value of the element to compute the float value.

Fixes #8002
2015-10-23 20:56:52 -04:00
Adam Szopa
88991013ab Remove explicit lifetimes which can be elided. 2015-10-21 01:27:48 +02:00
Eli Friedman
3a451ff845 Add support for pre-wrap and pre-line values for white-space.
This is mostly straightforward.  I had to modify a couple of places
which were accidentally discarding whitespace.

Fixes #1513.
2015-10-20 10:44:51 -07:00
Corey Farwell
20beaf5af3 Fix issues found by rust-clippy 2015-10-12 20:21:49 -04:00
bors-servo
0f8493a566 Auto merge of #7918 - nox:partialeq-font, r=mbrubeck
Derive PartialEq on the style Font structure

We check the hash first.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7918)
<!-- Reviewable:end -->
2015-10-10 12:26:07 -06:00
bors-servo
ab42ca4296 Auto merge of #7825 - eefriedman:div-align, r=mbrubeck
Fully implement the "align descendants" rule for div.

This adds -servo-left and -servo-right to complement -servo-center.

~~This intentionally doesn't try to address issue #7301.~~  Commit added to address #7301.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7825)
<!-- Reviewable:end -->
2015-10-08 12:20:55 -06:00
Anthony Ramine
6d6dbf0129 Derive PartialEq on the style Font structure
We check the hash first.
2015-10-08 00:32:58 +02:00
bors-servo
7debfd1f4c Auto merge of #7683 - frewsxcv:html-font-element-size-attr, r=nox
Implement `size` attribute for <font> element



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7683)
<!-- Reviewable:end -->
2015-10-05 02:33:02 -06:00
Eli Friedman
69ca066802 Fully implement the "align descendants" rule for div.
This adds -servo-left and -servo-right to complement -servo-center.

This intentionally doesn't try to address issue #7301.
2015-10-02 12:53:20 -07:00
bors-servo
a7743052ca Auto merge of #6185 - luniv:viewport-meta, r=mbrubeck
Implement <meta name=viewport> handling

Translate <meta name=viewport> as according to [CSS Device Adaption § 9](http://dev.w3.org/csswg/css-device-adapt/#viewport-meta)

Note: as the PR currently stands, handling `<meta name=viewport>` elements always occurs. This is probably not desired for some contexts (e.g. desktop), but I'm unsure of how to conditionally handle elements based on that.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6185)
<!-- Reviewable:end -->
2015-09-30 22:49:41 -06:00
James Gilbertson
61f7a0a1ee Implement CSS Device Adaption § 9 (Viewport <META> element)
Spec: http://dev.w3.org/csswg/css-device-adapt/#viewport-meta
2015-09-30 20:11:39 -07:00
Corey Farwell
74e4c4fdc7 Implement size attribute for <font> element 2015-09-30 22:51:30 -04:00
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
bors-servo
45a0c48efd Auto merge of #7711 - aopicier:root_layout, r=pcwalton
Use computed `display` property for hypothetical box of root element

Closes #7558.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7711)
<!-- Reviewable:end -->
2015-09-27 17:03:58 -06: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