style: Unship the legacy syntax for -moz-transform.

Intent to unship link:

  https://groups.google.com/d/msg/mozilla.dev.platform/T3PGm97MPNU/59XUavMlCgAJ

Reviewed-by: xidorn
Bug: 1438297
MozReview-Commit-ID: 6ybGBasPAWU
This commit is contained in:
Emilio Cobos Álvarez 2018-02-14 21:21:03 +01:00
parent a98da8ce93
commit 7473796aba
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 51 additions and 242 deletions

View file

@ -968,10 +968,7 @@ def set_gecko_property(ffi_name, expr):
<%
transform_functions = [
("Matrix3D", "matrix3d", ["number"] * 16),
("PrefixedMatrix3D", "matrix3d", ["number"] * 12 + ["lopon"] * 2
+ ["lon"] + ["number"]),
("Matrix", "matrix", ["number"] * 6),
("PrefixedMatrix", "matrix", ["number"] * 4 + ["lopon"] * 2),
("Translate", "translate", ["lop", "optional_lop"]),
("Translate3D", "translate3d", ["lop", "lop", "length"]),
("TranslateX", "translatex", ["lop"]),
@ -1027,8 +1024,6 @@ transform_functions = [
# need to cast it to f32.
"integer_to_percentage" : "bindings::Gecko_CSSValue_SetPercentage(%s, %s as f32)",
"lop" : "%s.set_lop(%s)",
"lopon" : "set_lopon(%s, %s)",
"lon" : "set_lon(%s, %s)",
"angle" : "%s.set_angle(%s)",
"number" : "bindings::Gecko_CSSValue_SetNumber(%s, %s)",
# Note: We use nsCSSValueSharedList here, instead of nsCSSValueList_heap
@ -1106,16 +1101,7 @@ transform_functions = [
field_names = ["from_list", "to_list", "count"]
%>
<%
guard = ""
if name == "Matrix3D" or name == "Matrix":
guard = "if !needs_prefix "
elif name == "PrefixedMatrix3D" or name == "PrefixedMatrix":
guard = "if needs_prefix "
%>
structs::nsCSSKeyword::eCSSKeyword_${keyword} ${guard}=> {
structs::nsCSSKeyword::eCSSKeyword_${keyword} => {
::values::generics::transform::TransformOperation::${name}${pre_symbols}
% for index, item in enumerate(items):
% if keyword == "matrix3d":
@ -1149,7 +1135,6 @@ fn set_single_transform_function(
servo_value: &values::computed::TransformOperation,
gecko_value: &mut structs::nsCSSValue /* output */
) {
use values::computed::{Length, LengthOrNumber, LengthOrPercentage, LengthOrPercentageOrNumber};
use values::computed::TransformOperation;
use values::generics::transform::{Matrix, Matrix3D};
@ -1159,22 +1144,6 @@ fn set_single_transform_function(
value
};
unsafe fn set_lopon(css: &mut structs::nsCSSValue, lopon: LengthOrPercentageOrNumber) {
let lop = match lopon {
Either::First(number) => LengthOrPercentage::Length(Length::new(number)),
Either::Second(lop) => lop,
};
css.set_lop(lop);
}
unsafe fn set_lon(css: &mut structs::nsCSSValue, lopon: LengthOrNumber) {
let length = match lopon {
Either::Second(number) => Length::new(number),
Either::First(l) => l,
};
bindings::Gecko_CSSValue_SetPixelLength(css, length.px())
}
unsafe {
match *servo_value {
% for servo, gecko, format in transform_functions:
@ -1228,19 +1197,6 @@ fn clone_single_transform_function(
bindings::Gecko_CSSValue_GetKeyword(bindings::Gecko_CSSValue_GetArrayItemConst(gecko_value, 0))
};
let needs_prefix = if transform_function == structs::nsCSSKeyword::eCSSKeyword_matrix3d {
unsafe {
bindings::Gecko_CSSValue_GetArrayItemConst(gecko_value, 13).mUnit
!= structs::nsCSSUnit::eCSSUnit_Number ||
bindings::Gecko_CSSValue_GetArrayItemConst(gecko_value, 14).mUnit
!= structs::nsCSSUnit::eCSSUnit_Number ||
bindings::Gecko_CSSValue_GetArrayItemConst(gecko_value, 15).mUnit
!= structs::nsCSSUnit::eCSSUnit_Number
}
} else {
false
};
unsafe {
match transform_function {
% for servo, gecko, format in transform_functions: