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

Issue 879428 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Maybe sticky should not use overflow: hidden ancestor if it does not overflow?

Project Member Reported by flackr@chromium.org, Aug 31

Issue description

Chrome Version: 70.0.3524.2
OS: All

Adapted from  issue 674116 

What steps will reproduce the problem?
(1) Open this CodePen https://codepen.io/AlexRad/pen/XMQpvq
(2) Scroll table content

What is the expected result?

Green box should be sticking to top at both columns.

What happens instead?

The green box in the first column does not stick. It does however stick in Firefox and neither box sticks in Safari.

The spec[1] states that "the offset is computed with reference to the nearest ancestor with a scrolling box, or the viewport if no ancestor has a scrolling box." where a scrolling box is created if "Elements and viewports have an associated scrolling box if has a scrolling mechanism or it overflows its content area and the used value of the overflow-x or overflow-y property is hidden." [2]

This seems to suggest that maybe at the moment the content within overflow: hidden overflows the sticky element should use that element, and otherwise it should use the next ancestor up.

[1] https://drafts.csswg.org/css-position/#sticky-pos
[2] https://drafts.csswg.org/cssom-view-1/#scrolling-box

 
Cc: radchenk...@gmail.com
Owner: ----
Status: Available (was: Assigned)
However, when I tried to make a test case to verify this it doesn't stick in any browsers within an overflow hidden which is consistent with our current behavior of using the overflow element as the ancestor scroller: http://jsbin.com/yaxovep/edit?html,css,output

TLDR; It's possible this is just a bug in Firefox with sticky within a table. We should add a test case like this to WPT and file a bug with them since it seems unintentional based on my test case.

Cc: -smcgruer@chromium.org
Owner: smcgruer@chromium.org
Status: Started (was: Available)
Status: Fixed (was: Started)
Not sure why it didnt post it, but a CL landed adding a test here: https://chromium-review.googlesource.com/c/chromium/src/+/1207190

The Chrome side of this bug is now fixed.
Project Member

Comment 6 by bugdroid1@chromium.org, Sep 5

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

commit c05315eb25c132c0dc0ba0dd09a39c6c897c934f
Author: Stephen McGruer <smcgruer@chromium.org>
Date: Wed Sep 05 17:38:36 2018

position:sticky - add test for overflow:hidden ancestor

Bug:  879428 
Change-Id: If92ac26be1fbf71be3e4a6040b764a09bc460eac
Reviewed-on: https://chromium-review.googlesource.com/1207190
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588918}
[add] https://crrev.com/c05315eb25c132c0dc0ba0dd09a39c6c897c934f/third_party/WebKit/LayoutTests/external/wpt/css/css-position/position-sticky-overflow-hidden.html

Sign in to add a comment