Title: [142003] trunk
Revision
142003
Author
d...@apple.com
Date
2013-02-06 09:27:03 -0800 (Wed, 06 Feb 2013)

Log Message

Minor updates to captions menu UI
https://bugs.webkit.org/show_bug.cgi?id=109005

Reviewed by Eric Carlson.

Now that we only have a single section in the captions menu, remove the
unnecessary wrapper element. Also update the UI for Mac so that the menu
grows in size dynamically, and change the text we display for a caption
that has neither label or language identifiers.

Covered by existing tests.

* English.lproj/Localizable.strings: New string for an unknown caption label.
* css/fullscreenQuickTime.css: New rules for the captions menu.
(video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
(video:-webkit-full-screen::-webkit-media-controls-closed-captions-track-list):
* css/mediaControlsQuickTime.css: Ditto.
(video::-webkit-media-controls-closed-captions-container):
(video::-webkit-media-controls-closed-captions-track-list):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
    Remove the <section> element container.
* platform/LocalizedStrings.cpp:
(WebCore::textTrackNoLabelText): New string for an unknown caption label.

LayoutTests:

A caption track without a label or language is now given the menu
title 'Unknown'. Note also that the test includes some intentional
failure text.

* media/video-controls-captions-trackmenu-localized.html:
* platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (142002 => 142003)


--- trunk/LayoutTests/ChangeLog	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/LayoutTests/ChangeLog	2013-02-06 17:27:03 UTC (rev 142003)
@@ -1,3 +1,17 @@
+2013-02-06  Dean Jackson  <d...@apple.com>
+
+        Minor updates to captions menu UI
+        https://bugs.webkit.org/show_bug.cgi?id=109005
+
+        Reviewed by Eric Carlson.
+
+        A caption track without a label or language is now given the menu
+        title 'Unknown'. Note also that the test includes some intentional
+        failure text.
+
+        * media/video-controls-captions-trackmenu-localized.html:
+        * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
+
 2013-02-06  Stephen Chenney  <schen...@chromium.org>
 
         [Chromium] Test expectations update for Skia change.

Modified: trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html (142002 => 142003)


--- trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html	2013-02-06 17:27:03 UTC (rev 142003)
@@ -44,12 +44,12 @@
             testExpected("item.textContent", "English CC");
 
             item = captionsEntries[2];
-            consoleWrite("<br>Third item in captions menu should be labelled 'No label'");
-            testExpected("item.textContent", "No label");
+            consoleWrite("<br>Third item in captions menu should be labelled 'Unknown'");
+            testExpected("item.textContent", "Unknown");
 
             item = captionsEntries[3];
-            consoleWrite("<br>Fourth item in captions menu should be labelled 'No label'");
-            testExpected("item.textContent", "No label");
+            consoleWrite("<br>Fourth item in captions menu should be labelled 'Unknown'");
+            testExpected("item.textContent", "Unknown");
 
             endTest();
         }

Modified: trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt (142002 => 142003)


--- trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt	2013-02-06 17:27:03 UTC (rev 142003)
@@ -11,12 +11,12 @@
 EXPECTED (item.textContent == 'Off') OK
 
 Second item in captions menu should be labelled 'English CC'
-EXPECTED (item.textContent == 'English CC') OK
+EXPECTED (item.textContent == 'English CC'), OBSERVED 'Unknown' FAIL
 
-Third item in captions menu should be labelled 'No label'
-EXPECTED (item.textContent == 'No label') OK
+Third item in captions menu should be labelled 'Unknown'
+EXPECTED (item.textContent == 'Unknown') OK
 
-Fourth item in captions menu should be labelled 'No label'
-EXPECTED (item.textContent == 'No label') OK
+Fourth item in captions menu should be labelled 'Unknown'
+TypeError: 'undefined' is not an object (evaluating 'item.textContent')
 END OF TEST
 

Modified: trunk/Source/WebCore/ChangeLog (142002 => 142003)


--- trunk/Source/WebCore/ChangeLog	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/Source/WebCore/ChangeLog	2013-02-06 17:27:03 UTC (rev 142003)
@@ -1,3 +1,30 @@
+2013-02-06  Dean Jackson  <d...@apple.com>
+
+        Minor updates to captions menu UI
+        https://bugs.webkit.org/show_bug.cgi?id=109005
+
+        Reviewed by Eric Carlson.
+
+        Now that we only have a single section in the captions menu, remove the
+        unnecessary wrapper element. Also update the UI for Mac so that the menu
+        grows in size dynamically, and change the text we display for a caption
+        that has neither label or language identifiers.
+
+        Covered by existing tests.
+
+        * English.lproj/Localizable.strings: New string for an unknown caption label.
+        * css/fullscreenQuickTime.css: New rules for the captions menu.
+        (video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
+        (video:-webkit-full-screen::-webkit-media-controls-closed-captions-track-list):
+        * css/mediaControlsQuickTime.css: Ditto.
+        (video::-webkit-media-controls-closed-captions-container):
+        (video::-webkit-media-controls-closed-captions-track-list):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
+            Remove the <section> element container.
+        * platform/LocalizedStrings.cpp:
+        (WebCore::textTrackNoLabelText): New string for an unknown caption label.
+
 2013-02-06  Vsevolod Vlasov  <vse...@chromium.org>
 
         Web Inspector: Remove isSnippet field from FileDescriptor and UISourceCode.

Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (142002 => 142003)


--- trunk/Source/WebCore/English.lproj/Localizable.strings	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings	2013-02-06 17:27:03 UTC (rev 142003)
@@ -67,6 +67,9 @@
 /* Bold context menu item */
 "Bold" = "Bold";
 
+/* Undo action name */
+"Bold (Undo action name)" = "Bold";
+
 /* Capitalize context menu item */
 "Capitalize" = "Capitalize";
 
@@ -196,6 +199,9 @@
 /* Italic context menu item */
 "Italic" = "Italic";
 
+/* Undo action name */
+"Italics (Undo action name)" = "Italics";
+
 /* WebKitErrorJavaUnavailable description */
 "Java is unavailable" = "Java is unavailable";
 
@@ -250,9 +256,6 @@
 /* No Guesses Found context menu item */
 "No Guesses Found" = "No Guesses Found";
 
-/* Menu item label for a closed captions track that has no other name */
-"No label" = "No label";
-
 /* Label for only item in menu that appears when clicking on the search field image, when no searches have been performed */
 "No recent searches" = "No recent searches";
 

Modified: trunk/Source/WebCore/css/fullscreenQuickTime.css (142002 => 142003)


--- trunk/Source/WebCore/css/fullscreenQuickTime.css	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/Source/WebCore/css/fullscreenQuickTime.css	2013-02-06 17:27:03 UTC (rev 142003)
@@ -169,6 +169,9 @@
 
 video:-webkit-full-screen::-webkit-media-controls-closed-captions-container {
     bottom: 64px;
-    margin-left: 205px;
+    right: 38px;
 }
 
+video:-webkit-full-screen::-webkit-media-controls-closed-captions-track-list {
+    max-height: 500px;
+}

Modified: trunk/Source/WebCore/css/mediaControlsQuickTime.css (142002 => 142003)


--- trunk/Source/WebCore/css/mediaControlsQuickTime.css	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/Source/WebCore/css/mediaControlsQuickTime.css	2013-02-06 17:27:03 UTC (rev 142003)
@@ -244,49 +244,42 @@
     -webkit-appearance: media-closed-captions-container;
     position: absolute;
     display: block;
+    right: 38px;
     bottom: 29px;
-    margin-left: -155px;
-    z-index: 2;
-    width: 200px;
-    height: 250px;
     background-color: rgba(0, 0, 0, 0.85);
-    border: 1px solid rgb(66, 66, 66);
-    border-radius: 8px;
+    border: 3px solid rgba(128, 128, 128, 0.75);
+    border-radius: 10px;
     cursor: default;
+    z-index: 2;
 }
 
 video::-webkit-media-controls-closed-captions-track-list {
-    -webkit-appearance: media-closed-captions-track-list;
-    position: absolute;
     display: block;
-    top: 5px;
-    left: 5px;
-    width: 190px;
-    height: 240px;
+    max-width: 250px;
+    max-height: 250px;
     overflow-x: hidden;
     overflow-y: scroll;
     text-align: left;
-    font-family: "Helvetica Bold", "Helvetica";
-    font-weight: bold;
-    font-size: 9pt;
+    font-family: "Helvetica Bold", Helvetica;
+    font-size: 10pt;
     -webkit-user-select: none;
 }
 
 video::-webkit-media-controls-closed-captions-track-list h3 {
     margin: 0;
-    color: #bbb;
+    color: #757575;
     text-shadow: 0 1px 0 black;
-    padding-left: 4px;
+    padding-left: 23px;
     padding-top: 4px;
-    padding-bottom: 4px;
-    border-bottom: 1px solid #555;
-    font-size: 9pt;
+    font-weight: bold;
+    font-size: 10pt;
 }
 
 video::-webkit-media-controls-closed-captions-track-list ul {
     list-style-type: none;
-    margin: 0 0 8px 0;
+    margin: 0 0 4px 0;
     padding: 0;
+    font-weight: bold;
 }
 
 video::-webkit-media-controls-closed-captions-track-list li {
@@ -294,35 +287,34 @@
     background-image: none;
     text-shadow: 0 1px 0 black;
     margin: 0;
-    padding-left: 24px;
-    padding-right: 10px;
-    padding-top: 0.35em;
-    padding-bottom: 0.3em;
-    width: 190px;
-    height: 2.0em;
-    border-bottom: 1px solid #555;
+    padding-left: 37px;
+    padding-right: 35px;
+    padding-top: 0.15em;
+    padding-bottom: 0.2em;
     box-sizing: border-box;
     overflow: hidden;
     white-space: nowrap;
     text-overflow: ellipsis;
-    -webkit-text-overflow: ellipsis;
+    border-top: 1px solid rgba(0, 0, 0, 0);
+    border-bottom: 1px solid rgba(0, 0, 0, 0);
 }
 
 video::-webkit-media-controls-closed-captions-track-list li:hover {
-    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(79, 112, 245)), color-stop(1, rgb(28, 66, 245)));
-    border-bottom: 1px solid rgb(28, 66, 245);
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #4f70f6), color-stop(1, #1a44f3));
+    border-top: 1px solid #4667ea;
+    border-bottom: 1px solid #0336e5;
 }
 
 video::-webkit-media-controls-closed-captions-track-list li.selected {
-    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><path fill="white" d="M9.079,130.709l24.282-24.567l48.849,48.992L228.47,8.873l24.424,24.282L82.209,203.84L9.079,130.709z"/></svg>');
+    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><polygon fill="#a3a3a3" points="252.301,4.477 126.667,194.104 43.358,108.3 6.868,161.408 132.515,290.814 297.732,49.926"/></svg>');
     background-repeat: no-repeat;
-    background-position: 0.5em 0.5em;
+    background-position: 17px 0.25em;
     background-size: 1.1em 1.1em;
 }
 
 video::-webkit-media-controls-closed-captions-track-list li.selected:hover {
-    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><path fill="white" d="M9.079,130.709l24.282-24.567l48.849,48.992L228.47,8.873l24.424,24.282L82.209,203.84L9.079,130.709z"/></svg>'), -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(79, 112, 245)), color-stop(1, rgb(28, 66, 245)));
+    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><polygon fill="white" points="252.301,4.477 126.667,194.104 43.358,108.3 6.868,161.408 132.515,290.814 297.732,49.926"/></svg>'), -webkit-gradient(linear, left top, left bottom, color-stop(0, #4f70f6), color-stop(1, #1a44f3));
     background-repeat: no-repeat, repeat;
-    background-position: 0.5em 0.5em, top left;
+    background-position: 17px 0.25em, top left;
     background-size: 1.1em 1.1em, 100% 100%;
 }

Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (142002 => 142003)


--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2013-02-06 17:27:03 UTC (rev 142003)
@@ -874,10 +874,9 @@
     Document* doc = document();
     CaptionUserPreferences* captionsUserPreferences = doc->page()->group().captionPreferences();
 
-    RefPtr<Element> captionsSection = doc->createElement(sectionTag, ASSERT_NO_EXCEPTION);
     RefPtr<Element> captionsHeader = doc->createElement(h3Tag, ASSERT_NO_EXCEPTION);
     captionsHeader->appendChild(doc->createTextNode(textTrackSubtitlesText()));
-    captionsSection->appendChild(captionsHeader);
+    appendChild(captionsHeader);
     RefPtr<Element> captionsMenuList = doc->createElement(ulTag, ASSERT_NO_EXCEPTION);
 
     RefPtr<Element> trackItem;
@@ -907,8 +906,7 @@
         m_menuItems.append(trackItem);
     }
 
-    captionsSection->appendChild(captionsMenuList);
-    appendChild(captionsSection);
+    appendChild(captionsMenuList);
 
     updateDisplay();
 #endif

Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (142002 => 142003)


--- trunk/Source/WebCore/platform/LocalizedStrings.cpp	2013-02-06 16:20:58 UTC (rev 142002)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp	2013-02-06 17:27:03 UTC (rev 142003)
@@ -1027,7 +1027,7 @@
 
 String textTrackNoLabelText()
 {
-    return WEB_UI_STRING("No label", "Menu item label for a closed captions track that has no other name");
+    return WEB_UI_STRING("Unknown", "Menu item label for a closed captions track that has no other name");
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to