mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #19001 - emilio:cleanup-parser-context, r=upsuper
style: Minimal ParserContext cleanup.
This commit is contained in:
commit
2536e1ee98
1 changed files with 16 additions and 13 deletions
|
@ -69,13 +69,13 @@ impl<'a> ParserContext<'a> {
|
||||||
rule_type: Option<CssRuleType>,
|
rule_type: Option<CssRuleType>,
|
||||||
parsing_mode: ParsingMode,
|
parsing_mode: ParsingMode,
|
||||||
quirks_mode: QuirksMode,
|
quirks_mode: QuirksMode,
|
||||||
) -> ParserContext<'a> {
|
) -> Self {
|
||||||
ParserContext {
|
ParserContext {
|
||||||
stylesheet_origin: stylesheet_origin,
|
stylesheet_origin,
|
||||||
url_data: url_data,
|
url_data,
|
||||||
rule_type: rule_type,
|
rule_type,
|
||||||
parsing_mode: parsing_mode,
|
parsing_mode,
|
||||||
quirks_mode: quirks_mode,
|
quirks_mode,
|
||||||
namespaces: None,
|
namespaces: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,8 +85,8 @@ impl<'a> ParserContext<'a> {
|
||||||
url_data: &'a UrlExtraData,
|
url_data: &'a UrlExtraData,
|
||||||
rule_type: Option<CssRuleType>,
|
rule_type: Option<CssRuleType>,
|
||||||
parsing_mode: ParsingMode,
|
parsing_mode: ParsingMode,
|
||||||
quirks_mode: QuirksMode
|
quirks_mode: QuirksMode,
|
||||||
) -> ParserContext<'a> {
|
) -> Self {
|
||||||
Self::new(
|
Self::new(
|
||||||
Origin::Author,
|
Origin::Author,
|
||||||
url_data,
|
url_data,
|
||||||
|
@ -118,11 +118,14 @@ impl<'a> ParserContext<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Record a CSS parse error with this context’s error reporting.
|
/// Record a CSS parse error with this context’s error reporting.
|
||||||
pub fn log_css_error<R>(&self,
|
pub fn log_css_error<R>(
|
||||||
context: &ParserErrorContext<R>,
|
&self,
|
||||||
location: SourceLocation,
|
context: &ParserErrorContext<R>,
|
||||||
error: ContextualParseError)
|
location: SourceLocation,
|
||||||
where R: ParseErrorReporter
|
error: ContextualParseError,
|
||||||
|
)
|
||||||
|
where
|
||||||
|
R: ParseErrorReporter,
|
||||||
{
|
{
|
||||||
let location = SourceLocation {
|
let location = SourceLocation {
|
||||||
line: location.line,
|
line: location.line,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue