Title: [280648] trunk/Source/WebCore
Revision
280648
Author
[email protected]
Date
2021-08-04 11:55:25 -0700 (Wed, 04 Aug 2021)

Log Message

REGRESSION(?): subtitle text sizing is sometimes inconsistent
https://bugs.webkit.org/show_bug.cgi?id=228786
<rdar://problem/80525509>

Reviewed by Eric Carlson.

Tested manually. I'm still not 100% sure of the root cause of this, but after talking with
some folks more familiar with WebKit's media "stack" it seems like this only happens with
in-band non-VTT subtitle tracks that have their own styling. The fix is also pretty obvious.

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::setFontSize):
We should still pass along the new font size (and `bool important`) even if we don't have a
display tree yet, as the font size (and `bool important`) are used when the display tree is
created, meaning that we shouldn't have to wait for another `setFontSize` call after the
display tree is created in order to update the font size.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (280647 => 280648)


--- trunk/Source/WebCore/ChangeLog	2021-08-04 18:44:20 UTC (rev 280647)
+++ trunk/Source/WebCore/ChangeLog	2021-08-04 18:55:25 UTC (rev 280648)
@@ -1,3 +1,22 @@
+2021-08-04  Devin Rousso  <[email protected]>
+
+        REGRESSION(?): subtitle text sizing is sometimes inconsistent
+        https://bugs.webkit.org/show_bug.cgi?id=228786
+        <rdar://problem/80525509>
+
+        Reviewed by Eric Carlson.
+
+        Tested manually. I'm still not 100% sure of the root cause of this, but after talking with
+        some folks more familiar with WebKit's media "stack" it seems like this only happens with
+        in-band non-VTT subtitle tracks that have their own styling. The fix is also pretty obvious.
+
+        * html/track/TextTrackCueGeneric.cpp:
+        (WebCore::TextTrackCueGeneric::setFontSize):
+        We should still pass along the new font size (and `bool important`) even if we don't have a
+        display tree yet, as the font size (and `bool important`) are used when the display tree is
+        created, meaning that we shouldn't have to wait for another `setFontSize` call after the
+        display tree is created in order to update the font size.
+
 2021-08-04  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r280630.

Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp (280647 => 280648)


--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp	2021-08-04 18:44:20 UTC (rev 280647)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp	2021-08-04 18:55:25 UTC (rev 280648)
@@ -194,10 +194,10 @@
 
 void TextTrackCueGeneric::setFontSize(int fontSize, const IntSize& videoSize, bool important)
 {
-    if (!hasDisplayTree() || !fontSize)
+    if (!fontSize)
         return;
     
-    if (important || !baseFontSizeRelativeToVideoHeight()) {
+    if (important || !hasDisplayTree() || !baseFontSizeRelativeToVideoHeight()) {
         VTTCue::setFontSize(fontSize, videoSize, important);
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to