Inconsistent rounding of clientWidth & clientHeight properties
Reported by
que....@gmail.com,
Sep 20 2016
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Example URL: http://jsbin.com/munuvoq/edit?js,output Steps to reproduce the problem: 1. Navigate to the provided url: http://jsbin.com/munuvoq/edit?js,output 2. Take a look at computed clientWidth/clientHeight properties What is the expected behavior? clientWidth & clientHeight properties are being rounded correctly, e.g. if contents' width is 136.48px then the rounded clientWidth (without paddings) should be 136. What went wrong? As for the provided example rounding of 136.48 resulted in 137. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 53.0.2785.116 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 23.0 r0
,
Sep 21 2016
clientWidth/Height are not rounded by snapped to the appropriate pixel boundary in either direction as to minimize the difference between specified and actual size. See the snapping section of https://trac.webkit.org/wiki/LayoutUnit for an explanation of the concept.
,
Sep 21 2016
But why for the same content dimensions client properties contain different values? As in the example content width (actual size) of the first and second blocks is the same but the clientWidth is different. Those blocks don't have paddings and they seem to be equal to each other in everything. |
||
►
Sign in to add a comment |
||
Comment 1 by dtapu...@chromium.org
, Sep 20 2016