Index: Source/core/html/HTMLDetailsElement.cpp |
diff --git a/Source/core/html/HTMLDetailsElement.cpp b/Source/core/html/HTMLDetailsElement.cpp |
index c4b8f541a9280dd31ba23a95e693cda78b6c19df..32a1fe8f042c498c74be28b64335c8c1cca64b51 100644 |
--- a/Source/core/html/HTMLDetailsElement.cpp |
+++ b/Source/core/html/HTMLDetailsElement.cpp |
@@ -79,10 +79,8 @@ void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot& root) |
Element* HTMLDetailsElement::findMainSummary() const |
{ |
- for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) { |
- if (child->hasTagName(summaryTag)) |
- return child; |
- } |
+ if (HTMLSummaryElement* summary = Traversal<HTMLSummaryElement>::firstChild(*this)) |
+ return summary; |
HTMLContentElement* content = toHTMLContentElement(userAgentShadowRoot()->firstChild()); |
ASSERT(content->firstChild() && content->firstChild()->hasTagName(summaryTag)); |