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

Re: [csswg-drafts] [css-display] Define interaction of display:contents and replaced elements

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Wed, 15 Mar 2017 23:30:17 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-286912022-1489620616-sysbot+gh@w3.org>
"display: contents" suppresses the *box* that the element would normally generate.  Shadow DOM disappears by the time box-tree happens; the box tree is built based on the "flat tree", which has all shadows expanded out.

So yes, for a shadow host, "display: contents" just strips out the host wrapper, but all the contents are left exactly the same, just "hoisted up" one level in the tree.

We're pretty set on having replaced elements just go 'display:none' when you set 'display:contents', because they simply *don't have any boxes* below the replaced element's box; they're a black box as far as CSS is concerned. There's nothing to hoist!

Note that `<video>` and `<audio>` don't actually have "fallback contents" - they can contain normal DOM, but it's *explicitly* not a11y-related fallback, it's just there so you can show an error message to old clients that didn't support those elements.  Again, tho, they're replaced - we don't care what their DOM content is, just what their box tree is, and they don't generate box-tree children at all.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/540#issuecomment-286912022 using your GitHub account
Received on Wednesday, 15 March 2017 23:30:23 UTC

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