Present diff calculation is incomplete, it does not properly handle the following case: [a, b, c, d, e, f, g, h] => [c, d, e, f, g, h, a, b] It detects [a, b] as the lcs. I imported jsdifflib from https://github.com/cemerick/jsdifflib. It has BSD license that is compatible with WebKit.
Created attachment 146877 [details] Patch
Committed r120085: <http://trac.webkit.org/changeset/120085>