Auto merge of #16810 - bholley:bool_flags_wrapper_cache, r=emilio

Handle mBoolFlags living on nsWrapperCache

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16810)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-11 04:37:50 -05:00 committed by GitHub
commit 0b4726c055
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 } 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 { fn owner_doc(&self) -> &structs::nsIDocument {
debug_assert!(!self.node_info().mDocument.is_null()); debug_assert!(!self.node_info().mDocument.is_null());
unsafe { &*self.node_info().mDocument } unsafe { &*self.node_info().mDocument }
@ -177,7 +188,7 @@ impl<'ln> GeckoNode<'ln> {
impl<'ln> NodeInfo for GeckoNode<'ln> { impl<'ln> NodeInfo for GeckoNode<'ln> {
fn is_element(&self) -> bool { fn is_element(&self) -> bool {
use gecko_bindings::structs::nsINode_BooleanFlag; 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 { fn is_text_node(&self) -> bool {