Commit graph

68 commits

Author SHA1 Message Date
Anthony Ramine
c4efbb4d51 Replace ColorOrAuto by CaretColor
This is its only use.
2018-02-28 10:25:59 +01:00
Anthony Ramine
761689f32d Replace PositiveIntegerOrAuto by ColumnCount
It was its only use.
2018-02-22 10:16:46 +01:00
Jonas Reinwald
d24301b7a0
moved css longhand counter-reset out of mako 2018-02-01 15:43:40 +01:00
bors-servo
dcd13b857c
Auto merge of #19918 - emilio:font-stuff-is-a-mess, r=nox
style: Refactor font-feature-settings and font-variation-settings.

This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1434692
  https://bugzilla.mozilla.org/show_bug.cgi?id=1434724

Also does a fair amount of cleanup and all that, which was needed, this code
was a mess.

There are further cleanups that can be done, like renaming the
font-variation-settings animation stuff.

<!-- 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/19918)
<!-- Reviewable:end -->
2018-02-01 06:45:20 -06:00
Anthony Ramine
3d99a4489c Don't use define_css_keyword_enum in style anymore 2018-02-01 12:43:48 +01:00
Emilio Cobos Álvarez
09398d42af
style: Move a bunch of font stuff living under generics to the proper module.
FontSettingsTagInt and such shouldn't be in the generic module, I know...

But that will change in a bit.
2018-02-01 02:35:33 +01:00
Emilio Cobos Álvarez
1380f1a14f
style: Remove the stupid space serialization on font-settings. 2018-02-01 02:35:32 +01:00
Emilio Cobos Álvarez
190e9b9715
style: Tidy and sprinkle some comments. 2018-02-01 02:35:31 +01:00
Anthony Ramine
cd8f96cc9e Change ToCss to take a CssWriter<W>
This more concrete wrapper type can write a prefix the very first time something
is written to it. This allows removing plenty of useless monomorphisations caused
by the former W/SequenceWriter<W> pair of types.
2018-01-23 10:41:42 +01:00
CYBAI
dcdc384122 Implement normal for FontSettings 2017-11-20 21:38:50 +08:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
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
c0f8f15f39 Update to cssparser 0.22 (source location in error types) 2017-10-10 13:28:17 +02:00
Emilio Cobos Álvarez
f9c06d7932
style: Generalise BorderCornerRadius as Size. 2017-09-17 21:33:14 +02:00
Nicholas Nethercote
c5aa2cb986 Measure PropertyDeclaration more thoroughly.
This patch replaces the handwritten MallocSizeOf implementation for
PropertyDeclaration with a derived one, which gives much more thorough
measurement.

This requires (a) deriving MallocSizeOf for a *lot* of additional types (most
of which already have `derive(HeapSizeOf)` in Servo builds), and (b)
implementing MallocSizeOf for a few more types in the `malloc_size_of` crate.

These changes would significantly improve the reporting coverage for gmail if
it weren't for the fact that SpecifiedUrl isn't measured due to a lack of
clarity about its fields; that can be fixed as a follow-up once bug 1397971 has
landed.
2017-09-14 13:18:03 +10:00
Anthony Ramine
bf034a83e8 Do not use CVAS for FontSettings<T> 2017-09-12 13:39:55 +02:00
Anthony Ramine
0254fd0635 Do not use CVAS for the list-style-type property 2017-09-11 18:41:08 +02:00
Daisuke Akatsuka
653bced7a5 Implement Animate for FontSettings 2017-09-05 16:12:20 +09:00
Simon Sapin
38043a71de Remove some uses of write! in components/style 2017-09-02 10:27:17 +02:00
Anthony Ramine
542a9337a4 Use generics for the vertical-align property 2017-08-30 23:01:12 +02:00
Emilio Cobos Álvarez
36ff89bd28
style: Remove HasViewportPercentage.
It's not needed since #18268
2017-08-29 23:51:21 +02:00
Anthony Ramine
7ee124b1ed Derive the most trivial Animate impls 2017-08-22 19:12:47 +02:00
Anthony Ramine
faaf31411a Derive the most trivial ToAnimatedZero impls 2017-08-22 19:12:42 +02:00
Anthony Ramine
277351da35 Derive ComputeSquaredDistance 2017-08-13 13:34:04 +02:00
Anthony Ramine
51b740033b Introduce ComputeSquaredDistance
This allows us to merge the former Animatable methods compute_distance and
compute_squared_distance, reducing code size.
2017-08-13 00:51:09 +02:00
bors-servo
10c3e2f3ac Auto merge of #17985 - dadaa:make-list-style-type-animatable, r=hiro
Make list-style-type animatable

<!-- Please describe your changes on the following line: -->

---
<!-- 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

<!-- Either: -->
- [X] There are tests for these changes. The test is patch 3 in https://bugzilla.mozilla.org/show_bug.cgi?id=1382137

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17985)
<!-- Reviewable:end -->
2017-08-07 19:06:43 -05:00
Daisuke Akatsuka
3e40d670dd implement conversion method from Gecko CounterStylePtr to CounterStyleOrNone 2017-08-07 13:13:56 +09:00
Boris Chiou
4cc97746f2 Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.
NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink.
GreaterThanOrEqualToOneNumber: for stroke-miterlimit.

MozReview-Commit-ID: Kgbt99BPdVA
2017-08-04 14:21:21 +08:00
Xidorn Quan
0071c7663f Add svg mods and move SVG-related types into them. 2017-08-02 10:03:08 +10: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
dc1e5372da Derive ToCss for SVGPaint
I wonder if there wasn't a bug in the former implementation, given there is no
space written before the fallback value.
2017-07-20 10:30:44 +02:00
Anthony Ramine
1eb51daba6 Derive ToComputedValue for SVGPaint 2017-07-20 10:30:25 +02:00
Mantaroh Yoshinaga
5e35b491bb Support none fallback for Paint server with URL. 2017-07-06 09:01:41 +09:00
Anthony Ramine
9ab0b9b4ac Introduce ToAnimatedValue 🎥 2017-06-29 14:03:15 +02:00
Anthony Ramine
17875b8a81 Introduce Separator::parse 2017-06-27 23:37:44 +02:00
bors-servo
fc2c5b7ef4 Auto merge of #17402 - servo:derive-all-the-things, r=emilio
Use generics for the filter property

<!-- 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/17402)
<!-- Reviewable:end -->
2017-06-20 06:23:17 -07:00
Anthony Ramine
6f4061d4ad Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
2017-06-20 13:48:53 +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
Simon Sapin
a5bb55790f Untry style 2017-06-18 13:18:13 +02:00
Anthony Ramine
bc9bc1d340 Rename LengthOrPercentageOrAutoOrContent to FlexBasis 2017-06-17 13:46:35 +02:00
Anthony Ramine
43a5257a0c Introduce #[css(function)] for #[derive(ToCss)]
Any variant with this attribute gets serialised as a CSS function,
using the variant name as the function name.
2017-06-13 10:19:23 +02:00
Emilio Cobos Álvarez
e3c4d03bde
style: Reduce some code duplication and ugliness when parsing identifiers. 2017-06-11 03:12:02 +02: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
Anthony Ramine
195e98e745 Use generics for scroll-snap-points-* 2017-06-06 19:27:43 +02:00
Manish Goregaokar
74f3284c69 Make SVGPaint generic 2017-06-05 17:05:59 -07:00
Anthony Ramine
5c6987a50d Use generics for the line-height property 2017-06-02 10:21:21 +02:00
Anthony Ramine
5d70580813 Make use of generics for transform-origin
This allows us to preserve keywords during serialisation.
2017-05-31 09:58:07 +02:00
bors-servo
433d68955b Auto merge of #17071 - servo:derive-all-the-things, r=emilio
Reuse Rect<T> some more

<!-- 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/17071)
<!-- Reviewable:end -->
2017-05-30 05:11:28 -05:00