servo/components/layout_2020
Oriol Brufau ab270f3d52
layout: Never stretch indefinite intrinsic keywords other than auto (#34672)
Consider:
```html
<div style="position: relative; width: 50px; height: 50px; border: solid; margin: 5px">
  <div style="position: absolute; top: 0; bottom: 0; height: max-content">
    <canvas width="25" height="25" style="background: cyan; height: 100%"></canvas>
  </div>
</div>
```

In order to determine the inline min/max-content sizes, we need a
tentative block size as the input, which only takes extrinsic values
into account.

In this case `height: max-content` is intrinsic, so we were treating it
as `height: initial`, which would behave as a definite `height: stretch`.
Therefore, the canvas was able to resolve its percentage.

However, it seems weird to treat an explicitly intrinsic keyword in an
extrinsic way, and Blink doesn't do it. So now we treat the tentative
block size as indefinite, therefore the percentage behaves as auto.

This adds a new test, we were previously failing 6 subtests, now only 3.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-12-18 22:21:47 +00:00
..
display_list script: Manage <iframe> sizes in Window (#34643) 2024-12-16 15:05:33 +00:00
flexbox script: Manage <iframe> sizes in Window (#34643) 2024-12-16 15:05:33 +00:00
flow Shrink ContainingBlockPaddingAndBorder (#34666) 2024-12-17 18:37:11 +00:00
fragment_tree Add BoxFragment::is_inline_box() (#34233) 2024-11-12 15:50:20 +00:00
table Distinguish cached inline_content_sizes() from uncached ones (#34595) 2024-12-12 15:39:51 +00:00
taffy script: Manage <iframe> sizes in Window (#34643) 2024-12-16 15:05:33 +00:00
tests Update deprecated use of PanicInfo to PanicHookInfo (#34659) 2024-12-17 03:50:26 +00:00
Cargo.toml layout: Fix CSS attr() function case sensitivity matching (#34574) 2024-12-13 17:29:52 +00:00
cell.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
construct_modern.rs layout: Add LayoutBoxBase and use it for IndependentFormattingContext (#34507) 2024-12-07 19:12:25 +00:00
context.rs script: Manage <iframe> sizes in Window (#34643) 2024-12-16 15:05:33 +00:00
dom.rs layout: Clean up inline layout data types a bit (#34563) 2024-12-11 14:40:34 +00:00
dom_traversal.rs layout: Fix CSS attr() function case sensitivity matching (#34574) 2024-12-13 17:29:52 +00:00
formatting_contexts.rs Distinguish cached inline_content_sizes() from uncached ones (#34595) 2024-12-12 15:39:51 +00:00
geom.rs layout: Never stretch indefinite intrinsic keywords other than auto (#34672) 2024-12-18 22:21:47 +00:00
layout_box_base.rs Distinguish cached inline_content_sizes() from uncached ones (#34595) 2024-12-12 15:39:51 +00:00
layout_debug.rs clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674) 2024-07-04 14:18:58 +00:00
lib.rs layout: Make a new ContainingBlockSize type (#34565) 2024-12-11 14:40:04 +00:00
lists.rs layout: Add LayoutBoxBase and use it for IndependentFormattingContext (#34507) 2024-12-07 19:12:25 +00:00
positioned.rs layout: Never stretch indefinite intrinsic keywords other than auto (#34672) 2024-12-18 22:21:47 +00:00
query.rs Fix offsetLeft/offsetTop to match major browsers (#32761) 2024-11-16 15:28:38 +00:00
replaced.rs script: Manage <iframe> sizes in Window (#34643) 2024-12-16 15:05:33 +00:00
sizing.rs Distinguish cached inline_content_sizes() from uncached ones (#34595) 2024-12-12 15:39:51 +00:00
style_ext.rs layout: Make a new ContainingBlockSize type (#34565) 2024-12-11 14:40:04 +00:00
traversal.rs script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00