Patch forthcoming.
Created attachment 190452 [details] the patch
I'm going to hold off on this, because it might be rendered redundant by other things I'm doing.
Actually, no, I'll land it: it clearly fixes a bug that our code has right now; I can always roll it out when I do the more comprehensive fix.
Landed in http://trac.webkit.org/changeset/144219