diff options
Diffstat (limited to 'testing/web-platform')
38 files changed, 387 insertions, 250 deletions
diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 65626d6b8..3c7df67fa 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -38674,6 +38674,12 @@ "url": "/html/webappapis/idle-callbacks/callback-multiple-calls.html" } ], + "html/webappapis/idle-callbacks/callback-suspended.html": [ + { + "path": "html/webappapis/idle-callbacks/callback-suspended.html", + "url": "/html/webappapis/idle-callbacks/callback-suspended.html" + } + ], "html/webappapis/idle-callbacks/callback-timeout.html": [ { "path": "html/webappapis/idle-callbacks/callback-timeout.html", @@ -39138,6 +39144,18 @@ "url": "/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_9.html" } ], + "2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1.html": [ + { + "path": "2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1.html", + "references": [ + [ + "/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1_ref.html", + "==" + ] + ], + "url": "/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1.html" + } + ], "2dcontext/line-styles/canvas_linestyles_linecap_001.htm": [ { "path": "2dcontext/line-styles/canvas_linestyles_linecap_001.htm", diff --git a/testing/web-platform/meta/XMLHttpRequest/open-url-bogus.htm.ini b/testing/web-platform/meta/XMLHttpRequest/open-url-bogus.htm.ini deleted file mode 100644 index ef7b5d910..000000000 --- a/testing/web-platform/meta/XMLHttpRequest/open-url-bogus.htm.ini +++ /dev/null @@ -1,11 +0,0 @@ -[open-url-bogus.htm] - type: testharness - [XMLHttpRequest: open() - bogus URLs (http:)] - expected: FAIL - - [XMLHttpRequest: open() - bogus URLs (ftp:)] - expected: FAIL - - [XMLHttpRequest: open() - bogus URLs (http:////////////)] - expected: FAIL - diff --git a/testing/web-platform/meta/dom/events/EventTarget-dispatchEvent.html.ini b/testing/web-platform/meta/dom/events/EventTarget-dispatchEvent.html.ini index d62b521c5..0d489b03d 100644 --- a/testing/web-platform/meta/dom/events/EventTarget-dispatchEvent.html.ini +++ b/testing/web-platform/meta/dom/events/EventTarget-dispatchEvent.html.ini @@ -12,10 +12,6 @@ expected: FAIL bug: https://github.com/whatwg/dom/issues/362, 1314303 - [If the event's initialized flag is not set, an InvalidStateError must be thrown (FocusEvent).] - expected: FAIL - bug: https://github.com/whatwg/dom/issues/362, 1314303 - [If the event's initialized flag is not set, an InvalidStateError must be thrown (IDBVersionChangeEvent).] expected: FAIL bug: https://github.com/whatwg/dom/issues/362, 1314303 diff --git a/testing/web-platform/meta/dom/nodes/Document-createEvent.html.ini b/testing/web-platform/meta/dom/nodes/Document-createEvent.html.ini index 1d92f01ae..a1c822113 100644 --- a/testing/web-platform/meta/dom/nodes/Document-createEvent.html.ini +++ b/testing/web-platform/meta/dom/nodes/Document-createEvent.html.ini @@ -76,30 +76,6 @@ expected: FAIL bug: https://github.com/whatwg/dom/issues/362, 1314303 - [FocusEvent should be an alias for FocusEvent.] - expected: FAIL - bug: https://github.com/whatwg/dom/issues/362, 1314303 - - [createEvent('FocusEvent') should be initialized correctly.] - expected: FAIL - bug: https://github.com/whatwg/dom/issues/362, 1314303 - - [focusevent should be an alias for FocusEvent.] - expected: FAIL - bug: https://github.com/whatwg/dom/issues/362, 1314303 - - [createEvent('focusevent') should be initialized correctly.] - expected: FAIL - bug: https://github.com/whatwg/dom/issues/362, 1314303 - - [FOCUSEVENT should be an alias for FocusEvent.] - expected: FAIL - bug: https://github.com/whatwg/dom/issues/362, 1314303 - - [createEvent('FOCUSEVENT') should be initialized correctly.] - expected: FAIL - bug: https://github.com/whatwg/dom/issues/362, 1314303 - [IDBVersionChangeEvent should be an alias for IDBVersionChangeEvent.] expected: FAIL bug: https://github.com/whatwg/dom/issues/362, 1314303 diff --git a/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini b/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini index 27927b1e9..8c4cddf9c 100644 --- a/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini +++ b/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini @@ -1,17 +1,3 @@ [headers-basic.html] type: testharness - [Check keys method] - expected: FAIL - - [Check values method] - expected: FAIL - - [Check entries method] - expected: FAIL - - [Check Symbol.iterator method] - expected: FAIL - - [Check forEach method] - expected: FAIL diff --git a/testing/web-platform/meta/fetch/nosniff/worker.html.ini b/testing/web-platform/meta/fetch/nosniff/worker.html.ini deleted file mode 100644 index 011ad15b8..000000000 --- a/testing/web-platform/meta/fetch/nosniff/worker.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[worker.html] - type: testharness - expected: ERROR diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini index a8247d5a0..23bd8642c 100644 --- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini +++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini @@ -32,25 +32,3 @@ [[INPUT in DATETIME status\] The datetime type must be supported.] expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an overflow] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an overflow (in a form)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an underflow] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an underflow (in a form)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch (in a form)] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini index 223667997..5b373cfee 100644 --- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini +++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini @@ -39,24 +39,3 @@ [[INPUT in DATETIME status\] The datetime type must be supported.] expected: FAIL - [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an overflow] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an overflow (in a form)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an underflow] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from an underflow (in a form)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch (in a form)] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini index 6af2a360e..d8c650632 100644 --- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini +++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini @@ -3,21 +3,3 @@ [[INPUT in DATETIME status\] The datetime type must be supported.] expected: FAIL - [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is greater than max] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is greater than max(with millisecond in 1 digit)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is greater than max(with millisecond in 2 digits)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is greater than max(with millisecond in 3 digits)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is greater than max(Year is 10000 should be valid)] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini index 344ee0039..87f6f964e 100644 --- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini +++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini @@ -3,21 +3,3 @@ [[INPUT in DATETIME status\] The datetime type must be supported.] expected: FAIL - [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is less than min] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is less than min(with millisecond in 1 digit)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is less than min(with millisecond in 2 digits)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is less than min(with millisecond in 3 digits)] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value is less than min(Year is 10000 should be valid)] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini index 0c33bdcbe..527760e60 100644 --- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini +++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini @@ -2,7 +2,3 @@ type: testharness [[INPUT in DATETIME status\] The datetime type must be supported.] expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The value must mismatch the step] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini index 1cddcd033..8eb7940d9 100644 --- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini +++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini @@ -23,16 +23,3 @@ [[INPUT in MONTH status\] validity.valid must be false if validity.stepMismatch is true] expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] validity.valid must be false if validity.rangeOverflow is true] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] validity.valid must be false if validity.rangeUnderflow is true] - expected: FAIL - - [[INPUT in DATETIME-LOCAL status\] validity.valid must be false if validity.stepMismatch is true] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/forms/the-label-element/label-attributes.html.ini b/testing/web-platform/meta/html/semantics/forms/the-label-element/label-attributes.html.ini deleted file mode 100644 index e1a2e38b5..000000000 --- a/testing/web-platform/meta/html/semantics/forms/the-label-element/label-attributes.html.ini +++ /dev/null @@ -1,17 +0,0 @@ -[label-attributes.html] - type: testharness - [A non-control follows by a control with same ID.] - expected: FAIL - - [A form control has multiple labels.] - expected: FAIL - - [A form control has no label 1.] - expected: FAIL - - [A form control has no label 2.] - expected: FAIL - - [A form control has an implicit label.] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/forms/the-label-element/labelable-elements.html.ini b/testing/web-platform/meta/html/semantics/forms/the-label-element/labelable-elements.html.ini index bfa61edb7..363324f2e 100644 --- a/testing/web-platform/meta/html/semantics/forms/the-label-element/labelable-elements.html.ini +++ b/testing/web-platform/meta/html/semantics/forms/the-label-element/labelable-elements.html.ini @@ -1,29 +1,7 @@ [labelable-elements.html] type: testharness - [Check if the output element can access 'labels'] - expected: FAIL - - [Check if the progress element can access 'labels'] - expected: FAIL - - [Check if the select element can access 'labels'] - expected: FAIL - - [Check if the textarea element can access 'labels'] - expected: FAIL - - [Check if the button element can access 'labels'] - expected: FAIL - - [Check if the hidden input element can access 'labels'] - expected: FAIL - - [Check if the input element in radio state can access 'labels'] + [Check if the keygen element is not a labelable element] expected: FAIL [Check if the keygen element can access 'labels'] expected: FAIL - - [Check if the meter element can access 'labels'] - expected: FAIL - diff --git a/testing/web-platform/meta/html/semantics/selectors/pseudo-classes/inrange-outofrange.html.ini b/testing/web-platform/meta/html/semantics/selectors/pseudo-classes/inrange-outofrange.html.ini deleted file mode 100644 index 5e2525ac2..000000000 --- a/testing/web-platform/meta/html/semantics/selectors/pseudo-classes/inrange-outofrange.html.ini +++ /dev/null @@ -1,20 +0,0 @@ -[inrange-outofrange.html] - type: testharness - [':in-range' matches all elements that are candidates for constraint validation, have range limitations, and that are neither suffering from an underflow nor suffering from an overflow] - expected: FAIL - - [':in-range' update number1's value < min] - expected: FAIL - - [':in-range' update number3's min < value] - expected: FAIL - - [':out-of-range' matches all elements that are candidates for constraint validation, have range limitations, and that are either suffering from an underflow or suffering from an overflow] - expected: FAIL - - [':out-of-range' update number1's value < min] - expected: FAIL - - [':out-of-range' update number3's min < value] - expected: FAIL - diff --git a/testing/web-platform/meta/media-source/mediasource-getvideoplaybackquality.html.ini b/testing/web-platform/meta/media-source/mediasource-getvideoplaybackquality.html.ini index b32cf5912..05e68a301 100644..100755 --- a/testing/web-platform/meta/media-source/mediasource-getvideoplaybackquality.html.ini +++ b/testing/web-platform/meta/media-source/mediasource-getvideoplaybackquality.html.ini @@ -2,4 +2,6 @@ type: testharness [Test the totalFrameDelay attribute of HTMLVideoElement.getVideoPlaybackQuality() with MediaSource API] expected: FAIL + [Test HTMLVideoElement.getVideoPlaybackQuality() with MediaSource API] + disabled: Because we do timer rounding, sometimes the test passes, othertimes it fails diff --git a/testing/web-platform/meta/old-tests/submission/Infraware/Forms/contents/Forms/button_labels.html.ini b/testing/web-platform/meta/old-tests/submission/Infraware/Forms/contents/Forms/button_labels.html.ini deleted file mode 100644 index e4a30320e..000000000 --- a/testing/web-platform/meta/old-tests/submission/Infraware/Forms/contents/Forms/button_labels.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[button_labels.html] - type: testharness - [Forms] - expected: FAIL - diff --git a/testing/web-platform/meta/old-tests/submission/Infraware/Forms/contents/Forms/input_labels.html.ini b/testing/web-platform/meta/old-tests/submission/Infraware/Forms/contents/Forms/input_labels.html.ini deleted file mode 100644 index da0fb96d7..000000000 --- a/testing/web-platform/meta/old-tests/submission/Infraware/Forms/contents/Forms/input_labels.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[input_labels.html] - type: testharness - [Forms] - expected: FAIL - diff --git a/testing/web-platform/meta/selection/getSelection.html.ini b/testing/web-platform/meta/selection/getSelection.html.ini index 4db5721ae..672b83770 100644 --- a/testing/web-platform/meta/selection/getSelection.html.ini +++ b/testing/web-platform/meta/selection/getSelection.html.ini @@ -1,14 +1,5 @@ [getSelection.html] type: testharness - [getSelection() on HTML document with null defaultView must be null] - expected: FAIL - - [getSelection() on XML document with null defaultView must be null] - expected: FAIL - - [getSelection() on HTML document with null defaultView must be null inside an iframe onload] - expected: FAIL - [window.getSelection() instanceof Selection in an iframe immediately after appendChild] expected: FAIL diff --git a/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini index e37f8696f..430f4c60c 100644..100755 --- a/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini +++ b/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini @@ -2,4 +2,6 @@ type: testharness [Resource Timing] expected: FAIL + [User Timing] + disabled: Because we do timer rounding, sometimes the test passes, othertimes it fails diff --git a/testing/web-platform/meta/svg/interfaces.html.ini b/testing/web-platform/meta/svg/interfaces.html.ini index f3f7f6b5c..1162695c8 100644 --- a/testing/web-platform/meta/svg/interfaces.html.ini +++ b/testing/web-platform/meta/svg/interfaces.html.ini @@ -820,12 +820,6 @@ [SVGElement interface: linearGradient must inherit property "onsort" with the proper type (62)] expected: FAIL - [SVGRadialGradientElement interface: attribute fr] - expected: FAIL - - [SVGRadialGradientElement interface: radialGradient must inherit property "fr" with the proper type (5)] - expected: FAIL - [SVGElement interface: radialGradient must inherit property "onautocomplete" with the proper type (8)] expected: FAIL diff --git a/testing/web-platform/meta/url/url-constructor.html.ini b/testing/web-platform/meta/url/url-constructor.html.ini index 6da03043b..22fddbc15 100644 --- a/testing/web-platform/meta/url/url-constructor.html.ini +++ b/testing/web-platform/meta/url/url-constructor.html.ini @@ -219,6 +219,3 @@ [Parsing: <http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar> against <about:blank>] expected: FAIL - [Parsing: <http:> against <https://example.org/foo/bar>] - expected: FAIL - diff --git a/testing/web-platform/meta/webaudio/the-audio-api/the-audioparam-interface/retrospective-setValueAtTime.html.ini b/testing/web-platform/meta/webaudio/the-audio-api/the-audioparam-interface/retrospective-setValueAtTime.html.ini new file mode 100755 index 000000000..a565e0109 --- /dev/null +++ b/testing/web-platform/meta/webaudio/the-audio-api/the-audioparam-interface/retrospective-setValueAtTime.html.ini @@ -0,0 +1,3 @@ +[retrospective-setValueAtTime.html] + [Test setValueAtTime with startTime in the past] + disabled: Because we do timer rounding, sometimes the test passes, othertimes it fails diff --git a/testing/web-platform/meta/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html.ini b/testing/web-platform/meta/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html.ini new file mode 100755 index 000000000..26fb23c0f --- /dev/null +++ b/testing/web-platform/meta/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html.ini @@ -0,0 +1,3 @@ +[current-time-block-size.html] + [Test currentTime at completion of OfflineAudioContext rendering] + disabled: Because we do timer rounding, sometimes the test passes, othertimes it fails diff --git a/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1.html b/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1.html index b9de85a97..74a00e037 100644 --- a/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1.html +++ b/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <meta charset="utf-8"> -<link rel=match href=drawimage_html_image_1_ref.html> +<link rel=match href=drawimage_svg_image_1_ref.html> <style> html, body { margin: 0; @@ -13,8 +13,8 @@ var sourceWidth = 100; var sourceHeight = 100; var smoothingEnabled = false; var destCanvas = document.getElementById('dest'); -var sourceImg = document.createElement('img'); -sourceImg.src = '../2x2.png' +var sourceImg = document.createElementNS('http://www.w3.org/2000/svg', 'image'); +sourceImg.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '../2x2.png'); sourceImg.width = sourceWidth; sourceImg.height = sourceHeight; diff --git a/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1_ref.html b/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1_ref.html index 60545df17..60545df17 100644 --- a/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1_ref.html +++ b/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1_ref.html diff --git a/testing/web-platform/tests/fetch/api/response/response-init-002.html b/testing/web-platform/tests/fetch/api/response/response-init-002.html index 0bb2e8d0b..a48af8336 100644 --- a/testing/web-platform/tests/fetch/api/response/response-init-002.html +++ b/testing/web-platform/tests/fetch/api/response/response-init-002.html @@ -65,6 +65,11 @@ }); }, "Testing empty Response Content-Type header"); + test(function() { + var response = new Response(null, {status: 204}); + assert_equals(response.body, null); + }, "Testing null Response body"); + </script> </body> </html> diff --git a/testing/web-platform/tests/fetch/nosniff/script.html b/testing/web-platform/tests/fetch/nosniff/script.html index 667f3c99a..c5c5167f5 100644 --- a/testing/web-platform/tests/fetch/nosniff/script.html +++ b/testing/web-platform/tests/fetch/nosniff/script.html @@ -4,8 +4,8 @@ <script> var log = function() {}, // see comment below p = function() {}, // see comment below - fails = ["", "?type=", "?type=x", "?type=x/x"], - passes = ["?type=text/javascript", "?type=text/ecmascript", "?type=text/ecmascript;blah"] + fails = ["", "?type=", "?type=x", "?type=x/x", "?type=text/json"], + passes = ["?type=text/javascript", "?type=text/ecmascript", "?type=text/ecmascript;blah", "?type=text/javascript1.0"] // Ideally we'd also check whether the scripts in fact execute, but that would involve // timers and might get a bit racy without cross-browser support for the execute events. diff --git a/testing/web-platform/tests/html/semantics/forms/the-label-element/iframe-label-attributes.html b/testing/web-platform/tests/html/semantics/forms/the-label-element/iframe-label-attributes.html new file mode 100644 index 000000000..56b52c951 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-label-element/iframe-label-attributes.html @@ -0,0 +1,8 @@ +<html>
+ <body>
+ <label>
+ <div id="div1"></div>
+ </label>
+ <label for="test13"></label>
+ </body>
+</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html b/testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html index 826533e0c..2910f2c01 100644 --- a/testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html +++ b/testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html @@ -32,10 +32,53 @@ <label id="lbl5" for="test7"></label> <input id="test7"> + + <label id="lbl7"> + <label id="lbl8"> + <div id="div1"> + <input id="test8"> + </div> + </label> + </label> + <div id="div2"></div> + + <label id="lbl9"> + <label id="lbl10" for="test10"> + <div id="div3"> + <input id="test9"> + </div> + </label> + </label> + <div id="div4"><input id="test10"></div> + + <label id="lbl11"> + <object id="obj"> + <input id="test11"> + <input id="test12"> + </object> + </label> + <label id="lbl12" for="test12"><div id="div5"></div></label> + + <label id="lbl13"> + <p id="p1"> + <input id="test13"> + </p> + </label> + + <div id="div6"> + <div id="div7"> + <label id="lbl14"> + <label id="lbl15" for="test15"> + <input id="test14"> + </label> + </label> + </div> + </div> + <input id="test15"> </form> <label id="lbl6" for="test7"></label> - +<div id="content" style="display: none"> <script> //control attribute @@ -57,6 +100,7 @@ }, "A label element not in a document can not label any element in the document."); test(function () { + var labels = document.getElementById("test3").labels; assert_equals(document.getElementById("lbl1").control, document.getElementById("test3"), "The first labelable descendant of a label element should be its labeled control."); @@ -64,6 +108,10 @@ document.getElementById("lbl1").insertBefore(input, document.getElementById("test2")); assert_equals(document.getElementById("lbl1").control, input, "The first labelable descendant of a label element in tree order should be its labeled control."); + assert_equals(input.labels.length, 1, + "The form control has an ancestor with no explicit associated label, and is the first labelable descendant."); + assert_equals(labels.length, 0, + "The number of labels should be 0 if it's not the first labelable descendant of a label element."); input.remove(); }, "The labeled control for a label element that has no 'for' attribute is the first labelable element which is a descendant of that label element."); @@ -101,6 +149,168 @@ }, "A form control has multiple labels."); test(function () { + var labels = document.getElementById("test8").labels; + assert_true(labels instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_equals(labels.length, 2, + "The form control has two ancestors with no explicit associated label, and is the first labelable descendant."); + assert_array_equals(labels, [document.getElementById("lbl7"), document.getElementById("lbl8")], + "The labels for a form control should be returned in tree order."); + + document.getElementById('div2').insertBefore(document.getElementById('div1'), document.getElementById('div2').firstChild); + assert_equals(labels.length, 0, + "The number of labels should be 0 after the labelable element is moved to outside of nested associated labels."); + }, "A labelable element is moved to outside of nested associated labels."); + + test(function () { + var labels1 = document.getElementById("test9").labels; + var labels2 = document.getElementById("test10").labels; + assert_true(labels1 instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_true(labels2 instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_equals(labels1.length, 1, + "The form control has an ancestor with no explicit associated label, and is the first labelable descendant."); + assert_equals(labels2.length, 1, + "The number of labels associated with a form control should be the number of label elements for which it is a labeled control."); + assert_array_equals(labels1, [document.getElementById("lbl9")], + "The labels for a form control should be returned in tree order."); + assert_array_equals(labels2, [document.getElementById("lbl10")], + "The labels for a form control should be returned in tree order."); + document.getElementById('div3').insertBefore(document.getElementById('div4'), document.getElementById('div3').firstChild); + assert_equals(labels1.length, 0, + "The number of labels should be 0 if it's not the first labelable descendant of a label element."); + assert_equals(labels2.length, 2, + "The form control has an ancestor with an explicit associated label, and is the first labelable descendant."); + }, "A labelable element is moved to inside of nested associated labels."); + + test(function () { + var labels1 = document.getElementById("test11").labels; + var labels2 = document.getElementById("test12").labels; + assert_true(labels1 instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_true(labels2 instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_equals(labels1.length, 1, + "The form control has an ancestor with no explicit associated label, and it is the first labelable descendant."); + assert_equals(labels2.length, 1, + "The number of labels should be 1 since there is a label with a 'for' attribute associated with this labelable element."); + assert_array_equals(labels1, [document.getElementById("lbl11")], + "The labels for a form control should be returned in tree order."); + assert_array_equals(labels2, [document.getElementById("lbl12")], + "The labels for a form control should be returned in tree order."); + document.getElementById('div5').appendChild(document.getElementById('obj')); + assert_equals(labels1.length, 0, + "The number of labels should be 0 after the labelable element is moved to outside of associated label."); + assert_equals(labels2.length, 1, + "The number of labels should be 1 after the labelable element is moved to outside of associated label."); + }, "A labelable element which is a descendant of non-labelable element is moved to outside of associated label."); + + async_test(function () { + var labels = document.getElementById("test13").labels; + assert_true(labels instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_equals(labels.length, 1, + "The form control has an ancestor with no explicit associated label, and is the first labelable descendant."); + assert_array_equals(labels, [document.getElementById("lbl13")], + "The labels for a form control should be returned in tree order."); + let iframe = document.createElement('iframe'); + + iframe.onload = this.step_func_done(() => { + iframe.contentWindow.document.getElementById("div1").appendChild(document.getElementById("p1")); + assert_equals(labels.length, 2, + "The number of labels should be 2 after the labelable element is moved to iframe."); + }); + + iframe.setAttribute('src', 'http://web-platform.test:8000/html/semantics/forms/the-label-element/iframe-label-attributes.html'); + document.body.appendChild(iframe); + }, "A labelable element is moved to iframe."); + + test(function () { + var labels1 = document.getElementById("test14").labels; + var labels2 = document.getElementById("test15").labels; + assert_true(labels1 instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_equals(labels1.length, 1, + "The form control has an ancestor with no explicit associated label, and is the first labelable descendant."); + assert_equals(labels2.length, 1, + "The number of labels associated with a form control should be the number of label elements for which it is a labeled control."); + assert_array_equals(labels1, [document.getElementById("lbl14")], + "The labels for a form control should be returned in tree order."); + + document.getElementById('div6').removeChild(document.getElementById('div7')); + assert_equals(labels1.length, 0, + "The number of labels should be 0 after the labelable element is removed."); + assert_equals(labels2.length, 0, + "The number of labels should be 0 since there is no label with a 'for' attribute associated with this labelable element."); + }, "A div element which contains labelable element is removed."); + + test(function () { + // <label><input id="test16"><label for="test16"></label></label> + var label1 = document.createElement('label'); + label1.innerHTML = "<input id='test16'>"; + var label2 = document.createElement('label'); + label2.htmlFor = "test16"; + label1.appendChild(label2); + + var input = label1.firstChild; + var labels = input.labels; + + assert_equals(labels.length, 2, + "The number of labels associated with a form control should be the number of label elements for which it is a labeled control."); + assert_true(labels instanceof NodeList, + "A form control's 'labels' property should be an instance of a NodeList."); + assert_equals(label1.control, input, "The first labelable descendant of a label element should be its labeled control."); + assert_equals(label2.control, input, "The labeled cotrol should be associated with the control whose ID is equal to the value of the 'for' attribute."); + }, "A labelable element not in a document can label element in the same tree."); + + test(function () { + var isShadowDOMV0; + if ("createShadowRoot" in document.getElementById('content')) { + isShadowDOMV0 = true; + } + var root1; + if (isShadowDOMV0) { + root1 = document.getElementById('content').createShadowRoot(); + } else { + root1 = document.getElementById('content').attachShadow({mode: 'open'}); + } + assert_true(root1 instanceof DocumentFragment, + "ShadowRoot should be an instance of DocumentFragment."); + // <label><input id="shadow1"/></label><div id="div1"></div> + var label1 = document.createElement('label'); + var input1 = document.createElement('input'); + input1.setAttribute("id", "shadow1"); + label1.appendChild(input1); + root1.appendChild(label1); + + var div1 = document.createElement('div'); + label1.appendChild(div1); + // <label for="shadow2"></label><input id="shadow2"/> + var root2; + if (isShadowDOMV0) { + root2 = div1.createShadowRoot(); + } else { + root2 = div1.attachShadow({mode: 'open'}); + } + + assert_true(root2 instanceof DocumentFragment, + "ShadowRoot should be an instance of DocumentFragment."); + var label2 = document.createElement('label'); + label2.setAttribute("for", "shadow2"); + + var input2 = document.createElement('input'); + input2.setAttribute("id", "shadow2"); + root2.appendChild(label2); + root2.appendChild(input2); + + assert_equals(root1.getElementById("shadow1").labels.length, 1, + "The form control has an ancestor with no explicit associated label, and it is the first labelable descendant."); + assert_equals(root2.getElementById("shadow2").labels.length, 1, + "The number of labels should be 1 since there is a label with a 'for' attribute associated with this labelable element."); + }, "A labelable element inside the shadow DOM."); + + test(function () { var labels = document.getElementById("test3").labels; assert_true(labels instanceof NodeList, "A form control's 'labels' property should be an instance of a NodeList."); assert_equals(labels.length, 1, "The form control has an ancestor with no explicit associated label, and is the first labelable descendant."); diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-suspended.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-suspended.html new file mode 100644 index 000000000..6040de922 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-suspended.html @@ -0,0 +1,93 @@ +<!doctype html> +<meta charset=utf-8> +<title>Dispatching idle callbacks should be able to be suspended and then resumed</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id="log"></div> +<script> + function withEventListener(target, event, handler) { + handler = handler || (e => e); + return new Promise(resolve => { + let wrapper = function(e) { + let result = handler(e); + if (!result) { + return; + } + + resolve(result); + } + target.addEventListener(event, wrapper, { once: true }); + }); + } + + function makePostBackUrl(name) { + return new URL('resources/post_name_on_load.html?name=' + name, + window.location).href; + } + + function waitForMessage(message, handler) { + return withEventListener(window, 'message', e => (e.data === message) && handler(e));; + } + + function withWindow(name) { + let win = window.open(makePostBackUrl(name)) + return waitForMessage(name, _ => win); + } + + function navigateWindow(win, name) { + win.location = makePostBackUrl(name); + return waitForMessage(name, _ => win); + } + + function waitDuration(delay) { + return new Promise(resolve => { + setTimeout(resolve, delay); + }) + } + + function goBack(win) { + var p = withEventListener(win, 'pagehide'); + win.history.back(); + return p; + } + + promise_test(t => { + let idleCalled = false; + let running = true; + return withWindow('foo') + .then(win => { + let callback = function(d) { + idleCalled = true; + if (running) { + win.requestIdleCallback(callback); + } + }; + + win.requestIdleCallback(callback); + + return navigateWindow(win, 'bar') + .then(_ => idleCalled = false) + .then(_ => waitDuration(2000)) + .then(_ => { + assert_false(idleCalled, "idle callback shouldn't have been called yet"); + return goBack(win); + }) + .then(_ => Promise.race([ + // At this point it's a matter of having bfcache ... + waitDuration(2000) + .then(_ => { + assert_true(idleCalled, "idle callback should've been called by now"); + running = false; + }), + // ... or not. If not, we expect a load event. + waitForMessage("foo") + ])) + .then(_ => win.close()) + .catch(e => { + win.close(); + throw e; + }) + }); + }); + +</script> diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html index 823d5f5db..cc2660a19 100644 --- a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html @@ -25,4 +25,19 @@ } window.requestIdleCallback(t.step_func(f)); }, "requestIdleCallback callback should time out"); + + async_test(function (t) { + assert_false(document.hidden, "document.hidden must exist and be false to run this test properly"); + function g(deadline) { + assert_false(deadline.didTimeout) + t.done(); + } + + function f(deadline) { + assert_false(deadline.didTimeout); + window.requestIdleCallback(t.step_func(g), {timeout:100000}); + } + window.requestIdleCallback(t.step_func(f)); + }, "requestIdleCallback callback should not time out"); + </script> diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html index 8956b8709..9fb77d65d 100644 --- a/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html @@ -23,4 +23,10 @@ t.done(); }, 2000); }, "A cancelled callback is never invoked"); + + async_test(function (t) { + var handle = requestIdleCallback(t.step_func_done(function () { + cancelIdleCallback(handle); + })); + }, "Cancelling the currently executing idle callback should be allowed"); </script> diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/resources/post_name_on_load.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/resources/post_name_on_load.html new file mode 100644 index 000000000..4679a6e6e --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/resources/post_name_on_load.html @@ -0,0 +1,7 @@ +<!doctype html> +<script> + addEventListener('load', _ => { + let params = new URLSearchParams(window.location.search); + window.opener.postMessage(params.get('name'), '*'); + }); +</script> diff --git a/testing/web-platform/tests/page-visibility/idlharness.html b/testing/web-platform/tests/page-visibility/idlharness.html index c8086a1bc..257546080 100644 --- a/testing/web-platform/tests/page-visibility/idlharness.html +++ b/testing/web-platform/tests/page-visibility/idlharness.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>Page Visibility IDL tests</title> <link rel="author" title="W3C" href="http://www.w3.org/" /> -<link rel="help" href="http://www.w3.org/TR/page-visibility/#sec-document-interface"/> +<link rel="help" href="https://w3c.github.io/page-visibility/"/> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> @@ -16,6 +16,10 @@ <pre id='untested_idl' style='display:none'> interface Document { }; + +[TreatNonObjectAsNull] +callback EventHandlerNonNull = any (Event event); +typedef EventHandlerNonNull? EventHandler; </pre> <pre id='idl'> diff --git a/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm b/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm index 647a8b81e..d57dc29d5 100644 --- a/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm +++ b/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm @@ -8,7 +8,7 @@ async_test(function(t) { try { var w = new Worker("ftp://example.org/support/WorkerBasic.js"); w.onerror = t.step_func_done(function(e) { - assert_true(e instanceof ErrorEvent); + assert_true(e instanceof Event); }); } catch (e) { t.step_func_done(function(e) { assert_true(true); }); diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html index 2e0dd8db3..78d53164e 100644 --- a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html @@ -16,7 +16,7 @@ function testSharedWorkerHelper(t, script) { try { var worker = new SharedWorker(script, ''); worker.onerror = t.step_func_done(function(e) { - assert_true(e instanceof ErrorEvent); + assert_true(e instanceof Event); }); } catch (e) { t.step_func_done(function(e) { assert_true(true); }); diff --git a/testing/web-platform/tests/workers/constructors/Worker/same-origin.html b/testing/web-platform/tests/workers/constructors/Worker/same-origin.html index 9b0148da3..bbc4382d0 100644 --- a/testing/web-platform/tests/workers/constructors/Worker/same-origin.html +++ b/testing/web-platform/tests/workers/constructors/Worker/same-origin.html @@ -14,7 +14,7 @@ function testSharedWorkerHelper(t, script) { try { var worker = new SharedWorker(script, ''); worker.onerror = t.step_func_done(function(e) { - assert_true(e instanceof ErrorEvent); + assert_true(e instanceof Event); }); } catch (e) { t.step_func_done(function(e) { assert_true(true); }); |