Title: [236403] trunk
Revision
236403
Author
pvol...@apple.com
Date
2018-09-24 09:39:04 -0700 (Mon, 24 Sep 2018)

Log Message

[WebVTT] Change name of WebVTT region attribute 'height' to 'lines'.
https://bugs.webkit.org/show_bug.cgi?id=189862

Reviewed by Eric Carlson.

Source/WebCore:

The WebVTT region attribute 'height' has been renamed to 'lines', see https://w3c.github.io/webvtt/#region-settings.

No new tests, covered by existing tests.

* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::setLines):
(WebCore::VTTRegion::updateParametersFromRegion):
(WebCore::VTTRegion::scanSettingName):
(WebCore::VTTRegion::parseSettingValue):
(WebCore::VTTRegion::prepareRegionDisplayTree):
(WebCore::VTTRegion::setHeight): Deleted.
* html/track/VTTRegion.h:
* html/track/VTTRegion.idl:

LayoutTests:

* media/track/captions-webvtt/captions-regions.vtt:
* media/track/captions-webvtt/header-regions.vtt:
* media/track/regions-webvtt/vtt-region-constructor-expected.txt:
* media/track/regions-webvtt/vtt-region-constructor.html:
* media/track/regions-webvtt/vtt-region-display-expected.txt:
* media/track/regions-webvtt/vtt-region-display.html:
* media/track/regions-webvtt/vtt-region-list-expected.txt:
* media/track/regions-webvtt/vtt-region-list.html:
* media/track/regions-webvtt/vtt-region-parser-expected.txt:
* media/track/regions-webvtt/vtt-region-parser.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (236402 => 236403)


--- trunk/LayoutTests/ChangeLog	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/ChangeLog	2018-09-24 16:39:04 UTC (rev 236403)
@@ -1,3 +1,21 @@
+2018-09-24  Per Arne Vollan  <pvol...@apple.com>
+
+        [WebVTT] Change name of WebVTT region attribute 'height' to 'lines'.
+        https://bugs.webkit.org/show_bug.cgi?id=189862
+
+        Reviewed by Eric Carlson.
+
+        * media/track/captions-webvtt/captions-regions.vtt:
+        * media/track/captions-webvtt/header-regions.vtt:
+        * media/track/regions-webvtt/vtt-region-constructor-expected.txt:
+        * media/track/regions-webvtt/vtt-region-constructor.html:
+        * media/track/regions-webvtt/vtt-region-display-expected.txt:
+        * media/track/regions-webvtt/vtt-region-display.html:
+        * media/track/regions-webvtt/vtt-region-list-expected.txt:
+        * media/track/regions-webvtt/vtt-region-list.html:
+        * media/track/regions-webvtt/vtt-region-parser-expected.txt:
+        * media/track/regions-webvtt/vtt-region-parser.html:
+
 2018-09-24  Yoav Weiss  <y...@yoav.ws>
 
         Import WPT resource-timing tests

Modified: trunk/LayoutTests/media/track/captions-webvtt/captions-regions.vtt (236402 => 236403)


--- trunk/LayoutTests/media/track/captions-webvtt/captions-regions.vtt	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/captions-webvtt/captions-regions.vtt	2018-09-24 16:39:04 UTC (rev 236403)
@@ -3,7 +3,7 @@
 REGION
 id=fred
 width=50%
-height=2
+lines=2
 regionanchor=50%,100%
 viewportanchor=10%,40%
 

Modified: trunk/LayoutTests/media/track/captions-webvtt/header-regions.vtt (236402 => 236403)


--- trunk/LayoutTests/media/track/captions-webvtt/header-regions.vtt	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/captions-webvtt/header-regions.vtt	2018-09-24 16:39:04 UTC (rev 236403)
@@ -6,7 +6,7 @@
 REGION
 id=region_with_all_settings
 width=32%
-height=5
+lines=5
 regionanchor=41%,20%
 viewportanchor=31%,84%
 scroll=up

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt	2018-09-24 16:39:04 UTC (rev 236403)
@@ -9,7 +9,7 @@
 EXPECTED (region.viewportAnchorY == '100') OK
 EXPECTED (region.regionAnchorX == '0') OK
 EXPECTED (region.regionAnchorY == '100') OK
-EXPECTED (region.height == '3') OK
+EXPECTED (region.lines == '3') OK
 EXPECTED (region.width == '100') OK
 
 ** Test that incorrect mutation keeps previous valid values. **
@@ -101,13 +101,13 @@
 RUN(region.width = invalidPercentageValues[index])
 TypeError: The provided value is non-finite
 EXPECTED (region.width == '100') OK
-RUN(region.height = -1)
+RUN(region.lines = -1)
 IndexSizeError: The index is not in the allowed range.
-EXPECTED (region.height == '3') OK
+EXPECTED (region.lines == '3') OK
 
 ** Test that proper mutation keeps assigned value. **
-RUN(region.height = 130)
-EXPECTED (region.height == '130') OK
+RUN(region.lines = 130)
+EXPECTED (region.lines == '130') OK
 RUN(region.viewportAnchorX = 64)
 EXPECTED (region.viewportAnchorX == '64') OK
 RUN(region.viewportAnchorY = 32)

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html	2018-09-24 16:39:04 UTC (rev 236403)
@@ -27,7 +27,7 @@
                 testExpected("region.viewportAnchorY", 100);
                 testExpected("region.regionAnchorX", 0);
                 testExpected("region.regionAnchorY", 100);
-                testExpected("region.height", 3);
+                testExpected("region.lines", 3);
                 testExpected("region.width", 100);
 
                 consoleWrite("<br>** Test that incorrect mutation keeps previous valid values. **");
@@ -49,12 +49,12 @@
                   testExpected("region.width", 100);
                 }
 
-                run("region.height = -1");
-                testExpected("region.height", 3);
+                run("region.lines = -1");
+                testExpected("region.lines", 3);
 
                 consoleWrite("<br>** Test that proper mutation keeps assigned value. **");
-                run("region.height = 130");
-                testExpected("region.height", 130);
+                run("region.lines = 130");
+                testExpected("region.lines", 130);
 
                 run("region.viewportAnchorX = 64");
                 testExpected("region.viewportAnchorX", 64);

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display-expected.txt (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display-expected.txt	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display-expected.txt	2018-09-24 16:39:04 UTC (rev 236403)
@@ -12,7 +12,7 @@
 Total cues in region: 1
 Cue content is: We are in New York City
 Cue lines visible from this cue: 1
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
+EXPECTED (totalVisibleLines <= testTrack.regions[0].lines == 'true') OK
 
 RUN(video.currentTime = 0.5)
 EVENT(seeked)
@@ -21,7 +21,7 @@
 Cue lines visible from this cue: 1
 Cue content is: Second cue
 Cue lines visible from this cue: 1
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
+EXPECTED (totalVisibleLines <= testTrack.regions[0].lines == 'true') OK
 
 RUN(video.currentTime = 1)
 EVENT(seeked)
@@ -32,7 +32,7 @@
 Cue lines visible from this cue: 1
 Cue content is: Multiline Cue
 Cue lines visible from this cue: 0
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
+EXPECTED (totalVisibleLines <= testTrack.regions[0].lines == 'true') OK
 
 RUN(video.currentTime = 2.3)
 EVENT(seeked)
@@ -41,7 +41,7 @@
 Cue lines visible from this cue: 2
 Cue content is: Fourth cue!
 Cue lines visible from this cue: 0
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
+EXPECTED (totalVisibleLines <= testTrack.regions[0].lines == 'true') OK
 
 RUN(video.currentTime = 3)
 EVENT(seeked)
@@ -48,6 +48,6 @@
 Total cues in region: 1
 Cue content is: Fourth cue!
 Cue lines visible from this cue: 1
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
+EXPECTED (totalVisibleLines <= testTrack.regions[0].lines == 'true') OK
 END OF TEST
 

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display.html (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display.html	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display.html	2018-09-24 16:39:04 UTC (rev 236403)
@@ -76,7 +76,7 @@
                 totalVisibleLines += cueVisibleLines;
             }
 
-            testExpected("totalVisibleLines <= testTrack.regions[0].height", true);
+            testExpected("totalVisibleLines <= testTrack.regions[0].lines", true);
 
             if (crtSeekTime == seekTimes.length)
                 endTest();
@@ -106,4 +106,4 @@
             <track src="" kind="captions" default _onload_="startTest()">
         </video>
     </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list-expected.txt (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list-expected.txt	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list-expected.txt	2018-09-24 16:39:04 UTC (rev 236403)
@@ -26,7 +26,7 @@
 EXPECTED (regions[0].viewportAnchorY == '68') OK
 EXPECTED (regions[0].regionAnchorX == '20') OK
 EXPECTED (regions[0].regionAnchorY == '30') OK
-EXPECTED (regions[0].height == '5') OK
+EXPECTED (regions[0].lines == '5') OK
 EXPECTED (regions[0].width == '87') OK
 EXPECTED (regions[0].scroll == 'up') OK
 EXPECTED (regions[0] != updatedRegion == 'true') OK

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list.html (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list.html	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list.html	2018-09-24 16:39:04 UTC (rev 236403)
@@ -48,7 +48,7 @@
             updatedRegion.viewportAnchorY = 68;
             updatedRegion.regionAnchorX = 20;
             updatedRegion.regionAnchorY = 30;
-            updatedRegion.height = 5;
+            updatedRegion.lines = 5;
             updatedRegion.width = 87;
             updatedRegion.scroll = "up";
 
@@ -58,7 +58,7 @@
             testExpected("regions[0].viewportAnchorY", updatedRegion.viewportAnchorY);
             testExpected("regions[0].regionAnchorX", updatedRegion.regionAnchorX);
             testExpected("regions[0].regionAnchorY", updatedRegion.regionAnchorY);
-            testExpected("regions[0].height", updatedRegion.height);
+            testExpected("regions[0].lines", updatedRegion.lines);
             testExpected("regions[0].width", updatedRegion.width);
             testExpected("regions[0].scroll", updatedRegion.scroll);
 

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser-expected.txt (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser-expected.txt	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser-expected.txt	2018-09-24 16:39:04 UTC (rev 236403)
@@ -7,7 +7,7 @@
 
 EXPECTED (region.id == 'region_with_all_settings') OK
 EXPECTED (region.width == '32') OK
-EXPECTED (region.height == '5') OK
+EXPECTED (region.lines == '5') OK
 EXPECTED (region.regionAnchorX == '41') OK
 EXPECTED (region.regionAnchorY == '20') OK
 EXPECTED (region.viewportAnchorX == '31') OK

Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html (236402 => 236403)


--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html	2018-09-24 16:39:04 UTC (rev 236403)
@@ -26,7 +26,7 @@
             region = video.textTracks[0].regions[1];
             testExpected("region.id", "region_with_all_settings");
             testExpected("region.width", 32);
-            testExpected("region.height", 5);
+            testExpected("region.lines", 5);
             testExpected("region.regionAnchorX", 41);
             testExpected("region.regionAnchorY", 20);
             testExpected("region.viewportAnchorX", 31);

Modified: trunk/Source/WebCore/ChangeLog (236402 => 236403)


--- trunk/Source/WebCore/ChangeLog	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/Source/WebCore/ChangeLog	2018-09-24 16:39:04 UTC (rev 236403)
@@ -1,3 +1,24 @@
+2018-09-24  Per Arne Vollan  <pvol...@apple.com>
+
+        [WebVTT] Change name of WebVTT region attribute 'height' to 'lines'.
+        https://bugs.webkit.org/show_bug.cgi?id=189862
+
+        Reviewed by Eric Carlson.
+
+        The WebVTT region attribute 'height' has been renamed to 'lines', see https://w3c.github.io/webvtt/#region-settings.
+
+        No new tests, covered by existing tests.
+
+        * html/track/VTTRegion.cpp:
+        (WebCore::VTTRegion::setLines):
+        (WebCore::VTTRegion::updateParametersFromRegion):
+        (WebCore::VTTRegion::scanSettingName):
+        (WebCore::VTTRegion::parseSettingValue):
+        (WebCore::VTTRegion::prepareRegionDisplayTree):
+        (WebCore::VTTRegion::setHeight): Deleted.
+        * html/track/VTTRegion.h:
+        * html/track/VTTRegion.idl:
+
 2018-09-24  Alicia Boya GarcĂ­a  <ab...@igalia.com>
 
         [MSE][GStreamer] Use no-more-pads event for noticing initialization segments

Modified: trunk/Source/WebCore/html/track/VTTRegion.cpp (236402 => 236403)


--- trunk/Source/WebCore/html/track/VTTRegion.cpp	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/Source/WebCore/html/track/VTTRegion.cpp	2018-09-24 16:39:04 UTC (rev 236403)
@@ -84,11 +84,11 @@
     return { };
 }
 
-ExceptionOr<void> VTTRegion::setHeight(int value)
+ExceptionOr<void> VTTRegion::setLines(int value)
 {
     if (value < 0)
         return Exception { IndexSizeError };
-    m_heightInLines = value;
+    m_lines = value;
     return { };
 }
 
@@ -150,7 +150,7 @@
 
 void VTTRegion::updateParametersFromRegion(const VTTRegion& other)
 {
-    m_heightInLines = other.m_heightInLines;
+    m_lines = other.m_lines;
     m_width = other.m_width;
     m_regionAnchor = other.m_regionAnchor;
     m_viewportAnchor = other.m_viewportAnchor;
@@ -185,8 +185,8 @@
 {
     if (input.scan("id"))
         return Id;
-    if (input.scan("height"))
-        return Height;
+    if (input.scan("lines"))
+        return Lines;
     if (input.scan("width"))
         return Width;
     if (input.scan("viewportanchor"))
@@ -223,10 +223,10 @@
             LOG(Media, "VTTRegion::parseSettingValue, invalid Width");
         break;
     }
-    case Height: {
+    case Lines: {
         int number;
         if (input.scanDigits(number) && parsedEntireRun(input, valueRun))
-            m_heightInLines = number;
+            m_lines = number;
         else
             LOG(Media, "VTTRegion::parseSettingValue, invalid Height");
         break;
@@ -364,7 +364,7 @@
     // Let lineHeight be '0.0533vh' ('vh' is a CSS unit) and regionHeight be
     // the text track region height. Let height be 'lineHeight' multiplied
     // by regionHeight.
-    double height = lineHeight * m_heightInLines;
+    double height = lineHeight * m_lines;
     m_regionDisplayTree->setInlineStyleProperty(CSSPropertyHeight, height, CSSPrimitiveValue::CSS_VH);
 
     // Let viewportAnchorX be the x dimension of the text track region viewport

Modified: trunk/Source/WebCore/html/track/VTTRegion.h (236402 => 236403)


--- trunk/Source/WebCore/html/track/VTTRegion.h	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/Source/WebCore/html/track/VTTRegion.h	2018-09-24 16:39:04 UTC (rev 236403)
@@ -61,8 +61,8 @@
     double width() const { return m_width; }
     ExceptionOr<void> setWidth(double);
 
-    int height() const { return m_heightInLines; }
-    ExceptionOr<void> setHeight(int);
+    int lines() const { return m_lines; }
+    ExceptionOr<void> setLines(int);
 
     double regionAnchorX() const { return m_regionAnchor.x(); }
     ExceptionOr<void> setRegionAnchorX(double);
@@ -106,7 +106,7 @@
         None,
         Id,
         Width,
-        Height,
+        Lines,
         RegionAnchor,
         ViewportAnchor,
         Scroll
@@ -124,7 +124,7 @@
     String m_settings;
 
     double m_width { 100 };
-    unsigned m_heightInLines { 3 };
+    unsigned m_lines { 3 };
 
     FloatPoint m_regionAnchor { 0, 100 };
     FloatPoint m_viewportAnchor { 0, 100 };

Modified: trunk/Source/WebCore/html/track/VTTRegion.idl (236402 => 236403)


--- trunk/Source/WebCore/html/track/VTTRegion.idl	2018-09-24 15:58:43 UTC (rev 236402)
+++ trunk/Source/WebCore/html/track/VTTRegion.idl	2018-09-24 16:39:04 UTC (rev 236403)
@@ -34,7 +34,7 @@
 
     attribute DOMString id;
     attribute double width;
-    attribute long height;
+    attribute long lines;
     attribute double regionAnchorX;
     attribute double regionAnchorY;
     attribute double viewportAnchorX;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to