mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Fix the silencing of CSS errors in the UA stylesheet.
This commit is contained in:
parent
7ece5f92db
commit
ac2b7c6700
1 changed files with 5 additions and 2 deletions
|
@ -22,7 +22,10 @@ impl<T, I: Iterator<Result<T, SyntaxError>>> Iterator<T> for ErrorLoggerIterator
|
|||
}
|
||||
|
||||
|
||||
local_data_key!(silence_errors: ())
|
||||
// FIXME: go back to `()` instead of `bool` after upgrading Rust
|
||||
// past 898669c4e203ae91e2048fb6c0f8591c867bccc6
|
||||
// Using bool is a work-around for https://github.com/mozilla/rust/issues/13322
|
||||
local_data_key!(silence_errors: bool)
|
||||
|
||||
pub fn log_css_error(location: SourceLocation, message: &str) {
|
||||
// TODO eventually this will got into a "web console" or something.
|
||||
|
@ -33,7 +36,7 @@ pub fn log_css_error(location: SourceLocation, message: &str) {
|
|||
|
||||
|
||||
pub fn with_errors_silenced<T>(f: || -> T) -> T {
|
||||
local_data::set(silence_errors, ());
|
||||
local_data::set(silence_errors, true);
|
||||
let result = f();
|
||||
local_data::pop(silence_errors);
|
||||
result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue