mirror of
https://github.com/servo/servo.git
synced 2025-08-17 03:15:34 +01:00
Urlmageddon: Use refcounted urls more often.
This commit is contained in:
parent
f14e7339b5
commit
913c874cb5
161 changed files with 1044 additions and 718 deletions
|
@ -6,13 +6,13 @@ use cssparser::{DeclarationListParser, parse_important};
|
|||
use cssparser::{Parser, AtRuleParser, DeclarationParser, Delimiter};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use parser::{ParserContext, ParserContextExtraData, log_css_error};
|
||||
use servo_url::ServoUrl;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::boxed::Box as StdBox;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use stylesheets::Origin;
|
||||
use super::*;
|
||||
use url::Url;
|
||||
|
||||
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -423,14 +423,19 @@ pub fn append_serialization<'a, W, I>(dest: &mut W,
|
|||
write!(dest, ";")
|
||||
}
|
||||
|
||||
pub fn parse_style_attribute(input: &str, base_url: &Url, error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||
pub fn parse_style_attribute(input: &str,
|
||||
base_url: &ServoUrl,
|
||||
error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||
extra_data: ParserContextExtraData)
|
||||
-> PropertyDeclarationBlock {
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author, base_url, error_reporter, extra_data);
|
||||
parse_property_declaration_list(&context, &mut Parser::new(input))
|
||||
}
|
||||
|
||||
pub fn parse_one_declaration(name: &str, input: &str, base_url: &Url, error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||
pub fn parse_one_declaration(name: &str,
|
||||
input: &str,
|
||||
base_url: &ServoUrl,
|
||||
error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||
extra_data: ParserContextExtraData)
|
||||
-> Result<Vec<PropertyDeclaration>, ()> {
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author, base_url, error_reporter, extra_data);
|
||||
|
|
|
@ -21,7 +21,6 @@ use app_units::Au;
|
|||
#[cfg(feature = "servo")] use cssparser::{Color as CSSParserColor, RGBA};
|
||||
use cssparser::{Parser, TokenSerializationType};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use url::Url;
|
||||
#[cfg(feature = "servo")] use euclid::side_offsets::SideOffsets2D;
|
||||
use euclid::size::Size2D;
|
||||
use computed_values;
|
||||
|
@ -29,6 +28,7 @@ use font_metrics::FontMetricsProvider;
|
|||
#[cfg(feature = "servo")] use logical_geometry::{LogicalMargin, PhysicalSide};
|
||||
use logical_geometry::WritingMode;
|
||||
use parser::{Parse, ParserContext, ParserContextExtraData};
|
||||
use servo_url::ServoUrl;
|
||||
use style_traits::ToCss;
|
||||
use stylesheets::Origin;
|
||||
#[cfg(feature = "servo")] use values::Either;
|
||||
|
@ -221,7 +221,7 @@ mod property_bit_field {
|
|||
fn substitute_variables_${property.ident}_slow<F>(
|
||||
css: &String,
|
||||
first_token_type: TokenSerializationType,
|
||||
base_url: &Url,
|
||||
base_url: &ServoUrl,
|
||||
from_shorthand: Option<Shorthand>,
|
||||
custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>,
|
||||
f: F,
|
||||
|
@ -474,7 +474,7 @@ pub enum DeclaredValue<T> {
|
|||
WithVariables {
|
||||
css: String,
|
||||
first_token_type: TokenSerializationType,
|
||||
base_url: Url,
|
||||
base_url: ServoUrl,
|
||||
from_shorthand: Option<Shorthand>,
|
||||
},
|
||||
Initial,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue