aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlanchorelement.rs
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2015-02-28 17:10:44 +0800
committerKeith Yeung <kungfukeith11@gmail.com>2015-03-02 12:54:50 +0800
commit83f56ed0610bd1fc3494b4f9e78866ef583be6dc (patch)
tree322adb99c53b803a5e39e76c73fae33d1b4b7cee /components/script/dom/htmlanchorelement.rs
parent521f60ec0d6dcfecbdacc59d50164c34a2991f54 (diff)
downloadservo-83f56ed0610bd1fc3494b4f9e78866ef583be6dc.tar.gz
servo-83f56ed0610bd1fc3494b4f9e78866ef583be6dc.zip
Implementation of step 1 activation behavior of htmlanchorelement (fixes #4871)
Fixed issues
Diffstat (limited to 'components/script/dom/htmlanchorelement.rs')
-rw-r--r--components/script/dom/htmlanchorelement.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs
index 8d427528aba..0856aae3c80 100644
--- a/components/script/dom/htmlanchorelement.rs
+++ b/components/script/dom/htmlanchorelement.rs
@@ -113,7 +113,11 @@ impl<'a> Activatable for JSRef<'a, HTMLAnchorElement> {
//https://html.spec.whatwg.org/multipage/semantics.html#the-a-element:activation-behaviour
fn activation_behavior(&self) {
- //TODO: Step 1. If the node document is not fully active, abort.
+ //Step 1. If the node document is not fully active, abort.
+ let doc = document_from_node(*self).root();
+ if !doc.r().is_fully_active() {
+ return;
+ }
//TODO: Step 2. Check if browsing context is specified and act accordingly.
//TODO: Step 3. Handle <img ismap/>.
//TODO: Step 4. Download the link is `download` attribute is set.
@@ -123,7 +127,6 @@ impl<'a> Activatable for JSRef<'a, HTMLAnchorElement> {
Some(ref href) => {
let value = href.r().Value();
debug!("clicked on link to {}", value);
- let doc = document_from_node(*self).root();
doc.r().load_anchor_href(value);
}
None => ()