Title: [147000] trunk
- Revision
- 147000
- Author
- eric.carl...@apple.com
- Date
- 2013-03-27 11:33:16 -0700 (Wed, 27 Mar 2013)
Log Message
[Mac] Text track menu items sometimes labeled incorrectly
https://bugs.webkit.org/show_bug.cgi?id=113406
Reviewed by Jer Noble.
Source/WebCore:
media/video-controls-captions-trackmenu-localized.html was updated to test this.
* page/CaptionUserPreferencesMac.mm:
(WebCore::trackDisplayName): Use the 'label' attribute for the menu text when necessary.
LayoutTests:
* media/video-controls-captions-trackmenu-localized.html:
* platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (146999 => 147000)
--- trunk/LayoutTests/ChangeLog 2013-03-27 18:26:15 UTC (rev 146999)
+++ trunk/LayoutTests/ChangeLog 2013-03-27 18:33:16 UTC (rev 147000)
@@ -1,16 +1,13 @@
-2013-03-27 Sergio Villar Senin <svil...@igalia.com>
+2013-03-27 Eric Carlson <eric.carl...@apple.com>
- Inserting a blank (" ") at the end of a line does not insert anything in Overtype mode
- https://bugs.webkit.org/show_bug.cgi?id=113413
+ [Mac] Text track menu items sometimes labeled incorrectly
+ https://bugs.webkit.org/show_bug.cgi?id=113406
- Reviewed by Ryosuke Niwa.
+ Reviewed by Jer Noble.
- Updated the test to include the case of inserting a whitespace
- both in the middle or at the end of a line.
+ * media/video-controls-captions-trackmenu-localized.html:
+ * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
- * editing/execCommand/overtype-expected.txt:
- * editing/execCommand/overtype.html:
-
2013-03-27 Zan Dobersek <zdober...@igalia.com>
Unreviewed GTK gardening.
Modified: trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html (146999 => 147000)
--- trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html 2013-03-27 18:26:15 UTC (rev 146999)
+++ trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html 2013-03-27 18:33:16 UTC (rev 147000)
@@ -44,12 +44,12 @@
testExpected("item.textContent", "English CC");
item = captionsEntries[2];
- consoleWrite("<br>Third item in captions menu should be labelled 'Unknown SDH'");
- testExpected("item.textContent", "Unknown SDH");
+ consoleWrite("<br>Third item in captions menu should be labelled 'Laugh Track (English-United States)'");
+ testExpected("item.textContent", "Laugh Track (English-United States)");
item = captionsEntries[3];
- consoleWrite("<br>Fourth item in captions menu should be labelled 'Unknown'");
- testExpected("item.textContent", "Unknown");
+ consoleWrite("<br>Fourth item in captions menu should be labelled 'Unknown SDH'");
+ testExpected("item.textContent", "Unknown SDH");
endTest();
}
@@ -67,7 +67,7 @@
<p>Test that captions and subtitles menu items are localized.</p>
<video width="500" height="300" controls>
<track kind="captions" src=""
- <track kind="subtitles" src=""
+ <track kind="subtitles" src="" label="Laugh Track" srclang="en-US">
</video>
</body>
</html>
Modified: trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt (146999 => 147000)
--- trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt 2013-03-27 18:26:15 UTC (rev 146999)
+++ trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt 2013-03-27 18:33:16 UTC (rev 147000)
@@ -11,12 +11,12 @@
EXPECTED (item.textContent == 'Off') OK
Second item in captions menu should be labelled 'English CC'
-EXPECTED (item.textContent == 'English CC'), OBSERVED 'Unknown SDH' FAIL
+EXPECTED (item.textContent == 'English CC'), OBSERVED 'Laugh Track (English-United States)' FAIL
-Third item in captions menu should be labelled 'Unknown SDH'
-EXPECTED (item.textContent == 'Unknown SDH'), OBSERVED 'Unknown' FAIL
+Third item in captions menu should be labelled 'Laugh Track (English-United States)'
+EXPECTED (item.textContent == 'Laugh Track (English-United States)'), OBSERVED 'Unknown SDH' FAIL
-Fourth item in captions menu should be labelled 'Unknown'
+Fourth item in captions menu should be labelled 'Unknown SDH'
TypeError: 'undefined' is not an object (evaluating 'item.textContent')
END OF TEST
Modified: trunk/Source/WebCore/ChangeLog (146999 => 147000)
--- trunk/Source/WebCore/ChangeLog 2013-03-27 18:26:15 UTC (rev 146999)
+++ trunk/Source/WebCore/ChangeLog 2013-03-27 18:33:16 UTC (rev 147000)
@@ -1,3 +1,15 @@
+2013-03-27 Eric Carlson <eric.carl...@apple.com>
+
+ [Mac] Text track menu items sometimes labeled incorrectly
+ https://bugs.webkit.org/show_bug.cgi?id=113406
+
+ Reviewed by Jer Noble.
+
+ media/video-controls-captions-trackmenu-localized.html was updated to test this.
+
+ * page/CaptionUserPreferencesMac.mm:
+ (WebCore::trackDisplayName): Use the 'label' attribute for the menu text when necessary.
+
2013-03-27 Sergio Villar Senin <svil...@igalia.com>
Inserting a blank (" ") at the end of a line does not insert anything in Overtype mode
Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm (146999 => 147000)
--- trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm 2013-03-27 18:26:15 UTC (rev 146999)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm 2013-03-27 18:33:16 UTC (rev 147000)
@@ -536,7 +536,9 @@
RetainPtr<CFStringRef> languageCF(AdoptCF, CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleLanguageCode, localeIdentifier.get()));
String language = languageCF.get();
if (!label.isEmpty()) {
- if (!language.isEmpty() && !label.contains(language)) {
+ if (language.isEmpty() || label.contains(language)) {
+ displayName.append(label);
+ } else {
RetainPtr<CFDictionaryRef> localeDict(AdoptCF, CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorDefault, localeIdentifier.get()));
if (localeDict) {
CFStringRef countryCode = 0;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes