Ensure media controls host exists before using it
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Aug 2017 19:54:09 +0000 (19:54 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Aug 2017 19:54:09 +0000 (19:54 +0000)
commitec96acf935bf2d5f17578f654299f761885865e4
treef48b225622ed65073f534f9a715aee950def64fa
parent2a9b73059115b2bdf028c0719fde1f22796b288f
Ensure media controls host exists before using it
https://bugs.webkit.org/show_bug.cgi?id=175833
<rdar://problem/34001219>

Reviewed by Jer Noble.

Source/WebCore:

Although we ensure that the media controls shadow root exists before updating the text track
container, we don't check that the media controls host has been created yet. We do check
and create in other places in HTMLMediaElement.

Tests: media/track/track-display-before-controls-crash.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateTextTrackDisplay):

LayoutTests:

* media/track/track-display-before-controls-crash-expected.txt: Added.
* media/track/track-display-before-controls-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/track/track-display-before-controls-crash-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-display-before-controls-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp