mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
1e983d86c0
commit
c46508e497
16 changed files with 127 additions and 73 deletions
|
@ -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) => (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue