Title: [232220] trunk/Source/WebCore
Revision
232220
Author
[email protected]
Date
2018-05-25 18:02:44 -0700 (Fri, 25 May 2018)

Log Message

Captions are sized incorrectly in PiP mode
https://bugs.webkit.org/show_bug.cgi?id=186005
<rdar://problem/39729718>

Reviewed by Dean Jackson.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateSizes): Only sync text track bounds
when the size actually changes.

* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame): Call syncTextTrackBounds.
(WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds): Set the text track layer size
to m_videoFullscreenFrame, it is always set the size of the PiP/Fullscreen layer.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232219 => 232220)


--- trunk/Source/WebCore/ChangeLog	2018-05-26 00:23:57 UTC (rev 232219)
+++ trunk/Source/WebCore/ChangeLog	2018-05-26 01:02:44 UTC (rev 232220)
@@ -1,3 +1,20 @@
+2018-05-25  Eric Carlson  <[email protected]>
+
+        Captions are sized incorrectly in PiP mode
+        https://bugs.webkit.org/show_bug.cgi?id=186005
+        <rdar://problem/39729718>
+
+        Reviewed by Dean Jackson.
+
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::updateSizes): Only sync text track bounds 
+        when the size actually changes.
+
+        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
+        (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame): Call syncTextTrackBounds.
+        (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds): Set the text track layer size
+        to m_videoFullscreenFrame, it is always set the size of the PiP/Fullscreen layer.
+
 2018-05-25  Timothy Hatcher  <[email protected]>
 
         Setting drawsBackground to YES on a WKView doesn't take effect immediately

Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (232219 => 232220)


--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2018-05-26 00:23:57 UTC (rev 232219)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2018-05-26 01:02:44 UTC (rev 232220)
@@ -1382,8 +1382,6 @@
     if (!document().page())
         return;
 
-    mediaElement->syncTextTrackBounds();
-
     IntRect videoBox;
     if (m_textTrackRepresentation) {
         videoBox = m_textTrackRepresentation->bounds();
@@ -1401,6 +1399,7 @@
 
     m_videoDisplaySize = videoBox;
     m_updateTextTrackRepresentationStyle = true;
+    mediaElement->syncTextTrackBounds();
 
     // FIXME (121170): This function is called during layout, and should lay out the text tracks immediately.
     m_updateTimer.startOneShot(0_s);

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm (232219 => 232220)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm	2018-05-26 00:23:57 UTC (rev 232219)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm	2018-05-26 01:02:44 UTC (rev 232220)
@@ -144,6 +144,7 @@
         return;
 
     [m_videoLayer setFrame:m_videoFullscreenFrame];
+    syncTextTrackBounds();
 }
 
 void VideoFullscreenLayerManagerObjC::didDestroyVideoLayer()
@@ -167,8 +168,7 @@
     [CATransaction begin];
     [CATransaction setDisableActions:YES];
 
-    CGRect textFrame = m_videoLayer ? m_videoInlineFrame : m_videoFullscreenFrame;
-    [m_textTrackRepresentationLayer setFrame:textFrame];
+    [m_textTrackRepresentationLayer setFrame:m_videoFullscreenFrame];
 
     [CATransaction commit];
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to