| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 HTMLDetailsElement::HTMLDetailsElement(const QualifiedName& tagName, Document* d
ocument) | 50 HTMLDetailsElement::HTMLDetailsElement(const QualifiedName& tagName, Document* d
ocument) |
| 51 : HTMLElement(tagName, document) | 51 : HTMLElement(tagName, document) |
| 52 , m_isOpen(false) | 52 , m_isOpen(false) |
| 53 { | 53 { |
| 54 ASSERT(hasTagName(detailsTag)); | 54 ASSERT(hasTagName(detailsTag)); |
| 55 ScriptWrappable::init(this); | 55 ScriptWrappable::init(this); |
| 56 } | 56 } |
| 57 | 57 |
| 58 RenderObject* HTMLDetailsElement::createRenderer(RenderStyle*) | 58 RenderObject* HTMLDetailsElement::createRenderer(RenderStyle*) |
| 59 { | 59 { |
| 60 return new (document()->renderArena()) RenderBlock(this); | 60 return new RenderBlock(this); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot* root) | 63 void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot* root) |
| 64 { | 64 { |
| 65 RefPtr<HTMLSummaryElement> defaultSummary = HTMLSummaryElement::create(summa
ryTag, document()); | 65 RefPtr<HTMLSummaryElement> defaultSummary = HTMLSummaryElement::create(summa
ryTag, document()); |
| 66 defaultSummary->appendChild(Text::create(document(), defaultDetailsSummaryTe
xt()), ASSERT_NO_EXCEPTION); | 66 defaultSummary->appendChild(Text::create(document(), defaultDetailsSummaryTe
xt()), ASSERT_NO_EXCEPTION); |
| 67 | 67 |
| 68 RefPtr<HTMLContentElement> content = HTMLContentElement::create(document()); | 68 RefPtr<HTMLContentElement> content = HTMLContentElement::create(document()); |
| 69 content->setSelect(summaryQuerySelector()); | 69 content->setSelect(summaryQuerySelector()); |
| 70 content->appendChild(defaultSummary); | 70 content->appendChild(defaultSummary); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return false; | 104 return false; |
| 105 return childContext.node() == findMainSummary() && HTMLElement::childShouldC
reateRenderer(childContext); | 105 return childContext.node() == findMainSummary() && HTMLElement::childShouldC
reateRenderer(childContext); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void HTMLDetailsElement::toggleOpen() | 108 void HTMLDetailsElement::toggleOpen() |
| 109 { | 109 { |
| 110 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); | 110 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } | 113 } |
| OLD | NEW |