See summary.
Created attachment 30243 [details] patch
Landed as http://trac.webkit.org/changeset/43574.