aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/macros.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-01-02 16:32:09 -0800
committerCorey Farwell <coreyf@rwell.org>2016-01-02 16:54:38 -0800
commit1a808219a8e51b8cac8c32a2361a930f24041557 (patch)
tree80c3895ba76e8451f17c79d8ce73715ca608bc84 /components/script/dom/macros.rs
parent9a1fd472ab7b136112bb8668d32ba5b324d35220 (diff)
downloadservo-1a808219a8e51b8cac8c32a2361a930f24041557.tar.gz
servo-1a808219a8e51b8cac8c32a2361a930f24041557.zip
Remove parsed attribute 'background' field on HTMLBodyElement
https://github.com/servo/servo/issues/7863
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r--components/script/dom/macros.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index eb60a2c5798..60ed65860f8 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -153,6 +153,20 @@ 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;
+ use dom::node::document_from_node;
+ let value = AttrValue::from_url(document_from_node(self).url(), value);
+ let element = self.upcast::<Element>();
+ element.set_attribute(&atom!($htmlname), value);
+ }
+ );
+);
+
+#[macro_export]
macro_rules! make_uint_setter(
($attr:ident, $htmlname:tt, $default:expr) => (
fn $attr(&self, value: u32) {