W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

[shadow-dom] ::before/after on shadow hosts

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 30 Jun 2015 16:48:22 -0700
Message-ID: <CAAWBYDBsr=+62NEQQHxk2Fp18L14zkzQ6SLs1aS6UQmmqaC5cA@mail.gmail.com>
To: public-webapps <public-webapps@w3.org>
I was recently pointed to this StackOverflow thread
<http://stackoverflow.com/questions/31094454/does-the-shadow-dom-replace-before-and-after/>
which asks what happens to ::before and ::after on shadow hosts, as
it's not clear from the specs.  I had to admit that I hadn't thought
of this corner-case, and it wasn't clear what the answer was!

In particular, there seem to be two reasonable options:

1. ::before and ::after are *basically* children of the host element,
so they get suppressed when the shadow contents are displayed

2. ::before and ::after aren't *really* children of the host element,
so they still show up before/after the shadow contents.

According to the SO thread (I haven't tested this myself), Firefox and
Chrome both settled on #2.  I'm fine to spec this in the Scoping
module, I just wanted to be sure this was the answer we wanted.

~TJ
Received on Tuesday, 30 June 2015 23:49:09 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:32 UTC