New issue
Advanced search Search tips

Issue 677127 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 310004
Owner: ----
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Layout height is incorrectly calculated when line-height is floating number

Reported by antonio....@gmail.com, Dec 27 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

Steps to reproduce the problem:
1. Download the attached file and run it

What is the expected behavior?
The height of the div(.box) element should exactly contain 20 lines. Because max-height is equal to 20 * line-height.

What went wrong?
The height of the div(.box) element is actually bigger than 20 lines and holds around 21 items. It seems Chromium can't calculate line-height that is not an integer.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 55.0.2883.95  Channel: stable
OS Version: OS X 10.9.5
Flash Version: Shockwave Flash 24.0 r0

Works in the following browsers: Firefox, Internet Explorer, Edge
 
experiment.html
899 bytes View Download

Comment 1 by woxxom@gmail.com, Dec 27 2016

Also reproduced in Chrome 31, 54, 57 (latest canary).

According to element inspector "Computed" subpanel, "line-height" property for 1.75rem is 22.75px, and "height" property is calculated as 22px. 

Apparently, Chrome truncates the fractional part.
Firefox correctly sets the height to 22.75px.
This means that this will also not work when CSS zoom is specified or Windows scaling* is turned on.

Windows scaling - http://core0.staticworld.net/images/article/2014/02/custom-sizing-options-100246808-orig.png
Labels: M-57 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Windows-10, Mac OS 10.12 and Ubuntu 14.04 using chrome latest stable M55-55.0.2883.95 by following steps mentioned in the original comment. Observed the layout height is incorrectly calculated, It's working fine on firefox.

This is a non-regression issue seen on earlier version of chrome M35-35.0.1849.0 as well, Hence marking it as untriaged.

Thanks!

Comment 4 by e...@chromium.org, Jan 2 2017

Mergedinto: 310004
Status: Duplicate (was: Untriaged)

Sign in to add a comment