Auto merge of #17787 - jdm:invalidvalue, r=SimonSapin

Store COW strings in CSS parser errors when possible.

This should be a straightforward performance improvement in pages with lots of CSS property values that the parser does not understand.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because there's no functional difference.

<!-- 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/17787)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-19 10:08:14 -07:00 committed by GitHub
commit b70cbeb84c
3 changed files with 3 additions and 3 deletions

View file

@ -224,7 +224,7 @@ impl<'a> ErrorHelpers<'a> for ContextualParseError<'a> {
(_, CssParseError::Custom(SelectorParseError::Custom(
StyleParseError::PropertyDeclaration(
PropertyDeclarationParseError::InvalidValue(property))))) =>
ErrorString::Snippet(property.into()),
ErrorString::Snippet(property),
(_, CssParseError::Custom(SelectorParseError::UnexpectedIdent(ident))) =>
ErrorString::Ident(ident),