mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Convert text-orientation to a Gecko-only property
Remove incomplete and buggy support for text-orientation in Servo. Make the property values align with Gecko and the latest draft of CSS Writing Modes Level 3.
This commit is contained in:
parent
bd72da5f02
commit
b3820c1296
9 changed files with 78 additions and 63 deletions
|
@ -29,7 +29,8 @@ bitflags!(
|
|||
const FLAG_RTL = 1 << 0,
|
||||
const FLAG_VERTICAL = 1 << 1,
|
||||
const FLAG_VERTICAL_LR = 1 << 2,
|
||||
const FLAG_SIDEWAYS_LEFT = 1 << 3
|
||||
const FLAG_SIDEWAYS = 1 << 3,
|
||||
const FLAG_UPRIGHT = 1 << 4,
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -48,7 +49,8 @@ impl WritingMode {
|
|||
/// Assuming .is_vertical(), does the inline direction go top to bottom?
|
||||
#[inline]
|
||||
pub fn is_inline_tb(&self) -> bool {
|
||||
!(self.intersects(FLAG_SIDEWAYS_LEFT) ^ self.intersects(FLAG_RTL))
|
||||
// https://drafts.csswg.org/css-writing-modes-3/#logical-to-physical
|
||||
!self.intersects(FLAG_RTL)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -57,8 +59,13 @@ impl WritingMode {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_sideways_left(&self) -> bool {
|
||||
self.intersects(FLAG_SIDEWAYS_LEFT)
|
||||
pub fn is_sideways(&self) -> bool {
|
||||
self.intersects(FLAG_SIDEWAYS)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_upright(&self) -> bool {
|
||||
self.intersects(FLAG_UPRIGHT)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -135,8 +142,8 @@ impl fmt::Display for WritingMode {
|
|||
} else {
|
||||
try!(write!(formatter, " RL"));
|
||||
}
|
||||
if self.intersects(FLAG_SIDEWAYS_LEFT) {
|
||||
try!(write!(formatter, " SidewaysL"));
|
||||
if self.intersects(FLAG_SIDEWAYS) {
|
||||
try!(write!(formatter, " Sideways"));
|
||||
}
|
||||
} else {
|
||||
try!(write!(formatter, "H"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue