REGRESSION (r224780): Text stroke not applied to video captions.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jan 2018 16:13:16 +0000 (16:13 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jan 2018 16:13:16 +0000 (16:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181743
<rdar://problem/35874338>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: media/track/track-css-visible-stroke-expected.html
       media/track/track-css-visible-stroke.html

After r224780, it is no longer possible to mix text stroke styles with webkit
legacy text stroke styles.

* css/StyleResolver.cpp:
(WebCore::isValidCueStyleProperty):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):

LayoutTests:

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

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

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

index 871fdc0..05ee411 100644 (file)
@@ -1,3 +1,16 @@
+2018-01-17  Per Arne Vollan  <pvollan@apple.com>
+
+        REGRESSION (r224780): Text stroke not applied to video captions.
+        https://bugs.webkit.org/show_bug.cgi?id=181743
+        <rdar://problem/35874338>
+
+        Reviewed by Simon Fraser.
+
+        * media/track/track-css-stroke-cues-expected.txt:
+        * media/track/track-css-stroke-cues.html:
+        * media/track/track-css-visible-stroke-expected.html: Added.
+        * media/track/track-css-visible-stroke.html: Added.
+
 2018-01-18  Andy Estes  <aestes@apple.com>
 
         [Payment Request] Support a default shipping address for Apple Pay
index ac9440f..f85e8df 100644 (file)
@@ -2,8 +2,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
+EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeWidth == '4px') OK
+EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeColor == 'rgb(0, 0, 0)') OK
 EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).paintOrder == 'stroke') OK
 EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeLinejoin == 'round') OK
 EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeLinecap == 'round') OK
index 4587662..7963aa1 100644 (file)
@@ -9,7 +9,7 @@
 
         <style>
 
-        video::cue { -webkit-text-stroke: 4px black; paint-order: stroke; stroke-linecap: round; stroke-linejoin: round;}
+        video::cue { stroke-width: 4px; stroke-color: black; paint-order: stroke; stroke-linecap: round; stroke-linejoin: round;}
 
         </style>
 
@@ -17,8 +17,8 @@
 
         function seeked()
         {
-            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).webkitTextStrokeWidth", "4px");
-            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).webkitTextStrokeColor", "rgb(0, 0, 0)");
+            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeWidth", "4px");
+            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeColor", "rgb(0, 0, 0)");
             testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).paintOrder", "stroke");
             testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeLinejoin", "round");
             testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).strokeLinecap", "round");
diff --git a/LayoutTests/media/track/track-css-visible-stroke-expected.html b/LayoutTests/media/track/track-css-visible-stroke-expected.html
new file mode 100644 (file)
index 0000000..ce3bbf9
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+        <style>
+
+        .redtile {
+            width: 50px;
+            height: 50px;
+            position: absolute;
+            background-color: red;
+        }
+
+        </style>
+
+    </head>
+    <body>
+        <div class="redtile" style="left: 0px; top: 0px;"></div>
+    </body>
+</html>
diff --git a/LayoutTests/media/track/track-css-visible-stroke.html b/LayoutTests/media/track/track-css-visible-stroke.html
new file mode 100644 (file)
index 0000000..d178b6d
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script>var requirePixelDump = true;</script>
+        <script src=../media-file.js></script>
+        <script src=../video-test.js></script>
+        <script src=../media-controls.js></script>
+
+        <style>
+        video::cue { font-size: 400px; stroke-width: 400px; stroke-color: red; paint-order: fill;}
+
+        .obscurer {
+            width: 500px;
+            height: 500px;
+            position: absolute;
+            background-color: white;
+        }
+        </style>
+        <script>
+        function seeked()
+        {
+            endTest();
+        }
+
+        function loaded()
+        {
+            consoleWrite("Test that text stroke 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 style="position: absolute; left: 0px; top: 0px;" controls >
+            <track src="captions-webvtt/styling.vtt" kind="captions" default>
+        </video>
+        <div class="obscurer" style="left: 0px; top: 50px;"></div>
+        <div class="obscurer" style="left: 50px; top: 0px;"></div>
+    </body>
+</html>
index 93ffad8..346748d 100644 (file)
@@ -1,3 +1,22 @@
+2018-01-17  Per Arne Vollan  <pvollan@apple.com>
+
+        REGRESSION (r224780): Text stroke not applied to video captions.
+        https://bugs.webkit.org/show_bug.cgi?id=181743
+        <rdar://problem/35874338>
+
+        Reviewed by Simon Fraser.
+
+        Tests: media/track/track-css-visible-stroke-expected.html
+               media/track/track-css-visible-stroke.html
+
+        After r224780, it is no longer possible to mix text stroke styles with webkit
+        legacy text stroke styles.
+
+        * css/StyleResolver.cpp:
+        (WebCore::isValidCueStyleProperty):
+        * page/CaptionUserPreferencesMediaAF.cpp:
+        (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):
+
 2018-01-18  Andy Estes  <aestes@apple.com>
 
         [Payment Request] Support a default shipping address for Apple Pay
index defc738..b30a336 100644 (file)
@@ -1529,8 +1529,8 @@ static inline bool isValidCueStyleProperty(CSSPropertyID id)
     case CSSPropertyPaintOrder:
     case CSSPropertyStrokeLinejoin:
     case CSSPropertyStrokeLinecap:
-    case CSSPropertyWebkitTextStrokeColor:
-    case CSSPropertyWebkitTextStrokeWidth:
+    case CSSPropertyStrokeColor:
+    case CSSPropertyStrokeWidth:
         return true;
     default:
         break;
index 23d7e0b..70c55a7 100644 (file)
@@ -395,7 +395,7 @@ String CaptionUserPreferencesMediaAF::captionsTextEdgeCSS() const
         appendCSS(builder, CSSPropertyTextShadow, makeString(edgeStyleDropShadow.get(), " black"), important);
 
     if (textEdgeStyle == kMACaptionAppearanceTextEdgeStyleDropShadow || textEdgeStyle == kMACaptionAppearanceTextEdgeStyleUniform) {
-        appendCSS(builder, CSSPropertyWebkitTextStrokeColor, "black", important);
+        appendCSS(builder, CSSPropertyStrokeColor, "black", important);
         appendCSS(builder, CSSPropertyPaintOrder, getValueName(CSSValueStroke), important);
         appendCSS(builder, CSSPropertyStrokeLinejoin, getValueName(CSSValueRound), important);
         appendCSS(builder, CSSPropertyStrokeLinecap, getValueName(CSSValueRound), important);