Ignore non-margin properties in @page rule

Extend Servo's @page parsing to match Gecko's CSS 2.2 behavior, where only
margin properties are allowed in an @page rule.  Other properties are ignored.

MozReview-Commit-ID: IPYUlnkLYSb
This commit is contained in:
J. Ryan Stinnett 2017-04-04 11:41:49 -05:00
parent f0e849cbd8
commit 981571f4f8
10 changed files with 47 additions and 20 deletions

View file

@ -9,6 +9,7 @@ use parser::ParserContext;
use properties::{PropertyId, ParsedDeclaration};
use std::fmt;
use style_traits::ToCss;
use stylesheets::CssRuleType;
#[derive(Debug)]
/// An @supports condition
@ -211,7 +212,7 @@ impl Declaration {
return false
};
let mut input = Parser::new(&self.val);
let res = ParsedDeclaration::parse(id, cx, &mut input, /* in_keyframe */ false);
let res = ParsedDeclaration::parse(id, cx, &mut input, /* in_keyframe */ false, CssRuleType::Style);
let _ = input.try(parse_important);
res.is_ok() && input.is_exhausted()
}