Unprefix column-rule properties in servo side. r?heycam
draft
Unprefix column-rule properties in servo side. r?heycam
MozReview-Commit-ID: KQESPzENSmT
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -2459,17 +2459,17 @@ clip-path
self.gecko.mCursor = other.gecko.mCursor;
unsafe {
Gecko_CopyCursorArrayFrom(&mut self.gecko, &other.gecko);
}
}
</%self:impl_trait>
<%self:impl_trait style_struct_name="Column"
- skip_longhands="column-count column-gap -moz-column-rule-width">
+ skip_longhands="column-count column-gap column-rule-width">
#[allow(unused_unsafe)]
pub fn set_column_count(&mut self, v: longhands::column_count::computed_value::T) {
use gecko_bindings::structs::{NS_STYLE_COLUMN_COUNT_AUTO, nsStyleColumn_kMaxColumnCount};
self.gecko.mColumnCount = match v.0 {
Some(number) => unsafe {
cmp::min(number, nsStyleColumn_kMaxColumnCount)
@@ -2486,17 +2486,17 @@ clip-path
match v {
Either::First(len) => self.gecko.mColumnGap.set(len),
Either::Second(_normal) => self.gecko.mColumnGap.set_value(CoordDataValue::Normal),
}
}
<%call expr="impl_coord_copy('column_gap', 'mColumnGap')"></%call>
- <% impl_app_units("_moz_column_rule_width", "mColumnRuleWidth", need_clone=True,
+ <% impl_app_units("column_rule_width", "mColumnRuleWidth", need_clone=True,
round_to_pixels=True) %>
</%self:impl_trait>
<%self:impl_trait style_struct_name="Counters"
skip_longhands="content">
pub fn set_content(&mut self, v: longhands::content::computed_value::T) {
use properties::longhands::content::computed_value::T;
use properties::longhands::content::computed_value::ContentItem;
--- a/servo/components/style/properties/longhand/column.mako.rs
+++ b/servo/components/style/properties/longhand/column.mako.rs
@@ -102,17 +102,17 @@
parse_method='parse_non_negative_length',
experimental=True,
animatable=False)}
${helpers.single_keyword("column-fill", "auto balance",
products="gecko", animatable=False)}
// https://drafts.csswg.org/css-multicol-1/#propdef-column-rule-width
-<%helpers:longhand name="-moz-column-rule-width" products="gecko" animatable="True">
+<%helpers:longhand name="column-rule-width" products="gecko" animatable="True">
use app_units::Au;
use std::fmt;
use style_traits::ToCss;
use values::HasViewportPercentage;
use values::specified::BorderWidth;
pub mod computed_value {
use app_units::Au;
@@ -132,24 +132,23 @@
}
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
BorderWidth::parse(context, input)
}
</%helpers:longhand>
// https://drafts.csswg.org/css-multicol-1/#crc
-${helpers.predefined_type("-moz-column-rule-color", "CSSColor",
+${helpers.predefined_type("column-rule-color", "CSSColor",
"::cssparser::Color::CurrentColor",
- products="gecko", gecko_ffi_name="mColumnRuleColor",
- animatable=True, complex_color=True, need_clone=True)}
+ products="gecko", animatable=True,
+ complex_color=True, need_clone=True)}
// It's not implemented in servo or gecko yet.
// https://drafts.csswg.org/css-multicol-1/#column-span
${helpers.single_keyword("column-span", "none all",
products="none", animatable=False)}
-${helpers.single_keyword("-moz-column-rule-style",
+${helpers.single_keyword("column-rule-style",
"none hidden dotted dashed solid double groove ridge inset outset",
products="gecko",
- gecko_ffi_name="mColumnRuleStyle",
gecko_constant_prefix="NS_STYLE_BORDER_STYLE",
animatable=False)}
--- a/servo/components/style/properties/shorthand/column.mako.rs
+++ b/servo/components/style/properties/shorthand/column.mako.rs
@@ -54,73 +54,73 @@
try!(write!(dest, " "));
self.column_count.to_css(dest)
}
}
</%helpers:shorthand>
// https://drafts.csswg.org/css-multicol/#column-rule
-<%helpers:shorthand name="-moz-column-rule" products="gecko"
- sub_properties="-moz-column-rule-width -moz-column-rule-style -moz-column-rule-color">
- use properties::longhands::{_moz_column_rule_width, _moz_column_rule_style};
- use properties::longhands::_moz_column_rule_color;
+<%helpers:shorthand name="column-rule" products="gecko"
+ sub_properties="column-rule-width column-rule-style column-rule-color">
+ use properties::longhands::{column_rule_width, column_rule_style};
+ use properties::longhands::column_rule_color;
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
% for name in "width style color".split():
let mut column_rule_${name} = None;
% endfor
let mut any = false;
loop {
% for name in "width style color".split():
if column_rule_${name}.is_none() {
if let Ok(value) = input.try(|input|
- _moz_column_rule_${name}::parse(context, input)) {
+ column_rule_${name}::parse(context, input)) {
column_rule_${name} = Some(value);
any = true;
continue
}
}
% endfor
break
}
if any {
Ok(Longhands {
% for name in "width style".split():
- _moz_column_rule_${name}: column_rule_${name}
- .or(Some(_moz_column_rule_${name}::get_initial_specified_value())),
+ column_rule_${name}: column_rule_${name}
+ .or(Some(column_rule_${name}::get_initial_specified_value())),
% endfor
- _moz_column_rule_color: column_rule_color,
+ column_rule_color: column_rule_color,
})
} else {
Err(())
}
}
impl<'a> LonghandsToSerialize<'a> {
fn to_css_declared<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
let mut need_space = false;
- try!(self._moz_column_rule_width.to_css(dest));
+ try!(self.column_rule_width.to_css(dest));
- if let DeclaredValue::Value(ref width) = *self._moz_column_rule_width {
+ if let DeclaredValue::Value(ref width) = *self.column_rule_width {
try!(width.to_css(dest));
need_space = true;
}
- if let DeclaredValue::Value(ref style) = *self._moz_column_rule_style {
+ if let DeclaredValue::Value(ref style) = *self.column_rule_style {
if need_space {
try!(write!(dest, " "));
}
try!(style.to_css(dest));
need_space = true;
}
- if let DeclaredValue::Value(ref color) = *self._moz_column_rule_color {
+ if let DeclaredValue::Value(ref color) = *self.column_rule_color {
if need_space {
try!(write!(dest, " "));
}
try!(color.to_css(dest));
}
Ok(())
}
}