mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #29863 - nicoburns:fix-infinite-loop-when-shrinking, r=Loirooriol
Fix infinite loop in flexbox algorithm Only apply step 5c of "resolve flexible lengths" if sum of scaled flexible shrink factors > 0 Probably fixes #29852 (but speculative as I can't get mach to run). --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___
This commit is contained in:
commit
7d9839acc8
7 changed files with 9 additions and 10 deletions
|
@ -976,10 +976,12 @@ impl FlexLine<'_> {
|
||||||
let scaled_shrink_factors_sum: Length = unfrozen_items()
|
let scaled_shrink_factors_sum: Length = unfrozen_items()
|
||||||
.map(|(item, _)| scaled_shrink_factor(item))
|
.map(|(item, _)| scaled_shrink_factor(item))
|
||||||
.sum();
|
.sum();
|
||||||
for (item, target_main_size) in unfrozen_items() {
|
if scaled_shrink_factors_sum > Length::zero() {
|
||||||
let ratio = scaled_shrink_factor(item) / scaled_shrink_factors_sum;
|
for (item, target_main_size) in unfrozen_items() {
|
||||||
target_main_size
|
let ratio = scaled_shrink_factor(item) / scaled_shrink_factors_sum;
|
||||||
.set(item.flex_base_size - remaining_free_space.abs() * ratio);
|
target_main_size
|
||||||
|
.set(item.flex_base_size - remaining_free_space.abs() * ratio);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
[flex-aspect-ratio-img-row-013.html]
|
[flex-aspect-ratio-img-row-013.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[img 1]
|
[img 1]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
[flex-item-compressible-002.html]
|
[flex-item-compressible-002.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[.flexbox 14]
|
[.flexbox 14]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
[flex-minimum-height-flex-items-031.html]
|
[flex-minimum-height-flex-items-031.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[.flex 1]
|
[.flex 1]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[flexbox-align-self-stretch-vert-001.html]
|
[flexbox-align-self-stretch-vert-001.html]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[flexbox-overflow-vert-002.html]
|
[flexbox-overflow-vert-002.html]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[percentage-padding-002.html]
|
[percentage-padding-002.html]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue