Nazım Can Altınova
c9e5cf0a28
Cleanup @font-face rule constructor
...
Passing SourceLocation into constructor instead of assigning
immediately after construction cleans up the code and helps to
prevent leaving an invalid SourceLocation in the future.
2017-07-26 11:55:22 -07:00
Simon Sapin
eb98ae6e04
Update cssparser to 0.18
...
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Anthony Ramine
7995a9ed51
Derive ToCss for font-weight descriptors
2017-07-11 15:58:07 +02:00
Xidorn Quan
8b842f5417
Use integer for specified and computed font-weight
2017-07-06 15:31:24 +10:00
Anthony Ramine
17875b8a81
Introduce Separator::parse
2017-06-27 23:37:44 +02:00
Nazım Can Altınova
3421694f12
stylo: Implement font-language-override descriptor for @font-face rule
2017-06-25 18:51:18 -07:00
Fernando Jiménez Moreno
632c5571a9
stylo: make font-weight descriptor in @font-face preserve keyword values
2017-06-20 15:28:39 +02:00
Jonathan Chan
26179b3660
style: Have OneOrMoreSeparated replace OneOrMoreCommaSeparated.
...
A future patch series has some values that should be separated by spaces. This
allows us to re-use the code for serialization, but the types do get a little
clunky. The separator is now indicated with an associated type.
2017-06-19 16:09:37 -07:00
Anthony Ramine
3217d1404e
Derive ToCss for font-face sources
2017-06-17 13:46:30 +02:00
Simon Sapin
b83afdedc8
Upgrade cssparser to 0.15
2017-06-16 15:05:46 +02:00
Josh Matthews
27ae1ef2e7
Thread ParseError return values through CSS parsing.
2017-06-09 16:46:25 -04:00
Josh Matthews
fd6e54d9e3
Report CSS parse errors via enum instead of strings.
2017-06-09 13:16:32 -04:00
Brad Werth
31584e3c14
Deep clone ServoStyleSheets.
...
MozReview-Commit-ID: 6hYIcOa86Y
2017-05-24 15:05:26 -07:00
Fernando Jiménez Moreno
96a23d9b73
stylo: Bug 1355345 - Support font-display descriptor in @font-face rule
2017-05-18 18:16:24 +02:00
Anthony Ramine
a0886213b6
Support font-feature-settings as a @font-face descriptor
2017-05-18 18:16:22 +02:00
Xidorn Quan
138fa4ca08
Change ToNsCssValue to take the ownership of value.
2017-05-16 14:42:42 +10:00
Fernando Jiménez Moreno
bc156cfe1c
Stylo: Bug 1350175 - Support getting line / column number of CSS rules
...
Fix font_cache_thread test
2017-05-12 15:20:12 +02:00
Simon Sapin
131b12dc67
Reject @font-face descriptors with value value followed by more stuff.
2017-04-01 14:54:57 +02:00
Simon Sapin
b43e2fb0df
Macroize conversion of @font-face values to Gecko types
2017-04-01 14:05:32 +02:00
Simon Sapin
61812d4d9d
Make the parser accept @font-face rules without font-family or src.
...
Fix #16165 .
Also, it turns out that the CSSFontFaceRule IDL specified in the
css-fonts spec is not web-compatible.
Instead browsers implement a .style attribute like in CSSStyleRule:
https://github.com/w3c/csswg-drafts/issues/825
This in turn requires preserving data about which descriptors
were set or not (distinguishing unset from set to a value that happens
to be the initial value),
so this commit also makes every field `Option<_>`.
2017-04-01 14:05:32 +02:00
Nazım Can Altınova
9991c496b3
Serialize unquoted font-family without quote
2017-03-30 23:40:23 +03:00
Xidorn Quan
2c0347ac5b
Rename font_face::FontFaceRule to FontFaceData.
2017-03-30 11:41:07 +11:00
Simon Sapin
fe4e70c5f8
Introduce a ToCssWithGuard trait
2017-03-19 22:30:33 +01:00
Simon Sapin
8160490272
Remove some unused impls.
2017-03-07 23:37:28 +01:00
Simon Sapin
c3cad2d6c7
Update cssparser to 0.9
2017-02-15 12:42:14 +01:00
Simon Sapin
9ec8418d8c
Rename CommaSeparated to OneOrMoreCommaSeparated, reflecting its behavior.
2017-02-03 13:15:53 +01:00
Simon Sapin
4701850f37
Add unicode-range descriptor to @font-face
2017-02-02 20:28:21 +01:00
Simon Sapin
0f351cb851
Fix incorrectly copy-pasted doc-comments.
2017-02-02 20:00:40 +01:00
Simon Sapin
f6bf397bb2
Add font-stretch descriptor to @font-face
2017-02-02 19:59:03 +01:00
Simon Sapin
fe8f5fad16
Add font-weight descriptor to @font-face
2017-02-02 19:58:40 +01:00
Simon Sapin
8767b0d7cc
Add font-style descriptor in @font-face
2017-02-02 19:57:40 +01:00
Simon Sapin
5405fb0d73
Use FamilyName instead of FontFamily in @font-face
...
… to exclude generic families, per spec:
https://drafts.csswg.org/css-fonts/#font-family-desc
2017-02-02 19:37:31 +01:00
Simon Sapin
44f6c60d91
Separate mandatory and optional descriptors in @font-face parsing macro.
2017-02-02 19:02:57 +01:00
Simon Sapin
4bcae573b3
Macroize @font-face descriptor definitions
2017-02-02 18:32:02 +01:00
Simon Sapin
2b83d844da
Use the Parse trait for @font-face
parsing.
2017-02-02 18:32:01 +01:00
Simon Sapin
7724bb01a3
Remove intermediate FontFaceDescriptorDeclaration enum.
...
Have `@font-face` parsing write to `FontFaceRule` directly.
2017-02-02 18:32:01 +01:00
Emilio Cobos Álvarez
c6144df470
style: Document the font_face module.
2017-01-02 12:57:57 +01:00
Thiago Pontes
206f4ea5b8
use Either type for UrlOrNone
...
fix test-tidy errors
fix style unit test
use the Parse trait instead of ParseWithContext
fix stylo test and geckolib build
move all specified url parse code to parse trait and remove refs to unused type
2016-11-30 11:43:14 -05:00
Manish Goregaokar
0e19f456bc
Fixup error from #14238
2016-11-23 09:32:47 -08:00
Nazım Can Altınova
fdbadcdce2
Implement ToCss serialization for CSSRules
2016-11-18 12:17:53 +03:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often.
2016-11-17 18:34:23 +01:00
Simon Sapin
8bfe978c78
Update cssparser
2016-09-07 14:13:56 +08: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
Anthony Ramine
b97c7a8c4d
Don't load all font faces sources
...
We stop at the first one we manage to load.
2016-06-10 21:51:06 +02:00
Anthony Ramine
64b34d5162
Introduce FontFaceRules::effective_sources()
...
This avoids downloading fonts in formats we don't support.
2016-06-06 23:43:09 +02:00
Per Lundberg
2f7ed1d73e
Removed unused imports
...
This fixes #11185 .
2016-05-15 22:24:26 +03:00
Simon Sapin
6889f37d9e
Remove the url! plugin.
...
In rust-url 1.0 the `Url` struct is going to have private fields, and there
is no way to to create an aribitrary one without going through the parser.
The plugin never had a clear demonstrated performance benefit,
it was made mostly because it was possible and relatively easy at the time.
2016-04-14 15:35:28 +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