mirror of
https://github.com/servo/servo.git
synced 2025-08-24 22:58:21 +01:00
style: Change StaticPrefs
from a class to a namespace.
This doesn't change the way C++ code uses static prefs. But it does slightly change how Rust code uses static prefs, specifically the name generated by bindgen is slightly different. The commit also improves some comments. Differential Revision: https://phabricator.services.mozilla.com/D35764
This commit is contained in:
parent
84a5ab2ba8
commit
323221051f
14 changed files with 19 additions and 19 deletions
|
@ -271,7 +271,7 @@ impl Device {
|
|||
return true;
|
||||
}
|
||||
let document_color_use =
|
||||
unsafe { structs::StaticPrefs_sVarCache_browser_display_document_color_use };
|
||||
unsafe { structs::StaticPrefs::sVarCache_browser_display_document_color_use };
|
||||
let prefs = self.pref_sheet_prefs();
|
||||
match document_color_use {
|
||||
1 => true,
|
||||
|
|
|
@ -112,7 +112,7 @@ impl PseudoElement {
|
|||
% for pseudo in PSEUDOS:
|
||||
${pseudo_element_variant(pseudo)} =>
|
||||
% if pseudo.is_tree_pseudo_element():
|
||||
if unsafe { structs::StaticPrefs_sVarCache_layout_css_xul_tree_pseudos_content_enabled } {
|
||||
if unsafe { structs::StaticPrefs::sVarCache_layout_css_xul_tree_pseudos_content_enabled } {
|
||||
0
|
||||
} else {
|
||||
structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME
|
||||
|
@ -210,7 +210,7 @@ impl PseudoElement {
|
|||
return PseudoElement::tree_pseudo_element(name, Box::new([]))
|
||||
}
|
||||
if unsafe {
|
||||
structs::StaticPrefs_sVarCache_layout_css_unknown_webkit_pseudo_element
|
||||
structs::StaticPrefs::sVarCache_layout_css_unknown_webkit_pseudo_element
|
||||
} {
|
||||
const WEBKIT_PREFIX: &str = "-webkit-";
|
||||
if starts_with_ignore_ascii_case(name, WEBKIT_PREFIX) {
|
||||
|
|
|
@ -175,7 +175,7 @@ impl NonTSPseudoClass {
|
|||
// For pseudo-classes with pref, the availability in content
|
||||
// depends on the pref.
|
||||
NonTSPseudoClass::Fullscreen => unsafe {
|
||||
mozilla::StaticPrefs_sVarCache_full_screen_api_unprefix_enabled
|
||||
mozilla::StaticPrefs::sVarCache_full_screen_api_unprefix_enabled
|
||||
},
|
||||
// Otherwise, a pseudo-class is enabled in content when it
|
||||
// doesn't have any enabled flag.
|
||||
|
@ -355,7 +355,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
#[inline]
|
||||
fn parse_part(&self) -> bool {
|
||||
self.chrome_rules_enabled() ||
|
||||
unsafe { structs::StaticPrefs_sVarCache_layout_css_shadow_parts_enabled }
|
||||
unsafe { structs::StaticPrefs::sVarCache_layout_css_shadow_parts_enabled }
|
||||
}
|
||||
|
||||
fn parse_non_ts_pseudo_class(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue