Move matching logic of :-moz-table-border-nonzero and :-moz-browser-frame into individual binding functions.

This commit is contained in:
Xidorn Quan 2018-03-28 09:45:28 +11:00
parent 911f174b70
commit e57b6c65a0
2 changed files with 11 additions and 11 deletions

View file

@ -54,7 +54,6 @@ use gecko_bindings::structs::RawServoSelectorList;
use gecko_bindings::structs::RawServoSourceSizeList;
use gecko_bindings::structs::RefPtr;
use gecko_bindings::structs::RustString;
use gecko_bindings::structs::CSSPseudoClassType;
use gecko_bindings::structs::CSSPseudoElementType;
use gecko_bindings::structs::ServoTraversalFlags;
use gecko_bindings::structs::ComputedTimingFunction_BeforeFlag;
@ -627,12 +626,6 @@ extern "C" {
extern "C" {
pub fn Gecko_IsRootElement(element: RawGeckoElementBorrowed) -> bool;
}
extern "C" {
pub fn Gecko_MatchesElement(
type_: CSSPseudoClassType,
element: RawGeckoElementBorrowed,
) -> bool;
}
extern "C" {
pub fn Gecko_MatchLang(
element: RawGeckoElementBorrowed,
@ -647,6 +640,12 @@ extern "C" {
extern "C" {
pub fn Gecko_GetDocumentLWTheme(aDocument: *const nsIDocument) -> nsIDocument_DocumentTheme;
}
extern "C" {
pub fn Gecko_IsTableBorderNonzero(element: RawGeckoElementBorrowed) -> bool;
}
extern "C" {
pub fn Gecko_IsBrowserFrame(element: RawGeckoElementBorrowed) -> bool;
}
extern "C" {
pub fn Gecko_AtomAttrValue(
element: RawGeckoElementBorrowed,

View file

@ -32,7 +32,6 @@ 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_GetLastChild, Gecko_GetNextStyleChild};
use gecko_bindings::bindings::{Gecko_IsRootElement, Gecko_MatchesElement};
use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
use gecko_bindings::bindings::Gecko_ClassOrClassList;
use gecko_bindings::bindings::Gecko_ElementHasAnimations;
@ -1996,7 +1995,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
}
unsafe {
Gecko_IsRootElement(self.0)
bindings::Gecko_IsRootElement(self.0)
}
}
@ -2124,9 +2123,11 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
NonTSPseudoClass::MozUseShadowTreeRoot => {
self.is_root_of_use_element_shadow_tree()
}
NonTSPseudoClass::MozTableBorderNonzero |
NonTSPseudoClass::MozTableBorderNonzero => unsafe {
bindings::Gecko_IsTableBorderNonzero(self.0)
}
NonTSPseudoClass::MozBrowserFrame => unsafe {
Gecko_MatchesElement(pseudo_class.to_gecko_pseudoclasstype().unwrap(), self.0)
bindings::Gecko_IsBrowserFrame(self.0)
},
NonTSPseudoClass::MozIsHTML => {
self.is_html_element_in_html_document()