Bug 61766

Summary: details::before/after rendered incorrectly
Product: WebKit Reporter: Roland Steiner <rolandsteiner>
Component: Layout and RenderingAssignee: Web Components Team <webcomponents-bugzilla>
Status: NEW ---    
Severity: Normal CC: dglazkov, dominicc, esprehn, igor.oliveira, jonlee, morrita, rniwa, shinyak
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 72352, 252223    

Description Roland Steiner 2011-05-31 00:17:01 PDT
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).
Comment 1 Hajime Morrita 2011-12-05 00:02:08 PST
Tree reforming: Unblocking 72352 because 59827 is already blocking it.
Comment 2 Elliott Sprehn 2013-03-06 00:36:08 PST
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>
Comment 3 Elliott Sprehn 2013-03-06 00:41:56 PST
(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.