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

Issue 727669 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Border width rounding changes float positions when zooming

Reported by frnkprn...@gmail.com, May 30 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0

Example URL:
https://jsfiddle.net/FrankPrins/278jt6q8/1/

Steps to reproduce the problem:
1. Navigate to any page which has a block element with a border and a set width within a parent element that has the same width as the element. For example:  https://jsfiddle.net/FrankPrins/278jt6q8/
2. Zoom out to any of the following percentages: 90%, 80%, 75%, 67%, 50%, 33%, 25%

What is the expected behavior?
The expected behaviour is that zooming on the page has no effect on block elements with fixed sizes. 

What went wrong?
Using the inspector i see that the border and width of the elements change depending on the zoom level.
The change in border width is upwards and significant (+3px or +300% on 1px border, +2px or +100% on 2px border) and results in shifting of elements.
The change in the width of the element itself is only minor (0.010 - 0.031) and down, not resulting in any distortion of layout.
Padding and Margin sizes are not affected in any way by zooming (Not reflected in the example).

In the case of the 1px border, the actual border seems to be the correct border size divided by the percentage. ( 1/.9= 1.111)
In the case of the 2px border, only the percentages 33 and 25 are affected.

The results are below:

1PX BORDER
100%
border: 1px
Width: 58px
90%
border: 1.111px
Width: 57.986px
80%
border: 1.250px
Width: 57.988px
75%
border: 1.333px
Width: 58px
67%
border: 1.500px
Width: 57.984px
50%
border: 2px
Width: 58px
33%
border: 3px
Width: 57.984px
25%
border: 4px
Width: 58px

2PX BORDER
100%
border: 2px
Width: 56px
90%
border: 1.997px
Width: 55.990px
80%
border: 1.992px
Width: 55.996px
75%
border: 2px
Width: 56px
67%
border: 1.992px
Width: 55.992px
50%
border: 2px
Width: 56px
33%
border: 3px
Width: 55.969px
25%
border: 4px
Width: 56px

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: 58.0.3029.110  Channel: stable
OS Version: 10.0
Flash Version: N/A
 
Works correctly in Edge(40.15063.0.0) and IE(11.296.15063.0) for windows as well as Safari (10.1 12603.1.30.0.34) for mac. 
Possibly related to 702608.
That issue is concerning display scaling, but the same issue exist when zooming.
The issue is merged into 594481 by schenney@chromium.org mentioning it is next on his agenda.
I am however not able to cc schenney myself, and i am not quite sure if this is indeed a related or a different problem.
Cc: schenney@chromium.org
Components: -Blink Blink>Paint
schenney, please see above
Cc: jbanavatu@chromium.org
Labels: M-60 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce on Windows-10 & 7, ubuntu 14.04, Mac 10.12 using chrome stable M58-58.0.3029.110 and latest M61-60.0.3115.0 
This is Non-regression issue seen from M-35. So, marking it as Untriaged to get more inputs from dev team.

Thanks!
Labels: -M-60 M-61
Components: -Blink>Paint Blink>Layout
Summary: Border width rounding changes float positions when zooming (was: Border width changes when zooming)
The calculated widths under zoom cause the floats to move onto a second line, when they should all stay on one line.

This is related to layout of floats. We are painting them correctly, but layout is telling us that they move around, presumably because the border sizes are snapping somehow or sub-pixel accumulation is not being accounted for correctly.


Comment 7 by ka...@opera.com, Jun 5 2017

Owner: ka...@opera.com
Status: Assigned (was: Untriaged)
Owner means assigned. :-)

Comment 9 by ka...@opera.com, Jun 6 2017

This is because borders between 0px and 1px are currently rounded up to 1px (appears to stem from https://codereview.chromium.org/1412103005).  In the above case, when zooming out to 90%, the 1px border is scaled down to 0.9px, and is subsequently clamped back up to 1px, which will occupy more space than expected.

I'll experiment with moving the rounding up to the painting stage instead.
Project Member

Comment 10 by bugdroid1@chromium.org, Jun 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eb499bd02c68f68b5f74d534a673e920f8e7a5e6

commit eb499bd02c68f68b5f74d534a673e920f8e7a5e6
Author: Karl Anders Øygard <karlo@opera.com>
Date: Mon Jun 26 10:49:53 2017

Move rounding up to 1.0f of border widths to the painting stage.

BUG= 727669 

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id6226e1df033e8ee72ffa32cde4c0d12fc3cbf36
Reviewed-on: https://chromium-review.googlesource.com/525536
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482233}
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/animations/interpolation/border-width-interpolation.html
[add] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/fast/borders/border-width-below-1-expected.html
[add] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/fast/borders/border-width-below-1.html
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/fast/reflections/reflection-with-zoom-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/fast/reflections/reflection-with-zoom-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/fast/sub-pixel/sub-pixel-border-2-expected.html
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/fast/sub-pixel/sub-pixel-border-2.html
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/fast/sub-pixel/sub-pixel-border.html
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select-popup/popup-menu-appearance-zoom090-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/fast/forms/select-popup/popup-menu-appearance-zoom090-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.png
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/Source/core/css/CSSProperties.json5
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/Source/core/layout/CollapsedBorderValue.h
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp
[modify] https://crrev.com/eb499bd02c68f68b5f74d534a673e920f8e7a5e6/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp

Comment 11 by ka...@opera.com, Jun 26 2017

Status: Fixed (was: Assigned)

Sign in to add a comment