[webkit-changes] cvs commit: LayoutTests/fast/xsl/resources
findme.xml
Alexey
ap at opensource.apple.com
Mon Jan 2 18:07:14 PST 2006
ap 06/01/02 18:07:14
Modified: khtml/xsl xslt_processorimpl.cpp
. ChangeLog
. ChangeLog
Added: fast/xsl xslt-relative-path.xml
xslt-relative-path-expected.txt
xslt-relative-path-expected.png
xslt-relative-path-expected.checksum
fast/xsl/resources findme.xml
Log:
Reviewed by Eric.
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5609
XSLT document() doesn't handle relative paths
Test case: fast/xsl/xslt-relative-path.xml
* khtml/xsl/xslt_processorimpl.cpp:
(DOM::docLoaderFunc): Renamed from stylesheetLoadFunc. Use base URL when constructing URLs.
(DOM::XSLTProcessorImpl::transformToString):
Revision Changes Path
1.22 +4 -3 WebCore/khtml/xsl/xslt_processorimpl.cpp
Index: xslt_processorimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xsl/xslt_processorimpl.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- xslt_processorimpl.cpp 30 Dec 2005 05:33:17 -0000 1.21
+++ xslt_processorimpl.cpp 3 Jan 2006 02:07:11 -0000 1.22
@@ -64,7 +64,7 @@
// FIXME: There seems to be no way to control the ctxt pointer for loading here, thus we have globals.
static XSLTProcessorImpl *globalProcessor = 0;
static khtml::DocLoader *globalDocLoader = 0;
-static xmlDocPtr stylesheetLoadFunc(const xmlChar *uri,
+static xmlDocPtr docLoaderFunc(const xmlChar *uri,
xmlDictPtr dict,
int options,
void* ctxt,
@@ -75,7 +75,8 @@
switch (type) {
case XSLT_LOAD_DOCUMENT: {
- KURL url = KURL((char *)uri);
+ xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt;
+ KURL url((const char *)xmlNodeGetBase(context->document->doc, context->node), (const char *)uri);
KURL finalURL;
KIO::TransferJob *job = KIO::get(url, true, false);
QByteArray data;
@@ -296,7 +297,7 @@
RefPtr<DocumentImpl> ownerDocument = sourceNode->getDocument();
RefPtr<XSLStyleSheetImpl> cachedStylesheet = m_stylesheet;
- setXSLTLoadCallBack(stylesheetLoadFunc, this, ownerDocument->docLoader());
+ setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->docLoader());
xsltStylesheetPtr sheet = xsltStylesheetPointer(cachedStylesheet, m_stylesheetRootNode.get());
if (!sheet) {
setXSLTLoadCallBack(0, 0, 0);
1.73 +13 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- ChangeLog 3 Jan 2006 00:13:34 -0000 1.72
+++ ChangeLog 3 Jan 2006 02:07:12 -0000 1.73
@@ -1,3 +1,16 @@
+2006-01-03 Alexey Proskuryakov <ap at nypop.com>
+
+ Reviewed by Eric.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5609
+ XSLT document() doesn't handle relative paths
+
+ Test case: fast/xsl/xslt-relative-path.xml
+
+ * khtml/xsl/xslt_processorimpl.cpp:
+ (DOM::docLoaderFunc): Renamed from stylesheetLoadFunc. Use base URL when constructing URLs.
+ (DOM::XSLTProcessorImpl::transformToString):
+
2006-01-02 Vicki Murley <vicki at apple.com>
Reviewed by Maciej.
1.211 +13 -0 LayoutTests/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/LayoutTests/ChangeLog,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -r1.210 -r1.211
--- ChangeLog 30 Dec 2005 22:17:03 -0000 1.210
+++ ChangeLog 3 Jan 2006 02:07:12 -0000 1.211
@@ -1,3 +1,16 @@
+2006-01-03 Alexey Proskuryakov <ap at nypop.com>
+
+ Reviewed by Eric.
+
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=5609
+ XSLT document() doesn't handle relative paths
+
+ * fast/xsl/xslt-relative-path.xml: Added.
+ * fast/xsl/resources/findme.xml: Added.
+ * fast/xsl/xslt-relative-path-expected.txt: Added.
+ * fast/xsl/xslt-relative-path-expected.checksum: Added.
+ * fast/xsl/xslt-relative-path-expected.png: Added.
+
2005-12-30 Alexey Proskuryakov <ap at nypop.com>
Reviewed by Darin.
1.1 LayoutTests/fast/xsl/xslt-relative-path.xml
Index: xslt-relative-path.xml
===================================================================
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="#stylesheet"?>
<!DOCTYPE doc [
<!ELEMENT xsl:stylesheet ANY>
<!ATTLIST xsl:stylesheet id ID #REQUIRED>
]>
<doc>
<xsl:stylesheet version="1.0" id="stylesheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="xsl:stylesheet"/>
<xsl:variable name="method1">file:resources/findme.xml</xsl:variable>
<xsl:variable name="method2">resources/findme.xml</xsl:variable>
<xsl:template match="doc">
<html>
<head>
<title>Testing Webkit</title>
</head>
<body>
<p>Here is an attempt to extract the string "Hello, Webkit!" from the file findme.xml:</p>
<p>using document('<xsl:value-of select="$method1"/>'):
<xsl:value-of select="document($method1)/foo/bar"/></p>
<p>using document('<xsl:value-of select="$method2"/>'):
<xsl:value-of select="document($method2)/foo/bar"/></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
</doc>
1.1 LayoutTests/fast/xsl/xslt-relative-path-expected.txt
Index: xslt-relative-path-expected.txt
===================================================================
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x118
RenderBlock {HTML} at (0,0) size 800x118
RenderBody {BODY} at (8,16) size 784x86
RenderBlock {P} at (0,0) size 784x18
RenderText {TEXT} at (0,0) size 511x18
text run at (0,0) width 511: "Here is an attempt to extract the string \"Hello, Webkit!\" from the file findme.xml:"
RenderBlock {P} at (0,34) size 784x18
RenderText {TEXT} at (0,0) size 377x18
text run at (0,0) width 283: "using document('file:resources/findme.xml'): "
text run at (283,0) width 94: "Hello, Webkit!"
RenderBlock {P} at (0,68) size 784x18
RenderText {TEXT} at (0,0) size 353x18
text run at (0,0) width 259: "using document('resources/findme.xml'): "
text run at (259,0) width 94: "Hello, Webkit!"
1.1 LayoutTests/fast/xsl/xslt-relative-path-expected.png
<<Binary file>>
1.1 LayoutTests/fast/xsl/xslt-relative-path-expected.checksum
Index: xslt-relative-path-expected.checksum
===================================================================
df52eccbf7b76dc63d00306672b32e09
1.1 LayoutTests/fast/xsl/resources/findme.xml
Index: findme.xml
===================================================================
<?xml version='1.0'?>
<foo>
<bar>Hello, Webkit!</bar>
</foo>
More information about the webkit-changes
mailing list