mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
|
@ -13,12 +13,13 @@ test(function(){
|
|||
assert_equals(ev.track, null, 'ev.track after assignment');
|
||||
}, document.title+', one arg');
|
||||
test(function(){
|
||||
var obj = {};
|
||||
var ev = new TrackEvent('foo', {track:obj});
|
||||
var video = document.createElement('video');
|
||||
var testTrack = video.addTextTrack('subtitles', 'foo', 'foo');
|
||||
var ev = new TrackEvent('foo', {track: testTrack});
|
||||
assert_true(ev instanceof TrackEvent, 'ev instanceof TrackEvent');
|
||||
assert_true(ev instanceof Event, 'ev instanceof Event');
|
||||
assert_equals(ev.track, obj, 'ev.track');
|
||||
assert_equals(ev.track, testTrack, 'ev.track');
|
||||
ev.track = {};
|
||||
assert_equals(ev.track, obj, 'ev.track after assignment');
|
||||
assert_equals(ev.track, testTrack, 'ev.track after assignment');
|
||||
}, document.title+', two args');
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>Historical embed element features should not be supported</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<embed id=embed>
|
||||
<script>
|
||||
test(function() {
|
||||
var elm = document.getElementById('embed');
|
||||
assert_equals(typeof elm, 'object', 'typeof');
|
||||
assert_throws(new TypeError(), function() {
|
||||
elm();
|
||||
});
|
||||
}, 'embed legacycaller should not be supported');
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Append iframe element to its own child document</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<iframe id=x></iframe>
|
||||
<script>
|
||||
test(function() {
|
||||
var iframe = document.getElementById('x');
|
||||
var childWindow = iframe.contentWindow;
|
||||
assert_equals(childWindow.parent, window);
|
||||
childWindow.document.body.appendChild(iframe);
|
||||
assert_equals(childWindow.parent, null);
|
||||
assert_equals(iframe.contentWindow, null);
|
||||
assert_equals(childWindow.document.body.firstChild, iframe);
|
||||
});
|
||||
</script>
|
|
@ -7,9 +7,10 @@
|
|||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<iframe id="testIframe" src="support/sandbox_allow_script.html" sandbox="allow-same-origin" style="display:none"></iframe>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
// Set up all our script stuff before the iframe starts loading, so we don't
|
||||
// miss any messages from it.
|
||||
var step1 = false;
|
||||
var t = async_test("iframe_sandbox_allow_scripts");
|
||||
|
||||
|
@ -35,5 +36,11 @@
|
|||
t.done();
|
||||
}
|
||||
|
||||
setTimeout(run, 500);
|
||||
// Make sure the iframe loads before we mess with it.
|
||||
window.addEventListener("load", function() {
|
||||
// The load event might fire before a message from the child comes in...
|
||||
// Wait a bit to see if that message does come in.
|
||||
setTimeout(run, 500);
|
||||
});
|
||||
</script>
|
||||
<iframe id="testIframe" src="support/sandbox_allow_script.html" sandbox="allow-same-origin" style="display:none"></iframe>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
assert_equals(e.data.origin, ourOrigin, "Should have escaped the sandbox");
|
||||
});
|
||||
|
||||
document.querySelector("iframe").src = "iframe_sandbox_popups_helper.html";
|
||||
document.querySelector("iframe").src = "iframe_sandbox_popups_helper-1.html";
|
||||
});
|
||||
postMessage("hello", "*");
|
||||
</script>
|
|
@ -0,0 +1,31 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Check that popups from a sandboxed iframe escape the sandbox if
|
||||
allow-popups-to-escape-sandbox is used</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<iframe sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox">
|
||||
</iframe>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var ourOrigin;
|
||||
onmessage = t.step_func(function(e) {
|
||||
assert_equals(e.data, "hello", "This is our origin getter message");
|
||||
ourOrigin = e.origin;
|
||||
|
||||
onmessage = t.step_func_done(function(e) {
|
||||
assert_equals(e.origin, "null", "It came from a sandboxed iframe");
|
||||
assert_equals(e.data.data, undefined, "Should have the right message");
|
||||
assert_equals(e.data.origin, ourOrigin, "Should have escaped the sandbox");
|
||||
});
|
||||
|
||||
var iframe = document.querySelector("iframe");
|
||||
iframe.onload = function() {
|
||||
frames[0].postMessage("start", "*");
|
||||
}
|
||||
iframe.src = "iframe_sandbox_popups_helper-2.html";
|
||||
});
|
||||
addEventListener("load", function() {
|
||||
postMessage("hello", "*");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Check that popups from a sandboxed iframe escape the sandbox if
|
||||
allow-popups-to-escape-sandbox is used</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<iframe sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox">
|
||||
</iframe>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var ourOrigin;
|
||||
onmessage = t.step_func(function(e) {
|
||||
assert_equals(e.data, "hello", "This is our origin getter message");
|
||||
ourOrigin = e.origin;
|
||||
|
||||
onmessage = t.step_func_done(function(e) {
|
||||
assert_equals(e.origin, "null", "It came from a sandboxed iframe");
|
||||
assert_equals(e.data.data, undefined, "Should have the right message");
|
||||
assert_equals(e.data.origin, ourOrigin, "Should have escaped the sandbox");
|
||||
});
|
||||
|
||||
document.querySelector("iframe").src = "iframe_sandbox_popups_helper-3.html";
|
||||
});
|
||||
postMessage("hello", "*");
|
||||
</script>
|
|
@ -1,6 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
var popupWin;
|
||||
if (opener) {
|
||||
// We're the popup. Send back our state. What we really want to send is
|
||||
// our origin, but that will come automatically.
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script>
|
||||
if (opener) {
|
||||
// We're the popup. Send back our state. What we really want to send is
|
||||
// our origin, but that will come automatically.
|
||||
opener.postMessage(undefined, "*");
|
||||
self.close();
|
||||
} else {
|
||||
// We're the child. Start listening for messages from our parent and open
|
||||
// ourselves as the popup when we get the "start" message.
|
||||
onmessage = function (e) {
|
||||
if (e.data == "start") {
|
||||
// Now listen for messages from the thing we plan to open.
|
||||
onmessage = function(e) {
|
||||
parent.postMessage({ data: e.data, origin: e.origin }, "*");
|
||||
}
|
||||
|
||||
var a = document.createElement("a");
|
||||
a.href = location.href;
|
||||
a.target = "_blank";
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
if (opener) {
|
||||
// We're the popup. Send back our state. What we really want to send is
|
||||
// our origin, but that will come automatically.
|
||||
opener.postMessage(undefined, "*");
|
||||
self.close();
|
||||
} else {
|
||||
// We're the child. Start listening for messages and open ourselves as the
|
||||
// popup.
|
||||
onmessage = function (e) {
|
||||
parent.postMessage({ data: e.data, origin: e.origin }, "*");
|
||||
};
|
||||
var popupWin = window.open();
|
||||
popupWin.location.href = location.href;
|
||||
}
|
||||
</script>
|
|
@ -12,4 +12,4 @@
|
|||
});
|
||||
</script>
|
||||
<iframe sandbox="allow-scripts allow-popups"
|
||||
src="iframe_sandbox_popups_helper.html"></iframe>
|
||||
src="iframe_sandbox_popups_helper-1.html"></iframe>
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Check that popups from a sandboxed iframe do not escape the sandbox</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
var t = async_test();
|
||||
onmessage = t.step_func_done(function(e) {
|
||||
assert_equals(e.origin, "null", "It came from a sandboxed iframe");
|
||||
assert_equals(e.data.data, undefined, "Should have the right message");
|
||||
assert_equals(e.data.origin, "null", "Should not have escaped the sandbox");
|
||||
});
|
||||
addEventListener("load", function() {
|
||||
frames[0].postMessage("start", "*");
|
||||
});
|
||||
</script>
|
||||
<iframe sandbox="allow-scripts allow-popups"
|
||||
src="iframe_sandbox_popups_helper-2.html"></iframe>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Check that popups from a sandboxed iframe do not escape the sandbox</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
var t = async_test();
|
||||
onmessage = t.step_func_done(function(e) {
|
||||
assert_equals(e.origin, "null", "It came from a sandboxed iframe");
|
||||
assert_equals(e.data.data, undefined, "Should have the right message");
|
||||
assert_equals(e.data.origin, "null", "Should not have escaped the sandbox");
|
||||
});
|
||||
</script>
|
||||
<iframe sandbox="allow-scripts allow-popups"
|
||||
src="iframe_sandbox_popups_helper-3.html"></iframe>
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>data URL image</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var c = document.createElement("canvas"),
|
||||
con = c.getContext("2d"),
|
||||
img = document.createElement("img")
|
||||
img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAA+UlEQVR4nO3RoRHAQBDEsOu/6YR+B2sgIO4Z3919pMwDMCRtHoAhafMADEmbB2BI2jwAQ9LmARiSNg/AkLR5AIakzQMwJG0egCFp8wAMSZsHYEjaPABD0uYBGJI2D8CQtHkAhqTNAzAkbR6AIWnzAAxJmwdgSNo8AEPS5gEYkjYPwJC0eQCGpM0DMCRtHoAhafMADEmbB2BI2jwAQ9LmARiSNg/AkLR5AIakzQMwJG0egCFp8wAMSZsHYEjaPABD0uYBGJI2D8CQtHkAhqTNAzAkbR6AIWnzAAxJmwdgSNo8AEPS5gEYkjYPwJC0eQCGpM0DMCRtHsDjB5K06yueJFXJAAAAAElFTkSuQmCC"
|
||||
img.onload = () => {
|
||||
con.drawImage(img, 0, 0)
|
||||
var data = con.getImageData(0, 0, 10, 10) // should not throw as data URLs are same-origin
|
||||
for(var i = 0; i < data.data.length; i++) {
|
||||
var expected = ((i+1) % 4 == 0) ? 255 : 0
|
||||
assert_equals(data.data[i], expected)
|
||||
}
|
||||
c.toDataURL() // shouldn't throw either
|
||||
done()
|
||||
}
|
||||
</script>
|
|
@ -3,10 +3,11 @@
|
|||
<title>Loading a non-parsing URL as an image should silently fail; triggering appropriate events</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<img id=myimg />
|
||||
<img id=brokenurl />
|
||||
<img id=emptysrc />
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
var img = document.getElementById("myimg");
|
||||
var img = document.getElementById("brokenurl");
|
||||
img.src = "http://also a broken url";
|
||||
var errorevent = false;
|
||||
|
||||
|
@ -16,6 +17,26 @@ async_test(function(t) {
|
|||
img.addEventListener('loadend', t.step_func_done(function() {
|
||||
assert_true(errorevent, "error event fired");
|
||||
}));
|
||||
});
|
||||
}, 'src="http://also a broken url"');
|
||||
|
||||
async_test(function(t) {
|
||||
var img = document.getElementById("emptysrc");
|
||||
img.src = "";
|
||||
var loadendevent = false;
|
||||
|
||||
// Setting src to empty string triggers only error event.
|
||||
// The errors should be queued in the event loop, so they should only trigger
|
||||
// after this block of code finishes, not during the img.src setter itself
|
||||
img.addEventListener('error', t.step_func(function() {
|
||||
// Queue this check in the event loop to check there is no loadend event
|
||||
// fired.
|
||||
t.step_timeout(t.step_func_done(function() {
|
||||
assert_false(loadendevent, "loadend event should not fired");
|
||||
}), 0)
|
||||
}));
|
||||
img.addEventListener('loadend', t.step_func(function() {
|
||||
loadendevent = true;
|
||||
}));
|
||||
}, 'src=""');
|
||||
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>img usemap case-sensitive</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-a-hash-name-reference">
|
||||
<!-- See also: https://github.com/whatwg/html/issues/1666 -->
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#sanityCheck" width="300" height="300">
|
||||
<map name="sanityCheck"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#sImPlE" width="300" height="300">
|
||||
<map name="simple"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="SIMPLE"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#paSSfield-killroyß" width="300" height="300">
|
||||
<map name="passfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="PASSFIELD-KILLROYß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="paſſfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfield-Killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="paßfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="paẞfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfield-killroyẞ"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfıeld-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfİeld-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#глупый" width="300" height="300">
|
||||
<map name="глупый"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="ГЛУПЫЙ"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="ГЛУПЫЙ"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#åωk" width="300" height="300">
|
||||
<map name="ÅΩK"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="Åωk"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="åΩk"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="åωK"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#blah1" width="300" height="300">
|
||||
<map name="blah①"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="blⒶh1"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="blⓐh1"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#tÉdz5アパートFi" width="300" height="300">
|
||||
<map name="TÉDZ5アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="TéDZ⁵アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="tÉdz5㌀Fi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="tÉdz5アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="TÉDZ⁵アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="TÉDZ5アパートfi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<img src="/images/threecolors.png" usemap="#ΣΣ" width="300" height="300">
|
||||
<map name="σς"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
setup({ explicit_done: true });
|
||||
|
||||
onload = () => {
|
||||
test(() => {
|
||||
const image = document.querySelector(`img[usemap="#sanityCheck"]`);
|
||||
const imageRect = image.getBoundingClientRect();
|
||||
const x = imageRect.left + imageRect.width / 2;
|
||||
const y = imageRect.top + imageRect.height / 2;
|
||||
const element = document.elementFromPoint(x, y);
|
||||
const area = document.querySelector(`map[name="sanityCheck"] > area`);
|
||||
|
||||
assert_equals(element, area);
|
||||
}, `Image with usemap of #sanityCheck should match the area with map named sanityCheck`);
|
||||
|
||||
const images = Array.from(document.querySelectorAll(`img:not([usemap="#sanityCheck"])`));
|
||||
|
||||
for (let image of images) {
|
||||
test(() => {
|
||||
const imageRect = image.getBoundingClientRect();
|
||||
const x = imageRect.left + imageRect.width / 2;
|
||||
const y = imageRect.top + imageRect.height / 2;
|
||||
const element = document.elementFromPoint(x, y);
|
||||
|
||||
const name = element.parentElement.getAttribute("name");
|
||||
const messageSuffix = name ? `; used <map> with name "${name}"` : "";
|
||||
|
||||
assert_equals(element, image, "The element retrieved must be the image, not an area" + messageSuffix);
|
||||
}, `Image with usemap of ${image.useMap} should not match any of the areas`);
|
||||
}
|
||||
|
||||
done();
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>Historical object element features should not be supported</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<object id=object></object>
|
||||
<script>
|
||||
test(function() {
|
||||
var elm = document.getElementById('object');
|
||||
assert_equals(typeof elm, 'object', 'typeof');
|
||||
assert_throws(new TypeError(), function() {
|
||||
elm();
|
||||
});
|
||||
}, 'object legacycaller should not be supported');
|
||||
</script>
|
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>object usemap case-sensitive</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-a-hash-name-reference">
|
||||
<!-- See also: https://github.com/whatwg/html/issues/1666 -->
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#sanityCheck" width="300" height="300"></object>
|
||||
<map name="sanityCheck"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#sImPlE" width="300" height="300"></object>
|
||||
<map name="simple"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="SIMPLE"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#paSSfield-killroyß" width="300" height="300"></object>
|
||||
<map name="passfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="PASSFIELD-KILLROYß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="paſſfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfield-Killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="paßfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="paẞfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfield-killroyẞ"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfield-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfıeld-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="passfİeld-killroyß"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#глупый" width="300" height="300"></object>
|
||||
<map name="глупый"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="ГЛУПЫЙ"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="ГЛУПЫЙ"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#åωk" width="300" height="300"></object>
|
||||
<map name="ÅΩK"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="Åωk"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="åΩk"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="åωK"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#blah1" width="300" height="300"></object>
|
||||
<map name="blah①"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="blⒶh1"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="blⓐh1"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#tÉdz5アパートFi" width="300" height="300"></object>
|
||||
<map name="TÉDZ5アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="TéDZ⁵アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="tÉdz5㌀Fi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="tÉdz5アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="TÉDZ⁵アパートFi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
<map name="TÉDZ5アパートfi"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<object data="/images/threecolors.png" usemap="#ΣΣ" width="300" height="300"></object>
|
||||
<map name="σς"><area shape="rect" coords="0,0,300,300"></map>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
setup({ explicit_done: true });
|
||||
|
||||
onload = () => {
|
||||
test(() => {
|
||||
const object = document.querySelector(`object[usemap="#sanityCheck"]`);
|
||||
const objectRect = object.getBoundingClientRect();
|
||||
const x = objectRect.left + objectRect.width / 2;
|
||||
const y = objectRect.top + objectRect.height / 2;
|
||||
const element = document.elementFromPoint(x, y);
|
||||
const area = document.querySelector(`map[name="sanityCheck"] > area`);
|
||||
|
||||
assert_equals(element, area);
|
||||
}, `Object with usemap of #sanityCheck should match the area with map named sanityCheck`);
|
||||
|
||||
const objects = Array.from(document.querySelectorAll(`object:not([usemap="#sanityCheck"])`));
|
||||
|
||||
for (let object of objects) {
|
||||
test(() => {
|
||||
const objectRect = object.getBoundingClientRect();
|
||||
const x = objectRect.left + objectRect.width / 2;
|
||||
const y = objectRect.top + objectRect.height / 2;
|
||||
const element = document.elementFromPoint(x, y);
|
||||
|
||||
const name = element.parentElement.getAttribute("name");
|
||||
const messageSuffix = name ? `; used <map> with name "${name}"` : "";
|
||||
|
||||
assert_equals(element, object, "The element retrieved must be the object, not an area" + messageSuffix);
|
||||
}, `Object with usemap of ${object.useMap} should not match any of the areas`);
|
||||
}
|
||||
|
||||
done();
|
||||
};
|
||||
</script>
|
|
@ -15,7 +15,7 @@
|
|||
types: ["text", "search", "tel", "password"],
|
||||
testData: [
|
||||
{conditions: {}, expected: true, name: "[target] no constraint"},
|
||||
{conditions: {maxLength: "4", value: "abcdef"}, expected: false, name: "[target] suffering from being too long", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "abcdef"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
|
||||
{conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] suffering from a pattern mismatch"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
|
||||
]
|
||||
|
@ -25,7 +25,7 @@
|
|||
types: ["url"],
|
||||
testData: [
|
||||
{conditions: {}, expected: true, name: "[target] no constraint"},
|
||||
{conditions: {maxLength: "20", value: "http://www.example.com"}, expected: false, name: "[target] suffering from being too long", dirty: true},
|
||||
{conditions: {maxLength: "20", value: "http://www.example.com"}, expected: true, name: "[target] suffering from being too long", dirty: true},
|
||||
{conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
|
||||
{conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
|
||||
|
@ -36,7 +36,7 @@
|
|||
types: ["email"],
|
||||
testData: [
|
||||
{conditions: {}, expected: true, name: "[target] no constraint"},
|
||||
{conditions: {maxLength: "10", value: "test@example.com"}, expected: false, name: "[target] suffering from being too long", dirty: true},
|
||||
{conditions: {maxLength: "10", value: "test@example.com"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
|
||||
{conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
|
||||
{conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
types: ["text", "search", "tel", "password"],
|
||||
testData: [
|
||||
{conditions: {}, expected: true, name: "[target] no constraint"},
|
||||
{conditions: {maxLength: "4", value: "abcdef"}, expected: false, name: "[target] suffering from being too long", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "abcdef"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
|
||||
{conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] suffering from a pattern mismatch"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
|
||||
]
|
||||
|
@ -25,7 +25,7 @@
|
|||
types: ["url"],
|
||||
testData: [
|
||||
{conditions: {}, expected: true, name: "[target] no constraint"},
|
||||
{conditions: {maxLength: "20", value: "http://www.example.com"}, expected: false, name: "[target] suffering from being too long", dirty: true},
|
||||
{conditions: {maxLength: "20", value: "http://www.example.com"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
|
||||
{conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
|
||||
{conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
|
||||
|
@ -36,7 +36,7 @@
|
|||
types: ["email"],
|
||||
testData: [
|
||||
{conditions: {}, expected: true, name: "[target] no constraint"},
|
||||
{conditions: {maxLength: "10", value: "test@example.com"}, expected: false, name: "[target] suffering from being too long", dirty: true},
|
||||
{conditions: {maxLength: "10", value: "test@example.com"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
|
||||
{conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
|
||||
{conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
types: ["date"],
|
||||
testData: [
|
||||
{conditions: {step: "", value: "2000-01-01"}, expected: false, name: "[target] The step attribute is not set"},
|
||||
{conditions: {step: 2 * 1 * 86400000, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2 * 1 * 86400000, value: "1970-01-02"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2 * 1 * 86400000, value: "1970-01-03"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
{conditions: {step: 2, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2, value: "1970-01-03"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2, value: "1970-01-02"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -26,9 +26,9 @@
|
|||
types: ["month"],
|
||||
testData: [
|
||||
{conditions: {step: "", value: "2000-01"}, expected: false, name: "[target] The step attribute is not set"},
|
||||
{conditions: {step: 2 * 1 * 1, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2 * 1 * 1, value: "1970-03"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2 * 1 * 1, value: "1970-04"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
{conditions: {step: 2, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2, value: "1970-03"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2, value: "1970-04"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -36,9 +36,9 @@
|
|||
types: ["week"],
|
||||
testData: [
|
||||
{conditions: {step: "", value: "1970-W01"}, expected: false, name: "[target] The step attribute is not set"},
|
||||
{conditions: {step: 2 * 1 * 604800000, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2 * 1 * 604800000, value: "1970-W03"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2 * 1 * 604800000, value: "1970-W04"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
{conditions: {step: 2, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2, value: "1970-W03"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2, value: "1970-W04"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -46,9 +46,9 @@
|
|||
types: ["time"],
|
||||
testData: [
|
||||
{conditions: {step: "", value: "12:00:00"}, 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: "12:02:00"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2 * 60 * 1000, value: "12:03:00"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
{conditions: {step: 2 * 60, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2 * 60, value: "12:02:00"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2 * 60, value: "12:03:00"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -56,9 +56,9 @@
|
|||
types: ["datetime-local"],
|
||||
testData: [
|
||||
{conditions: {step: "", value: "2000-01-01T12:00:00"}, 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: "1970-01-01T12:02:00"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2 * 60 * 1000, value: "1970-01-01T12:03:00"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
{conditions: {step: 2 * 60, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
|
||||
{conditions: {step: 2 * 60, value: "1970-01-01T12:02:00"}, expected: false, name: "[target] The value must match the step"},
|
||||
{conditions: {step: 2 * 60, value: "1970-01-01T12:03:00"}, expected: true, name: "[target] The value must mismatch the step"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
tag: "input",
|
||||
types: ["text", "search", "tel", "password"],
|
||||
testData: [
|
||||
{conditions: {maxLength: "4", value: "abcdef"}, expected: false, name: "[target] validity.valid must be false if validity.tooLong is true", dirty: true},
|
||||
{conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||
]
|
||||
|
@ -23,7 +22,6 @@
|
|||
tag: "input",
|
||||
types: ["url"],
|
||||
testData: [
|
||||
{conditions: {maxLength: "20", value: "http://www.example.com"}, expected: false, name: "[target] validity.valid must be false if validity.tooLong is true", dirty: true},
|
||||
{conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
||||
{conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||
|
@ -33,7 +31,6 @@
|
|||
tag: "input",
|
||||
types: ["email"],
|
||||
testData: [
|
||||
{conditions: {maxLength: "10", value: "test@example.com"}, expected: false, name: "[target] validity.valid must be false if validity.tooLong is true", dirty: true},
|
||||
{conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
||||
{conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||
|
|
|
@ -18,5 +18,28 @@ test(function() {
|
|||
assert_equals(form[1], document.getElementById("r2"));
|
||||
assert_equals(form[2], undefined);
|
||||
assert_equals(form[-1], undefined);
|
||||
}, "form.elements should be accessed correctly by index")
|
||||
}, "form.elements should be accessed correctly by index")
|
||||
|
||||
test(function(){
|
||||
var form = document.getElementById("form");
|
||||
var old_item = form[0];
|
||||
var old_desc = Object.getOwnPropertyDescriptor(form, 0);
|
||||
assert_equals(old_desc.value, old_item);
|
||||
assert_true(old_desc.enumerable);
|
||||
assert_true(old_desc.configurable);
|
||||
assert_false(old_desc.writable);
|
||||
|
||||
Object.prototype[0] = 5;
|
||||
this.add_cleanup(function () { delete Object.prototype[0]; });
|
||||
assert_equals(form[0], old_item);
|
||||
|
||||
delete form[0];
|
||||
assert_equals(form[0], old_item);
|
||||
|
||||
assert_throws(new TypeError(), function() {
|
||||
"use strict";
|
||||
delete form[0];
|
||||
});
|
||||
assert_equals(form[0], old_item);
|
||||
}, 'Trying to delete an indexed property name should never work');
|
||||
</script>
|
||||
|
|
|
@ -115,6 +115,11 @@ test(function() {
|
|||
var button = document.getElementsByTagName("input")[0]
|
||||
assert_equals(button.type, "button")
|
||||
assert_equals(form.button, button)
|
||||
var desc = Object.getOwnPropertyDescriptor(form, "button");
|
||||
assert_equals(desc.value, button);
|
||||
assert_false(desc.writable);
|
||||
assert_true(desc.configurable);
|
||||
assert_false(desc.enumerable);
|
||||
assert_equals(form.button.length, undefined)
|
||||
}, "Name for a single element should work")
|
||||
|
||||
|
@ -222,6 +227,12 @@ test(function() {
|
|||
assert_equals(input2.localName, "input")
|
||||
assert_equals(input2.getAttribute("form"), "c")
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(form, "d");
|
||||
assert_equals(desc.value, form.d);
|
||||
assert_false(desc.writable);
|
||||
assert_true(desc.configurable);
|
||||
assert_false(desc.enumerable);
|
||||
|
||||
assert_true(form.d instanceof NodeList, "form.d should be a NodeList")
|
||||
assert_array_equals(form.d, [input1, input2])
|
||||
}, "The form attribute should be taken into account for named getters (multiple elements)")
|
||||
|
@ -236,4 +247,84 @@ test(function() {
|
|||
assert_equals(f.x, undefined)
|
||||
assert_equals(g.x, input)
|
||||
}, "Input should only be a named property on the innermost form that contains it")
|
||||
|
||||
test(function() {
|
||||
var form = document.getElementsByTagName("form")[1];
|
||||
var old_item = form["l1"];
|
||||
var old_desc = Object.getOwnPropertyDescriptor(form, "l1");
|
||||
assert_equals(old_desc.value, old_item);
|
||||
assert_false(old_desc.enumerable);
|
||||
assert_true(old_desc.configurable);
|
||||
assert_false(old_desc.writable);
|
||||
|
||||
form["l1"] = 5;
|
||||
assert_equals(form["l1"], old_item);
|
||||
assert_throws(new TypeError(), function() {
|
||||
"use strict";
|
||||
form["l1"] = 5;
|
||||
});
|
||||
assert_throws(new TypeError(), function() {
|
||||
Object.defineProperty(form, "l1", { value: 5 });
|
||||
});
|
||||
|
||||
delete form["l1"];
|
||||
assert_equals(form["l1"], old_item);
|
||||
|
||||
assert_throws(new TypeError(), function() {
|
||||
"use strict";
|
||||
delete form["l1"];
|
||||
});
|
||||
assert_equals(form["l1"], old_item);
|
||||
|
||||
}, 'Trying to set an expando that would shadow an already-existing named property');
|
||||
|
||||
test(function() {
|
||||
var form = document.getElementsByTagName("form")[1];
|
||||
var old_item = form["new-name"];
|
||||
var old_desc = Object.getOwnPropertyDescriptor(form, "new-name");
|
||||
assert_equals(old_item, undefined);
|
||||
assert_equals(old_desc, undefined);
|
||||
|
||||
form["new-name"] = 5;
|
||||
assert_equals(form["new-name"], 5);
|
||||
|
||||
var input = document.createElement("input");
|
||||
this.add_cleanup(function () {input.remove();});
|
||||
input.name = "new-name";
|
||||
form.appendChild(input);
|
||||
|
||||
assert_equals(form["new-name"], 5);
|
||||
|
||||
delete form["new-name"];
|
||||
assert_equals(form["new-name"], input);
|
||||
}, 'Trying to set an expando that shadows a named property that gets added later');
|
||||
|
||||
test(function() {
|
||||
var form = document.getElementsByTagName("form")[1];
|
||||
var old_item = form["new-name2"];
|
||||
var old_desc = Object.getOwnPropertyDescriptor(form, "new-name2");
|
||||
assert_equals(old_item, undefined);
|
||||
assert_equals(old_desc, undefined);
|
||||
|
||||
Object.defineProperty(form, "new-name2", { configurable: false, writable:
|
||||
false, value: 5 });
|
||||
assert_equals(form["new-name2"], 5);
|
||||
|
||||
var input = document.createElement("input");
|
||||
this.add_cleanup(function () {input.remove();});
|
||||
input.name = "new-name2";
|
||||
form.appendChild(input);
|
||||
|
||||
assert_equals(form["new-name2"], 5);
|
||||
|
||||
delete form["new-name2"];
|
||||
assert_equals(form["new-name2"], 5);
|
||||
|
||||
assert_throws(new TypeError(), function() {
|
||||
"use strict";
|
||||
delete form["new-name2"];
|
||||
});
|
||||
assert_equals(form["new-name2"], 5);
|
||||
}, 'Trying to set a non-configurable expando that shadows a named property that gets added later');
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>radio group name compatibility caseless</title>
|
||||
<title>radio group name case-sensitive</title>
|
||||
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
|
||||
<link rel="help" href="http://people.mozilla.org/~jdaggett/tests/radiobuttonnamecase.html">
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#radio-button-group">
|
||||
<!-- See also: https://github.com/whatwg/html/issues/1666 -->
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<input id=r1 type="radio" name="sImPlE">
|
||||
<input id=r2 type="radio" name="simple">
|
||||
<input id=r3 type="radio" name="SIMPLE">
|
||||
|
@ -43,33 +48,36 @@
|
|||
<input id=r30 type="radio" name="TéDZ⁵アパートFi">
|
||||
<input id=r31 type="radio" name="tÉdz5㌀Fi">
|
||||
<input id=r32 type="radio" name="tÉdz5アパートFi">
|
||||
<input id=r33 type="radio" name="tÉdz5アパートFi">
|
||||
<input id=r34 type="radio" name="TÉDZ⁵アパートFi">
|
||||
<input id=r35 type="radio" name="TÉDZ5アパートfi">
|
||||
|
||||
<input id=r36 type="radio" name="ΣΣ">
|
||||
<input id=r37 type="radio" name="σς">
|
||||
|
||||
<script>
|
||||
var groups = [["r1" ,"r2", "r3"],
|
||||
["r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14"],
|
||||
["r15", "r16", "r17", "r18"],
|
||||
["r19", "r20", "r21", "r22", "r23"],
|
||||
["r24", "r25", "r26", "r27"],
|
||||
["r28", "r29", "r30", "r31", "r32", "r33", "r34", "r35"],
|
||||
["r36", "r37"]],
|
||||
groupName = ["sImPlE", "paSSfield-killroyß", "глупый", "åωk", "blah1", "tÉdz5アパートFi", "ΣΣ"];
|
||||
groups.forEach(function(group, index) {
|
||||
test(function(){
|
||||
group.forEach(function(radioId) {
|
||||
assert_false(document.getElementById(radioId).checked);
|
||||
});
|
||||
for (var i = 0; i < group.length; i++) {
|
||||
document.getElementById(group[i]).checked = true;
|
||||
assert_true(document.getElementById(group[i]).checked);
|
||||
for (var j = 0; j < group.length; j++) {
|
||||
if (j != i) assert_false(document.getElementById(group[j]).checked);
|
||||
}
|
||||
}
|
||||
}, "radio button group name = " + groupName[index]);
|
||||
});
|
||||
"use strict";
|
||||
const notGroups = {
|
||||
"sImPlE": ["r1" ,"r2", "r3"],
|
||||
"paSSfield-killroyß": ["r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14"],
|
||||
"глупый": ["r15", "r16", "r17", "r18"],
|
||||
"åωk": ["r19", "r20", "r21", "r22", "r23"],
|
||||
"blah1": ["r24", "r25", "r26", "r27"],
|
||||
"tÉdz5アパートFi": ["r28", "r29", "r30", "r31", "r32", "r34", "r35"],
|
||||
"ΣΣ": ["r36", "r37"]
|
||||
};
|
||||
|
||||
for (let notGroupLabel of Object.keys(notGroups)) {
|
||||
test(() => {
|
||||
const ids = notGroups[notGroupLabel];
|
||||
const radios = ids.map(id => document.getElementById(id));
|
||||
|
||||
for (let radio of radios) {
|
||||
radio.checked = true;
|
||||
}
|
||||
|
||||
for (let radio of radios) {
|
||||
assert_true(radio.checked, `${radio.name} must be checked`);
|
||||
}
|
||||
}, `Among names like ${notGroupLabel}, everything must be checkable at the same time`);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
var meters = [
|
||||
{value: 0, expectedValue: 0, expectedMin: 0, expectedMax: 1.0, expectedLow: 0, expectedHigh: 1.0, expectedOptimum: 0.5, testname: "Default values"},
|
||||
{value: 3, expectedValue: 3, min: -10.1, expectedMin: -10.1, max: 10.1, expectedMax: 10.1, low: -9.1, expectedLow: -9.1, high: 9.1, expectedHigh: 9.1, optimum: 3, expectedOptimum: 3, testname: "Setting values to min, max, low, high and optimum"},
|
||||
{value: "foobar", expectedValue: 0, min: "foobar", expectedMin: 0, max: "foobar", expectedMax: 1.0, low: "foobar", expectedLow: 0, high: "foobar", expectedHigh: 1.0, optimum: "foobar", expectedOptimum: 0.5, testname: "Invalid floating-point number values"},
|
||||
{value: 0, expectedValue: 0, min: 0, expectedMin: 0, max: -1.0, expectedMax: 0, expectedLow: 0, expectedHigh: 0, expectedOptimum: 0, testname: "max < min"},
|
||||
{value: 0, expectedValue: 10, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, expectedOptimum: 15, testname: "value < min"},
|
||||
{value: 30, expectedValue: 20, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, expectedOptimum: 15, testname: "value > max"},
|
||||
|
@ -71,6 +70,15 @@
|
|||
assert_equals(meter.optimum, m.expectedOptimum, "optimum value");
|
||||
}, m.testname);
|
||||
}
|
||||
test(function() {
|
||||
var meter = document.createElement("meter");
|
||||
assert_throws(new TypeError(), function() { meter.value = "foobar"; }, "value attribute");
|
||||
assert_throws(new TypeError(), function() { meter.min = "foobar"; }, "min attribute");
|
||||
assert_throws(new TypeError(), function() { meter.max = "foobar"; }, "max attribute");
|
||||
assert_throws(new TypeError(), function() { meter.low = "foobar"; }, "low attribute");
|
||||
assert_throws(new TypeError(), function() { meter.high = "foobar"; }, "high attribute");
|
||||
assert_throws(new TypeError(), function() { meter.optimum = "foobar"; }, "optimum attribute");
|
||||
}, "Invalid floating-point number values");
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -11,9 +11,7 @@
|
|||
<h1>Description</h1>
|
||||
<p>This test continues to validate the li element.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
|
||||
<p>This reftest verifies that the value attribute has no effect when applied to a list item NOT having an ol parent.</p>
|
||||
<p>This reftest verifies that the value attribute has no effect when applied to a list item NOT having an ol parent and not marked as display: list-item.</p>
|
||||
<p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
|
||||
<p>This reftest passes if you see NO sequencing information on any of the items below.</p>
|
||||
|
||||
|
|
|
@ -12,9 +12,7 @@
|
|||
<h1>Description</h1>
|
||||
<p>This test continues to validate the li element.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
|
||||
<p>This reftest verifies that the value attribute has no effect when applied to a list item NOT having an ol parent.</p>
|
||||
<p>This reftest verifies that the value attribute has no effect when applied to a list item NOT having an ol parent and not marked as display: list-item.</p>
|
||||
<p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
|
||||
<p>This reftest passes if you see NO sequencing information on any of the items below.</p>
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
<h1>Description</h1>
|
||||
<p>This test continues to validate the li element.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
|
||||
<p>This reftest verifies that the value attribute has an effect when applied to a list item with an ol parent.</p>
|
||||
<p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
|
||||
<p>This reftest passes if you see the numbers 1. 2. 3. below the words "Ordered List"</p>
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
<h1>Description</h1>
|
||||
<p>This test continues to validate the li element.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
|
||||
<p>This reftest verifies that the value attribute has an effect when applied to a list item with an ol parent.</p>
|
||||
<p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
|
||||
<p>This reftest passes if you see the numbers 1. 2. 3. below the words "Ordered List"</p>
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>display: list-item on non-<li> elements</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<style>
|
||||
.list-item {
|
||||
display: list-item;
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.list-item[hidden] {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if both lists display similar to the following:</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
D
|
||||
3. E</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<span>D</span>
|
||||
<li value="3">E</li>
|
||||
</ol>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<span>D</span>
|
||||
<li value="3">E</li>
|
||||
</ol>
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>display: list-item on non-<li> elements</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-display-list-item-ref.html">
|
||||
|
||||
<style>
|
||||
.list-item {
|
||||
display: list-item;
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.list-item[hidden] {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if both lists display similar to the following:</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
D
|
||||
3. E</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ul>
|
||||
<span class="list-item">A</span>
|
||||
<span class="list-item">B</span>
|
||||
<span class="list-item" hidden>C</span>
|
||||
<span>D</span>
|
||||
<span class="list-item">E</span>
|
||||
</ul>
|
||||
|
||||
<ol>
|
||||
<div class="list-item">A</div>
|
||||
<div class="list-item">B</div>
|
||||
<div class="list-item" hidden>C</div>
|
||||
<div>D</div>
|
||||
<div class="list-item">E</div>
|
||||
</ol>
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be narest ancestor menu if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="3">C</li>
|
||||
<li value="4">D</li>
|
||||
<li value="5">E</li>
|
||||
<ol>
|
||||
<li value="1">F</li>
|
||||
<li value="2">G</li>
|
||||
</ol>
|
||||
<li value="6">H</li>
|
||||
<ol>
|
||||
<li value="1">I</li>
|
||||
<li value="2">
|
||||
J
|
||||
<ol>
|
||||
<li value="1">K</li>
|
||||
<li value="2">L</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</ol>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be narest ancestor menu if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-list-owner-menu-ref.html">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<menu>
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<div>
|
||||
<li>C</li>
|
||||
<span>
|
||||
<li>D</li>
|
||||
<li>E</li>
|
||||
</span>
|
||||
<menu>
|
||||
<li>F</li>
|
||||
<li>G</li>
|
||||
</menu>
|
||||
</div>
|
||||
<li>H</li>
|
||||
<menu>
|
||||
<li>I</li>
|
||||
<li>
|
||||
J
|
||||
<menu>
|
||||
<li>K</li>
|
||||
<li>L</li>
|
||||
</menu>
|
||||
</li>
|
||||
</menu>
|
||||
</menu>
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be nearest ancestor ul or ul (but not dir) if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
3. K
|
||||
4. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="3">C</li>
|
||||
<li value="4">D</li>
|
||||
<li value="5">E</li>
|
||||
<ol>
|
||||
<li value="1">F</li>
|
||||
<li value="2">G</li>
|
||||
</ol>
|
||||
<li value="6">H</li>
|
||||
<ol>
|
||||
<li value="1">I</li>
|
||||
<li value="2">
|
||||
J
|
||||
<dir>
|
||||
<li value="3">K</li>
|
||||
<li value="4">L</li>
|
||||
</dir>
|
||||
</li>
|
||||
</ol>
|
||||
</ol>
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be nearest ancestor ul or ul (but not dir) if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-list-owner-mixed-ref.html">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
display: list-item;
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
3. K
|
||||
4. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ul>
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<div>
|
||||
<li>C</li>
|
||||
<span>
|
||||
<li>D</li>
|
||||
<li>E</li>
|
||||
</span>
|
||||
<ol>
|
||||
<li>F</li>
|
||||
<span class="list-item">G</span>
|
||||
</ol>
|
||||
</div>
|
||||
<li>H</li>
|
||||
<ol>
|
||||
<li>I</li>
|
||||
<li>
|
||||
J
|
||||
<dir>
|
||||
<li>K</li>
|
||||
<li>L</li>
|
||||
</dir>
|
||||
</li>
|
||||
</ol>
|
||||
</ul>
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>The dir element is not treated specially when calculating list owners</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
6. F
|
||||
7. G
|
||||
8. H
|
||||
9. I
|
||||
10. J
|
||||
11. K
|
||||
12. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="3">C</li>
|
||||
<li value="4">D</li>
|
||||
<li value="5">E</li>
|
||||
<dir>
|
||||
<li value="6">F</li>
|
||||
<li value="7">G</li>
|
||||
</dir>
|
||||
<li value="8">H</li>
|
||||
<dir>
|
||||
<li value="9">I</li>
|
||||
<li value="10">
|
||||
J
|
||||
<dir>
|
||||
<li value="11">K</li>
|
||||
<li value="12">L</li>
|
||||
</dir>
|
||||
</li>
|
||||
</dir>
|
||||
</ol>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>The dir element is not treated specially when calculating list owners</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-list-owner-not-dir-ref.html">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
6. F
|
||||
7. G
|
||||
8. H
|
||||
9. I
|
||||
10. J
|
||||
11. K
|
||||
12. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<div>
|
||||
<li>C</li>
|
||||
<span>
|
||||
<li>D</li>
|
||||
<li>E</li>
|
||||
</span>
|
||||
<dir>
|
||||
<li>F</li>
|
||||
<li>G</li>
|
||||
</dir>
|
||||
</div>
|
||||
<li>H</li>
|
||||
<dir>
|
||||
<li>I</li>
|
||||
<li>
|
||||
J
|
||||
<dir>
|
||||
<li>K</li>
|
||||
<li>L</li>
|
||||
</dir>
|
||||
</li>
|
||||
</dir>
|
||||
</ol>
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be narest ancestor ol if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="3">C</li>
|
||||
<li value="4">D</li>
|
||||
<li value="5">E</li>
|
||||
<ol>
|
||||
<li value="1">F</li>
|
||||
<li value="2">G</li>
|
||||
</ol>
|
||||
<li value="6">H</li>
|
||||
<ol>
|
||||
<li value="1">I</li>
|
||||
<li value="2">
|
||||
J
|
||||
<ol>
|
||||
<li value="1">K</li>
|
||||
<li value="2">L</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</ol>
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be narest ancestor ol if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-list-owner-ol-ref.html">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<div>
|
||||
<li>C</li>
|
||||
<span>
|
||||
<li>D</li>
|
||||
<li>E</li>
|
||||
</span>
|
||||
<ol>
|
||||
<li>F</li>
|
||||
<li>G</li>
|
||||
</ol>
|
||||
</div>
|
||||
<li>H</li>
|
||||
<ol>
|
||||
<li>I</li>
|
||||
<li>
|
||||
J
|
||||
<ol>
|
||||
<li>K</li>
|
||||
<li>L</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</ol>
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be the parent if there is no ancestor ul/ol/menu</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
ol {
|
||||
padding: 50px;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
1. C
|
||||
1. D
|
||||
1. E
|
||||
3. F</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="1">C</li>
|
||||
<li value="1">D</li>
|
||||
<blockquote>
|
||||
<li value="1">E</li>
|
||||
</blockquote>
|
||||
<li value="3">F</li>
|
||||
</ol>
|
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be the parent if there is no ancestor ul/ol/menu</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-list-owner-parent-ref.html">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 50px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
1. C
|
||||
1. D
|
||||
1. E
|
||||
3. F</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="container">
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<div>
|
||||
<li>C</li>
|
||||
<span>
|
||||
<li>D</li>
|
||||
</span>
|
||||
</div>
|
||||
<blockquote>
|
||||
<li>E</li>
|
||||
</blockquote>
|
||||
<li>F</li>
|
||||
</div>
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner calculation skips elements that do not generate layout boxes</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
6. F
|
||||
7. G
|
||||
8. H
|
||||
9. I
|
||||
10. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="3">C</li>
|
||||
<li value="4">D</li>
|
||||
<li value="5">E</li>
|
||||
<li value="6">F</li>
|
||||
<li value="7">G</li>
|
||||
<li value="8">H</li>
|
||||
<li value="9">I</li>
|
||||
<li value="10">
|
||||
J
|
||||
<ol>
|
||||
<li value="1">K</li>
|
||||
<li value="2">L</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner calculation skips elements that do not generate layout boxes</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-list-owner-skip-no-boxes-ref.html">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
6. F
|
||||
7. G
|
||||
8. H
|
||||
9. I
|
||||
10. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<div>
|
||||
<li>C</li>
|
||||
<span>
|
||||
<li>D</li>
|
||||
<li>E</li>
|
||||
</span>
|
||||
<ol style="display: contents;">
|
||||
<li>F</li>
|
||||
<li>G</li>
|
||||
</ol>
|
||||
</div>
|
||||
<li>H</li>
|
||||
<ol style="display: contents;">
|
||||
<li>I</li>
|
||||
<li>
|
||||
J
|
||||
<ol>
|
||||
<li>K</li>
|
||||
<li>L</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</ol>
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be nearest ancestor ul if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="3">C</li>
|
||||
<li value="4">D</li>
|
||||
<li value="5">E</li>
|
||||
<ol>
|
||||
<li value="1">F</li>
|
||||
<li value="2">G</li>
|
||||
</ol>
|
||||
<li value="6">H</li>
|
||||
<ol>
|
||||
<li value="1">I</li>
|
||||
<li value="2">
|
||||
J
|
||||
<ol>
|
||||
<li value="1">K</li>
|
||||
<li value="2">L</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</ol>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>list owner is calculated to be nearest ancestor ul if it exists</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-list-owner-ul-ref.html">
|
||||
|
||||
<style>
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. C
|
||||
4. D
|
||||
5. E
|
||||
1. F
|
||||
2. G
|
||||
6. H
|
||||
1. I
|
||||
2. J
|
||||
1. K
|
||||
2. L</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ul>
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<div>
|
||||
<li>C</li>
|
||||
<span>
|
||||
<li>D</li>
|
||||
<li>E</li>
|
||||
</span>
|
||||
<ul>
|
||||
<li>F</li>
|
||||
<li>G</li>
|
||||
</ul>
|
||||
</div>
|
||||
<li>H</li>
|
||||
<ul>
|
||||
<li>I</li>
|
||||
<li>
|
||||
J
|
||||
<ul>
|
||||
<li>K</li>
|
||||
<li>L</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>If no ancestors generate CSS boxes, the list item has no owner, and thus gets numbered as 0</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>0. A
|
||||
0. B
|
||||
0. C</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<li value="0">A</li>
|
||||
<li value="0">B</li>
|
||||
<li value="0">C</li>
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>If no ancestors generate CSS boxes, the list item has no owner, and thus gets numbered as 0</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-no-list-owner-ref.html">
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style-type: decimal;
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>0. A
|
||||
0. B
|
||||
0. C</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<li>C</li>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>List items that are not being rendered do not participate in numbering</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. D
|
||||
4. E
|
||||
5. G</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li value="1">A</li>
|
||||
<li value="2">B</li>
|
||||
<li value="3">D</li>
|
||||
<li value="4">E</li>
|
||||
<li value="5">G</li>
|
||||
</ol>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>List items that are not being rendered do not participate in numbering</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">
|
||||
|
||||
<link rel="match" href="grouping-li-reftest-not-being-rendered-ref.html">
|
||||
|
||||
<p>This test matches if the list displays similar to the following</p>
|
||||
|
||||
<pre>1. A
|
||||
2. B
|
||||
3. D
|
||||
4. E
|
||||
5. G</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol>
|
||||
<li>A</li>
|
||||
<li>B</li>
|
||||
<li hidden>C</li>
|
||||
<li>D</li>
|
||||
<div>
|
||||
<li>E</li>
|
||||
<li hidden>F</li>
|
||||
<li>G</li>
|
||||
</div>
|
||||
</ol>
|
|
@ -17,9 +17,6 @@
|
|||
|
||||
<p>These reftests are necessary because the values of the ol's li children as calculated by the user agent are NOT available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>"The reversed attribute is a boolean attribute. If present, it indicates that the list is a descending list (..., 3, 2, 1). If the attribute is omitted, the list is an ascending list (1, 2, 3, ...)."</blockquote>
|
||||
|
||||
<p><strong>This reftest passes if you see an ascending list followed by two descending lists.</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -20,9 +20,6 @@
|
|||
|
||||
<p>These reftests are necessary because the values of the ol's li children as calculated by the user agent are NOT available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>"The reversed attribute is a boolean attribute. If present, it indicates that the list is a descending list (..., 3, 2, 1). If the attribute is omitted, the list is an ascending list (1, 2, 3, ...)."</blockquote>
|
||||
|
||||
<p><strong>This reftest passes if you see an ascending list followed by two descending lists.</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -14,10 +14,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
|
||||
<p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
|
||||
<p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -14,10 +14,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
|
||||
<p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
|
||||
<p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote><p>The type attribute represents the state given in the cell in the second column of the row whose first cell matches the attribute's value; if none of the cells match, or if the attribute is omitted, then the attribute represents the decimal state.</p></blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote><p>The type attribute represents the state given in the cell in the second column of the row whose first cell matches the attribute's value; if none of the cells match, or if the attribute is omitted, then the attribute represents the decimal state.</p></blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>User agents should render the items of the list in a manner consistent with the state of the type attribute of the ol element.</blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states:</p>
|
||||
<blockquote>User agents should render the items of the list in a manner consistent with the state of the type attribute of the ol element.</blockquote>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states: Numbers less than or equal to zero should always use the decimal system regardless of the type attribute.</p>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
<body>
|
||||
<p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
|
||||
|
||||
<p>The spec states: Numbers less than or equal to zero should always use the decimal system regardless of the type attribute.</p>
|
||||
|
||||
<p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
|
||||
<p>(Note: each list item has no content; only the sequencing should appear.)</p>
|
||||
|
||||
|
|
|
@ -230,83 +230,68 @@
|
|||
// is the number of child li elements otherwise."
|
||||
// "The start IDL attribute has the same default as its content attribute."
|
||||
|
||||
// basic - default should be 1
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("basic").start, 1, "no start attribute provided -> 1");
|
||||
assert_equals(document.getElementById("basic").start, 1);
|
||||
}, "Default start value for non-reversed list should be 1");
|
||||
|
||||
// decimal's first element has value of .5 which should return 1
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("decimal").start, 1, "start of .5 -> 1 (default)");
|
||||
assert_equals(document.getElementById("decimal").start, 1);
|
||||
}, "IDL and content attribute parse start of '.5' correctly.");
|
||||
|
||||
// letter's first element has value of A which should return 1
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("letter").start, 1, "start of A -> 1 (default)");
|
||||
assert_equals(document.getElementById("letter").start, 1);
|
||||
}, "IDL and content attribute parse start of 'A' correctly.");
|
||||
|
||||
// basicRevGoodName - default should be 3
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("basicRevGoodName").start, 3, "no start attribute provided -> 3");
|
||||
}, "Default start value (if none provided) for reversed list = child li elements.");
|
||||
assert_equals(document.getElementById("basicRevGoodName").start, 1);
|
||||
}, "Default start value (if none provided) for reversed list = 1.");
|
||||
|
||||
// basicRevEmpty - default should be 3
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("basicRevEmpty").start, 3, "start of A -> 3 (default)");
|
||||
}, "Default start value (if failed to parse) for reversed list = child li elements.");
|
||||
assert_equals(document.getElementById("basicRevEmpty").start, 1);
|
||||
}, "Default start value (if failed to parse) for reversed list = 1.");
|
||||
|
||||
// lots - default should be 3
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("lots").start, 3, "no start attribute -> 3 (default)");
|
||||
}, "Default start value for reversed list = child li elements (even with tons of other child elements).");
|
||||
assert_equals(document.getElementById("lots").start, 1);
|
||||
}, "Default start value for reversed list = 1 (even with tons of other child elements).");
|
||||
|
||||
// adding child element changes default start value for reversed list
|
||||
test(function() {
|
||||
var myList = document.getElementById("basicRevGoodName"), myLI = document.createElement("li");
|
||||
myList.appendChild(myLI);
|
||||
assert_equals(document.getElementById("basicRevGoodName").start, 4, "Adding child element to reversed list adds 1 to start value");
|
||||
}, "Adding child element to reversed list adds 1 to start value");
|
||||
assert_equals(document.getElementById("basicRevGoodName").start, 1);
|
||||
}, "Adding child element to reversed list does not change start value");
|
||||
|
||||
// removing child element changes default start value for reversed list
|
||||
test(function() {
|
||||
var myList = document.getElementById("basicRevTrue");
|
||||
myList.removeChild(myList.children[0]);
|
||||
assert_equals(document.getElementById("basicRevTrue").start, 2, "Deleting child element from reversed list reduces start value by 1");
|
||||
}, "Deleting child element from reversed list reduces start value by 1");
|
||||
assert_equals(document.getElementById("basicRevTrue").start, 1);
|
||||
}, "Deleting child element from reversed list does not change start value");
|
||||
|
||||
// start2's first element has value of 2
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("start2").start, 2, "start of 2 -> 2");
|
||||
assert_equals(document.getElementById("start2").start, 2);
|
||||
}, "IDL and content attribute parse start of '2' correctly.");
|
||||
|
||||
// negative's first element has value of -10
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("negative").start, -10, "start of -10 -> -10");
|
||||
assert_equals(document.getElementById("negative").start, -10);
|
||||
}, "IDL and content attribute parse start of '-10' correctly.");
|
||||
|
||||
// posFloatDown's first element has value of 4.03 which should return 4
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("posFloatDown").start, 4, "start of 4.03 -> 4");
|
||||
assert_equals(document.getElementById("posFloatDown").start, 4);
|
||||
}, "IDL and content attribute parse start of '4.03' correctly.");
|
||||
|
||||
// negFloatDown's first element has value of -4.03 which should return -4
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("negFloatDown").start, -4, "start of -4.03 -> -4");
|
||||
assert_equals(document.getElementById("negFloatDown").start, -4);
|
||||
}, "IDL and content attribute parse start of '-4.03' correctly.");
|
||||
|
||||
// posFloatUp's first element has value of 4.9 which should return 4
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("posFloatUp").start, 4, "start of 4.9 -> 4");
|
||||
assert_equals(document.getElementById("posFloatUp").start, 4);
|
||||
}, "IDL and content attribute parse start of '4.9' correctly.");
|
||||
|
||||
// negFloatUp's first element has value of -4.9 which should return -4
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("negFloatUp").start, -4, "start of -4.9 -> -4");
|
||||
assert_equals(document.getElementById("negFloatUp").start, -4);
|
||||
}, "IDL and content attribute parse start of '-4.9' correctly.");
|
||||
|
||||
// exponent's first element has value of 7e2 which should return 7
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("exponent").start, 7, "start of 7e2 -> 7");
|
||||
assert_equals(document.getElementById("exponent").start, 7);
|
||||
}, "IDL and content attribute parse start of '7e2' correctly.");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<div id='log'></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementById('ol').start, 3);
|
||||
assert_equals(document.getElementById('ol').start, 1);
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>`reversed` should reverse the numbering correctly</title>
|
||||
<link rel=match href="reversed-1-ref.html">
|
||||
<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
|
||||
<ol reversed>
|
||||
<li>Three</li>
|
||||
<li>Two</li>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Dynamically setting `reversed` should update the numbering</title>
|
||||
<link rel=match href="reversed-1-ref.html">
|
||||
<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
|
||||
<ol id="x">
|
||||
<li>Three</li>
|
||||
<li>Two</li>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Reversed numbering should update on dynamic addition of child nodes</title>
|
||||
<link rel=match href="reversed-1-ref.html">
|
||||
<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
|
||||
<ol id="x" reversed>
|
||||
<li>Three</li>
|
||||
<li>Two</li>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Reverse numbering should not be affected by nested div</title>
|
||||
<link rel=match href="reversed-1-ref.html">
|
||||
<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
|
||||
<ol reversed>
|
||||
<li>Three</li>
|
||||
<div>
|
||||
<li>Two</li>
|
||||
<li>One</li>
|
||||
</div>
|
||||
</ol>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Reverse numbering should not count display:none elements</title>
|
||||
<link rel=match href="reversed-1-ref.html">
|
||||
<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
|
||||
<ol reversed>
|
||||
<li>Three</li>
|
||||
<li style="display:none">Three</li>
|
||||
<li>Two</li>
|
||||
<li>One</li>
|
||||
</ol>
|
|
@ -0,0 +1,78 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test behavior of rel="noopener" links</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<iframe name="oursubframe"></iframe>
|
||||
<a href="support/noopener-target-2.html" rel="noopener" target="ourpopup"></a>
|
||||
<a href="support/noopener-target-2.html" rel="noopener" target="oursubframe"></a>
|
||||
<script>
|
||||
var tests = [];
|
||||
// First test the special targets
|
||||
function target1Loaded(win) {
|
||||
// Find the relevant test
|
||||
var test = tests.find((t) => t.openedWindow == win);
|
||||
test.step(function() {
|
||||
assert_equals(win.opener, window);
|
||||
win.close();
|
||||
test.done();
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Test that <a rel="noopener"> targeted at one of _self, _parent, _top does the
|
||||
* load in the appropriate existing browsing context instead of opening a new
|
||||
* one. The test is run in a separate popup window we open and which we can
|
||||
* navigate without causing the test harness going into conniptions.
|
||||
*/
|
||||
for (var target of ["self", "parent", "top"]) {
|
||||
var t = async_test("Check that rel=noopener with target=_" + target + " does a normal load");
|
||||
tests.push(t);
|
||||
t.openedWindow = window.open("support/noopener-popup.html");
|
||||
t.targetName = target;
|
||||
t.openedWindow.onload = t.step_func(function() {
|
||||
this.openedWindow.findLink(this.targetName).click();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* And now check that a noopener load targeted at something other than one of
|
||||
* the three special targets above in fact ignores existing things with the
|
||||
* given name. We do this in two ways. First, by opening a window named
|
||||
* "ourpopup" and then doing a load via <a rel="noopener" target="ourpopup"> and
|
||||
* verifying that the load happens in a window with a null opener, etc, while
|
||||
* the opener of the thing we opened is not modified. And second, by targeting
|
||||
* <a rel="noopener"> at a name that an existing subframe has, and ensuring that
|
||||
* this subframe is not navigated.
|
||||
*/
|
||||
var t1 = async_test("Check that targeting of rel=noopener with a given name ignores an existing window with that name");
|
||||
var w;
|
||||
t1.add_cleanup(function() { w.close(); });
|
||||
var channel = new BroadcastChannel("ourpopup");
|
||||
channel.onmessage = t1.step_func_done(function(e) {
|
||||
var data = e.data;
|
||||
assert_false(data.hasOpener);
|
||||
assert_false(data.hasParent);
|
||||
assert_equals(data.name, "ourpopup");
|
||||
assert_equals(w.opener, window);
|
||||
assert_equals(w.location.href, "about:blank");
|
||||
});
|
||||
t1.step(function() {
|
||||
w = window.open("", "ourpopup");
|
||||
assert_equals(w.opener, window);
|
||||
document.querySelectorAll("a")[0].click();
|
||||
});
|
||||
|
||||
var t2 = async_test("Check that targeting of rel=noopener with a given name ignores an existing subframe with that name");
|
||||
var channel = new BroadcastChannel("oursubframe");
|
||||
channel.onmessage = t2.step_func_done(function(e) {
|
||||
var data = e.data;
|
||||
assert_false(data.hasOpener);
|
||||
assert_false(data.hasParent);
|
||||
assert_equals(data.name, "oursubframe");
|
||||
assert_equals(document.querySelector("iframe").contentWindow.location.href,
|
||||
"about:blank");
|
||||
});
|
||||
t2.step(function() {
|
||||
document.querySelectorAll("a")[1].click();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
function findLink(arg) {
|
||||
var doc;
|
||||
if (arg == "self") {
|
||||
doc = document;
|
||||
} else {
|
||||
doc = frames[0].document;
|
||||
}
|
||||
return doc.getElementById(arg + "target");
|
||||
}
|
||||
</script>
|
||||
<a rel="noopener" target="_self" id="selftarget"
|
||||
href="noopener-target-1.html"></a>
|
||||
<iframe srcdoc='
|
||||
<a rel="noopener" target="_parent" id="parenttarget"
|
||||
href="noopener-target-1.html"></a>
|
||||
<a rel="noopener" target="_top" id="toptarget"
|
||||
href="noopener-target-1.html"></a>'></iframe>
|
|
@ -0,0 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
opener.target1Loaded(this);
|
||||
</script>
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
var channel = new BroadcastChannel(this.name);
|
||||
channel.postMessage({ hasOpener: opener !== null ,
|
||||
hasParent: parent != this,
|
||||
name: window.name });
|
||||
window.close();
|
||||
</script>
|
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>data URL and scripts</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
setup({allow_uncaught_exception:true})
|
||||
async_test(t => {
|
||||
var counter = 1
|
||||
window.onerror = t.step_func((message, x, xx, xxx, e) => {
|
||||
assert_not_equals(message, "Script error.") // Cannot be "muted" as data URLs are same-origin
|
||||
assert_equals(typeof e, "number")
|
||||
assert_equals(e, counter)
|
||||
if (counter == 3) {
|
||||
t.done()
|
||||
}
|
||||
counter++
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<script src="data:,throw 1"></script>
|
||||
<script src="data:,throw 2" crossorigin></script>
|
||||
<script src="data:,throw 3" crossorigin=use-credentials></script>
|
|
@ -0,0 +1,12 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test that the insertion point is defined in the error event of a parser-inserted script that actually started a fetch (but just had it fail).</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
var t = async_test("");
|
||||
var writeDone = t.step_func_done(function(text) {
|
||||
assert_equals(text, "Some text");
|
||||
});
|
||||
</script>
|
||||
<iframe src="support/script-onerror-insertion-point-1-helper.html"></iframe>
|
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test that the insertion point is not defined in the error event of a
|
||||
parser-inserted script that has an unparseable URL</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
var t = async_test("");
|
||||
var writeDone = t.step_func_done(function(text) {
|
||||
assert_equals(text, "text");
|
||||
});
|
||||
</script>
|
||||
<iframe src="support/script-onerror-insertion-point-2-helper.html"></iframe>
|
|
@ -0,0 +1,12 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test that the insertion point is defined in the load event of a parser-inserted script.</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
var t = async_test("");
|
||||
var writeDone = t.step_func_done(function(text) {
|
||||
assert_equals(text, "Some text");
|
||||
});
|
||||
</script>
|
||||
<iframe src="support/script-onload-insertion-point-helper.html"></iframe>
|
|
@ -0,0 +1,2 @@
|
|||
Some <script src="nosuchscripthere.js"
|
||||
onerror="document.write('text'); parent.writeDone(document.documentElement.textContent)"></script>
|
|
@ -0,0 +1,2 @@
|
|||
Some <script src="http://this is not parseable"
|
||||
onerror="document.write('text'); parent.writeDone(document.documentElement.textContent)"></script>
|
|
@ -0,0 +1,2 @@
|
|||
Some <script src="script-onload-insertion-point-helper.js"
|
||||
onload="document.write('xt'); parent.writeDone(document.documentElement.textContent)"></script>
|
|
@ -0,0 +1 @@
|
|||
document.write("te");
|
|
@ -14,7 +14,6 @@
|
|||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc1 = newHTMLDocument();
|
||||
var template = doc1.createElement('template');
|
||||
|
@ -35,7 +34,6 @@ test(function() {
|
|||
}, 'Changing of template element\'s node document. ' +
|
||||
'Test that ownerDocument of an empty template and its content changes');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc1 = newHTMLDocument();
|
||||
doc1.body.innerHTML = '<template id="tmpl"><div>Div content</div> And some more text</template>';
|
||||
|
@ -63,7 +61,6 @@ test(function() {
|
|||
}, 'Changing of template element\'s node document. ' +
|
||||
'Test that ownerDocument of a not empty template and its content changes');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc1 = newHTMLDocument();
|
||||
doc1.body.innerHTML = ''
|
||||
|
@ -109,7 +106,6 @@ test(function() {
|
|||
}, 'Changing of template element\'s node document. ' +
|
||||
'Test that ownerDocument of nested template and its content changes');
|
||||
|
||||
|
||||
testInIFrame('../resources/template-contents.html', function(context) {
|
||||
var doc1 = context.iframes[0].contentDocument;
|
||||
|
||||
|
@ -131,7 +127,6 @@ testInIFrame('../resources/template-contents.html', function(context) {
|
|||
}, 'Changing of template element\'s node document. ' +
|
||||
'Test document loaded from a file');
|
||||
|
||||
|
||||
testInIFrame('../resources/template-contents.html', function(context) {
|
||||
var doc1 = context.iframes[0].contentDocument;
|
||||
|
||||
|
@ -161,7 +156,6 @@ testInIFrame('../resources/template-contents.html', function(context) {
|
|||
}, 'Changing of template element\'s node document. ' +
|
||||
'Adobt template element into a document that has a browsing context');
|
||||
|
||||
|
||||
testInIFrame('../resources/template-contents.html', function(context) {
|
||||
var doc1 = context.iframes[0].contentDocument;
|
||||
|
||||
|
@ -173,7 +167,6 @@ testInIFrame('../resources/template-contents.html', function(context) {
|
|||
|
||||
doc2.body.appendChild(template);
|
||||
|
||||
|
||||
assert_not_equals(template.ownerDocument, doc1,
|
||||
'Template node owner document should be changed');
|
||||
assert_not_equals(template.content.ownerDocument, templateContentOwner,
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
testSelectorIdsMatch(":indeterminate", ["radio4", "radio5", "progress1"], "dynamically check a radio input in a radio button group");
|
||||
|
||||
document.getElementById("radio4").click();
|
||||
testSelectorIdsMatch(":indeterminate", ["checkbox1", "progress2"], "click on radio4 which is in the indeterminate state");
|
||||
testSelectorIdsMatch(":indeterminate", ["progress1"], "click on radio4 which is in the indeterminate state");
|
||||
|
||||
document.getElementById("progress1").setAttribute("value", "20");
|
||||
testSelectorIdsMatch(":indeterminate", [], "adding a value to progress1 should put it in a determinate state");
|
||||
|
|
|
@ -42,9 +42,23 @@ test(function() {
|
|||
assert_equals(old_length, el.rows.length);
|
||||
}, "check normal deleteRow");
|
||||
test(function() {
|
||||
while (el.rows.length > 1) {
|
||||
assert_equals(el.rows.length, 3);
|
||||
do {
|
||||
var old_length = el.rows.length;
|
||||
el.deleteRow(-1);
|
||||
}
|
||||
assert_equals(1, el.rows.length);
|
||||
assert_equals(el.rows.length, old_length - 1);
|
||||
} while (el.rows.length);
|
||||
}, "check normal deleteRow bis");
|
||||
|
||||
test(function() {
|
||||
assert_equals(el.rows.length, 0);
|
||||
el.deleteRow(-1);
|
||||
}, 'deleteRow(-1) with no rows');
|
||||
|
||||
test(function() {
|
||||
assert_equals(el.rows.length, 0);
|
||||
assert_throws("IndexSizeError", function() {
|
||||
el.deleteRow(0);
|
||||
});
|
||||
}, 'deleteRow(0) with no rows');
|
||||
</script>
|
||||
|
|
|
@ -51,4 +51,11 @@ test(function () {
|
|||
assert_equals(tbody.rows.length, 0);
|
||||
}, "HTMLTableSectionElement deleteRow(-1) with no rows");
|
||||
|
||||
test(function () {
|
||||
assert_equals(tbody.rows.length, 0);
|
||||
assert_throws("IndexSizeError", function () {
|
||||
tbody.deleteRow(0);
|
||||
});
|
||||
}, "HTMLTableSectionElement deleteRow(0) with no rows");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -51,4 +51,11 @@ test(function () {
|
|||
assert_equals(tr.cells.length, 0);
|
||||
}, "HTMLTableRowElement deleteCell(-1) with no cells");
|
||||
|
||||
test(function () {
|
||||
assert_equals(tr.cells.length, 0);
|
||||
assert_throws("IndexSizeError", function () {
|
||||
tr.deleteCell(0);
|
||||
});
|
||||
}, "HTMLTableRowElement deleteCell(0) with no cells");
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue