aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/reporter.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2017-04-18 14:08:05 +1000
committerJosh Matthews <josh@joshmatthews.net>2017-06-09 13:16:32 -0400
commitfd6e54d9e37cb31ad5a1e3a55dfbc91aee0a4e4e (patch)
treed95d0e9a8e34f00c572d1e1042a5457eb8be6bfe /components/script_layout_interface/reporter.rs
parente46aa87b4c126ddd5857fe6a365710076ad427f8 (diff)
downloadservo-fd6e54d9e37cb31ad5a1e3a55dfbc91aee0a4e4e.tar.gz
servo-fd6e54d9e37cb31ad5a1e3a55dfbc91aee0a4e4e.zip
Report CSS parse errors via enum instead of strings.
Diffstat (limited to 'components/script_layout_interface/reporter.rs')
-rw-r--r--components/script_layout_interface/reporter.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/script_layout_interface/reporter.rs b/components/script_layout_interface/reporter.rs
index 12157e646a4..bd321b5223d 100644
--- a/components/script_layout_interface/reporter.rs
+++ b/components/script_layout_interface/reporter.rs
@@ -9,7 +9,7 @@ use msg::constellation_msg::PipelineId;
use script_traits::ConstellationControlMsg;
use servo_url::ServoUrl;
use std::sync::{Mutex, Arc};
-use style::error_reporting::ParseErrorReporter;
+use style::error_reporting::{ParseErrorReporter, ParseError};
#[derive(HeapSizeOf, Clone)]
pub struct CSSErrorReporter {
@@ -22,12 +22,12 @@ pub struct CSSErrorReporter {
}
impl ParseErrorReporter for CSSErrorReporter {
- fn report_error(&self,
- input: &mut Parser,
- position: SourcePosition,
- message: &str,
- url: &ServoUrl,
- line_number_offset: u64) {
+ fn report_error<'a>(&self,
+ input: &mut Parser,
+ position: SourcePosition,
+ error: ParseError<'a>,
+ url: &ServoUrl,
+ line_number_offset: u64) {
let location = input.source_location(position);
let line_offset = location.line + line_number_offset as usize;
if log_enabled!(log::LogLevel::Info) {
@@ -35,7 +35,7 @@ impl ParseErrorReporter for CSSErrorReporter {
url.as_str(),
line_offset,
location.column,
- message)
+ error.to_string())
}
//TODO: report a real filename
@@ -44,6 +44,6 @@ impl ParseErrorReporter for CSSErrorReporter {
"".to_owned(),
location.line,
location.column,
- message.to_owned()));
+ error.to_string()));
}
}