mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Fix Servo build.
This commit is contained in:
parent
856886c40d
commit
1505eaaade
3 changed files with 4 additions and 54 deletions
|
@ -111,6 +111,7 @@ ${helpers.predefined_type(
|
|||
vector=False,
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_FIRST_LETTER",
|
||||
boxed=product == "servo",
|
||||
)}
|
||||
|
||||
${helpers.predefined_type(
|
||||
|
|
|
@ -23,6 +23,9 @@ use values::computed::{Context, ToComputedValue};
|
|||
///
|
||||
/// However, this approach is still not necessarily optimal: See
|
||||
/// <https://bugzilla.mozilla.org/show_bug.cgi?id=1347435#c6>
|
||||
///
|
||||
/// TODO(emilio): This should be shrunk by making CssUrl a wrapper type of an
|
||||
/// arc, and keep the serialization in that Arc. See gecko/url.rs for example.
|
||||
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize, SpecifiedValueInfo)]
|
||||
pub struct CssUrl {
|
||||
/// The original URI. This might be optional since we may insert computed
|
||||
|
|
|
@ -611,60 +611,6 @@ mod shorthand_serialization {
|
|||
}
|
||||
}
|
||||
|
||||
mod transform {
|
||||
pub use super::*;
|
||||
use style::values::generics::transform::TransformOperation;
|
||||
use style::values::specified::{Angle, Number};
|
||||
use style::values::specified::transform::TransformOperation as SpecifiedOperation;
|
||||
|
||||
#[test]
|
||||
fn should_serialize_none_correctly() {
|
||||
use style::properties::longhands::transform;
|
||||
|
||||
assert_roundtrip_with_context!(transform::parse, "none");
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn validate_serialization(op: &SpecifiedOperation, expected_string: &'static str) {
|
||||
let css_string = op.to_css_string();
|
||||
assert_eq!(css_string, expected_string);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transform_scale() {
|
||||
validate_serialization(&TransformOperation::Scale(Number::new(1.3), None), "scale(1.3)");
|
||||
validate_serialization(
|
||||
&TransformOperation::Scale(Number::new(2.0), Some(Number::new(2.0))),
|
||||
"scale(2, 2)");
|
||||
validate_serialization(&TransformOperation::ScaleX(Number::new(42.0)), "scaleX(42)");
|
||||
validate_serialization(&TransformOperation::ScaleY(Number::new(0.3)), "scaleY(0.3)");
|
||||
validate_serialization(&TransformOperation::ScaleZ(Number::new(1.0)), "scaleZ(1)");
|
||||
validate_serialization(
|
||||
&TransformOperation::Scale3D(Number::new(4.0), Number::new(5.0), Number::new(6.0)),
|
||||
"scale3d(4, 5, 6)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transform_skew() {
|
||||
validate_serialization(
|
||||
&TransformOperation::Skew(Angle::from_degrees(42.3, false), None),
|
||||
"skew(42.3deg)");
|
||||
validate_serialization(
|
||||
&TransformOperation::Skew(Angle::from_gradians(-50.0, false), Some(Angle::from_turns(0.73, false))),
|
||||
"skew(-50grad, 0.73turn)");
|
||||
validate_serialization(
|
||||
&TransformOperation::SkewX(Angle::from_radians(0.31, false)), "skewX(0.31rad)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transform_rotate() {
|
||||
validate_serialization(
|
||||
&TransformOperation::Rotate(Angle::from_turns(35.0, false)),
|
||||
"rotate(35turn)"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
mod quotes {
|
||||
pub use super::*;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue