aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNazım Can Altınova <canaltinova@gmail.com>2016-11-21 23:04:43 +0300
committerNazım Can Altınova <canaltinova@gmail.com>2016-11-21 23:04:43 +0300
commit61431b7fd61604da9a54b9dd6714438f6485bf7b (patch)
tree34309def8e777e400f77a2f7f0fe4661d95cfed1
parenta4e26d503af5589262e0ad2a73b40325fc7ef8a0 (diff)
downloadservo-61431b7fd61604da9a54b9dd6714438f6485bf7b.tar.gz
servo-61431b7fd61604da9a54b9dd6714438f6485bf7b.zip
Implement parsing/serialization of column-rule-width, column-rule-color and column-span
-rw-r--r--components/style/properties/gecko.mako.rs5
-rw-r--r--components/style/properties/longhand/column.mako.rs36
2 files changed, 40 insertions, 1 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index a82dcd4a4e0..20fa243d3f4 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -2244,7 +2244,7 @@ clip-path
</%self:impl_trait>
<%self:impl_trait style_struct_name="Column"
- skip_longhands="column-width column-count">
+ skip_longhands="column-width column-count -moz-column-rule-width">
pub fn set_column_width(&mut self, v: longhands::column_width::computed_value::T) {
match v.0 {
@@ -2268,6 +2268,9 @@ clip-path
}
${impl_simple_copy('column_count', 'mColumnCount')}
+
+ <% impl_app_units("_moz_column_rule_width", "mColumnRuleWidth", need_clone=True,
+ round_to_pixels=True) %>
</%self:impl_trait>
<%self:impl_trait style_struct_name="Counters"
diff --git a/components/style/properties/longhand/column.mako.rs b/components/style/properties/longhand/column.mako.rs
index 88272435972..6f6ca6da816 100644
--- a/components/style/properties/longhand/column.mako.rs
+++ b/components/style/properties/longhand/column.mako.rs
@@ -252,3 +252,39 @@
${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">
+ 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;
+ pub type T = Au;
+ }
+
+ pub type SpecifiedValue = BorderWidth;
+
+ #[inline]
+ pub fn get_initial_value() -> computed_value::T {
+ Au::from_px(3) // medium
+ }
+
+ pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
+ BorderWidth::parse(input)
+ }
+</%helpers:longhand>
+
+// https://drafts.csswg.org/css-multicol-1/#crc
+${helpers.predefined_type("-moz-column-rule-color", "CSSColor",
+ "::cssparser::Color::CurrentColor",
+ products="gecko", gecko_ffi_name="mColumnRuleColor",
+ 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)}