Index: Source/core/html/HTMLDetailsElement.cpp |
diff --git a/Source/core/html/HTMLDetailsElement.cpp b/Source/core/html/HTMLDetailsElement.cpp |
index 9546f306e698da65e31e050950e79d44ff043426..b08a2536e291e39b4924ff60df90f884573b97c1 100644 |
--- a/Source/core/html/HTMLDetailsElement.cpp |
+++ b/Source/core/html/HTMLDetailsElement.cpp |
@@ -79,9 +79,9 @@ void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot& root) |
Element* HTMLDetailsElement::findMainSummary() const |
{ |
- for (Node* child = firstChild(); child; child = child->nextSibling()) { |
+ for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) { |
if (child->hasTagName(summaryTag)) |
- return toElement(child); |
+ return child; |
} |
HTMLContentElement* content = toHTMLContentElement(userAgentShadowRoot()->firstChild()); |