mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Inline Document::load_anchor_href into its only caller.
This commit is contained in:
parent
40b5c4586e
commit
da88e9ad9f
2 changed files with 10 additions and 12 deletions
|
@ -29,6 +29,8 @@ use std::default::Default;
|
|||
use string_cache::Atom;
|
||||
use util::str::DOMString;
|
||||
|
||||
use url::UrlParser;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct HTMLAnchorElement {
|
||||
htmlelement: HTMLElement,
|
||||
|
@ -155,7 +157,13 @@ impl<'a> Activatable for &'a HTMLAnchorElement {
|
|||
value.push_str(&suffix);
|
||||
}
|
||||
debug!("clicked on link to {}", value);
|
||||
doc.r().load_anchor_href(value);
|
||||
|
||||
let window = doc.window();
|
||||
let base_url = window.get_url();
|
||||
let url = UrlParser::new().base_url(&base_url).parse(&value);
|
||||
// FIXME: handle URL parse errors more gracefully.
|
||||
let url = url.unwrap();
|
||||
window.load_url(url);
|
||||
}
|
||||
|
||||
//TODO:https://html.spec.whatwg.org/multipage/#the-a-element
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue