Merge branch 'master' into calc

This commit is contained in:
Simon Sapin 2015-09-01 18:39:16 +02:00
commit 80d471d5cf
400 changed files with 8129 additions and 11782 deletions

View file

@ -51,7 +51,7 @@ class Longhand(object):
self.ident = to_rust_ident(name)
self.camel_case = to_camel_case(self.ident)
self.style_struct = THIS_STYLE_STRUCT
self.experimental = experimental
self.experimental = ("layout.%s.enabled" % name) if experimental else None
self.custom_cascade = custom_cascade
if derived_from is None:
self.derived_from = None
@ -64,7 +64,7 @@ class Shorthand(object):
self.ident = to_rust_ident(name)
self.camel_case = to_camel_case(self.ident)
self.derived_from = None
self.experimental = experimental
self.experimental = ("layout.%s.enabled" % name) if experimental else None
self.sub_properties = [LONGHANDS_BY_NAME[s] for s in sub_properties]
class StyleStruct(object):
@ -450,7 +450,9 @@ pub mod longhands {
% for value in values[:-1]:
"${value}" => {
% if value in experimental_values:
if !::util::opts::experimental_enabled() { return Err(()) }
if !::util::prefs::get_pref("layout.${value}.enabled", false) {
return Err(())
}
% endif
Ok(computed_value::T::${to_rust_ident(value)})
},
@ -458,7 +460,9 @@ pub mod longhands {
% for value in values[-1:]:
"${value}" => {
% if value in experimental_values:
if !::util::opts::experimental_enabled() { return Err(()) }
if !::util::prefs::get_pref("layout.${value}.enabled", false) {
return Err(())
}
% endif
Ok(computed_value::T::${to_rust_ident(value)})
}
@ -5726,7 +5730,7 @@ impl PropertyDeclaration {
% if property.derived_from is None:
"${property.name}" => {
% if property.experimental:
if !::util::opts::experimental_enabled() {
if !::util::prefs::get_pref("${property.experimental}", false) {
return PropertyDeclarationParseResult::ExperimentalProperty
}
% endif
@ -5745,7 +5749,7 @@ impl PropertyDeclaration {
% for shorthand in SHORTHANDS:
"${shorthand.name}" => {
% if shorthand.experimental:
if !::util::opts::experimental_enabled() {
if !::util::prefs::get_pref("${shorthand.experimental}", false) {
return PropertyDeclarationParseResult::ExperimentalProperty
}
% endif
@ -6587,6 +6591,9 @@ macro_rules! css_properties_accessors {
$macro_name! {
% for property in SHORTHANDS + LONGHANDS:
% if property.derived_from is None:
% if '-' in property.name:
[${property.ident.capitalize()}, Set${property.ident.capitalize()}, "${property.name}"],
% endif
% if property != LONGHANDS[-1]:
[${property.camel_case}, Set${property.camel_case}, "${property.name}"],
% else: