Commit a2eb10ab authored by ap@webkit.org's avatar ap@webkit.org

Reviewed by Adam.

        http://bugs.webkit.org/show_bug.cgi?id=18259
        XML+XSLT pages in iframe contains document.location of a parent window

        Test: fast/xsl/subframe-location.html

        * xml/XSLTProcessor.cpp:
        (WebCore::XSLTProcessor::createDocumentFromSource): Set resulting document URL before opening
        it, so that the document loader picks a correct URL, too.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7a274f51
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Adam.
http://bugs.webkit.org/show_bug.cgi?id=18259
XML+XSLT pages in iframe contains document.location of a parent window
* fast/xsl/resources/subframe-location-frame.xml: Added.
* fast/xsl/resources/subframe-location-frame.xsl: Added.
* fast/xsl/subframe-location-expected.txt: Added.
* fast/xsl/subframe-location.html: Added.
2008-04-15 Justin Garcia <justin.garcia@apple.com>
Reviewed by Oliver.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="subframe-location-frame.xsl"?>
<boo/>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>Frame 2</title>
</head>
<body>
<script>
alert(/resources/.test(document.location) ? "SUCCESS" : ("FAILURE: " + document.location));
</script>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
ALERT: SUCCESS
Test that a document in a subframe processed with XSLT has a correct location. (bug 18259).
<html>
<head>
<title>Frames</title>
</head>
<body>
<p>Test that a document in a subframe processed with XSLT has a correct location.
(<a href='http://bugs.webkit.org/show_bug.cgi?id=18259'>bug 18259</a>).</p>
<Script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</Script>
<iframe src="resources/subframe-location-frame.xml"></iframe>
</body>
</html>
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Adam.
http://bugs.webkit.org/show_bug.cgi?id=18259
XML+XSLT pages in iframe contains document.location of a parent window
Test: fast/xsl/subframe-location.html
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Set resulting document URL before opening
it, so that the document loader picks a correct URL, too.
2008-04-16 Dan Bernstein <mitz@apple.com>
Rubber-stamped by John Sullivan.
......@@ -254,11 +254,11 @@ RefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourceStr
frame->setDocument(result);
}
result->open();
if (sourceIsDocument) {
result->setURL(ownerDocument->url());
result->setBaseURL(ownerDocument->baseURL());
}
result->open();
RefPtr<TextResourceDecoder> decoder = new TextResourceDecoder(sourceMIMEType);
decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncoding(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment