Fix URL attributes

URL attributes should always use AttrValue::Url, and the input should be
resolved against the document's base URL at setting time always.
This commit is contained in:
Anthony Ramine 2017-10-10 16:14:40 +02:00
parent 826352ab4c
commit 605c679fee
11 changed files with 75 additions and 47 deletions

View file

@ -194,11 +194,8 @@ macro_rules! make_url_setter(
fn $attr(&self, value: DOMString) {
use dom::bindings::inheritance::Castable;
use dom::element::Element;
use dom::node::document_from_node;
let value = AttrValue::from_url(document_from_node(self).url(),
value.into());
let element = self.upcast::<Element>();
element.set_attribute(&local_name!($htmlname), value);
element.set_url_attribute(&local_name!($htmlname), value);
}
);
);