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

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

Issue 2534873004: Avoid unchecked casts in UA shadow DOM. (Closed)
Patch Set: Created 4 years 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
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 content->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); 105 content->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
106 root.appendChild(content); 106 root.appendChild(content);
107 } 107 }
108 108
109 Element* HTMLDetailsElement::findMainSummary() const { 109 Element* HTMLDetailsElement::findMainSummary() const {
110 if (HTMLSummaryElement* summary = 110 if (HTMLSummaryElement* summary =
111 Traversal<HTMLSummaryElement>::firstChild(*this)) 111 Traversal<HTMLSummaryElement>::firstChild(*this))
112 return summary; 112 return summary;
113 113
114 HTMLContentElement* content = 114 HTMLContentElement* content =
115 toHTMLContentElement(userAgentShadowRoot()->firstChild()); 115 toHTMLContentElementOrDie(userAgentShadowRoot()->firstChild());
116 DCHECK(content->firstChild()); 116 DCHECK(content->firstChild());
117 DCHECK(isHTMLSummaryElement(*content->firstChild())); 117 CHECK(isHTMLSummaryElement(*content->firstChild()));
118 return toElement(content->firstChild()); 118 return toElement(content->firstChild());
119 } 119 }
120 120
121 void HTMLDetailsElement::parseAttribute(const QualifiedName& name, 121 void HTMLDetailsElement::parseAttribute(const QualifiedName& name,
122 const AtomicString& oldValue, 122 const AtomicString& oldValue,
123 const AtomicString& value) { 123 const AtomicString& value) {
124 if (name == openAttr) { 124 if (name == openAttr) {
125 bool oldValue = m_isOpen; 125 bool oldValue = m_isOpen;
126 m_isOpen = !value.isNull(); 126 m_isOpen = !value.isNull();
127 if (m_isOpen == oldValue) 127 if (m_isOpen == oldValue)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 void HTMLDetailsElement::toggleOpen() { 160 void HTMLDetailsElement::toggleOpen() {
161 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); 161 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom);
162 } 162 }
163 163
164 bool HTMLDetailsElement::isInteractiveContent() const { 164 bool HTMLDetailsElement::isInteractiveContent() const {
165 return true; 165 return true;
166 } 166 }
167 167
168 } // namespace blink 168 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698