mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
826352ab4c
commit
605c679fee
11 changed files with 75 additions and 47 deletions
|
@ -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);
|
||||
}
|
||||
);
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue