Created attachment 299020 [details] Screenshot of the issue Applying display: flex; to a <summary> element doesn't render the children as flex items. Instead they appear to render as if the <summary> element was display: block, the current default at time of writing. HTML for reproduction: <!DOCTYPE html> <html> <head> <title><summary> flex demo</title> <style> details { background: #eee; } summary { background: #dee; } h3 { background: #ede; } .foo { background: #eed; } </style> </head> <body> <h2>No flex styles</h2> <details> <summary> <h3>Hello</h3> <div class="foo">There</div> </summary> <div>Woah!</div> </details> <h2><summary> as display: block;</h2> <details> <summary style="display: block;"> <h3>Hello</h3> <div class="foo">There</div> </summary> <div>Woah!</div> </details> <h2><summary> as display: flex;</h2> <details> <summary style="display: flex;"> <h3 style="flex: 1 1 auto;">Hello</h3> <div class="foo" style="flex: 0 0 auto;">There</div> </summary> <div>Woah!</div> </details> <h2><div> inside <summary> as display: flex;</h2> <details> <summary> <div style="display: flex;"> <h3 style="flex: 1 1 auto;">Hello</h3> <div class="foo" style="flex: 0 0 auto;">There</div> </div> </summary> <div>Woah!</div> </details> </body> </html>
I confirm the issue. Note that Chrome respects `display: flex` on <summary>.
Another testcase: http://dabblet.com/gist/e4042d6b12973f1e4583bf32c4bc7e14 It doesn't look like display: flex is ignored, it certainly has an effect, just not the intended one...
I believe these two Safari-only failures in WPT are due to this bug: https://wpt.fyi/results/html/rendering/the-details-element/summary-display-flex.html?run_id=5669940343341056&run_id=5095377872093184&run_id=5759629192593408&run_id=5699667892371456 https://wpt.fyi/results/html/rendering/the-details-element/summary-display-inline-flex.html?run_id=5669940343341056&run_id=5095377872093184&run_id=5759629192593408&run_id=5699667892371456 There are also tests for grid in the same directory.
I tried similar to Blink: https://chromium.googlesource.com/chromium/src.git/+/b711bbea21e196179a525c1588004ca4f60d025d ______ RenderPtr<RenderElement> HTMLSummaryElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) { // <summary> elements with display:list-item should not be rendered as list items because they'd end up with two markers before the text (one from summary element and the other as a list item). DisplayType display = style.display(); if (display == DisplayType::Flex || display == DisplayType::Grid || display == DisplayType::InlineFlex || display == DisplayType::InlineGrid) return RenderElement::createFor(*this, WTFMove(style)); return RenderElement::createFor(*this, WTFMove(style), { RenderElement::ConstructBlockLevelRendererFor::ListItem, RenderElement::ConstructBlockLevelRendererFor::Inline, RenderElement::ConstructBlockLevelRendererFor::TableOrTablePart }); } _____ Although above didn't work. It compiles but no progression. @Aditya, @Ryosuke - any tip or help?
Safari Technology Preview 170 seems to pass these tests now: https://wpt.fyi/results/html/rendering/the-details-element/summary-display-flex.html?label=master&label=experimental&aligned&q=the-details-element & https://wpt.fyi/results/html/rendering/the-details-element/summary-display-inline-flex.html?label=master&label=experimental&aligned&q=the-details-element Do we need to track anything further?
Still passing WPT with STP172. So marking as 'RESOLVED CONFIGURATION CHANGED', please reopen if it is still not fixed.