Add gecko leagcy logical properties aliases

This commit is contained in:
Xidorn Quan 2017-01-10 20:21:41 +11:00
parent e494a0f0a7
commit 2f2044e4b7
4 changed files with 16 additions and 3 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<% from data import Method, PHYSICAL_SIDES, ALL_SIDES %>
<% from data import Method, PHYSICAL_SIDES, ALL_SIDES, maybe_moz_logical_alias %>
<% data.new_style_struct("Border", inherited=False,
additional_methods=[Method("border_" + side + "_has_nonzero_width",
@ -18,6 +18,7 @@
% for side in ALL_SIDES:
${helpers.predefined_type("border-%s-color" % side[0], "CSSColor",
"::cssparser::Color::CurrentColor",
alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-color"),
spec=maybe_logical_spec(side, "color"),
animatable=True, logical = side[1])}
% endfor
@ -26,12 +27,14 @@
${helpers.predefined_type("border-%s-style" % side[0], "BorderStyle",
"specified::BorderStyle::none",
needs_context=False, need_clone=True,
alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-style"),
spec=maybe_logical_spec(side, "style"),
animatable=False, logical = side[1])}
% endfor
% for side in ALL_SIDES:
<%helpers:longhand name="border-${side[0]}-width" animatable="True" logical="${side[1]}"
alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-width")
spec="${maybe_logical_spec(side, 'width')}">
use app_units::Au;
use std::fmt;