mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Simplify the string handling in HTMLAnchorElement::activation_behavior.
This commit is contained in:
parent
59ea4dbd21
commit
9f52ab11aa
1 changed files with 6 additions and 7 deletions
|
@ -141,15 +141,14 @@ impl<'a> Activatable for &'a HTMLAnchorElement {
|
||||||
|
|
||||||
//TODO: Step 4. Download the link is `download` attribute is set.
|
//TODO: Step 4. Download the link is `download` attribute is set.
|
||||||
|
|
||||||
let attr = element.get_attribute(&ns!(""), &atom!("href"));
|
if let Some(ref href) = element.get_attribute(&ns!(""), &atom!("href")) {
|
||||||
match attr {
|
let mut value = href.r().Value();
|
||||||
Some(ref href) => {
|
if let Some(suffix) = ismap_suffix {
|
||||||
let value = href.r().Value() + ismap_suffix.as_ref().map(|s| &**s).unwrap_or("");
|
value.push_str(&suffix);
|
||||||
|
}
|
||||||
debug!("clicked on link to {}", value);
|
debug!("clicked on link to {}", value);
|
||||||
doc.r().load_anchor_href(value);
|
doc.r().load_anchor_href(value);
|
||||||
}
|
}
|
||||||
None => ()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:https://html.spec.whatwg.org/multipage/#the-a-element
|
//TODO:https://html.spec.whatwg.org/multipage/#the-a-element
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue