Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/syntax/parsing/common.js

Issue 1164243002: W3C Test: Import web-platform-tests/html/syntax. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 function mark_diffs(expected, actual) {
2 var expected_lines = expected.split("\n");
3 var actual_lines = actual.split("\n");
4
5 var max_length = Math.max(expected_lines.length, actual_lines.length);
6
7 var expected_diff = ["code", {}];
8 var actual_diff = ["code", {}];
9
10 for (var i=0; i<max_length; i++) {
11 if (expected_lines[i] === actual_lines[i]) {
12 expected_diff.push(expected_lines[i] + "\n");
13 actual_diff.push(actual_lines[i] + "\n");
14 } else {
15 if (expected_lines[i]) {
16 expected_diff.push(["span", {style:"color:red"}, expected_lines[i] + "\n "]);
17 }
18 if (actual_lines[i]) {
19 actual_diff.push(["span", {style:"color:red"}, actual_lines[i] + "\n"]);
20 }
21 }
22 }
23 return [expected_diff, actual_diff];
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698