mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Delegate logical bitfield setters to physical to fix cascade (fixes #14222)
This commit is contained in:
parent
3b2e3dcfb9
commit
3cab0e6919
2 changed files with 27 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue