Title: [203806] trunk
Revision
203806
Author
[email protected]
Date
2016-07-27 16:50:29 -0700 (Wed, 27 Jul 2016)

Log Message

First parameter to HTMLMediaElement.canPlayType() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=160275

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline w3c test now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

First parameter to HTMLMediaElement.canPlayType() should be mandatory:
- https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement

Firefox and Chrome agree with the specification.

No new tests, rebaselined existing tests.

* html/HTMLMediaElement.idl:

LayoutTests:

Update existing tests to reflect behavior change.

* media/encrypted-media/encrypted-media-can-play-type.html:
* media/media-can-play-type-expected.txt:
* media/media-can-play-type.html:
* platform/mac/media/encrypted-media/encrypted-media-can-play-type-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203805 => 203806)


--- trunk/LayoutTests/ChangeLog	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/LayoutTests/ChangeLog	2016-07-27 23:50:29 UTC (rev 203806)
@@ -1,5 +1,19 @@
 2016-07-27  Chris Dumez  <[email protected]>
 
+        First parameter to HTMLMediaElement.canPlayType() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160275
+
+        Reviewed by Ryosuke Niwa.
+
+        Update existing tests to reflect behavior change.
+
+        * media/encrypted-media/encrypted-media-can-play-type.html:
+        * media/media-can-play-type-expected.txt:
+        * media/media-can-play-type.html:
+        * platform/mac/media/encrypted-media/encrypted-media-can-play-type-expected.txt:
+
+2016-07-27  Chris Dumez  <[email protected]>
+
         Parameters to insertAdjacentText() / insertAdjacentHTML() should be mandatory
         https://bugs.webkit.org/show_bug.cgi?id=160274
 

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203805 => 203806)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-27 23:50:29 UTC (rev 203806)
@@ -1,5 +1,16 @@
 2016-07-27  Chris Dumez  <[email protected]>
 
+        First parameter to HTMLMediaElement.canPlayType() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160275
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline w3c test now that more checks are passing.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-07-27  Chris Dumez  <[email protected]>
+
         First parameter to setTimeout() / setInterval() should be mandatory
         https://bugs.webkit.org/show_bug.cgi?id=160277
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (203805 => 203806)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-27 23:50:29 UTC (rev 203806)
@@ -1850,9 +1850,7 @@
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "buffered" with the proper type (10) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "load" with the proper type (11) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "canPlayType" with the proper type (12) 
-FAIL HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("video") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("video") with too few arguments must throw TypeError 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_NOTHING" with the proper type (13) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_METADATA" with the proper type (14) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_CURRENT_DATA" with the proper type (15) 
@@ -1906,9 +1904,7 @@
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "buffered" with the proper type (10) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "load" with the proper type (11) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "canPlayType" with the proper type (12) 
-FAIL HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("audio") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("audio") with too few arguments must throw TypeError 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_NOTHING" with the proper type (13) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_METADATA" with the proper type (14) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_CURRENT_DATA" with the proper type (15) 
@@ -1957,9 +1953,7 @@
 PASS HTMLMediaElement interface: new Audio() must inherit property "buffered" with the proper type (10) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "load" with the proper type (11) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "canPlayType" with the proper type (12) 
-FAIL HTMLMediaElement interface: calling canPlayType(DOMString) on new Audio() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS HTMLMediaElement interface: calling canPlayType(DOMString) on new Audio() with too few arguments must throw TypeError 
 PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_NOTHING" with the proper type (13) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_METADATA" with the proper type (14) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_CURRENT_DATA" with the proper type (15) 
@@ -2064,7 +2058,7 @@
 PASS HTMLMediaElement interface: attribute preload 
 PASS HTMLMediaElement interface: attribute buffered 
 PASS HTMLMediaElement interface: operation load() 
-FAIL HTMLMediaElement interface: operation canPlayType(DOMString) assert_equals: property has wrong .length expected 1 but got 0
+PASS HTMLMediaElement interface: operation canPlayType(DOMString) 
 PASS HTMLMediaElement interface: constant HAVE_NOTHING on interface object 
 PASS HTMLMediaElement interface: constant HAVE_NOTHING on interface prototype object 
 PASS HTMLMediaElement interface: constant HAVE_METADATA on interface object 

Modified: trunk/LayoutTests/media/encrypted-media/encrypted-media-can-play-type.html (203805 => 203806)


--- trunk/LayoutTests/media/encrypted-media/encrypted-media-can-play-type.html	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/LayoutTests/media/encrypted-media/encrypted-media-can-play-type.html	2016-07-27 23:50:29 UTC (rev 203806)
@@ -13,7 +13,7 @@
             video = mediaElement = document.getElementsByTagName('video')[0];
 
             consoleWrite("Always return the empty string for no type.");
-            testExpected("video.canPlayType()", "");
+            testException("video.canPlayType()", "'TypeError: Not enough arguments'");
 
             consoleWrite("<br>Always return the empty string for an empty type.");
             testExpected("video.canPlayType('')", "");

Modified: trunk/LayoutTests/media/media-can-play-type-expected.txt (203805 => 203806)


--- trunk/LayoutTests/media/media-can-play-type-expected.txt	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/LayoutTests/media/media-can-play-type-expected.txt	2016-07-27 23:50:29 UTC (rev 203806)
@@ -1,7 +1,7 @@
 
 Test HTMLMediaElement canPlayType() method.
 
-EXPECTED (video.canPlayType() == '') OK
+TEST(video.canPlayType()) THROWS('TypeError: Not enough arguments') OK
 EXPECTED (video.canPlayType('video/') == '') OK
 EXPECTED (video.canPlayType('video/blahblah') == '') OK
 EXPECTED (video.canPlayType('video/blahblah; codecs="blah, , blah"') == '') OK

Modified: trunk/LayoutTests/media/media-can-play-type.html (203805 => 203806)


--- trunk/LayoutTests/media/media-can-play-type.html	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/LayoutTests/media/media-can-play-type.html	2016-07-27 23:50:29 UTC (rev 203806)
@@ -6,7 +6,7 @@
             function start() {
                 video = document.getElementsByTagName('video')[0];
 
-                testExpected("video.canPlayType()", "");
+                testException("video.canPlayType()", "'TypeError: Not enough arguments'");
                 testExpected("video.canPlayType('video/')", "");
                 testExpected("video.canPlayType('video/blahblah')", "");
                 testExpected("video.canPlayType('video/blahblah; codecs=\"blah,  , blah\"')", "");

Modified: trunk/LayoutTests/platform/mac/media/encrypted-media/encrypted-media-can-play-type-expected.txt (203805 => 203806)


--- trunk/LayoutTests/platform/mac/media/encrypted-media/encrypted-media-can-play-type-expected.txt	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/LayoutTests/platform/mac/media/encrypted-media/encrypted-media-can-play-type-expected.txt	2016-07-27 23:50:29 UTC (rev 203806)
@@ -4,7 +4,7 @@
 The test is designed to pass with any implementation regardless of supported media types and relies on the expected log to detect the expected results for some types. To get sufficient coverage, it is important that an implementation support clearkey encryption of at least one of the types below.
 
 Always return the empty string for no type.
-EXPECTED (video.canPlayType() == '') OK
+TEST(video.canPlayType()) THROWS('TypeError: Not enough arguments') OK
 
 Always return the empty string for an empty type.
 EXPECTED (video.canPlayType('') == '') OK

Modified: trunk/Source/WebCore/ChangeLog (203805 => 203806)


--- trunk/Source/WebCore/ChangeLog	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/Source/WebCore/ChangeLog	2016-07-27 23:50:29 UTC (rev 203806)
@@ -1,5 +1,21 @@
 2016-07-27  Chris Dumez  <[email protected]>
 
+        First parameter to HTMLMediaElement.canPlayType() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160275
+
+        Reviewed by Ryosuke Niwa.
+
+        First parameter to HTMLMediaElement.canPlayType() should be mandatory:
+        - https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
+
+        Firefox and Chrome agree with the specification.
+
+        No new tests, rebaselined existing tests.
+
+        * html/HTMLMediaElement.idl:
+
+2016-07-27  Chris Dumez  <[email protected]>
+
         First parameter to setTimeout() / setInterval() should be mandatory
         https://bugs.webkit.org/show_bug.cgi?id=160277
 

Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (203805 => 203806)


--- trunk/Source/WebCore/html/HTMLMediaElement.idl	2016-07-27 23:50:07 UTC (rev 203805)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl	2016-07-27 23:50:29 UTC (rev 203806)
@@ -48,11 +48,10 @@
     readonly attribute TimeRanges buffered;
     void load();
 
-    // FIXME: Using "undefined" as default parameter value is wrong.
 #if (defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA) || (defined(ENABLE_ENCRYPTED_MEDIA_V2) && ENABLE_ENCRYPTED_MEDIA_V2)
-    DOMString canPlayType(optional DOMString type = "undefined", optional DOMString? keySystem = null);
+    DOMString canPlayType(DOMString type, optional DOMString? keySystem = null);
 #else
-    DOMString canPlayType(optional DOMString type = "undefined");
+    DOMString canPlayType(DOMString type);
 #endif
 
     // ready state
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to