Reviewed by ggaren & TimH.
<rdar://problem/
4473288> XSL file containing <xsl:include href="../Styles/EscapeString.xsl" /> fails to load file
XML_DTD_NODE objects in the tree were causing loadChildSheets to
fail to preload child stylesheets, this patch causes us to
correctly ignore all nodes besides the first XML_ELEMENT_NODE at
the root level when searching the tree for xsl:include statements
to pre-load.
Test: fast/xsl/xslt-second-level-import.xml
* khtml/xsl/xsl_stylesheetimpl.cpp:
(WebCore::XSLStyleSheetImpl::loadChildSheets):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13277
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-03-13 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by ggaren & TimH.
+
+ * fast/xsl/resources/xslt-second-level-import.xsl: Added.
+ * fast/xsl/resources/xslt-second-level-import.xsl.dtd: Added.
+ * fast/xsl/resources/xslt-second-level-import2.xsl: Added.
+ * fast/xsl/xslt-second-level-import-expected.txt: Added.
+ * fast/xsl/xslt-second-level-import.xml: Added.
+
2006-03-12 Rob Buis <buis@kde.org>
Reviewed by darin. Landed by eseidel.
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xsl:stylesheet SYSTEM "resources/xslt-second-level-import.xsl.dtd">
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:include href="xslt-second-level-import2.xsl" />
+ <xsl:template match="/">
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ </script>
+ <p>&success;</p>
+ </xsl:template>
+</xsl:stylesheet>
--- /dev/null
+<!ENTITY success "SUCCESS">
--- /dev/null
+<?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" encoding="UTF-8"/>
+</xsl:stylesheet>
--- /dev/null
+SUCCESS
+
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet type="text/xsl" href="resources/xslt-second-level-import.xsl"?>
+<stub>
+FAIL
+
+This test checks to make sure that XML_DTD_NODE objects being at the top level of an external stylesheet does not cause pre-loading of child stylesheets to fail.
+
+</stub>
+2006-03-13 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by ggaren & TimH.
+
+ <rdar://problem/4473288> XSL file containing <xsl:include href="../Styles/EscapeString.xsl" /> fails to load file
+ XML_DTD_NODE objects in the tree were causing loadChildSheets to
+ fail to preload child stylesheets, this patch causes us to
+ correctly ignore all nodes besides the first XML_ELEMENT_NODE at
+ the root level when searching the tree for xsl:include statements
+ to pre-load.
+
+ Test: fast/xsl/xslt-second-level-import.xml
+
+ * khtml/xsl/xsl_stylesheetimpl.cpp:
+ (WebCore::XSLStyleSheetImpl::loadChildSheets):
+
2006-03-10 Rob Buis <buis@kde.org>
Reviewed by darin. Landed by eseidel.
return;
xmlNodePtr stylesheetRoot = document()->children;
+
+ // Top level children may include other things such as DTD nodes, we ignore those.
+ while (stylesheetRoot && stylesheetRoot->type != XML_ELEMENT_NODE)
+ stylesheetRoot = stylesheetRoot->next;
+
if (m_embedded) {
// We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the
// import/include list.
xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(href().qstring().utf8().data()));
- if (idNode == NULL)
+ if (!idNode)
return;
stylesheetRoot = idNode->parent;
} else {