Title: [272190] trunk/Source/WebCore
- Revision
- 272190
- Author
- [email protected]
- Date
- 2021-02-01 21:18:54 -0800 (Mon, 01 Feb 2021)
Log Message
REGRESSION: Fullscreen HTML5 video subtitles/captions are shown twice
https://bugs.webkit.org/show_bug.cgi?id=214634
Reviewed by Eric Carlson.
When we need to hide a text track representation, we can hide it directly. But, when we
need to show(set "hidden" to false) a text track representation, we have to render it first.
Otherwise, the previously rendered content will flash for a short period of time.
Covered by manual test.
* html/shadow/MediaControlTextTrackContainerElement.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationImageIfNeeded):
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationIfNeeded):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (272189 => 272190)
--- trunk/Source/WebCore/ChangeLog 2021-02-02 04:47:40 UTC (rev 272189)
+++ trunk/Source/WebCore/ChangeLog 2021-02-02 05:18:54 UTC (rev 272190)
@@ -1,3 +1,21 @@
+2021-02-01 Peng Liu <[email protected]>
+
+ REGRESSION: Fullscreen HTML5 video subtitles/captions are shown twice
+ https://bugs.webkit.org/show_bug.cgi?id=214634
+
+ Reviewed by Eric Carlson.
+
+ When we need to hide a text track representation, we can hide it directly. But, when we
+ need to show(set "hidden" to false) a text track representation, we have to render it first.
+ Otherwise, the previously rendered content will flash for a short period of time.
+
+ Covered by manual test.
+
+ * html/shadow/MediaControlTextTrackContainerElement.cpp:
+ (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
+ (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationImageIfNeeded):
+ (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationIfNeeded):
+
2021-02-01 Jer Noble <[email protected]>
[Cocoa] Disable interstitial events on AVPlayerItem.
Modified: trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp (272189 => 272190)
--- trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp 2021-02-02 04:47:40 UTC (rev 272189)
+++ trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp 2021-02-02 05:18:54 UTC (rev 272190)
@@ -182,20 +182,21 @@
updateTextTrackRepresentationIfNeeded();
updateTextTrackStyle();
- m_needsGenerateTextTrackRepresentation = true;
}
void MediaControlTextTrackContainerElement::updateTextTrackRepresentationImageIfNeeded()
{
- if (!m_needsGenerateTextTrackRepresentation)
+ if (!m_needsToGenerateTextTrackRepresentation)
return;
- m_needsGenerateTextTrackRepresentation = false;
+ m_needsToGenerateTextTrackRepresentation = false;
// We should call m_textTrackRepresentation->update() to paint the subtree of
// the RenderTextTrackContainerElement after the layout is clean.
- if (m_textTrackRepresentation)
+ if (m_textTrackRepresentation) {
m_textTrackRepresentation->update();
+ m_textTrackRepresentation->setHidden(false);
+ }
}
void MediaControlTextTrackContainerElement::processActiveVTTCue(VTTCue& cue)
@@ -298,7 +299,7 @@
m_mediaElement->setTextTrackRepresentation(m_textTrackRepresentation.get());
}
- m_textTrackRepresentation->setHidden(false);
+ m_needsToGenerateTextTrackRepresentation = true;
}
void MediaControlTextTrackContainerElement::clearTextTrackRepresentation()
Modified: trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.h (272189 => 272190)
--- trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.h 2021-02-02 04:47:40 UTC (rev 272189)
+++ trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.h 2021-02-02 05:18:54 UTC (rev 272190)
@@ -102,7 +102,7 @@
IntRect m_videoDisplaySize;
int m_fontSize { 0 };
bool m_fontSizeIsImportant { false };
- bool m_needsGenerateTextTrackRepresentation { false };
+ bool m_needsToGenerateTextTrackRepresentation { false };
};
} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes