| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 80     ASSERT(content->firstChild() && content->firstChild()->hasTagName(summaryTag
     )); | 80     ASSERT(content->firstChild() && content->firstChild()->hasTagName(summaryTag
     )); | 
| 81     return toElement(content->firstChild()); | 81     return toElement(content->firstChild()); | 
| 82 } | 82 } | 
| 83 | 83 | 
| 84 void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicS
     tring& value) | 84 void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicS
     tring& value) | 
| 85 { | 85 { | 
| 86     if (name == openAttr) { | 86     if (name == openAttr) { | 
| 87         bool oldValue = m_isOpen; | 87         bool oldValue = m_isOpen; | 
| 88         m_isOpen = !value.isNull(); | 88         m_isOpen = !value.isNull(); | 
| 89         if (oldValue != m_isOpen) | 89         if (oldValue != m_isOpen) | 
| 90             lazyReattachIfAttached(); | 90             scheduleRenderTreeRecreationIfAttached(); | 
| 91     } else | 91     } else | 
| 92         HTMLElement::parseAttribute(name, value); | 92         HTMLElement::parseAttribute(name, value); | 
| 93 } | 93 } | 
| 94 | 94 | 
| 95 bool HTMLDetailsElement::childShouldCreateRenderer(const Node& child) const | 95 bool HTMLDetailsElement::childShouldCreateRenderer(const Node& child) const | 
| 96 { | 96 { | 
| 97     // FIXME: These checks do not look correct, we should just use insertion poi
     nts instead. | 97     // FIXME: These checks do not look correct, we should just use insertion poi
     nts instead. | 
| 98     if (m_isOpen) | 98     if (m_isOpen) | 
| 99         return HTMLElement::childShouldCreateRenderer(child); | 99         return HTMLElement::childShouldCreateRenderer(child); | 
| 100     if (!child.hasTagName(summaryTag)) | 100     if (!child.hasTagName(summaryTag)) | 
| 101         return false; | 101         return false; | 
| 102     return &child == findMainSummary() && HTMLElement::childShouldCreateRenderer
     (child); | 102     return &child == findMainSummary() && HTMLElement::childShouldCreateRenderer
     (child); | 
| 103 } | 103 } | 
| 104 | 104 | 
| 105 void HTMLDetailsElement::toggleOpen() | 105 void HTMLDetailsElement::toggleOpen() | 
| 106 { | 106 { | 
| 107     setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); | 107     setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); | 
| 108 } | 108 } | 
| 109 | 109 | 
| 110 } | 110 } | 
| OLD | NEW | 
|---|