Hide inline captions in fullscreen. Remove fullscreen captions when no longer needed.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 19:48:32 +0000 (19:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 19:48:32 +0000 (19:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173482

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-06-16
Reviewed by Eric Carlson.

Hide the inline captions while they are presenting to fullscreen.
Remove the text track representation as soon as it is no longer needed.
This allows the text track to render properly when returning to inline.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/shadow/MediaControlElements.cpp

index c10e31a..6b1ca29 100644 (file)
@@ -1,3 +1,17 @@
+2017-06-16  Jeremy Jones  <jeremyj@apple.com>
+
+        Hide inline captions in fullscreen. Remove fullscreen captions when no longer needed.
+        https://bugs.webkit.org/show_bug.cgi?id=173482
+
+        Reviewed by Eric Carlson.
+
+        Hide the inline captions while they are presenting to fullscreen.
+        Remove the text track representation as soon as it is no longer needed.
+        This allows the text track to render properly when returning to inline.
+
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
+
 2017-06-16  Tim Horton  <timothy_horton@apple.com>
 
         Include a few widespread WTF headers in WebCorePrefix.h
index 7d85bd3..162da4b 100644 (file)
@@ -1280,8 +1280,13 @@ void MediaControlTextTrackContainerElement::updateTextTrackRepresentation()
     if (!mediaElement)
         return;
 
-    if (!mediaElement->requiresTextTrackRepresentation())
+    if (!mediaElement->requiresTextTrackRepresentation()) {
+        if (m_textTrackRepresentation) {
+            clearTextTrackRepresentation();
+            updateSizes(true);
+        }
         return;
+    }
 
     if (!m_textTrackRepresentation) {
         m_textTrackRepresentation = TextTrackRepresentation::create(*this);
@@ -1289,6 +1294,7 @@ void MediaControlTextTrackContainerElement::updateTextTrackRepresentation()
         mediaElement->setTextTrackRepresentation(m_textTrackRepresentation.get());
     }
 
+    hide();
     m_textTrackRepresentation->update();
     updateStyleForTextTrackRepresentation();
 }