| 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 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2200 | 2200 |
| 2201 bool HTMLMediaElement::togglePlayStateWillPlay() const | 2201 bool HTMLMediaElement::togglePlayStateWillPlay() const |
| 2202 { | 2202 { |
| 2203 if (m_mediaController) | 2203 if (m_mediaController) |
| 2204 return m_mediaController->paused() || m_mediaController->isRestrained(); | 2204 return m_mediaController->paused() || m_mediaController->isRestrained(); |
| 2205 return paused(); | 2205 return paused(); |
| 2206 } | 2206 } |
| 2207 | 2207 |
| 2208 void HTMLMediaElement::togglePlayState() | 2208 void HTMLMediaElement::togglePlayState() |
| 2209 { | 2209 { |
| 2210 // The activation behavior of a media element that is exposing a user interf
ace to the user | |
| 2211 if (m_mediaController) { | 2210 if (m_mediaController) { |
| 2212 if (m_mediaController->isRestrained()) | 2211 if (m_mediaController->isRestrained()) |
| 2213 m_mediaController->play(); | 2212 m_mediaController->play(); |
| 2214 else if (m_mediaController->paused()) | 2213 else if (m_mediaController->paused()) |
| 2215 m_mediaController->unpause(); | 2214 m_mediaController->unpause(); |
| 2216 else | 2215 else |
| 2217 m_mediaController->pause(); | 2216 m_mediaController->pause(); |
| 2218 } else { | 2217 } else { |
| 2219 if (paused()) | 2218 if (paused()) |
| 2220 play(); | 2219 play(); |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3396 for (unsigned i = 0; i < m_textTracks->length(); ++i) { | 3395 for (unsigned i = 0; i < m_textTracks->length(); ++i) { |
| 3397 RefPtr<TextTrack> textTrack = m_textTracks->item(i); | 3396 RefPtr<TextTrack> textTrack = m_textTracks->item(i); |
| 3398 String kind = textTrack->kind(); | 3397 String kind = textTrack->kind(); |
| 3399 | 3398 |
| 3400 if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captions
Keyword()) | 3399 if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captions
Keyword()) |
| 3401 textTrack->setHasBeenConfigured(false); | 3400 textTrack->setHasBeenConfigured(false); |
| 3402 } | 3401 } |
| 3403 configureTextTracks(); | 3402 configureTextTracks(); |
| 3404 } | 3403 } |
| 3405 | 3404 |
| 3406 bool HTMLMediaElement::willRespondToMouseClickEvents() | |
| 3407 { | |
| 3408 return controls(); | |
| 3409 } | |
| 3410 | |
| 3411 void* HTMLMediaElement::preDispatchEventHandler(Event* event) | 3405 void* HTMLMediaElement::preDispatchEventHandler(Event* event) |
| 3412 { | 3406 { |
| 3413 if (event && event->type() == EventTypeNames::webkitfullscreenchange) | 3407 if (event && event->type() == EventTypeNames::webkitfullscreenchange) |
| 3414 configureMediaControls(); | 3408 configureMediaControls(); |
| 3415 | 3409 |
| 3416 return 0; | 3410 return 0; |
| 3417 } | 3411 } |
| 3418 | 3412 |
| 3419 void HTMLMediaElement::defaultEventHandler(Event* event) | |
| 3420 { | |
| 3421 if (event->type() == EventTypeNames::click && willRespondToMouseClickEvents(
)) { | |
| 3422 togglePlayState(); | |
| 3423 event->setDefaultHandled(); | |
| 3424 return; | |
| 3425 } | |
| 3426 HTMLElement::defaultEventHandler(event); | |
| 3427 } | |
| 3428 | |
| 3429 void HTMLMediaElement::createMediaPlayer() | 3413 void HTMLMediaElement::createMediaPlayer() |
| 3430 { | 3414 { |
| 3431 #if ENABLE(WEB_AUDIO) | 3415 #if ENABLE(WEB_AUDIO) |
| 3432 if (m_audioSourceNode) | 3416 if (m_audioSourceNode) |
| 3433 m_audioSourceNode->lock(); | 3417 m_audioSourceNode->lock(); |
| 3434 #endif | 3418 #endif |
| 3435 | 3419 |
| 3436 if (m_mediaSource) | 3420 if (m_mediaSource) |
| 3437 closeMediaSource(); | 3421 closeMediaSource(); |
| 3438 | 3422 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3645 return fastHasAttribute(controlsAttr); | 3629 return fastHasAttribute(controlsAttr); |
| 3646 } | 3630 } |
| 3647 | 3631 |
| 3648 void HTMLMediaElement::trace(Visitor* visitor) | 3632 void HTMLMediaElement::trace(Visitor* visitor) |
| 3649 { | 3633 { |
| 3650 Supplementable<HTMLMediaElement>::trace(visitor); | 3634 Supplementable<HTMLMediaElement>::trace(visitor); |
| 3651 HTMLElement::trace(visitor); | 3635 HTMLElement::trace(visitor); |
| 3652 } | 3636 } |
| 3653 | 3637 |
| 3654 } | 3638 } |
| OLD | NEW |