| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 { | 47 { |
| 48 ASSERT(hasTagName(detailsTag)); | 48 ASSERT(hasTagName(detailsTag)); |
| 49 ScriptWrappable::init(this); | 49 ScriptWrappable::init(this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 RenderObject* HTMLDetailsElement::createRenderer(RenderStyle*) | 52 RenderObject* HTMLDetailsElement::createRenderer(RenderStyle*) |
| 53 { | 53 { |
| 54 return new RenderBlockFlow(this); | 54 return new RenderBlockFlow(this); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot* root) | 57 void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot& root) |
| 58 { | 58 { |
| 59 DEFINE_STATIC_LOCAL(AtomicString, summarySelector, ("summary:first-of-type",
AtomicString::ConstructFromLiteral)); | 59 DEFINE_STATIC_LOCAL(AtomicString, summarySelector, ("summary:first-of-type",
AtomicString::ConstructFromLiteral)); |
| 60 | 60 |
| 61 RefPtr<HTMLSummaryElement> defaultSummary = HTMLSummaryElement::create(summa
ryTag, document()); | 61 RefPtr<HTMLSummaryElement> defaultSummary = HTMLSummaryElement::create(summa
ryTag, document()); |
| 62 defaultSummary->appendChild(Text::create(document(), locale().queryString(bl
ink::WebLocalizedString::DetailsLabel))); | 62 defaultSummary->appendChild(Text::create(document(), locale().queryString(bl
ink::WebLocalizedString::DetailsLabel))); |
| 63 | 63 |
| 64 RefPtr<HTMLContentElement> content = HTMLContentElement::create(document()); | 64 RefPtr<HTMLContentElement> content = HTMLContentElement::create(document()); |
| 65 content->setAttribute(selectAttr, summarySelector); | 65 content->setAttribute(selectAttr, summarySelector); |
| 66 content->appendChild(defaultSummary); | 66 content->appendChild(defaultSummary); |
| 67 | 67 |
| 68 root->appendChild(content); | 68 root.appendChild(content); |
| 69 root->appendChild(HTMLContentElement::create(document())); | 69 root.appendChild(HTMLContentElement::create(document())); |
| 70 } | 70 } |
| 71 | 71 |
| 72 Element* HTMLDetailsElement::findMainSummary() const | 72 Element* HTMLDetailsElement::findMainSummary() const |
| 73 { | 73 { |
| 74 for (Node* child = firstChild(); child; child = child->nextSibling()) { | 74 for (Node* child = firstChild(); child; child = child->nextSibling()) { |
| 75 if (child->hasTagName(summaryTag)) | 75 if (child->hasTagName(summaryTag)) |
| 76 return toElement(child); | 76 return toElement(child); |
| 77 } | 77 } |
| 78 | 78 |
| 79 HTMLContentElement* content = toHTMLContentElement(userAgentShadowRoot()->fi
rstChild()); | 79 HTMLContentElement* content = toHTMLContentElement(userAgentShadowRoot()->fi
rstChild()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 106 { | 106 { |
| 107 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); | 107 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool HTMLDetailsElement::isInteractiveContent() const | 110 bool HTMLDetailsElement::isInteractiveContent() const |
| 111 { | 111 { |
| 112 return true; | 112 return true; |
| 113 } | 113 } |
| 114 | 114 |
| 115 } | 115 } |
| OLD | NEW |