REGRESSION: Caption Menus show language codes instead of display names.
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2015 00:27:06 +0000 (00:27 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2015 00:27:06 +0000 (00:27 +0000)
commitc7011866aa9e7b89ff2d057a15ed2d82aeae6b6b
tree5e3f751c95507aa62e80630778805fd0ab7c4ee8
parent2e1eaf8baeeb7cf45011670ad2f19f18006d9502
REGRESSION: Caption Menus show language codes instead of display names.
https://bugs.webkit.org/show_bug.cgi?id=143350
<rdar://problem/20094145>

Reviewed by Jer Noble.

The generic caption/track label handling in CaptionUserPreferences does not convert language codes
(e.g. 'fr-CA') into display names (e.g., 'French (Canada)'). Because we did not have an AudioTrack
override to process these types of menu items, they were being handled using the generic code.

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::buildStringForTrackBase): Helper function to share code with the two flavors
of 'trackDisplayName'.
(WebCore::trackDisplayName): Add a version to support AudioTracks, and modify the TextTrack
version to use the new 'buildStringForTrackBase' function.
(WebCore::CaptionUserPreferencesMediaAF::displayNameForTrack): Add an AudioTrack override so
our AVFoundation tracks are processed in our CaptionUserPreferencesMediaAF implementation, not the
generic version.
(WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Add an AudioTrack override so
that the menu items are sorted in order of display name, not language code.
* page/CaptionUserPreferencesMediaAF.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
Source/WebCore/page/CaptionUserPreferencesMediaAF.h