Bug 61766 - details::before/after rendered incorrectly
Summary: details::before/after rendered incorrectly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Web Components Team
URL:
Keywords:
Depends on:
Blocks: 72352 252223
  Show dependency treegraph
 
Reported: 2011-05-31 00:17 PDT by Roland Steiner
Modified: 2023-02-13 18:51 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.