servo: Merge #16810 - Handle mBoolFlags living on nsWrapperCache (from bholley:bool_flags_wrapper_cache); r=emilio

https://bugzilla.mozilla.org/show_bug.cgi?id=1363375

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b4726c0557b9ad1bdbefb57929f05dbc65f2cf9

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f0de6e5c636db4ddd284112d4f1620d94679b92d
This commit is contained in:
Bobby Holley 2017-05-11 04:37:50 -05:00
parent d1954ff1cd
commit c5e2ffebd7
3 changed files with 962 additions and 878 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -117,6 +117,17 @@ impl<'ln> GeckoNode<'ln> {
unsafe { &*self.0.mNodeInfo.mRawPtr }
}
// These live in different locations depending on processor architecture.
#[cfg(target_pointer_width = "64")]
fn bool_flags(&self) -> u32 {
(self.0)._base._base_1.mBoolFlags
}
#[cfg(target_pointer_width = "32")]
fn bool_flags(&self) -> u32 {
(self.0).mBoolFlags
}
fn owner_doc(&self) -> &structs::nsIDocument {
debug_assert!(!self.node_info().mDocument.is_null());
unsafe { &*self.node_info().mDocument }
@ -177,7 +188,7 @@ impl<'ln> GeckoNode<'ln> {
impl<'ln> NodeInfo for GeckoNode<'ln> {
fn is_element(&self) -> bool {
use gecko_bindings::structs::nsINode_BooleanFlag;
self.0.mBoolFlags & (1u32 << nsINode_BooleanFlag::NodeIsElement as u32) != 0
self.bool_flags() & (1u32 << nsINode_BooleanFlag::NodeIsElement as u32) != 0
}
fn is_text_node(&self) -> bool {