mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Merge pull request #2906 from brunoabinader/node-typeid-fix
Prefer direct member access than type_id() in Node self.type_id calls
This commit is contained in:
commit
360c7f8bf1
1 changed files with 6 additions and 6 deletions
|
@ -421,7 +421,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
|
||||||
|
|
||||||
/// Returns a string that describes this node.
|
/// Returns a string that describes this node.
|
||||||
fn debug_str(&self) -> String {
|
fn debug_str(&self) -> String {
|
||||||
format!("{:?}", self.type_id())
|
format!("{:?}", self.type_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_in_doc(&self) -> bool {
|
fn is_in_doc(&self) -> bool {
|
||||||
|
@ -465,12 +465,12 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_document(&self) -> bool {
|
fn is_document(&self) -> bool {
|
||||||
self.type_id() == DocumentNodeTypeId
|
self.type_id == DocumentNodeTypeId
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_anchor_element(&self) -> bool {
|
fn is_anchor_element(&self) -> bool {
|
||||||
self.type_id() == ElementNodeTypeId(HTMLAnchorElementTypeId)
|
self.type_id == ElementNodeTypeId(HTMLAnchorElementTypeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -480,7 +480,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_text(&self) -> bool {
|
fn is_text(&self) -> bool {
|
||||||
self.type_id() == TextNodeTypeId
|
self.type_id == TextNodeTypeId
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_hover_state(&self) -> bool {
|
fn get_hover_state(&self) -> bool {
|
||||||
|
@ -1600,7 +1600,7 @@ impl<'a> NodeMethods for JSRef<'a, 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>> {
|
||||||
|
|
||||||
// Step 1.
|
// Step 1.
|
||||||
match self.type_id() {
|
match self.type_id {
|
||||||
DocumentNodeTypeId |
|
DocumentNodeTypeId |
|
||||||
DocumentFragmentNodeTypeId |
|
DocumentFragmentNodeTypeId |
|
||||||
ElementNodeTypeId(..) => (),
|
ElementNodeTypeId(..) => (),
|
||||||
|
@ -1631,7 +1631,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 6.
|
// Step 6.
|
||||||
match self.type_id() {
|
match self.type_id {
|
||||||
DocumentNodeTypeId => {
|
DocumentNodeTypeId => {
|
||||||
match node.type_id() {
|
match node.type_id() {
|
||||||
// Step 6.1
|
// Step 6.1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue