style: Fix Servo build.

This commit is contained in:
Emilio Cobos Álvarez 2018-10-19 01:15:26 +02:00
parent 856886c40d
commit 1505eaaade
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 4 additions and 54 deletions

View file

@ -111,6 +111,7 @@ ${helpers.predefined_type(
vector=False,
animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER",
boxed=product == "servo",
)}
${helpers.predefined_type(

View file

@ -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

View file

@ -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::*;