layout: a bordered scroll box that fits scrolls nowhere
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 3m52s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 3m44s

This commit is contained in:
Meta Vens 2026-11-28 06:56:39 +01:00
commit 820f43de77

View file

@ -1161,6 +1161,12 @@ fn scroll_extent_is_measured_from_the_padding_box() {
let laid = lay(bx("root", plain(), vec![bx_paint("list", style, paint, rows)]), 400.0, 300.0);
let list = laid.nodes.iter().find(|n| n.id.as_str() == "list").unwrap();
assert_eq!(list.max_scroll, Some((68.0, 158.0)));
// Content that fits the padding box scrolls nowhere, though `content` is held at the border box.
let paint = Paint { background: None, border: Some(Border { color: ColorRef::Rgba(Rgba { r: 0, g: 0, b: 0, a: 255 }), width: 4.0 }), radius: 0.0 };
let small = BoxStyle { overflow: Overflow::Scroll, ..sized(100.0, 100.0) };
let laid = lay(bx("root", plain(), vec![bx_paint("fit", small, paint, vec![bx("kid", sized(10.0, 10.0), vec![])])]), 400.0, 300.0);
let fit = laid.nodes.iter().find(|n| n.id.as_str() == "fit").unwrap();
assert_eq!((fit.content, fit.max_scroll), (Some((100.0, 100.0)), Some((0.0, 0.0))));
}
#[test]