mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Add construction stack
This commit is contained in:
parent
82de4c49f3
commit
8c5005fc44
2 changed files with 42 additions and 14 deletions
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue