mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 075802c1d3387d07e31cd5887459d539b1297c8d.
This commit is contained in:
parent
10127d6b5a
commit
881fe95cd1
1617 changed files with 57062 additions and 2789 deletions
|
@ -5,7 +5,7 @@ function mark_diffs(expected, actual) {
|
|||
var max_length = Math.max(expected_lines.length, actual_lines.length);
|
||||
|
||||
var expected_diff = ["code", {}];
|
||||
var actual_diff = ["code", {}];
|
||||
var actual_diff = ["code", {}];
|
||||
|
||||
for (var i=0; i<max_length; i++) {
|
||||
if (expected_lines[i] === actual_lines[i]) {
|
||||
|
@ -13,12 +13,12 @@ function mark_diffs(expected, actual) {
|
|||
actual_diff.push(actual_lines[i] + "\n");
|
||||
} else {
|
||||
if (expected_lines[i]) {
|
||||
expected_diff.push(["span", {style:"color:red"}, expected_lines[i] + "\n"]);
|
||||
expected_diff.push(["span", {style:"color:red"}, expected_lines[i] + "\n"]);
|
||||
}
|
||||
if (actual_lines[i]) {
|
||||
actual_diff.push(["span", {style:"color:red"}, actual_lines[i] + "\n"]);
|
||||
if (actual_lines[i]) {
|
||||
actual_diff.push(["span", {style:"color:red"}, actual_lines[i] + "\n"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return [expected_diff, actual_diff];
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -8,29 +8,29 @@
|
|||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=named-character-references-data.js></script>
|
||||
<script>
|
||||
(function() {
|
||||
(function() {
|
||||
|
||||
function pad(string, totalCharacters) {
|
||||
return totalCharacters < string.length ? string : (Array(totalCharacters + 1).join('0') + string).slice(-totalCharacters);
|
||||
}
|
||||
function pad(string, totalCharacters) {
|
||||
return totalCharacters < string.length ? string : (Array(totalCharacters + 1).join('0') + string).slice(-totalCharacters);
|
||||
}
|
||||
|
||||
var dummy = document.createElement('p');
|
||||
var dummy = document.createElement('p');
|
||||
|
||||
Object.keys(data).forEach(function(entity) {
|
||||
var object = data[entity];
|
||||
dummy.innerHTML = entity;
|
||||
test(
|
||||
function() {
|
||||
assert_equals(
|
||||
dummy.textContent,
|
||||
object.characters
|
||||
);
|
||||
},
|
||||
entity + ' should match ' + object.codepoints.map(function(codePoint) {
|
||||
return 'U+' + pad(codePoint.toString(16).toUpperCase(), 5);
|
||||
}).join(' ')
|
||||
);
|
||||
});
|
||||
Object.keys(data).forEach(function(entity) {
|
||||
var object = data[entity];
|
||||
dummy.innerHTML = entity;
|
||||
test(
|
||||
function() {
|
||||
assert_equals(
|
||||
dummy.textContent,
|
||||
object.characters
|
||||
);
|
||||
},
|
||||
entity + ' should match ' + object.codepoints.map(function(codePoint) {
|
||||
return 'U+' + pad(codePoint.toString(16).toUpperCase(), 5);
|
||||
}).join(' ')
|
||||
);
|
||||
});
|
||||
|
||||
}());
|
||||
</script>
|
||||
}());
|
||||
</script>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
var namespaces = {
|
||||
"html":"http://www.w3.org/1999/xhtml",
|
||||
"mathml":"http://www.w3.org/1998/Math/MathML",
|
||||
"svg":"http://www.w3.org/2000/svg",
|
||||
"xlink":"http://www.w3.org/1999/xlink",
|
||||
"xml":"http://www.w3.org/XML/1998/namespace",
|
||||
"xmlns":"http://www.w3.org/2000/xmlns/"
|
||||
"html":"http://www.w3.org/1999/xhtml",
|
||||
"mathml":"http://www.w3.org/1998/Math/MathML",
|
||||
"svg":"http://www.w3.org/2000/svg",
|
||||
"xlink":"http://www.w3.org/1999/xlink",
|
||||
"xml":"http://www.w3.org/XML/1998/namespace",
|
||||
"xmlns":"http://www.w3.org/2000/xmlns/"
|
||||
};
|
||||
|
||||
var prefixes = {};
|
||||
|
@ -73,24 +73,24 @@ function test_serializer(element) {
|
|||
lines.push(format("|%s<%s>", indent_spaces, name));
|
||||
|
||||
var attributes = Array.prototype.map.call(
|
||||
element.attributes,
|
||||
function(attr) {
|
||||
var name = (attr.namespaceURI ? prefixes[attr.namespaceURI] + " " : "") +
|
||||
attr.localName;
|
||||
return [name, attr.value];
|
||||
});
|
||||
element.attributes,
|
||||
function(attr) {
|
||||
var name = (attr.namespaceURI ? prefixes[attr.namespaceURI] + " " : "") +
|
||||
attr.localName;
|
||||
return [name, attr.value];
|
||||
});
|
||||
attributes.sort(function (a, b) {
|
||||
var x = a[0];
|
||||
var y = b[0];
|
||||
if (x === y) {
|
||||
return 0;
|
||||
}
|
||||
return x > y ? 1 : -1;
|
||||
});
|
||||
var x = a[0];
|
||||
var y = b[0];
|
||||
if (x === y) {
|
||||
return 0;
|
||||
}
|
||||
return x > y ? 1 : -1;
|
||||
});
|
||||
|
||||
attributes.forEach(
|
||||
function(attr) {
|
||||
var indent_spaces = (new Array(indent + 2)).join(" ");
|
||||
var indent_spaces = (new Array(indent + 2)).join(" ");
|
||||
lines.push(format("|%s%s=\"%s\"", indent_spaces, attr[0], attr[1]));
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue