Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1231)

Side by Side Diff: Source/core/html/HTMLDetailsElement.cpp

Issue 189923002: Use new Traversal<HTML*Element> API in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLAppletElement.cpp ('k') | Source/core/html/HTMLFieldSetElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 RefPtr<HTMLDivElement> content = HTMLDivElement::create(document()); 73 RefPtr<HTMLDivElement> content = HTMLDivElement::create(document());
74 content->setIdAttribute(ShadowElementNames::detailsContent()); 74 content->setIdAttribute(ShadowElementNames::detailsContent());
75 content->appendChild(HTMLContentElement::create(document())); 75 content->appendChild(HTMLContentElement::create(document()));
76 content->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); 76 content->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
77 root.appendChild(content.release()); 77 root.appendChild(content.release());
78 } 78 }
79 79
80 Element* HTMLDetailsElement::findMainSummary() const 80 Element* HTMLDetailsElement::findMainSummary() const
81 { 81 {
82 for (Element* child = ElementTraversal::firstWithin(*this); child; child = E lementTraversal::nextSibling(*child)) { 82 if (HTMLSummaryElement* summary = Traversal<HTMLSummaryElement>::firstChild( *this))
83 if (child->hasTagName(summaryTag)) 83 return summary;
84 return child;
85 }
86 84
87 HTMLContentElement* content = toHTMLContentElement(userAgentShadowRoot()->fi rstChild()); 85 HTMLContentElement* content = toHTMLContentElement(userAgentShadowRoot()->fi rstChild());
88 ASSERT(content->firstChild() && content->firstChild()->hasTagName(summaryTag )); 86 ASSERT(content->firstChild() && content->firstChild()->hasTagName(summaryTag ));
89 return toElement(content->firstChild()); 87 return toElement(content->firstChild());
90 } 88 }
91 89
92 void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value) 90 void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value)
93 { 91 {
94 if (name == openAttr) { 92 if (name == openAttr) {
95 bool oldValue = m_isOpen; 93 bool oldValue = m_isOpen;
(...skipping 21 matching lines...) Expand all
117 { 115 {
118 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); 116 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom);
119 } 117 }
120 118
121 bool HTMLDetailsElement::isInteractiveContent() const 119 bool HTMLDetailsElement::isInteractiveContent() const
122 { 120 {
123 return true; 121 return true;
124 } 122 }
125 123
126 } 124 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAppletElement.cpp ('k') | Source/core/html/HTMLFieldSetElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698