mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #7545 - jgraham:get_pref_option, r=jdm
Update prefs API to return an Option<bool>. This allows for situations where there is no reasonable default to apply for the pref value e.g. when we are just listing values <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7545) <!-- Reviewable:end -->
This commit is contained in:
commit
9d42179900
7 changed files with 12 additions and 12 deletions
|
@ -494,7 +494,7 @@ pub mod longhands {
|
|||
% for value in values[:-1]:
|
||||
"${value}" => {
|
||||
% if value in experimental_values:
|
||||
if !::util::prefs::get_pref("layout.${value}.enabled", false) {
|
||||
if !::util::prefs::get_pref("layout.${value}.enabled").unwrap_or(false) {
|
||||
return Err(())
|
||||
}
|
||||
% endif
|
||||
|
@ -504,7 +504,7 @@ pub mod longhands {
|
|||
% for value in values[-1:]:
|
||||
"${value}" => {
|
||||
% if value in experimental_values:
|
||||
if !::util::prefs::get_pref("layout.${value}.enabled", false) {
|
||||
if !::util::prefs::get_pref("layout.${value}.enabled".unwrap_or(false) {
|
||||
return Err(())
|
||||
}
|
||||
% endif
|
||||
|
@ -5794,7 +5794,7 @@ impl PropertyDeclaration {
|
|||
% if property.derived_from is None:
|
||||
"${property.name}" => {
|
||||
% if property.experimental:
|
||||
if !::util::prefs::get_pref("${property.experimental}", false) {
|
||||
if !::util::prefs::get_pref("${property.experimental}").unwrap_or(false) {
|
||||
return PropertyDeclarationParseResult::ExperimentalProperty
|
||||
}
|
||||
% endif
|
||||
|
@ -5813,7 +5813,7 @@ impl PropertyDeclaration {
|
|||
% for shorthand in SHORTHANDS:
|
||||
"${shorthand.name}" => {
|
||||
% if shorthand.experimental:
|
||||
if !::util::prefs::get_pref("${shorthand.experimental}", false) {
|
||||
if !::util::prefs::get_pref("${shorthand.experimental}").unwrap_or(false) {
|
||||
return PropertyDeclarationParseResult::ExperimentalProperty
|
||||
}
|
||||
% endif
|
||||
|
|
|
@ -429,7 +429,7 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
|
|||
Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace))
|
||||
},
|
||||
"viewport" => {
|
||||
if ::util::prefs::get_pref("layout.viewport.enabled", false) {
|
||||
if ::util::prefs::get_pref("layout.viewport.enabled").unwrap_or(false) {
|
||||
Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport))
|
||||
} else {
|
||||
Err(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue