these two methods seem to use nearly the same code. That code should be factored into a common method
Created attachment 62704 [details] Patch
http://trac.webkit.org/changeset/64139