mirror of
https://github.com/lexmount/moli.git
synced 2026-10-30 16:07:24 +00:00
fix(layout): apply inline-block intrinsic maximum widths
Constrain auto-width inline-blocks by max-width:min-content while preserving intrinsic minimums, minimum precedence and automatic growth. Pin the separate Taffy sizing fixes, including the block-root auto-fill control. MOL-466: Taffy a34a7a82e5144b311b2fcb34feeb8412db9d0117. Browser before/after probes retained. Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast: 20278 passed,18 skipped.
This commit is contained in:
Generated
+1
-1
@@ -5542,7 +5542,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "taffy"
|
||||
version = "0.13.0"
|
||||
source = "git+https://github.com/ldm0/taffy?rev=4a618c7b6b7f9c3fbd8b8b0eaf9918ebd2cf9969#4a618c7b6b7f9c3fbd8b8b0eaf9918ebd2cf9969"
|
||||
source = "git+https://github.com/ldm0/taffy?rev=a34a7a82e5144b311b2fcb34feeb8412db9d0117#a34a7a82e5144b311b2fcb34feeb8412db9d0117"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"serde",
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ stylo_dom = { git = "https://github.com/lexmount/stylo", rev = "0c7e8baf63b6714e
|
||||
stylo_static_prefs = { git = "https://github.com/lexmount/stylo", rev = "0c7e8baf63b6714e7614834fadbc09710f3c3d27" }
|
||||
stylo_traits = { git = "https://github.com/lexmount/stylo", rev = "0c7e8baf63b6714e7614834fadbc09710f3c3d27" }
|
||||
svgtypes = { git = "https://github.com/lexmount/svgtypes", branch = "moli" }
|
||||
taffy = { git = "https://github.com/ldm0/taffy", rev = "4a618c7b6b7f9c3fbd8b8b0eaf9918ebd2cf9969" }
|
||||
taffy = { git = "https://github.com/ldm0/taffy", rev = "a34a7a82e5144b311b2fcb34feeb8412db9d0117" }
|
||||
|
||||
[workspace.lints.clippy]
|
||||
disallowed_methods = "deny"
|
||||
|
||||
@@ -136,3 +136,21 @@ fn auto_grid_tracks_honor_intrinsic_item_minima_before_measuring_row_height() ->
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inline_block_intrinsic_maximum_constrains_auto_width_and_preserves_minimum_sizing() -> Result<()>
|
||||
{
|
||||
let html = probe_font_document(
|
||||
"<section><span id='maximum' style='display:inline-block;max-width:min-content'>aaaa bbbbb ccc</span></section><section><span id='minimum' style='display:inline-block;min-width:min-content;width:0'>aaaa bbbbb ccc</span></section><section><span id='auto-minimum' style='display:inline-block;min-width:min-content'>aaaa bbbbb ccc</span></section><section><span id='minimum-wins' style='display:inline-block;min-width:max-content;max-width:min-content'>aaaa bbbbb ccc</span></section>",
|
||||
);
|
||||
let value = run_layout(&html, GEOMETRY, true)?;
|
||||
for id in ["maximum", "minimum"] {
|
||||
assert_dimension(&value, id, "width", 60.0);
|
||||
assert_dimension(&value, id, "height", 60.0);
|
||||
}
|
||||
for id in ["auto-minimum", "minimum-wins"] {
|
||||
assert_dimension(&value, id, "width", 168.0);
|
||||
assert_dimension(&value, id, "height", 20.0);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user