Fix a “Accessing content size that was not requested” panic

Percentage `width` are treated as `auto` for the purpose of
min/max-content computation, so they also need to be considered
when testing “wether width is auto”
This commit is contained in:
Simon Sapin 2019-12-08 11:41:29 +01:00
parent a17db217a1
commit 53ce714005
4 changed files with 8 additions and 8 deletions

View file

@ -60,7 +60,7 @@ impl AbsolutelyPositionedBox {
// "Shrink-to-fit" in https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width
let content_sizes = ContentSizesRequest::inline_if(
// If inline-size is non-auto, that value is used without shrink-to-fit
style.inline_size_is_auto() &&
!style.inline_size_is_length() &&
// If it is, then the only case where shrink-to-fit is *not* used is
// if both offsets are non-auto, leaving inline-size as the only variable
// in the constraint equation.