diff options
Diffstat (limited to 'src/components/script')
-rw-r--r-- | src/components/script/dom/bindings/codegen/Bindings.conf | 3 | ||||
-rw-r--r-- | src/components/script/dom/node.rs | 7 | ||||
-rw-r--r-- | src/components/script/dom/webidls/Node.webidl | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/components/script/dom/bindings/codegen/Bindings.conf b/src/components/script/dom/bindings/codegen/Bindings.conf index b9fd8d9c1d8..f99bbf890b0 100644 --- a/src/components/script/dom/bindings/codegen/Bindings.conf +++ b/src/components/script/dom/bindings/codegen/Bindings.conf @@ -323,7 +323,8 @@ DOMInterfaces = { 'nodeValue', 'removeChild', 'textContent', - 'childNodes' + 'childNodes', + 'contains', ] }, diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 6af9bff6331..8857e503b64 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -1538,8 +1538,11 @@ impl Node { 0 } - pub fn Contains(&self, _other: Option<AbstractNode>) -> bool { - false + pub fn Contains(&self, abstract_self: AbstractNode, maybe_other: Option<AbstractNode>) -> bool { + match maybe_other { + None => false, + Some(other) => abstract_self.is_inclusive_ancestor_of(other) + } } pub fn LookupPrefix(&self, _prefix: Option<DOMString>) -> Option<DOMString> { diff --git a/src/components/script/dom/webidls/Node.webidl b/src/components/script/dom/webidls/Node.webidl index 1a9d9d53bb3..ba48fd94e11 100644 --- a/src/components/script/dom/webidls/Node.webidl +++ b/src/components/script/dom/webidls/Node.webidl @@ -78,7 +78,7 @@ interface Node : EventTarget { const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical unsigned short compareDocumentPosition(Node other); - //boolean contains(Node? other); //XXXjdm we don't deal well with Node? parameters + boolean contains(Node? other); DOMString? lookupPrefix(DOMString? namespace); DOMString? lookupNamespaceURI(DOMString? prefix); |