mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Implement text-align
(except justify
)
This commit is contained in:
parent
6d91d77fba
commit
9f4b1a0f14
5 changed files with 84 additions and 13 deletions
|
@ -206,6 +206,20 @@ impl WritingMode {
|
|||
self.intersects(WritingMode::UPRIGHT)
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-writing-modes/#logical-to-physical
|
||||
///
|
||||
/// | Return | line-left is… | line-right is… |
|
||||
/// |---------|---------------|----------------|
|
||||
/// | `true` | inline-start | inline-end |
|
||||
/// | `false` | inline-end | inline-start |
|
||||
#[inline]
|
||||
pub fn line_left_is_inline_start(&self) -> bool {
|
||||
// https://drafts.csswg.org/css-writing-modes/#inline-start
|
||||
// “For boxes with a used direction value of ltr, this means the line-left side.
|
||||
// For boxes with a used direction value of rtl, this means the line-right side.”
|
||||
self.is_bidi_ltr()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn inline_start_physical_side(&self) -> PhysicalSide {
|
||||
match (self.is_vertical(), self.is_inline_tb(), self.is_bidi_ltr()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue