style: Don't look at the rule type from value parsing.

This would cause properties to change the value semantics between, e.g.,
@keyframes and non-@keyframes, which would be observable.

It happens not to be observable since the animation-* and transition-*
properties are not allowed in @keyframes, nor have bits in `contain`, and none
of the two properties are allowed in @page. But I think it's the right thing to
do.

This still causes a quirk like a property value in chrome / user origins being
potentially different if the value is specified via CSS var functions. But I
think that is fine.

Bug: 1466136
Reviewed-by: hiro
MozReview-Commit-ID: GhoPt0I34oO
This commit is contained in:
Emilio Cobos Álvarez 2018-06-01 17:11:00 +02:00
parent 710184b670
commit f829300751
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 43 additions and 4 deletions

View file

@ -465,7 +465,7 @@ fn change_bits_for_longhand(longhand: LonghandId) -> WillChangeBits {
}
fn change_bits_for_maybe_property(ident: &str, context: &ParserContext) -> WillChangeBits {
let id = match PropertyId::parse(ident, context) {
let id = match PropertyId::parse_ignoring_rule_type(ident, context) {
Ok(id) => id,
Err(..) => return WillChangeBits::empty(),
};
@ -777,7 +777,7 @@ impl Parse for TransitionProperty {
let location = input.current_source_location();
let ident = input.expect_ident()?;
let id = match PropertyId::parse(&ident, context) {
let id = match PropertyId::parse_ignoring_rule_type(&ident, context) {
Ok(id) => id,
Err(..) => return Ok(TransitionProperty::Unsupported(
CustomIdent::from_ident(location, ident, &["none"])?,