[Webkit-unassigned] [Bug 206161] New: getComputedStyle(img).height returns string of a rounded int not a float

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 12 21:04:34 PST 2020


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

            Bug ID: 206161
           Summary: getComputedStyle(img).height returns string of a
                    rounded int not a float
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cathiechen at igalia.com
                CC: emilio at crisal.io, fred.wang at free.fr
            Blocks: 201641

According to the spec getComputedStyle(img).height should return the "Used Value" if img isn't display:none.
The "Used Value" of height is (used width) / (intrinsic ratio). So it can be a float, while WebKit always returns rouned int. (https://www.w3.org/TR/CSS21/visudet.html#propdef-height)

The related test: LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html


Referenced Bugs:

https://bugs.webkit.org/show_bug.cgi?id=201641
[Bug 201641] Map HTML attributes width/height to the default aspect ratio of <img>
-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200113/6c8c4bc0/attachment.htm>


More information about the webkit-unassigned mailing list