mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Simplify the implementation of make_url_or_base_getter.
This commit is contained in:
parent
a3adf6ab75
commit
e282b71596
1 changed files with 5 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue