Update web-platform-tests and CSS tests.

- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180.
- Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
Ms2ger 2017-02-06 11:06:12 +01:00
parent fb4f421c8b
commit 296fa2512b
21852 changed files with 2080936 additions and 892894 deletions

View file

@ -0,0 +1,16 @@
<!doctype html>
<title>Set location.pathname to ?</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<iframe src=/common/blank.html></iframe>
<script>
async_test((t) => {
onload = t.step_func(() => {
self[0].frameElement.onload = t.step_func_done(() => {
assert_equals(self[0].location.pathname, "/%3F")
})
self[0].location.pathname = "?"
})
})
</script>

View file

@ -0,0 +1,34 @@
<!doctype html>
<title>Set location.protocol from an HTTP URL</title>
<!-- In particular, valid non-broken schemes that are nevertheless not going to work -->
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<script>
self.onload = () => {
[
'x',
'data',
'file',
'ftp',
'gopher',
'http+x'
].forEach((val, index) => {
async_test((t) => {
self[index].location.protocol = val
t.step_timeout(() => {
assert_equals(self[index].location.protocol, location.protocol)
assert_equals(self[index].location.host, location.host)
assert_equals(self[index].location.port, location.port)
t.done()
}, 500)
}, "Set location.protocol to " + val)
})
}
</script>

View file

@ -0,0 +1,60 @@
<!doctype html>
<title>Set location.protocol to a non-broken-non-functioning scheme</title>
<!-- In particular, valid non-broken schemes that are nevertheless not going to work -->
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
self.onload = () => {
[
'x',
'data',
// 'mailto' opens an email client in Firefox...
'file',
'ftp',
'gopher',
'http+x'
].forEach((val) => {
async_test((t) => {
// HTTP URL <iframe>
const frame = document.createElement("iframe")
frame.src = "/common/blank.html"
frame.onload = t.step_func(() => {
frame.contentWindow.location.protocol = val
t.step_timeout(() => {
assert_equals(frame.contentWindow.location.protocol, location.protocol)
assert_equals(frame.contentWindow.location.host, location.host)
assert_equals(frame.contentWindow.location.port, location.port)
t.done()
}, 500)
})
document.body.appendChild(frame)
}, "Set HTTP URL frame location.protocol to " + val)
async_test((t) => {
// data URL <iframe>
const dataFrame = document.createElement("iframe")
const channel = new MessageChannel()
dataFrame.src = `data:text/html,<script>
onmessage = (e) => {
let result = false;
try {
location.protocol = e.data
} catch(e) {
result = true
}
setTimeout(() => e.ports[0].postMessage([result, location.protocol]), 100)
}
<\/script>`
dataFrame.onload = t.step_func(() => {
dataFrame.contentWindow.postMessage(val, "*", [channel.port2])
})
channel.port1.onmessage = t.step_func_done((e) => {
assert_false(e.data[0])
assert_equals(e.data[1], "data:")
})
document.body.appendChild(dataFrame)
}, "Set data URL frame location.protocol to " + val)
})
}
</script>

View file

@ -0,0 +1,106 @@
<!doctype html>
<title>Set location.protocol to broken schemes</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<iframe src="data:text/html,<script>
onmessage = (e) => {
let results = [];
e.data.forEach((val) => {
try {
location.protocol = val;
results.push('failure')
} catch(e) {
results.push(e.name)
}
});
parent.postMessage(results, '*')
}
</script>"></iframe>
<iframe srcdoc="<script>
onmessage = (e) => {
let results = [];
e.data.forEach((val) => {
try {
location.protocol = val;
results.push('failure')
} catch(e) {
results.push(e.name)
}
});
parent.postMessage(results, '*')
}
</script>"></iframe>
<script>
let broken = [
'\x00',
'\x01',
'\x0A',
'\x20',
'\x21',
'\x7F',
'\x80',
'\xFF',
':',
'†',
'\x00x',
'\x01x',
'\x0Ax',
'\x20x',
'\x21x',
'\x7Fx',
'\x80x',
'\xFFx',
':x',
'†x',
'\x00X',
'\x01X',
'\x0AX',
'\x20X',
'\x21X',
'\x7FX',
'\x80X',
'\xFFX',
':X',
'†X',
'x\x00',
'x\x01',
'x\x0A',
'x\x20',
'x\x21',
'x\x7F',
'x\x80',
'x\xFF',
'x†',
'X\x00',
'X\x01',
'X\x0A',
'X\x20',
'X\x21',
'X\x7F',
'X\x80',
'X\xFF',
'X†',
'a\x0A',
'a+-.\x0A'
]
;broken.forEach((val) => {
test(() => {
assert_throws("SyntaxError", () => { location.protocol = val })
}, encodeURI(val) + " (percent-encoded) is not a scheme")
})
let c = 0
async_test((t) => {
self.onload = t.step_func(() => {
self.onmessage = t.step_func((e) => {
assert_array_equals(e.data, ("SyntaxError ".repeat(49) + "SyntaxError").split(" "))
c++
if(c === 2) {
t.done()
}
})
self[0].postMessage(broken, "*")
self[1].postMessage(broken, "*")
})
}, "Equivalent tests for data URL and srcdoc <iframe>s")
</script>