[Webkit-unassigned] [Bug 152588] Webkit not recalculating width when changing height of absolute-positioned div with image

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 31 18:05:21 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=152588

--- Comment #2 from zalan <zalan at apple.com> ---
(In reply to comment #0)
> Created attachment 267987 [details]
> Page that demonstrates bug
> 
> StackOverflow issue, has an example you can run:
> http://stackoverflow.com/questions/34506314/webkit-bug-rendering-image-in-
> centered-absolute-div
> 
> Basically I have a relatively position div, with a absolutely positioned div
> child.  Inside the absolutely positioned div is a (square) image:
> <div relative>
>  <div absolute>
>   <img />
>  </div>
> </div>
> 
> Both absolute and img have height: 100%, so when relative changes height, so
> should both children. The image should then recalculate it's width to
> preserve it's aspect ratio, which in turn will change its parent (absolute)
> to change width. However, when relative's height is changed (via javascript
> or the debugger) the widths are not properly updated. If relative's height
> is decreased, no widths are recalculated and the image becomes squished
> vertically. if relative's height is increased, the image's width is
> increased to maintain the aspect ratio, but its parent (absolute) does not
> increase width, causing the image to overflow and be displaced to the right
> (in the example, it should stay centered).
> 
> Attached is an example page that shows this bug (also included in the
> stackoverflow).
You could add "-webkit-aspect-ratio: from-intrinsic;" to your img element to preserve ratio.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160101/b2bd4fbe/attachment.html>


More information about the webkit-unassigned mailing list