Anthony Ramine
ba4136b5a8
Document how style traits can be derived
2017-08-28 12:26:43 +02:00
Simon Sapin
dc5dfafbba
Use Parser::skip_whitespace in a few places to make Parser::try rewind less.
...
Gecko’s CSS parsing microbenchmarks before:
```
43.437 ± 0.391 ms Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
29.244 ± 0.042 ms Stylo.Gecko_nsCSSParser_ParseSheet_Bench
281.884 ± 0.028 ms Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
426.242 ± 0.008 ms Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```
After:
```
29.779 ± 0.254 ms Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
28.841 ± 0.031 ms Stylo.Gecko_nsCSSParser_ParseSheet_Bench
296.240 ± 4.744 ms Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
293.855 ± 4.304 ms Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```
2017-08-26 01:44:45 +02: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
eb98ae6e04
Update cssparser to 0.18
...
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Anthony Ramine
c03f5f19ab
Introduce CommaWithSpace
...
This allows us to support stroke-dasharray the same way as comma-separated
values.
2017-06-27 23:37:48 +02:00
Anthony Ramine
17875b8a81
Introduce Separator::parse
2017-06-27 23:37:44 +02:00
Anthony Ramine
39e29f557e
Simplify machinery to serialise optional parts of CSS values
...
We simply implement ToCss for Option<T>, printing nothing if the value is None,
and we then use SequenceWriter to skip writing of separators around empty parts.
2017-06-21 11:17:22 +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
Hiroyuki Ikezoe
6c5915068a
AllowedNumericType.is_ok() takes ParingMode as well.
...
And it returns true if ParsingMode.allows_all_numeric_values is true regardless
of AllowedNumericType itself.
2017-06-14 09:52:06 +09:00
Hiroyuki Ikezoe
7341574b66
Make AllowedLengthType.is_ok() returning true if parsing mode allows all numeric values.
...
Even if the type is NonNegative and the given value is a negative.
2017-06-14 09:51:54 +09:00
Josh Matthews
27ae1ef2e7
Thread ParseError return values through CSS parsing.
2017-06-09 16:46:25 -04:00
Anthony Ramine
c8c6f3482f
Implement ToCss for str and String
2017-06-08 11:13:39 +02:00
Anthony Ramine
45e8b0e8c7
Support unit variants when deriving ToCss
2017-06-07 16:47:59 +02:00
bors-servo
0b3fd8de76
Auto merge of #16067 - Wafflespeanut:grid, r=nox,Wafflespeanut
...
Stylo: Add support for grid-template-{rows,columns}
This has the implementation of grid's `<track-list>` nightmare.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15311
<!-- Either: -->
- [x] There are tests for these changes
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/16067 )
<!-- Reviewable:end -->
2017-05-18 17:09:15 -05:00
Ravi Shankar
81b4e64dfc
Add parsing/serialization for repeat() function
2017-05-18 21:56:38 +05:30
Anthony Ramine
d0b9bd9c64
Refactor how calc() clamping is done on computed values ( fixes #15296 )
2017-05-18 10:14:59 +02:00
Cameron McCormack
10f2d3c38e
style: Add support for property value aliases.
...
For keyword-typed properties with aliases but no extra_specified values,
the storage of the specified and computed values could be the same,
since value aliases are resolved at parse time. But to prevent
computed_value::T::parse from recognizing these aliases, we keep the
specified and computed value types distinct.
2017-04-17 11:24:21 +10:00
Anthony Ramine
dfbd89860a
Don't reject out of bound calc() values at parsing-time
...
https://bugzilla.mozilla.org/show_bug.cgi?id=1355014
2017-04-12 14:07:38 +02:00
Anthony Ramine
12d46e7d01
Rename AllowedNumericType to AllowedLengthType
2017-04-12 13:58:38 +02:00
Pyfisch
480f59c880
Implement serialization for transform functions.
...
Preserve more information from transform function parsing.
Preserve angle unit while parsing.
Simplify SpecifiedMatrix.
Use the write! macro for formatting with a helper called Css.
Implement ToCss for &T if T implements ToCss.
Add some tests and update others.
closes #15194
2017-04-04 19:04:19 +02:00
Emilio Cobos Álvarez
a5436e9091
style: Add <keyword>::from_ident helper to avoid tokenizing the same value multiple times.
2017-03-26 18:12:02 +02:00
Simon Sapin
0f2d000a23
Borrow input to match_ignore_ascii_case!
...
In cssparser version 0.11, this macro will stop implicitly borrowing its
own input.
2017-02-26 10:40:09 +01:00
Anthony Ramine
8a8ee2888c
Remove rustc-serialize from style and style_traits
2017-02-23 21:47:23 +01:00
Simon Sapin
c3cad2d6c7
Update cssparser to 0.9
2017-02-15 12:42:14 +01:00
Nazım Can Altınova
78afe2b8d1
Box larger specified values to avoid memmove impact
2017-02-09 11:10:08 +01:00
Simon Sapin
9ec8418d8c
Rename CommaSeparated to OneOrMoreCommaSeparated, reflecting its behavior.
2017-02-03 13:15:53 +01:00
Simon Sapin
4bcae573b3
Macroize @font-face descriptor definitions
2017-02-02 18:32:02 +01:00
Emilio Cobos Álvarez
82b6825a86
style: Document style_traits and deny missing docs on it.
2016-12-31 12:17:07 +01:00
Emilio Cobos Álvarez
277ef70d39
style: Consistently indent stuff, add a bit of documentation driving by.
2016-12-31 12:16:57 +01:00
bors-servo
eb36ab82c0
Auto merge of #14135 - frewsxcv:code-like, r=Ms2ger
...
Indicate items in doc comments as code-like.
<!-- 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/14135 )
<!-- Reviewable:end -->
2016-11-14 06:59:35 -06:00
Emilio Cobos Álvarez
5f2e7af864
style: Centralize specified url value handling, and refcount urls.
2016-11-10 13:15:21 +01:00
Corey Farwell
531289ebb7
Indicate items in doc comments as code-like.
2016-11-08 09:33:03 -05:00
Ravi Shankar
6061985898
Prefer Servo-specific ToCss for all types
2016-11-07 09:14:22 +05:30
Ravi Shankar
5dbc8d02c9
Move Servo-specific ToCss to style_traits
2016-11-07 00:00:28 +05:30
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
2617d15ed6
style: Properly track whether negative values of calc() are allowed
...
In order to clamp them at computed value time.
2016-08-30 19:17:16 -07:00
Simon Sapin
3822bb269c
Change style_traits to a single "servo" Cargo feature
...
... instead of fine-grained heap_size and serde-serialization ones.
2016-06-22 15:48:52 +02:00
Simon Sapin
ea73c8efac
Make it possible to build the style_traits crate with a stable compiler.
...
Testing this on CI to make sure we don’t regress it is blocked on #11806
2016-06-22 15:40:53 +02:00
Simon Sapin
6fd46b5e6a
Update cssparser.
...
https://github.com/servo/rust-cssparser/pull/91
2016-01-21 17:58:03 +01:00
João Oliveira
4a305d1e62
Add style_traits crate to improve crate separation,
...
closes #7353
2015-09-04 12:59:37 +01:00