Media elements outside fullscreen should not be considered main content.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2018 18:00:23 +0000 (18:00 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2018 18:00:23 +0000 (18:00 +0000)
commit89588b1733eb910712f5f4176229363c727c22fc
tree7036af24b84cb1a9a641689df01aa361bee97cef
parentffc764d2e5232bbccf8842b087054c0bc01a61ff
Media elements outside fullscreen should not be considered main content.
https://bugs.webkit.org/show_bug.cgi?id=186063
<rdar://problem/40630437>

Reviewed by Eric Carlson.

Source/WebCore:

Test: platform/mac/media/video-best-element-for-playback-controls-purpose.html

Media elements outside the current fullscreen element are not visible, and thus should not be considered
main content.

Drive-by fix: set the m_hasEverNotifiedAboutPlaying before dispatching the 'playing' event, so that
tests can check bestMediaElementForShowingPlaybackControlsManager() in the 'playing' handler.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::notifyAboutPlaying):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac/media/video-best-element-for-playback-controls-purpose-expected.txt: Added.
* platform/mac/media/video-best-element-for-playback-controls-purpose.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/media/video-best-element-for-playback-controls-purpose-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/media/video-best-element-for-playback-controls-purpose.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl