Auto merge of #18444 - ferjm:bug1384221.alias.errors, r=jdm

stylo: Fix error reporting for invalid values in property alias

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [bug 1384221](https://bugzilla.mozilla.org/show_bug.cgi?id=1384221)
- [X] There are [tests](https://bug1384221.bmoattachments.org/attachment.cgi?id=8906527) for these changes

<!-- 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/18444)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-09-11 12:50:11 -05:00 committed by GitHub
commit d2b689cf2e
4 changed files with 15 additions and 13 deletions

View file

@ -951,7 +951,8 @@ pub fn parse_one_declaration_into<R>(declarations: &mut SourcePropertyDeclaratio
let start_position = parser.position();
let start_location = parser.current_source_location();
parser.parse_entirely(|parser| {
PropertyDeclaration::parse_into(declarations, id, &context, parser)
let name = id.name().into();
PropertyDeclaration::parse_into(declarations, id, name, &context, parser)
.map_err(|e| e.into())
}).map_err(|err| {
let error = ContextualParseError::UnsupportedPropertyDeclaration(
@ -1000,7 +1001,7 @@ impl<'a, 'b, 'i> DeclarationParser<'i> for PropertyDeclarationParser<'a, 'b> {
}
};
input.parse_until_before(Delimiter::Bang, |input| {
PropertyDeclaration::parse_into(self.declarations, id, self.context, input)
PropertyDeclaration::parse_into(self.declarations, id, name, self.context, input)
.map_err(|e| e.into())
})?;
let importance = match input.try(parse_important) {