diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-07-03 13:31:00 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-07-03 13:31:00 +0200 |
commit | 9f52ab11aa4beefa072de95ab612b7fe67c56631 (patch) | |
tree | 9d5ea47b2bd7c69ab01543c2f476c986b6a7e342 | |
parent | 59ea4dbd212c0dc7fd36f5cee3a9d278138503ae (diff) | |
download | servo-9f52ab11aa4beefa072de95ab612b7fe67c56631.tar.gz servo-9f52ab11aa4beefa072de95ab612b7fe67c56631.zip |
Simplify the string handling in HTMLAnchorElement::activation_behavior.
-rw-r--r-- | components/script/dom/htmlanchorelement.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 8fc76ced75f..9f1f57a0baf 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -141,14 +141,13 @@ impl<'a> Activatable for &'a HTMLAnchorElement { //TODO: Step 4. Download the link is `download` attribute is set. - let attr = element.get_attribute(&ns!(""), &atom!("href")); - match attr { - Some(ref href) => { - let value = href.r().Value() + ismap_suffix.as_ref().map(|s| &**s).unwrap_or(""); - debug!("clicked on link to {}", value); - doc.r().load_anchor_href(value); + if let Some(ref href) = element.get_attribute(&ns!(""), &atom!("href")) { + let mut value = href.r().Value(); + if let Some(suffix) = ismap_suffix { + value.push_str(&suffix); } - None => () + debug!("clicked on link to {}", value); + doc.r().load_anchor_href(value); } } |