New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 778812 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Border width is not rounded correctly when page is zoomed

Reported by jakub.fr...@gmail.com, Oct 26 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 OPR/48.0.2685.39

Steps to reproduce the problem:
1. Create new block element.
2. Put border 5px style on it (also breaks for every integer not divisible by 4).
3. Look at div's border width in inspector - it's calculated as 4.8px (for 5px test case).

What is the expected behavior?
Rendered border width should be the same as written in CSS, especially for values without floating point.

What went wrong?
Border's width was scaled to rendered "zoomed in" page, but when code is trying to "bring it back" to regular (so, not scaled) size there is some sort of rounding error happening.

Did this work before? No 

Does this work in other browsers? No
 Firefox - also borders are displayed incorrectly - test case shows 4.8px of border's width.

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 10.0
Flash Version: 

Bug created as a result of previous one (which I believe was set to 'wontfix' because of "component" option which was set incorrectly) - https://bugs.chromium.org/p/chromium/issues/detail?id=696215#c7
 
test.html
526 bytes View Download
boxModel.PNG
5.4 KB View Download
Pasting another test case from previous bug report - element's sizes & paddings & margins are rendered differently (correctly) what causes some weird positioning errors to happen.

Here: width on first element and border-left on second are both 51px but because of this strange border-connected behaviour border is shown as 50.40px (b_boxModel.png) and part of the black element (which should be overlapped by yellow one) can be seen (result.png).
test2.html
726 bytes View Download
result.png
353 bytes View Download
a_boxModel.png
3.7 KB View Download
b_boxModel.png
6.5 KB View Download

Comment 2 by gracec@chromium.org, Oct 27 2017

Labels: Needs-Feedback
I can't reproduce using your test.html and the steps in the report. 

I assume you used zoom somewhere, but it's not part of the repro steps in the report. Please specify the exact steps you followed. 

Also, please consider that if Firefox's behaviour is identical to Chrome's, it is quite likely that the behaviour is correct.
Right.
First of all, if you have looked into the link to "previous issue" then you should see the comment made by "pfeldman@chromium.org":

"The issue here is that the page is zoomed it to 125%.

window.getComputedStyle($0).borderWidth gives me 4.8.

Looks like we are trying to render border with the counting number of pixels and work it back to show as computed. For 125% zoom, we have:

Math.floor(5 * 1.25) / 1.25 == 4.8"


I don't know if there is any other way to reproduce it (maybe it's possible to ask somebody from the linked issue?) - on my machine I have setup as follows:

I'm on Win 10 and in Display settings (Settings->System->Display) I have chosen "125%: option under "Scale and layout" -> "Change the size of text, apps, and other items" (see attachment).

Well, what will be the way to check if "that behaviour is correct"? By literally reading w3 standard or is there a more sophisticated approach?
Hard to believe it's working as it should - as you can see on result.png this behaviour is causing layout errors (it's not possible to implement a layout without "holes" or overlapping elements which is a huge discomfort for users with scaled views).

Capture.PNG
102 KB View Download
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 27 2017

Cc: gracec@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "gracec@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: krajshree@chromium.org
Labels: Needs-Feedback Needs-Milestone
Tested the issue on Win-10 using chrome reported version #61.0.3163.100, latest stable #62.0.3202.75 and latest canary #64.0.3253.0.

Attached a screen cast and screenshot for reference.

Following are the steps followed to reproduce the issue.
------------
1. Opened the attached file "test2.html" and zoomed the display to 125%.
2. Observed that rendered border width was 951.2 x 50 px as per the attached screenshot.

jakub.freisler@ - Could you please check the attached screen cast or screenshot and please let us know if anything missed from our side to reproduce the issue.

Thanks...!!
778812.JPG
128 KB View Download
778812.webm
1.8 MB View Download
Thanks krajshree@ you helped me realise one thing - machine on which I was testing both files (test.html & test2.html) wasn't connected to the internet for some time now and chrome's version there was still 56.0.2924.87.

Now, I confirm that in newest stable release (61) everything works as expected, so somewhere between releases 56-61 it has had been fixed - and firefox still fails.

Sorry for confusion and thank you guys for your work!
Project Member

Comment 8 by sheriffbot@chromium.org, Oct 30 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
jakub.freisler@ Thanks for the feedback.

As per comment 7, as everything is working as expected, can you please confirm if we can close this issue?

Thanks..
susanjuniab@ Sure - I'm confirming that everything works as expected and this issue can be closed.
Project Member

Comment 11 by sheriffbot@chromium.org, Oct 31 2017

Cc: susanjuniab@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "susanjuniab@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: WontFix (was: Unconfirmed)
Closing the issue as per #10.

Sign in to add a comment