mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Rename some 'new' functions to 'new_inherited'.
This commit is contained in:
parent
3fe50711d4
commit
7f4283f4bc
8 changed files with 10 additions and 10 deletions
|
@ -15,9 +15,9 @@ pub struct CharacterData {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CharacterData {
|
impl CharacterData {
|
||||||
pub fn new(id: NodeTypeId, data: ~str, document: AbstractDocument) -> CharacterData {
|
pub fn new_inherited(id: NodeTypeId, data: ~str, document: AbstractDocument) -> CharacterData {
|
||||||
CharacterData {
|
CharacterData {
|
||||||
node: Node::new(id, document),
|
node: Node::new_inherited(id, document),
|
||||||
data: data
|
data: data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub struct Comment {
|
||||||
impl Comment {
|
impl Comment {
|
||||||
pub fn new_inherited(text: ~str, document: AbstractDocument) -> Comment {
|
pub fn new_inherited(text: ~str, document: AbstractDocument) -> Comment {
|
||||||
Comment {
|
Comment {
|
||||||
element: CharacterData::new(CommentNodeTypeId, text, document)
|
element: CharacterData::new_inherited(CommentNodeTypeId, text, document)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ impl DocumentFragment {
|
||||||
/// Creates a new DocumentFragment.
|
/// Creates a new DocumentFragment.
|
||||||
pub fn new_inherited(document: AbstractDocument) -> DocumentFragment {
|
pub fn new_inherited(document: AbstractDocument) -> DocumentFragment {
|
||||||
DocumentFragment {
|
DocumentFragment {
|
||||||
node: Node::new(DocumentFragmentNodeTypeId, document),
|
node: Node::new_inherited(DocumentFragmentNodeTypeId, document),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ impl DocumentType {
|
||||||
document: AbstractDocument)
|
document: AbstractDocument)
|
||||||
-> DocumentType {
|
-> DocumentType {
|
||||||
DocumentType {
|
DocumentType {
|
||||||
node: Node::new(DoctypeNodeTypeId, document),
|
node: Node::new_inherited(DoctypeNodeTypeId, document),
|
||||||
name: name,
|
name: name,
|
||||||
public_id: public_id.unwrap_or(~""),
|
public_id: public_id.unwrap_or(~""),
|
||||||
system_id: system_id.unwrap_or(~""),
|
system_id: system_id.unwrap_or(~""),
|
||||||
|
|
|
@ -151,9 +151,9 @@ impl ElementLike for Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self> Element {
|
impl<'self> Element {
|
||||||
pub fn new(type_id: ElementTypeId, tag_name: ~str, namespace: Namespace, document: AbstractDocument) -> Element {
|
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, namespace: Namespace, document: AbstractDocument) -> Element {
|
||||||
Element {
|
Element {
|
||||||
node: Node::new(ElementNodeTypeId(type_id), document),
|
node: Node::new_inherited(ElementNodeTypeId(type_id), document),
|
||||||
tag_name: tag_name,
|
tag_name: tag_name,
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
attrs: HashMap::new(),
|
attrs: HashMap::new(),
|
||||||
|
|
|
@ -18,7 +18,7 @@ pub struct HTMLElement {
|
||||||
impl HTMLElement {
|
impl HTMLElement {
|
||||||
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLElement {
|
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLElement {
|
||||||
HTMLElement {
|
HTMLElement {
|
||||||
element: Element::new(type_id, tag_name, namespace::HTML, document)
|
element: Element::new_inherited(type_id, tag_name, namespace::HTML, document)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -625,7 +625,7 @@ impl Node<ScriptView> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(type_id: NodeTypeId, doc: AbstractDocument) -> Node<ScriptView> {
|
pub fn new_inherited(type_id: NodeTypeId, doc: AbstractDocument) -> Node<ScriptView> {
|
||||||
Node::new_(type_id, Some(doc))
|
Node::new_(type_id, Some(doc))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub struct Text {
|
||||||
impl Text {
|
impl Text {
|
||||||
pub fn new_inherited(text: ~str, document: AbstractDocument) -> Text {
|
pub fn new_inherited(text: ~str, document: AbstractDocument) -> Text {
|
||||||
Text {
|
Text {
|
||||||
element: CharacterData::new(TextNodeTypeId, text, document)
|
element: CharacterData::new_inherited(TextNodeTypeId, text, document)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue