Add construction stack

This commit is contained in:
Connor Brewster 2017-07-19 12:58:15 -06:00
parent 82de4c49f3
commit 8c5005fc44
2 changed files with 42 additions and 14 deletions

View file

@ -366,6 +366,12 @@ pub struct LifecycleCallbacks {
attribute_changed_callback: Option<Rc<Function>>,
}
#[derive(HeapSizeOf, JSTraceable, Clone)]
pub enum ConstructionStackEntry {
Element(Root<Element>),
AlreadyConstructedMarker,
}
/// https://html.spec.whatwg.org/multipage/#custom-element-definition
#[derive(HeapSizeOf, JSTraceable, Clone)]
pub struct CustomElementDefinition {
@ -379,6 +385,8 @@ pub struct CustomElementDefinition {
pub observed_attributes: Vec<DOMString>,
pub callbacks: LifecycleCallbacks,
pub construction_stack: DOMRefCell<Vec<ConstructionStackEntry>>,
}
impl CustomElementDefinition {
@ -394,6 +402,7 @@ impl CustomElementDefinition {
constructor: constructor,
observed_attributes: observed_attributes,
callbacks: callbacks,
construction_stack: Default::default(),
}
}