mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Pass immutable self to Node::{SetNodeValue, SetTextContent}.
This commit is contained in:
parent
34c42f6acb
commit
687722da2d
1 changed files with 4 additions and 6 deletions
|
@ -1349,9 +1349,9 @@ pub trait NodeMethods {
|
||||||
fn GetPreviousSibling(&self) -> Option<Temporary<Node>>;
|
fn GetPreviousSibling(&self) -> Option<Temporary<Node>>;
|
||||||
fn GetNextSibling(&self) -> Option<Temporary<Node>>;
|
fn GetNextSibling(&self) -> Option<Temporary<Node>>;
|
||||||
fn GetNodeValue(&self) -> Option<DOMString>;
|
fn GetNodeValue(&self) -> Option<DOMString>;
|
||||||
fn SetNodeValue(&mut self, val: Option<DOMString>) -> ErrorResult;
|
fn SetNodeValue(&self, val: Option<DOMString>) -> ErrorResult;
|
||||||
fn GetTextContent(&self) -> Option<DOMString>;
|
fn GetTextContent(&self) -> Option<DOMString>;
|
||||||
fn SetTextContent(&mut self, value: Option<DOMString>) -> ErrorResult;
|
fn SetTextContent(&self, value: Option<DOMString>) -> ErrorResult;
|
||||||
fn InsertBefore(&self, node: &JSRef<Node>, child: Option<JSRef<Node>>) -> Fallible<Temporary<Node>>;
|
fn InsertBefore(&self, node: &JSRef<Node>, child: Option<JSRef<Node>>) -> Fallible<Temporary<Node>>;
|
||||||
fn AppendChild(&self, node: &JSRef<Node>) -> Fallible<Temporary<Node>>;
|
fn AppendChild(&self, node: &JSRef<Node>) -> Fallible<Temporary<Node>>;
|
||||||
fn ReplaceChild(&self, node: &JSRef<Node>, child: &JSRef<Node>) -> Fallible<Temporary<Node>>;
|
fn ReplaceChild(&self, node: &JSRef<Node>, child: &JSRef<Node>) -> Fallible<Temporary<Node>>;
|
||||||
|
@ -1493,8 +1493,7 @@ 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(&mut self, val: Option<DOMString>)
|
fn SetNodeValue(&self, val: Option<DOMString>) -> ErrorResult {
|
||||||
-> ErrorResult {
|
|
||||||
match self.type_id {
|
match self.type_id {
|
||||||
CommentNodeTypeId |
|
CommentNodeTypeId |
|
||||||
TextNodeTypeId |
|
TextNodeTypeId |
|
||||||
|
@ -1533,8 +1532,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(&mut self, value: Option<DOMString>)
|
fn SetTextContent(&self, value: Option<DOMString>) -> ErrorResult {
|
||||||
-> ErrorResult {
|
|
||||||
let value = null_str_as_empty(&value);
|
let value = null_str_as_empty(&value);
|
||||||
match self.type_id {
|
match self.type_id {
|
||||||
DocumentFragmentNodeTypeId |
|
DocumentFragmentNodeTypeId |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue