| 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 15 matching lines...) Expand all Loading... |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/html/HTMLSourceElement.h" | 27 #include "core/html/HTMLSourceElement.h" |
| 28 | 28 |
| 29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
| 30 #include "core/css/MediaList.h" | 30 #include "core/css/MediaList.h" |
| 31 #include "core/css/MediaQueryList.h" | 31 #include "core/css/MediaQueryList.h" |
| 32 #include "core/css/MediaQueryMatcher.h" | 32 #include "core/css/MediaQueryMatcher.h" |
| 33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 34 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
| 35 #include "core/events/EventSender.h" | 35 #include "core/events/EventSender.h" |
| 36 #include "core/html/HTMLMediaElement.h" | |
| 37 #include "core/html/HTMLPictureElement.h" | 36 #include "core/html/HTMLPictureElement.h" |
| 38 #include "platform/Logging.h" | 37 #include "platform/Logging.h" |
| 39 | 38 |
| 40 namespace blink { | 39 namespace blink { |
| 41 | 40 |
| 42 static SourceEventSender& sourceErrorEventSender() | 41 static SourceEventSender& sourceErrorEventSender() |
| 43 { | 42 { |
| 44 DEFINE_STATIC_LOCAL(SourceEventSender, sharedErrorEventSender, (EventTypeNam
es::error)); | 43 DEFINE_STATIC_LOCAL(SourceEventSender, sharedErrorEventSender, (EventTypeNam
es::error)); |
| 45 return sharedErrorEventSender; | 44 return sharedErrorEventSender; |
| 46 } | 45 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 sourceErrorEventSender().cancelEvent(this); | 78 sourceErrorEventSender().cancelEvent(this); |
| 80 #if !ENABLE(OILPAN) | 79 #if !ENABLE(OILPAN) |
| 81 m_listener->clearElement(); | 80 m_listener->clearElement(); |
| 82 #endif | 81 #endif |
| 83 } | 82 } |
| 84 | 83 |
| 85 Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode
* insertionPoint) | 84 Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode
* insertionPoint) |
| 86 { | 85 { |
| 87 HTMLElement::insertedInto(insertionPoint); | 86 HTMLElement::insertedInto(insertionPoint); |
| 88 Element* parent = parentElement(); | 87 Element* parent = parentElement(); |
| 89 if (isHTMLMediaElement(parent)) | |
| 90 toHTMLMediaElement(parent)->sourceWasAdded(this); | |
| 91 if (isHTMLPictureElement(parent)) | 88 if (isHTMLPictureElement(parent)) |
| 92 toHTMLPictureElement(parent)->sourceOrMediaChanged(); | 89 toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
| 93 return InsertionDone; | 90 return InsertionDone; |
| 94 } | 91 } |
| 95 | 92 |
| 96 void HTMLSourceElement::removedFrom(ContainerNode* removalRoot) | 93 void HTMLSourceElement::removedFrom(ContainerNode* removalRoot) |
| 97 { | 94 { |
| 98 Element* parent = parentElement(); | 95 Element* parent = parentElement(); |
| 99 if (!parent && removalRoot->isElementNode()) | 96 if (!parent && removalRoot->isElementNode()) |
| 100 parent = toElement(removalRoot); | 97 parent = toElement(removalRoot); |
| 101 if (isHTMLMediaElement(parent)) | |
| 102 toHTMLMediaElement(parent)->sourceWasRemoved(this); | |
| 103 if (isHTMLPictureElement(parent)) | 98 if (isHTMLPictureElement(parent)) |
| 104 toHTMLPictureElement(parent)->sourceOrMediaChanged(); | 99 toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
| 105 HTMLElement::removedFrom(removalRoot); | 100 HTMLElement::removedFrom(removalRoot); |
| 106 } | 101 } |
| 107 | 102 |
| 108 void HTMLSourceElement::setSrc(const String& url) | 103 void HTMLSourceElement::setSrc(const String& url) |
| 109 { | 104 { |
| 110 setAttribute(HTMLNames::srcAttr, AtomicString(url)); | 105 setAttribute(HTMLNames::srcAttr, AtomicString(url)); |
| 111 } | 106 } |
| 112 | 107 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 175 } |
| 181 | 176 |
| 182 void HTMLSourceElement::trace(Visitor* visitor) | 177 void HTMLSourceElement::trace(Visitor* visitor) |
| 183 { | 178 { |
| 184 visitor->trace(m_mediaQueryList); | 179 visitor->trace(m_mediaQueryList); |
| 185 visitor->trace(m_listener); | 180 visitor->trace(m_listener); |
| 186 HTMLElement::trace(visitor); | 181 HTMLElement::trace(visitor); |
| 187 } | 182 } |
| 188 | 183 |
| 189 } | 184 } |
| OLD | NEW |