diff options
author | Xidorn Quan <me@upsuper.org> | 2018-03-28 09:45:28 +1100 |
---|---|---|
committer | Xidorn Quan <me@upsuper.org> | 2018-03-28 09:50:14 +1100 |
commit | e57b6c65a0b8041cc06aaebf314a48de1a404938 (patch) | |
tree | 8de30f57c1a37187106a4bccd79810132b272ead | |
parent | 911f174b708fd5b880998a1b2e23787ca3b223d7 (diff) | |
download | servo-e57b6c65a0b8041cc06aaebf314a48de1a404938.tar.gz servo-e57b6c65a0b8041cc06aaebf314a48de1a404938.zip |
Move matching logic of :-moz-table-border-nonzero and :-moz-browser-frame into individual binding functions.
-rw-r--r-- | components/style/gecko/generated/bindings.rs | 13 | ||||
-rw-r--r-- | components/style/gecko/wrapper.rs | 9 |
2 files changed, 11 insertions, 11 deletions
diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index 4e76b4679e0..02401664525 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -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; @@ -628,12 +627,6 @@ 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, override_lang: *mut nsAtom, @@ -648,6 +641,12 @@ 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, attribute: *mut nsAtom, diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index f4081ed7aa5..9c32d301c13 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -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() |