mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Bring CSS parse error reporting back. (Still off by default. Enable with RUST_LOG=style
.)
This commit is contained in:
parent
966af0030a
commit
493a9e6a89
6 changed files with 53 additions and 25 deletions
|
@ -9,7 +9,7 @@ use properties::longhands::font_family::parse_one_family;
|
|||
use properties::computed_values::font_family::FontFamily;
|
||||
use media_queries::Device;
|
||||
use url::{Url, UrlParser};
|
||||
use parser::ParserContext;
|
||||
use parser::{ParserContext, log_css_error};
|
||||
|
||||
|
||||
pub fn iter_font_face_rules_inner<F>(rules: &[CSSRule], device: &Device,
|
||||
|
@ -54,9 +54,14 @@ pub fn parse_font_face_block(context: &ParserContext, input: &mut Parser)
|
|||
-> Result<FontFaceRule, ()> {
|
||||
let mut family = None;
|
||||
let mut src = None;
|
||||
for declaration in DeclarationListParser::new(input, FontFaceRuleParser { context: context }) {
|
||||
let mut iter = DeclarationListParser::new(input, FontFaceRuleParser { context: context });
|
||||
while let Some(declaration) = iter.next() {
|
||||
match declaration {
|
||||
Err(()) => {}
|
||||
Err(range) => {
|
||||
let message = format!("Unsupported @font-face descriptor declaration: '{}'",
|
||||
iter.input.slice(range));
|
||||
log_css_error(iter.input, range.start, &*message);
|
||||
}
|
||||
Ok(FontFaceDescriptorDeclaration::Family(value)) => {
|
||||
family = Some(value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue