[Mac] Safari fails to fire page "load" event with video[preload=none]
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2015 21:32:38 +0000 (21:32 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2015 21:32:38 +0000 (21:32 +0000)
commit90d092bcc8db5b24b91d0f6a8d28c06c34979070
tree3bc911f189c155f15a5f78adc904719cf44c7266
parentcbcca1f0dc8c5ccd64b249d24c8c0f8c1d428f85
[Mac] Safari fails to fire page "load" event with video[preload=none]
https://bugs.webkit.org/show_bug.cgi?id=143147

Reviewed by Simon Fraser.

Source/WebCore:

Test: media/video-page-load-preload-none.html

When told to load() when preload == None, set the networkState to Idle.
This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
false, and allows the page's 'load' event to fire.

Drive-by fix: add setNetworkState() and setReadyState() methods to
MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::load):
(WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
(WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:

LayoutTests:

* media/video-page-load-preload-none-expected.txt: Added.
* media/video-page-load-preload-none.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/video-page-load-preload-none-expected.txt [new file with mode: 0644]
LayoutTests/media/video-page-load-preload-none.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h