mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Remove the url! plugin.
In rust-url 1.0 the `Url` struct is going to have private fields, and there is no way to to create an aribitrary one without going through the parser. The plugin never had a clear demonstrated performance benefit, it was made mostly because it was possible and relatively easy at the time.
This commit is contained in:
parent
87d5424d4d
commit
6889f37d9e
27 changed files with 84 additions and 296 deletions
|
@ -102,7 +102,7 @@ fn parse_one_src(context: &ParserContext, input: &mut Parser) -> Result<Source,
|
|||
}
|
||||
let url = try!(input.expect_url());
|
||||
let url = context.base_url.join(&url).unwrap_or_else(
|
||||
|_error| url!("about:invalid"));
|
||||
|_error| Url::parse("about:invalid").unwrap());
|
||||
|
||||
// Parsing optional format()
|
||||
let format_hints = if input.try(|input| input.expect_function_matching("format")).is_ok() {
|
||||
|
|
|
@ -34,7 +34,7 @@ impl<'a> ParserContext<'a> {
|
|||
impl<'a> ParserContext<'a> {
|
||||
pub fn parse_url(&self, input: &str) -> Url {
|
||||
self.base_url.join(input)
|
||||
.unwrap_or_else(|_| url!("about:invalid"))
|
||||
.unwrap_or_else(|_| Url::parse("about:invalid").unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ lazy_static! {
|
|||
Ok(res) => {
|
||||
Stylesheet::from_bytes(
|
||||
&res,
|
||||
url!("chrome:///quirks-mode.css"),
|
||||
Url::parse("chrome:///quirks-mode.css").unwrap(),
|
||||
None,
|
||||
None,
|
||||
Origin::UserAgent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue