diff --git a/third_party/blink/renderer/core/html/html_details_element.cc b/third_party/blink/renderer/core/html/html_details_element.cc index 13ab1f9781dec5..42c8395ef86c14 100644 --- a/third_party/blink/renderer/core/html/html_details_element.cc +++ b/third_party/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/third_party/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html b/third_party/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html new file mode 100644 index 00000000000000..cc94e92fe0cdfb --- /dev/null +++ b/third_party/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/third_party/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt b/third_party/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt index f78414ece3703d..611b1031ea16fb 100644 --- a/third_party/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt +++ b/third_party/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