aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/macros.rs
diff options
context:
space:
mode:
authorPatrick Shaughnessy <pshaughn@comcast.net>2020-01-02 15:44:29 -0500
committerPatrick Shaughnessy <pshaughn@comcast.net>2020-01-06 10:39:36 -0500
commit036e8dabe2d38e21348766d1a5cda99381b015f8 (patch)
tree004e033196a208628e84767bd86b5e5c83425932 /components/script/dom/macros.rs
parent0d142bea9ae9b822c0d03d23b00dae23126a92c8 (diff)
downloadservo-036e8dabe2d38e21348766d1a5cda99381b015f8.tar.gz
servo-036e8dabe2d38e21348766d1a5cda99381b015f8.zip
Labels are a live list in tree order
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r--components/script/dom/macros.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index a1941662963..fe578f6f675 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -141,6 +141,21 @@ macro_rules! make_form_action_getter(
);
#[macro_export]
+macro_rules! make_labels_getter(
+ ( $attr:ident, $memo:ident ) => (
+ fn $attr(&self) -> DomRoot<NodeList> {
+ use crate::dom::htmlelement::HTMLElement;
+ use crate::dom::nodelist::NodeList;
+ self.$memo.or_init(|| NodeList::new_labels_list(
+ self.upcast::<Node>().owner_doc().window(),
+ self.upcast::<HTMLElement>()
+ )
+ )
+ }
+ );
+);
+
+#[macro_export]
macro_rules! make_enumerated_getter(
( $attr:ident, $htmlname:tt, $default:expr, $($choices: pat)|+) => (
fn $attr(&self) -> DOMString {