New issue
Advanced search Search tips

Issue 876220 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 693412
Owner:
Closed: Aug 21
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Compat



Sign in to add a comment

position: sticky has 1 pixel precise issue at some cases

Reported by zljj0...@gmail.com, Aug 21

Issue description

Example URL:
https://pre-wormhole.tmall.com/wow/tun/act/test-sticky-2

Steps to reproduce the problem:
1. scroll page, and the div with postion: sticky fixed at top

What is the expected behavior?

What went wrong?
The div's top is 0px, but there is an obvious 1px gap between top and div.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 67.0.3396.99  Channel: n/a
OS Version: all
Flash Version: Shockwave Flash 30.0 r0
 
com.android.chrome.png
72.1 KB View Download
This issue is caused by accuracy loss, and also exists on M68.
I found the root cause:
In CompositedLayerMapping::UpdateStickyConstraints:
  constraint.scroll_container_relative_sticky_box_rect =
      EnclosingIntRect(constraints.ScrollContainerRelativeStickyBoxRect());
this will cause in this casue postion y value 313.9xx enclosing to 313, and this will cause 1 pixel accuracy loss.

I think EnclosingIntRect should change to RoundedIntRect.

And the url above is internal, so please try the test html on attchment.

Please conform this issue, thank you.
sticky.html
110 KB View Download
Components: Internals>Compositing>Animation
Labels: Hotlist-Polish
Owner: yigu@chromium.org
Status: Started (was: Unconfirmed)
Thanks for the investigation! Will look into it soon.
Mergedinto: 693412
Status: Duplicate (was: Started)
Bug fixed.

Sign in to add a comment