Manish Goregaokar
cb9645cd17
Comments and minor fixes
2017-11-02 14:37:54 -07:00
Manish Goregaokar
1c12e0ebc6
Rustfmt the new files
2017-11-02 14:30:16 -07:00
Manish Goregaokar
6415294fd5
Fix unit tests
2017-11-02 14:30:15 -07:00
Manish Goregaokar
f699b8cfb2
Handle animating 2D matrices
2017-11-02 14:30:10 -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
5ce2966bda
Add utilities for converting Transform to euclid types
2017-11-02 14:30:03 -07:00
Manish Goregaokar
2de3464374
Add ToAnimatedZero implementation
2017-11-02 14:30:02 -07:00
Manish Goregaokar
d6525e030a
Add specified and computed variants of Transform/TransformOperation
2017-11-02 14:29:59 -07:00
Gecko Backout
1aa0b20e09
Backed out changeset 616bd23b9896 (bug 1391145) for frequently failing mochitests layout/style/test/test_animations.html and layout/style/test/test_animations_omta.html on Linux x64. r=backout
...
Backs out https://github.com/servo/servo/pull/18492
2017-09-16 13:48:06 +00:00
Manish Goregaokar
a7a5adb71a
stylo: Fix TransformOperation.animate() implementation
2017-09-15 14:36:28 -07:00
Manish Goregaokar
06300999e9
stylo: Preserve the variant of rotate() values in computed transforms
...
MozReview-Commit-ID: Dmw7P21I6FN
2017-09-15 14:36:27 -07:00
Manish Goregaokar
e74d04c040
stylo: Preserve the variant of scale() values in computed transforms
2017-09-15 14:36:25 -07:00
Manish Goregaokar
83e3394904
stylo: Preserve the variant of translate() values in computed transforms
2017-09-13 15:21:26 -07:00
Boris Chiou
ce9f1ed143
Fix extremely small pixel value for transform on Servo.
...
Sometimes, we want to use extremely small pixel value in transform, e.g.
translate(calc(0.001px)), which should be rendered correctly together
with scale(100000). This patch only fixes this case for Servo because
Stylo still uses Au on the Gecko side, even if we pass pixel value into
FFI directly in the previous patch.
2017-09-13 18:10:47 +08:00
Boris Chiou
b89286e8e7
Use CSSPixelLength in LengthOrPercentage{*}.
...
Replace Au with CSSPixelLength in LengthOrPercentage,
LengthOrPercentageOrAuto, and LengthOrPercentageOrNone.
2017-09-13 18:10:46 +08:00
Boris Chiou
535c1e3c6f
Replace Au with CSSPixelLength in CalcLengthOrPercentage.
...
We replace Au with CSSPixelLength for the length part of
computed::CalcLengthOrPercentage. Therefore, it would be easier to use
CSSPixelLength for all other LengthOrPercentage{*} types.
2017-09-13 18:10:39 +08:00
Boris Chiou
a949e2a057
Introduce CSSPixelLength and update NonNegativeLength.
...
First, we define computed::CSSPixelLength which contains a CSSFloat, a
pixel value, and then we replace computed::Length with CSSPixelLength.
Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength,
FontRelativeLength, ViewportPercentageLength, CharacterWidth, and
PhysicalLength is CSSPixelLength.
Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength
with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
2017-09-13 18:05:14 +08:00
Boris Chiou
4580b530a8
Use DirectionVector as an alias of euclid::Vector3D<f32>.
...
Therefore, we can reuse the methods of Vector3D, instead of implementing
similar ones.
2017-08-25 18:25:15 +08:00
Boris Chiou
5c2d8507be
Implement to_transform_3d_matrix for computing distance of mismatched transform lists.
...
We could use this method to convert a TransformList into a Matrix, and
use this matrix for computing distance for Stylo and rendering the transform
for Servo.
This is an equivalent of nsStyleTransformMatrix::ReadTransforms in Gecko.
2017-08-25 18:25:14 +08: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
Anthony Ramine
98bf832169
Move Animatable::get_zero_value to ToAnimatedZero::to_animated_zero
2017-07-19 10:19:44 +02:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages.
2017-07-14 13:43:27 +02:00
Anthony Ramine
608e7f71a2
Make computed types hold Percentage instead of bare CSSFloat
2017-06-15 16:59:03 +02:00
Anthony Ramine
874885e235
Use generics for transition-timing-function 📈
2017-06-05 16:49:55 +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