Update web-platform-tests to revision 3b3585e368841b77caea8576fa56cef91c3fbdf0

This commit is contained in:
Ms2ger 2016-09-26 10:52:50 +02:00
parent d00639c55f
commit 3b4f0ec0bb
541 changed files with 14609 additions and 3288 deletions

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>Historical style element features should not be supported</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
function t(property) {
test(function() {
assert_false(property in document.createElement('style'));
}, 'style.' + property + ' should not be supported');
}
// added in https://github.com/whatwg/html/commit/29cf39d2163cfc85b67409f4e10390619ffb2b40
// removed in https://github.com/whatwg/html/commit/c2a3b2a2e3db49c14b486a5e99acf7d10cfe8443
t('scoped');
</script>

View file

@ -1,42 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Test: The scoped attribute must apply the style information only to its parent element</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-scoped">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#test {
width: 50px;
}
</style>
</head>
<body>
<div id="log"></div>
<div id="test"></div>
<div>
<style id="style">
#test {
width: 100px;
}
</style>
<div>
<script>
test(function() {
var testElement = document.getElementById("test");
var style = document.getElementById("style");
var width1, width2;
width1 = window.getComputedStyle(testElement, false)["width"];
assert_equals(width1, "100px", "The style 'width' should be applied.");
style.scoped = true;
width2 = window.getComputedStyle(testElement, false)["width"];
assert_equals(width2, "50px", "The width should not be applied.");
}, "The scoped attribute is present, the style information must be applied only to its parent element");
</script>
</body>
</html>

View file

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Audio Test: audio_loop_current_media_controller</title>
<link rel="author" title="Intel" href="http://www.intel.com" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-loop" />
<meta name="flags" content="" />
<meta name="assert" content="Check if the audio element has a current media controller that expecting the loop attribute has no effect" />
<script src="/common/media.js"></script>
</head>
<body>
<p>Test passes if the audio doesn't repeatly play and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
<audio id="m" controls loop mediagroup="movie">The user agent doesn't support media element.</audio>
<script type="text/javascript">
var media = document.getElementById("m");
var controller = new MediaController();
media.controller = controller;
media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
media.play();
</script>
</body>
</html>

View file

@ -42,4 +42,12 @@ test(function() {
new TextTrackCue(0, 0, '');
});
}, 'TextTrackCue constructor should not be supported');
// added in https://github.com/whatwg/html/commit/66c5b32240c202c74f475872e7ea2cd163777b4a
// removed in https://github.com/whatwg/html/commit/634698e70ea4586d58c989fa7d2cbfcad20d33e6
t('mediaGroup');
t('controller');
test(function() {
assert_false('MediaController' in window);
}, 'MediaController constructor should not be supported');
</script>

View file

@ -5,73 +5,39 @@
<div id=log></div>
<script>
test(function(){
var track = document.createElement('track');
assert_equals(track.src, '');
assert_equals(track.getAttribute('src'), null);
var track = document.createElement('track');
assert_equals(track.src, '');
assert_equals(track.getAttribute('src'), null);
}, document.title + ' missing value');
test(function(){
var track = document.createElement('track');
track.setAttribute('src', '');
assert_equals(track.src, '');
assert_equals(track.getAttribute('src'), '');
}, document.title + ' empty string in content attribute');
function resolve(url) {
var link = document.createElement('a');
link.setAttribute('href', url);
return link.href;
}
test(function(){
var track = document.createElement('track');
track.src = '';
assert_equals(track.src, '');
assert_equals(track.getAttribute('src'), '');
}, document.title + ' empty string in IDL attribute');
var tests = [
{input:'', expectedIDL:resolve(''), desc:'empty string'},
{input:'http://foo bar', expectedIDL:'http://foo bar', desc:'unresolvable value'},
{input:'test', expectedIDL:resolve('test'), desc:'resolvable value'},
// Leading and trailing C0 controls and space is stripped per url spec.
{input:'\u0000', expectedIDL:resolve(''), desc:'\\u0000'},
{input:'foo\u0000bar', expectedIDL:resolve('foo%00bar'), desc:'foo\\u0000bar'},
];
test(function(){
var track = document.createElement('track');
track.setAttribute('src', 'http://foo bar');
assert_equals(track.src, 'http://foo bar');
assert_equals(track.getAttribute('src'), 'http://foo bar');
}, document.title + ' unresolvable value in content attribute');
test(function(){
var track = document.createElement('track');
track.setAttribute('src', 'test');
var link = document.createElement('a');
link.setAttribute('href', 'test');
assert_equals(track.src, link.href);
assert_equals(track.getAttribute('src'), 'test');
}, document.title + ' resolvable value in content attribute');
test(function(){
var track = document.createElement('track');
track.setAttribute('src', '\u0000');
var link = document.createElement('a');
link.setAttribute('href', '%00');
assert_equals(track.src, link.href);
assert_equals(track.getAttribute('src'), '\u0000');
}, document.title + ' \\u0000 in content attribute');
test(function(){
var track = document.createElement('track');
track.src = 'http://foo bar';
assert_equals(track.src, 'http://foo bar');
assert_equals(track.getAttribute('src'), 'http://foo bar');
}, document.title + ' assigning unresolvable value to IDL attribute');
test(function(){
var track = document.createElement('track');
track.src = 'test';
var link = document.createElement('a');
link.setAttribute('href', 'test');
assert_equals(track.src, link.href);
assert_equals(track.getAttribute('src'), 'test');
}, document.title + ' assigning resolvable value to IDL attribute');
test(function(){
var track = document.createElement('track');
track.src = '\u0000';
var link = document.createElement('a');
link.setAttribute('href', '%00');
assert_equals(track.src, link.href);
assert_equals(track.getAttribute('src'), '\u0000');
}, document.title + ' assigning \\u0000 to IDL attribute');
tests.forEach(function(t) {
test(function(){
var track = document.createElement('track');
track.setAttribute('src', t.input);
assert_equals(track.src, t.expectedIDL);
assert_equals(track.getAttribute('src'), t.input);
}, [document.title, t.desc, 'in content attribute'].join(' '));
test(function(){
var track = document.createElement('track');
track.src = t.input;
assert_equals(track.src, t.expectedIDL);
assert_equals(track.getAttribute('src'), t.input);
}, [document.title, 'assigning', t.desc, 'to IDL attribute'].join(' '));
});
</script>

View file

@ -10,14 +10,6 @@ test(function() {
assert_equals(v.currentTime, 0);
}, 'currentTime initial value');
test(function() {
var v = document.createElement('video');
v.controller = new MediaController();
assert_true(v.controller instanceof MediaController);
assert_throws('InvalidStateError', function() { v.currentTime = 1; });
assert_false(v.seeking);
}, 'setting currentTime with a media controller present');
test(function() {
var v = document.createElement('video');
assert_equals(v.readyState, v.HAVE_NOTHING);

View file

@ -1,27 +0,0 @@
<!doctype html>
<title>MediaController events task source</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function(t) {
// Both MediaControllers should use the DOM manipulation task source, so the
// events should fire in the same order as the attributes are modified.
var mc1 = new MediaController();
var mc2 = new MediaController();
mc1.volume = 0;
mc2.volume = 0;
mc1.volume = 1;
mc2.volume = 1;
var targets = [];
var callback = t.step_func(function(event) {
targets.push(event.target);
if (targets.length == 4) {
assert_array_equals(targets, [mc1, mc2, mc1, mc2]);
t.done();
}
});
mc1.addEventListener('volumechange', callback);
mc2.addEventListener('volumechange', callback);
});
</script>

View file

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Video Test: video_loop_current_media_controller</title>
<link rel="author" title="Intel" href="http://www.intel.com" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-loop" />
<meta name="flags" content="" />
<meta name="assert" content="Check if the video element has a current media controller that expecting the loop attribute has no effect" />
<script src="/common/media.js"></script>
</head>
<body>
<p>Test passes if the video doesn't repeatly play and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
<video id="m" controls loop mediagroup="movie">The user agent doesn't support media element.</video>
<script type="text/javascript">
var media = document.getElementById("m");
var controller = new MediaController();
media.controller = controller;
media.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
media.play();
</script>
</body>
</html>

View file

@ -20,6 +20,9 @@ var tests = [
{desc: 'empty string', shape: 'default', coords: "", hit: hitAll},
{desc: 'omitted coords', shape: 'DEFAULT', coords: null, hit: hitAll},
{desc: 'simple', shape: 'rect', coords: "2,2,10,10", hit: hitRect},
{desc: 'simple', shape: 'rectangle', coords: "2,2,10,10", hit: hitRect},
{desc: 'simple', shape: 'circle', coords: "20,40,10", hit: hitCircle},
{desc: 'simple', shape: 'circ', coords: "20,40,10", hit: hitCircle},
{desc: 'simple', shape: 'CIRCLE', coords: "20,40,10", hit: hitCircle},

View file

@ -5,13 +5,73 @@
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
var canvas;
var canvas, context;
setup(function() {
canvas = document.createElement("canvas");
context = canvas.getContext('2d');
path2d = new Path2D();
});
["supportsContext", "probablySupportsContext"].forEach(function(m) {
function t(member, obj) {
var name = obj === canvas ? "Canvas" : String(obj).match(/\[object (\S+)\]/)[1];
test(function() {
assert_false(m in canvas);
}, "Canvas support for " + m);
});
assert_false(member in obj);
}, name + " support for " + member);
}
// added in https://github.com/whatwg/html/commit/0ecbf0e010df16d9c6d11eef6b2c58419158c4da
// renamed in https://github.com/whatwg/html/commit/2542a12cb25ee93534cbed1f31b5e1bc05fcdd0e
t("supportsContext", canvas);
// removed in https://github.com/whatwg/html/commit/2cfb8e3f03d3166842d2ad0f661459d26e2a40eb
t("probablySupportsContext", canvas);
// removed in https://github.com/whatwg/html/commit/ef72f55da4acdf266174225c6ca8bf2a650d0219
t("width", context);
t("height", context);
// removed in https://github.com/whatwg/html/commit/740634d0f30a3b76e9da166ac2fa8835fcc073ab
t("setContext", canvas);
t("transferControlToProxy", canvas);
t("CanvasProxy", window);
t("commit", canvas);
test(function() {
assert_throws(new TypeError(), function() {
new CanvasRenderingContext2D();
}, 'no arguments');
assert_throws(new TypeError(), function() {
new CanvasRenderingContext2D(1, 1);
}, 'with arguments');
}, "CanvasRenderingContext2D constructors");
// removed in https://github.com/whatwg/html/commit/e1d04f49a38e2254a783c28987457a95a47d9511
t("addPathByStrokingPath", path2d);
t("addText", path2d);
t("addPathByStrokingText", path2d);
// renamed in https://github.com/whatwg/html/commit/fcb0756dd94d96df9b8355741d82fcd5ca0a6154
test(function() {
var canvas = document.createElement('canvas');
var context = canvas.getContext('bitmaprenderer');
if (context) {
assert_false('transferImageBitmap' in context);
}
}, 'ImageBitmapRenderingContext support for transferImageBitmap');
// renamed in https://github.com/whatwg/html/commit/3aec2a7e04a3402201afd29c224b57fa54497517
t('Path', window);
// removed in https://github.com/whatwg/html/commit/d5759b0435091e4858c9bff90319cbe5b040eda2
t('toDataURLHD', canvas);
t('toBlobHD', canvas);
t('createImageDataHD', context);
t('getImageDataHD', context);
t('putImageDataHD', context);
test(function() {
if ('ImageData' in window) {
assert_false('resolution' in new ImageData(1, 1));
}
}, 'ImageData support for resolution');
// dropped/renamed in https://github.com/whatwg/html/commit/ff07c6d630fb986f6c4f64b2fb87387b4f89647d
t('drawSystemFocusRing', context);
t('drawCustomFocusRing', context);
</script>

View file

@ -0,0 +1,16 @@
<!doctype html>
<title>Historical iframe element features should not be supported</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
function t(property) {
test(function() {
assert_false(property in document.createElement('iframe'));
}, 'iframe.' + property + ' should not be supported');
}
// added in https://github.com/whatwg/html/commit/f6490f17f577fa3478791b29ad8c2b586418001f
// removed in https://github.com/whatwg/html/commit/1490eba4dba5ab476f0981443a86c01acae01311
t('seamless');
</script>

View file

@ -44,12 +44,12 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00Z"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},
@ -71,7 +71,7 @@
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01", value: "2001-01"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {step: 3 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},

View file

@ -44,12 +44,12 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00Z"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},
@ -71,7 +71,7 @@
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01", value: "2001-01"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {step: 3 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},

View file

@ -12,20 +12,19 @@
var testElements = [
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {max: "", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The max attribute is not set"},
{conditions: {max: "2000-01-01T12:00:00Z", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {max: "2000-01-01 12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] The max attribute is an invalid global date time string"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2000-01-01T11:00:00Z"}, expected: false, name: "[target] The max attribute is greater than the value attribute"},
{conditions: {max: "2000-01-01T23:59:59Z", value: "2001-01-01T24:00:00Z"}, expected: false, name: "[target] The value is an invalid datetime string(hour is greater than 23)"},
{conditions: {max: "1970-01-01T12:00Z", value: "80-01-01T12:00Z"}, expected: false, name: "[target] The value if an invalid date time string(year is two digits)"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T13:00:00Z"}, expected: true, name: "[target] The value is greater than max"},
{conditions: {max: "2000-01-01T12:00:00.1Z", value: "2000-01-01T12:00:00.2Z"}, expected: true, name: "[target] The value is greater than max(with millisecond in 1 digit)"},
{conditions: {max: "2000-01-01T12:00:00.01Z", value: "2000-01-01T12:00:00.02Z"}, expected: true, name: "[target] The value is greater than max(with millisecond in 2 digits)"},
{conditions: {max: "2000-01-01T12:00:00.001Z", value: "2000-01-01T12:00:00.002Z"}, expected: true, name: "[target] The value is greater than max(with millisecond in 3 digits)"},
{conditions: {max: "", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The max attribute is not set"},
{conditions: {max: "2000-01-01T12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {max: "2000-01-01 12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] The max attribute is an invalid local date time string"},
{conditions: {max: "2000-01-01T12:00:00", value: "2000-01-01T11:00:00"}, expected: false, name: "[target] The max attribute is greater than the value attribute"},
{conditions: {max: "2000-01-01T23:59:59", value: "2001-01-01T24:00:00"}, expected: false, name: "[target] The value is an invalid local date time string(hour is greater than 23)"},
{conditions: {max: "1970-01-01T12:00", value: "80-01-01T12:00"}, expected: false, name: "[target] The value if an invalid local date time string(year is two digits)"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T13:00:00"}, expected: true, name: "[target] The value is greater than max"},
{conditions: {max: "2000-01-01T12:00:00.1", value: "2000-01-01T12:00:00.2"}, expected: true, name: "[target] The value is greater than max(with millisecond in 1 digit)"},
{conditions: {max: "2000-01-01T12:00:00.01", value: "2000-01-01T12:00:00.02"}, expected: true, name: "[target] The value is greater than max(with millisecond in 2 digits)"},
{conditions: {max: "2000-01-01T12:00:00.001", value: "2000-01-01T12:00:00.002"}, expected: true, name: "[target] The value is greater than max(with millisecond in 3 digits)"},
{conditions: {max: "2000-01-01T12:00:00", value: "10000-01-01T12:00:00"}, expected: true, name: "[target] The value is greater than max(Year is 10000 should be valid)"},
{conditions: {max: "8592-01-01T02:09+02:09", value: "8593-01-01T02:09+02:09"}, expected: true, name: "[target] The value is greater than max(with timezone)"}
]
},
{

View file

@ -12,20 +12,20 @@
var testElements = [
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {min: "", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The min attribute is not set"},
{conditions: {min: "2000-01-01T12:00:00Z", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {min: "2001-01-01 12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The min attribute is an invalid global date time string"},
{conditions: {min: "2000-01-01T11:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The min attribute is less than the value attribute"},
{conditions: {min: "2001-01-01T23:59:59Z", value: "2000-01-01T24:00:00Z"}, expected: false, name: "[target] The value is an invalid datetime string(hour is greater than 23)"},
{conditions: {min: "1980-01-01T12:00Z", value: "79-01-01T12:00Z"}, expected: false, name: "[target] The value is an invalid date time string(year is two digits)"},
{conditions: {min: "2000-01-01T13:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: true, name: "[target] The value is less than min"},
{conditions: {min: "2000-01-01T12:00:00.2Z", value: "2000-01-01T12:00:00.1Z"}, expected: true, name: "[target] The value is less than min(with millisecond in 1 digit)"},
{conditions: {min: "2000-01-01T12:00:00.02Z", value: "2000-01-01T12:00:00.01Z"}, expected: true, name: "[target] The value is less than min(with millisecond in 2 digits)"},
{conditions: {min: "2000-01-01T12:00:00.002Z", value: "2000-01-01T12:00:00.001Z"}, expected: true, name: "[target] The value is less than min(with millisecond in 3 digits)"},
{conditions: {min: "10000-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: true, name: "[target] The value is less than min(Year is 10000 should be valid)"},
{conditions: {min: "8593-01-01T02:09+02:09", value: "8592-01-01T02:09+02:09"}, expected: true, name: "[target] The value is greater than max(with timezone)"}
{conditions: {min: "", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is not set"},
{conditions: {min: "2000-01-01T12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {min: "2001-01-01 12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is an invalid local date time string"},
{conditions: {min: "2000-01-01T11:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is less than the value attribute"},
{conditions: {min: "2001-01-01T23:59:59", value: "2000-01-01T24:00:00"}, expected: false, name: "[target] The value is an invalid local date time string(hour is greater than 23)"},
{conditions: {min: "1980-01-01T12:00", value: "79-01-01T12:00"}, expected: false, name: "[target] The value is an invalid local date time string(year is two digits)"},
{conditions: {min: "2000-01-01T13:00:00", value: "2000-01-01T12:00:00"}, expected: true, name: "[target] The value is less than min"},
{conditions: {min: "2000-01-01T12:00:00.2", value: "2000-01-01T12:00:00.1"}, expected: true, name: "[target] The value is less than min(with millisecond in 1 digit)"},
{conditions: {min: "2000-01-01T12:00:00.02", value: "2000-01-01T12:00:00.01"}, expected: true, name: "[target] The value is less than min(with millisecond in 2 digits)"},
{conditions: {min: "2000-01-01T12:00:00.002", value: "2000-01-01T12:00:00.001"}, expected: true, name: "[target] The value is less than min(with millisecond in 3 digits)"},
{conditions: {min: "10000-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: true, name: "[target] The value is less than min(Year is 10000 should be valid)"},
{conditions: {max: "8593-01-01T02:09", value: "8592-01-01T02:09"}, expected: false, name: "[target] The value is greater than max"}
]
},
{

View file

@ -11,16 +11,6 @@
<script>
//set step = 2 * default step * factor
var testElements = [
{
tag: "input",
types: ["datetime"],
testData: [
{conditions: {step: "", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The step attribute is not set"},
{conditions: {step: 2 * 60 * 1000, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
{conditions: {step: 2 * 60 * 1000, value: "2000-01-01T12:58Z"}, expected: false, name: "[target] The value must match the step"},
{conditions: {step: 2 * 60 * 1000, value: "2000-01-01T12:59Z"}, expected: true, name: "[target] The value must mismatch the step"}
]
},
{
tag: "input",
types: ["date"],

View file

@ -41,11 +41,11 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
{conditions: {min: "2001-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00Z"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
]
},

View file

@ -21,18 +21,17 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
{conditions: {required: true, value: "2000-12-10T12:00:00Z"}, expected: false, name: "[target] Valid global date and time string(2000-12-10T12:00:00Z)"},
{conditions: {required: true, value: "2000-12-10 12:00Z"}, expected: false, name: "[target] Valid global date and time string(2000-12-10 12:00Z)"},
{conditions: {required: true, value: "1979-10-14T12:00:00.001-04:00"}, expected: false, name: "[target] Valid global date and time string(1979-10-14T12:00:00.001-04:00)"},
{conditions: {required: true, value: "8592-01-01T02:09+02:09"}, expected: false, name: "[target] Valid global date and time string(8592-01-01T02:09+02:09)"},
{conditions: {required: true, value: "2000-12-10T12:00:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10T12:00:00)"},
{conditions: {required: true, value: "2000-12-10 12:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10 12:00)"},
{conditions: {required: true, value: "1979-10-14T12:00:00.001"}, expected: false, name: "[target] Valid local date and time string(1979-10-14T12:00:00.001)"},
{conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
{conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
{conditions: {required: true, value: "1979-10-99 99:99Z"}, expected: true, name: "[target] Invalid global date and time string(1979-10-99 99:99Z)"},
{conditions: {required: true, value: "1979-10-14 12:00:00"}, expected: true, name: "[target] Invalid global date and time string(1979-10-14 12:00:00)"},
{conditions: {required: true, value: "2001-12-21 12:00Z"}, expected: true, name: "[target] Invalid global date and time string(2001-12-21 12:00Z)-two white space"},
{conditions: {required: true, value: "1979-10-99 99:99"}, expected: true, name: "[target] Invalid local date and time string(1979-10-99 99:99)"},
{conditions: {required: true, value: "1979-10-14 12:00:00"}, expected: false, name: "[target] Valid local date and time string(1979-10-14 12:00:00)"},
{conditions: {required: true, value: "2001-12-21 12:00"}, expected: true, name: "[target] Invalid local date and time string(2001-12-21 12:00)-two white space"},
{conditions: {required: true, value: "abc"}, expected: true, name: "[target] the value attribute is a string(abc)"},
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
]

View file

@ -49,7 +49,7 @@
//If the readonly attribute is specified on an INPUT element, the element is barred from constraint validation.
{
tag: "input",
types: ["text", "search", "tel", "url", "email", "password", "datetime", "date", "month", "week", "time", "color", "file", "submit"],
types: ["text", "search", "tel", "url", "email", "password", "datetime-local", "date", "month", "week", "time", "color", "file", "submit"],
testData: [
{conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation if it is disabled"},
{conditions: {disabled: false, readOnly: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},

View file

@ -0,0 +1,85 @@
<!doctype html>
<title>Historical forms features should not be supported</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<form id=form hidden>
<label id=label></label>
<input id=input>
<button id=button></button>
<select id=select>
<optgroup id=optgroup>
<option id=option>
</select>
<datalist id=datalist></datalist>
<textarea id=textarea></textarea>
<progress id=progress></progress>
<meter id=meter></meter>
<fieldset id=fieldset>
<legend id=legend></legend>
</fieldset>
</form>
<form hidden action="isindex-support.txt" target=isindex_iframe id=isindex_form>
<input name=isindex value=x>
<iframe name=isindex_iframe id=isindex_iframe></iframe>
</form>
<script>
var tags = ['form', 'label', 'input', 'button', 'select', 'datalist',
'optgroup', 'option', 'textarea', 'progress', 'meter', 'fieldset', 'legend'];
function t(property, tagName) {
var tagNames = tagName ? [tagName] : tags;
tagNames.forEach(function(tagName) {
test(function() {
assert_false(property in document.getElementById(tagName));
}, tagName + '.' + property + ' should not be supported');
});
}
function inputType(type) {
test(function() {
var input = document.createElement('input');
input.type = type;
assert_equals(input.type, 'text');
}, '<input type=' + type + '> should not be supported');
}
// <input type=range multiple>
// added in https://github.com/whatwg/html/commit/1efac390abb3f95df61f2d2ac6c0feb47349d97b
// removed in https://github.com/whatwg/html/commit/b598d4f873fb8c27d4b23b033837108edfbc3d75
t('valueLow', 'input');
t('valueHigh', 'input');
// requestAutoComplete()
// added in https://github.com/whatwg/html/commit/321659e4db11228857632487ab72b6959db1ba86
// removed in https://github.com/whatwg/html/commit/6a257aae619f85390eee20b47767f34887450fcd
t('requestAutocomplete', 'form');
t('onautocomplete', 'form');
t('onautocompleteerror', 'form');
// <input type=datetime>
// added in WF2
// removed in https://github.com/whatwg/html/commit/80ba4fa24e5d3d81a10aa1bbd8a2f72f4bcc3f7c
inputType('datetime');
// <progress form>, <meter form>
// removed in https://github.com/whatwg/html/commit/3814376a311837ddfac229d9a631cd10adf53157
t('form', 'progress');
t('form', 'meter');
// form.item(), form.namedItem()
// removed in https://github.com/whatwg/html/commit/da87ab9009d5aeca95a602e718439e35b00d0731
t('item', 'form');
t('namedItem', 'form');
// <input name=isindex>
// removed in https://github.com/whatwg/html/commit/5c44abc734eb483f9a7ec79da5844d2fe63d9c3b
async_test(function() {
var iframe = document.getElementById('isindex_iframe');
iframe.onload = this.step_func_done(function() {
assert_regexp_match(iframe.contentWindow.location.href, /\?isindex=x$/);
});
document.getElementById('isindex_form').submit();
}, '<input name=isindex> should not be supported');
</script>

View file

@ -7,7 +7,7 @@
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var types = ["hidden", "email", "datetime", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; //types for which the API doesn't apply
var types = ["hidden", "email", "datetime-local", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; //types for which the API doesn't apply
var types2 = ["text", "search", "tel", "url", "password"]; //types for which the API applies
types.forEach(function(type){

View file

@ -30,7 +30,7 @@
t5 = async_test("canceled activation steps on unchecked checkbox"),
t6 = async_test("canceled activation steps on unchecked checkbox (indeterminate=true in onclick)");
checkbox1.onclick = t1.step_func(function () {
checkbox1.onclick = t1.step_func(function(e) {
c1_click_fired = true;
assert_false(c1_input_fired, "click event should fire before input event");
assert_false(c1_change_fired, "click event should fire before change event");

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cloning of input elements</title>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone-ext">
<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#the-input-element:concept-node-clone-ext">
<link rel="author" title="Matthew Phillips" href="mailto:matthew@matthewphillips.info">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(function() {
var input = document.createElement("input");
input.value = "foo bar";
var copy = input.cloneNode();
assert_equals(copy.value, "foo bar");
}, "input element's value should be cloned");
test(function() {
var input = document.createElement("input");
input.value = "foo bar";
var copy = input.cloneNode();
copy.setAttribute("value", "something else");
assert_equals(copy.value, "foo bar");
}, "input element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned input's value");
test(function() {
var input = document.createElement("input");
input.setAttribute("type", "radio");
input.checked = true;
var copy = input.cloneNode();
assert_equals(copy.checked, true);
}, "input element's checkedness should be cloned");
test(function() {
var input = document.createElement("input");
input.setAttribute("type", "radio");
input.checked = false;
var copy = input.cloneNode();
copy.setAttribute("checked", "checked");
assert_equals(copy.checked, false);
}, "input element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness");
</script>

View file

@ -1,45 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Form input type=datetime</title>
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/common-microsyntaxes.html#global-dates-and-times">
<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/states-of-the-type-attribute.html#local-date-and-time-state-(type=datetime)">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var datetime = [
// valid values
{value: "", expected: "", testname: "empty value"},
{value: "2014-01-01T11:11Z", expected: "2014-01-01T11:11Z", testname: "datetime input value set to 2014-01-01T11:11Z without min/max"},
{value: "2014-01-01 11:11Z", expected: "2014-01-01T11:11Z", testname: "datetime input value set to 2014-01-01 11:11Z without min/max"},
{value: "2014-01-01 11:11-04:00", expected: "2014-01-01T15:11Z", testname: "datetime input value set to 2014-01-01 11:11-04:00 without min/max"},
{value: "2014-01-01 11:11-0400", expected: "2014-01-01T15:11Z", testname: "datetime input value set to 2014-01-01 11:11-0400 without min/max"},
{value: "2014-01-01 11:11:00.000-04:00", expected: "2014-01-01T15:11Z", testname: "datetime input value set to 2014-01-01 11:11:00.000-04:00 without min/max"},
// invalid values
{value: "2014-01-01 11:11:00.000Z", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000Z without min/max"},
{value: "2014-01-01 11:11:00.000", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000 without min/max"},
{value: "2014-01-01 11:11:00.000+", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000+ without min/max"},
{value: "2014-01-01 11:11:00.000+24", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000+24 without min/max"},
{value: "2014-01-01 11:11:00.000+2360", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000+2360 without min/max"},
{value: "2014-01-0 11:11:00.000+0400", expected: "", testname: "datetime input value set to 2014-01-0 11:11:00.000+0400 without min/max"},
{value: "2014-01-01 11:1:00.000+0400", expected: "", testname: "datetime input value set to 2014-01-01 11:1:00.000+0400 without min/max"},
// min/max
{value: "2014-01-01 11:11Z", attributes: { min: "2014-01-01T11:10Z" }, expected: "2014-01-01T11:11Z", testname: "Value >= min attribute"},
{value: "2014-01-01 11:10Z", attributes: { min: "2014-01-01T11:11Z" }, expected: "2014-01-01T11:11Z", testname: "Value < min attribute"},
{value: "2014-01-01 11:10Z", attributes: { max: "2014-01-01T11:11Z" }, expected: "2014-01-01T11:11Z", testname: "Value <= max attribute"},
{value: "2014-01-01 11:11Z", attributes: { max: "2014-01-01T11:10Z" }, expected: "2014-01-01T11:10Z", testname: "Value > max attribute"}
];
for (var i = 0; i < datetime.length; i++) {
var w = datetime[i];
test(function() {
var input = document.createElement("input");
input.type = "datetime";
input.value = w.value;
for(var attr in w.attributes) {
input[attr] = w.attributes[attr];
}
assert_equals(input.value, w.expected);
}, w.testname);
}
</script>

View file

@ -13,7 +13,6 @@ var types = [
"url",
"email",
"password",
"datetime",
"date",
"month",
"week",

View file

@ -14,16 +14,10 @@
<h1>Inputs Month</h1>
<div style="display: none">
<input id="valid" type="month" value="2011-11" min="2011-01" max="2011-12" />
<input id="too_small_value" type="month" value="1999-01" min="2011-01" max="2011-12"/>
<input id="too_large_value" type="month" value="2099-01" min="2011-01" max="2011-12"/>
<input id="invalid_value" type="month" value="invalid-month" min="2011-01" max="2011-12"/>
<input id="invalid_min" type="month" value="2011-01" min="invalid_min" max="2011-12"/>
<input id="invalid_max" type="month" value="2011-01" min="2011-01" max="invalid_max"/>
<input id="min_larger_than_max" type="month" value="2011-01" min="2099-01" max="2011-12"/>
<input id="value_can_be_empty_string" type="month" value="2013-06" />
<input id="invalid_value_with_two_digits_year" type="month" value="13-06" />
<input id="invalid_value_is_set" type="month" />
<input id="invalid_value_is_set_to_valid_value" type="month" value="2013-05" />
<input id="step_attribute_is_invalid_value" type="month" value="2013-06" step="invalid_step_value" />
<input id="invalid_month_too_high" type="month" value="2013-13" />
<input id="invalid_month_too_low" type="month" value="2013-00" />
@ -36,23 +30,6 @@
assert_equals(document.getElementById("valid").type, "month")
}, "month type support on input element");
test(function() {
assert_equals(document.getElementById("valid").value, "2011-11"),
assert_equals(document.getElementById("too_small_value").value, "2011-01"),
assert_equals(document.getElementById("too_large_value").value, "2011-12")
}, "The value attribute, if specified and not empty, must have a value that is a valid month string");
test(function() {
assert_equals(document.getElementById("valid").min, "2011-01"),
assert_equals(document.getElementById("invalid_min").min, "")
}, "The min attribute, if specified, must have a value that is a valid month string.");
test(function() {
assert_equals(document.getElementById("valid").max, "2011-12"),
assert_equals(document.getElementById("min_larger_than_max").max, "2099-01"),
assert_equals(document.getElementById("invalid_max").max, "")
}, "The max attribute, if specified, must have a value that is a valid month string");
test(function() {
assert_equals(document.getElementById("invalid_value").value, "")
}, "User agents must not allow the user to set the value to a non-empty string that is not a valid month string.");
@ -71,11 +48,6 @@
assert_equals(document.getElementById("invalid_value_is_set").value, "")
}, "When value is set with invalid value, the value must return empty string.");
test(function() {
document.getElementById("invalid_value_is_set_to_valid_value").value = "invalid value";
assert_equals(document.getElementById("invalid_value_is_set_to_valid_value").value, "2013-05")
}, "When value is given invalid value to non-empty valid string, the value must be same as before.");
test(function() {
document.getElementById("step_attribute_is_invalid_value").stepUp();
assert_equals(document.getElementById("step_attribute_is_invalid_value").value, "2013-07")

View file

@ -15,7 +15,7 @@
{ type: "url", sanitizedValue: "foobar" },
{ type: "email", sanitizedValue: "foobar" },
{ type: "password", sanitizedValue: " foobar " },
{ type: "datetime", sanitizedValue: "" },
{ type: "datetime-local", sanitizedValue: "" },
{ type: "date", sanitizedValue: "" },
{ type: "month", sanitizedValue: "" },
{ type: "week", sanitizedValue: "" },

View file

@ -14,7 +14,7 @@
{ type: "url", mode: "value", sanitizedValue: "foo" },
{ type: "email", mode: "value", sanitizedValue: "foo" },
{ type: "password", mode: "value", sanitizedValue: "foo" },
{ type: "datetime", mode: "value", sanitizedValue: "" },
{ type: "datetime-local", mode: "value", sanitizedValue: "" },
{ type: "date", mode: "value", sanitizedValue: "" },
{ type: "month", mode: "value", sanitizedValue: "" },
{ type: "week", mode: "value", sanitizedValue: "" },

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cloning of textarea elements</title>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone-ext">
<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#the-textarea-element:concept-node-clone-ext">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(function() {
var textarea = document.createElement("textarea");
textarea.value = "foo bar";
var copy = textarea.cloneNode();
assert_equals(copy.value, "foo bar");
}, "textarea element's value should be cloned");
test(function() {
var textarea = document.createElement("textarea");
textarea.value = "foo bar";
var copy = textarea.cloneNode();
copy.setAttribute("value", "something else");
assert_equals(copy.value, "foo bar");
}, "textarea element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned textarea's value");
</script>

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<title>Dynamic manipulation of textarea.wrap</title>
<link rel=match href=wrap-reflect-1-ref.html>
<link rel=help href=https://html.spec.whatwg.org/multipage/#dom-textarea-wrap>
<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<title>Dynamic manipulation of textarea.wrap</title>
<link rel=match href=wrap-reflect-1-ref.html>
<link rel=help href=https://html.spec.whatwg.org/multipage/#dom-textarea-wrap>
<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>

View file

@ -0,0 +1,53 @@
<!doctype html>
<title>Historical script element features should not be supported</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
function t(property) {
test(function() {
assert_false(property in document.createElement('script'));
}, 'script.' + property + ' should not be supported');
}
// added in https://github.com/whatwg/html/commit/69f83cf2eacf4543860ccb7abab0ff5bb1e8b594
// removed in https://github.com/whatwg/html/commit/1a0b5e8377d59462e05a5cffda4b8592324a2785
t('onbeforescriptexecute');
t('onafterscriptexecute');
var t_onbeforescriptexecute_attr = async_test('onbeforescriptexecute content attribute should not be supported');
var t_onafterscriptexecute_attr = async_test('onafterscriptexecute content attribute should not be supported');
var t_beforescriptexecute_event = async_test(function() {
addEventListener('beforescriptexecute', this.step_func(function() {
assert_unreached();
}), true);
}, 'beforescriptexecute event should not be supported');
var t_afterscriptexecute_event = async_test(function() {
addEventListener('afterscriptexecute', this.step_func(function() {
assert_unreached();
}), true);
}, 'afterscriptexecute event should not be supported');
var a = false;
onload = function() {
t_onbeforescriptexecute_attr.step(function() {
assert_true(a);
this.done();
});
t_onafterscriptexecute_attr.step(function() {
assert_true(a);
this.done();
});
t_beforescriptexecute_event.step(function() {
assert_true(a);
this.done();
});
t_afterscriptexecute_event.step(function() {
assert_true(a);
this.done();
});
};
</script>
<script onbeforescriptexecute="t_onbeforescriptexecute_attr.step(function() { assert_unreached(); });"
onafterscriptexecute="t_onafterscriptexecute_attr.step(function() { assert_unreached(); });">
a = true;
</script>

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script>
"use strict";
async_test(function(t) {
window.scriptExecuting = function () {
setTimeout(t.step_func_done(() => {
assert_equals(window.onloadHappened, undefined);
}), 0);
};
}, "load events should not be fired for inline scripts");
</script>
<script onload="window.onloadHappened = true;">
"use strict";
window.scriptExecuting();
</script>

View file

@ -1,55 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>script beforescriptexecute/afterscriptexecute events</title>
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/#the-script-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var t1 = async_test("'beforescriptexecute'/'afterscriptexecute' events have been fired"),
t2 = async_test("default prevented 'beforescriptexecute' event aborts script execution"),
a = false,
b = false;
var before = function(e) {
b = true;
test(function(){
assert_true(e.isTrusted);
assert_true(e.bubbles);
assert_true(e.cancelable);
}, "'beforescriptexecute' event is trusted, bubbles and is cancelable");
};
var after = function(e) {
a = true;
test(function(){
assert_true(e.isTrusted);
assert_true(e.bubbles);
assert_false(e.cancelable);
}, "'afterscriptexecute' event is trusted, bubbles and isn't cancelable");
};
var prevent_default = function(e) {
t2.step(function() {
e.preventDefault();
assert_true(e.defaultPrevented);
});
};
document.body.onload = function() {
t1.step(function() {
assert_true(a && b);
});
t1.done();
t2.done();
};
</script>
<script onbeforescriptexecute=before(event) onafterscriptexecute=after(event)>
document.querySelector("script");
</script>
<script onbeforescriptexecute=prevent_default(event)>
t2.step(function() {
assert_unreached("script execution not aborted by default prevented 'beforescriptexecute' event");
});
</script>

View file

@ -0,0 +1,25 @@
<!doctype html>
<title>Historical table features should not be supported</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
function t(property, tagNames) {
if (typeof tagNames === "string") {
tagNames = [tagNames];
}
tagNames.forEach(function(tagName) {
test(function() {
assert_false(property in document.createElement(tagName));
}, tagName + '.' + property + ' should not be supported');
});
}
// added in https://github.com/whatwg/html/commit/6db0d8d4e3456140de958c963afe9bb9ec7b6a25
// removed in https://github.com/whatwg/html/commit/59b7e2466c2b7c5c408a4963b05b13fd808aa07a
t('onsort', 'table');
t('sortable', 'table');
t('stopSorting', 'table');
t('sorted', 'th');
t('sort', 'th');
</script>

View file

@ -0,0 +1,32 @@
<!doctype html>
<title>Historical text-level element features should not be supported</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
function t(property, tagNames) {
if (typeof tagNames === "string") {
tagNames = [tagNames];
}
tagNames.forEach(function(tagName) {
test(function() {
assert_false(property in document.createElement(tagName));
}, tagName + '.' + property + ' should not be supported');
});
}
// <area> and <link> are in other sections in the spec, but we'll test them here together with <a>
// removed in https://github.com/whatwg/html/commit/790479ab1ba143efc27d1f92cd0465627df48fb0
t('hreflang', 'area');
t('type', 'area');
// renamed to dateTime in https://github.com/whatwg/html/commit/8b6732237c7021cd61e3c3463146234ca8ce5bad
t('datetime', 'time');
// removed in https://github.com/whatwg/html/commit/66fcb2357f205448fe2f40d7834a1e8ea2ed283b
t('media', ['a', 'area']);
// renamed to noreferrer in https://github.com/whatwg/html/commit/6a34274e99593e767ae99744a6c38a19489915c6
t('noreferer', ['link', 'a', 'area']);
</script>