aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-05-01 21:22:16 +0200
committerMs2ger <ms2ger@gmail.com>2015-05-01 21:22:16 +0200
commite282b71596af0bf2dd453c405db55cc1f80f339c (patch)
treebaaf2e63942ed4de260dbf3cf3f1059cc5221cad /components/script/dom
parenta3adf6ab750c1548fb89dc935d7da744d5aea17a (diff)
downloadservo-e282b71596af0bf2dd453c405db55cc1f80f339c.tar.gz
servo-e282b71596af0bf2dd453c405db55cc1f80f339c.zip
Simplify the implementation of make_url_or_base_getter.
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/macros.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index 76157789e71..b3dda8730e0 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -85,12 +85,11 @@ macro_rules! make_url_or_base_getter(
use std::ascii::AsciiExt;
let element: JSRef<Element> = ElementCast::from_ref(self);
let url = element.get_url_attribute(&Atom::from_slice($htmlname));
- match &*url {
- "" => {
- let window = window_from_node(self).root();
- window.r().get_url().serialize()
- },
- _ => url
+ if url.is_empty() {
+ let window = window_from_node(self).root();
+ window.r().get_url().serialize()
+ } else {
+ url
}
}
);