-
-
Save GauriGNaik/d3d035114b0b855e574d to your computer and use it in GitHub Desktop.
Changes to layout_task.rs and window.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use cssparser::{Parser, SourcePosition}; | |
struct CSSErrorReporter { | |
} | |
impl ParseErrorReporter for CSSErrorReporter { | |
fn report_error(&self, input: &mut Parser, position: SourcePosition, message: &str) { | |
if log_enabled!(log::LogLevel::Info) { | |
let location = input.source_location(position); | |
// TODO eventually this will got into a "web console" or something. | |
info!("{}:{} {}", location.line, location.column, message) | |
} | |
} | |
fn clone(&self) -> Box<ParseErrorReporter + Send> { | |
let error_reporter=Box::new(CSSErrorReporter); | |
return error_reporter; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use layout_task::CSSErrorReporter; | |
pub fn css_error_reporter(&self) -> Box<ParseErrorReporter+Send> { | |
let error_reporter = Box::new(CSSErrorReporter); | |
return error_reporter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment