mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Bug 1348489 - stylo: Implement :-moz-window-inactive.
This commit is contained in:
parent
9a13cf6bda
commit
17f4d0c5d9
4 changed files with 30 additions and 4 deletions
|
@ -22,7 +22,7 @@ use context::{QuirksMode, SharedStyleContext, UpdateAnimationsTasks};
|
|||
use data::ElementData;
|
||||
use dom::{self, DescendantsBit, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode};
|
||||
use dom::{OpaqueNode, PresentationalHintsSynthesizer};
|
||||
use element_state::ElementState;
|
||||
use element_state::{ElementState, DocumentState, NS_DOCUMENT_STATE_WINDOW_INACTIVE};
|
||||
use error_reporting::create_error_reporter;
|
||||
use font_metrics::{FontMetrics, FontMetricsProvider, FontMetricsQueryResult};
|
||||
use gecko::data::PerDocumentStyleData;
|
||||
|
@ -31,7 +31,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_ElementState, Gecko_GetDocumentLWTheme};
|
||||
use gecko_bindings::bindings::{Gecko_DocumentState, 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};
|
||||
|
@ -652,6 +652,14 @@ impl<'le> GeckoElement<'le> {
|
|||
unsafe { Gecko_ElementState(self.0) }
|
||||
}
|
||||
|
||||
fn document_state(&self) -> DocumentState {
|
||||
let node = self.as_node();
|
||||
unsafe {
|
||||
let states = Gecko_DocumentState(node.owner_doc());
|
||||
DocumentState::from_bits_truncate(states)
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn may_have_class(&self) -> bool {
|
||||
self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementMayHaveClass)
|
||||
|
@ -1758,6 +1766,9 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
|||
NonTSPseudoClass::MozLWThemeDarkText => {
|
||||
self.get_document_theme() == DocumentTheme::Doc_Theme_Dark
|
||||
}
|
||||
NonTSPseudoClass::MozWindowInactive => {
|
||||
self.document_state().contains(NS_DOCUMENT_STATE_WINDOW_INACTIVE)
|
||||
}
|
||||
NonTSPseudoClass::MozPlaceholder => false,
|
||||
NonTSPseudoClass::MozAny(ref sels) => {
|
||||
let old_value = context.hover_active_quirk_disabled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue