http://bugs.webkit.org/show_bug.cgi?id=15368
xsl:import fails when preceded by comment
Test: fast/xsl/import-after-comment.xml
* xml/XSLStyleSheet.cpp:
(WebCore::XSLStyleSheet::loadChildSheets): It's OK for xsl:import to be preceded by
non-element nodes.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26511
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-10-07 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ http://bugs.webkit.org/show_bug.cgi?id=15368
+ xsl:import fails when preceded by comment
+
+ * fast/xsl/import-after-comment-expected.txt: Added.
+ * fast/xsl/import-after-comment.xml: Added.
+ * fast/xsl/resources/import-after-comment-stylesheet.xsl: Added.
+ * fast/xsl/resources/import-after-comment-transform.xsl: Added.
+
2007-10-07 Vincent Ricard <magic@magicninja.org>
Reviewed by Maciej. Landed by eseidel.
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet type='text/xsl' href='resources/import-after-comment-stylesheet.xsl'?>
+<doc/>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<!-- Comment -->
+<xsl:import href="import-after-comment-transform.xsl"/>
+</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:template match="*">
+ <html>
+ <body>
+ <script>if (window.layoutTestController) layoutTestController.dumpAsText();</script>
+ <p>SUCCESS</p>
+ </body>
+ </html>
+ </xsl:template>
+
+</xsl:transform>
+2007-10-07 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ http://bugs.webkit.org/show_bug.cgi?id=15368
+ xsl:import fails when preceded by comment
+
+ Test: fast/xsl/import-after-comment.xml
+
+ * xml/XSLStyleSheet.cpp:
+ (WebCore::XSLStyleSheet::loadChildSheets): It's OK for xsl:import to be preceded by
+ non-element nodes.
+
2007-10-07 Vincent Ricard <magic@magicninja.org>
Reviewed by Maciej. Landed by eseidel.
namespace WebCore {
-#define IS_BLANK_NODE(n) \
- (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))
-
XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href)
: StyleSheet(parentRule, href)
, m_ownerDocument(0)
// Imports must occur first.
xmlNodePtr curr = stylesheetRoot->children;
while (curr) {
- if (IS_BLANK_NODE(curr)) {
+ if (curr->type != XML_ELEMENT_NODE) {
curr = curr->next;
continue;
}
- if (curr->type == XML_ELEMENT_NODE && IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "import")) {
+ if (IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "import")) {
xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE);
loadChildSheet(DeprecatedString::fromUtf8((const char*)uriRef));
xmlFree(uriRef);