| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "core/css/MediaList.h" | 29 #include "core/css/MediaList.h" |
| 30 #include "core/css/MediaQueryList.h" | 30 #include "core/css/MediaQueryList.h" |
| 31 #include "core/css/MediaQueryMatcher.h" | 31 #include "core/css/MediaQueryMatcher.h" |
| 32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/events/Event.h" | 33 #include "core/events/Event.h" |
| 34 #include "core/events/EventSender.h" | 34 #include "core/events/EventSender.h" |
| 35 #include "core/html/HTMLMediaElement.h" | 35 #include "core/html/HTMLMediaElement.h" |
| 36 #include "core/html/HTMLPictureElement.h" | 36 #include "core/html/HTMLPictureElement.h" |
| 37 #include "platform/Logging.h" | 37 #include "platform/Logging.h" |
| 38 | 38 |
| 39 #define SOURCE_LOG_LEVEL 3 |
| 40 |
| 39 namespace blink { | 41 namespace blink { |
| 40 | 42 |
| 41 using namespace HTMLNames; | 43 using namespace HTMLNames; |
| 42 | 44 |
| 43 static SourceEventSender& sourceErrorEventSender() | 45 static SourceEventSender& sourceErrorEventSender() |
| 44 { | 46 { |
| 45 DEFINE_STATIC_LOCAL(SourceEventSender, sharedErrorEventSender, (SourceEventS
ender::create(EventTypeNames::error))); | 47 DEFINE_STATIC_LOCAL(SourceEventSender, sharedErrorEventSender, (SourceEventS
ender::create(EventTypeNames::error))); |
| 46 return sharedErrorEventSender; | 48 return sharedErrorEventSender; |
| 47 } | 49 } |
| 48 | 50 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 62 MediaQueryListListener::trace(visitor); | 64 MediaQueryListListener::trace(visitor); |
| 63 } | 65 } |
| 64 private: | 66 private: |
| 65 Member<HTMLSourceElement> m_element; | 67 Member<HTMLSourceElement> m_element; |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 inline HTMLSourceElement::HTMLSourceElement(Document& document) | 70 inline HTMLSourceElement::HTMLSourceElement(Document& document) |
| 69 : HTMLElement(sourceTag, document) | 71 : HTMLElement(sourceTag, document) |
| 70 , m_listener(new Listener(this)) | 72 , m_listener(new Listener(this)) |
| 71 { | 73 { |
| 72 WTF_LOG(Media, "HTMLSourceElement::HTMLSourceElement - %p", this); | 74 DVLOG(SOURCE_LOG_LEVEL) << "HTMLSourceElement - " << (void*)this; |
| 73 } | 75 } |
| 74 | 76 |
| 75 DEFINE_NODE_FACTORY(HTMLSourceElement) | 77 DEFINE_NODE_FACTORY(HTMLSourceElement) |
| 76 | 78 |
| 77 HTMLSourceElement::~HTMLSourceElement() | 79 HTMLSourceElement::~HTMLSourceElement() |
| 78 { | 80 { |
| 79 } | 81 } |
| 80 | 82 |
| 81 void HTMLSourceElement::createMediaQueryList(const AtomicString& media) | 83 void HTMLSourceElement::createMediaQueryList(const AtomicString& media) |
| 82 { | 84 { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return getAttribute(typeAttr); | 131 return getAttribute(typeAttr); |
| 130 } | 132 } |
| 131 | 133 |
| 132 void HTMLSourceElement::setType(const AtomicString& type) | 134 void HTMLSourceElement::setType(const AtomicString& type) |
| 133 { | 135 { |
| 134 setAttribute(typeAttr, type); | 136 setAttribute(typeAttr, type); |
| 135 } | 137 } |
| 136 | 138 |
| 137 void HTMLSourceElement::scheduleErrorEvent() | 139 void HTMLSourceElement::scheduleErrorEvent() |
| 138 { | 140 { |
| 139 WTF_LOG(Media, "HTMLSourceElement::scheduleErrorEvent - %p", this); | 141 DVLOG(SOURCE_LOG_LEVEL) << "scheduleErrorEvent - " << (void*)this; |
| 140 sourceErrorEventSender().dispatchEventSoon(this); | 142 sourceErrorEventSender().dispatchEventSoon(this); |
| 141 } | 143 } |
| 142 | 144 |
| 143 void HTMLSourceElement::cancelPendingErrorEvent() | 145 void HTMLSourceElement::cancelPendingErrorEvent() |
| 144 { | 146 { |
| 145 WTF_LOG(Media, "HTMLSourceElement::cancelPendingErrorEvent - %p", this); | 147 DVLOG(SOURCE_LOG_LEVEL) << "cancelPendingErrorEvent - " << (void*)this; |
| 146 sourceErrorEventSender().cancelEvent(this); | 148 sourceErrorEventSender().cancelEvent(this); |
| 147 } | 149 } |
| 148 | 150 |
| 149 void HTMLSourceElement::dispatchPendingEvent(SourceEventSender* eventSender) | 151 void HTMLSourceElement::dispatchPendingEvent(SourceEventSender* eventSender) |
| 150 { | 152 { |
| 151 ASSERT_UNUSED(eventSender, eventSender == &sourceErrorEventSender()); | 153 ASSERT_UNUSED(eventSender, eventSender == &sourceErrorEventSender()); |
| 152 WTF_LOG(Media, "HTMLSourceElement::dispatchPendingEvent - %p", this); | 154 DVLOG(SOURCE_LOG_LEVEL) << "dispatchPendingEvent - " << (void*)this; |
| 153 dispatchEvent(Event::createCancelable(EventTypeNames::error)); | 155 dispatchEvent(Event::createCancelable(EventTypeNames::error)); |
| 154 } | 156 } |
| 155 | 157 |
| 156 bool HTMLSourceElement::mediaQueryMatches() const | 158 bool HTMLSourceElement::mediaQueryMatches() const |
| 157 { | 159 { |
| 158 if (!m_mediaQueryList) | 160 if (!m_mediaQueryList) |
| 159 return true; | 161 return true; |
| 160 | 162 |
| 161 return m_mediaQueryList->matches(); | 163 return m_mediaQueryList->matches(); |
| 162 } | 164 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 186 } | 188 } |
| 187 | 189 |
| 188 DEFINE_TRACE(HTMLSourceElement) | 190 DEFINE_TRACE(HTMLSourceElement) |
| 189 { | 191 { |
| 190 visitor->trace(m_mediaQueryList); | 192 visitor->trace(m_mediaQueryList); |
| 191 visitor->trace(m_listener); | 193 visitor->trace(m_listener); |
| 192 HTMLElement::trace(visitor); | 194 HTMLElement::trace(visitor); |
| 193 } | 195 } |
| 194 | 196 |
| 195 } // namespace blink | 197 } // namespace blink |
| OLD | NEW |