Replaced elements with 'contain: size' should have zero intrinsic size.
This behavior follows the spec, https://drafts.csswg.org/css-contain/#containment-size, as the statement below. 'Replaced elements must be treated as having an intrinsic width and height of 0.' For this behavior, when 'contain: size' is specified, LayoutReplaced::IntrinsicSize returns zero size instead of the intrinsic size it actually has. Before this CL, |LayoutReplaced::ComputeIntrinsicSizingInfoForReplacedContent| did early return with "FloatSize()", but |LayoutReplaced::ComputeReplacedLogicalWidth| has *if statement* for specified and intrinsic css size, so *that* early return couldn't be reached. Addition to it, ComputeIntrinsicSizeFoo uses |LayoutReplaced::IntrinsicSize| essentially, and it returned non-zero size and that value was used before this CL. Bug: 955163 Change-Id: If0309ae5f1adb2e3026ff92bfde2ffb07ba73582 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703540Reviewed-by:Mounir Lamouri <mlamouri@chromium.org> Reviewed-by:
Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by:
vmpstr <vmpstr@chromium.org> Commit-Queue: Joonghun Park <pjh0718@gmail.com> Cr-Commit-Position: refs/heads/master@{#684192}
Showing
Please register or sign in to comment