mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Introduce [Abstract] to mark non-leaf interfaces
Some interfaces like Node, CharacterData and HTMLTableCellElement are never instantiated directly, only their descendant interfaces are. Those are marked with [Abstract] to set their type_id to None instead of having dummy values in the TypeId enums.
This commit is contained in:
parent
941f7dc04b
commit
c25085f68a
21 changed files with 26 additions and 48 deletions
|
@ -1430,8 +1430,6 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
|
||||||
Some(NodeTypeId::Document) => {
|
Some(NodeTypeId::Document) => {
|
||||||
(display::T::none, float::T::none, position::T::static_)
|
(display::T::none, float::T::none, position::T::static_)
|
||||||
}
|
}
|
||||||
Some(NodeTypeId::Node) => unreachable!(),
|
|
||||||
Some(NodeTypeId::CharacterData(CharacterDataTypeId::CharacterData)) => unreachable!(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!("building flow for node: {:?} {:?} {:?} {:?}", display, float, positioning, node.type_id());
|
debug!("building flow for node: {:?} {:?} {:?} {:?}", display, float, positioning, node.type_id());
|
||||||
|
@ -1587,7 +1585,6 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> {
|
||||||
Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
HTMLElementTypeId::HTMLObjectElement))) => self.has_object_data(),
|
HTMLElementTypeId::HTMLObjectElement))) => self.has_object_data(),
|
||||||
Some(NodeTypeId::Element(_)) => false,
|
Some(NodeTypeId::Element(_)) => false,
|
||||||
Some(NodeTypeId::Node) => unreachable!(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1724,7 +1724,7 @@ class CGNamespace(CGWrapper):
|
||||||
|
|
||||||
def EventTargetEnum(desc):
|
def EventTargetEnum(desc):
|
||||||
protochain = desc.prototypeChain
|
protochain = desc.prototypeChain
|
||||||
if protochain[0] != "EventTarget":
|
if protochain[0] != "EventTarget" or desc.interface.getExtendedAttribute("Abstract"):
|
||||||
return "None"
|
return "None"
|
||||||
|
|
||||||
inner = ""
|
inner = ""
|
||||||
|
|
|
@ -1357,7 +1357,8 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
||||||
identifier == "ChromeOnly" or
|
identifier == "ChromeOnly" or
|
||||||
identifier == "Unforgeable" or
|
identifier == "Unforgeable" or
|
||||||
identifier == "UnsafeInPrerendering" or
|
identifier == "UnsafeInPrerendering" or
|
||||||
identifier == "LegacyEventInit"):
|
identifier == "LegacyEventInit" or
|
||||||
|
identifier == "Abstract"):
|
||||||
# Known extended attributes that do not take values
|
# Known extended attributes that do not take values
|
||||||
if not attr.noArguments():
|
if not attr.noArguments():
|
||||||
raise WebIDLError("[%s] must take no arguments" % identifier,
|
raise WebIDLError("[%s] must take no arguments" % identifier,
|
||||||
|
|
12
components/script/dom/bindings/codegen/parser/abstract.patch
Normal file
12
components/script/dom/bindings/codegen/parser/abstract.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
--- WebIDL.py
|
||||||
|
+++ WebIDL.py
|
||||||
|
@@ -1357,7 +1357,8 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
||||||
|
identifier == "ChromeOnly" or
|
||||||
|
identifier == "Unforgeable" or
|
||||||
|
identifier == "UnsafeInPrerendering" or
|
||||||
|
- identifier == "LegacyEventInit"):
|
||||||
|
+ identifier == "LegacyEventInit" or
|
||||||
|
+ identifier == "Abstract"):
|
||||||
|
# Known extended attributes that do not take values
|
||||||
|
if not attr.noArguments():
|
||||||
|
raise WebIDLError("[%s] must take no arguments" % identifier,
|
|
@ -1,3 +1,4 @@
|
||||||
wget https://mxr.mozilla.org/mozilla-central/source/dom/bindings/parser/WebIDL.py?raw=1 -O WebIDL.py
|
wget https://mxr.mozilla.org/mozilla-central/source/dom/bindings/parser/WebIDL.py?raw=1 -O WebIDL.py
|
||||||
patch < external.patch
|
patch < external.patch
|
||||||
patch < module.patch
|
patch < module.patch
|
||||||
|
patch < abstract.patch
|
||||||
|
|
|
@ -160,8 +160,6 @@ impl CharacterDataMethods for CharacterData {
|
||||||
/// The different types of CharacterData.
|
/// The different types of CharacterData.
|
||||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
pub enum CharacterDataTypeId {
|
pub enum CharacterDataTypeId {
|
||||||
CharacterData,
|
|
||||||
|
|
||||||
Comment,
|
Comment,
|
||||||
Text,
|
Text,
|
||||||
ProcessingInstruction,
|
ProcessingInstruction,
|
||||||
|
|
|
@ -48,8 +48,6 @@ pub enum ListenerPhase {
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum EventTargetTypeId {
|
pub enum EventTargetTypeId {
|
||||||
EventTarget,
|
|
||||||
|
|
||||||
Node(NodeTypeId),
|
Node(NodeTypeId),
|
||||||
WebSocket,
|
WebSocket,
|
||||||
Window,
|
Window,
|
||||||
|
|
|
@ -43,8 +43,6 @@ impl HTMLMediaElement {
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum HTMLMediaElementTypeId {
|
pub enum HTMLMediaElementTypeId {
|
||||||
HTMLMediaElement = -1,
|
|
||||||
|
|
||||||
HTMLAudioElement = 0,
|
HTMLAudioElement = 0,
|
||||||
HTMLVideoElement = 1,
|
HTMLVideoElement = 1,
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,6 @@ const DEFAULT_COLSPAN: u32 = 1;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum HTMLTableCellElementTypeId {
|
pub enum HTMLTableCellElementTypeId {
|
||||||
HTMLTableCellElement = -1,
|
|
||||||
|
|
||||||
HTMLTableDataCellElement = 0,
|
HTMLTableDataCellElement = 0,
|
||||||
HTMLTableHeaderCellElement = 1,
|
HTMLTableHeaderCellElement = 1,
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,8 +283,6 @@ impl LayoutDataRef {
|
||||||
/// The different types of nodes.
|
/// The different types of nodes.
|
||||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
pub enum NodeTypeId {
|
pub enum NodeTypeId {
|
||||||
Node,
|
|
||||||
|
|
||||||
CharacterData(CharacterDataTypeId),
|
CharacterData(CharacterDataTypeId),
|
||||||
DocumentType,
|
DocumentType,
|
||||||
DocumentFragment,
|
DocumentFragment,
|
||||||
|
@ -1456,8 +1454,6 @@ impl Node {
|
||||||
|
|
||||||
// Step 4-5.
|
// Step 4-5.
|
||||||
match node.type_id() {
|
match node.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::CharacterData) => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => {
|
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => {
|
||||||
if parent.is_document() {
|
if parent.is_document() {
|
||||||
return Err(HierarchyRequest);
|
return Err(HierarchyRequest);
|
||||||
|
@ -1540,7 +1536,7 @@ impl Node {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
NodeTypeId::CharacterData(_) => (),
|
NodeTypeId::CharacterData(_) => (),
|
||||||
NodeTypeId::Document | NodeTypeId::Node => unreachable!(),
|
NodeTypeId::Document => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -1700,8 +1696,6 @@ impl Node {
|
||||||
// Step 2.
|
// Step 2.
|
||||||
// XXXabinader: clone() for each node as trait?
|
// XXXabinader: clone() for each node as trait?
|
||||||
let copy: Root<Node> = match node.type_id() {
|
let copy: Root<Node> = match node.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::CharacterData) => unreachable!(),
|
|
||||||
NodeTypeId::DocumentType => {
|
NodeTypeId::DocumentType => {
|
||||||
let doctype: &DocumentType = DocumentTypeCast::to_ref(node).unwrap();
|
let doctype: &DocumentType = DocumentTypeCast::to_ref(node).unwrap();
|
||||||
let doctype = DocumentType::new(doctype.name().clone(),
|
let doctype = DocumentType::new(doctype.name().clone(),
|
||||||
|
@ -1894,8 +1888,6 @@ impl NodeMethods for Node {
|
||||||
// https://dom.spec.whatwg.org/#dom-node-nodetype
|
// https://dom.spec.whatwg.org/#dom-node-nodetype
|
||||||
fn NodeType(&self) -> u16 {
|
fn NodeType(&self) -> u16 {
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::CharacterData) => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) =>
|
NodeTypeId::CharacterData(CharacterDataTypeId::Text) =>
|
||||||
NodeConstants::TEXT_NODE,
|
NodeConstants::TEXT_NODE,
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) =>
|
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) =>
|
||||||
|
@ -1916,12 +1908,10 @@ impl NodeMethods for Node {
|
||||||
// https://dom.spec.whatwg.org/#dom-node-nodename
|
// https://dom.spec.whatwg.org/#dom-node-nodename
|
||||||
fn NodeName(&self) -> DOMString {
|
fn NodeName(&self) -> DOMString {
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::Element(..) => {
|
NodeTypeId::Element(..) => {
|
||||||
let elem: &Element = ElementCast::to_ref(self).unwrap();
|
let elem: &Element = ElementCast::to_ref(self).unwrap();
|
||||||
elem.TagName()
|
elem.TagName()
|
||||||
}
|
}
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::CharacterData) => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => "#text".to_owned(),
|
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => "#text".to_owned(),
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) => {
|
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) => {
|
||||||
let processing_instruction: &ProcessingInstruction =
|
let processing_instruction: &ProcessingInstruction =
|
||||||
|
@ -1946,7 +1936,6 @@ impl NodeMethods for Node {
|
||||||
// https://dom.spec.whatwg.org/#dom-node-ownerdocument
|
// https://dom.spec.whatwg.org/#dom-node-ownerdocument
|
||||||
fn GetOwnerDocument(&self) -> Option<Root<Document>> {
|
fn GetOwnerDocument(&self) -> Option<Root<Document>> {
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(..) |
|
NodeTypeId::CharacterData(..) |
|
||||||
NodeTypeId::Element(..) |
|
NodeTypeId::Element(..) |
|
||||||
NodeTypeId::DocumentType |
|
NodeTypeId::DocumentType |
|
||||||
|
@ -2025,7 +2014,6 @@ impl NodeMethods for Node {
|
||||||
// https://dom.spec.whatwg.org/#dom-node-textcontent
|
// https://dom.spec.whatwg.org/#dom-node-textcontent
|
||||||
fn GetTextContent(&self) -> Option<DOMString> {
|
fn GetTextContent(&self) -> Option<DOMString> {
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::DocumentFragment |
|
NodeTypeId::DocumentFragment |
|
||||||
NodeTypeId::Element(..) => {
|
NodeTypeId::Element(..) => {
|
||||||
let content = Node::collect_text_contents(self.traverse_preorder());
|
let content = Node::collect_text_contents(self.traverse_preorder());
|
||||||
|
@ -2046,7 +2034,6 @@ impl NodeMethods for Node {
|
||||||
fn SetTextContent(&self, value: Option<DOMString>) {
|
fn SetTextContent(&self, value: Option<DOMString>) {
|
||||||
let value = value.unwrap_or(String::new());
|
let value = value.unwrap_or(String::new());
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::DocumentFragment |
|
NodeTypeId::DocumentFragment |
|
||||||
NodeTypeId::Element(..) => {
|
NodeTypeId::Element(..) => {
|
||||||
// Step 1-2.
|
// Step 1-2.
|
||||||
|
@ -2106,7 +2093,6 @@ impl NodeMethods for Node {
|
||||||
|
|
||||||
// Step 4-5.
|
// Step 4-5.
|
||||||
match node.type_id() {
|
match node.type_id() {
|
||||||
NodeTypeId::Node => unreachable!(),
|
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) if self.is_document() =>
|
NodeTypeId::CharacterData(CharacterDataTypeId::Text) if self.is_document() =>
|
||||||
return Err(HierarchyRequest),
|
return Err(HierarchyRequest),
|
||||||
NodeTypeId::DocumentType if !self.is_document() => return Err(HierarchyRequest),
|
NodeTypeId::DocumentType if !self.is_document() => return Err(HierarchyRequest),
|
||||||
|
@ -2170,7 +2156,7 @@ impl NodeMethods for Node {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
NodeTypeId::CharacterData(..) => (),
|
NodeTypeId::CharacterData(..) => (),
|
||||||
NodeTypeId::Document | NodeTypeId::Node => unreachable!()
|
NodeTypeId::Document => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
* liability, trademark and document use rules apply.
|
* liability, trademark and document use rules apply.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
interface CharacterData : Node {
|
interface CharacterData : Node {
|
||||||
[TreatNullAs=EmptyString] attribute DOMString data;
|
[TreatNullAs=EmptyString] attribute DOMString data;
|
||||||
readonly attribute unsigned long length;
|
readonly attribute unsigned long length;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* https://dom.spec.whatwg.org/#interface-eventtarget
|
* https://dom.spec.whatwg.org/#interface-eventtarget
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
interface EventTarget {
|
interface EventTarget {
|
||||||
void addEventListener(DOMString type,
|
void addEventListener(DOMString type,
|
||||||
EventListener? listener,
|
EventListener? listener,
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
// https://www.whatwg.org/html/#htmlmediaelement
|
// https://www.whatwg.org/html/#htmlmediaelement
|
||||||
//enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" };
|
//enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" };
|
||||||
|
[Abstract]
|
||||||
interface HTMLMediaElement : HTMLElement {
|
interface HTMLMediaElement : HTMLElement {
|
||||||
|
|
||||||
// error state
|
// error state
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://www.whatwg.org/html/#htmltablecellelement
|
// https://www.whatwg.org/html/#htmltablecellelement
|
||||||
|
[Abstract]
|
||||||
interface HTMLTableCellElement : HTMLElement {
|
interface HTMLTableCellElement : HTMLElement {
|
||||||
attribute unsigned long colSpan;
|
attribute unsigned long colSpan;
|
||||||
// attribute unsigned long rowSpan;
|
// attribute unsigned long rowSpan;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* https://dom.spec.whatwg.org/#interface-node
|
* https://dom.spec.whatwg.org/#interface-node
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
interface Node : EventTarget {
|
interface Node : EventTarget {
|
||||||
const unsigned short ELEMENT_NODE = 1;
|
const unsigned short ELEMENT_NODE = 1;
|
||||||
const unsigned short ATTRIBUTE_NODE = 2; // historical
|
const unsigned short ATTRIBUTE_NODE = 2; // historical
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://www.whatwg.org/html/#workerglobalscope
|
// https://html.spec.whatwg.org/multipage/#workerglobalscope
|
||||||
//[Exposed=Worker]
|
[Abstract/*, Exposed=Worker*/]
|
||||||
interface WorkerGlobalScope : EventTarget {
|
interface WorkerGlobalScope : EventTarget {
|
||||||
[BinaryName="Self_"] readonly attribute WorkerGlobalScope self;
|
[BinaryName="Self_"] readonly attribute WorkerGlobalScope self;
|
||||||
readonly attribute WorkerLocation location;
|
readonly attribute WorkerLocation location;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//[Exposed=(Window,Worker)]
|
[Abstract/*, Exposed=(Window,Worker)*/]
|
||||||
interface XMLHttpRequestEventTarget : EventTarget {
|
interface XMLHttpRequestEventTarget : EventTarget {
|
||||||
// event handlers
|
// event handlers
|
||||||
attribute EventHandler onloadstart;
|
attribute EventHandler onloadstart;
|
||||||
|
|
|
@ -38,8 +38,6 @@ use std::sync::mpsc::Receiver;
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum WorkerGlobalScopeTypeId {
|
pub enum WorkerGlobalScopeTypeId {
|
||||||
WorkerGlobalScope,
|
|
||||||
|
|
||||||
DedicatedWorkerGlobalScope,
|
DedicatedWorkerGlobalScope,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@ use dom::eventtarget::{EventTarget, EventTargetTypeId};
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum XMLHttpRequestEventTargetTypeId {
|
pub enum XMLHttpRequestEventTargetTypeId {
|
||||||
XMLHttpRequestEventTarget,
|
|
||||||
|
|
||||||
XMLHttpRequest,
|
XMLHttpRequest,
|
||||||
XMLHttpRequestUpload,
|
XMLHttpRequestUpload,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,7 @@ use dom::element::ElementTypeId;
|
||||||
use dom::eventtarget::{EventTarget, EventTargetTypeId};
|
use dom::eventtarget::{EventTarget, EventTargetTypeId};
|
||||||
use dom::htmlelement::HTMLElementTypeId;
|
use dom::htmlelement::HTMLElementTypeId;
|
||||||
use dom::htmlmediaelement::HTMLMediaElementTypeId::HTMLAudioElement;
|
use dom::htmlmediaelement::HTMLMediaElementTypeId::HTMLAudioElement;
|
||||||
use dom::htmlmediaelement::HTMLMediaElementTypeId::HTMLMediaElement;
|
|
||||||
use dom::htmlmediaelement::HTMLMediaElementTypeId::HTMLVideoElement;
|
use dom::htmlmediaelement::HTMLMediaElementTypeId::HTMLVideoElement;
|
||||||
use dom::htmltablecellelement::HTMLTableCellElementTypeId::HTMLTableCellElement;
|
|
||||||
use dom::htmltablecellelement::HTMLTableCellElementTypeId::HTMLTableDataCellElement;
|
use dom::htmltablecellelement::HTMLTableCellElementTypeId::HTMLTableDataCellElement;
|
||||||
use dom::htmltablecellelement::HTMLTableCellElementTypeId::HTMLTableHeaderCellElement;
|
use dom::htmltablecellelement::HTMLTableCellElementTypeId::HTMLTableHeaderCellElement;
|
||||||
use dom::node::NodeTypeId;
|
use dom::node::NodeTypeId;
|
||||||
|
@ -249,13 +247,5 @@ pub fn heap_size_of_eventtarget(target: &EventTarget) -> usize {
|
||||||
heap_size_of_self_and_children(DocumentTypeCast::to_ref(target).unwrap()),
|
heap_size_of_self_and_children(DocumentTypeCast::to_ref(target).unwrap()),
|
||||||
&EventTargetTypeId::Node(NodeTypeId::DocumentFragment) =>
|
&EventTargetTypeId::Node(NodeTypeId::DocumentFragment) =>
|
||||||
heap_size_of_self_and_children(DocumentFragmentCast::to_ref(target).unwrap()),
|
heap_size_of_self_and_children(DocumentFragmentCast::to_ref(target).unwrap()),
|
||||||
&EventTargetTypeId::EventTarget |
|
|
||||||
&EventTargetTypeId::Node(NodeTypeId::Node) |
|
|
||||||
&EventTargetTypeId::Node(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
|
||||||
HTMLElementTypeId::HTMLMediaElement(HTMLMediaElement)))) |
|
|
||||||
&EventTargetTypeId::Node(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
|
||||||
HTMLElementTypeId::HTMLTableCellElement(HTMLTableCellElement)))) => {
|
|
||||||
unreachable!()
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,8 +184,6 @@ impl<'a> Serializable for &'a Node {
|
||||||
traversal_scope: TraversalScope) -> io::Result<()> {
|
traversal_scope: TraversalScope) -> io::Result<()> {
|
||||||
let node = *self;
|
let node = *self;
|
||||||
match (traversal_scope, node.type_id()) {
|
match (traversal_scope, node.type_id()) {
|
||||||
(_, NodeTypeId::Node) => unreachable!(),
|
|
||||||
(_, NodeTypeId::CharacterData(CharacterDataTypeId::CharacterData)) => unreachable!(),
|
|
||||||
(_, NodeTypeId::Element(..)) => {
|
(_, NodeTypeId::Element(..)) => {
|
||||||
let elem = ElementCast::to_ref(node).unwrap();
|
let elem = ElementCast::to_ref(node).unwrap();
|
||||||
let name = QualName::new(elem.namespace().clone(),
|
let name = QualName::new(elem.namespace().clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue