The CSS property -webkit-text-stroke is not applied on captions.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Feb 2017 17:39:34 +0000 (17:39 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Feb 2017 17:39:34 +0000 (17:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167687

Reviewed by Brent Fulgham.

Source/WebCore:

Add style to list of valid properties for cue.

Test: media/track/track-css-stroke-cues.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::isValidCueStyleProperty):

LayoutTests:

* media/track/track-css-stroke-cues-expected.txt: Added.
* media/track/track-css-stroke-cues.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/media/track/track-css-stroke-cues-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-css-stroke-cues.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp

index 653b63f..167e0c9 100644 (file)
@@ -1,3 +1,13 @@
+2017-02-03  Per Arne Vollan  <pvollan@apple.com>
+
+        The CSS property -webkit-text-stroke is not applied on captions.
+        https://bugs.webkit.org/show_bug.cgi?id=167687
+
+        Reviewed by Brent Fulgham.
+
+        * media/track/track-css-stroke-cues-expected.txt: Added.
+        * media/track/track-css-stroke-cues.html: Added.
+
 2017-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Add initial implementation of resource usage overlay
diff --git a/LayoutTests/media/track/track-css-stroke-cues-expected.txt b/LayoutTests/media/track/track-css-stroke-cues-expected.txt
new file mode 100644 (file)
index 0000000..c91bf06
--- /dev/null
@@ -0,0 +1,8 @@
+
+Test that style to all cues is applied correctly.
+EVENT(canplaythrough)
+EVENT(seeked)
+EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).webkitTextStrokeWidth == '4px') OK
+EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).webkitTextStrokeColor == 'rgb(0, 0, 0)') OK
+END OF TEST
+
diff --git a/LayoutTests/media/track/track-css-stroke-cues.html b/LayoutTests/media/track/track-css-stroke-cues.html
new file mode 100644 (file)
index 0000000..ee37bd8
--- /dev/null
@@ -0,0 +1,42 @@
+<!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>
+
+        <style>
+
+        video::cue { -webkit-text-stroke: 4px black; }
+
+        </style>
+
+        <script>
+
+        function seeked()
+        {
+            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).webkitTextStrokeWidth", "4px");
+            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).webkitTextStrokeColor", "rgb(0, 0, 0)");
+            endTest();
+        }
+
+        function loaded()
+        {
+            consoleWrite("Test that style to all cues is applied correctly.");
+            findMediaElement();
+            video.src = findMediaFile('video', '../content/test');
+            waitForEvent('seeked', seeked);
+            waitForEvent('canplaythrough', function() { video.currentTime = .5; });
+        }
+
+        setCaptionDisplayMode('Automatic');
+        </script>
+    </head>
+    <body onload="loaded()">
+        <video controls >
+            <track src="captions-webvtt/styling.vtt" kind="captions" default>
+        </video>
+    </body>
+</html>
index 4ac8873..3e1fa18 100644 (file)
@@ -1,3 +1,17 @@
+2017-02-03  Per Arne Vollan  <pvollan@apple.com>
+
+        The CSS property -webkit-text-stroke is not applied on captions.
+        https://bugs.webkit.org/show_bug.cgi?id=167687
+
+        Reviewed by Brent Fulgham.
+
+        Add style to list of valid properties for cue.
+
+        Test: media/track/track-css-stroke-cues.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::isValidCueStyleProperty):
+
 2017-02-03  Alex Christensen  <achristensen@webkit.org>
 
         Align URL setters with spec for URLs that cannot be a base URL
index c380fb1..4a1efe2 100644 (file)
@@ -1503,6 +1503,8 @@ inline bool StyleResolver::isValidCueStyleProperty(CSSPropertyID id)
     case CSSPropertyTextDecoration:
     case CSSPropertyTextShadow:
     case CSSPropertyBorderStyle:
+    case CSSPropertyWebkitTextStrokeColor:
+    case CSSPropertyWebkitTextStrokeWidth:
         return true;
     default:
         break;