diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 3ce69d356b7..9999503a758 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -924,9 +924,16 @@ impl Node { } // http://dom.spec.whatwg.org/#dom-node-nodevalue - pub fn SetNodeValue(&mut self, _abstract_self: &JS, _val: Option) + pub fn SetNodeValue(&mut self, abstract_self: &mut JS, val: Option) -> ErrorResult { - // FIXME (#1825) implement. + match self.type_id { + CommentNodeTypeId | + TextNodeTypeId | + ProcessingInstructionNodeTypeId => { + self.SetTextContent(abstract_self, val); + } + _ => {} + } Ok(()) } diff --git a/src/test/html/content/test_document_set_node_value.html b/src/test/html/content/test_document_set_node_value.html new file mode 100644 index 00000000000..20762a93674 --- /dev/null +++ b/src/test/html/content/test_document_set_node_value.html @@ -0,0 +1,19 @@ + + + + +
A
+

P

+ + +