RESOLVED FIXED256090
Un-necessary text track reconfigurations causes full re-layout
https://bugs.webkit.org/show_bug.cgi?id=256090
Summary Un-necessary text track reconfigurations causes full re-layout
Jean-Yves Avenard [:jya]
Reported 2023-04-28 06:46:17 PDT
Whenever the MediaPlayer notifies that the characteristics of the player changed, the code checks if the current subtitle track language is different to the current primary audio track language. And if so we configure the text tracks, leading to the RenderVideo to call updatePlayer [1] Upon initialisation, and if no subtitle is selected/activated, m_subtitleTrackLanguage is an empty string and as such will always be different to MediaPlayer::languageOfPrimaryAudioTrack(), and so `HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured` will be called each time `HTMLMediaElement::mediaPlayerCharacteristicChanged which will call `HTMLMediaElement::configureTextTracks()` which calls `HTMLMediaElement::updateCaptionContainer();` which will update the media controls and cause re-layout of the player and the media control. We should only call `markCaptionAndSubtitleTracksAsUnconfigured` again if the MediaPlayer audio track has changed. [1] https://searchfox.org/wubkat/rev/6fa5a22eeca90d4396d6e6a14e600b672aab49a4/Source/WebCore/html/HTMLMediaElement.cpp#5718-5719
Attachments
Jean-Yves Avenard [:jya]
Comment 1 2023-04-28 06:46:30 PDT
Jean-Yves Avenard [:jya]
Comment 2 2023-04-28 06:52:08 PDT
EWS
Comment 3 2023-04-28 16:55:01 PDT
Committed 263521@main (81f8f7f4b684): <https://commits.webkit.org/263521@main> Reviewed commits have been landed. Closing PR #13273 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.