From 026bacafb3743b946a201e584f089567bfc2e583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 3 Dec 2017 23:51:20 +0100 Subject: [PATCH] style: Inline the Rust bits of GetDocumentState. Bug: 1422633 Reviewed-by: xidorn MozReview-Commit-ID: 9zvZF72ljS --- components/style/gecko/wrapper.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 9bbb07cb1c4..75558dffcf9 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -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]