W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2019

[csswg-drafts] [css-scroll-anchoring-1] Can anchor node be an inline-block? (#4247)

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Tue, 27 Aug 2019 21:24:01 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-486041589-1566941039-sysbot+gh@w3.org>
emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-scroll-anchoring-1] Can anchor node be an inline-block? ==
If you go to [this test-case](https://bug1540203.bmoattachments.org/attachment.cgi?id=9088572), then scroll so that the red box is only partially visible, then click it, what should happen?

Firefox and Chrome disagree on this one, and I think Firefox is right per spec. However the user expected Chrome's behavior.

In particular:

 * Firefox chooses the text as the scroll anchor, and thus when the box grows the text keeps its position relative to the viewport.

 * Chrome seems to choose the red box as an anchor, and thus when it grows it moves the text down.

I think per spec Firefox is right. https://drafts.csswg.org/css-scroll-anchoring/#anchor-node-selection says:

> The anchor node is either a non-anonymous block box or a text node.

Where block box is https://drafts.csswg.org/css-display-3/#block-box. An inline-block element is clearly not a "block box" (its display outside is `block`), so the next eligible anchor node is the text.

However it seems Chromium does select inline-blocks as anchor nodes?

Is this an oversight in the specification, or a bug in Chromium?

cc @skobes @eqrion @dholbert 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4247 using your GitHub account
Received on Tuesday, 27 August 2019 21:24:03 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:13 UTC