mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Percentage values of translate are serialized as percent for computed values.
Basically, we rewrite the type of generics::transform::Translate and its ToCss to match the spec. Besides, we always serialize Translate by servo, so we could drop a lot of duplicated code. Differential Revision: https://phabricator.services.mozilla.com/D11206
This commit is contained in:
parent
d9453bc0ea
commit
c6ead1dc0e
7 changed files with 127 additions and 34 deletions
|
@ -334,7 +334,6 @@ impl Translate {
|
|||
pub fn to_transform_operation(&self) -> Option<TransformOperation> {
|
||||
match *self {
|
||||
generic::Translate::None => None,
|
||||
generic::Translate::TranslateX(tx) => Some(generic::TransformOperation::TranslateX(tx)),
|
||||
generic::Translate::Translate(tx, ty) => {
|
||||
Some(generic::TransformOperation::Translate(tx, Some(ty)))
|
||||
},
|
||||
|
@ -347,7 +346,6 @@ impl Translate {
|
|||
/// Convert Translate to TransformOperation.
|
||||
pub fn from_transform_operation(operation: &TransformOperation) -> Translate {
|
||||
match *operation {
|
||||
generic::TransformOperation::TranslateX(tx) => generic::Translate::TranslateX(tx),
|
||||
generic::TransformOperation::Translate(tx, Some(ty)) => {
|
||||
generic::Translate::Translate(tx, ty)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue