servo: Merge #13673 - Don't pref-gate properties in geckolib mode (from Manishearth:no-prefs-geckolib); r=emilio

This led to me wasting a lot of time trying to figure out why my column-count implementation in gecko didn't work.

We might eventually want to hook into the Gecko prefs, but the mechanism would probably be different

r? @emilio

Source-Repo: https://github.com/servo/servo
Source-Revision: 960d884fd4dd2ad5dabfb4dd9d52e50f9d5c292c
This commit is contained in:
Manish Goregaokar 2016-10-10 08:11:32 -05:00
Родитель 750768b2f3
Коммит fbe2016107
3 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -60,7 +60,7 @@
match_ignore_ascii_case! { try!(input.expect_ident()), match_ignore_ascii_case! { try!(input.expect_ident()),
% for value in values: % for value in values:
"${value}" => { "${value}" => {
% if value in experimental_values: % if value in experimental_values and product == "servo":
if !::util::prefs::PREFS.get("layout.${value}.enabled") if !::util::prefs::PREFS.get("layout.${value}.enabled")
.as_boolean().unwrap_or(false) { .as_boolean().unwrap_or(false) {
return Err(()) return Err(())

Просмотреть файл

@ -767,7 +767,7 @@ impl PropertyDeclaration {
return PropertyDeclarationParseResult::UnknownProperty return PropertyDeclarationParseResult::UnknownProperty
} }
% endif % endif
% if property.experimental: % if property.experimental and product == "servo":
if !::util::prefs::PREFS.get("${property.experimental}") if !::util::prefs::PREFS.get("${property.experimental}")
.as_boolean().unwrap_or(false) { .as_boolean().unwrap_or(false) {
return PropertyDeclarationParseResult::ExperimentalProperty return PropertyDeclarationParseResult::ExperimentalProperty
@ -797,7 +797,7 @@ impl PropertyDeclaration {
return PropertyDeclarationParseResult::UnknownProperty return PropertyDeclarationParseResult::UnknownProperty
} }
% endif % endif
% if shorthand.experimental: % if shorthand.experimental and product == "servo":
if !::util::prefs::PREFS.get("${shorthand.experimental}") if !::util::prefs::PREFS.get("${shorthand.experimental}")
.as_boolean().unwrap_or(false) { .as_boolean().unwrap_or(false) {
return PropertyDeclarationParseResult::ExperimentalProperty return PropertyDeclarationParseResult::ExperimentalProperty

Просмотреть файл

@ -504,7 +504,8 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace)) Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace))
}, },
"viewport" => { "viewport" => {
if ::util::prefs::PREFS.get("layout.viewport.enabled").as_boolean().unwrap_or(false) { if ::util::prefs::PREFS.get("layout.viewport.enabled").as_boolean().unwrap_or(false) ||
cfg!(feature = "gecko") {
Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport)) Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport))
} else { } else {
Err(()) Err(())