| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 24 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 25 #include "core/CSSPropertyNames.h" | 25 #include "core/CSSPropertyNames.h" |
| 26 #include "core/CSSValueKeywords.h" | 26 #include "core/CSSValueKeywords.h" |
| 27 #include "core/HTMLNames.h" | 27 #include "core/HTMLNames.h" |
| 28 #include "core/dom/ElementTraversal.h" | 28 #include "core/dom/ElementTraversal.h" |
| 29 #include "core/dom/Text.h" | 29 #include "core/dom/Text.h" |
| 30 #include "core/dom/shadow/ShadowRoot.h" | 30 #include "core/dom/shadow/ShadowRoot.h" |
| 31 #include "core/events/Event.h" | 31 #include "core/events/Event.h" |
| 32 #include "core/events/EventSender.h" | 32 #include "core/events/EventSender.h" |
| 33 #include "core/frame/UseCounter.h" |
| 33 #include "core/html/HTMLContentElement.h" | 34 #include "core/html/HTMLContentElement.h" |
| 34 #include "core/html/HTMLDivElement.h" | 35 #include "core/html/HTMLDivElement.h" |
| 35 #include "core/html/HTMLSummaryElement.h" | 36 #include "core/html/HTMLSummaryElement.h" |
| 36 #include "core/html/shadow/ShadowElementNames.h" | 37 #include "core/html/shadow/ShadowElementNames.h" |
| 37 #include "core/rendering/RenderBlockFlow.h" | 38 #include "core/rendering/RenderBlockFlow.h" |
| 38 #include "platform/text/PlatformLocale.h" | 39 #include "platform/text/PlatformLocale.h" |
| 39 | 40 |
| 40 namespace WebCore { | 41 namespace WebCore { |
| 41 | 42 |
| 42 using namespace HTMLNames; | 43 using namespace HTMLNames; |
| 43 | 44 |
| 44 static DetailsEventSender& detailsToggleEventSender() | 45 static DetailsEventSender& detailsToggleEventSender() |
| 45 { | 46 { |
| 46 DEFINE_STATIC_LOCAL(DetailsEventSender, sharedToggleEventSender, (EventTypeN
ames::toggle)); | 47 DEFINE_STATIC_LOCAL(DetailsEventSender, sharedToggleEventSender, (EventTypeN
ames::toggle)); |
| 47 return sharedToggleEventSender; | 48 return sharedToggleEventSender; |
| 48 } | 49 } |
| 49 | 50 |
| 50 PassRefPtrWillBeRawPtr<HTMLDetailsElement> HTMLDetailsElement::create(Document&
document) | 51 PassRefPtrWillBeRawPtr<HTMLDetailsElement> HTMLDetailsElement::create(Document&
document) |
| 51 { | 52 { |
| 52 RefPtrWillBeRawPtr<HTMLDetailsElement> details = adoptRefWillBeNoop(new HTML
DetailsElement(document)); | 53 RefPtrWillBeRawPtr<HTMLDetailsElement> details = adoptRefWillBeNoop(new HTML
DetailsElement(document)); |
| 53 details->ensureUserAgentShadowRoot(); | 54 details->ensureUserAgentShadowRoot(); |
| 54 return details.release(); | 55 return details.release(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 HTMLDetailsElement::HTMLDetailsElement(Document& document) | 58 HTMLDetailsElement::HTMLDetailsElement(Document& document) |
| 58 : HTMLElement(detailsTag, document) | 59 : HTMLElement(detailsTag, document) |
| 59 , m_isOpen(false) | 60 , m_isOpen(false) |
| 60 { | 61 { |
| 61 ScriptWrappable::init(this); | 62 ScriptWrappable::init(this); |
| 63 UseCounter::count(document, UseCounter::DetailsElement); |
| 62 } | 64 } |
| 63 | 65 |
| 64 HTMLDetailsElement::~HTMLDetailsElement() | 66 HTMLDetailsElement::~HTMLDetailsElement() |
| 65 { | 67 { |
| 66 detailsToggleEventSender().cancelEvent(this); | 68 detailsToggleEventSender().cancelEvent(this); |
| 67 } | 69 } |
| 68 | 70 |
| 69 void HTMLDetailsElement::dispatchPendingEvent(DetailsEventSender* eventSender) | 71 void HTMLDetailsElement::dispatchPendingEvent(DetailsEventSender* eventSender) |
| 70 { | 72 { |
| 71 ASSERT_UNUSED(eventSender, eventSender == &detailsToggleEventSender()); | 73 ASSERT_UNUSED(eventSender, eventSender == &detailsToggleEventSender()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 { | 143 { |
| 142 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); | 144 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); |
| 143 } | 145 } |
| 144 | 146 |
| 145 bool HTMLDetailsElement::isInteractiveContent() const | 147 bool HTMLDetailsElement::isInteractiveContent() const |
| 146 { | 148 { |
| 147 return true; | 149 return true; |
| 148 } | 150 } |
| 149 | 151 |
| 150 } | 152 } |
| OLD | NEW |