Simplify the implementation of make_url_or_base_getter.

This commit is contained in:
Ms2ger 2015-05-01 21:22:16 +02:00
parent a3adf6ab75
commit e282b71596

View file

@ -85,12 +85,11 @@ macro_rules! make_url_or_base_getter(
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
let element: JSRef<Element> = ElementCast::from_ref(self); let element: JSRef<Element> = ElementCast::from_ref(self);
let url = element.get_url_attribute(&Atom::from_slice($htmlname)); let url = element.get_url_attribute(&Atom::from_slice($htmlname));
match &*url { if url.is_empty() {
"" => { let window = window_from_node(self).root();
let window = window_from_node(self).root(); window.r().get_url().serialize()
window.r().get_url().serialize() } else {
}, url
_ => url
} }
} }
); );