style: Inline the Rust bits of GetDocumentState.

Bug: 1422633
Reviewed-by: xidorn
MozReview-Commit-ID: 9zvZF72ljS
This commit is contained in:
Emilio Cobos Álvarez 2017-12-03 23:51:20 +01:00
parent dcd81b92e0
commit 026bacafb3
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -29,7 +29,7 @@ use gecko::selector_parser::{SelectorImpl, NonTSPseudoClass, PseudoElement};
use gecko::snapshot_helpers;
use gecko_bindings::bindings;
use gecko_bindings::bindings::{Gecko_ConstructStyleChildrenIterator, Gecko_DestroyStyleChildrenIterator};
use gecko_bindings::bindings::{Gecko_DocumentState, Gecko_ElementState, Gecko_GetDocumentLWTheme};
use gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWTheme};
use gecko_bindings::bindings::{Gecko_GetLastChild, Gecko_GetNextStyleChild};
use gecko_bindings::bindings::{Gecko_IsRootElement, Gecko_MatchesElement, Gecko_Namespace};
use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
@ -658,12 +658,11 @@ impl<'le> GeckoElement<'le> {
unsafe { Gecko_ElementState(self.0) }
}
#[inline]
fn document_state(&self) -> DocumentState {
let node = self.as_node();
unsafe {
let states = Gecko_DocumentState(node.owner_doc().0);
DocumentState::from_bits_truncate(states)
}
DocumentState::from_bits_truncate(
self.as_node().owner_doc().0.mDocumentState.mStates
)
}
#[inline]