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
rdar://108381732
Pull request: https://github.com/WebKit/WebKit/pull/13273
Committed 263521@main (81f8f7f4b684): <https://commits.webkit.org/263521@main> Reviewed commits have been landed. Closing PR #13273 and removing active labels.