diff options
Diffstat (limited to 'components/util/logical_geometry.rs')
-rw-r--r-- | components/util/logical_geometry.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/util/logical_geometry.rs b/components/util/logical_geometry.rs index 2faa6400e1a..fd30c6c07cb 100644 --- a/components/util/logical_geometry.rs +++ b/components/util/logical_geometry.rs @@ -12,39 +12,39 @@ use std::num::Zero; bitflags!( #[deriving(Encodable)] flags WritingMode: u8 { - static FlagRTL = 1 << 0, - static FlagVertical = 1 << 1, - static FlagVerticalLR = 1 << 2, - static FlagSidewaysLeft = 1 << 3 + const FLAG_RTL = 1 << 0, + const FLAG_VERTICAL = 1 << 1, + const FLAG_VERTICAL_LR = 1 << 2, + const FLAG_SIDEWAYS_LEFT = 1 << 3 } ) impl WritingMode { #[inline] pub fn is_vertical(&self) -> bool { - self.intersects(FlagVertical) + self.intersects(FLAG_VERTICAL) } /// Asuming .is_vertical(), does the block direction go left to right? #[inline] pub fn is_vertical_lr(&self) -> bool { - self.intersects(FlagVerticalLR) + self.intersects(FLAG_VERTICAL_LR) } /// Asuming .is_vertical(), does the inline direction go top to bottom? #[inline] pub fn is_inline_tb(&self) -> bool { - !(self.intersects(FlagSidewaysLeft) ^ self.intersects(FlagRTL)) + !(self.intersects(FLAG_SIDEWAYS_LEFT) ^ self.intersects(FLAG_RTL)) } #[inline] pub fn is_bidi_ltr(&self) -> bool { - !self.intersects(FlagRTL) + !self.intersects(FLAG_RTL) } #[inline] pub fn is_sideways_left(&self) -> bool { - self.intersects(FlagSidewaysLeft) + self.intersects(FLAG_SIDEWAYS_LEFT) } } @@ -57,7 +57,7 @@ impl Show for WritingMode { } else { try!(write!(formatter, " RL")); } - if self.intersects(FlagSidewaysLeft) { + if self.intersects(FLAG_SIDEWAYS_LEFT) { try!(write!(formatter, " SidewaysL")); } } else { |