Labels are a live list in tree order

This commit is contained in:
Patrick Shaughnessy 2020-01-02 15:44:29 -05:00
parent 0d142bea9a
commit 036e8dabe2
14 changed files with 161 additions and 102 deletions

View file

@ -140,6 +140,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)|+) => (