In an HTML result of XSLT processing, document.URL is empty.
Created attachment 4129 [details] test case
Created attachment 4130 [details] proposed patch The test case doesn't work in Firefox as is (it crashes), but Firefox does have the expected behavior of preserving document.URL.
Comment on attachment 4130 [details] proposed patch Looks great. r=me.
Could this be the same problem that caused bug 4054?