mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision e3cf1284464a4a3e46fd15e4138f8e32c6cecdd8
This commit is contained in:
parent
b20333a324
commit
c5c325d8bb
57 changed files with 1422 additions and 493 deletions
|
@ -2383,6 +2383,42 @@ policies and contribution forms [3].
|
|||
return duplicates;
|
||||
};
|
||||
|
||||
function code_unit_str(char) {
|
||||
return 'U+' + char.charCodeAt(0).toString(16);
|
||||
}
|
||||
|
||||
function sanitize_unpaired_surrogates(str) {
|
||||
return str.replace(/([\ud800-\udbff])(?![\udc00-\udfff])/g,
|
||||
function(_, unpaired)
|
||||
{
|
||||
return code_unit_str(unpaired);
|
||||
})
|
||||
// This replacement is intentionally implemented without an
|
||||
// ES2018 negative lookbehind assertion to support runtimes
|
||||
// which do not yet implement that language feature.
|
||||
.replace(/(^|[^\ud800-\udbff])([\udc00-\udfff])/g,
|
||||
function(_, previous, unpaired) {
|
||||
if (/[\udc00-\udfff]/.test(previous)) {
|
||||
previous = code_unit_str(previous);
|
||||
}
|
||||
|
||||
return previous + code_unit_str(unpaired);
|
||||
});
|
||||
}
|
||||
|
||||
function sanitize_all_unpaired_surrogates(tests) {
|
||||
forEach (tests,
|
||||
function (test)
|
||||
{
|
||||
var sanitized = sanitize_unpaired_surrogates(test.name);
|
||||
|
||||
if (test.name !== sanitized) {
|
||||
test.name = sanitized;
|
||||
delete test._structured_clone;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Tests.prototype.notify_complete = function() {
|
||||
var this_obj = this;
|
||||
var duplicates;
|
||||
|
@ -2390,6 +2426,11 @@ policies and contribution forms [3].
|
|||
if (this.status.status === null) {
|
||||
duplicates = this.find_duplicates();
|
||||
|
||||
// Some transports adhere to UTF-8's restriction on unpaired
|
||||
// surrogates. Sanitize the titles so that the results can be
|
||||
// consistently sent via all transports.
|
||||
sanitize_all_unpaired_surrogates(this.tests);
|
||||
|
||||
// Test names are presumed to be unique within test files--this
|
||||
// allows consumers to use them for identification purposes.
|
||||
// Duplicated names violate this expectation and should therefore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue