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 3277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3288 m_shouldDelayLoadEvent = shouldDelay; | 3288 m_shouldDelayLoadEvent = shouldDelay; |
3289 if (shouldDelay) | 3289 if (shouldDelay) |
3290 document().incrementLoadEventDelayCount(); | 3290 document().incrementLoadEventDelayCount(); |
3291 else | 3291 else |
3292 document().decrementLoadEventDelayCount(); | 3292 document().decrementLoadEventDelayCount(); |
3293 } | 3293 } |
3294 | 3294 |
3295 | 3295 |
3296 MediaControls* HTMLMediaElement::mediaControls() const | 3296 MediaControls* HTMLMediaElement::mediaControls() const |
3297 { | 3297 { |
3298 return toMediaControls(userAgentShadowRoot()->firstChild()); | 3298 return toMediaControls(closedShadowRoot()->firstChild()); |
3299 } | 3299 } |
3300 | 3300 |
3301 bool HTMLMediaElement::hasMediaControls() const | 3301 bool HTMLMediaElement::hasMediaControls() const |
3302 { | 3302 { |
3303 if (ShadowRoot* userAgent = userAgentShadowRoot()) { | 3303 if (ShadowRoot* userAgent = closedShadowRoot()) { |
3304 Node* node = userAgent->firstChild(); | 3304 Node* node = userAgent->firstChild(); |
3305 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isMediaControls()); | 3305 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isMediaControls()); |
3306 return node; | 3306 return node; |
3307 } | 3307 } |
3308 | 3308 |
3309 return false; | 3309 return false; |
3310 } | 3310 } |
3311 | 3311 |
3312 void HTMLMediaElement::ensureMediaControls() | 3312 void HTMLMediaElement::ensureMediaControls() |
3313 { | 3313 { |
3314 if (hasMediaControls()) | 3314 if (hasMediaControls()) |
3315 return; | 3315 return; |
3316 | 3316 |
3317 RefPtrWillBeRawPtr<MediaControls> mediaControls = MediaControls::create(*thi
s); | 3317 RefPtrWillBeRawPtr<MediaControls> mediaControls = MediaControls::create(*thi
s); |
3318 | 3318 |
3319 mediaControls->reset(); | 3319 mediaControls->reset(); |
3320 if (isFullscreen()) | 3320 if (isFullscreen()) |
3321 mediaControls->enteredFullscreen(); | 3321 mediaControls->enteredFullscreen(); |
3322 | 3322 |
3323 ensureUserAgentShadowRoot().appendChild(mediaControls); | 3323 ensureClosedShadowRoot().appendChild(mediaControls); |
3324 | 3324 |
3325 if (!shouldShowControls() || !inDocument()) | 3325 if (!shouldShowControls() || !inDocument()) |
3326 mediaControls->hide(); | 3326 mediaControls->hide(); |
3327 } | 3327 } |
3328 | 3328 |
3329 void HTMLMediaElement::configureMediaControls() | 3329 void HTMLMediaElement::configureMediaControls() |
3330 { | 3330 { |
3331 if (!inDocument()) { | 3331 if (!inDocument()) { |
3332 if (hasMediaControls()) | 3332 if (hasMediaControls()) |
3333 mediaControls()->hide(); | 3333 mediaControls()->hide(); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3632 | 3632 |
3633 #if ENABLE(WEB_AUDIO) | 3633 #if ENABLE(WEB_AUDIO) |
3634 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 3634 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
3635 { | 3635 { |
3636 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) | 3636 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) |
3637 audioSourceProvider()->setClient(nullptr); | 3637 audioSourceProvider()->setClient(nullptr); |
3638 } | 3638 } |
3639 #endif | 3639 #endif |
3640 | 3640 |
3641 } | 3641 } |
OLD | NEW |