Commit graph

139 commits

Author SHA1 Message Date
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Simon Sapin
46ea99d54b CSS parsing error types: flatten nested enums somewhat 2017-10-10 13:28:30 +02:00
Simon Sapin
c64374bc58 Use the location in the error value when reporting a CSS error 2017-10-10 13:28:29 +02:00
Simon Sapin
c0f8f15f39 Update to cssparser 0.22 (source location in error types) 2017-10-10 13:28:17 +02:00
Simon Sapin
056e599562 Use the current parser location for CSS error
… rather than the start location of the current construct.
This likely places the error just *after* of the unexpected token
whereas before would be best, but that’s likely a much bigger change.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1378861
2017-10-10 13:27:01 +02:00
Corey Farwell
9cd4535364 Implement size_hint for more iterators.
```
implement size hint for
more iterators because why
not we like fast things
```
2017-09-13 20:29:27 -04:00
Xidorn Quan
2bca62045f Parse at-rule without block in two stages 2017-09-01 16:21:22 +10:00
bors-servo
d4ddec8d33 Auto merge of #18209 - jdm:devirtualize, r=mbrubeck
Devirtualize CSS error reporting.

This removes a trait object from the path of reporting a CSS error.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18209)
<!-- Reviewable:end -->
2017-08-24 13:19:25 -05:00
Josh Matthews
1297c0ff51 Devirtualize CSS error reporting. 2017-08-24 10:41:06 -07:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Simon Sapin
7382dad939 Update to cssparser 0.19, count line numbers during tokenization 2017-08-09 22:37:16 +02:00
Xidorn Quan
df95a469a0 Make font-display descriptor behind the pref. 2017-08-03 19:07:12 +10:00
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