mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Auto merge of #7825 - eefriedman:div-align, r=mbrubeck
Fully implement the "align descendants" rule for div. This adds -servo-left and -servo-right to complement -servo-center. ~~This intentionally doesn't try to address issue #7301.~~ Commit added to address #7301. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7825) <!-- Reviewable:end -->
This commit is contained in:
commit
ab42ca4296
9 changed files with 194 additions and 40 deletions
|
@ -1019,8 +1019,14 @@ impl InlineFlow {
|
|||
// Translate `left` and `right` to logical directions.
|
||||
let is_ltr = fragments.fragments[0].style().writing_mode.is_bidi_ltr();
|
||||
let line_align = match (line_align, is_ltr) {
|
||||
(text_align::T::left, true) | (text_align::T::right, false) => text_align::T::start,
|
||||
(text_align::T::left, false) | (text_align::T::right, true) => text_align::T::end,
|
||||
(text_align::T::left, true) |
|
||||
(text_align::T::servo_left, true) |
|
||||
(text_align::T::right, false) |
|
||||
(text_align::T::servo_right, false) => text_align::T::start,
|
||||
(text_align::T::left, false) |
|
||||
(text_align::T::servo_left, false) |
|
||||
(text_align::T::right, true) |
|
||||
(text_align::T::servo_right, true) => text_align::T::end,
|
||||
_ => line_align
|
||||
};
|
||||
|
||||
|
@ -1040,7 +1046,10 @@ impl InlineFlow {
|
|||
inline_start_position_for_fragment = inline_start_position_for_fragment +
|
||||
slack_inline_size
|
||||
}
|
||||
text_align::T::left | text_align::T::right => unreachable!()
|
||||
text_align::T::left |
|
||||
text_align::T::servo_left |
|
||||
text_align::T::right |
|
||||
text_align::T::servo_right => unreachable!()
|
||||
}
|
||||
|
||||
// Lay out the fragments in visual order.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue