W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2017

Re: [csswg-drafts] [css-display][css-pseudo] Interaction of display:contents and ::first-line

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Tue, 16 May 2017 00:28:35 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-301641199-1494894513-sysbot+gh@w3.org>
Yes, @fantasai and I think that the first option is best.  #2 is bad because it produces sibling ::first-line boxes, which doesn't happen currently and would break certain types of formatting, such as image backgrounds and letter-spacing. 

#3 is bad because it's actually impossible - the boxes don't exist, so we don't know whether they "would contain" inlines or blocks (that fact can change depending on surroundings).  Also, appending content to an element shouldn't fundamentally change the structure of earlier contents.

So #1 is the most reasonable, I think - just look at the resulting box tree and insert ::first-line boxes as appropriate.  This keeps ::first-line generation purely a box-tree-time operation (which both #2 and #3 fail, since they require element-tree information)  The only downside is that, from an author's perspective, it "flips" inheritance for text inside a display:contents that would have been a block (without display:contents, the ::first-line goes inside the div, so text inherits from the ::first-line rather than the div), however we don't really have a concept of "would have been a block" (as the block-ness comes from the display value).

GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1310#issuecomment-301641199 using your GitHub account
Received on Tuesday, 16 May 2017 00:28:41 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:12 UTC