From 67e9fc8c0ad5dd54a9947a3048f588a8ea55458e Mon Sep 17 00:00:00 2001 From: Patrick Shaughnessy Date: Fri, 13 Dec 2019 18:39:11 -0500 Subject: [PATCH] Attr is a Node, with consequences for many Node methods --- components/script/dom/attr.rs | 48 +--- components/script/dom/document.rs | 4 +- components/script/dom/element.rs | 3 +- components/script/dom/node.rs | 259 ++++++++++++++---- components/script/dom/range.rs | 1 + components/script/dom/servoparser/html.rs | 1 + components/script/dom/webidls/Attr.webidl | 8 +- .../wpt/metadata/dom/idlharness.window.js.ini | 197 ------------- .../dom/nodes/Document-importNode.html.ini | 4 - 9 files changed, 224 insertions(+), 301 deletions(-) delete mode 100644 tests/wpt/metadata/dom/nodes/Document-importNode.html.ini diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 886f62718e9b..a25fcac36677 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -5,15 +5,14 @@ use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::AttrBinding::{self, AttrMethods}; use crate::dom::bindings::inheritance::Castable; -use crate::dom::bindings::reflector::{reflect_dom_object, Reflector}; use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom}; use crate::dom::bindings::str::DOMString; use crate::dom::customelementregistry::CallbackReaction; +use crate::dom::document::Document; use crate::dom::element::{AttributeMutation, Element}; use crate::dom::mutationobserver::{Mutation, MutationObserver}; use crate::dom::node::Node; use crate::dom::virtualmethods::vtable_for; -use crate::dom::window::Window; use crate::script_thread::ScriptThread; use devtools_traits::AttrInfo; use dom_struct::dom_struct; @@ -27,7 +26,7 @@ use style::attr::{AttrIdentifier, AttrValue}; // https://dom.spec.whatwg.org/#interface-attr #[dom_struct] pub struct Attr { - reflector_: Reflector, + node_: Node, identifier: AttrIdentifier, value: DomRefCell, @@ -37,6 +36,7 @@ pub struct Attr { impl Attr { fn new_inherited( + document: &Document, local_name: LocalName, value: AttrValue, name: LocalName, @@ -45,7 +45,7 @@ impl Attr { owner: Option<&Element>, ) -> Attr { Attr { - reflector_: Reflector::new(), + node_: Node::new_inherited(document), identifier: AttrIdentifier { local_name: local_name, name: name, @@ -58,7 +58,7 @@ impl Attr { } pub fn new( - window: &Window, + document: &Document, local_name: LocalName, value: AttrValue, name: LocalName, @@ -66,11 +66,11 @@ impl Attr { prefix: Option, owner: Option<&Element>, ) -> DomRoot { - reflect_dom_object( + Node::reflect_node( Box::new(Attr::new_inherited( - local_name, value, name, namespace, prefix, owner, + document, local_name, value, name, namespace, prefix, owner, )), - window, + document, AttrBinding::Wrap, ) } @@ -114,37 +114,12 @@ impl AttrMethods for Attr { } } - // https://dom.spec.whatwg.org/#dom-attr-textcontent - fn TextContent(&self) -> DOMString { - self.Value() - } - - // https://dom.spec.whatwg.org/#dom-attr-textcontent - fn SetTextContent(&self, value: DOMString) { - self.SetValue(value) - } - - // https://dom.spec.whatwg.org/#dom-attr-nodevalue - fn NodeValue(&self) -> DOMString { - self.Value() - } - - // https://dom.spec.whatwg.org/#dom-attr-nodevalue - fn SetNodeValue(&self, value: DOMString) { - self.SetValue(value) - } - // https://dom.spec.whatwg.org/#dom-attr-name fn Name(&self) -> DOMString { // FIXME(ajeffrey): convert directly from LocalName to DOMString DOMString::from(&*self.identifier.name) } - // https://dom.spec.whatwg.org/#dom-attr-nodename - fn NodeName(&self) -> DOMString { - self.Name() - } - // https://dom.spec.whatwg.org/#dom-attr-namespaceuri fn GetNamespaceURI(&self) -> Option { match self.identifier.namespace { @@ -250,6 +225,13 @@ impl Attr { value: String::from(self.Value()), } } + + pub fn qualified_name(&self) -> DOMString { + match self.prefix() { + Some(ref prefix) => DOMString::from(format!("{}:{}", prefix, &**self.local_name())), + None => DOMString::from(&**self.local_name()), + } + } } #[allow(unsafe_code)] diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 94c9c8603c40..56b34053cf52 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -3685,7 +3685,7 @@ impl DocumentMethods for Document { let value = AttrValue::String("".to_owned()); Ok(Attr::new( - &self.window, + &self, name.clone(), value, name, @@ -3705,7 +3705,7 @@ impl DocumentMethods for Document { let value = AttrValue::String("".to_owned()); let qualified_name = LocalName::from(qualified_name); Ok(Attr::new( - &self.window, + &self, local_name, value, qualified_name, diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index f359c43a18fb..7f956520ad2b 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -1336,9 +1336,8 @@ impl Element { namespace: Namespace, prefix: Option, ) { - let window = window_from_node(self); let attr = Attr::new( - &window, + &self.node.owner_doc(), local_name, value, name, diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 8ee51283146e..ad70a21e37f5 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -5,7 +5,9 @@ //! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements. use crate::document_loader::DocumentLoader; +use crate::dom::attr::Attr; use crate::dom::bindings::cell::DomRefCell; +use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use crate::dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use crate::dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; @@ -1764,6 +1766,7 @@ impl Node { NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) | NodeTypeId::CharacterData(CharacterDataTypeId::Comment) => (), NodeTypeId::Document(_) => return Err(Error::HierarchyRequest), + NodeTypeId::Attr => unreachable!(), } // Step 6. @@ -1833,6 +1836,7 @@ impl Node { }, NodeTypeId::CharacterData(_) => (), NodeTypeId::Document(_) => unreachable!(), + NodeTypeId::Attr => unreachable!(), } } Ok(()) @@ -2108,6 +2112,19 @@ impl Node { ); DomRoot::upcast::(doctype) }, + NodeTypeId::Attr => { + let attr = node.downcast::().unwrap(); + let attr = Attr::new( + &document, + attr.local_name().clone(), + attr.value().clone(), + attr.name().clone(), + attr.namespace().clone(), + attr.prefix().cloned(), + None, + ); + DomRoot::upcast::(attr) + }, NodeTypeId::DocumentFragment(_) => { let doc_fragment = DocumentFragment::new(&document); DomRoot::upcast::(doc_fragment) @@ -2235,6 +2252,12 @@ impl Node { pub fn locate_namespace(node: &Node, prefix: Option) -> Namespace { match node.type_id() { NodeTypeId::Element(_) => node.downcast::().unwrap().locate_namespace(prefix), + NodeTypeId::Attr => node + .downcast::() + .unwrap() + .GetOwnerElement() + .as_ref() + .map_or(ns!(), |elem| elem.locate_namespace(prefix)), NodeTypeId::Document(_) => node .downcast::() .unwrap() @@ -2254,6 +2277,7 @@ impl NodeMethods for Node { // https://dom.spec.whatwg.org/#dom-node-nodetype fn NodeType(&self) -> u16 { match self.type_id() { + NodeTypeId::Attr => NodeConstants::ATTRIBUTE_NODE, NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::Text)) => { NodeConstants::TEXT_NODE }, @@ -2274,6 +2298,7 @@ impl NodeMethods for Node { // https://dom.spec.whatwg.org/#dom-node-nodename fn NodeName(&self) -> DOMString { match self.type_id() { + NodeTypeId::Attr => self.downcast::().unwrap().qualified_name(), NodeTypeId::Element(..) => self.downcast::().unwrap().TagName(), NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::Text)) => { DOMString::from("#text") @@ -2304,11 +2329,8 @@ impl NodeMethods for Node { // https://dom.spec.whatwg.org/#dom-node-ownerdocument fn GetOwnerDocument(&self) -> Option> { match self.type_id() { - NodeTypeId::CharacterData(..) | - NodeTypeId::Element(..) | - NodeTypeId::DocumentType | - NodeTypeId::DocumentFragment(_) => Some(self.owner_doc()), NodeTypeId::Document(_) => None, + _ => Some(self.owner_doc()), } } @@ -2378,13 +2400,27 @@ impl NodeMethods for Node { // https://dom.spec.whatwg.org/#dom-node-nodevalue fn GetNodeValue(&self) -> Option { - self.downcast::().map(CharacterData::Data) + match self.type_id() { + NodeTypeId::Attr => Some(self.downcast::().unwrap().Value()), + NodeTypeId::CharacterData(_) => { + self.downcast::().map(CharacterData::Data) + }, + _ => None, + } } // https://dom.spec.whatwg.org/#dom-node-nodevalue fn SetNodeValue(&self, val: Option) { - if let Some(character_data) = self.downcast::() { - character_data.SetData(val.unwrap_or_default()); + match self.type_id() { + NodeTypeId::Attr => { + let attr = self.downcast::().unwrap(); + attr.SetValue(val.unwrap_or_default()); + }, + NodeTypeId::CharacterData(_) => { + let character_data = self.downcast::().unwrap(); + character_data.SetData(val.unwrap_or_default()); + }, + _ => {}, } } @@ -2396,6 +2432,7 @@ impl NodeMethods for Node { Node::collect_text_contents(self.traverse_preorder(ShadowIncluding::No)); Some(content) }, + NodeTypeId::Attr => Some(self.downcast::().unwrap().Value()), NodeTypeId::CharacterData(..) => { let characterdata = self.downcast::().unwrap(); Some(characterdata.Data()) @@ -2419,6 +2456,10 @@ impl NodeMethods for Node { // Step 3. Node::replace_all(node.as_deref(), self); }, + NodeTypeId::Attr => { + let attr = self.downcast::().unwrap(); + attr.SetValue(value); + }, NodeTypeId::CharacterData(..) => { let characterdata = self.downcast::().unwrap(); characterdata.SetData(value); @@ -2517,6 +2558,7 @@ impl NodeMethods for Node { }, NodeTypeId::CharacterData(..) => (), NodeTypeId::Document(_) => unreachable!(), + NodeTypeId::Attr => unreachable!(), } } @@ -2573,6 +2615,7 @@ impl NodeMethods for Node { prev: previous_sibling.as_deref(), next: reference_child, }; + MutationObserver::queue_a_mutation_record(&self, mutation); // Step 15. @@ -2661,6 +2704,13 @@ impl NodeMethods for Node { let other_characterdata = other.downcast::().unwrap(); *characterdata.data() == *other_characterdata.data() } + fn is_equal_attr(node: &Node, other: &Node) -> bool { + let attr = node.downcast::().unwrap(); + let other_attr = other.downcast::().unwrap(); + (*attr.namespace() == *other_attr.namespace()) && + (attr.local_name() == other_attr.local_name()) && + (**attr.value() == **other_attr.value()) + } fn is_equal_element_attrs(node: &Node, other: &Node) -> bool { let element = node.downcast::().unwrap(); let other_element = other.downcast::().unwrap(); @@ -2673,6 +2723,7 @@ impl NodeMethods for Node { }) }) } + fn is_equal_node(this: &Node, node: &Node) -> bool { // Step 2. if this.NodeType() != node.NodeType() { @@ -2696,6 +2747,8 @@ impl NodeMethods for Node { } // Step 4. NodeTypeId::Element(..) if !is_equal_element_attrs(this, node) => return false, + NodeTypeId::Attr if !is_equal_attr(this, node) => return false, + _ => (), } @@ -2732,65 +2785,154 @@ impl NodeMethods for Node { return 0; } - // FIXME(emilio): This will eventually need to handle attribute nodes. - - let mut self_and_ancestors = self - .inclusive_ancestors(ShadowIncluding::No) - .collect::>(); - let mut other_and_ancestors = other - .inclusive_ancestors(ShadowIncluding::No) - .collect::>(); + // step 2 + let mut node1 = Some(other); + let mut node2 = Some(self); + + // step 3 + let mut attr1: Option<&Attr> = None; + let mut attr2: Option<&Attr> = None; + + // step 4: spec says to operate on node1 here, + // node1 is definitely Some(other) going into this step + // The compiler doesn't know the lifetime of attr1.GetOwnerElement + // is guaranteed by the lifetime of attr1, so we hold it explicitly + let attr1owner; + if let Some(ref a) = other.downcast::() { + attr1 = Some(a); + attr1owner = a.GetOwnerElement(); + node1 = match attr1owner { + Some(ref e) => Some(&e.upcast()), + None => None, + } + } - if self_and_ancestors.last() != other_and_ancestors.last() { - let random = as_uintptr(self_and_ancestors.last().unwrap()) < - as_uintptr(other_and_ancestors.last().unwrap()); - let random = if random { - NodeConstants::DOCUMENT_POSITION_FOLLOWING - } else { - NodeConstants::DOCUMENT_POSITION_PRECEDING - }; + // step 5.1: spec says to operate on node2 here, + // node2 is definitely just Some(self) going into this step + let attr2owner; + if let Some(ref a) = self.downcast::() { + attr2 = Some(a); + attr2owner = a.GetOwnerElement(); + node2 = match attr2owner { + Some(ref e) => Some(&*e.upcast()), + None => None, + } + } - // Disconnected. - return random + - NodeConstants::DOCUMENT_POSITION_DISCONNECTED + - NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC; + // Step 5.2 + // This substep seems lacking in test coverage. + // We hit this when comparing two attributes that have the + // same owner element. + if let Some(node2) = node2 { + if Some(node2) == node1 { + match (attr1, attr2) { + (Some(a1), Some(a2)) => { + let attrs = node2.downcast::().unwrap().attrs(); + // go through the attrs in order to see if self + // or other is first; spec is clear that we + // want value-equality, not reference-equality + for attr in attrs.iter() { + if (*attr.namespace() == *a1.namespace()) && + (attr.local_name() == a1.local_name()) && + (**attr.value() == **a1.value()) + { + return NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + + NodeConstants::DOCUMENT_POSITION_PRECEDING; + } + if (*attr.namespace() == *a2.namespace()) && + (attr.local_name() == a2.local_name()) && + (**attr.value() == **a2.value()) + { + return NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + + NodeConstants::DOCUMENT_POSITION_FOLLOWING; + } + } + // both attrs have node2 as their owner element, so + // we can't have left the loop without seeing them + unreachable!(); + }, + (_, _) => {}, + } + } } - let mut parent = self_and_ancestors.pop().unwrap(); - other_and_ancestors.pop().unwrap(); + // Step 6 + match (node1, node2) { + (None, _) => { + // node1 is null + return NodeConstants::DOCUMENT_POSITION_FOLLOWING + + NodeConstants::DOCUMENT_POSITION_DISCONNECTED + + NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC; + }, + (_, None) => { + // node2 is null + return NodeConstants::DOCUMENT_POSITION_PRECEDING + + NodeConstants::DOCUMENT_POSITION_DISCONNECTED + + NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC; + }, + (Some(node1), Some(node2)) => { + // still step 6, testing if node1 and 2 share a root + let mut self_and_ancestors = node2 + .inclusive_ancestors(ShadowIncluding::No) + .collect::>(); + let mut other_and_ancestors = node1 + .inclusive_ancestors(ShadowIncluding::No) + .collect::>(); + + if self_and_ancestors.last() != other_and_ancestors.last() { + let random = as_uintptr(self_and_ancestors.last().unwrap()) < + as_uintptr(other_and_ancestors.last().unwrap()); + let random = if random { + NodeConstants::DOCUMENT_POSITION_FOLLOWING + } else { + NodeConstants::DOCUMENT_POSITION_PRECEDING + }; - let mut current_position = cmp::min(self_and_ancestors.len(), other_and_ancestors.len()); + // Disconnected. + return random + + NodeConstants::DOCUMENT_POSITION_DISCONNECTED + + NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC; + } + // steps 7-10 + let mut parent = self_and_ancestors.pop().unwrap(); + other_and_ancestors.pop().unwrap(); + + let mut current_position = + cmp::min(self_and_ancestors.len(), other_and_ancestors.len()); + + while current_position > 0 { + current_position -= 1; + let child_1 = self_and_ancestors.pop().unwrap(); + let child_2 = other_and_ancestors.pop().unwrap(); + + if child_1 != child_2 { + let is_before = parent.children().position(|c| c == child_1).unwrap() < + parent.children().position(|c| c == child_2).unwrap(); + // If I am before, `other` is following, and the other way + // around. + return if is_before { + NodeConstants::DOCUMENT_POSITION_FOLLOWING + } else { + NodeConstants::DOCUMENT_POSITION_PRECEDING + }; + } - while current_position > 0 { - current_position -= 1; - let child_1 = self_and_ancestors.pop().unwrap(); - let child_2 = other_and_ancestors.pop().unwrap(); + parent = child_1; + } - if child_1 != child_2 { - let is_before = parent.children().position(|c| c == child_1).unwrap() < - parent.children().position(|c| c == child_2).unwrap(); - // If I am before, `other` is following, and the other way - // around. - return if is_before { - NodeConstants::DOCUMENT_POSITION_FOLLOWING + // We hit the end of one of the parent chains, so one node needs to be + // contained in the other. + // + // If we're the container, return that `other` is contained by us. + return if self_and_ancestors.len() < other_and_ancestors.len() { + NodeConstants::DOCUMENT_POSITION_FOLLOWING + + NodeConstants::DOCUMENT_POSITION_CONTAINED_BY } else { - NodeConstants::DOCUMENT_POSITION_PRECEDING + NodeConstants::DOCUMENT_POSITION_PRECEDING + + NodeConstants::DOCUMENT_POSITION_CONTAINS }; - } - - parent = child_1; + }, } - - // We hit the end of one of the parent chains, so one node needs to be - // contained in the other. - // - // If we're the container, return that `other` is contained by us. - return if self_and_ancestors.len() < other_and_ancestors.len() { - NodeConstants::DOCUMENT_POSITION_FOLLOWING + - NodeConstants::DOCUMENT_POSITION_CONTAINED_BY - } else { - NodeConstants::DOCUMENT_POSITION_PRECEDING + NodeConstants::DOCUMENT_POSITION_CONTAINS - }; } // https://dom.spec.whatwg.org/#dom-node-contains @@ -2819,6 +2961,11 @@ impl NodeMethods for Node { .GetDocumentElement() .and_then(|element| element.lookup_prefix(namespace)), NodeTypeId::DocumentType | NodeTypeId::DocumentFragment(_) => None, + NodeTypeId::Attr => self + .downcast::() + .unwrap() + .GetOwnerElement() + .and_then(|element| element.lookup_prefix(namespace)), _ => self .GetParentElement() .and_then(|element| element.lookup_prefix(namespace)), diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index 819cc284d637..665469f48843 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -986,6 +986,7 @@ impl RangeMethods for Range { NodeTypeId::CharacterData(CharacterDataTypeId::Text(_)) => node.GetParentElement(), NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) | NodeTypeId::DocumentType => unreachable!(), + NodeTypeId::Attr => unreachable!(), }; // Step 2. diff --git a/components/script/dom/servoparser/html.rs b/components/script/dom/servoparser/html.rs index 22e2574a9b40..1bbc0aeeae80 100644 --- a/components/script/dom/servoparser/html.rs +++ b/components/script/dom/servoparser/html.rs @@ -253,6 +253,7 @@ impl<'a> Serialize for &'a Node { NodeTypeId::Document(_) => panic!("Can't serialize Document node itself"), NodeTypeId::Element(_) => panic!("Element shouldn't appear here"), + NodeTypeId::Attr => panic!("Attr shouldn't appear here"), }, } } diff --git a/components/script/dom/webidls/Attr.webidl b/components/script/dom/webidls/Attr.webidl index 9bd212e9fe5f..f56f9104e655 100644 --- a/components/script/dom/webidls/Attr.webidl +++ b/components/script/dom/webidls/Attr.webidl @@ -8,7 +8,7 @@ */ [Exposed=Window] -interface Attr { +interface Attr : Node { [Constant] readonly attribute DOMString? namespaceURI; [Constant] @@ -17,14 +17,8 @@ interface Attr { readonly attribute DOMString localName; [Constant] readonly attribute DOMString name; - [Constant] - readonly attribute DOMString nodeName; // historical alias of .name [CEReactions, Pure] attribute DOMString value; - [CEReactions, Pure] - attribute DOMString textContent; // historical alias of .value - [CEReactions, Pure] - attribute DOMString nodeValue; // historical alias of .value [Pure] readonly attribute Element? ownerElement; diff --git a/tests/wpt/metadata/dom/idlharness.window.js.ini b/tests/wpt/metadata/dom/idlharness.window.js.ini index b31ff368e3c0..d2543ab080d3 100644 --- a/tests/wpt/metadata/dom/idlharness.window.js.ini +++ b/tests/wpt/metadata/dom/idlharness.window.js.ini @@ -1,176 +1,3 @@ -[idlharness.window.html?include=Node] - [Node interface: calling isSameNode(Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "TEXT_NODE" with the proper type] - expected: FAIL - - [Node interface: calling removeChild(Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: calling isEqualNode(Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "lookupPrefix(DOMString)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "nextSibling" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "isConnected" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "isSameNode(Node)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "nodeType" with the proper type] - expected: FAIL - - [Node interface: calling replaceChild(Node, Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_POSITION_FOLLOWING" with the proper type] - expected: FAIL - - [Node interface: calling getRootNode(GetRootNodeOptions) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "cloneNode(boolean)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "ENTITY_NODE" with the proper type] - expected: FAIL - - [Node interface: calling contains(Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "CDATA_SECTION_NODE" with the proper type] - expected: FAIL - - [Node interface: calling cloneNode(boolean) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "appendChild(Node)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "parentNode" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "removeChild(Node)" with the proper type] - expected: FAIL - - [Node interface: calling lookupPrefix(DOMString) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "PROCESSING_INSTRUCTION_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "baseURI" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_POSITION_DISCONNECTED" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "compareDocumentPosition(Node)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "replaceChild(Node, Node)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_POSITION_PRECEDING" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "isEqualNode(Node)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "COMMENT_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "ATTRIBUTE_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_POSITION_CONTAINS" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "childNodes" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "parentElement" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "isDefaultNamespace(DOMString)" with the proper type] - expected: FAIL - - [Node interface: calling isDefaultNamespace(DOMString) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "ownerDocument" with the proper type] - expected: FAIL - - [Node interface: calling appendChild(Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: calling insertBefore(Node, Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "ELEMENT_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_POSITION_CONTAINED_BY" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "lookupNamespaceURI(DOMString)" with the proper type] - expected: FAIL - - [Node interface: calling lookupNamespaceURI(DOMString) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "firstChild" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "normalize()" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_FRAGMENT_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "contains(Node)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "getRootNode(GetRootNodeOptions)" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "DOCUMENT_TYPE_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "hasChildNodes()" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "lastChild" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "previousSibling" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "insertBefore(Node, Node)" with the proper type] - expected: FAIL - - [Node interface: calling compareDocumentPosition(Node) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "ENTITY_REFERENCE_NODE" with the proper type] - expected: FAIL - - [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "NOTATION_NODE" with the proper type] - expected: FAIL - - [idlharness.window.html?exclude=Node] [EventTarget interface: new AbortController().signal must inherit property "addEventListener(DOMString, EventListener, [object Object\],[object Object\])" with the proper type] expected: FAIL @@ -265,9 +92,6 @@ [AbortController interface: attribute signal] expected: FAIL - [EventTarget interface: document.querySelector("[id\]").attributes[0\] must inherit property "dispatchEvent(Event)" with the proper type] - expected: FAIL - [Element interface: calling attachShadow(ShadowRootInit) on element with too few arguments must throw TypeError] expected: FAIL @@ -292,9 +116,6 @@ [Event interface: operation composedPath()] expected: FAIL - [EventTarget interface: calling dispatchEvent(Event) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - [AbstractRange interface: attribute endContainer] expected: FAIL @@ -304,9 +125,6 @@ [AbortController interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL - [EventTarget interface: document.querySelector("[id\]").attributes[0\] must inherit property "removeEventListener(DOMString, EventListener, [object Object\],[object Object\])" with the proper type] - expected: FAIL - [CharacterData interface: operation remove()] expected: FAIL @@ -409,9 +227,6 @@ [AbortSignal interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL - [EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object\],[object Object\]) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - [Document interface: xmlDoc must inherit property "origin" with the proper type] expected: FAIL @@ -424,9 +239,6 @@ [AbortSignal interface: attribute onabort] expected: FAIL - [EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object\],[object Object\]) on document.querySelector("[id\]").attributes[0\] with too few arguments must throw TypeError] - expected: FAIL - [AbortSignal interface: existence and properties of interface prototype object] expected: FAIL @@ -460,9 +272,6 @@ [CharacterData interface: operation before([object Object\],[object Object\])] expected: FAIL - [EventTarget interface: document.querySelector("[id\]").attributes[0\] must inherit property "addEventListener(DOMString, EventListener, [object Object\],[object Object\])" with the proper type] - expected: FAIL - [Stringification of new AbortController()] expected: FAIL @@ -475,9 +284,6 @@ [Event interface: document.createEvent("Event") must inherit property "composed" with the proper type] expected: FAIL - [Attr interface: existence and properties of interface object] - expected: FAIL - [DocumentType interface: operation remove()] expected: FAIL @@ -487,9 +293,6 @@ [Element interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL - [Attr interface: existence and properties of interface prototype object] - expected: FAIL - [Element interface: operation replaceWith([object Object\],[object Object\])] expected: FAIL diff --git a/tests/wpt/metadata/dom/nodes/Document-importNode.html.ini b/tests/wpt/metadata/dom/nodes/Document-importNode.html.ini deleted file mode 100644 index 21a56ba896f4..000000000000 --- a/tests/wpt/metadata/dom/nodes/Document-importNode.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[Document-importNode.html] - [Import an Attr node with namespace/prefix correctly.] - expected: FAIL -