Commit graph

41 commits

Author SHA1 Message Date
Anthony Ramine
4d0bf2ddf9 Opt into field bounds for #[derive(ToComputedValue)] 2018-03-09 18:54:59 +01:00
Anthony Ramine
2efd06c12d Remove #[compute(clone)] 2018-03-09 15:45:34 +01:00
Anthony Ramine
9f631fd886 Don't derive Animate for Transform<T>
There is a custom implementation already in animated_properties.
2018-03-09 11:57:21 +01:00
Anthony Ramine
91e12563eb Derive ToCss for Transform<T>
Now that #[derive(ToCss)] unconditionally bounds type params, we can derive
the trait for Transform<T>.
2018-03-08 16:35:12 +01:00
Anthony Ramine
859002a81f Opt into field bounds when deriving ToCss, instead of opting out 2018-03-08 16:33:19 +01:00
Emilio Cobos Álvarez
0d7dae1f85
style: Derive ToCss for TimingFunction. 2018-03-08 10:28:11 +01:00
Emilio Cobos Álvarez
7473796aba
style: Unship the legacy syntax for -moz-transform.
Intent to unship link:

  https://groups.google.com/d/msg/mozilla.dev.platform/T3PGm97MPNU/59XUavMlCgAJ

Reviewed-by: xidorn
Bug: 1438297
MozReview-Commit-ID: 6ybGBasPAWU
2018-02-19 10:46:14 +01:00
Anthony Ramine
335cb4c9f4 Whitelist Copy types when generating PropertyDeclaration 2018-02-07 22:49:15 +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
1f8777bb0b Move TransformStyle out of Mako files 2018-02-01 12:40:36 +01:00
CJ Ku
8a4661b829 Implement Animate trait for individual transforms 2018-01-31 22:15:31 +00:00
CJ Ku
174f5f7128 Implement scale property styling 2018-01-31 22:12:34 +00:00
CJ Ku
de3e8c9a8b Implement translate property styling 2018-01-31 22:12:33 +00:00
CJ Ku
62c0c6feee Implement rotate property styling 2018-01-31 22:12:26 +00:00
Anthony Ramine
42c8dc983f Derive ToCss for TransformOperation
Now that SequenceWriter<W> does not monomorphise excessively, we can actually
type check a derived ToCss without too much type recursion.
2018-01-23 11:02:34 +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
Simon Sapin
e17697fb0e Update euclid, azure, skia, offscreen_gl_context, plane-split, webrender 2017-12-08 14:32:28 +01:00
Boris Chiou
3a38e815ec Implement Servo_ParseTransformIntoMatrix.
DOMMatrix needs to convert a specified transform list into a matrix, so
we could rewrite to_transform_3d_matrix by generics for both specified
and computed transform lists.

Besides, we have to update the test case because we use Transform3D<f64> to
compute the matrix, instead of Transform3D<f32>, so the result will be
the same as that in Gecko. Using 0.3 may cause floating point issue
because (0.3f32 as f64) is not equal to 0.3 (i.e. floating point precision
issue), so using 0.25 instead.
2017-11-28 10:08:12 +08:00
Xidorn Quan
8b9bbfea75 Use helpers.predefined_type for transform property. 2017-11-12 10:59:53 -08:00
Gecko Backout
2c1b041fc6 Backed out changeset d77275db6419 (bug 1374178) for failure reftests/transform-3d/translatez-1a.html r=backout a=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/19106
2017-11-07 06:49:27 +00:00
Xidorn Quan
79fb584eac Use helpers.predefined_type for transform property. 2017-11-06 11:49:50 -08:00
Manish Goregaokar
1c12e0ebc6
Rustfmt the new files 2017-11-02 14:30:16 -07:00
Manish Goregaokar
9c9a181f35
Allow cross interpolation between differing translate/scale functions
See ToPrimitive() in StyleAnimationValue.cpp
2017-11-02 14:30:11 -07:00
Manish Goregaokar
aba00be52d
Add more operations to animation 2017-11-02 14:30:09 -07:00
Manish Goregaokar
6631594e28
Replace old transform code with new generic code 2017-11-02 14:30:04 -07:00
Manish Goregaokar
5031d14d1b
Use a generic Matrix3D type 2017-11-02 14:30:01 -07:00
Manish Goregaokar
544989819d
Add parsing support for transform 2017-11-02 14:30:00 -07:00
Manish Goregaokar
dcefcc3c22
Add ToComputedValue and ToCss impls 2017-11-02 14:29:58 -07:00
Manish Goregaokar
337d48aa61
Add generic struct for transform 2017-11-02 14:29:57 -07: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
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
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
5ffa523ccd Don't use Point2D<f32> for cubic curves anymore 2017-07-19 10:19:41 +02:00
Anthony Ramine
118291ca91 Introduce Matrix for matrix() transformations 2017-07-11 15:58:04 +02:00
Anthony Ramine
874885e235 Use generics for transition-timing-function 📈 2017-06-05 16:49:55 +02:00
Anthony Ramine
c4f1d647a0 Derive the most trivial ToCss implementations 🌋
For now, all variants get serialised as the space-separated serialisations
of their fields. Unit variants are not supported.
2017-06-04 16:17:56 +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