mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Update web-platform-tests to revision 6856483bcc86322198f10e0c42385a7f9127eb66
This commit is contained in:
parent
b1a2b6b5bf
commit
ff06f1d031
265 changed files with 7539 additions and 988 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=windows-1252>
|
||||
<title>Character Decoding: UTF-32 (not supported) subresource of windows-1252 document</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
// Since UTF-32 is not supported:
|
||||
// * HTML resources will use the parent encoding (windows-1252)
|
||||
// * XML resources will default to UTF-8
|
||||
// ... except for the UTF-32LE-with-BOM case, where the UTF-32
|
||||
// BOM will be mistaken for a UTF-16LE BOM (FF FE 00 00), in which
|
||||
// case it will be interpreted as UTF-16LE.
|
||||
|
||||
const samples = [
|
||||
{file: 'resources/utf-32-big-endian-bom.html',
|
||||
characterSet: 'windows-1252',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-big-endian-bom.xml',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'application/xml'
|
||||
},
|
||||
{file: 'resources/utf-32-big-endian-nobom.html',
|
||||
characterSet: 'windows-1252',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-big-endian-nobom.xml',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'application/xml'
|
||||
},
|
||||
|
||||
{file: 'resources/utf-32-little-endian-bom.html',
|
||||
characterSet: 'UTF-16LE',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-little-endian-bom.xml',
|
||||
characterSet: 'UTF-16LE',
|
||||
contentType: 'application/xml'
|
||||
},
|
||||
{file: 'resources/utf-32-little-endian-nobom.html',
|
||||
characterSet: 'windows-1252',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-little-endian-nobom.xml',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'application/xml'
|
||||
}
|
||||
];
|
||||
|
||||
samples.forEach(expected => async_test(t => {
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.src = expected.file;
|
||||
iframe.onload = t.step_func_done(() => {
|
||||
const doc = iframe.contentDocument;
|
||||
assert_equals(doc.contentType, expected.contentType);
|
||||
assert_equals(doc.characterSet, expected.characterSet);
|
||||
// The following is a little quirky as non-well-formed XML isn't defined in sufficient detail to
|
||||
// be able to use more precise assertions.
|
||||
assert_true(
|
||||
!('dataset' in doc.documentElement) ||
|
||||
doc.documentElement.dataset['parsed'] !== 'yes',
|
||||
'Should not have parsed as (X)HTML');
|
||||
});
|
||||
document.body.appendChild(iframe);
|
||||
t.add_cleanup(() => iframe.remove());
|
||||
}, `Expect ${expected.file} to parse as ${expected.characterSet}`));
|
||||
|
||||
</script>
|
||||
</body>
|
|
@ -1,37 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Character Decoding: UTF-32 (not supported)</title>
|
||||
<meta charset=utf-8>
|
||||
<title>Character Decoding: UTF-32 (not supported) subresource of UTF-8 document</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
// Since UTF-32 is not supported, such content will be interpreted
|
||||
// as the default HTML encoding (windows-1252) unless it has a
|
||||
// leading little endian BOM (FF FE 00 00), in which case it will
|
||||
// be interpreted as UTF-16LE.
|
||||
// Since UTF-32 is not supported:
|
||||
// * HTML resources will use the parent encoding (UTF-8)
|
||||
// * XML resources will default to UTF-8
|
||||
// ... except for the UTF-32LE-with-BOM case, where the UTF-32
|
||||
// BOM will be mistaken for a UTF-16LE BOM (FF FE 00 00), in which
|
||||
// case it will be interpreted as UTF-16LE.
|
||||
|
||||
const samples = [
|
||||
{file: 'resources/utf-32-big-endian-bom.html', expected: 'windows-1252'},
|
||||
{file: 'resources/utf-32-big-endian-bom.xml', expected: 'windows-1252'},
|
||||
{file: 'resources/utf-32-big-endian-nobom.html', expected: 'windows-1252'},
|
||||
{file: 'resources/utf-32-big-endian-nobom.xml', expected: 'windows-1252'},
|
||||
{file: 'resources/utf-32-big-endian-bom.html',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-big-endian-bom.xml',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'application/xml'
|
||||
},
|
||||
{file: 'resources/utf-32-big-endian-nobom.html',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-big-endian-nobom.xml',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'application/xml'
|
||||
},
|
||||
|
||||
{file: 'resources/utf-32-little-endian-bom.html', expected: 'UTF-16LE'},
|
||||
{file: 'resources/utf-32-little-endian-bom.xml', expected: 'UTF-16LE'},
|
||||
{file: 'resources/utf-32-little-endian-nobom.html', expected: 'windows-1252'},
|
||||
{file: 'resources/utf-32-little-endian-nobom.xml', expected: 'windows-1252'}
|
||||
{file: 'resources/utf-32-little-endian-bom.html',
|
||||
characterSet: 'UTF-16LE',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-little-endian-bom.xml',
|
||||
characterSet: 'UTF-16LE',
|
||||
contentType: 'application/xml'
|
||||
},
|
||||
{file: 'resources/utf-32-little-endian-nobom.html',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'text/html'
|
||||
},
|
||||
{file: 'resources/utf-32-little-endian-nobom.xml',
|
||||
characterSet: 'UTF-8',
|
||||
contentType: 'application/xml'
|
||||
}
|
||||
];
|
||||
|
||||
samples.forEach(sample => async_test(t => {
|
||||
samples.forEach(expected => async_test(t => {
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.src = sample.file;
|
||||
iframe.onload = t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.characterSet, sample.expected);
|
||||
t.done();
|
||||
iframe.src = expected.file;
|
||||
iframe.onload = t.step_func_done(() => {
|
||||
const doc = iframe.contentDocument;
|
||||
assert_equals(doc.contentType, expected.contentType);
|
||||
assert_equals(doc.characterSet, expected.characterSet);
|
||||
// The following is a little quirky as non-well-formed XML isn't defined in sufficient detail to
|
||||
// be able to use more precise assertions.
|
||||
assert_true(
|
||||
!('dataset' in doc.documentElement) ||
|
||||
doc.documentElement.dataset['parsed'] !== 'yes',
|
||||
'Should not have parsed as (X)HTML');
|
||||
});
|
||||
document.body.appendChild(iframe);
|
||||
t.add_cleanup(() => iframe.remove());
|
||||
}, `Expect ${sample.file} to parse as ${sample.expected}`));
|
||||
}, `Expect ${expected.file} to parse as ${expected.characterSet}`));
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue