| OLD | NEW |
| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 toHTMLContentElementOrDie(userAgentShadowRoot()->firstChild()); | 115 toHTMLContentElementOrDie(userAgentShadowRoot()->firstChild()); |
| 116 DCHECK(content->firstChild()); | 116 DCHECK(content->firstChild()); |
| 117 CHECK(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( |
| 122 const AtomicString& oldValue, | 122 const AttributeModificationParams& params) { |
| 123 const AtomicString& value) { | 123 if (params.name == openAttr) { |
| 124 if (name == openAttr) { | |
| 125 bool oldValue = m_isOpen; | 124 bool oldValue = m_isOpen; |
| 126 m_isOpen = !value.isNull(); | 125 m_isOpen = !params.newValue.isNull(); |
| 127 if (m_isOpen == oldValue) | 126 if (m_isOpen == oldValue) |
| 128 return; | 127 return; |
| 129 | 128 |
| 130 // Dispatch toggle event asynchronously. | 129 // Dispatch toggle event asynchronously. |
| 131 m_pendingEvent = | 130 m_pendingEvent = |
| 132 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) | 131 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) |
| 133 ->postCancellableTask( | 132 ->postCancellableTask( |
| 134 BLINK_FROM_HERE, | 133 BLINK_FROM_HERE, |
| 135 WTF::bind(&HTMLDetailsElement::dispatchPendingEvent, | 134 WTF::bind(&HTMLDetailsElement::dispatchPendingEvent, |
| 136 wrapPersistent(this))); | 135 wrapPersistent(this))); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 147 // if the details element is open or closed. | 146 // if the details element is open or closed. |
| 148 Element* summary = findMainSummary(); | 147 Element* summary = findMainSummary(); |
| 149 DCHECK(summary); | 148 DCHECK(summary); |
| 150 | 149 |
| 151 Element* control = toHTMLSummaryElement(summary)->markerControl(); | 150 Element* control = toHTMLSummaryElement(summary)->markerControl(); |
| 152 if (control && control->layoutObject()) | 151 if (control && control->layoutObject()) |
| 153 control->layoutObject()->setShouldDoFullPaintInvalidation(); | 152 control->layoutObject()->setShouldDoFullPaintInvalidation(); |
| 154 | 153 |
| 155 return; | 154 return; |
| 156 } | 155 } |
| 157 HTMLElement::parseAttribute(name, oldValue, value); | 156 HTMLElement::parseAttribute(params); |
| 158 } | 157 } |
| 159 | 158 |
| 160 void HTMLDetailsElement::toggleOpen() { | 159 void HTMLDetailsElement::toggleOpen() { |
| 161 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); | 160 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); |
| 162 } | 161 } |
| 163 | 162 |
| 164 bool HTMLDetailsElement::isInteractiveContent() const { | 163 bool HTMLDetailsElement::isInteractiveContent() const { |
| 165 return true; | 164 return true; |
| 166 } | 165 } |
| 167 | 166 |
| 168 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |