WebVTT <i>, <b> and <u> elements should have default styles
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 22:39:16 +0000 (22:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 22:39:16 +0000 (22:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107214

Patch by Dima Gorbik <dgorbik@apple.com> 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141817 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/track/captions-webvtt/styling-default.vtt [new file with mode: 0644]
LayoutTests/media/track/track-css-matching-default-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-css-matching-default.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/mediaControls.css

index f11cc5b2aaf4e9d54f74c7ad7144aaed50ad8f13..945059e8bd7626022a081d98acd903483e158ef0 100644 (file)
@@ -1,3 +1,14 @@
+2013-02-04  Dima Gorbik  <dgorbik@apple.com>
+
+        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  <jchaffraix@webkit.org>
 
         [CSS Grid Layout] Heap-buffer-overflow in std::sort
diff --git a/LayoutTests/media/track/captions-webvtt/styling-default.vtt b/LayoutTests/media/track/captions-webvtt/styling-default.vtt
new file mode 100644 (file)
index 0000000..10de52e
--- /dev/null
@@ -0,0 +1,5 @@
+WEBVTT
+
+1
+00:00.000 --> 00:01.000
+<b>bold</b> <i>italic</i> <u>underline</u>
diff --git a/LayoutTests/media/track/track-css-matching-default-expected.txt b/LayoutTests/media/track/track-css-matching-default-expected.txt
new file mode 100644 (file)
index 0000000..497503b
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/media/track/track-css-matching-default.html b/LayoutTests/media/track/track-css-matching-default.html
new file mode 100644 (file)
index 0000000..7b57143
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+        <script src=../media-file.js></script>
+        <script src=../video-test.js></script>
+        <script src=../media-controls.js></script>
+
+        <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 = findMediaFile('video', '../content/test');
+            video.id = "testvideo";
+            waitForEvent('seeked', seeked);
+            waitForEvent('canplaythrough', function() { video.currentTime = 0.1; });
+        }
+
+        </script>
+    </head>
+    <body onload="loaded()">
+        <video controls >
+            <track src="captions-webvtt/styling-default.vtt" kind="captions" default>
+        </video>
+    </body>
+</html>
index 4d354e966a8e8927ac484a0f9b1f9f2239fe6be2..0c102db7fb136f32ce186929e8a86e48e4791495 100644 (file)
@@ -1,3 +1,19 @@
+2013-02-04  Dima Gorbik  <dgorbik@apple.com>
+
+        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  <inferno@chromium.org>
 
         Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access
index d8faf64aeb5f206a887517af2eafbe25684bab18..5c5eded9c4019064fc9195a4dc50257bf2b10cd0 100644 (file)
@@ -254,3 +254,15 @@ video::-webkit-media-text-track-display {
 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;
+}