Auto merge of #23892 - emilio:enginegeddon, r=SimonSapin

style: Sync changes from mozilla-central.

See individual commits for details.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23892)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-07-30 08:11:07 -04:00 committed by GitHub
commit b3441af80a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 16 deletions

View file

@ -1825,7 +1825,7 @@ fn static_assert() {
for (gecko, servo) in self.gecko.mAnimations.iter_mut().take(input_len as usize).zip(v) { for (gecko, servo) in self.gecko.mAnimations.iter_mut().take(input_len as usize).zip(v) {
let result = match servo { let result = match servo {
% for value in keyword.gecko_values(): % for value in keyword.values_for("gecko"):
Keyword::${to_camel_case(value)} => Keyword::${to_camel_case(value)} =>
structs::${keyword.gecko_constant(value)} ${keyword.maybe_cast(cast_type)}, structs::${keyword.gecko_constant(value)} ${keyword.maybe_cast(cast_type)},
% endfor % endfor
@ -1838,7 +1838,7 @@ fn static_assert() {
-> longhands::animation_${ident}::computed_value::SingleComputedValue { -> longhands::animation_${ident}::computed_value::SingleComputedValue {
use crate::properties::longhands::animation_${ident}::single_value::computed_value::T as Keyword; use crate::properties::longhands::animation_${ident}::single_value::computed_value::T as Keyword;
match self.gecko.mAnimations[index].m${gecko_ffi_name} ${keyword.maybe_cast("u32")} { match self.gecko.mAnimations[index].m${gecko_ffi_name} ${keyword.maybe_cast("u32")} {
% for value in keyword.gecko_values(): % for value in keyword.values_for("gecko"):
structs::${keyword.gecko_constant(value)} => Keyword::${to_camel_case(value)}, structs::${keyword.gecko_constant(value)} => Keyword::${to_camel_case(value)},
% endfor % endfor
% if keyword.gecko_inexhaustive: % if keyword.gecko_inexhaustive:

View file

@ -649,9 +649,10 @@ ${helpers.predefined_type(
// The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102. // The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102.
${helpers.predefined_type( ${helpers.predefined_type(
"shape-image-threshold", "Opacity", "0.0", "shape-image-threshold",
"Opacity",
"0.0",
engines="gecko", engines="gecko",
parse_method="parse_number",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property", spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property",
)} )}

View file

@ -80,7 +80,7 @@ ${helpers.predefined_type(
"overflow-wrap", "overflow-wrap",
"OverflowWrap", "OverflowWrap",
"computed::OverflowWrap::Normal", "computed::OverflowWrap::Normal",
engines="servo-2013 servo-2020", engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented", servo_2020_pref="layout.2020.unimplemented",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap", spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap",

View file

@ -410,17 +410,6 @@ impl Parse for NonNegativeNumberOrPercentage {
)] )]
pub struct Opacity(Number); pub struct Opacity(Number);
impl Opacity {
/// Parse number value only.
#[inline]
pub fn parse_number<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
Number::parse(context, input).map(Opacity)
}
}
impl Parse for Opacity { impl Parse for Opacity {
/// Opacity accepts <number> | <percentage>, so we parse it as NumberOrPercentage, /// Opacity accepts <number> | <percentage>, so we parse it as NumberOrPercentage,
/// and then convert into an Number if it's a Percentage. /// and then convert into an Number if it's a Percentage.