mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
layout: Fix depends_on_block_constraints
logic (#38318)
The logic was wrong, sometimes we weren't setting it to true on flex containers that needed it, and then as a workaround we were setting it to to true on flex items that didn't need it. For example, this testcase had 5 cache misses when stretching the items, now we will avoid laying them out again: ```html <div style="display: flex"> <div></div> <div></div> <div></div> <div></div> <div></div> </div> ``` Also, the workaround wasn't always working, e.g. it failed to stretch the green element here: ```html <div style="display: flex; min-height: 200px"> <div> <div style="display: flex; height: 100%; background-color: red"> <div style="width: 200px; background-color: green;"></div> </div> </div> </div> ``` Testing: Adding new test Fixes: #38023 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
a5d4c49ec6
commit
3d2f0d1be5
10 changed files with 50 additions and 36 deletions
|
@ -451,7 +451,6 @@ impl ReplacedContents {
|
|||
containing_block_for_children: &ContainingBlock,
|
||||
preferred_aspect_ratio: Option<AspectRatio>,
|
||||
base: &LayoutBoxBase,
|
||||
depends_on_block_constraints: bool,
|
||||
lazy_block_size: &LazySize,
|
||||
) -> CacheableLayoutResult {
|
||||
let writing_mode = base.style.writing_mode;
|
||||
|
@ -472,7 +471,7 @@ impl ReplacedContents {
|
|||
collapsible_margins_in_children: CollapsedBlockMargins::zero(),
|
||||
content_block_size,
|
||||
content_inline_size_for_table: None,
|
||||
depends_on_block_constraints,
|
||||
depends_on_block_constraints: false,
|
||||
fragments: self.make_fragments(layout_context, &base.style, size),
|
||||
specific_layout_info: None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue