mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
node.textContent and node.nodeValue should not throw
This commit is contained in:
parent
76ba6f669e
commit
6b78b93be1
2 changed files with 6 additions and 7 deletions
|
@ -18,7 +18,7 @@ use dom::bindings::codegen::InheritTypes::{CharacterDataCast, NodeBase, NodeDeri
|
||||||
use dom::bindings::codegen::InheritTypes::{ProcessingInstructionCast, EventTargetCast};
|
use dom::bindings::codegen::InheritTypes::{ProcessingInstructionCast, EventTargetCast};
|
||||||
use dom::bindings::codegen::InheritTypes::{HTMLLegendElementDerived, HTMLFieldSetElementDerived};
|
use dom::bindings::codegen::InheritTypes::{HTMLLegendElementDerived, HTMLFieldSetElementDerived};
|
||||||
use dom::bindings::codegen::InheritTypes::HTMLOptGroupElementDerived;
|
use dom::bindings::codegen::InheritTypes::HTMLOptGroupElementDerived;
|
||||||
use dom::bindings::error::{ErrorResult, Fallible, NotFound, HierarchyRequest, Syntax};
|
use dom::bindings::error::{Fallible, NotFound, HierarchyRequest, Syntax};
|
||||||
use dom::bindings::global::{GlobalRef, Window};
|
use dom::bindings::global::{GlobalRef, Window};
|
||||||
use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, Root, OptionalUnrootable};
|
use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, Root, OptionalUnrootable};
|
||||||
use dom::bindings::js::{OptionalSettable, TemporaryPushable, OptionalRootedRootable};
|
use dom::bindings::js::{OptionalSettable, TemporaryPushable, OptionalRootedRootable};
|
||||||
|
@ -1557,14 +1557,14 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-nodevalue
|
// http://dom.spec.whatwg.org/#dom-node-nodevalue
|
||||||
fn SetNodeValue(&self, val: Option<DOMString>) -> ErrorResult {
|
fn SetNodeValue(&self, val: Option<DOMString>) {
|
||||||
match self.type_id {
|
match self.type_id {
|
||||||
CommentNodeTypeId |
|
CommentNodeTypeId |
|
||||||
TextNodeTypeId |
|
TextNodeTypeId |
|
||||||
ProcessingInstructionNodeTypeId => {
|
ProcessingInstructionNodeTypeId => {
|
||||||
self.SetTextContent(val)
|
self.SetTextContent(val)
|
||||||
}
|
}
|
||||||
_ => Ok(())
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1596,7 +1596,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-textcontent
|
// http://dom.spec.whatwg.org/#dom-node-textcontent
|
||||||
fn SetTextContent(&self, value: Option<DOMString>) -> ErrorResult {
|
fn SetTextContent(&self, value: Option<DOMString>) {
|
||||||
let value = null_str_as_empty(&value);
|
let value = null_str_as_empty(&value);
|
||||||
match self.type_id {
|
match self.type_id {
|
||||||
DocumentFragmentNodeTypeId |
|
DocumentFragmentNodeTypeId |
|
||||||
|
@ -1627,7 +1627,6 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
DoctypeNodeTypeId |
|
DoctypeNodeTypeId |
|
||||||
DocumentNodeTypeId => {}
|
DocumentNodeTypeId => {}
|
||||||
}
|
}
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-insertbefore
|
// http://dom.spec.whatwg.org/#dom-node-insertbefore
|
||||||
|
|
|
@ -46,9 +46,9 @@ interface Node : EventTarget {
|
||||||
[Pure]
|
[Pure]
|
||||||
readonly attribute Node? nextSibling;
|
readonly attribute Node? nextSibling;
|
||||||
|
|
||||||
[SetterThrows, Pure]
|
[Pure]
|
||||||
attribute DOMString? nodeValue;
|
attribute DOMString? nodeValue;
|
||||||
[SetterThrows, Pure]
|
[Pure]
|
||||||
attribute DOMString? textContent;
|
attribute DOMString? textContent;
|
||||||
void normalize();
|
void normalize();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue