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

Issue 635716 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
(currently inactive on Chromium)
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 558575



Sign in to add a comment

[scroll anchoring] allow authors to exclude elements from anchor node selection

Project Member Reported by skobes@chromium.org, Aug 9 2016

Issue description

We should allow web authors to declare that parts of the dom inside a scroller are ineligible for anchor node selection, without disabling scroll anchoring for the entire scroller.

We can probably do this as an extension of the overflow-anchor property added in  issue 599180 .  In other words, overflow-anchor:none means "don't anchor to this element or anything inside it".  As a corollary, overflow-anchor:none on a scroller disables scroll anchoring inside that scroller.

This makes things slightly tricky if you want an inner scroller to perform anchoring but be ineligible to an outer scroller, or vice versa, but those can be achieved by adding an extra <div> with overflow-anchor:none around or within the inner scroller.
 

Comment 1 by ymalik@chromium.org, Aug 10 2016

To clarify, if I have overflow-anchor: none on scroller x, and overflow-anchor:visible on an element y within the scroller, this would mean the following things right?
- Scroll anchoring is disabled for scroller x
- All elements between x and y will not be used as anchors, but all of y's children will still be potential anchor candidates?

I worry that authors may disable scroll anchoring on a nested scroller, without realizing that all of the scrollers' children are opted out from being anchor candidates for the main scroller.

Comment 2 by skobes@chromium.org, Aug 10 2016

No, I think if findAnchor hits an element with overflow-anchor:none it should skip over it and not descend into it.

There's no way to exclude an element from an inner scroller but not an outer scroller.  But I'm not sure when that would be useful?

Comment 3 by ymalik@chromium.org, Aug 14 2016

For nested scrollers, we have the following scenarios: 

Want anchoring on outer and inner: do nothing
Want anchoring on neither: overflow-anchor: none on inner and outer
Want anchoring on inner not on outer: overflow-anchor:none on outer
Want anchoring on outer not on inner: 
  - overflow-anchor: none on inner scroller if also want to exclude inner from outer's anchor selection, else
  - wrap contents of inner scroller within a div and overflow-anchor: none on the div

In the last case, the author can’t specify to anchor to things inside the inner scroller for the outer scroller, but presumably this is not really useful.

Comment 4 by ymalik@chromium.org, Aug 15 2016

Owner: ymalik@chromium.org
Status: Started (was: Available)

Comment 5 by ojan@chromium.org, Aug 15 2016

Cc: tabatkins@chromium.org
Tab, do you have opinions on this? The more I think about it, the more it feels weird to me to have one property control both whether you do anchoring and whether you can be an anchor. Using wrapper nodes to solve problems also is less than ideal since we're trying to push authors to use fewer DOM nodes to get better performance.
I don't think it's weird at first glance, but this is also getting to the point that we should be WICG'ing it and getting other people to look at it. ^_^
Status: Fixed (was: Started)
I've added the questions around the shape of this API to the open issues section of the explainer doc and invited feedback on https://github.com/WICG/interventions/issues/2.  Let's close this and open new bugs for any future API changes we decide to make.
Labels: Hotlist-Input-Dev

Sign in to add a comment