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

Issue 709233 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

Shrink-to-fit width not recalculated when the width of the contents varies with window height

Reported by oriol-bu...@hotmail.com, Apr 6 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0

Steps to reproduce the problem:
1. Create a shrink-to-fit element with height 100% of the window.
2. Inside it, place a replaced element with an intrinsic aspect ratio and height 100%.
3. Resize the window vertically.

What is the expected behavior?
1. The container is resized vertically due to the percentage in height.
2. The replaced element is resized vertically due to the percentage in height.
3. The replaced element is resized horizontally due to the intrinsic aspect ratio.
4. The container is resized horizontally due to shrink-to-fit.

What went wrong?
Step 4 does not happen.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 59.0.3055.0  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 25.0 r0

Works on Firefox.
 
testcase.htm
1.1 KB View Download
Labels: Needs-Triage-M59

Comment 2 by ajha@chromium.org, Apr 10 2017

Cc: ajha@chromium.org
Components: Blink>Layout
Labels: -Needs-Triage-M59 M-59 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on the latest canary: 59.0.3067.0 and the latest stable(57.0.2987.133) on Windows-10, Mac OS 10.12.3 and Linux Ubuntu 14.04.

Similar behavior is seen on older chrome versions:44.0.2358.0 and chrome versions before that(42.0.2291.0,40.0.2172.0,30.0.1549.0) doesn't show any resize with the attached test file.

Marking this as Untriaged for more inputs on this.

Comment 3 by e...@chromium.org, Apr 18 2017

Cc: ikilpatrick@chromium.org glebl@chromium.org
Status: Available (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 25 2017

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

commit 76e307f44292b2999535aa8c5605cfd9129e9c12
Author: shoon.kim <shoon.kim@lge.com>
Date: Tue Apr 25 09:37:39 2017

Add NeedsPreferredWidthsRecalculation() for block

In the case the block has relative height and width is auto and
it has an image which should keep the aspect ratio,
it needs preferred width recalculation if the parent changes the height.
To cover this, add NeedsPreferredWidthsRecalculation() for LayoutBlock.

BUG= 707151 ,  514663 ,  709233 

Review-Url: https://codereview.chromium.org/2828453002
Cr-Commit-Position: refs/heads/master@{#466934}

[add] https://crrev.com/76e307f44292b2999535aa8c5605cfd9129e9c12/third_party/WebKit/LayoutTests/fast/block/block-width-recalc-with-relative-height.html
[modify] https://crrev.com/76e307f44292b2999535aa8c5605cfd9129e9c12/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
[modify] https://crrev.com/76e307f44292b2999535aa8c5605cfd9129e9c12/third_party/WebKit/Source/core/layout/LayoutBlock.h

Comment 5 by robho...@gmail.com, Aug 13 2017

Status: Fixed (was: Available)
I still see this problem in 66.0.3342.0
https://jsfiddle.net/b6g4q3jx/

Sign in to add a comment