mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use Url.join instead of UrlParser.base_url(...).parse (#9002)
This commit is contained in:
parent
6764cf0ee9
commit
11234f5370
41 changed files with 58 additions and 64 deletions
|
@ -7,7 +7,7 @@ use cssparser::{Parser, SourcePosition};
|
|||
use msg::ParseErrorReporter;
|
||||
use selectors::parser::ParserContext as SelectorParserContext;
|
||||
use stylesheets::Origin;
|
||||
use url::{Url, UrlParser};
|
||||
use url::Url;
|
||||
|
||||
pub struct ParserContext<'a> {
|
||||
pub stylesheet_origin: Origin,
|
||||
|
@ -33,7 +33,7 @@ impl<'a> ParserContext<'a> {
|
|||
|
||||
impl<'a> ParserContext<'a> {
|
||||
pub fn parse_url(&self, input: &str) -> Url {
|
||||
UrlParser::new().base_url(self.base_url).parse(input)
|
||||
self.base_url.join(input)
|
||||
.unwrap_or_else(|_| url!("about:invalid"))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue