Delegate logical bitfield setters to physical to fix cascade (fixes #14222)

This commit is contained in:
Manish Goregaokar 2016-11-14 23:53:14 -08:00
parent 3b2e3dcfb9
commit 3cab0e6919
2 changed files with 27 additions and 5 deletions

View file

@ -149,6 +149,7 @@ pub mod animated_properties {
// TODO(SimonSapin): Convert this to a syntax extension rather than a Mako template.
// Maybe submit for inclusion in libstd?
mod property_bit_field {
use logical_geometry::WritingMode;
pub struct PropertyBitField {
storage: [u32; (${len(data.longhands)} - 1 + 32) / 32]
@ -181,6 +182,24 @@ mod property_bit_field {
self.set(${i})
}
% endif
% if property.logical:
#[allow(non_snake_case)]
pub fn get_physical_${property.ident}(&self, wm: WritingMode) -> bool {
<%helpers:logical_setter_helper name="${property.name}">
<%def name="inner(physical_ident)">
self.get_${physical_ident}()
</%def>
</%helpers:logical_setter_helper>
}
#[allow(non_snake_case)]
pub fn set_physical_${property.ident}(&mut self, wm: WritingMode) {
<%helpers:logical_setter_helper name="${property.name}">
<%def name="inner(physical_ident)">
self.set_${physical_ident}()
</%def>
</%helpers:logical_setter_helper>
}
% endif
% endfor
}
}