New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 872794 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

[css-contain] Chrome mistakenly collapses empty "overflow:scroll;contain:size" boxes to be 0 sized

Project Member Reported by dholb...@gmail.com, Aug 9

Issue description

Chrome Version: 70.0.3510.0 (Official Build) dev (64-bit)
OS: Ubuntu 18.04

What steps will reproduce the problem?
(1) Load https://jsfiddle.net/muxd4g6L/

What is the expected result?
The two boxes should be the same size.

What happens instead?
The second box is collapsed to 0 (aside from its black border)

Please use labels and text to provide additional information.
The boxes only differ in that the second box has 'contain:size', and it appears that this difference is preventing Chrome from using the scrollbar sizes when determining the "auto" size of the box.   That doesn't seem correct to me -- 'contain:size' is supposed to make the browser do layout as if the element *had no contents* (which I think means children)[1], and the scrollbars aren't part of the box's contents -- they're a piece of the 'overflow' styling that's set on the box, and their sizes are the same regardless of whether the box has contents.

[1] https://drafts.csswg.org/css-contain/#containment-size
 
Components: Blink>Scroll
Cc: szager@chromium.org
Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)
I agree, that seems odd. Thanks for the test case!
Owner: r...@igalia.com
Status: Started (was: Available)
Summary: [css-contain] Chrome mistakenly collapses empty "overflow:scroll;contain:size" boxes to be 0 sized (was: Chrome mistakenly collapses empty "overflow:scroll;contain:size" boxes to be 0 sized)
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1daea42ff5055f1698230d7ac82e669ca8aeb93

commit c1daea42ff5055f1698230d7ac82e669ca8aeb93
Author: Manuel Rego Casasnovas <rego@igalia.com>
Date: Wed Sep 05 09:52:10 2018

[css-contain] Fix size containment in elements with scrollbars

To determine the size of an element with "contain: size"
we should treat it as having no contents
(https://drafts.csswg.org/css-contain/#containment-size).

Scrollbars are not part of the box's contents,
so we should take them into account to determine box size.

BUG= 872794 
TEST=external/wpt/css/css-contain/contain-size-scrollbars-001.html

Change-Id: I166af8469243a9c3b52c3e30569d1d81c3de6e9e
Reviewed-on: https://chromium-review.googlesource.com/1206210
Commit-Queue: Manuel Rego <rego@igalia.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588809}
[add] https://crrev.com/c1daea42ff5055f1698230d7ac82e669ca8aeb93/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-scrollbars-001.html
[add] https://crrev.com/c1daea42ff5055f1698230d7ac82e669ca8aeb93/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/reference/contain-size-scrollbars-001-ref.html
[modify] https://crrev.com/c1daea42ff5055f1698230d7ac82e669ca8aeb93/third_party/blink/renderer/core/layout/layout_block.cc
[modify] https://crrev.com/c1daea42ff5055f1698230d7ac82e669ca8aeb93/third_party/blink/renderer/core/layout/layout_box.cc

Sign in to add a comment