I think Bug 1012662 has already fixed this. You can try your test on Nightly. It works! :)
I was able to reproduce the issue on Mac OS X 10.10.4 using Firefox 38.0 (20150429135941) and the str from Comment 0. The issue is no longer reproducible on Mac OS X 10.10.4 and Windows 10 x86 using latest Nightly 44.0a1 (20151008030232) and below, so it seems that this has been indeed fixed by Bug 1012662.