mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Avoid cloning all over the error reporter.
This commit is contained in:
parent
eaf27ccfa0
commit
b4de69e3eb
36 changed files with 186 additions and 154 deletions
|
@ -11,7 +11,6 @@ use cssparser::{Parser, AtRuleParser, DeclarationParser, Delimiter};
|
|||
use error_reporting::ParseErrorReporter;
|
||||
use parser::{ParserContext, ParserContextExtraData, log_css_error};
|
||||
use servo_url::ServoUrl;
|
||||
use std::boxed::Box as StdBox;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use stylesheets::Origin;
|
||||
|
@ -570,10 +569,13 @@ pub fn append_serialization<'a, W, I, N>(dest: &mut W,
|
|||
/// shared between Servo and Gecko.
|
||||
pub fn parse_style_attribute(input: &str,
|
||||
base_url: &ServoUrl,
|
||||
error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||
error_reporter: &ParseErrorReporter,
|
||||
extra_data: ParserContextExtraData)
|
||||
-> PropertyDeclarationBlock {
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author, base_url, error_reporter, extra_data);
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author,
|
||||
base_url,
|
||||
error_reporter,
|
||||
extra_data);
|
||||
parse_property_declaration_list(&context, &mut Parser::new(input))
|
||||
}
|
||||
|
||||
|
@ -585,10 +587,13 @@ pub fn parse_style_attribute(input: &str,
|
|||
pub fn parse_one_declaration(id: PropertyId,
|
||||
input: &str,
|
||||
base_url: &ServoUrl,
|
||||
error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||
error_reporter: &ParseErrorReporter,
|
||||
extra_data: ParserContextExtraData)
|
||||
-> Result<ParsedDeclaration, ()> {
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author, base_url, error_reporter, extra_data);
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author,
|
||||
base_url,
|
||||
error_reporter,
|
||||
extra_data);
|
||||
Parser::new(input).parse_entirely(|parser| {
|
||||
ParsedDeclaration::parse(id, &context, parser, false)
|
||||
.map_err(|_| ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue