+2008-01-04 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin.
+
+ <rdar://problem/5611712> xsl:sort does not use a case folding sort, and the 'case-order' attribute is ignored (16077)
+
+ * platform/win/Skipped: The fix for this bug is now enabled on Windows, take the test out of Skipped list.
+
2008-01-04 Adam Roben <aroben@apple.com>
Added a test for <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text
# Results are wildly wrong <rdar://5563746>
svg/css/glyph-orientation-rounding-test.xhtml
-# The fix for this test is disabled on Windows <rdar://5611712>
-fast/xsl/sort-unicode.xml
-
# This test intermittently crashes <rdar://5621979>
editing/selection/5241148.html
+2008-01-04 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin.
+
+ <rdar://problem/5611712> xsl:sort does not use a case folding sort, and the 'case-order' attribute is ignored (16077)
+
+ Enable the fix on Windows.
+
+ * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::transformToString):
+ Always set a custom sort function, even if it doesn't implement proper collation on the platform.
+
+ * xml/XSLTUnicodeSort.cpp:
+ (WebCore::xsltUnicodeSortFunction):
+ * xml/XSLTUnicodeSort.h:
+ If the platform does not use ICU, or ICU has collation support disabled, fall back to binary comparison.
+
2008-01-04 Antti Koivisto <antti@apple.com>
Fix build.
xsltTransformContextPtr transformContext = xsltNewTransformContext(sheet, sourceDoc);
registerXSLTExtensions(transformContext);
-// FIXME: <rdar://5611712> Remove the PLATFORM(WIN) check once ICU on Windows has collation support.
-#if USE(ICU_UNICODE) && !PLATFORM(WIN)
+
// <http://bugs.webkit.org/show_bug.cgi?id=16077>: XSLT processor <xsl:sort> algorithm only compares by code point
- // Only implemented for ICU yet.
xsltSetCtxtSortFunc(transformContext, xsltUnicodeSortFunction);
-#endif
// This is a workaround for a bug in libxslt.
// The bug has been fixed in version 1.1.13, so once we ship that this can be removed.
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#include "config.h"
#include "XSLTUnicodeSort.h"
-// FIXME: <rdar://5611712> Remove the PLATFORM(WIN) check once ICU on Windows has collation support.
-#if ENABLE(XSLT) && USE(ICU_UNICODE) && !PLATFORM(WIN)
+#if ENABLE(XSLT)
#include <libxslt/templates.h>
#include <libxslt/xsltutils.h>
+
+#if USE(ICU_UNICODE)
#include <unicode/ucnv.h>
#include <unicode/ucol.h>
#include <unicode/ustring.h>
+#define WTF_USE_ICU_COLLATION !UCONFIG_NO_COLLATION
+#endif
#if PLATFORM(MAC)
#include "SoftLinking.h"
xmlXPathObjectPtr tmp;
int tempstype[XSLT_MAX_SORT], temporder[XSLT_MAX_SORT];
- /* Start ICU change */
+#if USE(ICU_COLLATION)
UCollator *coll = 0;
UConverter *conv;
UErrorCode status;
UChar *target,*target2;
int targetlen, target2len;
- /* End ICU change */
+#endif
if ((ctxt == NULL) || (sorts == NULL) || (nbsorts <= 0) ||
(nbsorts >= XSLT_MAX_SORT))
if (results == NULL)
return;
- /* Start ICU change */
+#if USE(ICU_COLLATION)
status = U_ZERO_ERROR;
conv = ucnv_open("UTF8", &status);
if (U_FAILURE(status))
ucol_setAttribute(coll,UCOL_CASE_FIRST,UCOL_UPPER_FIRST,&status);
if (U_FAILURE(status))
xsltTransformError(ctxt, NULL, NULL, "xsltICUSortFunction: Error setting collator attribute\n");
- /* End ICU change */
+#endif
/* Shell's sort of node-set */
for (incr = len / 2; incr > 0; incr /= 2) {
tst = 1;
else tst = -1;
} else {
- /* Start ICU change */
- targetlen = xmlStrlen(results[j]->stringval) * 2;
- target2len = xmlStrlen(results[j + incr]->stringval) * 2;
+#if USE(ICU_COLLATION)
+ targetlen = xmlStrlen(results[j]->stringval) + 1;
+ target2len = xmlStrlen(results[j + incr]->stringval) + 1;
target = (UChar*)xmlMalloc(targetlen * sizeof(UChar));
target2 = (UChar*)xmlMalloc(target2len * sizeof(UChar));
targetlen = ucnv_toUChars(conv, target, targetlen, (const char*)results[j]->stringval, -1, &status);
tst = ucol_strcoll(coll, target, u_strlen(target), target2, u_strlen(target2));
xmlFree(target);
xmlFree(target2);
- /* End ICU change */
+#else
+ tst = xmlStrcmp(results[j]->stringval,
+ results[j + incr]->stringval);
+#endif
}
if (descending)
tst = -tst;
tst = 1;
else tst = -1;
} else {
- /* Start ICU change */
- targetlen = xmlStrlen(res[j]->stringval) * 2;
- target2len = xmlStrlen(res[j + incr]->stringval) * 2;
+#if USE(ICU_COLLATION)
+ targetlen = xmlStrlen(res[j]->stringval) + 1;
+ target2len = xmlStrlen(res[j + incr]->stringval) + 1;
target = (UChar*)xmlMalloc(targetlen * sizeof(UChar));
target2 = (UChar*)xmlMalloc(target2len * sizeof(UChar));
targetlen = ucnv_toUChars(conv, target, targetlen, (const char*)res[j]->stringval, -1, &status);
tst = ucol_strcoll(coll, target, u_strlen(target), target2, u_strlen(target2));
xmlFree(target);
xmlFree(target2);
- /* End ICU change */
+#else
+ tst = xmlStrcmp(res[j]->stringval,
+ res[j + incr]->stringval);
+#endif
}
if (desc)
tst = -tst;
}
}
- /* Start ICU change */
+#if USE(ICU_COLLATION)
ucol_close(coll);
ucnv_close(conv);
- /* End ICU change */
+#endif
for (j = 0; j < nbsorts; j++) {
comp = static_cast<xsltStylePreComp*>(sorts[j]->psvi);
#ifndef XSLTUnicodeSort_h
#define XSLTUnicodeSort_h
-// Only implemented for ICU yet.
-// FIXME: We need to make an abstraction for Unicode collation to implement this for other libraries.
-#if ENABLE(XSLT) && USE(ICU_UNICODE)
+// FIXME: Only works as advertised for ICU with collation support enabled yet, falls back on binary comparison otherwise..
+// We need to make an abstraction for Unicode collation to implement this for other libraries.
+#if ENABLE(XSLT)
#include <libxslt/xsltInternals.h>
+2008-01-04 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin.
+
+ <rdar://problem/5611712> xsl:sort does not use a case folding sort, and the 'case-order' attribute is ignored (16077)
+
+ * WebKit.vcproj/WebKit.vcproj: Link to icuin{_debug}.lib
+
2008-01-04 Adam Roben <aroben@apple.com>
Fix <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text
-<?xml version="1.0" encoding="Windows-1252"?>\r
+<?xml version="1.0" encoding="windows-1251"?>\r
<VisualStudioProject\r
ProjectType="Visual C++"\r
- Version="8.00"\r
+ Version="8,00"\r
Name="WebKit"\r
ProjectGUID="{0662A8A9-82A3-4638-97D8-EC425D8D87C9}"\r
RootNamespace="WebKit"\r
<Tool\r
Name="VCLinkerTool"\r
LinkLibraryDependencies="false"\r
- AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib"\r
+ AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuin$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"\r
LinkIncremental="2"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib""\r
<Tool\r
Name="VCLinkerTool"\r
LinkLibraryDependencies="false"\r
- AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib"\r
+ AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuin$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"\r
LinkIncremental="1"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib""\r
<Tool\r
Name="VCLinkerTool"\r
LinkLibraryDependencies="false"\r
- AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib"\r
+ AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuin$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"\r
LinkIncremental="2"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib""\r