Make contentsToWindow/windowToContents cross-platform
Created attachment 23870 [details] Patch
Fixed in r36988.