<img> with width:auto and height:auto is not resized correctly if container size is changed dynamically
Reported by
jakalten...@gmail.com,
Jan 3 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Example URL: https://jsfiddle.net/kaljak/fuzxqkmz/4/ Steps to reproduce the problem: 1. Open the attached jsfiddle 2. Resize the preview window until its width is smaller than 669px 3. The used library (css-element-queries) adds a property to the container (max-width="669px"). This CSS is used now: DIV[max-width~="669px"] { height: 10.7em; } 4. The height is smaller but the image is not resized correctly What is the expected behavior? The image should not be distorted What went wrong? The image is not resized correctly - it's distorted. Does it occur on multiple sites: N/A Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 55.0.2883.87 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version:
,
Jan 3 2017
,
Jan 3 2017
,
Jan 7 2017
For what it's worth a slightly simpler reproduction might be found here assuming I understand the problem correctly (https://jsfiddle.net/domfarolino/2bd81q1m/). When clicking the button in the fiddle, the picture undergoes distortion in Chrome where it does not in Firefox.
,
Feb 9 2017
,
Feb 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6da27d806a2386ab7baacf5692727ffa0a7706ca commit 6da27d806a2386ab7baacf5692727ffa0a7706ca Author: glebl <glebl@chromium.org> Date: Mon Feb 13 23:18:46 2017 Keep the aspect ratio of child with percentage max-height when the size of its container changes BUG= 677942 TEST=fast/replaced/aspect-ratio-of-replaced-child-with-max-height.html Review-Url: https://codereview.chromium.org/2683793007 Cr-Commit-Position: refs/heads/master@{#450145} [add] https://crrev.com/6da27d806a2386ab7baacf5692727ffa0a7706ca/third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height-expected.txt [add] https://crrev.com/6da27d806a2386ab7baacf5692727ffa0a7706ca/third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height.html [modify] https://crrev.com/6da27d806a2386ab7baacf5692727ffa0a7706ca/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
,
Feb 13 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Jan 3 2017