Loading servo/components/style/properties/declaration_block.rs +1 −21 Original line number Original line Diff line number Diff line Loading @@ -1328,7 +1328,7 @@ type SmallParseErrorVec<'i> = SmallVec<[(ParseError<'i>, &'i str, Option<Propert #[cold] #[cold] fn report_one_css_error<'i>( fn report_one_css_error<'i>( context: &ParserContext, context: &ParserContext, block: Option<&PropertyDeclarationBlock>, _block: Option<&PropertyDeclarationBlock>, selectors: Option<&SelectorList<SelectorImpl>>, selectors: Option<&SelectorList<SelectorImpl>>, mut error: ParseError<'i>, mut error: ParseError<'i>, slice: &str, slice: &str, Loading @@ -1336,21 +1336,6 @@ fn report_one_css_error<'i>( ) { ) { debug_assert!(context.error_reporting_enabled()); debug_assert!(context.error_reporting_enabled()); fn all_properties_in_block(block: &PropertyDeclarationBlock, property: &PropertyId) -> bool { match *property { PropertyId::LonghandAlias(id, _) | PropertyId::Longhand(id) => block.contains(id), PropertyId::ShorthandAlias(id, _) | PropertyId::Shorthand(id) => { id.longhands().all(|longhand| block.contains(longhand)) }, // NOTE(emilio): We could do this, but it seems of limited utility, // and it's linear on the size of the declaration block, so let's // not. PropertyId::Custom(..) => false, } } // If the unrecognized property looks like a vendor-specific property, // If the unrecognized property looks like a vendor-specific property, // silently ignore it instead of polluting the error output. // silently ignore it instead of polluting the error output. if let ParseErrorKind::Custom(StyleParseErrorKind::UnknownVendorProperty) = error.kind { if let ParseErrorKind::Custom(StyleParseErrorKind::UnknownVendorProperty) = error.kind { Loading @@ -1358,11 +1343,6 @@ fn report_one_css_error<'i>( } } if let Some(ref property) = property { if let Some(ref property) = property { if let Some(block) = block { if all_properties_in_block(block, property) { return; } } error = match *property { error = match *property { PropertyId::Custom(ref c) => StyleParseErrorKind::new_invalid(format!("--{}", c), error), PropertyId::Custom(ref c) => StyleParseErrorKind::new_invalid(format!("--{}", c), error), _ => StyleParseErrorKind::new_invalid(property.non_custom_id().unwrap().name(), error), _ => StyleParseErrorKind::new_invalid(property.non_custom_id().unwrap().name(), error), Loading Loading
servo/components/style/properties/declaration_block.rs +1 −21 Original line number Original line Diff line number Diff line Loading @@ -1328,7 +1328,7 @@ type SmallParseErrorVec<'i> = SmallVec<[(ParseError<'i>, &'i str, Option<Propert #[cold] #[cold] fn report_one_css_error<'i>( fn report_one_css_error<'i>( context: &ParserContext, context: &ParserContext, block: Option<&PropertyDeclarationBlock>, _block: Option<&PropertyDeclarationBlock>, selectors: Option<&SelectorList<SelectorImpl>>, selectors: Option<&SelectorList<SelectorImpl>>, mut error: ParseError<'i>, mut error: ParseError<'i>, slice: &str, slice: &str, Loading @@ -1336,21 +1336,6 @@ fn report_one_css_error<'i>( ) { ) { debug_assert!(context.error_reporting_enabled()); debug_assert!(context.error_reporting_enabled()); fn all_properties_in_block(block: &PropertyDeclarationBlock, property: &PropertyId) -> bool { match *property { PropertyId::LonghandAlias(id, _) | PropertyId::Longhand(id) => block.contains(id), PropertyId::ShorthandAlias(id, _) | PropertyId::Shorthand(id) => { id.longhands().all(|longhand| block.contains(longhand)) }, // NOTE(emilio): We could do this, but it seems of limited utility, // and it's linear on the size of the declaration block, so let's // not. PropertyId::Custom(..) => false, } } // If the unrecognized property looks like a vendor-specific property, // If the unrecognized property looks like a vendor-specific property, // silently ignore it instead of polluting the error output. // silently ignore it instead of polluting the error output. if let ParseErrorKind::Custom(StyleParseErrorKind::UnknownVendorProperty) = error.kind { if let ParseErrorKind::Custom(StyleParseErrorKind::UnknownVendorProperty) = error.kind { Loading @@ -1358,11 +1343,6 @@ fn report_one_css_error<'i>( } } if let Some(ref property) = property { if let Some(ref property) = property { if let Some(block) = block { if all_properties_in_block(block, property) { return; } } error = match *property { error = match *property { PropertyId::Custom(ref c) => StyleParseErrorKind::new_invalid(format!("--{}", c), error), PropertyId::Custom(ref c) => StyleParseErrorKind::new_invalid(format!("--{}", c), error), _ => StyleParseErrorKind::new_invalid(property.non_custom_id().unwrap().name(), error), _ => StyleParseErrorKind::new_invalid(property.non_custom_id().unwrap().name(), error), Loading