-
eric.carlson@apple.com authored
https://bugs.webkit.org/show_bug.cgi?id=105371 Reviewed by Simon Fraser. Source/WebCore: Add an RAII object to manage text track update blocking, use it to always process the current cues to ensure that cues from a track that is deleted are removed from the shadow DOM before the next layout. No new tests, this fixes a crash in media/video-controls-captions-trackmenu.html. * html/HTMLMediaElement.cpp: (WebCore::TrackDisplayUpdateScope::TrackDisplayUpdateScope): New, call beginIgnoringTrackDisplayUpdateRequests. (WebCore::TrackDisplayUpdateScope::~TrackDisplayUpdateScope): New, call endIgnoringTrackDisplayUpdateRequests. (WebCore::HTMLMediaElement::beginIgnoringTrackDisplayUpdateRequests): (WebCore::HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests): Call updateActiveTextTrackCues when the ignore count reaches zero. (WebCore::HTMLMediaElement::textTrackAddCues): Use TrackDisplayUpdateScope instead of calling beginIgnoringTrackDisplayUpdateRequests and endIgnoringTrackDisplayUpdateRequests directly. (WebCore::HTMLMediaElement::textTrackRemoveCues): Ditto. (WebCore::HTMLMediaElement::removeTrack): Ditto. (WebCore::HTMLMediaElement::removeAllInbandTracks): Ditto. (WebCore::HTMLMediaElement::didRemoveTrack): Ditto. Call removeTrack. * html/HTMLMediaElement.h: Declare TrackDisplayUpdateScope as a friend of HTMLMediaElement so it can call protected methods. LayoutTests: * platform/mac/TestExpectations: Unskip video-controls-captions-trackmenu.html. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
716fecdb