Resign NowPlaying status when no media element is eligible
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 01:29:39 +0000 (01:29 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 01:29:39 +0000 (01:29 +0000)
commitfaff90bfddbfe9253b3f28345fe892f46ae34f0e
treee5e5aeb99a234ec0b310aaa5a52a96a8c2881daa
parent3cae845fece5b6df31cf97671a2935bb8ab45496
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>

Patch by Eric Carlson <eric.carlson@apple.com> on 2018-01-22
Reviewed by Jer Noble.

No new tests, these changes prevent existing tests from crashing.

* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const): Return early when the media
element has been suspended.
(WebCore::MediaElementSession::canShowControlsManager const): Return false when the
media element has been suspended.
(WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
style because HitTest can force a layout.
(WebCore::MediaElementSession::updateIsMainContent const): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/MediaElementSession.cpp