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

Issue 754263 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

CSS intrinsic width incorrect when child has min and max width

Reported by oliverj...@gmail.com, Aug 10 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.25 Safari/537.36

Steps to reproduce the problem:
Go to http://jsbin.com/latonap/6/edit?html,css,output

What is the expected behavior?
The parent should encapsulate all of its content due to the intrinsic width value `width: max-content`.

What went wrong?
The parent does not encapsulate all of its content. The computed width of the parent appears to use the `max-width` of the child, but it should be using the `min-width` as this overrides the `max-width`.

Did this work before? N/A 

Does this work in other browsers? No
 This works as expected in Firefox, but the unexpected behaviour seen in Chrome is also seen in Safari.

Chrome version: 61.0.3163.25  Channel: n/a
OS Version: OS X 10.12.6
Flash Version:
 
Cc: pbomm...@chromium.org
Labels: Needs-Bisect M-62 OS-Linux OS-Windows
I see similar behavior on Windows 7,10,Mac and Linux with latest Chrome Stable,Beta, Dev and canary.

As updated in bug report this works fine in Firefox.
Status: Untriaged (was: Unconfirmed)

Comment 3 by shrike@chromium.org, Aug 10 2017

Components: Blink>CSS

Comment 4 by ajha@chromium.org, Aug 11 2017

Labels: Needs-Triage-M61

Comment 5 by hdodda@chromium.org, Aug 11 2017

Cc: hdodda@chromium.org
Labels: -Needs-Bisect hasbisect-per-revision
Able to reproduce the issueon windows 7 , ubuntu 14.04 and Mac OS 10.12.6 using chrome M60 #60.0.3112.90 and M62 #62.0.3182.0.

This is a regression issue broken in M46 .

Using the per-revision bisect providing the bisect results,
Good build: 56.0.2487.0 (Revision:344105).
Bad build:56.0.2490.0 (Revision:344925).

You are probably looking for a change made after 344313 (known good), but no later than 344342 (first known bad).

CHANGELOG URL:

The script might not always return single CL as suspectas some perf builds might get missing due to failure.

 https://chromium.googlesource.com/chromium/src/+log/92e3a0f75d28517ff9e8bc47b11666e436762ee5..02b77a227ed7c158143b67e6b530fc0cdaa8ab2e

@unable to find the suspect from the above CL , could someone help us in assigning it to the concerned owner.

Thanks!
Actually I think this behaviour sort of makes sense when using `min-width: max-content`, but I'm also seeing the behaviour with `min-width: min-content`. Can somebody clarify what the correct behaviour should be?
Labels: -Type-Bug Type-Bug-Regression
Owner: meade@chromium.org
Status: Assigned (was: Untriaged)
Labels: Update-Weekly

Comment 9 by meade@chromium.org, Aug 21 2017

Components: -Blink>CSS Blink>Layout
Owner: e...@chromium.org
I think this seems like a layout, eae, could you PTAL?
Here is an example of the bug when using `min-width: min-content`: http://jsbin.com/latonap/8/edit?html,css,output
Here is the same example but with vendor prefixes for testing Firefox and Safari.

http://jsbin.com/latonap/10/edit?html,css,output

The same behaviour is seen in Safari. Firefox has the correct/expected behaviour.
An alternative to `min-width: min-content` is to use `display: inline-block`. The bug also appears when using `display: inline-block`. Again, Firefox has the expected behaviour.

http://jsbin.com/latonap/16/edit?css,output

Comment 13 by e...@chromium.org, Aug 30 2017

Cc: robho...@gmail.com msten...@opera.com
Labels: -Type-Bug-Regression Type-Bug
Owner: ----
Status: Available (was: Assigned)

Comment 14 by msten...@opera.com, Aug 31 2017

Test case.
tc.html
196 bytes View Download

Comment 15 by msten...@opera.com, Aug 31 2017

Owner: msten...@opera.com
Status: Assigned (was: Available)
Wow, that's a very old bug (2003) [1]! Min-width should take priority over max-width, not the other way around [2]. Impressive that it hasn't been reported until now.

[1] crrev.com/5548ac5e4f021ee403d4d845579786002b3cf24c
[2] https://www.w3.org/TR/CSS22/visudet.html#min-max-widths
Project Member

Comment 16 by bugdroid1@chromium.org, Aug 31 2017

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

commit 713ad27a9b7b68ebe510b0e9397b0c7a7617d565
Author: Morten Stenshorne <mstensho@opera.com>
Date: Thu Aug 31 21:55:04 2017

Min-width takes precedence over max-width.

This also applies to intrinsic sizing, obviously. Clamp to max-width, THEN
min-width - not the other way around.

Bug:  754263 
Change-Id: Ide083d3ba591b252cd1bfa28500be3c3c2324d79
Reviewed-on: https://chromium-review.googlesource.com/645306
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499024}
[add] https://crrev.com/713ad27a9b7b68ebe510b0e9397b0c7a7617d565/third_party/WebKit/LayoutTests/fast/css-intrinsic-dimensions/block-min-width-and-max-width.html
[modify] https://crrev.com/713ad27a9b7b68ebe510b0e9397b0c7a7617d565/third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment