This is similar to bug 61426 (see there for a test case) Generated content from a details::before selector render before any summary or other details-content. Per the CSS spec, content generated with a :before rule should be rendered as if it was the first child of the parent element. For <details> this means that the generated content should become part of the non-<summary> content of the <details> element (and thus hidden if the <details> element is collapsed). Similarly for details::after - this should also become part of the non-summary content (as if the last child) and thus hidden if the element is collapsed (currently it is rendered always).
Tree reforming: Unblocking 72352 because 59827 is already blocking it.
The generated content doesn't display at all in this test anymore. Something is bad here because it will show if you create a shadow root manually on an element. Something weird is going on with <details>
(In reply to comment #2) > The generated content doesn't display at all in this test anymore. Something is bad here because it will show if you create a shadow root manually on an element. > > Something weird is going on with <details> This is because of the logic in HTMLDetailsElement::childShouldCreateRenderer. It's unfortunate that the ShadowRoot things in WebCore side step the usual mechanisms that JS developers would use because we end up with behavior you can't explain with the Shadow DOM/HTML Components specs. I think we should fix Shadow DOM to perform distribution on generated content so <content select=":before"> works and then explain <input>'s weirdness with webkit having a <content select=":before"> in there.