style: Allow parsing unitless zero angles in hue-rotate().

Per https://github.com/w3c/fxtf-drafts/issues/228
This commit is contained in:
Emilio Cobos Álvarez 2017-12-02 15:21:40 +01:00
parent 25ae329156
commit 55439e6222
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 5 additions and 7 deletions

View file

@ -205,7 +205,11 @@ impl Parse for Filter {
// https://drafts.fxtf.org/filter-effects/#funcdef-filter-grayscale
Ok(GenericFilter::Grayscale(Factor::parse_with_clamping_to_one(context, i)?))
},
"hue-rotate" => Ok(GenericFilter::HueRotate(Angle::parse(context, i)?)),
"hue-rotate" => {
// We allow unitless zero here, see:
// https://github.com/w3c/fxtf-drafts/issues/228
Ok(GenericFilter::HueRotate(Angle::parse_with_unitless(context, i)?))
},
"invert" => {
// Values of amount over 100% are allowed but UAs must clamp the values to 1.
// https://drafts.fxtf.org/filter-effects/#funcdef-filter-invert