Bug 256090
| Summary: | Un-necessary text track reconfigurations causes full re-layout | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Media | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Jean-Yves Avenard [:jya]
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Jean-Yves Avenard [:jya]
rdar://108381732
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/13273
EWS
Committed 263521@main (81f8f7f4b684): <https://commits.webkit.org/263521@main>
Reviewed commits have been landed. Closing PR #13273 and removing active labels.