SVG length parsing mode

SVG allows non-zero lengths to be accepted and assumes they are in px.  This
adds this length parsing mode to Servo.

MozReview-Commit-ID: Kxd3x64r9Ye
This commit is contained in:
J. Ryan Stinnett 2017-04-12 17:40:48 +08:00
parent 0936dd24d0
commit 6069e44f02
18 changed files with 130 additions and 53 deletions

View file

@ -8,7 +8,7 @@
use cssparser::{AtRuleParser, Parser, QualifiedRuleParser, RuleListParser};
use cssparser::{DeclarationListParser, DeclarationParser, parse_one_rule};
use parser::{ParserContext, log_css_error};
use parser::{LengthParsingMode, ParserContext, log_css_error};
use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock, PropertyId};
use properties::{PropertyDeclarationId, LonghandId, ParsedDeclaration};
use properties::LonghandIdSet;
@ -129,7 +129,8 @@ impl Keyframe {
let context = ParserContext::new(parent_stylesheet.origin,
&parent_stylesheet.url_data,
&error_reporter,
Some(CssRuleType::Keyframe));
Some(CssRuleType::Keyframe),
LengthParsingMode::Default);
let mut input = Parser::new(css);
let mut rule_parser = KeyframeListParser {