Bug 11574 - REGRESSION: XSLT processing doesn't preserve location.href (Using XMLHttpRequest from script output by an XSLT transformation gives permission denied)
Summary: REGRESSION: XSLT processing doesn't preserve location.href (Using XMLHttpRequ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 420+
Hardware: Mac (PowerPC) OS X 10.4
: P1 Normal
Assignee: Nobody
URL: http://nypop.com/~ap/webkit/test.xml
Keywords: Regression
Depends on:
Blocks:
 
Reported: 2006-11-11 17:58 PST by Paul Hickman
Modified: 2006-12-19 11:25 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hickman 2006-11-11 17:58:59 PST
I have two XML pages. The first one, test.xml contains one line:

<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href="test2.xml" type="text/xsl"?><root />



The second, test2.xml is a simple XSLT stylesheet that generates an HTML page containing javascript. The javascript in the page attempts to download another copy of test2.xml using XMLHttpRequest. However, it gets a permission denied error, presumably because the result of the XSLT transformation in the original XML file has lost its connection to the domain name of the server from which the files were downloaded.

<?xml version="1.0" encoding="utf-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" omit-xml-declaration="yes"/>
	<xsl:template match="/root">
		<html>		
			<script type="text/javascript">
				var xmlhttp = new XMLHttpRequest();
				xmlhttp.open("GET",location.href,true);
				xmlhttp.send("");
				alert("ok");
			</script>		
		</html>
	</xsl:template>
</xsl:transform>




Neither IE 6/7 or Firefox 1/2 have a problem running this code. Tests were performed using the Webkit nightly downloaded 10 Nov 2006.
Comment 1 Alexey Proskuryakov 2006-11-12 02:44:02 PST
Confirmed as a regression.

See also: bug 5219 (a similar problem with document.URL that was fixed).
Comment 2 Alexey Proskuryakov 2006-12-19 11:25:37 PST
Fixed by Alice in r18301.