+2011-01-11 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Mihai Parparita.
+
+ maintain word diffs when converting to side-by-side and back
+ https://bugs.webkit.org/show_bug.cgi?id=52244
+
+ Using textContent would lose the spans use to make the word-diff highlighting.
+ Just move the span element itself.
+
+ * code-review.js:
+
2011-01-11 Ojan Vafai <ojan@chromium.org>
Reviewed by Adam Barth.
'</span><span class="to ' + lineNumberClassName + '">' + (to || ' ') +
'</span> <span class="text"></span>' +
'</div>');
- // Use text instead of innerHTML to avoid evaluting HTML.
- $('.text', line).text(contents);
+
+ $('.text', line).replaceWith(contents);
return line;
}
'</div>' +
'</div>');
- // Use text instead of innerHTML to avoid evaluting HTML.
- $('.text', line_side).text(contents);
+ $('.text', line_side).replaceWith(contents);
return line_side;
}
var convert_function = diff_type == 'sidebyside' ? sideBySideifyLine : unifyLine;
var from = fromLineNumber(line);
var to = toLineNumber(line);
- var contents = textContentsFor(line);
+ var contents = $('.text', line);
var classNames = classNamesForMovingLine(line);
var attributes = attributesForMovingLine(line);
var id = line.id;