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

Issue 693412 link

Starred by 11 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

1px gap before element with sticky positioning

Reported by rubenill...@gmail.com, Feb 17 2017

Issue description

Chrome Version : 56.0.2924.87
OS Version     : OS X 10.12.2 (also seen on Windows 10)
URLs           : https://jsfiddle.net/rulych/3vrk8pLo/
Other browsers tested:
  Firefox 51.0.1       : FAIL (mixed results, does not always happen)
  Safari on iOS 10.2.1 : OK

What steps will reproduce the problem?
1. Create a block with a height with decimal px (for example: 29.98px).
2. Create another block right after it and give it "position: sticky" and "top: 0".
3. Scroll down to make the second bar stick to the top.

What is the expected result?
The sticky bar is rendered at the top of the viewport without a gap.

What happens instead of that?
The sticky bar is shown with a "transparent" gap of 1px between itself and the top of the viewport.

UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36



 
top.png
291 KB View Download
scrolled-down.png
291 KB View Download

Comment 1 by shrike@chromium.org, Feb 18 2017

Components: Blink>Layout
Labels: Needs-Triage-M56

Comment 3 by hdodda@chromium.org, Feb 21 2017

Cc: hdodda@chromium.org
Labels: Needs-Feedback
Tested on Mac os 10.12.2 using chrome M56 #56.0.2924.87 and issue is not observed as given in scroll-down image in comment #0.  

Attached screencast for reference.

@rubenillodobrea-- Could you please check attached screencast and confirm us if we had followed correct steps in reproducing the issue , and also please help us by providing the expected result screenshot or screencast ,that would help us in traging the issue better.

Thanks!
693412.mp4
710 KB View Download
The expected behaviour would be the one you are getting, without a 1px red line on top of the blue box. I have attached a screenshot of this running on Firefox.

I have also attached a screencast of the page running on my Chrome. It's hard to distinguish the 1px gap in the video directly, but as you can see, it's consistently showing even after I zoom in.

The 1px gap keeps appearing with different window sizes, zoom levels and font base size settings.
1px-gap.mov
7.8 MB Download
expected-firefox.png
483 KB View Download
I'm able to reproduce the issue using the URL provided.

Chrome 56.0.2924.67 (Official Build) beta (64-bit)
Mac OS X 10.11.6

Screenshots attached.
Screen Shot 2017-02-22 at 23.23.23.png
258 KB View Download
Screen Shot 2017-02-22 at 23.23.46.png
423 KB View Download
Screen Shot 2017-02-22 at 23.24.02.png
201 KB View Download
For good measure, here's the same thing after updating to 57.0.2987.54 (Official Build) beta (64-bit).
Screen Shot 2017-02-22 at 23.38.24.png
267 KB View Download
Screen Shot 2017-02-22 at 23.38.27.png
425 KB View Download
I have tested it on an old MacBook Pro 2012 (!3.3", 1280 x 800) with macOS 10.12.3. The problem is not there. So:

MacBook Pro 2012 (13.3", 1280 x 800) : OK
macOS 10.12.3
Chrome 56.0.2924.87

MacBook Pro 2016 (13.3", 2560 x 1600) : FAIL
macOS 10.12.3
Chrome 56.0.2924.87
Labels: -Needs-Feedback
Thank you for providing feedback. removing "Needs-Feedback" label.
Cc: sureshkumari@chromium.org
Labels: Needs-Feedback
Tested the issue on MacBook Air 10.12.2,Windows-7 and linux Ubuntu-14.04 using
Chrome stable version 56.0.2924.87 and canary 58.0.3027.3 with the steps mentioned in comment#0 and issue is not reproduced.
Reporter@ could you please try in a clean profile without any extensions and let us know your observations if the issue still persists.

Thanks..

I have tested several MacBooks around the office, and I think that the bug can only be found on high resolution screens (Retina Display). I have attached 5 new tests on 5 different machines here. You can see that the only one that behaves correctly is test number 1, run on a non-Retina Display MacBook Air.
1-OK-1440x900-case.png
140 KB View Download
1-OK-1440x900-os-details.png
115 KB View Download
1-OK-1440x900-screen-details.png
60.4 KB View Download
2-FAIL-2304x1440-case.png
624 KB View Download
2-FAIL-2304x1440-os-details.png
203 KB View Download
2-FAIL-2304x1440-screen-details.png
203 KB View Download
3-FAIL-5120x2880-case.png
567 KB View Download
3-FAIL-5120x2880-os-details.png
169 KB View Download
3-FAIL-5120x2880-screen-details.png
256 KB View Download
4-FAIL-2560x1600-case.png
402 KB View Download
4-FAIL-2560x1600-os-details.png
444 KB View Download
4-FAIL-2560x1600-screen-details.png
249 KB View Download
5-FAIL-2880x1800-case.png
378 KB View Download
5-FAIL-2880x1800-os-details.png
202 KB View Download
5-FAIL-2880x1800-screen-details.png
204 KB View Download
Project Member

Comment 11 by sheriffbot@chromium.org, Mar 3 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sureshkumari@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
One more test case. I have used again my own computer, that usually FAILS, but this time I opened the site on a second screen plugged to my MacBook. The second screen is 1920x1080, and test is OK; there is no bug. Only on the primary screen (2560x1600) can the bug be found.
6-OK-1920x1080-case.png
157 KB View Download
6-OK-1920x1080-os-details.png
443 KB View Download
6-OK-1920x1080-screen-details.png
60.1 KB View Download

Comment 13 by e...@chromium.org, Mar 5 2017

Owner: flackr@chromium.org
Looks like another position: sticky sub-pixel/hi-dpi problem.

Comment 14 by e...@chromium.org, Mar 7 2017

Status: Available (was: Unconfirmed)
Cc: smcgruer@chromium.org
Owner: yigu@chromium.org
Status: Assigned (was: Available)
Yi can you take a look?

Comment 16 by yigu@chromium.org, Feb 12 2018

Cc: vamshi.k...@techmahindra.com
 Issue 810352  has been merged into this issue.

Comment 17 by wanzh...@gmail.com, Feb 17 2018

any new updates?

Comment 18 by yigu@chromium.org, Feb 22 2018

Labels: -Needs-Triage-M56 Needs-Bisect
This bug was only reproducible on high dpi devices. Now it fails low dpi ones on canary as well.

Working version: 64.0.3282.167
Broken version: 66.0.3353.0 

Comment 19 by yigu@chromium.org, Feb 22 2018

Labels: -Needs-Bisect
Found the cause of the regression. Need further investigation.

Comment 20 by yigu@chromium.org, Feb 27 2018

Cc: yigu@chromium.org
 Issue 815106  has been merged into this issue.
Project Member

Comment 21 by bugdroid1@chromium.org, Aug 21

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

commit 20c11c9492d799080819ff38696f09b2102211f6
Author: Yi Gu <yigu@chromium.org>
Date: Tue Aug 21 19:42:13 2018

Fix the 1px gap between composited sticky and its container

Upon calculating the relative position between a composited sticky
element and its scroll container, we use EnclosingIntRect instead of
RoundedIntRect which causes a scroll offset mismatch between main and
cc if the relative position is non integer, e.g. float prepadding.

Bug:  693412 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ideab875d2d087b8fe97264d0bddbd7e2393f8e7f
Reviewed-on: https://chromium-review.googlesource.com/1183622
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584884}
[add] https://crrev.com/20c11c9492d799080819ff38696f09b2102211f6/third_party/WebKit/LayoutTests/compositing/overflow/composited-sticky-element-with-non-integer-relative-position-to-container-expected.html
[add] https://crrev.com/20c11c9492d799080819ff38696f09b2102211f6/third_party/WebKit/LayoutTests/compositing/overflow/composited-sticky-element-with-non-integer-relative-position-to-container.html
[modify] https://crrev.com/20c11c9492d799080819ff38696f09b2102211f6/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc

Status: Fixed (was: Assigned)
 Issue 876220  has been merged into this issue.
Cc: flackr@chromium.org vamshi.kommuri@chromium.org
 Issue 814269  has been merged into this issue.
Cc: pdr@chromium.org amineer@chromium.org
 Issue 878802  has been merged into this issue.

Sign in to add a comment