mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #19915 - emilio:color-errors-whee, r=jdm
stylo: Fix missing null terminator in error reporting code. This was causing the patch in bug 1420026 to fail. <!-- 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/19915) <!-- Reviewable:end -->
This commit is contained in:
commit
4bd0590117
2 changed files with 4 additions and 2 deletions
|
@ -13,6 +13,7 @@ use style_traits::ParseError;
|
||||||
use stylesheets::UrlExtraData;
|
use stylesheets::UrlExtraData;
|
||||||
|
|
||||||
/// Errors that can be encountered while parsing CSS.
|
/// Errors that can be encountered while parsing CSS.
|
||||||
|
#[derive(Debug)]
|
||||||
pub enum ContextualParseError<'a> {
|
pub enum ContextualParseError<'a> {
|
||||||
/// A property declaration was not recognized.
|
/// A property declaration was not recognized.
|
||||||
UnsupportedPropertyDeclaration(&'a str, ParseError<'a>),
|
UnsupportedPropertyDeclaration(&'a str, ParseError<'a>),
|
||||||
|
|
|
@ -66,6 +66,7 @@ impl<'a> ErrorString<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
enum Action {
|
enum Action {
|
||||||
Nothing,
|
Nothing,
|
||||||
Skip,
|
Skip,
|
||||||
|
@ -370,14 +371,14 @@ impl<'a> ErrorHelpers<'a> for ContextualParseError<'a> {
|
||||||
StyleParseErrorKind::ValueError(
|
StyleParseErrorKind::ValueError(
|
||||||
ValueParseErrorKind::InvalidColor(..)
|
ValueParseErrorKind::InvalidColor(..)
|
||||||
)
|
)
|
||||||
) => (b"PEColorNotColor", Action::Nothing),
|
) => (b"PEColorNotColor\0", Action::Nothing),
|
||||||
_ => {
|
_ => {
|
||||||
// Not the best error message, since we weren't parsing
|
// Not the best error message, since we weren't parsing
|
||||||
// a declaration, just a value. But we don't produce
|
// a declaration, just a value. But we don't produce
|
||||||
// UnsupportedValue errors other than InvalidColors
|
// UnsupportedValue errors other than InvalidColors
|
||||||
// currently.
|
// currently.
|
||||||
debug_assert!(false, "should use a more specific error message");
|
debug_assert!(false, "should use a more specific error message");
|
||||||
(b"PEDeclDropped", Action::Nothing)
|
(b"PEDeclDropped\0", Action::Nothing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue