Commit graph

44 commits

Author SHA1 Message Date
Simon Sapin
17ec774a49 Stylo: replace uses of mem::uninitialized with MaybeUninit
MozReview-Commit-ID: KGhYL6DJRaR
2019-07-16 08:03:54 +02:00
Emilio Cobos Álvarez
81f40a57e4 style: Reformat recent style system changes. 2019-05-29 16:14:30 +02:00
Cameron McCormack
3a22bb6c49 style: Add Gecko profiler labels for when the style threads are doing work.
Differential Revision: https://phabricator.services.mozilla.com/D30869
2019-05-29 16:14:06 +02:00
Emilio Cobos Álvarez
a47dcb5707 style: Derive ToResolvedValue.
Differential Revision: https://phabricator.services.mozilla.com/D26783
2019-04-12 12:20:09 +02:00
Cameron McCormack
40248ae5fd style: Add derived ToShmem implementations.
Differential Revision: https://phabricator.services.mozilla.com/D17197
2019-04-12 12:19:52 +02:00
Emilio Cobos Álvarez
01e0f37861 style: Make the will-change bitfield use cbindgen.
Differential Revision: https://phabricator.services.mozilla.com/D23414
2019-03-27 14:29:12 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
chansuke
8dab4d659a
Format style component. 2018-09-09 16:24:45 +02:00
Xidorn Quan
7fe7b2ffb1
style: Add a ValueInfo trait for exposing types needed by devtools.
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.

In my current plan, this new trait will be used in bug 1434130 to expose
values as well.

Bug: 1455576
Reviewed-by: emilio
MozReview-Commit-ID: LI7fy45VkRw
2018-04-29 03:28:34 +02:00
Jonathan Watt
ccbd84886b
Fix error name in comment for try_match_ident_ignore_ascii_case 2018-04-17 13:24:30 +01:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Anthony Ramine
a90e660eac Kill AnimatedValueAsComputed 2018-02-10 16:31:47 +01:00
Anthony Ramine
3d99a4489c Don't use define_css_keyword_enum in style anymore 2018-02-01 12:43:48 +01:00
Anthony Ramine
bac8781cc7 Kill define_numbered_css_keyword_enum 2018-02-01 12:43:28 +01:00
Emilio Cobos Álvarez
e978645a52
style: make the try_match_ident_ignore_ascii_case macro actually return the error.
This allows it to be used as an expression, which I'd like to do very soon.
2018-01-24 16:12:30 +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
a38de8b540 style: Move font-variant-numeric outside of mako 2017-11-18 17:57:22 +08:00
bors-servo
8c332f5dd3 Auto merge of #19220 - CYBAI:font-variant-east-asian-out-of-mako, r=emilio
style: Move font-variant-east-asian outside of mako

This is a sub-PR of #19015
r? emilio

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19216
- [x] These changes do not require tests

<!-- 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/19220)
<!-- Reviewable:end -->
2017-11-15 20:00:48 -06:00
CYBAI
c110c8a131 style: Move font-variant-east-asian outside of mako 2017-11-15 21:27:12 +08:00
Keith Yeung
6f59a45cdc Move text-decoration-line out of mako 2017-11-14 13:13:23 -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
Simon Sapin
c0f8f15f39 Update to cssparser 0.22 (source location in error types) 2017-10-10 13:28:17 +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
5e8ee277fc Do not use CVAS for specified::Attr 2017-09-11 18:41:12 +02:00
Emilio Cobos Álvarez
a4da2220c1
style: Unify the trivial ToComputedValue implementations, and add impls for i32. 2017-09-11 11:22:23 +02:00
Emilio Cobos Álvarez
b9f5388635
style: Use derive for -x-span. 2017-09-11 11:22:20 +02:00
Emilio Cobos Álvarez
c87b485fa6
style: Derive ToComputedValue for keyword types. 2017-09-11 11:22:17 +02:00
Emilio Cobos Álvarez
06c8e0163e
style: Manually expand ComputedValueAsSpecified in the keyword macros. 2017-09-11 11:22:16 +02:00
Emilio Cobos Álvarez
95712d5edf
style: Minor reformatting in macros.rs 2017-09-11 11:22:15 +02:00
Simon Sapin
5d06c9959f Replace some more uses of write! in components/style 2017-09-04 19:01:43 +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
aea0cd7ec7 Introduce values::animated::Animate
This replaces the Animatable trait and merges its three former methods into a single one.
2017-08-22 09:41:01 +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
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
98bf832169 Move Animatable::get_zero_value to ToAnimatedZero::to_animated_zero 2017-07-19 10:19:44 +02:00
Anthony Ramine
9ab0b9b4ac Introduce ToAnimatedValue 🎥 2017-06-29 14:03:15 +02:00
Anthony Ramine
3a2e79274a Derive ToCss for keyword structs 2017-06-17 13:46:33 +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
90bae7f802 Derive HasViewportPercentage 🍷 2017-05-20 14:48:04 +02:00
Anthony Ramine
7d66e65d94 Move some style macros into their own module, used first 2017-05-18 18:16:21 +02:00