diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2014-09-17 13:19:00 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2014-09-17 13:19:00 -0700 |
commit | 787a68336524fb9585922b9ed319a8b194fb8ee1 (patch) | |
tree | dd766824192dd26a929bd0b2ce0f5e3d9d0b7677 /components/script/dom/node.rs | |
parent | 61642d64b5c06f30fd68961e5ffd21a35dacbc4c (diff) | |
parent | 874db261046d6155b1942efa106d2e0014295d6d (diff) | |
download | servo-787a68336524fb9585922b9ed319a8b194fb8ee1.tar.gz servo-787a68336524fb9585922b9ed319a8b194fb8ee1.zip |
Merge pull request #3316 from pcwalton/use-atoms
script: Use atom comparison in more places, especially for attributes.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 9e1b73feb12..8462d652e45 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -769,16 +769,19 @@ pub trait RawLayoutNodeHelpers { } impl RawLayoutNodeHelpers for Node { + #[inline] unsafe fn get_hover_state_for_layout(&self) -> bool { (*self.unsafe_get_flags()).contains(InHoverState) } + #[inline] unsafe fn get_disabled_state_for_layout(&self) -> bool { (*self.unsafe_get_flags()).contains(InDisabledState) } + #[inline] unsafe fn get_enabled_state_for_layout(&self) -> bool { (*self.unsafe_get_flags()).contains(InEnabledState) } - + #[inline] fn type_id_for_layout(&self) -> NodeTypeId { self.type_id } @@ -1413,6 +1416,7 @@ impl Node { } } + #[inline] pub unsafe fn unsafe_get_flags(&self) -> *const NodeFlags { mem::transmute(&self.flags) } @@ -1987,7 +1991,7 @@ impl<'a> VirtualMethods for JSRef<'a, Node> { } } -impl<'a> style::TNode<JSRef<'a, Element>> for JSRef<'a, Node> { +impl<'a> style::TNode<JSRef<'a,Element>> for JSRef<'a,Node> { fn parent_node(&self) -> Option<JSRef<'a, Node>> { (self as &NodeHelpers).parent_node().map(|node| *node.root()) } @@ -2021,9 +2025,9 @@ impl<'a> style::TNode<JSRef<'a, Element>> for JSRef<'a, Node> { fn match_attr(&self, attr: &style::AttrSelector, test: |&str| -> bool) -> bool { let name = { if self.is_html_element_in_html_document() { - attr.lower_name.as_slice() + &attr.lower_name } else { - attr.name.as_slice() + &attr.name } }; match attr.namespace { |