[scroll anchoring] allow authors to exclude elements from anchor node selection |
|||||
Issue descriptionWe 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.
,
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?
,
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.
,
Aug 15 2016
,
Aug 15 2016
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.
,
Aug 15 2016
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. ^_^
,
Aug 15 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/82a6ae9efa7fa7f60d9af62bd2b3f2ebe023e177 commit 82a6ae9efa7fa7f60d9af62bd2b3f2ebe023e177 Author: ymalik <ymalik@chromium.org> Date: Mon Aug 15 20:32:48 2016 Exclude elements with overflow-anchor:none from anchor node selection BUG= 635716 Review-Url: https://codereview.chromium.org/2246803002 Cr-Commit-Position: refs/heads/master@{#412035} [modify] https://crrev.com/82a6ae9efa7fa7f60d9af62bd2b3f2ebe023e177/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp [modify] https://crrev.com/82a6ae9efa7fa7f60d9af62bd2b3f2ebe023e177/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
,
Sep 6 2016
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.
,
Sep 27 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ymalik@chromium.org
, Aug 10 2016