Title: [153448] trunk/Source/WebCore
- Revision
- 153448
- Author
- [email protected]
- Date
- 2013-07-29 17:15:43 -0700 (Mon, 29 Jul 2013)
Log Message
TextTrackRepresentation captions often disappear then appear again.
https://bugs.webkit.org/show_bug.cgi?id=119228
Reviewed by Simon Fraser.
Calling updateTextTrackDisplay() will cause the entire DOM subtree containing the active cues
to be torn down and rebuilt. Only call into this method when text tracks have actually changed.
Add an enum parameter to configureTextTrackDisplay() which allows the caller to specify that
method should assume that the list of visible text tracks has changed, forcing a call to
updateTextTrackDisplay().
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Remove the unnecessary call to updateTextTrackDisplay().
(WebCore::HTMLMediaElement::textTrackModeChanged): Pass AssumeVisibleTextTracksChanged to configureTextTrackDisplay().
(WebCore::HTMLMediaElement::configureTextTrackDisplay): Check the passed flags and exit early only if
AssumeVisibleTextTracksChanged is not set.
* html/HTMLMediaElement.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (153447 => 153448)
--- trunk/Source/WebCore/ChangeLog 2013-07-30 00:12:02 UTC (rev 153447)
+++ trunk/Source/WebCore/ChangeLog 2013-07-30 00:15:43 UTC (rev 153448)
@@ -1,3 +1,24 @@
+2013-07-29 Jer Noble <[email protected]>
+
+ TextTrackRepresentation captions often disappear then appear again.
+ https://bugs.webkit.org/show_bug.cgi?id=119228
+
+ Reviewed by Simon Fraser.
+
+ Calling updateTextTrackDisplay() will cause the entire DOM subtree containing the active cues
+ to be torn down and rebuilt. Only call into this method when text tracks have actually changed.
+
+ Add an enum parameter to configureTextTrackDisplay() which allows the caller to specify that
+ method should assume that the list of visible text tracks has changed, forcing a call to
+ updateTextTrackDisplay().
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Remove the unnecessary call to updateTextTrackDisplay().
+ (WebCore::HTMLMediaElement::textTrackModeChanged): Pass AssumeVisibleTextTracksChanged to configureTextTrackDisplay().
+ (WebCore::HTMLMediaElement::configureTextTrackDisplay): Check the passed flags and exit early only if
+ AssumeVisibleTextTracksChanged is not set.
+ * html/HTMLMediaElement.h:
+
2013-07-26 Ryosuke Niwa <[email protected]>
Fix crash due to unexpected Node deletion during MutationObserver registration book-keeping
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (153447 => 153448)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2013-07-30 00:12:02 UTC (rev 153447)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2013-07-30 00:15:43 UTC (rev 153448)
@@ -1242,16 +1242,8 @@
activeSetChanged = true;
}
- if (!activeSetChanged) {
- // Even though the active set has not changed, it is possible that the
- // the mode of a track has changed from 'hidden' to 'showing' and the
- // cues have not yet been rendered.
- // Note: don't call updateTextTrackDisplay() unless we have controls because it will
- // create them.
- if (hasMediaControls())
- updateTextTrackDisplay();
+ if (!activeSetChanged)
return;
- }
// 7 - If the time was reached through the usual monotonic increase of the
// current playback position during normal playback, and there are cues in
@@ -1459,8 +1451,7 @@
platformTextTrackMenu()->trackWasSelected(track->platformTextTrack());
#endif
- configureTextTrackDisplay();
- updateActiveTextTrackCues(currentTime());
+ configureTextTrackDisplay(AssumeTextTrackVisibilityChanged);
}
void HTMLMediaElement::videoTrackSelectedChanged(VideoTrack*)
@@ -4689,7 +4680,7 @@
}
#if ENABLE(VIDEO_TRACK)
-void HTMLMediaElement::configureTextTrackDisplay()
+void HTMLMediaElement::configureTextTrackDisplay(TextTrackVisibilityCheckType checkType)
{
ASSERT(m_textTracks);
@@ -4706,7 +4697,7 @@
}
}
- if (m_haveVisibleTextTrack == haveVisibleTextTrack) {
+ if (checkType == CheckTextTrackVisibility && m_haveVisibleTextTrack == haveVisibleTextTrack) {
updateActiveTextTrackCues(currentTime());
return;
}
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (153447 => 153448)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2013-07-30 00:12:02 UTC (rev 153447)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2013-07-30 00:15:43 UTC (rev 153448)
@@ -291,7 +291,8 @@
void setSelectedTextTrack(TextTrack*);
bool textTracksAreReady() const;
- void configureTextTrackDisplay();
+ enum TextTrackVisibilityCheckType { CheckTextTrackVisibility, AssumeTextTrackVisibilityChanged };
+ void configureTextTrackDisplay(TextTrackVisibilityCheckType checkType = CheckTextTrackVisibility);
void updateTextTrackDisplay();
// AudioTrackClient
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes