Reviewed by Vicki.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2005 22:48:07 +0000 (22:48 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2005 22:48:07 +0000 (22:48 +0000)
        - fixed <rdar://problem/4125212> form submission delayed until you are on the next page on XML/XSL page (security hole)

        * khtml/xsl/xslt_processorimpl.cpp: (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
        Call setParsing(false) explicitly here. It's really annoying that setParsing(true) is done
        inside DOM::DocumentImpl and setParsing(false) is done by KHTMLPart, so that should be fixed
        some day, but for now this is the way to do it.

        Test cases added:
        * layout-tests/fast/events/xsl-onload-expected.txt: Added.
        * layout-tests/fast/events/xsl-onload.xhtml: Added.
        * layout-tests/fast/events/xsl-onload.xsl: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9225 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/fast/events/xsl-onload-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/xsl-onload.xhtml [new file with mode: 0644]
LayoutTests/fast/events/xsl-onload.xsl [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/xsl/xslt_processorimpl.cpp

diff --git a/LayoutTests/fast/events/xsl-onload-expected.txt b/LayoutTests/fast/events/xsl-onload-expected.txt
new file mode 100644 (file)
index 0000000..ca18274
--- /dev/null
@@ -0,0 +1,7 @@
+This is a regression test that checks for a problem where parsing would be stuck true and you'd never get a load event for an XSL-generated page
+
+If the test succeeds, the next paragraph will say "handled load event". If that message is missing, the test failed.
+
+Handled load event.
+
+
diff --git a/LayoutTests/fast/events/xsl-onload.xhtml b/LayoutTests/fast/events/xsl-onload.xhtml
new file mode 100644 (file)
index 0000000..5297e19
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<?xml-stylesheet type='text/xsl' href='xsl-onload.xsl'?>
+<body/>
diff --git a/LayoutTests/fast/events/xsl-onload.xsl b/LayoutTests/fast/events/xsl-onload.xsl
new file mode 100644 (file)
index 0000000..718b2c8
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+       <xsl:output method="html" indent="yes"/>
+
+       <xsl:template match="*|@*|processing-instruction()|comment()">
+               <xsl:copy>
+                       <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()"/>
+               </xsl:copy>
+       </xsl:template>
+
+<xsl:template match="body">
+       <body onload="document.getElementById('result').appendChild(document.createTextNode('Handled load event.'))">
+               <script>if (window.layoutTestController) { layoutTestController.dumpAsText(); }</script>
+               <p>This is a regression test that checks for a problem where parsing would be stuck true and you'd never get a load event for an XSL-generated page</p>
+               <p>If the test succeeds, the next paragraph will say "handled load event". If that message is missing, the test failed.</p>
+                <p id="result"/>
+       </body>
+</xsl:template>
+
+</xsl:stylesheet>
index 20e61c8d85b1e4b93f04aa50d45cbd40f176d30d..756ba06768868e4a99bcac1487576c0d25f4d4b5 100644 (file)
@@ -1,3 +1,19 @@
+2005-05-27  Darin Adler  <darin@apple.com>
+
+        Reviewed by Vicki.
+
+        - fixed <rdar://problem/4125212> form submission delayed until you are on the next page on XML/XSL page (security hole)
+
+        * khtml/xsl/xslt_processorimpl.cpp: (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
+        Call setParsing(false) explicitly here. It's really annoying that setParsing(true) is done
+        inside DOM::DocumentImpl and setParsing(false) is done by KHTMLPart, so that should be fixed
+        some day, but for now this is the way to do it.
+
+        Test cases added:
+        * layout-tests/fast/events/xsl-onload-expected.txt: Added.
+        * layout-tests/fast/events/xsl-onload.xhtml: Added.
+        * layout-tests/fast/events/xsl-onload.xsl: Added.
+
 2005-05-27  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Darin
index 8bd8eb91079fb2f9eda97d9b4fc0b7643f79a493..973b9654dfd36a8ccc88f87752ea53da232b76fa 100644 (file)
@@ -159,6 +159,7 @@ DocumentImpl* XSLTProcessorImpl::documentFromXMLDocPtr(xmlDocPtr resultDoc, xslt
         result->determineParseMode(m_resultOutput); // Make sure we parse in the correct mode.
         result->write(m_resultOutput);
         result->finishParsing();
+        result->setParsing(false);
         if (view)
             view->part()->checkCompleted();
         else