Update src/href attributes to be a USVString

The following IDLs have the src/href attributes typed as a DOMString
while in the spec the attribute has been updated to be a USVString:

 - HTMLIFrameElement
 - HTMLImageElement
 - HTMLInputElement
 - HTMLLinkElement
 - HTMLMediaElement
 - HTMLScriptElement
This commit is contained in:
Dan Robertson 2018-12-14 03:59:03 +00:00
parent 1e983d86c0
commit c46508e497
No known key found for this signature in database
GPG key ID: 45C4A652C47E42A5
16 changed files with 127 additions and 73 deletions

View file

@ -96,7 +96,7 @@ macro_rules! make_uint_getter(
#[macro_export]
macro_rules! make_url_getter(
( $attr:ident, $htmlname:tt ) => (
fn $attr(&self) -> DOMString {
fn $attr(&self) -> USVString {
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
@ -105,6 +105,19 @@ macro_rules! make_url_getter(
);
);
#[macro_export]
macro_rules! make_url_setter(
( $attr:ident, $htmlname:tt ) => (
fn $attr(&self, value: USVString) {
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
element.set_string_attribute(&local_name!($htmlname),
DOMString::from(value.0));
}
);
);
#[macro_export]
macro_rules! make_form_action_getter(
( $attr:ident, $htmlname:tt ) => (
@ -171,18 +184,6 @@ macro_rules! make_bool_setter(
);
);
#[macro_export]
macro_rules! make_url_setter(
( $attr:ident, $htmlname:tt ) => (
fn $attr(&self, value: DOMString) {
use dom::bindings::inheritance::Castable;
use dom::element::Element;
let element = self.upcast::<Element>();
element.set_url_attribute(&local_name!($htmlname), value);
}
);
);
#[macro_export]
macro_rules! make_uint_setter(
($attr:ident, $htmlname:tt, $default:expr) => (