diff --git a/blink/renderer/core/html/html_details_element.cc b/blink/renderer/core/html/html_details_element.cc index 13ab1f9781de..42c8395ef86c 100644 --- a/blink/renderer/core/html/html_details_element.cc +++ b/blink/renderer/core/html/html_details_element.cc @@ -89,12 +89,12 @@ void HTMLDetailsElement::DidAddUserAgentShadowRoot(ShadowRoot& root) { summary_slot->AppendChild(default_summary); root.AppendChild(summary_slot); - auto* content = MakeGarbageCollected(GetDocument()); - content->SetIdAttribute(shadow_element_names::kIdDetailsContent); - content->AppendChild( - HTMLSlotElement::CreateUserAgentDefaultSlot(GetDocument())); - content->SetInlineStyleProperty(CSSPropertyID::kDisplay, CSSValueID::kNone); - root.AppendChild(content); + HTMLSlotElement* content_slot = + HTMLSlotElement::CreateUserAgentDefaultSlot(GetDocument()); + content_slot->SetIdAttribute(shadow_element_names::kIdDetailsContent); + content_slot->SetInlineStyleProperty(CSSPropertyID::kDisplay, + CSSValueID::kNone); + root.AppendChild(content_slot); } Element* HTMLDetailsElement::FindMainSummary() const { diff --git a/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html b/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html new file mode 100644 index 000000000000..cc94e92fe0cd --- /dev/null +++ b/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html @@ -0,0 +1,35 @@ + + +CSS Test: details children blockification + + + + + + +
+
+ foo +
bar +
+
+ +
+
+ foo +
bar +
+
+ + diff --git a/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt b/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt index f78414ece370..611b1031ea16 100644 --- a/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt +++ b/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt @@ -8,8 +8,7 @@ DIV id=sandbox SUMMARY id=summary DIV id=details-marker SLOT - DIV id=details-content - SLOT + SLOT id=details-content Moving mouse from details to summary