mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
24
tests/wpt/web-platform-tests/html/syntax/parsing/common.js
Normal file
24
tests/wpt/web-platform-tests/html/syntax/parsing/common.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
function mark_diffs(expected, actual) {
|
||||
var expected_lines = expected.split("\n");
|
||||
var actual_lines = actual.split("\n");
|
||||
|
||||
var max_length = Math.max(expected_lines.length, actual_lines.length);
|
||||
|
||||
var expected_diff = ["code", {}];
|
||||
var actual_diff = ["code", {}];
|
||||
|
||||
for (var i=0; i<max_length; i++) {
|
||||
if (expected_lines[i] === actual_lines[i]) {
|
||||
expected_diff.push(expected_lines[i] + "\n");
|
||||
actual_diff.push(actual_lines[i] + "\n");
|
||||
} else {
|
||||
if (expected_lines[i]) {
|
||||
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"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return [expected_diff, actual_diff];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue