mirror of
https://github.com/servo/servo.git
synced 2025-10-17 16:59:27 +01:00
This patch implements the following changes: - Only check for the toplevel/sublevel part of the mime type when deciding if it's a js or css resource, ignoring the mime parameters. - Fix the wpt tests that did not escape url parameters properly and also used an invalid syntax for the mime parameter. - Update the wpt manifest.
27 lines
822 B
HTML
27 lines
822 B
HTML
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<div id=log></div>
|
|
<script>
|
|
// Note: images get always sniffed, nosniff doesn't do anything
|
|
var passes = [null, "", "x", "x/x", "image/gif", "image/png", "image/png;blah"]
|
|
|
|
const get_url = (mime) => {
|
|
let url = "resources/image.py"
|
|
if (mime != null) {
|
|
url += "?type=" + encodeURIComponent(mime)
|
|
}
|
|
return url
|
|
}
|
|
|
|
passes.forEach(function(mime) {
|
|
async_test(function(t) {
|
|
var img = document.createElement("img")
|
|
img.onerror = t.unreached_func("Unexpected error event")
|
|
img.onload = t.step_func_done(function(){
|
|
assert_equals(img.width, 96)
|
|
})
|
|
img.src = get_url(mime)
|
|
document.body.appendChild(img)
|
|
}, "URL query: " + mime)
|
|
})
|
|
</script>
|