Title: [141817] trunk
Revision
141817
Author
[email protected]
Date
2013-02-04 14:39:16 -0800 (Mon, 04 Feb 2013)

Log Message

WebVTT <i>, <b> and <u> elements should have default styles
https://bugs.webkit.org/show_bug.cgi?id=107214

Patch by Dima Gorbik <[email protected]> on 2013-02-04
Reviewed by Darin Adler.

Source/WebCore:

Added default styles for basic webvtt object types.

Test: media/track/track-css-matching-default.html

* css/mediaControls.css:
(video::-webkit-media-text-track-container b):
(video::-webkit-media-text-track-container u):
(video::-webkit-media-text-track-container i):

LayoutTests:

* media/track/captions-webvtt/styling-default.vtt: Added.
* media/track/track-css-matching-default-expected.txt: Added.
* media/track/track-css-matching-default.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (141816 => 141817)


--- trunk/LayoutTests/ChangeLog	2013-02-04 22:36:56 UTC (rev 141816)
+++ trunk/LayoutTests/ChangeLog	2013-02-04 22:39:16 UTC (rev 141817)
@@ -1,3 +1,14 @@
+2013-02-04  Dima Gorbik  <[email protected]>
+
+        WebVTT <i>, <b> and <u> elements should have default styles
+        https://bugs.webkit.org/show_bug.cgi?id=107214
+
+        Reviewed by Darin Adler.
+
+        * media/track/captions-webvtt/styling-default.vtt: Added.
+        * media/track/track-css-matching-default-expected.txt: Added.
+        * media/track/track-css-matching-default.html: Added.
+
 2013-02-04  Julien Chaffraix  <[email protected]>
 
         [CSS Grid Layout] Heap-buffer-overflow in std::sort

Added: trunk/LayoutTests/media/track/captions-webvtt/styling-default.vtt (0 => 141817)


--- trunk/LayoutTests/media/track/captions-webvtt/styling-default.vtt	                        (rev 0)
+++ trunk/LayoutTests/media/track/captions-webvtt/styling-default.vtt	2013-02-04 22:39:16 UTC (rev 141817)
@@ -0,0 +1,5 @@
+WEBVTT
+
+1
+00:00.000 --> 00:01.000
+<b>bold</b> <i>italic</i> <u>underline</u>

Added: trunk/LayoutTests/media/track/track-css-matching-default-expected.txt (0 => 141817)


--- trunk/LayoutTests/media/track/track-css-matching-default-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/track/track-css-matching-default-expected.txt	2013-02-04 22:39:16 UTC (rev 141817)
@@ -0,0 +1,8 @@
+Test that u, b, i WebVTT objects are being styled correctly.
+EVENT(canplaythrough)
+EVENT(seeked)
+EXPECTED (getComputedStyle(cueNode).fontWeight == 'bold') OK
+EXPECTED (getComputedStyle(cueNode).fontStyle == 'italic') OK
+EXPECTED (getComputedStyle(cueNode).textDecoration == 'underline') OK
+END OF TEST
+

Added: trunk/LayoutTests/media/track/track-css-matching-default.html (0 => 141817)


--- trunk/LayoutTests/media/track/track-css-matching-default.html	                        (rev 0)
+++ trunk/LayoutTests/media/track/track-css-matching-default.html	2013-02-04 22:39:16 UTC (rev 141817)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+        <script src=""
+        <script src=""
+        <script src=""
+
+        <script>
+
+        var cueNode;
+
+        function seeked()
+        {
+            if (testEnded)
+                return;
+
+            cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild;
+            testExpected("getComputedStyle(cueNode).fontWeight", "bold");
+            cueNode = cueNode.nextElementSibling;
+            testExpected("getComputedStyle(cueNode).fontStyle", "italic");
+            cueNode = cueNode.nextElementSibling;
+            testExpected("getComputedStyle(cueNode).textDecoration", "underline");
+
+            endTest();
+        }
+
+        function loaded()
+        {
+            consoleWrite("Test that u, b, i WebVTT objects are being styled correctly.");
+            findMediaElement();
+            video.src = "" '../content/test');
+            video.id = "testvideo";
+            waitForEvent('seeked', seeked);
+            waitForEvent('canplaythrough', function() { video.currentTime = 0.1; });
+        }
+
+        </script>
+    </head>
+    <body _onload_="loaded()">
+        <video controls >
+            <track src="" kind="captions" default>
+        </video>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (141816 => 141817)


--- trunk/Source/WebCore/ChangeLog	2013-02-04 22:36:56 UTC (rev 141816)
+++ trunk/Source/WebCore/ChangeLog	2013-02-04 22:39:16 UTC (rev 141817)
@@ -1,3 +1,19 @@
+2013-02-04  Dima Gorbik  <[email protected]>
+
+        WebVTT <i>, <b> and <u> elements should have default styles
+        https://bugs.webkit.org/show_bug.cgi?id=107214
+
+        Reviewed by Darin Adler.
+
+        Added default styles for basic webvtt object types.
+
+        Test: media/track/track-css-matching-default.html
+
+        * css/mediaControls.css:
+        (video::-webkit-media-text-track-container b):
+        (video::-webkit-media-text-track-container u):
+        (video::-webkit-media-text-track-container i):
+
 2013-02-04  Abhishek Arya  <[email protected]>
 
         Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access

Modified: trunk/Source/WebCore/css/mediaControls.css (141816 => 141817)


--- trunk/Source/WebCore/css/mediaControls.css	2013-02-04 22:36:56 UTC (rev 141816)
+++ trunk/Source/WebCore/css/mediaControls.css	2013-02-04 22:39:16 UTC (rev 141817)
@@ -254,3 +254,15 @@
 video::cue(:future) {
     color: gray;
 }
+
+video::-webkit-media-text-track-container b {
+    font-weight: bold;
+}
+
+video::-webkit-media-text-track-container u {
+    text-decoration: underline;
+}
+
+video::-webkit-media-text-track-container i {
+    font-style: italic;
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to