mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Use Serde for rotate, scale, and translate properties.
The only drawback is: we resolve LengthPercentage value before passing translate property through IPC, so its percentage part is redundant. However, this makes us easier to maintain the Rust type. Differential Revision: https://phabricator.services.mozilla.com/D60044
This commit is contained in:
parent
5043695c78
commit
238e9ca2fb
1 changed files with 9 additions and 0 deletions
|
@ -611,8 +611,10 @@ pub fn get_normalized_vector_and_angle<T: Zero>(
|
|||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
Deserialize,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
Serialize,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
|
@ -623,6 +625,7 @@ pub fn get_normalized_vector_and_angle<T: Zero>(
|
|||
/// A value of the `Rotate` property
|
||||
///
|
||||
/// <https://drafts.csswg.org/css-transforms-2/#individual-transforms>
|
||||
/// cbindgen:private-default-tagged-enum-constructor=false
|
||||
pub enum GenericRotate<Number, Angle> {
|
||||
/// 'none'
|
||||
None,
|
||||
|
@ -685,8 +688,10 @@ where
|
|||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
Deserialize,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
Serialize,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
|
@ -697,6 +702,7 @@ where
|
|||
/// A value of the `Scale` property
|
||||
///
|
||||
/// <https://drafts.csswg.org/css-transforms-2/#individual-transforms>
|
||||
/// cbindgen:private-default-tagged-enum-constructor=false
|
||||
pub enum GenericScale<Number> {
|
||||
/// 'none'
|
||||
None,
|
||||
|
@ -749,8 +755,10 @@ fn y_axis_and_z_axis_are_zero<LengthPercentage: Zero, Length: Zero>(
|
|||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
Deserialize,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
Serialize,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
|
@ -772,6 +780,7 @@ fn y_axis_and_z_axis_are_zero<LengthPercentage: Zero, Length: Zero>(
|
|||
/// https://github.com/w3c/csswg-drafts/issues/3305
|
||||
///
|
||||
/// <https://drafts.csswg.org/css-transforms-2/#individual-transforms>
|
||||
/// cbindgen:private-default-tagged-enum-constructor=false
|
||||
pub enum GenericTranslate<LengthPercentage, Length>
|
||||
where
|
||||
LengthPercentage: Zero,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue