mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Fix align-content
set to start
or end
on flexbox (#33667)
We need to handle `flex-wrap: wrap-reverse`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
6aaca118a9
commit
433f48741b
4 changed files with 7 additions and 33 deletions
|
@ -721,12 +721,14 @@ impl FlexContainer {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Implement "unsafe" alignment. "safe" alignment is handled by the fallback process above.
|
// Implement "unsafe" alignment. "safe" alignment is handled by the fallback process above.
|
||||||
let resolved_align_content = self.config.resolve_reversable_flex_alignment(
|
let flex_wrap_is_reversed = flex_context.config.flex_wrap_is_reversed;
|
||||||
resolved_align_content,
|
let resolved_align_content = self
|
||||||
flex_context.config.flex_wrap_is_reversed,
|
.config
|
||||||
);
|
.resolve_reversable_flex_alignment(resolved_align_content, flex_wrap_is_reversed);
|
||||||
let mut cross_start_position_cursor = match resolved_align_content {
|
let mut cross_start_position_cursor = match resolved_align_content {
|
||||||
|
AlignFlags::START if flex_wrap_is_reversed => remaining_free_cross_space,
|
||||||
AlignFlags::START => Au::zero(),
|
AlignFlags::START => Au::zero(),
|
||||||
|
AlignFlags::END if flex_wrap_is_reversed => Au::zero(),
|
||||||
AlignFlags::END => remaining_free_cross_space,
|
AlignFlags::END => remaining_free_cross_space,
|
||||||
AlignFlags::CENTER => remaining_free_cross_space / 2,
|
AlignFlags::CENTER => remaining_free_cross_space / 2,
|
||||||
AlignFlags::STRETCH => Au::zero(),
|
AlignFlags::STRETCH => Au::zero(),
|
||||||
|
@ -771,7 +773,7 @@ impl FlexContainer {
|
||||||
cross_gap;
|
cross_gap;
|
||||||
|
|
||||||
let flow_relative_line_position =
|
let flow_relative_line_position =
|
||||||
match (self.config.flex_axis, self.config.flex_wrap_is_reversed) {
|
match (self.config.flex_axis, flex_wrap_is_reversed) {
|
||||||
(FlexAxis::Row, false) => LogicalVec2 {
|
(FlexAxis::Row, false) => LogicalVec2 {
|
||||||
block: line_cross_start_position,
|
block: line_cross_start_position,
|
||||||
inline: Au::zero(),
|
inline: Au::zero(),
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
[align-content-wrap-005.html]
|
|
||||||
[.flexitem 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.flexitem 2]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.flexitem 3]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.flexitem 4]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.flexitem 5]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.flexitem 6]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.flexitem 7]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.flexitem 8]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[flexbox-safe-overflow-position-002.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[flexbox-safe-overflow-position-005.html]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue