mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Ignore stylesheet links with an empty href.
This commit is contained in:
parent
c69ce9deef
commit
e2f5ce4893
2 changed files with 7 additions and 3 deletions
|
@ -197,12 +197,19 @@ impl VirtualMethods for HTMLLinkElement {
|
|||
|
||||
|
||||
impl HTMLLinkElement {
|
||||
/// https://html.spec.whatwg.org/multipage/#concept-link-obtain
|
||||
fn handle_stylesheet_url(&self, href: &str) {
|
||||
let document = document_from_node(self);
|
||||
if document.browsing_context().is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 1.
|
||||
if href.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 2.
|
||||
let url = match document.base_url().join(href) {
|
||||
Err(e) => return debug!("Parsing url {} failed: {}", href, e),
|
||||
Ok(url) => url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue