mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename MemoryHoleReporter to NullReporter
This commit is contained in:
parent
733820583e
commit
de1fe51dc6
3 changed files with 19 additions and 18 deletions
|
@ -42,3 +42,17 @@ impl ParseErrorReporter for StdoutErrorReporter {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Error reporter which silently forgets errors
|
||||
pub struct NullReporter;
|
||||
|
||||
impl ParseErrorReporter for NullReporter {
|
||||
fn report_error(&self,
|
||||
_: &mut Parser,
|
||||
_: SourcePosition,
|
||||
_: &str,
|
||||
_: &UrlExtraData,
|
||||
_: u64) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
use cssparser::{AtRuleParser, Parser, QualifiedRuleParser, RuleListParser};
|
||||
use cssparser::{DeclarationListParser, DeclarationParser, parse_one_rule};
|
||||
use error_reporting::NullReporter;
|
||||
use parser::{LengthParsingMode, ParserContext, log_css_error};
|
||||
use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock, PropertyId};
|
||||
use properties::{PropertyDeclarationId, LonghandId, ParsedDeclaration};
|
||||
|
@ -18,7 +19,7 @@ use shared_lock::{SharedRwLock, SharedRwLockReadGuard, Locked, ToCssWithGuard};
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style_traits::ToCss;
|
||||
use stylesheets::{CssRuleType, MemoryHoleReporter, Stylesheet, VendorPrefix};
|
||||
use stylesheets::{CssRuleType, Stylesheet, VendorPrefix};
|
||||
|
||||
/// A number from 0 to 1, indicating the percentage of the animation when this
|
||||
/// keyframe should run.
|
||||
|
@ -125,7 +126,7 @@ impl Keyframe {
|
|||
/// Parse a CSS keyframe.
|
||||
pub fn parse(css: &str, parent_stylesheet: &Stylesheet)
|
||||
-> Result<Arc<Locked<Self>>, ()> {
|
||||
let error_reporter = MemoryHoleReporter;
|
||||
let error_reporter = NullReporter;
|
||||
let context = ParserContext::new(parent_stylesheet.origin,
|
||||
&parent_stylesheet.url_data,
|
||||
&error_reporter,
|
||||
|
|
|
@ -10,7 +10,7 @@ use {Atom, Prefix, Namespace};
|
|||
use cssparser::{AtRuleParser, Parser, QualifiedRuleParser};
|
||||
use cssparser::{AtRuleType, RuleListParser, SourcePosition, Token, parse_one_rule};
|
||||
use cssparser::ToCss as ParserToCss;
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use error_reporting::{ParseErrorReporter, NullReporter};
|
||||
#[cfg(feature = "servo")]
|
||||
use font_face::FontFaceRuleData;
|
||||
use font_face::parse_font_face_block;
|
||||
|
@ -321,20 +321,6 @@ pub enum CssRuleType {
|
|||
Viewport = 15,
|
||||
}
|
||||
|
||||
/// Error reporter which silently forgets errors
|
||||
pub struct MemoryHoleReporter;
|
||||
|
||||
impl ParseErrorReporter for MemoryHoleReporter {
|
||||
fn report_error(&self,
|
||||
_: &mut Parser,
|
||||
_: SourcePosition,
|
||||
_: &str,
|
||||
_: &UrlExtraData,
|
||||
_: u64) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
pub enum SingleRuleParseError {
|
||||
Syntax,
|
||||
|
@ -418,7 +404,7 @@ impl CssRule {
|
|||
state: Option<State>,
|
||||
loader: Option<&StylesheetLoader>)
|
||||
-> Result<(Self, State), SingleRuleParseError> {
|
||||
let error_reporter = MemoryHoleReporter;
|
||||
let error_reporter = NullReporter;
|
||||
let mut namespaces = parent_stylesheet.namespaces.write();
|
||||
let context = ParserContext::new(parent_stylesheet.origin,
|
||||
&parent_stylesheet.url_data,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue