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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 29 12:02:33 PST 2015


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

            Bug ID: 152588
           Summary: Webkit not recalculating width when changing height of
                    absolute-positioned div with image
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: lugnuts25 at gmail.com
                CC: simon.fraser at apple.com

Created attachment 267987
  --> https://bugs.webkit.org/attachment.cgi?id=267987&action=review
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 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/20151229/75ed64f4/attachment.html>


More information about the webkit-unassigned mailing list