Emilio Cobos Álvarez
f69983930d
style: Fix media query parsing when invalid queries are present.
2017-03-15 17:45:39 +01:00
Xidorn Quan
52c9f4b527
Implement MediaList for Stylo.
2017-03-13 17:55:25 +11:00
Emilio Cobos Álvarez
5b5243b8af
Bug 1331213: Bootstrap a Gecko-side Device, and track it's dirtiness manually in the per-doc data. r=heycam
...
The setup is quite different to Servo-land, so add a comment about the different
setup.
Also, check viewport rules when flushing stylesheets. I believe that the
previous behavior is plain wrong, though I haven't taken the time to come up
with a test case.
In any case, it doesn't hurt any of both back-ends.
MozReview-Commit-ID: 46gtTkesOsr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:05:23 +01:00
Emilio Cobos Álvarez
c0cf847043
style: Isolate the soon-to-be style-backend-specific from the media_query module.
2017-01-07 12:34:43 +01:00
Boris Zbarsky
369fdddcd9
Bug 1298588 part 13. Make sure Device has a ComputedValues for stylo. r=bholley
2017-01-04 23:13:52 -05:00
Emilio Cobos Álvarez
c04c3c60c3
style: Serialize also "only" qualifier, and fix serialization of all media expressions without explicit qualifiers.
2016-12-30 15:05:28 +01:00
Emilio Cobos Álvarez
bb672f1a2c
style: Simplify media-query parsing so it's easier to split out.
2016-12-30 15:05:27 +01:00
Emilio Cobos Álvarez
8120906a15
style: Refactor media query serialization so it doesn't use an intermediate buffer.
...
I plan to move MediaType to ToCss soon.
2016-12-30 15:05:27 +01:00
Emilio Cobos Álvarez
b4caebae69
style: Cleanup and refactor how media types are represented.
...
This is necessary for the upcoming work in Stylo, given I plan to make MediaType
different for Servo and Gecko, and the Unknown variant doesn't fit in MediaType
to be fair, the device is never going to have any unknown media type.
2016-12-30 15:05:14 +01:00
Emilio Cobos Álvarez
ca93a2dcec
style: Add a way to update an empty stylesheet for @import.
...
We'll update the empty stylesheet we've created when instantiating the
ImportRule when the stylesheet finishes loading.
2016-12-16 16:57:19 +01:00
Emilio Cobos Álvarez
62d65c1872
style: Simplify some code in media_queries.rs
2016-12-16 14:53:17 +01:00
Nazım Can Altınova
c052835281
Implement MediaList interface
2016-12-02 23:46:40 +03:00
Gregory
84e9277771
implement support for the width media query
...
failing test for correct to_css of "width"
separate test for mq and to_css
implement css serialization for Eq
remove PASS test expectation
remove FIXME
simplify serialization
2016-11-26 17:31:41 +08:00
Emilio Cobos Álvarez
6c3458767b
style: Refactor and add infrastructure for font metrics in style.
...
This commit itself only moves things around and adds an extra parameter to the
`apply_declarations` function to eventually handle #14079 correctly.
Probably needs a more granular API to query fonts, á la nsFontMetrics, but
that's trivial to do once this is landed.
Then we should make the font provider mandatory, and implement the missing stylo
bits.
2016-11-13 11:54:10 +01:00
Xidorn Quan
5dfcb07f6a
Allow empty media query list
...
And make empty list the default value of MediaList.
This commit also removes Option wrapper of Stylesheet.media because
a stylesheet should always have an associated media query list.
2016-11-10 17:42:16 +11:00
Xidorn Quan
2733ec3bdc
Rename media_queries::MediaQueryList to MediaList
2016-11-08 13:09:31 +11:00
Ravi Shankar
6061985898
Prefer Servo-specific ToCss for all types
2016-11-07 09:14:22 +05:30
Simon Sapin
53b638c0e2
Update to string-cache 0.3
2016-11-03 16:23:05 +01:00
Jack Moffitt
138a0480fe
Implement matchMedia and MediaQueryList
...
Fixes #13376 .
2016-11-02 13:40:22 -06:00
Emilio Cobos Álvarez
d02c5b0281
style: Don't incorrectly clamp values in calc that might not be only lengths.
...
Expressions with percentages may be negative or positive at computed value time.
So, we can only clamp lengths at computed value time, which is what the other
browsers do.
2016-09-01 23:39:40 -07:00
Emilio Cobos Álvarez
be7a44315d
style: Allow calc in media queries.
2016-08-30 13:48:55 -07:00
Martin Robinson
6259df5e2d
Update to euclid 0.8
2016-08-12 03:12:06 +02:00
Ms2ger
cbfe77cee1
Move some unit type definitions to style_traits.
2016-07-11 12:14:27 +02:00
Ms2ger
79e0d18a1d
Add some documentation to the style crate.
2016-06-27 17:33:14 +02:00
Simon Sapin
00b6210519
Make the style crate almost build on stable Rust.
...
`discriminant_value` will need to be replaced with something else later.
2016-06-22 15:44:13 +02:00
Per Lundberg
2f7ed1d73e
Removed unused imports
...
This fixes #11185 .
2016-05-15 22:24:26 +03:00
Emilio Cobos Álvarez
9caaa6004e
style: Support lazy pseudo-elements
...
These can't be supported in Servo as of right now, because I'm not
totally sure the accesses that should be done in layout would be
thread-safe.
It can be revisited later though.
2016-05-03 19:01:54 +02:00
Anthony Ramine
cb5cd8d881
Say farewell to in-tree HeapSizeOf
2016-02-04 22:03:32 +01:00
Simon Sapin
6fd46b5e6a
Update cssparser.
...
https://github.com/servo/rust-cssparser/pull/91
2016-01-21 17:58:03 +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
Glenn Watson
339a3f869b
Split Au type into separate crate, with minimal dependencies.
2015-10-01 07:16:11 +10: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
Manish Goregaokar
35dd1816a9
Improve style in properties.mako.rs
2015-09-04 08:16:32 +05:30
Manish Goregaokar
97422ad252
Various fixes in style
2015-09-03 03:16:00 +05:30
Johann Tuffe
ec07178b6f
sort all uses
2015-08-20 20:47:12 +08:00
ecoal95
8cbfb3482c
Use euclid from crates.io
2015-06-19 00:04:24 +02:00
Corey Farwell
5c408d2be9
rust-geom API changes
...
https://github.com/servo/rust-geom/pull/81
2015-06-13 12:28:21 -07:00
Simon Sapin
8b522f2e7d
Rename Au methods with f32/f64 instead of frac32/frac/subpx
2015-05-05 18:23:29 +02:00
Ms2ger
903305416a
Implement Clone for Copy types.
2015-04-28 23:31:10 +02:00
Corey Farwell
9f6d94e107
Add links to the spec for components/style
2015-04-17 21:29:08 -04:00
Simon Sapin
9199c4f478
Remove now-empty module.
2015-04-08 01:07:57 +02:00
Simon Sapin
e5466a34c5
Move style crate unit tests into the unit_tests crate.
2015-04-08 01:07:52 +02:00
Ms2ger
2755ed6c58
Remove allow(missing_copy_implementations) attributes.
...
This is now the default.
2015-03-23 10:49:44 +01:00
James Gilbertson
bc1c44bbc2
Implement viewport percentage length units ('vw', 'vh', 'vmin', 'vmax')
2015-03-05 07:11:34 -07:00
James Gilbertson
16a8047343
Defer media query width computation until evalation
2015-03-05 07:09:10 -07:00
Simon Sapin
be599158e0
Do "computed value" calculation with a trait with an associated type.
2015-02-20 21:32:01 +01:00
Simon Sapin
d5dd1d658e
Upgrade to rustc ba2f13ef0 2015-02-04
2015-02-11 14:48:34 -08:00
Ms2ger
505159a464
Import the util crate as util rather than servo_util.
...
This used to conflict with the util crate from the standard library, which
has long since been removed.
The import in layout has not been changed because of a conflict with the
util mod there.
2015-01-29 12:16:41 +01:00
Josh Matthews
95fc29fa0d
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
2015-01-28 10:16:49 +10:00