auto merge of #4056 : brunoabinader/servo/css-updates, r=SimonSapin

TSIA
This commit is contained in:
bors-servo 2014-11-21 08:06:31 -07:00
commit 4c1ca2fb96

View file

@ -1615,9 +1615,7 @@ impl PropertyDeclaration {
result_list: &mut Vec<PropertyDeclaration>,
base_url: &Url,
seen: &mut PropertyBitField) -> PropertyDeclarationParseResult {
// FIXME: local variable to work around Rust #10683
let name_lower = name.as_slice().to_ascii_lower();
match name_lower.as_slice() {
match name.to_ascii_lower().as_slice() {
% for property in LONGHANDS:
% if property.derived_from is None:
"${property.name}" => {
@ -1895,20 +1893,6 @@ fn initial_writing_mode_is_empty() {
assert_eq!(get_writing_mode(INITIAL_VALUES.get_inheritedbox()), WritingMode::empty())
}
/// This only exists to limit the scope of #[allow(experimental)]
/// FIXME: remove this when Arc::make_unique() is not experimental anymore.
trait ArcExperimental<T> {
fn make_unique_experimental<'a>(&'a mut self) -> &'a mut T;
}
impl<T: Send + Sync + Clone> ArcExperimental<T> for Arc<T> {
#[inline]
#[allow(experimental)]
fn make_unique_experimental<'a>(&'a mut self) -> &'a mut T {
self.make_unique()
}
}
/// Fast path for the function below. Only computes new inherited styles.
#[allow(unused_mut)]
fn cascade_with_cached_declarations(applicable_declarations: &[DeclarationBlock],
@ -1959,7 +1943,7 @@ fn cascade_with_cached_declarations(applicable_declarations: &[DeclarationBlock]
.clone()
}
};
style_${style_struct.ident}.make_unique_experimental()
style_${style_struct.ident}.make_unique()
.${property.ident} = computed_value;
% endif
@ -1971,7 +1955,7 @@ fn cascade_with_cached_declarations(applicable_declarations: &[DeclarationBlock]
% endif
% for derived in DERIVED_LONGHANDS[property.name]:
style_${derived.style_struct.ident}
.make_unique_experimental()
.make_unique()
.${derived.ident} =
longhands::${derived.ident}
::derive_from_${property.ident}(
@ -2165,13 +2149,13 @@ pub fn cascade(applicable_declarations: &[DeclarationBlock],
.clone()
}
};
style_${style_struct.ident}.make_unique_experimental()
style_${style_struct.ident}.make_unique()
.${property.ident} = computed_value;
% if property.name in DERIVED_LONGHANDS:
% for derived in DERIVED_LONGHANDS[property.name]:
style_${derived.style_struct.ident}
.make_unique_experimental()
.make_unique()
.${derived.ident} =
longhands::${derived.ident}
::derive_from_${property.ident}(
@ -2193,7 +2177,7 @@ pub fn cascade(applicable_declarations: &[DeclarationBlock],
// The initial value of border-*-width may be changed at computed value time.
{
let border = style_border.make_unique_experimental();
let border = style_border.make_unique();
% for side in ["top", "right", "bottom", "left"]:
// Like calling to_computed_value, which wouldn't type check.
if !context.border_${side}_present {
@ -2204,7 +2188,7 @@ pub fn cascade(applicable_declarations: &[DeclarationBlock],
// The initial value of display may be changed at computed value time.
if !seen.get_display() {
let box_ = style_box_.make_unique_experimental();
let box_ = style_box_.make_unique();
box_.display = longhands::display::to_computed_value(box_.display, &context);
}
@ -2238,7 +2222,7 @@ pub fn cascade_anonymous(parent_style: &ComputedValues) -> ComputedValues {
writing_mode: parent_style.writing_mode,
};
{
let border = result.border.make_unique_experimental();
let border = result.border.make_unique();
% for side in ["top", "right", "bottom", "left"]:
// Like calling to_computed_value, which wouldn't type check.
border.border_${side}_width = Au(0);