mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Implement Document::CreateAttributeNS()
This commit is contained in:
parent
7b4f6126c8
commit
2353bc4798
4 changed files with 17 additions and 18 deletions
|
@ -997,6 +997,18 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
||||||
Ok(Attr::new(window.r(), name, value, l_name, ns!(""), None, None))
|
Ok(Attr::new(window.r(), name, value, l_name, ns!(""), None, None))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://dom.spec.whatwg.org/#dom-document-createattributens
|
||||||
|
fn CreateAttributeNS(self, namespace: Option<DOMString>, qualified_name: DOMString)
|
||||||
|
-> Fallible<Temporary<Attr>> {
|
||||||
|
let (namespace, prefix, local_name) =
|
||||||
|
try!(validate_and_extract(namespace, &qualified_name));
|
||||||
|
let window = self.window.root();
|
||||||
|
let value = AttrValue::String("".to_owned());
|
||||||
|
let qualified_name = Atom::from_slice(&qualified_name);
|
||||||
|
Ok(Attr::new(window.r(), local_name, value, qualified_name,
|
||||||
|
namespace, prefix, None))
|
||||||
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-document-createdocumentfragment
|
// http://dom.spec.whatwg.org/#dom-document-createdocumentfragment
|
||||||
fn CreateDocumentFragment(self) -> Temporary<DocumentFragment> {
|
fn CreateDocumentFragment(self) -> Temporary<DocumentFragment> {
|
||||||
DocumentFragment::new(self)
|
DocumentFragment::new(self)
|
||||||
|
|
|
@ -40,14 +40,16 @@ interface Document : Node {
|
||||||
[NewObject, Throws]
|
[NewObject, Throws]
|
||||||
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
|
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
|
||||||
|
|
||||||
[NewObject, Throws]
|
|
||||||
Attr createAttribute(DOMString localName);
|
|
||||||
|
|
||||||
[NewObject, Throws]
|
[NewObject, Throws]
|
||||||
Node importNode(Node node, optional boolean deep = false);
|
Node importNode(Node node, optional boolean deep = false);
|
||||||
[Throws]
|
[Throws]
|
||||||
Node adoptNode(Node node);
|
Node adoptNode(Node node);
|
||||||
|
|
||||||
|
[NewObject, Throws]
|
||||||
|
Attr createAttribute(DOMString localName);
|
||||||
|
[NewObject, Throws]
|
||||||
|
Attr createAttributeNS(DOMString? namespace, DOMString localName);
|
||||||
|
|
||||||
[NewObject, Throws]
|
[NewObject, Throws]
|
||||||
Event createEvent(DOMString interface_);
|
Event createEvent(DOMString interface_);
|
||||||
|
|
||||||
|
|
|
@ -90,9 +90,6 @@
|
||||||
[Document interface: operation importNode(Node,boolean)]
|
[Document interface: operation importNode(Node,boolean)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Document interface: operation createAttributeNS(DOMString,DOMString)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: operation createNodeIterator(Node,unsigned long,NodeFilter)]
|
[Document interface: operation createNodeIterator(Node,unsigned long,NodeFilter)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -141,9 +138,6 @@
|
||||||
[Document interface: xmlDoc must inherit property "origin" with the proper type (3)]
|
[Document interface: xmlDoc must inherit property "origin" with the proper type (3)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Document interface: calling createAttributeNS(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on xmlDoc with too few arguments must throw TypeError]
|
[Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on xmlDoc with too few arguments must throw TypeError]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -1020,9 +1014,6 @@
|
||||||
[DOMTokenList interface object length]
|
[DOMTokenList interface object length]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Document interface: xmlDoc must inherit property "createAttributeNS" with the proper type (22)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: xmlDoc must inherit property "createNodeIterator" with the proper type (25)]
|
[Document interface: xmlDoc must inherit property "createNodeIterator" with the proper type (25)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1035,12 +1035,6 @@
|
||||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "origin" with the proper type (3)]
|
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "origin" with the proper type (3)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttributeNS" with the proper type (22)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: calling createAttributeNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "createNodeIterator" with the proper type (25)]
|
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "createNodeIterator" with the proper type (25)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue