aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r--components/script/dom/macros.rs27
1 files changed, 14 insertions, 13 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index 62a4394bc87..454f1a678f8 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -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>();
@@ -106,6 +106,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 ) => (
fn $attr(&self) -> DOMString {
@@ -172,18 +185,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) => (
fn $attr(&self, value: u32) {