| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
| 38 #include "core/events/Event.h" | 38 #include "core/events/Event.h" |
| 39 #include "core/frame/LocalFrame.h" | 39 #include "core/frame/LocalFrame.h" |
| 40 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
| 41 #include "core/frame/UseCounter.h" | 41 #include "core/frame/UseCounter.h" |
| 42 #include "core/html/HTMLMediaSource.h" | 42 #include "core/html/HTMLMediaSource.h" |
| 43 #include "core/html/HTMLSourceElement.h" | 43 #include "core/html/HTMLSourceElement.h" |
| 44 #include "core/html/MediaError.h" | 44 #include "core/html/MediaError.h" |
| 45 #include "core/html/MediaFragmentURIParser.h" | 45 #include "core/html/MediaFragmentURIParser.h" |
| 46 #include "core/html/TimeRanges.h" | 46 #include "core/html/TimeRanges.h" |
| 47 #include "core/rendering/RenderVideo.h" | |
| 48 #include "core/rendering/RenderView.h" | 47 #include "core/rendering/RenderView.h" |
| 49 #include "core/rendering/compositing/RenderLayerCompositor.h" | 48 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 50 #include "platform/ContentType.h" | 49 #include "platform/ContentType.h" |
| 51 #include "platform/Language.h" | 50 #include "platform/Language.h" |
| 52 #include "platform/Logging.h" | 51 #include "platform/Logging.h" |
| 53 #include "platform/MIMETypeFromURL.h" | 52 #include "platform/MIMETypeFromURL.h" |
| 54 #include "platform/MIMETypeRegistry.h" | 53 #include "platform/MIMETypeRegistry.h" |
| 55 #include "platform/NotImplemented.h" | 54 #include "platform/NotImplemented.h" |
| 56 #include "platform/RuntimeEnabledFeatures.h" | 55 #include "platform/RuntimeEnabledFeatures.h" |
| 57 #include "platform/UserGestureIndicator.h" | 56 #include "platform/UserGestureIndicator.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 } | 392 } |
| 394 | 393 |
| 395 bool HTMLMediaElement::rendererIsNeeded(const RenderStyle& style) | 394 bool HTMLMediaElement::rendererIsNeeded(const RenderStyle& style) |
| 396 { | 395 { |
| 397 // FIXME(sky): Can we delete this method? | 396 // FIXME(sky): Can we delete this method? |
| 398 return false; | 397 return false; |
| 399 } | 398 } |
| 400 | 399 |
| 401 RenderObject* HTMLMediaElement::createRenderer(RenderStyle*) | 400 RenderObject* HTMLMediaElement::createRenderer(RenderStyle*) |
| 402 { | 401 { |
| 403 return new RenderMedia(this); | 402 return 0; |
| 404 } | 403 } |
| 405 | 404 |
| 406 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode*
insertionPoint) | 405 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode*
insertionPoint) |
| 407 { | 406 { |
| 408 WTF_LOG(Media, "HTMLMediaElement::insertedInto"); | 407 WTF_LOG(Media, "HTMLMediaElement::insertedInto"); |
| 409 | 408 |
| 410 HTMLElement::insertedInto(insertionPoint); | 409 HTMLElement::insertedInto(insertionPoint); |
| 411 if (insertionPoint->inDocument()) { | 410 if (insertionPoint->inDocument()) { |
| 412 m_active = true; | 411 m_active = true; |
| 413 | 412 |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 scheduleTimeupdateEvent(false); | 1154 scheduleTimeupdateEvent(false); |
| 1156 scheduleEvent(EventTypeNames::waiting); | 1155 scheduleEvent(EventTypeNames::waiting); |
| 1157 } | 1156 } |
| 1158 } | 1157 } |
| 1159 | 1158 |
| 1160 if (m_readyState >= HAVE_METADATA && oldState < HAVE_METADATA) { | 1159 if (m_readyState >= HAVE_METADATA && oldState < HAVE_METADATA) { |
| 1161 prepareMediaFragmentURI(); | 1160 prepareMediaFragmentURI(); |
| 1162 | 1161 |
| 1163 m_duration = duration(); | 1162 m_duration = duration(); |
| 1164 scheduleEvent(EventTypeNames::durationchange); | 1163 scheduleEvent(EventTypeNames::durationchange); |
| 1165 | |
| 1166 if (isHTMLVideoElement()) | |
| 1167 scheduleEvent(EventTypeNames::resize); | |
| 1168 scheduleEvent(EventTypeNames::loadedmetadata); | 1164 scheduleEvent(EventTypeNames::loadedmetadata); |
| 1169 if (renderer()) | 1165 if (renderer()) |
| 1170 renderer()->updateFromElement(); | 1166 renderer()->updateFromElement(); |
| 1171 } | 1167 } |
| 1172 | 1168 |
| 1173 bool shouldUpdateDisplayState = false; | 1169 bool shouldUpdateDisplayState = false; |
| 1174 | 1170 |
| 1175 if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA && !m_
haveFiredLoadedData) { | 1171 if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA && !m_
haveFiredLoadedData) { |
| 1176 m_haveFiredLoadedData = true; | 1172 m_haveFiredLoadedData = true; |
| 1177 shouldUpdateDisplayState = true; | 1173 shouldUpdateDisplayState = true; |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2026 | 2022 |
| 2027 updateDisplayState(); | 2023 updateDisplayState(); |
| 2028 if (renderer()) | 2024 if (renderer()) |
| 2029 renderer()->setShouldDoFullPaintInvalidation(true); | 2025 renderer()->setShouldDoFullPaintInvalidation(true); |
| 2030 } | 2026 } |
| 2031 | 2027 |
| 2032 void HTMLMediaElement::mediaPlayerSizeChanged() | 2028 void HTMLMediaElement::mediaPlayerSizeChanged() |
| 2033 { | 2029 { |
| 2034 WTF_LOG(Media, "HTMLMediaElement::mediaPlayerSizeChanged"); | 2030 WTF_LOG(Media, "HTMLMediaElement::mediaPlayerSizeChanged"); |
| 2035 | 2031 |
| 2036 ASSERT(hasVideo()); // "resize" makes no sense absent video. | |
| 2037 if (m_readyState > HAVE_NOTHING && isHTMLVideoElement()) | |
| 2038 scheduleEvent(EventTypeNames::resize); | |
| 2039 | |
| 2040 if (renderer()) | 2032 if (renderer()) |
| 2041 renderer()->updateFromElement(); | 2033 renderer()->updateFromElement(); |
| 2042 } | 2034 } |
| 2043 | 2035 |
| 2044 PassRefPtr<TimeRanges> HTMLMediaElement::buffered() const | 2036 PassRefPtr<TimeRanges> HTMLMediaElement::buffered() const |
| 2045 { | 2037 { |
| 2046 if (m_mediaSource) | 2038 if (m_mediaSource) |
| 2047 return m_mediaSource->buffered(); | 2039 return m_mediaSource->buffered(); |
| 2048 | 2040 |
| 2049 if (!webMediaPlayer()) | 2041 if (!webMediaPlayer()) |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2413 { | 2405 { |
| 2414 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 2406 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
| 2415 } | 2407 } |
| 2416 | 2408 |
| 2417 void HTMLMediaElement::defaultEventHandler(Event* event) | 2409 void HTMLMediaElement::defaultEventHandler(Event* event) |
| 2418 { | 2410 { |
| 2419 HTMLElement::defaultEventHandler(event); | 2411 HTMLElement::defaultEventHandler(event); |
| 2420 } | 2412 } |
| 2421 | 2413 |
| 2422 } | 2414 } |
| OLD | NEW |