Add custom elements related stuff into ElementRareData

This commit is contained in:
Fernando Jiménez Moreno 2019-03-06 16:34:16 +01:00
parent a9019da39d
commit c75da615bd
5 changed files with 54 additions and 34 deletions

View file

@ -23,7 +23,7 @@ use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::DOMString;
use crate::dom::document::Document;
use crate::dom::domexception::{DOMErrorName, DOMException};
use crate::dom::element::{CustomElementState, Element};
use crate::dom::element::Element;
use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::{document_from_node, window_from_node, Node, ShadowIncluding};
@ -47,6 +47,21 @@ use std::ops::Deref;
use std::ptr;
use std::rc::Rc;
/// <https://dom.spec.whatwg.org/#concept-element-custom-element-state>
#[derive(Clone, Copy, Eq, JSTraceable, MallocSizeOf, PartialEq)]
pub enum CustomElementState {
Undefined,
Failed,
Uncustomized,
Custom,
}
impl Default for CustomElementState {
fn default() -> CustomElementState {
CustomElementState::Uncustomized
}
}
/// <https://html.spec.whatwg.org/multipage/#customelementregistry>
#[dom_struct]
pub struct CustomElementRegistry {