diff -Naur WebKit-r41128/autotools/webkit.m4 WebKit-r41137-nx/autotools/webkit.m4 --- WebKit-r41128/autotools/webkit.m4 2009-02-15 03:48:56.000000000 -0500 +++ WebKit-r41137-nx/autotools/webkit.m4 2009-02-23 16:01:26.000000000 -0500 @@ -120,17 +120,17 @@ dnl determine the Unicode backend AC_MSG_CHECKING([which Unicode backend to use]) AC_ARG_WITH(unicode_backend, - AC_HELP_STRING([--with-unicode-backend=@<:@icu@:>@], + AC_HELP_STRING([--with-unicode-backend=@<:@icu/glib@:>@], [Select Unicode backend [default=icu]]), - [],[unicode_backend="icu"]) + [],[with_unicode_backend="icu"]) -case "$unicode_backend" in - icu) ;; - *) AC_MSG_ERROR([Invalid Unicode backend: must be icu.]) ;; +case "$with_unicode_backend" in + icu|glib) ;; + *) AC_MSG_ERROR([Invalid Unicode backend: must be icu or glib.]) ;; esac -AC_MSG_RESULT([$unicode_backend]) - -if test "$unicode_backend" = "icu"; then +AC_MSG_RESULT([$with_unicode_backend]) + +if test "$with_unicode_backend" = "icu"; then if test "$os_darwin" = "yes"; then UNICODE_CFLAGS="-I\$(srcdir)/JavaScriptCore/icu -I\$(srcdir)/WebCore/icu" UNICODE_LIBS="-licucore" @@ -150,6 +150,19 @@ UNICODE_LIBS=`$icu_config --ldflags` fi fi + +if test "$with_unicode_backend" = "glib"; then + PKG_CHECK_MODULES([UNICODE], [glib-2.0 pango >= 1.16.0]) + AC_MSG_CHECKING([for libidn]) + AC_CHECK_HEADER(idna.h, + AC_CHECK_LIB(idn, stringprep_check_version, + [libidn=yes UNICODE_LIBS="${UNICODE_LIBS} -lidn"], libidn=no), + libidn=no) + if test "$libidn" = "no" ; then + AC_MSG_ERROR([Libidn not found, needed for GLib unicode backend.]) + fi +fi + AC_SUBST([UNICODE_CFLAGS]) AC_SUBST([UNICODE_LIBS]) ]) diff -Naur WebKit-r41128/autotoolsconfig.h.in WebKit-r41137-nx/autotoolsconfig.h.in --- WebKit-r41128/autotoolsconfig.h.in 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/autotoolsconfig.h.in 2009-05-05 02:35:22.438115770 -0400 @@ -0,0 +1,113 @@ +/* autotoolsconfig.h.in. Generated from configure.ac by autoheader. */ + +/* Define to enable JIT */ +#undef ENABLE_JIT + +/* Define to enable optimized arithmetic */ +#undef ENABLE_JIT_OPTIMIZE_ARITHMETIC + +/* Define to enable optimizing calls */ +#undef ENABLE_JIT_OPTIMIZE_CALL + +/* Define to enable optimized property access */ +#undef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS + +/* Define to enable WREC */ +#undef ENABLE_WREC + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to disable debugging features */ +#undef NDEBUG + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define if target is DirectFB */ +#undef WTF_PLATFORM_DIRECTFB + +/* Define if target is X11 */ +#undef WTF_PLATFORM_X11 + +/* Use stub va_list */ +#undef WTF_USE_JIT_STUB_ARGUMENT_VA_LIST + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to empty if the keyword `volatile' does not work. Warning: valid + code using `volatile' can become incorrect without. Disable with care. */ +#undef volatile diff -Naur WebKit-r41128/configure.ac WebKit-r41137-nx/configure.ac --- WebKit-r41128/configure.ac 2009-02-19 01:12:25.000000000 -0500 +++ WebKit-r41137-nx/configure.ac 2009-02-23 16:01:26.000000000 -0500 @@ -27,7 +27,7 @@ LIBWEBKITGTK_VERSION=1:0:0 AC_SUBST([LIBWEBKITGTK_VERSION]) -AM_INIT_AUTOMAKE([foreign subdir-objects tar-ustar]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) # host checking - inspired by the GTK+ configure.in # TODO: move these to webkit.m4? @@ -607,6 +607,10 @@ AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"]) AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"]) +# Unicode backend conditionals +AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"]) +AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"]) + # HTTP backend conditionals AM_CONDITIONAL([USE_CURL], [test "$with_http_backend" = "curl"]) AM_CONDITIONAL([USE_SOUP], [test "$with_http_backend" = "soup"]) @@ -656,7 +660,7 @@ Enable debugging (slow) : $enable_debug Enable GCC build optimization : $enable_optimizations Code coverage support : $enable_coverage - Unicode backend : $unicode_backend + Unicode backend : $with_unicode_backend HTTP backend : $with_http_backend Font backend : $with_font_backend Optimized memory allocator : $enable_fast_malloc diff -Naur WebKit-r41128/debian/changelog WebKit-r41137-nx/debian/changelog --- WebKit-r41128/debian/changelog 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/changelog 2009-05-04 19:47:53.273645571 -0400 @@ -0,0 +1,133 @@ +webkit (1.0-svn41137-8) unstable; urgency=high + + * Fix for slow resource loading after a while. + + -- Bundyo Tue, 05 May 2009 02:20:00 +0200 + +webkit (1.0-svn41137-7) unstable; urgency=high + + * Fix for zoom_step. + + -- Bundyo Tue, 25 Apr 2009 16:40:00 +0200 + +webkit (1.0-svn41137-6) unstable; urgency=high + + * Applied patch for user agent change support. + + -- Bundyo Tue, 21 Apr 2009 01:35:00 +0200 + +webkit (1.0-svn41137-5) unstable; urgency=high + + * Removed resource request checks for testing. + * Added XSLT support on request. + + -- Bundyo Tue, 08 Apr 2009 01:00:00 +0200 + +webkit (1.0-svn41137-4) unstable; urgency=high + + * Changed the place where the resource request checks are done. + + -- Bundyo Tue, 31 Mar 2009 09:00:00 +0200 + +webkit (1.0-svn41137-3) unstable; urgency=high + + * Fixed the badly applied 3rd hns' patch (The GMail crash). + + -- Bundyo Tue, 30 Mar 2009 02:00:00 +0200 + +webkit (1.0-svn41137-2) unstable; urgency=high + + * No optimizations. 770 compatible. + + -- Bundyo Tue, 25 Mar 2009 21:00:00 +0200 + +webkit (1.0-svn41137-1) unstable; urgency=high + + * Update from upstream. + * Built with Nokia 770 optimizations. + + -- Bundyo Tue, 25 Mar 2009 02:00:00 +0200 + +webkit (1.0-svn41128-2) unstable; urgency=high + + * Menu popup hack removed. + + -- Bundyo Tue, 25 Mar 2009 02:00:00 +0200 + +webkit (1.0-svn41128-1~hns-2) unstable; urgency=low + + * Fix input method issues with hildon on-screen keyboard + + -- Hannes Wallnoefer Tue, 24 Mar 2009 15:08:11 +0100 + +webkit (1.0-svn41128-1) unstable; urgency=high + + * Update from upstream. + * Menu popup hack. + + -- Bundyo Tue, 23 Feb 2009 02:00:00 +0200 + +webkit (1.0-svn41071-1) unstable; urgency=high + + * Update from upstream. + + -- Bundyo Tue, 20 Feb 2009 02:00:00 +0200 + +webkit (1.0-svn40663-1) unstable; urgency=high + + * Update from upstream. + + -- Bundyo Tue, 06 Feb 2009 02:00:00 +0200 + +webkit (1.0-svn40419-1) unstable; urgency=high + + * Handling text/plain MIME types as downloads - like Mozilla does. + * Different way to get the Content-Length - CURL doesn't seem to do it. + + -- Bundyo Tue, 31 Jan 2009 22:00:00 +0200 + +webkit (1.0-svn40239-3) unstable; urgency=high + + * Changed some dependencies to allow installation on Chinook. + + -- Bundyo Tue, 28 Jan 2009 23:30:00 +0200 + +webkit (1.0-svn40239-2) unstable; urgency=high + + * Switched on some optimizations. + + -- Bundyo Tue, 27 Jan 2009 03:00:00 +0200 + +webkit (1.0-svn40239-1) unstable; urgency=high + + * Updated to 40239. + + -- Bundyo Tue, 27 Jan 2009 01:00:00 +0200 + +webkit (1.0-svn40080-1) unstable; urgency=high + + * Updated to 40080. + + -- Bundyo Tue, 22 Jan 2009 01:00:00 +0200 + +webkit (1.0-svn39682-1) unstable; urgency=high + + * Updated to 39682. + + -- Bundyo Tue, 09 Jan 2009 23:00:00 +0200 + +webkit (1.0-svn39572-1) unstable; urgency=high + + * Patch for unicode handling with GLib. + * Patch for download support. + * Patch for inspect support. + * Maemo PASSWORD input field support with INVISIBLE input mode. + * Web inspector files included in package. + + -- Bundyo Tue, 04 Jan 2009 20:00:00 +0200 + +webkit (1.0-svn39572) unstable; urgency=high + + * Packaged for Maemo. No changes from SVN 39572. + + -- Bundyo Tue, 03 Jan 2009 20:57:48 +0200 diff -Naur WebKit-r41128/debian/compat WebKit-r41137-nx/debian/compat --- WebKit-r41128/debian/compat 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/compat 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1 @@ +4 diff -Naur WebKit-r41128/debian/control WebKit-r41137-nx/debian/control --- WebKit-r41128/debian/control 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/control 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,53 @@ +Source: webkit +Priority: optional +Section: user/other +Uploaders: Bundyo +Build-Depends: debhelper (>= 5.0), libgtk2.0-dev (>= 2.10), libpango1.0-dev (>= 1.16), libxslt-dev, libcurl3-dev, libsqlite3-dev, bison, flex, libjpeg62-dev, libpng12-dev, autoconf, automake, libtool, libxt-dev +Standards-Version: 3.8.0.1 +Homepage: http://webkit.org/ + +Package: libwebkit-1.0-1 +Section: user/other +Architecture: any +Depends: ${shlibs:Depends} +Description: Web content engine library for Gtk+ + WebKit is a web content engine, derived from KHTML and KJS from KDE, and + used primarily in Apple's Safari browser. It is made to be embedded in + other applications, such as mail readers, or web browsers. + . + It is able to display content such as HTML, SVG, XML, and others. It also + supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and more. + . + This is the library for embedding in Gtk+ applications. + +Package: libwebkit-dev +Section: libdevel +Priority: extra +Architecture: all +Depends: libwebkit-1.0-1 (>= ${source:Upstream-Version}), libgtk2.0-dev +Conflicts: libwebkitgdk-dev +Description: Web content engine library for Gtk+ - Development files + WebKit is a web content engine, derived from KHTML and KJS from KDE, and + used primarily in Apple's Safari browser. It is made to be embedded in + other applications, such as mail readers, or web browsers. + . + It is able to display content such as HTML, SVG, XML, and others. It also + supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and more. + . + This package provides development files required to create Gtk+ applications + embedding WebKit. + +Package: libwebkit-1.0-1-dbg +Section: libdevel +Priority: extra +Architecture: any +Depends: libwebkit-1.0-1 (= ${binary:Version}) +Description: Web content engine library for Gtk+ - Debugging symbols + WebKit is a web content engine, derived from KHTML and KJS from KDE, and + used primarily in Apple's Safari browser. It is made to be embedded in + other applications, such as mail readers, or web browsers. + . + It is able to display content such as HTML, SVG, XML, and others. It also + supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and more. + . + This package provides the debugging symbols for the Webkit library for Gtk+. diff -Naur WebKit-r41128/debian/copyright WebKit-r41137-nx/debian/copyright --- WebKit-r41128/debian/copyright 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/copyright 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,1082 @@ +Original source may be found at http://people.freedesktop.org/~alp/webkit/gtk/ + +Files: debian/* +Copyright: © 2007 Mike Hommey +License: LGPL-2+ (/usr/share/common-licenses/LGPL-2) + +Files: JavaScriptCore/API/*, + JavaScriptCore/profiler/Profile.*, + JavaScriptCore/wtf/Assertions.*, + JavaScriptCore/wtf/HashIterators.h, + JavaScriptCore/wtf/MathExtras.h, + JavaScriptCore/wtf/OwnPtrWin.cpp, + JavaScriptCore/wtf/Platform.h, + JavaScriptCore/wtf/StringExtras.h, + JavaScriptCore/wtf/unicode/UTF8.*, + WebCore/WebCorePrefix.cpp, + WebCore/bindings/js/JSAudioConstructor.*, + WebCore/bindings/js/JSConsoleCustom.cpp, + WebCore/bindings/js/JSCSSRuleCustom.cpp, + WebCore/bindings/js/JSCSSStyleDeclarationCustom.*, + WebCore/bindings/js/JSCSSValueCustom.cpp, + WebCore/bindings/js/JSCustomXPathNSResolver.*, + WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp, + WebCore/bindings/js/JSEventTargetBase.*, + WebCore/bindings/js/JSEventTargetNode.*, + WebCore/bindings/js/JSHTMLAllCollection.h, + WebCore/bindings/js/JSHTMLAppletElementCustom.*, + WebCore/bindings/js/JSHTMLDocumentCustom.cpp, + WebCore/bindings/js/JSHTMLElementCustom.cpp, + WebCore/bindings/js/JSHTMLEmbedElementCustom.*, + WebCore/bindings/js/JSHTMLFormElementCustom.cpp, + WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp, + WebCore/bindings/js/JSHTMLObjectElementCustom.*, + WebCore/bindings/js/JSHistoryCustom.h, + WebCore/bindings/js/JSInspectedObjectWrapper.*, + WebCore/bindings/js/JSInspectorCallbackWrapper.*, + WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp, + WebCore/bindings/js/JSLocationCustom.h, + WebCore/bindings/js/JSNamedNodeMapCustom.cpp, + WebCore/bindings/js/JSNamedNodesCollection.*, + WebCore/bindings/js/JSNodeCustom.cpp, + WebCore/bindings/js/JSNodeFilterCustom.cpp, + WebCore/bindings/js/JSNodeListCustom.cpp, + WebCore/bindings/js/JSQuarantinedObjectWrapper.*, + WebCore/bindings/js/JSSVGPODTypeWrapper.h, + WebCore/bindings/js/JSStorageCustom.*, + WebCore/bindings/js/JSStyleSheetCustom.cpp, + WebCore/bindings/js/JSStyleSheetListCustom.cpp, + WebCore/bindings/js/JSTextCustom.cpp, + WebCore/bindings/js/JSXSLTProcessorConstructor.*, + WebCore/bindings/js/GCController.*, + WebCore/bindings/objc/*, + WebCore/bridge/*, + WebCore/css/CSSCanvasValue.*, + WebCore/css/CSSFontFace.*, + WebCore/css/CSSFontFaceSource.*, + WebCore/css/CSSFontFaceSrcValue.*, + WebCore/css/CSSFontSelector.*, + WebCore/css/CSSGradientValue.*, + WebCore/css/CSSImageGeneratorValue.*, + WebCore/css/CSSPrimitiveValueMappings.h, + WebCore/css/CSSReflectValue.*, + WebCore/css/CSSReflectionDirection.h, + WebCore/css/CSSRuleList.idl, + WebCore/css/CSSSegmentedFontFace.*, + WebCore/css/CSSTimingFunctionValue.*, + WebCore/css/CSSTransformValue.*, + WebCore/css/CSSUnicodeRangeValue.*, + WebCore/css/CSSValueList.idl, + WebCore/css/MediaList.idl, + WebCore/css/MediaQuery*, + WebCore/css/view-source.css, + WebCore/css/svg.css, + WebCore/dom/BeforeTextInsertedEvent.*, + WebCore/dom/Clipboard.cpp, + WebCore/dom/ClipboardAccessPolicy.h, + WebCore/dom/EventTarget.cpp, + WebCore/dom/EventTarget.h, + WebCore/dom/ExceptionCode.cpp, + WebCore/dom/MessageEvent.*, + WebCore/dom/NodeWithIndex.h, + WebCore/dom/OverflowEvent.*, + WebCore/dom/Position*, + WebCore/dom/ProgressEvent.*, + WebCore/dom/RangeBoundaryPoint.h, + WebCore/dom/TextEvent.*, + WebCore/editing/*, + WebCore/history/*, + WebCore/html/Canvas*, + WebCore/html/HTMLAudioElement.*, + WebCore/html/HTMLCanvasElement.*, + WebCore/html/HTMLMediaElement.*, + WebCore/html/HTMLParserErrorCodes.*, + WebCore/html/HTMLSourceElement.*, + WebCore/html/HTMLTextFieldInnerElement.*, + WebCore/html/HTMLVideoElement.*, + WebCore/html/HTMLViewSourceDocument.*, + WebCore/html/MediaError.h, + WebCore/html/PreloadScanner.*, + WebCore/html/TimeRanges.*, + WebCore/html/VoidCallback.h, + WebCore/loader/CachePolicy.h, + WebCore/loader/CachedFont.*, + WebCore/loader/ImageDocument.*, + WebCore/loader/PluginDocument.*, + WebCore/loader/ProgressTracker.*, + WebCore/loader/SubstituteData.h, + WebCore/loader/SubstituteResource.h, + WebCore/loader/TextDocument.*, + WebCore/loader/FTPDirectoryDocument.*, + WebCore/loader/*/*, + WebCore/page/*, + WebCore/page/inspector/Breakpoint.js, + WebCore/page/inspector/BreakpointsSidebarPane.js, + WebCore/page/inspector/CallStackSidebarPane.js, + WebCore/page/inspector/DataGrid.js, + WebCore/page/inspector/DatabaseQueryView.js, + WebCore/page/inspector/DatabaseTableView.js, + WebCore/page/inspector/Object.js, + WebCore/page/inspector/ObjectPropertiesSection.js, + WebCore/page/inspector/Placard.js, + WebCore/page/inspector/ProfileView.js, + WebCore/page/inspector/ProfilesPanel.js, + WebCore/page/inspector/ScopeChainSidebarPane.js, + WebCore/page/inspector/Script.js, + WebCore/page/inspector/ScriptsPanel.js, + WebCore/page/inspector/ScriptView.js, + WebCore/page/inspector/SidebarTreeElement.js, + WebCore/page/inspector/SourceFrame.js, + WebCore/page/inspector/View.js, + WebCore/page/win/AXObjectCacheWin.cpp, + WebCore/page/win/AccessibilityObjectWrapperWin.h, + WebCore/platform/*, + WebCore/platform/graphics/svg/filters/cg/WK*, + WebCore/plugins/gtk/PluginDatabaseGtk.cpp, + WebCore/plugins/gtk/PluginPackageGtk.cpp, + WebCore/plugins/gtk/PluginViewGtk.cpp, + WebCore/plugins/npapi.cpp, + WebCore/plugins/npfunctions.h, + WebCore/plugins/PluginDatabase.*, + WebCore/plugins/PluginDebug.h, + WebCore/plugins/PluginInfoStore.*, + WebCore/plugins/PluginStream.*, + WebCore/plugins/PluginPackage.*, + WebCore/plugins/PluginView.*, + WebCore/plugins/PluginQuirkSet.h, + WebCore/plugins/qt/PluginDatabaseQt.cpp, + WebCore/plugins/qt/PluginPackageQt.cpp, + WebCore/plugins/qt/PluginViewQt.cpp, + WebCore/plugins/win/PluginMessageThrottlerWin.*, + WebCore/plugins/win/PluginDatabaseWin.cpp, + WebCore/plugins/win/PluginViewWin.cpp, + WebCore/plugins/win/PluginPackageWin.cpp, + WebCore/plugins/wx/PluginDataWx.cpp, + WebCore/plugins/wx/PluginDatabaseWx.cpp, + WebCore/plugins/wx/PluginPackageWx.cpp, + WebCore/plugins/wx/PluginViewWx.cpp, + WebCore/rendering/LayoutState.*, + WebCore/rendering/RenderHTMLCanvas.*, + WebCore/rendering/RenderImageGeneratedContent.*, + WebCore/rendering/RenderMedia.*, + WebCore/rendering/RenderTreeAsText.*, + WebCore/rendering/RenderWordBreak.*, + WebCore/rendering/SVGRenderTreeAsText.*, + WebCore/rendering/RenderVideo.*, + WebCore/storage/LocalStorage.*, + WebCore/storage/LocalStorageArea.*, + WebCore/storage/LocalStorageTask.*, + WebCore/storage/LocalStorageThread.*, + WebCore/storage/SessionStorage.*, + WebCore/storage/SessionStorageArea.*, + WebCore/storage/Storage.*, + WebCore/storage/StorageArea.*, + WebCore/storage/StorageEvent.*, + WebCore/storage/StorageMap.*, + WebCore/svg/ElementTimeControl.h, + WebCore/svg/*.idl, + WebCore/svg/animation/*, + WebCore/svg/graphics/SVGImage.*, + WebCore/svg/graphics/SVGImageEmptyClients.h, + WebCore/svg/graphics/SVGPaintServer*, + WebCore/svg/graphics/SVGResource*, + WebCore/svg/graphics/cg/CgSupport.*, + WebCore/svg/graphics/cg/RenderPathCg.cpp, + WebCore/svg/graphics/cg/SVGResourceClipperCg.cpp, + WebCore/svg/graphics/cg/SVGResourceFilterCg.cpp, + WebCore/svg/graphics/cg/SVGResourceMaskerCg.cpp, + WebCore/svg/graphics/filters/cg/WK*, + WebCore/svg/graphics/mac/SVGResourceFilterPlatformDataMac.h, + WebCore/xml/*, + WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.*, + WebKit/gtk/WebCoreSupport/EditorClientGtk.*, + WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.*, + WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp, + WebKitTools/DumpRenderTree/mac/ObjCPlugin.*, + WebKitTools/DumpRenderTree/mac/ObjCPluginFunction.*, + WebKitTools/GtkLauncher/main.c, + WebKitTools/Scripts/run-sunspider, + WebKitTools/Scripts/update-sources-list.py, + WebKitTools/wx/build-wxwebkit, + WebKitTools/wx/browser/browser.cpp, + WebKitTools/WinLauncher/stdafx.*, + WebKitTools/WinLauncher/WinLauncher.*, + WebKit/mac/History/WebHistoryInternal.h + WebKit/mac/Misc/WebIconFetcher.*, + WebKit/mac/Misc/WebIconFetcherInternal.h, + WebKit/mac/Plugins/WebNetscapePluginEventHandler.*, + WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.*, + WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.*, + WebKit/mac/Plugins/nptextinput.h, + WebKit/mac/WebCoreSupport/WebDragClient.h, + WebKit/mac/WebCoreSupport/WebPasteboardHelper.h, + WebKit/win/*, + WebKit/wx/*, + WebKitLibraries/win/tools/scripts/auto-version.sh +Copyright: © 2002, 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. + © 2005, 2006, 2007 Alexey Proskuryakov (ap@nypop.com) + © 2006, 2007 Trolltech ASA + © 2006, 2007 Nikolas Zimmermann + © 2006 Samuel Weinig + © 2006 James G. Speth (speth@end.com) + © 2006 Jonas Witt + © 2005 Frerich Raabe + © 2005 Maksim Orlovich + © 2001, 2002 Thomas Broyer, Charlie Bozeman and Daniel Veillard + © 2005, 2006 Alexander Kellett + © 2005, 2006 Kimmo Kinnunen + © 2005, 2006 Michael Emmel mike.emmel@gmail.com + © 2005 Ben La Monica + © 2005 Google Inc. + © 2005, 2006 Nokia Corporation + © 2005, 2006 Oliver Hunt + © 2006, 2007 Eric Seidel + © 2006 Allan Sandfeld Jensen + © 2006 Charles Samuels + © 2006 Dave MacLachlan (dmaclach@mac.com) + © 2006 David Smith (catfish.man@gmail.com) + © 2006 Dirk Mueller + © 2006 Don Gibson + © 2006 Friedemann Kleint + © 2006 George Staikos + © 2006 Justin Haygood + © 2006, 2007, 2008 Kevin Ollivier + © 2006 Lars Knoll + © 2006 Nefaur Khandker + © 2006, 2007 Rob Buis + © 2006 Simon Hausmann + © 2006 Zack Rusin + © 2007 Alp Toker + © 2007 Holger Hans Peter Freyther + © 2007 Robin Dunn + © 2007 Staikos Computing Services Inc. + © 2007 Henry Mason (hmason@mac.com) + © 2007 Hiroyuki Ikezoe + © 2007 Kouhei Sutou + © 2007 Vaclav Slavik + © 2008 Xan Lopez + © 2008 Collabora, Ltd. + © 2008 Julien Chaffraix + © 2008 The Mozilla Foundation +License: BSD-2 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: JavaScriptCore/API/JSRetainPtr.h, + JavaScriptCore/API/JSStringRefBSTR.*, + JavaScriptCore/DerivedSources.make, + JavaScriptCore/VM/*, + JavaScriptCore/kjs/CallData.h, + JavaScriptCore/kjs/CollectorHeapIntrospector.*, + JavaScriptCore/kjs/ConstructData.h, + JavaScriptCore/kjs/DebuggerCallFrame.*, + JavaScriptCore/kjs/InitializeThreading.*, + JavaScriptCore/kjs/JSActivation.*, + JavaScriptCore/kjs/JSGlobalData.*, + JavaScriptCore/kjs/JSGlobalObject.cpp, + JavaScriptCore/kjs/JSNotAnObject.*, + JavaScriptCore/kjs/JSVariableObject.*, + JavaScriptCore/kjs/SourceProvider.h, + JavaScriptCore/kjs/SourceRange.h, + JavaScriptCore/kjs/SymbolTable.h, + JavaScriptCore/profiler/*, + JavaScriptCore/wtf/ASCIICType.h, + JavaScriptCore/wtf/AVLTree.h, + JavaScriptCore/wtf/Deque.h, + JavaScriptCore/wtf/DisallowCType.h, + JavaScriptCore/wtf/Locker.h, + JavaScriptCore/wtf/MainThread.*, + JavaScriptCore/wtf/MallocZoneSupport.h, + JavaScriptCore/wtf/MessageQueue.h, + JavaScriptCore/wtf/Threading.h, + JavaScriptCore/wtf/ThreadingGtk.cpp, + JavaScriptCore/wtf/ThreadingNone.cpp, + JavaScriptCore/wtf/ThreadingPthreads.cpp, + JavaScriptCore/wtf/ThreadingQt.cpp, + JavaScriptCore/wtf/ThreadingWin.cpp, + JavaScriptCore/wtf/ThreadSpecific.h, + JavaScriptCore/wtf/mac/MainThreadMac.mm, + JavaScriptCore/wtf/gtk/MainThreadGtk.cpp, + JavaScriptCore/wtf/qt/MainThreadQt.cpp, + JavaScriptCore/wtf/unicode/Collator.h, + JavaScriptCore/wtf/unicode/CollatorDefault.cpp + JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp, + JavaScriptCore/wtf/win/MainThreadWin.cpp, + JavaScriptCore/wtf/wx/MainThreadWx.cpp, + JavaScriptGlue/*, + WebCore/DerivedSources.make, + WebCore/WebCore.vcproj/migrate-idls.sh, + WebCore/bindings/js/JSAttrCustom.cpp, + WebCore/bindings/js/JSCanvasPixelArrayCustom.cpp, + WebCore/bindings/js/JSClipboardCustom.cpp, + WebCore/bindings/js/JSCustomSQL*, + WebCore/bindings/js/JSCustomVoidCallback.*, + WebCore/bindings/js/JSDatabaseCustom.cpp, + WebCore/bindings/js/JSHistoryCustom.cpp, + WebCore/bindings/js/JSEventCustom.cpp, + WebCore/bindings/js/JSHTMLFrameElementCustom.cpp, + WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp, + WebCore/bindings/js/JSHTMLSelectElementCustom.h, + WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp, + WebCore/bindings/js/JSSQLTransactionCustom.cpp, + WebCore/bindings/js/JSXMLHttpRequestCustom.cpp, + WebCore/bindings/js/JSXSLTProcessorCustom.cpp, + WebCore/bindings/js/StringSourceProvider.h, + WebCore/bindings/objc/DOMAbstractView.mm, + WebCore/bindings/objc/DOMAbstractViewFrame.h, + WebCore/bridge/npruntime.h, + WebCore/dom/ClassNodeList.*, + WebCore/dom/Clipboard.idl, + WebCore/dom/DOMCoreException.idl, + WebCore/dom/DOMCoreException.h, + WebCore/dom/EventException.idl, + WebCore/dom/EventException.h, + WebCore/dom/ExceptionBase.*, + WebCore/dom/SelectorNodeList.*, + WebCore/dom/StaticNodeList.*, + WebCore/dom/make_names.pl, + WebCore/editing/SmartReplace*, + WebCore/history/CachedPagePlatformData.h, + WebCore/html/CanvasPixelArray.*, + WebCore/html/HTMLTableRowsCollection.*, + WebCore/html/ImageData.*, + WebCore/loader/archive/*, + WebCore/loader/DocumentLoader.*, + WebCore/loader/FormState.*, + WebCore/loader/FrameLoader*, + WebCore/loader/MainResourceLoader.*, + WebCore/loader/NavigationAction.*, + WebCore/loader/NetscapePlugInStreamLoader.*, + WebCore/loader/ResourceLoader.*, + WebCore/loader/SubresourceLoader*, + WebCore/loader/icon/IconDatabaseClient.h, + WebCore/loader/icon/IconRecord.*, + WebCore/loader/icon/PageURLRecord.*, + WebCore/loader/mac/*, + WebCore/page/AccessibilityObject.*, + WebCore/page/AccessibilityListBox.*, + WebCore/page/AccessibilityListBoxOption.*, + WebCore/page/AccessibilityRenderObject.*, + WebCore/page/AnimationController.*, + WebCore/page/AXObjectCache.cpp, + WebCore/page/BarInfo.*, + WebCore/page/Console.*, + WebCore/page/DOMSelection.*, + WebCore/page/InspectorController.*, + WebCore/page/JavaScriptDebugListener.h, + WebCore/page/JavaScriptDebugServer.*, + WebCore/page/Location.*, + WebCore/page/Screen.*, + WebCore/page/WindowFeatures.h, + WebCore/page/inspector/*, + WebCore/page/mac/AccessibilityObjectWrapper.*, + WebCore/page/mac/PageMac.cpp, + WebCore/platform/AutodrainedPool.h, + WebCore/platform/FileChooser.*, + WebCore/platform/FileSystem.h, + WebCore/platform/FloatConversion.h, + WebCore/platform/SecurityOrigin.*, + WebCore/platform/SecurityOriginHash.h, + WebCore/platform/cf/FileSystemCF.cpp, + WebCore/platform/cf/SchedulePair.*, + WebCore/platform/cf/SharedBufferCF.cpp, + WebCore/platform/graphics/FontCache.*, + WebCore/platform/graphics/FontFallbackList.cpp, + WebCore/platform/graphics/FontDescription.cpp, + WebCore/platform/graphics/Glyph*, + WebCore/platform/graphics/SimpleFontData.cpp, + WebCore/platform/graphics/StringTruncator.*, + WebCore/platform/graphics/gtk/FontDataGtk.cpp, + WebCore/platform/graphics/gtk/FontCacheGtk.cpp, + WebCore/platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp, + WebCore/platform/graphics/gtk/GlyphPageTreeNodePango.cpp, + WebCore/platform/graphics/gtk/IconGtk.cpp, + WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp, + WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp, + WebCore/platform/graphics/mac/ColorMac.h, + WebCore/platform/graphics/mac/FontCacheMac.mm, + WebCore/platform/graphics/mac/FontDataMac.mm, + WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp, + WebCore/platform/graphics/mac/SimpleFontDataMac.mm, + WebCore/platform/graphics/win/ColorSafari.cpp, + WebCore/platform/graphics/win/FontCacheWin.cpp, + WebCore/platform/graphics/win/FontDataWin.cpp, + WebCore/platform/graphics/win/FontDatabase.*, + WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp, + WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp, + WebCore/platform/graphics/win/SimpleFontDataWin.cpp, + WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp, + WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp, + WebCore/platform/graphics/win/UniscribeController.*, + WebCore/platform/graphics/wx/FontCacheWx.cpp, + WebCore/platform/graphics/wx/FontDataWx.cpp, + WebCore/platform/graphics/wx/FontPlatformData.h, + WebCore/platform/graphics/wx/GlyphMapWx.cpp, + WebCore/platform/graphics/wx/SimpleFontDataWx.cpp, + WebCore/platform/gtk/ContextMenuGtk.cpp, + WebCore/platform/gtk/ContextMenuItemGtk.cpp, + WebCore/platform/gtk/PasteboardGtk.cpp, + WebCore/platform/gtk/SearchPopupMenuGtk.cpp, + WebCore/platform/mac/AutodrainedPool.mm, + WebCore/platform/mac/FileChooserMac.mm, + WebCore/platform/mac/SchedulePairMac.mm, + WebCore/platform/mac/SoftLinking.h, + WebCore/platform/mac/Threading.mm, + WebCore/platform/mac/WebCoreNSStringExtras.*, + WebCore/platform/mac/WebCoreObjCExtras.*, + WebCore/platform/mac/WebFontCache.mm, + WebCore/platform/network/HTTPParsers.*, + WebCore/platform/network/cf/FormDataStreamCFNet.*, + WebCore/platform/network/mac/FormDataStreamMac.*, + WebCore/platform/network/mac/WebCoreURLResponse.*, + WebCore/platform/posix/FileSystemPOSIX.cpp, + WebCore/platform/qt/FileSystemQt.cpp + WebCore/platform/qt/PlatformScreenQt.cpp, + WebCore/platform/qt/ThreadingQt.cpp, + WebCore/platform/sql/SQLValue.*, + WebCore/platform/sql/SQLiteAuthorizer.*, + WebCore/platform/text/StringBuffer.h, + WebCore/platform/text/StringBuilder.*, + WebCore/platform/text/mac/make-charset-table.pl, + WebCore/platform/win/FileSystemWin.cpp, + WebCore/platform/win/GDIObjectCounter.*, + WebCore/platform/win/MutexWin.cpp, + WebCore/platform/win/SharedBufferWin.cpp, + WebCore/platform/win/SoftLinking.h, + WebCore/platform/win/WindowMessageBroadcaster.*, + WebCore/platform/win/WindowMessageListener.h, + WebCore/platform/wx/ThreadingWx.cpp, + WebCore/rendering/MediaControlElements.*, + WebCore/rendering/RenderListBox.*, + WebCore/rendering/RenderReplica.*, + WebCore/storage/*, + WebCore/xml/XMLHttpRequest.idl, + WebCore/xml/XMLHttpRequestException.h, + WebCore/xml/XMLHttpRequestException.idl, + WebCore/xml/XPathException.h, + WebCore/xml/XPathException.idl, + WebCore/xml/XSLTUnicodeSort.*, + WebKit/qt/WebCoreSupport/InspectorClientQt.*, + WebKitTools/BuildSlaveSupport/*, + WebKitTools/CodeCoverage/*, + WebKitTools/DumpRenderTree/*, + WebKitTools/Scripts/*, + WebKitTools/WebKitLauncher/*, + WebKitTools/FindSafari/*, + WebKitTools/wx/browser/browser.bkl, + WebKitTools/wx/install-unix-extras, + WebKit/*, + WebKit/gtk/*, + WebKit/win/DOMCreateInstance.*, + WebKit/win/ForEachCoClass.h, + WebKit/win/GEN_DOMObject.*, + WebKit/win/WebDatabaseManager.*, + WebKit/win/WebDragClient.h, + WebKit/win/WebInspector.*, + WebKit/win/WebInspectorClient.*, + WebKit/win/WebKit.vcproj/FixMIDLHeaders.pl, + WebKit/win/WebKit.vcproj/build-generated-files.sh, + WebKit/win/WebKitLogging.*, + WebKit/win/WebKitPrefix.*, + WebKit/win/WebKitStatistics*, + WebKit/win/WebKitSystemBits.*, + WebKit/win/WebPreferenceKeysPrivate.h, + WebKit/win/WebScriptCallFrame.*, + WebKit/win/WebTextRenderer.*, + WebKit/win/WebNodeHighlight.*, + WebKit/win/Interfaces/IWebIconFetcher.idl, + WebKit/win/Interfaces/IWebMutableURLRequestPrivate.idl, + WebKit/win/Interfaces/IWebSecurityOrigin.idl, + WebKit/win/WebCoreSupport/FormValuesPropertyBag.*, + WebKit/win/WebCoreSupport/WebFrameLoaderClient.*, + WebKit/win/WebCoreSupport/WebInspectorDelegate.cpp, + WebKit/wx/WebViewPrivate.h +Copyright: © 2003, 2005, 2006, 2007, 2008 Apple Inc. + © 2006, 2007 Holger Hans Peter Freyther + © 2004, Apple Computer, Inc. and The Mozilla Foundation + © 2006 Samuel Weinig + © 2006, 2007 Trolltech ASA + © 2006 Alexey Proskuryakov (ap@nypop.com) + © 2007 Matt Lilek (pewtermoose@gmail.com) + © 2006 Michael Emmel mike.emmel@gmail.com + © 2007, 2008 Alp Toker + © 2006, 2007 Kevin Ollivier + © 2006 Mark Rowe + © 2004, 2005, 2006 Nathaniel Smith + © 2006, 2007 David Smith (catfish.man@gmail.com) + © 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) + © 2006 Nikolas Zimmermann + © 2006 Jonas Witt + © 2006 Eric Seidel (eric@webkit.org) + © 2006 Graham Dennis + © 2007 Staikos Computing Services, Inc. + © 2007 Brent Fulgham + © 2007 Justin Haygood (jhaygood@reaktix.com) + © 2008 Cameron Zwarich (cwzwarich@uwaterloo.ca) + © 2008 Tony Chang +License: BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of Apple, Inc. ("Apple") nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: WebCore/bridge/qt/*, + WebCore/page/Chrome.*, + WebCore/page/ChromeClient.h, + WebCore/page/Frame.*, + WebCore/page/FramePrivate.h, + WebCore/page/FrameTree.*, + WebCore/page/FrameView.*, + WebCore/page/MouseEventWithHitTestResults.*, + WebCore/page/Navigator.*, + WebCore/page/Page.*, + WebCore/page/Plugin.h, + WebCore/page/PrintContext.*, + WebCore/page/WindowFeatures.cpp, + WebCore/page/gtk/AXObjectCacheAtk.cpp, + WebCore/page/gtk/AccessibilityObjectWrapperAtk.*, + WebCore/page/mac/ChromeMac.mm, + WebCore/platform/PopupMenuClient.h, + WebCore/platform/PopupMenu.h, + WebCore/platform/SearchPopupMenu.h, + WebCore/platform/Shared.h, + WebCore/platform/StaticConstructors.h, + WebCore/platform/TreeShared.h, + WebCore/platform/graphics/FloatPoint3D.*, + WebCore/platform/graphics/Font.cpp, + WebCore/platform/graphics/Font.h, + WebCore/platform/graphics/FontDescription.h, + WebCore/platform/graphics/FontFallbackList.h, + WebCore/platform/graphics/Icon.h, + WebCore/platform/graphics/IntSizeHash.h, + WebCore/platform/graphics/PathTraversalState.cpp, + WebCore/platform/graphics/SimpleFontData.h, + WebCore/platform/graphics/cairo/CairoPath.h, + WebCore/platform/graphics/cairo/PathCairo.cpp, + WebCore/platform/graphics/gtk/FontPlatformData.h, + WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp, + WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp, + WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.*, + WebCore/platform/graphics/gtk/PopupMenuGtk.cpp, + WebCore/platform/graphics/gtk/RenderThemeGtk.*, + WebCore/platform/graphics/gtk/VideoSinkGStreamer.*, + WebCore/platform/graphics/mac/FontCustomPlatformData.*, + WebCore/platform/graphics/mac/FontMac.mm, + WebCore/platform/graphics/mac/FontPlatformData.h, + WebCore/platform/graphics/mac/FontPlatformDataMac.mm, + WebCore/platform/graphics/mac/IconMac.mm, + WebCore/platform/graphics/qt/FontCacheQt.cpp, + WebCore/platform/graphics/qt/FontCustomPlatformData.*, + WebCore/platform/graphics/qt/FontDataQt.cpp, + WebCore/platform/graphics/qt/FontPlatformData.h, + WebCore/platform/graphics/qt/FontQt.cpp, + WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp, + WebCore/platform/graphics/qt/IconQt.cpp, + WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.*, + WebCore/platform/graphics/qt/SimpleFontDataQt.cpp, + WebCore/platform/graphics/win/FontCustomPlatformData.*, + WebCore/platform/graphics/win/FontCustomPlatformDataCairo.*, + WebCore/platform/graphics/win/FontPlatformData.h, + WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp, + WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp, + WebCore/platform/graphics/win/IconWin.cpp, + WebCore/platform/gtk/CursorGtk.h, + WebCore/platform/gtk/EventLoopGtk.cpp, + WebCore/platform/gtk/PasteboardHelper.h, + WebCore/platform/mac/LocalCurrentGraphicsContext.*, + WebCore/platform/mac/PopupMenuMac.mm, + WebCore/platform/mac/SearchPopupMenuMac.mm, + WebCore/platform/network/FormData.*, + WebCore/platform/network/curl/CookieJarCurl.cpp, + WebCore/platform/network/soup/CookieJarSoup.cpp, + WebCore/platform/network/qt/QNetworkReplyHandler.*, + WebCore/platform/network/qt/ResourceRequestQt.cpp, + WebCore/platform/network/soup/ResourceHandleSoup.cpp, + WebCore/platform/qt/EventLoopQt.cpp, + WebCore/platform/qt/FileChooserQt.cpp, + WebCore/platform/qt/KURLQt.cpp, + WebCore/platform/qt/LoggingQt.cpp, + WebCore/platform/qt/MenuEventProxy.h, + WebCore/platform/qt/PopupMenuQt.cpp, + WebCore/platform/qt/QWebPopup.*, + WebCore/platform/qt/RenderThemeQt.*, + WebCore/platform/qt/SearchPopupMenuQt.cpp, + WebCore/platform/qt/WheelEventQt.cpp, + WebCore/platform/qt/html4-adjustments-qt.css, + WebCore/platform/text/AtomicString.*, + WebCore/platform/text/AtomicStringImpl.h, + WebCore/platform/text/Base64.cpp, + WebCore/platform/text/BidiContext.*, + WebCore/platform/text/BidiResolver.h, + WebCore/platform/text/ParserUtilities.h, + WebCore/platform/text/PlatformString.h, + WebCore/platform/text/String.cpp, + WebCore/platform/text/SegmentedString.*, + WebCore/platform/text/StringHash.h, + WebCore/platform/text/StringImpl.*, + WebCore/platform/text/TextBreakIterator.h, + WebCore/platform/text/TextBreakIteratorICU.cpp, + WebCore/platform/text/TextBreakIteratorInternalICU.h, + WebCore/platform/text/cf/StringCF.cpp, + WebCore/platform/text/cf/StringImplCF.cpp, + WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp, + WebCore/platform/text/mac/StringImplMac.mm, + WebCore/platform/text/mac/StringMac.mm, + WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm, + WebCore/platform/text/qt/TextBreakIteratorQt.cpp, + WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp, + WebCore/platform/win/PopupMenuWin.cpp, + WebCore/platform/win/SearchPopupMenuWin.cpp, + WebCore/platform/wx/PopupMenuWx.cpp, + WebCore/svg/SVGAngle.idl, + WebCore/svg/SVGColor.idl, + WebCore/svg/SVGDocument.idl, + WebCore/svg/SVGElement.idl, + WebCore/svg/SVGException.idl, + WebCore/svg/SVGFontData.*, + WebCore/svg/SVGHKernElement.idl, + WebCore/svg/SVGLength.idl, + WebCore/svg/SVGMatrix.idl, + WebCore/svg/SVGMetadataElement.idl, + WebCore/svg/SVGNumber.idl, + WebCore/svg/SVGPoint.idl, + WebCore/svg/SVGRect.idl, + WebCore/svg/SVGSVGElement.idl, + WebCore/svg/SVGTransform.idl, + WebCore/svg/graphics/SVGResourceFilter.*, + WebCore/svg/graphics/cg/SVGPaintServerCg.cpp, + WebCore/svg/graphics/cg/SVGPaintServerGradientCg.cpp, + WebCore/svg/graphics/cg/SVGPaintServerPatternCg.cpp, + WebCore/svg/graphics/cg/SVGPaintServerSolidCg.cpp, + WebCore/svg/graphics/filters/*, + WebCore/svg/graphics/filters/cg/SVG*, + WebCore/svg/graphics/qt/*, + WebCore/xml/DOMParser.*, + WebCore/xml/XMLSerializer.*, + WebCore/xml/XPathEvaluator.idl, + WebCore/xml/XPathExpression.idl, + WebCore/xml/XPathNSResolver.idl, + WebCore/xml/XPathResult.idl, + WebCore/xml/XSL*, + WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.*, + WebKit/gtk/webkit/*, + WebKit/qt, + * +Copyright: © 2002, 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. + © 1991, 1999 Free Software Foundation, Inc. + © 1997 Martin Jones (mjones@kde.org) + © 1998, 1999 Torben Weis + © 1998-2003, 2006 Lars Knoll (knoll@kde.org) + © 1999-2004 Harri Porten (porten@kde.org) + © 1999, 2001 Antti Koivisto (koivisto@kde.org) + © 1999, 2002 Waldo Bastian (bastian@kde.org) + © 2000-2001 Dawit Alemayehu + © 2000 Daniel Molkentin (molkentin@kde.org) + © 2000-2003 Dirk Mueller (mueller@kde.org) + © 2000 Frederik Holljen (frederik.holljen@hig.no) + © 2000, 2001, 2003 Peter Kelly (pmk@post.com) + © 2000 Malte Starostik + © 2000 Simon Hausmann + © 2000 Stefan Schimanski (schimmi@kde.org) + © 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) + © 2001 Tim Copperfield + © 2002, 2003 The Karbon Developers + © 2002 Cyrus Patel + © 2004, 2005, 2006, 2007 Nikolas Zimmermann + © 2004, 2005, 2006, 2007 Rob Buis + © 2004, 2005 Allan Sandfeld Jensen (kde@carewolf.com) + © 2004, 2006 Zack Rusin + © 2004 Michal Zalewski + © 2005, 2006 Alexander Kellett + © 2005, 2006, 2007 Alexey Proskuryakov + © 2005, 2006 Oliver Hunt + © 2006, 2007 Eric Seidel (eric@webkit.org) + © 2006, 2007 Samuel Weinig + © 2006 Anders Carlsson + © 2006 Andrew Wellington (proton@wiretapped.net) + © 2006 Bjoern Graf (bjoern.graf@gmail.com) + © 2006 Enrico Ros + © 2006 George Staikos + © 2006 Graham Dennis (graham.dennis@gmail.com) + © 2006 James G. Speth (speth@end.com) + © 2006 Jon Shier (jshier@iastate.edu) + © 2006, 2007 Maks Orlovich + © 2006 Michael Emmel + © 2006, 2008 Trolltech ASA + © 2007, 2008 Alp Toker + © 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca) + © 2007 Holger Hans Peter Freyther + © 2007 Krzysztof Kowalczyk + © 2007 Staikos Computing Services Inc. + © 2007 David Smith (catfish.man@gmail.com) + © 2007, 2008 Collabora, Ltd. + © 2007 OpenedHand + © 2007 Christian Dywan + © 2007 Luca Bruno + © 2008 Xan Lopez + © 2008 Nuanti Ltd + © 2007 Christian Dywan +License: LGPL-2+ (/usr/share/common-licenses/LGPL-2) + +Files: WebCore/bridge/npruntime_internal.h +Copyright: © 2007 Collabora, Ltd. +License: LGPL-2.1+ (/usr/share/common-licenses/LGPL-2) + +Files: JavaScriptCore/kjs/DateMath.*, + WebCore/bridge/npapi.h, + WebCore/html/HTMLDocument.cpp, + WebCore/platform/Arena.*, + WebCore/platform/gtk/gtk2drawing.c, + WebCore/platform/gtk/gtkdrawing.h, + WebCore/platform/image-decoders/gif/GIFImageReader.*, + WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp, + WebCore/platform/image-decoders/png/PNGImageDecoder.cpp, + WebCore/platform/image-decoders/zlib/mozzconf.h, + WebCore/platform/text/UnicodeRange.*, + WebCore/plugins/gtk/gtk2xtbin.*, + WebCore/plugins/gtk/xembed.h, + WebCore/rendering/RenderArena.*, + WebCore/rendering/RenderLayer.* +Copyright: © 1998, 2001-2006 mozilla.org + © 1999, 2000 Harri Porten (porten@kde.org) + © 2003, 2004, 2005, 2006, 2007 Apple Inc. + © 1998-2000, 2002 Netscape Communications Corporation. + © 1999 Lars Knoll (knoll@kde.org) + © 1999 Antti Koivisto (koivisto@kde.org) + © 2004 IBM Corporation + © 2002 Sun Microsystems, Inc. +License: LGPL-2.1+ (/usr/share/common-licenses/LGPL-2) | GPL-2+ (/usr/share/common-licenses/GPL-2) | MPL-1.1 + Other contributors for this code include: + - Boris Zbarsky + - Brian Ryner + - Chris Saari + - Christian Biesinger + - David Baron + - Jeff Hostetler + - Josh Soref + - Michael Ventnor + - Nick Blievers + - Pierre Chanial + - Raffaele Sena + - Randall Jesup + - Robert O'Callahan + - Roland Mainz + - Stuart Parmenter + - Tom Rini + +Files: JavaScriptCore/pcre/* +Copyright: © 1997-2005 University of Cambridge + © 2002, 2004, 2005, 2006, 2007 Apple Inc. +License: BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + . + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +Files: JavaScriptCore/kjs/dtoa.cpp +Copyright: © 1991, 2000, 2001 Lucent Technologies +License: other + Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + . + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + +Files: JavaScriptCore/wtf/FastMalloc.cpp, + JavaScriptCore/wtf/TC* +Copyright: © 2005, 2007 Google Inc. +License: BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: WebCore/platform/text/symbian/StringImplSymbian.* +Copyright: © 2006 Nokia Corporation +License: BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of the Nokia Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + +Files: JavaScriptCore/icu/*, + JavaScriptGlue/icu/*, + WebCore/icu/*, + WebKit/mac/icu/*, +Copyright: © 1995-2006 International Business Machines Corporation and others +License: other + Permission is hereby granted, free of charge, to any person obtaining a copy of this + software and associated documentation files (the "Software"), to deal in the Software + without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, and/or sell copies of the Software, and to permit persons + to whom the Software is furnished to do so, provided that the above copyright notice(s) + and this permission notice appear in all copies of the Software and that both the above + copyright notice(s) and this permission notice appear in supporting documentation. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER + OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR + CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder shall not be used in + advertising or otherwise to promote the sale, use or other dealings in this Software + without prior written authorization of the copyright holder. + +Files: WebCore/platform/image-decoders/zlib/* +Copyright: © 1995-2005 Mark Adler + © 1995-2005 Jean-loup Gailly +License: other + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +Files: WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.c, + WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp, + WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp, + WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h, + WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp, + WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h, + WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp +Copyright: © Apple Inc. +License: other + IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in + consideration of your agreement to the following terms, and your use, installation, + modification or redistribution of this Apple software constitutes acceptance of these + terms. If you do not agree with these terms, please do not use, install, modify or + redistribute this Apple software. + . + In consideration of your agreement to abide by the following terms, and subject to these + terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in + this original Apple software (the "Apple Software"), to use, reproduce, modify and + redistribute the Apple Software, with or without modifications, in source and/or binary + forms; provided that if you redistribute the Apple Software in its entirety and without + modifications, you must retain this notice and the following text and disclaimers in all + such redistributions of the Apple Software. Neither the name, trademarks, service marks + or logos of Apple Computer, Inc. may be used to endorse or promote products derived from + the Apple Software without specific prior written permission from Apple. Except as expressly + stated in this notice, no other rights or licenses, express or implied, are granted by Apple + herein, including but not limited to any patent rights that may be infringed by your + derivative works or by other works in which the Apple Software may be incorporated. + . + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, + EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS + USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + . + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, + REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND + WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR + OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: WebKitTools/iExploder/* +Copyright: © 2005 Thomas Stromberg +License: other + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be appreciated + but is not required. + . + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + . + 3. This notice may not be removed or altered from any source distribution. + +Files: WebKitTools/Scripts/prepare-ChangeLog +Copyright: © 2000, 2001 Eazel, Inc. + © 2002, 2003, 2004, 2005, 2006, 2007 Apple Inc. +License: GPL-2+ (/usr/share/common-licenses/GPL-2) + +Files: WebCore/bindings/scripts/XMLTiny.pm +Copyright: © 2007 David Cantrell +License: other + This program is free software; you can redistribute it and/or modify + it under the terms of either: + . + a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or + b) the "Artistic License" which comes with this Kit. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either + the GNU General Public License or the Artistic License for more details. + . + You should have received a copy of the Artistic License with this + Kit, in the file named "Artistic". If not, I'll be glad to provide one. + . + You should also have received a copy of the GNU General Public License + along with this program in the file named "Copying". If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA or visit their web page on the internet at + http://www.gnu.org/copyleft/gpl.html. + . + For those of you that choose to use the GNU General Public License, + my interpretation of the GNU General Public License is that no Perl + script falls under the terms of the GPL unless you explicitly put + said script under the terms of the GPL yourself. Furthermore, any + object code linked with perl does not automatically fall under the + terms of the GPL, provided such object code only adds definitions + of subroutines and variables, and does not otherwise impair the + resulting interpreter from executing any standard Perl script. I + consider linking in C subroutines in this manner to be the moral + equivalent of defining subroutines in the Perl language itself. You + may sell such an object file as proprietary provided that you provide + or offer to provide the Perl source, as specified by the GNU General + Public License. (This is merely an alternate way of specifying input + to the program.) You may also sell a binary produced by the dumping of + a running Perl script that belongs to you, provided that you provide or + offer to provide the Perl source as specified by the GPL. (The + fact that a Perl interpreter and your code are in the same binary file + is, in this case, a form of mere aggregation.) This is my interpretation + of the GPL. If you still have concerns or difficulties understanding + my intent, feel free to contact me. Of course, the Artistic License + spells all this out for your protection, so you may prefer to use that. + +Files: WebKitLibraries/WebCoreSQLite3 +Copyright: © 2001, 2006 +License: other + The author disclaims copyright to this source code. In place of + a legal notice, here is a blessing: + . + May you do good and not evil. + May you find forgiveness for yourself and forgive others. + May you share freely, never taking more than you give. + +Files: acinclude.m4 +Copyright: © 2007, 2008 Josh Triplett +License: other + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. diff -Naur WebKit-r41128/debian/files WebKit-r41137-nx/debian/files --- WebKit-r41128/debian/files 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/files 2009-05-05 03:12:34.085635098 -0400 @@ -0,0 +1,3 @@ +libwebkit-dev_1.0-svn41137-8_all.deb libdevel extra +libwebkit-1.0-1_1.0-svn41137-8_armel.deb user/other optional +libwebkit-1.0-1-dbg_1.0-svn41137-8_armel.deb libdevel extra diff -Naur WebKit-r41128/debian/libwebkit-1.0-1.install WebKit-r41137-nx/debian/libwebkit-1.0-1.install --- WebKit-r41128/debian/libwebkit-1.0-1.install 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/libwebkit-1.0-1.install 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,4 @@ +usr/lib/libwebkit-1.0.so.* +usr/lib/webkit-1.0/libexec/GtkLauncher +usr/lib/webkit-1.0/libexec/DumpRenderTree +usr/share/webkit-1.0/* diff -Naur WebKit-r41128/debian/libwebkit-dev.install WebKit-r41137-nx/debian/libwebkit-dev.install --- WebKit-r41128/debian/libwebkit-dev.install 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/libwebkit-dev.install 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,3 @@ +usr/lib/libwebkit-1.0.so +usr/include/webkit-1.0 +usr/lib/pkgconfig/webkit-1.0.pc diff -Naur WebKit-r41128/debian/rules WebKit-r41137-nx/debian/rules --- WebKit-r41128/debian/rules 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/rules 2009-05-03 14:07:03.401116250 -0400 @@ -0,0 +1,102 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export LC_ALL=en_US + +CFLAGS = -g -Wall + +ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O2 -mfpu=vfp -mfloat-abi=softfp +else + CFLAGS += -O0 +endif + +ifeq ($(DEB_BUILD_ARCH),alpha) + CFLAGS += -Wl,--no-relax +endif + +clean: + dh_testdir + dh_testroot + + rm -f build-stamp install-stamp + # comment out next line for fast rebuilds + rm -rf build + + rm -f GNUmakefile.in INSTALL README aclocal.m4 aconfig.h.in compile config.guess config.sub configure depcomp install-sh ltmain.sh missing + rm -rf autom4te.cache + + dh_clean + +build: build-stamp + +build-stamp: + dh_testdir + +# CPPFLAGS="-DMOBILE=1" + [ ! -d build ] && mkdir build || true + cd build && \ + CFLAGS="$(CFLAGS)" \ + CXXFLAGS="$(CFLAGS)" \ + CC="gcc -Wl,--as-needed" \ + CXX="g++ -Wl,--as-needed" \ + ../autogen.sh --prefix=/usr --with-hildon --with-unicode-backend=glib --disable-dashboard-support --enable-optimizations --enable-workers --with-http-backend=curl + + $(MAKE) -j10 -C build + + touch $@ + +install: install-stamp + +install-stamp: build-stamp + dh_testdir + dh_testroot + + dh_clean -k + + $(MAKE) -j10 -C build install DESTDIR="$(CURDIR)"/debian/tmp + [ ! -d debian/tmp/usr/lib/webkit-1.0/libexec ] && install -d -m 755 debian/tmp/usr/lib/webkit-1.0/libexec || true + build/libtool --mode=install install -m 755 build/Programs/DumpRenderTree "$(CURDIR)"/debian/tmp/usr/lib/webkit-1.0/libexec/DumpRenderTree + build/libtool --mode=install install -m 755 build/Programs/GtkLauncher "$(CURDIR)"/debian/tmp/usr/lib/webkit-1.0/libexec/GtkLauncher + + touch $@ + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs -i + dh_installchangelogs -i + dh_install -i --sourcedir=debian/tmp + dh_link -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs -a + dh_installchangelogs -a + dh_install -a --sourcedir=debian/tmp + dh_link -a + # dh_strip -a --dbg-package=libwebkit-1.0-1 + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_makeshlibs -a -V 'libwebkit-1.0-1 (>= 1.0)' -- -c4 + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary: binary-indep binary-arch + +.PHONY: build clean install binary binary-indep binary-arch diff -Naur WebKit-r41128/debian/shlibs.local WebKit-r41137-nx/debian/shlibs.local --- WebKit-r41128/debian/shlibs.local 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/debian/shlibs.local 2009-03-25 03:31:31.000000000 -0400 @@ -0,0 +1 @@ +libfreetype 6 libfreetype6 (>= 2.2) diff -Naur WebKit-r41128/GNUmakefile.am WebKit-r41137-nx/GNUmakefile.am --- WebKit-r41128/GNUmakefile.am 2009-02-20 22:38:12.000000000 -0500 +++ WebKit-r41137-nx/GNUmakefile.am 2009-02-23 16:01:26.000000000 -0500 @@ -50,8 +50,15 @@ # Global flags to CPP global_cppflags := +if USE_ICU_UNICODE global_cppflags += \ -DWTF_USE_ICU_UNICODE=1 +endif + +if USE_GLIB_UNICODE +global_cppflags += \ + -DWTF_USE_GLIB_UNICODE=1 +endif # Default compiler flags global_cflags := \ @@ -314,6 +321,7 @@ WebKit/gtk/webkit/webkitwebpolicydecision.h \ WebKit/gtk/webkit/webkitwebsettings.h \ WebKit/gtk/webkit/webkitwebwindowfeatures.h \ + WebKit/gtk/webkit/webkitwebdownload.h \ WebKit/gtk/webkit/webkitwebview.h webkitgtk_built_sources += \ @@ -348,6 +356,7 @@ WebKit/gtk/webkit/webkitwebnavigationaction.cpp \ WebKit/gtk/webkit/webkitwebpolicydecision.cpp \ WebKit/gtk/webkit/webkitwebsettings.cpp \ + WebKit/gtk/webkit/webkitwebdownload.cpp \ WebKit/gtk/webkit/webkitwebview.cpp \ WebKit/gtk/webkit/webkitwebwindowfeatures.cpp diff -Naur WebKit-r41128/JavaScriptCore/wtf/unicode/glib/CasefoldTableFromGLib.h WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/CasefoldTableFromGLib.h --- WebKit-r41128/JavaScriptCore/wtf/unicode/glib/CasefoldTableFromGLib.h 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/CasefoldTableFromGLib.h 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,200 @@ +/* + * Copyright (C) 2006 George Staikos + * Copyright (C) 2006 Alexey Proskuryakov + * Copyright (C) 2007 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2008 Dominik Röttsches + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef CasefoldTableFromGLib_h +#define CasefoldTableFromGLib_h + +#include + +// copied from GLib + +/* Table of casefolding cases that can't be derived by lowercasing + */ +static const struct { + guint16 ch; + gchar data[7]; +} casefold_table[] = { + { 0x00b5, "\xce\xbc" }, + { 0x00df, "\x73\x73" }, + { 0x0130, "\x69\xcc\x87" }, + { 0x0149, "\xca\xbc\x6e" }, + { 0x017f, "\x73" }, + { 0x01f0, "\x6a\xcc\x8c" }, + { 0x0345, "\xce\xb9" }, + { 0x0390, "\xce\xb9\xcc\x88\xcc\x81" }, + { 0x03b0, "\xcf\x85\xcc\x88\xcc\x81" }, + { 0x03c2, "\xcf\x83" }, + { 0x03d0, "\xce\xb2" }, + { 0x03d1, "\xce\xb8" }, + { 0x03d5, "\xcf\x86" }, + { 0x03d6, "\xcf\x80" }, + { 0x03f0, "\xce\xba" }, + { 0x03f1, "\xcf\x81" }, + { 0x03f5, "\xce\xb5" }, + { 0x0587, "\xd5\xa5\xd6\x82" }, + { 0x1e96, "\x68\xcc\xb1" }, + { 0x1e97, "\x74\xcc\x88" }, + { 0x1e98, "\x77\xcc\x8a" }, + { 0x1e99, "\x79\xcc\x8a" }, + { 0x1e9a, "\x61\xca\xbe" }, + { 0x1e9b, "\xe1\xb9\xa1" }, + { 0x1f50, "\xcf\x85\xcc\x93" }, + { 0x1f52, "\xcf\x85\xcc\x93\xcc\x80" }, + { 0x1f54, "\xcf\x85\xcc\x93\xcc\x81" }, + { 0x1f56, "\xcf\x85\xcc\x93\xcd\x82" }, + { 0x1f80, "\xe1\xbc\x80\xce\xb9" }, + { 0x1f81, "\xe1\xbc\x81\xce\xb9" }, + { 0x1f82, "\xe1\xbc\x82\xce\xb9" }, + { 0x1f83, "\xe1\xbc\x83\xce\xb9" }, + { 0x1f84, "\xe1\xbc\x84\xce\xb9" }, + { 0x1f85, "\xe1\xbc\x85\xce\xb9" }, + { 0x1f86, "\xe1\xbc\x86\xce\xb9" }, + { 0x1f87, "\xe1\xbc\x87\xce\xb9" }, + { 0x1f88, "\xe1\xbc\x80\xce\xb9" }, + { 0x1f89, "\xe1\xbc\x81\xce\xb9" }, + { 0x1f8a, "\xe1\xbc\x82\xce\xb9" }, + { 0x1f8b, "\xe1\xbc\x83\xce\xb9" }, + { 0x1f8c, "\xe1\xbc\x84\xce\xb9" }, + { 0x1f8d, "\xe1\xbc\x85\xce\xb9" }, + { 0x1f8e, "\xe1\xbc\x86\xce\xb9" }, + { 0x1f8f, "\xe1\xbc\x87\xce\xb9" }, + { 0x1f90, "\xe1\xbc\xa0\xce\xb9" }, + { 0x1f91, "\xe1\xbc\xa1\xce\xb9" }, + { 0x1f92, "\xe1\xbc\xa2\xce\xb9" }, + { 0x1f93, "\xe1\xbc\xa3\xce\xb9" }, + { 0x1f94, "\xe1\xbc\xa4\xce\xb9" }, + { 0x1f95, "\xe1\xbc\xa5\xce\xb9" }, + { 0x1f96, "\xe1\xbc\xa6\xce\xb9" }, + { 0x1f97, "\xe1\xbc\xa7\xce\xb9" }, + { 0x1f98, "\xe1\xbc\xa0\xce\xb9" }, + { 0x1f99, "\xe1\xbc\xa1\xce\xb9" }, + { 0x1f9a, "\xe1\xbc\xa2\xce\xb9" }, + { 0x1f9b, "\xe1\xbc\xa3\xce\xb9" }, + { 0x1f9c, "\xe1\xbc\xa4\xce\xb9" }, + { 0x1f9d, "\xe1\xbc\xa5\xce\xb9" }, + { 0x1f9e, "\xe1\xbc\xa6\xce\xb9" }, + { 0x1f9f, "\xe1\xbc\xa7\xce\xb9" }, + { 0x1fa0, "\xe1\xbd\xa0\xce\xb9" }, + { 0x1fa1, "\xe1\xbd\xa1\xce\xb9" }, + { 0x1fa2, "\xe1\xbd\xa2\xce\xb9" }, + { 0x1fa3, "\xe1\xbd\xa3\xce\xb9" }, + { 0x1fa4, "\xe1\xbd\xa4\xce\xb9" }, + { 0x1fa5, "\xe1\xbd\xa5\xce\xb9" }, + { 0x1fa6, "\xe1\xbd\xa6\xce\xb9" }, + { 0x1fa7, "\xe1\xbd\xa7\xce\xb9" }, + { 0x1fa8, "\xe1\xbd\xa0\xce\xb9" }, + { 0x1fa9, "\xe1\xbd\xa1\xce\xb9" }, + { 0x1faa, "\xe1\xbd\xa2\xce\xb9" }, + { 0x1fab, "\xe1\xbd\xa3\xce\xb9" }, + { 0x1fac, "\xe1\xbd\xa4\xce\xb9" }, + { 0x1fad, "\xe1\xbd\xa5\xce\xb9" }, + { 0x1fae, "\xe1\xbd\xa6\xce\xb9" }, + { 0x1faf, "\xe1\xbd\xa7\xce\xb9" }, + { 0x1fb2, "\xe1\xbd\xb0\xce\xb9" }, + { 0x1fb3, "\xce\xb1\xce\xb9" }, + { 0x1fb4, "\xce\xac\xce\xb9" }, + { 0x1fb6, "\xce\xb1\xcd\x82" }, + { 0x1fb7, "\xce\xb1\xcd\x82\xce\xb9" }, + { 0x1fbc, "\xce\xb1\xce\xb9" }, + { 0x1fbe, "\xce\xb9" }, + { 0x1fc2, "\xe1\xbd\xb4\xce\xb9" }, + { 0x1fc3, "\xce\xb7\xce\xb9" }, + { 0x1fc4, "\xce\xae\xce\xb9" }, + { 0x1fc6, "\xce\xb7\xcd\x82" }, + { 0x1fc7, "\xce\xb7\xcd\x82\xce\xb9" }, + { 0x1fcc, "\xce\xb7\xce\xb9" }, + { 0x1fd2, "\xce\xb9\xcc\x88\xcc\x80" }, + { 0x1fd3, "\xce\xb9\xcc\x88\xcc\x81" }, + { 0x1fd6, "\xce\xb9\xcd\x82" }, + { 0x1fd7, "\xce\xb9\xcc\x88\xcd\x82" }, + { 0x1fe2, "\xcf\x85\xcc\x88\xcc\x80" }, + { 0x1fe3, "\xcf\x85\xcc\x88\xcc\x81" }, + { 0x1fe4, "\xcf\x81\xcc\x93" }, + { 0x1fe6, "\xcf\x85\xcd\x82" }, + { 0x1fe7, "\xcf\x85\xcc\x88\xcd\x82" }, + { 0x1ff2, "\xe1\xbd\xbc\xce\xb9" }, + { 0x1ff3, "\xcf\x89\xce\xb9" }, + { 0x1ff4, "\xcf\x8e\xce\xb9" }, + { 0x1ff6, "\xcf\x89\xcd\x82" }, + { 0x1ff7, "\xcf\x89\xcd\x82\xce\xb9" }, + { 0x1ffc, "\xcf\x89\xce\xb9" }, + { 0x2160, "\xe2\x85\xb0" }, + { 0x2161, "\xe2\x85\xb1" }, + { 0x2162, "\xe2\x85\xb2" }, + { 0x2163, "\xe2\x85\xb3" }, + { 0x2164, "\xe2\x85\xb4" }, + { 0x2165, "\xe2\x85\xb5" }, + { 0x2166, "\xe2\x85\xb6" }, + { 0x2167, "\xe2\x85\xb7" }, + { 0x2168, "\xe2\x85\xb8" }, + { 0x2169, "\xe2\x85\xb9" }, + { 0x216a, "\xe2\x85\xba" }, + { 0x216b, "\xe2\x85\xbb" }, + { 0x216c, "\xe2\x85\xbc" }, + { 0x216d, "\xe2\x85\xbd" }, + { 0x216e, "\xe2\x85\xbe" }, + { 0x216f, "\xe2\x85\xbf" }, + { 0x24b6, "\xe2\x93\x90" }, + { 0x24b7, "\xe2\x93\x91" }, + { 0x24b8, "\xe2\x93\x92" }, + { 0x24b9, "\xe2\x93\x93" }, + { 0x24ba, "\xe2\x93\x94" }, + { 0x24bb, "\xe2\x93\x95" }, + { 0x24bc, "\xe2\x93\x96" }, + { 0x24bd, "\xe2\x93\x97" }, + { 0x24be, "\xe2\x93\x98" }, + { 0x24bf, "\xe2\x93\x99" }, + { 0x24c0, "\xe2\x93\x9a" }, + { 0x24c1, "\xe2\x93\x9b" }, + { 0x24c2, "\xe2\x93\x9c" }, + { 0x24c3, "\xe2\x93\x9d" }, + { 0x24c4, "\xe2\x93\x9e" }, + { 0x24c5, "\xe2\x93\x9f" }, + { 0x24c6, "\xe2\x93\xa0" }, + { 0x24c7, "\xe2\x93\xa1" }, + { 0x24c8, "\xe2\x93\xa2" }, + { 0x24c9, "\xe2\x93\xa3" }, + { 0x24ca, "\xe2\x93\xa4" }, + { 0x24cb, "\xe2\x93\xa5" }, + { 0x24cc, "\xe2\x93\xa6" }, + { 0x24cd, "\xe2\x93\xa7" }, + { 0x24ce, "\xe2\x93\xa8" }, + { 0x24cf, "\xe2\x93\xa9" }, + { 0xfb00, "\x66\x66" }, + { 0xfb01, "\x66\x69" }, + { 0xfb02, "\x66\x6c" }, + { 0xfb03, "\x66\x66\x69" }, + { 0xfb04, "\x66\x66\x6c" }, + { 0xfb05, "\x73\x74" }, + { 0xfb06, "\x73\x74" }, + { 0xfb13, "\xd5\xb4\xd5\xb6" }, + { 0xfb14, "\xd5\xb4\xd5\xa5" }, + { 0xfb15, "\xd5\xb4\xd5\xab" }, + { 0xfb16, "\xd5\xbe\xd5\xb6" }, + { 0xfb17, "\xd5\xb4\xd5\xad" } +}; + + +#endif + diff -Naur WebKit-r41128/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h --- WebKit-r41128/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,407 @@ +/* + * Copyright (C) 2006 George Staikos + * Copyright (C) 2006 Alexey Proskuryakov + * Copyright (C) 2007 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2008 Dominik Röttsches + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef UnicodeGLib_h +#define UnicodeGLib_h + +#include +#include +#include + +#include +#include + +#include + +#include "CasefoldTableFromGLib.h" +#include "UnicodeGLibTypes.h" +#include "UnicodeMacrosFromICU.h" + +namespace WTF { + namespace Unicode { + + enum Direction { + LeftToRight, + RightToLeft, + EuropeanNumber, + EuropeanNumberSeparator, + EuropeanNumberTerminator, + ArabicNumber, + CommonNumberSeparator, + BlockSeparator, + SegmentSeparator, + WhiteSpaceNeutral, + OtherNeutral, + LeftToRightEmbedding, + LeftToRightOverride, + RightToLeftArabic, + RightToLeftEmbedding, + RightToLeftOverride, + PopDirectionalFormat, + NonSpacingMark, + BoundaryNeutral + }; + + enum DecompositionType { + DecompositionNone, + DecompositionCanonical, + DecompositionCompat, + DecompositionCircle, + DecompositionFinal, + DecompositionFont, + DecompositionFraction, + DecompositionInitial, + DecompositionIsolated, + DecompositionMedial, + DecompositionNarrow, + DecompositionNoBreak, + DecompositionSmall, + DecompositionSquare, + DecompositionSub, + DecompositionSuper, + DecompositionVertical, + DecompositionWide, + }; + + enum CharCategory { + NoCategory = 0, + Other_NotAssigned = U_MASK(G_UNICODE_UNASSIGNED), + Letter_Uppercase = U_MASK(G_UNICODE_UPPERCASE_LETTER), + Letter_Lowercase = U_MASK(G_UNICODE_LOWERCASE_LETTER), + Letter_Titlecase = U_MASK(G_UNICODE_TITLECASE_LETTER), + Letter_Modifier = U_MASK(G_UNICODE_MODIFIER_LETTER), + Letter_Other = U_MASK(G_UNICODE_OTHER_LETTER), + + Mark_NonSpacing = U_MASK(G_UNICODE_NON_SPACING_MARK), + Mark_Enclosing = U_MASK(G_UNICODE_ENCLOSING_MARK), + Mark_SpacingCombining = U_MASK(G_UNICODE_COMBINING_MARK), + + Number_DecimalDigit = U_MASK(G_UNICODE_DECIMAL_NUMBER), + Number_Letter = U_MASK(G_UNICODE_LETTER_NUMBER), + Number_Other = U_MASK(G_UNICODE_OTHER_NUMBER), + + Separator_Space = U_MASK(G_UNICODE_SPACE_SEPARATOR), + Separator_Line = U_MASK(G_UNICODE_LINE_SEPARATOR), + Separator_Paragraph = U_MASK(G_UNICODE_PARAGRAPH_SEPARATOR), + + Other_Control = U_MASK(G_UNICODE_CONTROL), + Other_Format = U_MASK(G_UNICODE_FORMAT), + Other_PrivateUse = U_MASK(G_UNICODE_PRIVATE_USE), + Other_Surrogate = U_MASK(G_UNICODE_SURROGATE), + + Punctuation_Dash = U_MASK(G_UNICODE_DASH_PUNCTUATION), + Punctuation_Open = U_MASK(G_UNICODE_OPEN_PUNCTUATION), + Punctuation_Close = U_MASK(G_UNICODE_CLOSE_PUNCTUATION), + Punctuation_Connector = U_MASK(G_UNICODE_CONNECT_PUNCTUATION), + Punctuation_Other = U_MASK(G_UNICODE_OTHER_PUNCTUATION), + + Symbol_Math = U_MASK(G_UNICODE_MATH_SYMBOL), + Symbol_Currency = U_MASK(G_UNICODE_CURRENCY_SYMBOL), + Symbol_Modifier = U_MASK(G_UNICODE_MODIFIER_SYMBOL), + Symbol_Other = U_MASK(G_UNICODE_OTHER_SYMBOL), + + Punctuation_InitialQuote = U_MASK(G_UNICODE_INITIAL_PUNCTUATION), + Punctuation_FinalQuote = U_MASK(G_UNICODE_FINAL_PUNCTUATION) + }; + + inline UChar32 foldCase(UChar32 ch) + { + // add g_unichar_casefold to GLib upstream? + + int start = 0; + int end = G_N_ELEMENTS(casefold_table); + + if (ch >= casefold_table[start].ch && + ch <= casefold_table[end - 1].ch) { + while (true) { + int half = (start + end) / 2; + if (ch == casefold_table[half].ch) + return g_utf8_get_char(casefold_table[half].data); + if (half == start) + break; + else if (ch > casefold_table[half].ch) + start = half; + else + end = half; + } + } + + return g_unichar_tolower (ch); + } + + inline int foldCase(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error) + { + *error = false; + GOwnPtr gerror; + + GOwnPtr utf8src; + utf8src.set(g_utf16_to_utf8(src, srcLength, 0, 0, &gerror.outPtr())); + if (gerror) { + *error = true; + return -1; + } + + GOwnPtr utf8result; + utf8result.set(g_utf8_casefold(utf8src.get(), -1)); + + long utf16resultLength = -1; + GOwnPtr utf16result; + utf16result.set(g_utf8_to_utf16(utf8result.get(), -1, 0, &utf16resultLength, &gerror.outPtr())); + if (gerror) { + *error = true; + return -1; + } + + if (utf16resultLength > resultLength) { + *error = true; + return utf16resultLength; + } + memcpy(result, utf16result.get(), utf16resultLength * sizeof(UChar)); + + return utf16resultLength; + } + + inline int toLower(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error) + { + *error = false; + GOwnPtr gerror; + + GOwnPtr utf8src; + utf8src.set(g_utf16_to_utf8(src, srcLength, 0, 0, &gerror.outPtr())); + if (gerror) { + *error = true; + return -1; + } + + GOwnPtr utf8result; + utf8result.set(g_utf8_strdown(utf8src.get(), -1)); + + long utf16resultLength = -1; + GOwnPtr utf16result; + utf16result.set(g_utf8_to_utf16(utf8result.get(), -1, 0, &utf16resultLength, &gerror.outPtr())); + if (gerror) { + *error = true; + return -1; + } + + if (utf16resultLength > resultLength) { + *error = true; + return utf16resultLength; + } + memcpy(result, utf16result.get(), utf16resultLength * sizeof(UChar)); + + return utf16resultLength; + } + + inline UChar32 toLower(UChar32 c) + { + return g_unichar_tolower(c); + } + + inline UChar32 toUpper(UChar32 c) + { + return g_unichar_toupper(c); + } + + inline int toUpper(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error) + { + *error = false; + GOwnPtr gerror; + + GOwnPtr utf8src; + utf8src.set(g_utf16_to_utf8(src, srcLength, 0, 0, &gerror.outPtr())); + if (gerror) { + *error = true; + return -1; + } + + GOwnPtr utf8result; + utf8result.set(g_utf8_strup(utf8src.get(), -1)); + + long utf16resultLength = -1; + GOwnPtr utf16result; + utf16result.set(g_utf8_to_utf16(utf8result.get(), -1, 0, &utf16resultLength, &gerror.outPtr())); + if (gerror) { + *error = true; + return -1; + } + + if (utf16resultLength > resultLength) { + *error = true; + return utf16resultLength; + } + memcpy(result, utf16result.get(), utf16resultLength * sizeof(UChar)); + + return utf16resultLength; + } + + inline UChar32 toTitleCase(UChar32 c) + { + return g_unichar_totitle(c); + } + + inline bool isArabicChar(UChar32 c) + { + return c >= 0x0600 && c <= 0x06FF; + } + + inline bool isFormatChar(UChar32 c) + { + return g_unichar_type(c) == G_UNICODE_FORMAT; + } + + inline bool isSeparatorSpace(UChar32 c) + { + return g_unichar_type(c) == G_UNICODE_SPACE_SEPARATOR; + } + + inline bool isPrintableChar(UChar32 c) + { + return g_unichar_isprint(c); + } + + inline bool isDigit(UChar32 c) + { + return g_unichar_isdigit(c); + } + + inline bool isPunct(UChar32 c) + { + return g_unichar_ispunct(c); + } + + inline UChar32 mirroredChar(UChar32 c) + { + gunichar mirror = 0; + g_unichar_get_mirror_char(c, &mirror); + return mirror; + } + + inline CharCategory category(UChar32 c) + { + if (c > 0xffff) + return NoCategory; + + return (CharCategory) U_MASK(g_unichar_type(c)); + } + + inline Direction direction(UChar32 c) + { + /*PangoBidiType*/ PangoDirection type = pango_unichar_direction(c);//pango_bidi_type_for_unichar(c); + switch (type) { + case PANGO_DIRECTION_LTR: + return LeftToRight; + case PANGO_DIRECTION_RTL: + return RightToLeft; + case PANGO_DIRECTION_WEAK_LTR: + return EuropeanNumber; + case PANGO_DIRECTION_WEAK_RTL: + return ArabicNumber; +/* case PANGO_BIDI_TYPE_L: + return LeftToRight; + case PANGO_BIDI_TYPE_R: + return RightToLeft; + case PANGO_BIDI_TYPE_AL: + return RightToLeftArabic; + case PANGO_BIDI_TYPE_LRE: + return LeftToRightEmbedding; + case PANGO_BIDI_TYPE_RLE: + return RightToLeftEmbedding; + case PANGO_BIDI_TYPE_LRO: + return LeftToRightOverride; + case PANGO_BIDI_TYPE_RLO: + return RightToLeftOverride; + case PANGO_BIDI_TYPE_PDF: + return PopDirectionalFormat; + case PANGO_BIDI_TYPE_EN: + return EuropeanNumber; + case PANGO_BIDI_TYPE_AN: + return ArabicNumber; + case PANGO_BIDI_TYPE_ES: + return EuropeanNumberSeparator; + case PANGO_BIDI_TYPE_ET: + return EuropeanNumberTerminator; + case PANGO_BIDI_TYPE_CS: + return CommonNumberSeparator; + case PANGO_BIDI_TYPE_NSM: + return NonSpacingMark; + case PANGO_BIDI_TYPE_BN: + return BoundaryNeutral; + case PANGO_BIDI_TYPE_B: + return BlockSeparator; + case PANGO_BIDI_TYPE_S: + return SegmentSeparator; + case PANGO_BIDI_TYPE_WS: + return WhiteSpaceNeutral;*/ + default: + return OtherNeutral; + } + } + + inline bool isLower(UChar32 c) + { + return g_unichar_islower(c); + } + + inline int digitValue(UChar32 c) + { + return g_unichar_digit_value(c); + } + + inline uint8_t combiningClass(UChar32 c) + { + // return g_unichar_combining_class(c); + return 0; + } + + inline DecompositionType decompositionType(UChar32 c) + { + // FIXME + return DecompositionNone; + } + + inline int umemcasecmp(const UChar* a, const UChar* b, int len) + { + GOwnPtr utf8a; + GOwnPtr utf8b; + + utf8a.set(g_utf16_to_utf8(a, len, 0, 0, 0)); + utf8b.set(g_utf16_to_utf8(b, len, 0, 0, 0)); + + GOwnPtr foldedA; + GOwnPtr foldedB; + + foldedA.set(g_utf8_casefold(utf8a.get(), -1)); + foldedB.set(g_utf8_casefold(utf8b.get(), -1)); + + int result = g_utf8_collate(foldedA.get(), foldedB.get()); + + return result; + } + + } +} + +#endif + diff -Naur WebKit-r41128/JavaScriptCore/wtf/unicode/glib/UnicodeGLibTypes.h WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/UnicodeGLibTypes.h --- WebKit-r41128/JavaScriptCore/wtf/unicode/glib/UnicodeGLibTypes.h 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/UnicodeGLibTypes.h 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2006 George Staikos + * Copyright (C) 2006 Alexey Proskuryakov + * Copyright (C) 2007 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2008 Dominik Röttsches + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef UnicodeGLibTypes_h +#define UnicodeGLibTypes_h + +typedef uint16_t UChar; +typedef int32_t UChar32; + +#endif diff -Naur WebKit-r41128/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h --- WebKit-r41128/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h 2009-02-23 16:01:26.000000000 -0500 @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2006 George Staikos + * Copyright (C) 2006 Alexey Proskuryakov + * Copyright (C) 2007 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2008 Dominik Röttsches + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef UnicodeMacrosFromICU_h +#define UnicodeMacrosFromICU_h + +// some defines from ICU + +#define U16_IS_LEAD(c) (((c)&0xfffffc00)==0xd800) +#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00) +#define U16_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000) +#define U16_GET_SUPPLEMENTARY(lead, trail) \ + (((UChar32)(lead)<<10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET) + +#define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0) +#define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00) + +#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800) +#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c) +#define U16_IS_SURROGATE(c) U_IS_SURROGATE(c) +#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0) + +#define U16_NEXT(s, i, length, c) { \ + (c)=(s)[(i)++]; \ + if(U16_IS_LEAD(c)) { \ + uint16_t __c2; \ + if((i)<(length) && U16_IS_TRAIL(__c2=(s)[(i)])) { \ + ++(i); \ + (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ + } \ + } \ +} + +#define U_MASK(x) ((uint32_t)1<<(x)) + +#endif + diff -Naur WebKit-r41128/JavaScriptCore/wtf/unicode/Unicode.h WebKit-r41137-nx/JavaScriptCore/wtf/unicode/Unicode.h --- WebKit-r41128/JavaScriptCore/wtf/unicode/Unicode.h 2009-01-21 00:13:29.000000000 -0500 +++ WebKit-r41137-nx/JavaScriptCore/wtf/unicode/Unicode.h 2009-02-23 16:01:26.000000000 -0500 @@ -28,6 +28,8 @@ #include "qt4/UnicodeQt4.h" #elif USE(ICU_UNICODE) #include +#elif USE(GLIB_UNICODE) +#include #else #error "Unknown Unicode implementation" #endif diff -Naur WebKit-r41128/LayoutTests/fast/dom/empty-hash-and-search-expected.txt WebKit-r41137-nx/LayoutTests/fast/dom/empty-hash-and-search-expected.txt --- WebKit-r41128/LayoutTests/fast/dom/empty-hash-and-search-expected.txt 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/dom/empty-hash-and-search-expected.txt 2009-03-24 16:51:45.000000000 -0400 @@ -0,0 +1,13 @@ +Hash and search properties should be non-empty only if they were specified. + +link w/o hash link with empty hash link with hash + +location.hash: +link1.hash: +link2.hash: +link3.hash: #test +location.search: +link1.search: +link2.search: +link3.search: ?search + diff -Naur WebKit-r41128/LayoutTests/fast/dom/empty-hash-and-search.html WebKit-r41137-nx/LayoutTests/fast/dom/empty-hash-and-search.html --- WebKit-r41128/LayoutTests/fast/dom/empty-hash-and-search.html 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/dom/empty-hash-and-search.html 2009-03-24 16:51:45.000000000 -0400 @@ -0,0 +1,54 @@ + + +link's hash property + + +Hash and search properties should be non-empty only if they were specified.
+
+link w/o hash +link with empty hash +link with hash +
+ + + diff -Naur WebKit-r41128/LayoutTests/fast/dom/onload-open-expected.txt WebKit-r41137-nx/LayoutTests/fast/dom/onload-open-expected.txt --- WebKit-r41128/LayoutTests/fast/dom/onload-open-expected.txt 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/dom/onload-open-expected.txt 2009-03-24 16:51:20.000000000 -0400 @@ -0,0 +1,3 @@ +Test for bug 15707: Crash when manipulating document from within an iframe onload function. + +SUCCESS if no crash. diff -Naur WebKit-r41128/LayoutTests/fast/dom/onload-open.html WebKit-r41137-nx/LayoutTests/fast/dom/onload-open.html --- WebKit-r41128/LayoutTests/fast/dom/onload-open.html 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/dom/onload-open.html 2009-03-24 16:51:20.000000000 -0400 @@ -0,0 +1,19 @@ + + + + + + + + + diff -Naur WebKit-r41128/LayoutTests/fast/dom/resources/frame-onload-open.html WebKit-r41137-nx/LayoutTests/fast/dom/resources/frame-onload-open.html --- WebKit-r41128/LayoutTests/fast/dom/resources/frame-onload-open.html 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/dom/resources/frame-onload-open.html 2009-03-24 16:51:20.000000000 -0400 @@ -0,0 +1,5 @@ + + + + + diff -Naur WebKit-r41128/LayoutTests/fast/forms/numeric-input-name-expected.txt WebKit-r41137-nx/LayoutTests/fast/forms/numeric-input-name-expected.txt --- WebKit-r41128/LayoutTests/fast/forms/numeric-input-name-expected.txt 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/forms/numeric-input-name-expected.txt 2009-03-24 16:51:00.000000000 -0400 @@ -0,0 +1,10 @@ +Check form element indexed iteration (there should be no identical lines). + +field_000=Field_000 +0=0 +-1=-1 +method=Method +reset=Reset +focus=Focus +children=Children + diff -Naur WebKit-r41128/LayoutTests/fast/forms/numeric-input-name.html WebKit-r41137-nx/LayoutTests/fast/forms/numeric-input-name.html --- WebKit-r41128/LayoutTests/fast/forms/numeric-input-name.html 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/forms/numeric-input-name.html 2009-03-24 16:51:00.000000000 -0400 @@ -0,0 +1,52 @@ + + + + + +

Check form element indexed iteration (there should be no identical lines).

+
+
+ + + + + + + + +
+ + + diff -Naur WebKit-r41128/LayoutTests/fast/forms/select-no-name-expected.txt WebKit-r41137-nx/LayoutTests/fast/forms/select-no-name-expected.txt --- WebKit-r41128/LayoutTests/fast/forms/select-no-name-expected.txt 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/forms/select-no-name-expected.txt 2009-03-24 16:51:37.000000000 -0400 @@ -0,0 +1,5 @@ +Test for bug 20184: SELECT with no name generates invalid query string. + + +PASS +reload diff -Naur WebKit-r41128/LayoutTests/fast/forms/select-no-name.html WebKit-r41137-nx/LayoutTests/fast/forms/select-no-name.html --- WebKit-r41128/LayoutTests/fast/forms/select-no-name.html 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/LayoutTests/fast/forms/select-no-name.html 2009-03-24 16:51:37.000000000 -0400 @@ -0,0 +1,66 @@ + + + Submit + + + +

Test for bug 20184: +SELECT with no name generates invalid query string.

+
+ + + + + +
+

PASS

+

FAIL

+ +

+reload +

+ + diff -Naur WebKit-r41128/WebCore/bindings/scripts/CodeGeneratorJS.pm WebKit-r41137-nx/WebCore/bindings/scripts/CodeGeneratorJS.pm --- WebKit-r41128/WebCore/bindings/scripts/CodeGeneratorJS.pm 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/bindings/scripts/CodeGeneratorJS.pm 2009-03-24 16:50:58.000000000 -0400 @@ -284,29 +284,19 @@ push(@getOwnPropertySlotImpl, " return false;\n\n"); } - my $hasNameGetterGeneration = sub { - push(@getOwnPropertySlotImpl, " if (canGetItemsForName(exec, static_cast<$implClassName*>(impl()), propertyName)) {\n"); - push(@getOwnPropertySlotImpl, " slot.setCustom(this, nameGetter);\n"); - push(@getOwnPropertySlotImpl, " return true;\n"); - push(@getOwnPropertySlotImpl, " }\n"); - if ($inlined) { - $headerIncludes{"AtomicString.h"} = 1; - } else { - $implIncludes{"AtomicString.h"} = 1; + my $manualLookupGetterGeneration = sub { + my $requiresManualLookup = $dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasNameGetter"}; + if ($requiresManualLookup) { + push(@getOwnPropertySlotImpl, " const ${namespaceMaybe}HashEntry* entry = ${className}Table.entry(exec, propertyName);\n"); + push(@getOwnPropertySlotImpl, " if (entry) {\n"); + push(@getOwnPropertySlotImpl, " slot.setCustom(this, entry->propertyGetter());\n"); + push(@getOwnPropertySlotImpl, " return true;\n"); + push(@getOwnPropertySlotImpl, " }\n"); } }; - if ($dataNode->extendedAttributes->{"HasOverridingNameGetter"}) { - &$hasNameGetterGeneration(); - } - - my $requiresManualLookup = $dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasNameGetter"}; - if ($requiresManualLookup) { - push(@getOwnPropertySlotImpl, " const ${namespaceMaybe}HashEntry* entry = ${className}Table.entry(exec, propertyName);\n"); - push(@getOwnPropertySlotImpl, " if (entry) {\n"); - push(@getOwnPropertySlotImpl, " slot.setCustom(this, entry->propertyGetter());\n"); - push(@getOwnPropertySlotImpl, " return true;\n"); - push(@getOwnPropertySlotImpl, " }\n"); + if (!$dataNode->extendedAttributes->{"HasOverridingNameGetter"}) { + &$manualLookupGetterGeneration(); } if ($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"}) { @@ -322,8 +312,20 @@ push(@getOwnPropertySlotImpl, " }\n"); } - if ($dataNode->extendedAttributes->{"HasNameGetter"}) { - &$hasNameGetterGeneration(); + if ($dataNode->extendedAttributes->{"HasNameGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) { + push(@getOwnPropertySlotImpl, " if (canGetItemsForName(exec, static_cast<$implClassName*>(impl()), propertyName)) {\n"); + push(@getOwnPropertySlotImpl, " slot.setCustom(this, nameGetter);\n"); + push(@getOwnPropertySlotImpl, " return true;\n"); + push(@getOwnPropertySlotImpl, " }\n"); + if ($inlined) { + $headerIncludes{"AtomicString.h"} = 1; + } else { + $implIncludes{"AtomicString.h"} = 1; + } + } + + if ($dataNode->extendedAttributes->{"HasOverridingNameGetter"}) { + &$manualLookupGetterGeneration(); } if ($dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}) { diff -Naur WebKit-r41128/WebCore/bridge/IdentifierRep.h WebKit-r41137-nx/WebCore/bridge/IdentifierRep.h --- WebKit-r41128/WebCore/bridge/IdentifierRep.h 2009-02-15 03:48:41.000000000 -0500 +++ WebKit-r41137-nx/WebCore/bridge/IdentifierRep.h 2009-02-23 16:01:26.000000000 -0500 @@ -26,6 +26,7 @@ #ifndef IdentifierRep_h #define IdentifierRep_h +#include #include #include diff -Naur WebKit-r41128/WebCore/css/CSSPrimitiveValueMappings.h WebKit-r41137-nx/WebCore/css/CSSPrimitiveValueMappings.h --- WebKit-r41128/WebCore/css/CSSPrimitiveValueMappings.h 2009-02-16 04:14:50.000000000 -0500 +++ WebKit-r41137-nx/WebCore/css/CSSPrimitiveValueMappings.h 2009-02-23 16:01:26.000000000 -0500 @@ -1676,72 +1676,6 @@ } } -template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e) - : m_type(CSS_IDENT) -{ - switch (e) { - case PE_NONE: - m_value.ident = CSSValueNone; - break; - case PE_STROKE: - m_value.ident = CSSValueStroke; - break; - case PE_FILL: - m_value.ident = CSSValueFill; - break; - case PE_PAINTED: - m_value.ident = CSSValuePainted; - break; - case PE_VISIBLE: - m_value.ident = CSSValueVisible; - break; - case PE_VISIBLE_STROKE: - m_value.ident = CSSValueVisiblestroke; - break; - case PE_VISIBLE_FILL: - m_value.ident = CSSValueVisiblefill; - break; - case PE_VISIBLE_PAINTED: - m_value.ident = CSSValueVisiblepainted; - break; - case PE_AUTO: - m_value.ident = CSSValueAuto; - break; - case PE_ALL: - m_value.ident = CSSValueAll; - break; - } -} - -template<> inline CSSPrimitiveValue::operator EPointerEvents() const -{ - switch (m_value.ident) { - case CSSValueAll: - return PE_ALL; - case CSSValueAuto: - return PE_AUTO; - case CSSValueNone: - return PE_NONE; - case CSSValueVisiblepainted: - return PE_VISIBLE_PAINTED; - case CSSValueVisiblefill: - return PE_VISIBLE_FILL; - case CSSValueVisiblestroke: - return PE_VISIBLE_STROKE; - case CSSValueVisible: - return PE_VISIBLE; - case CSSValuePainted: - return PE_PAINTED; - case CSSValueFill: - return PE_FILL; - case CSSValueStroke: - return PE_STROKE; - default: - ASSERT_NOT_REACHED(); - return PE_ALL; - } -} - #if ENABLE(SVG) template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e) @@ -2078,6 +2012,76 @@ } } +#endif + +template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e) + : m_type(CSS_IDENT) +{ + switch (e) { + case PE_NONE: + m_value.ident = CSSValueNone; + break; + case PE_STROKE: + m_value.ident = CSSValueStroke; + break; + case PE_FILL: + m_value.ident = CSSValueFill; + break; + case PE_PAINTED: + m_value.ident = CSSValuePainted; + break; + case PE_VISIBLE: + m_value.ident = CSSValueVisible; + break; + case PE_VISIBLE_STROKE: + m_value.ident = CSSValueVisiblestroke; + break; + case PE_VISIBLE_FILL: + m_value.ident = CSSValueVisiblefill; + break; + case PE_VISIBLE_PAINTED: + m_value.ident = CSSValueVisiblepainted; + break; + case PE_AUTO: + m_value.ident = CSSValueAuto; + break; + case PE_ALL: + m_value.ident = CSSValueAll; + break; + } +} + +template<> inline CSSPrimitiveValue::operator EPointerEvents() const +{ + switch (m_value.ident) { + case CSSValueAll: + return PE_ALL; + case CSSValueAuto: + return PE_AUTO; + case CSSValueNone: + return PE_NONE; + case CSSValueVisiblepainted: + return PE_VISIBLE_PAINTED; + case CSSValueVisiblefill: + return PE_VISIBLE_FILL; + case CSSValueVisiblestroke: + return PE_VISIBLE_STROKE; + case CSSValueVisible: + return PE_VISIBLE; + case CSSValuePainted: + return PE_PAINTED; + case CSSValueFill: + return PE_FILL; + case CSSValueStroke: + return PE_STROKE; + default: + ASSERT_NOT_REACHED(); + return PE_ALL; + } +} + +#if ENABLE(SVG) + template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e) : m_type(CSS_IDENT) { diff -Naur WebKit-r41128/WebCore/dom/ContainerNode.cpp WebKit-r41137-nx/WebCore/dom/ContainerNode.cpp --- WebKit-r41128/WebCore/dom/ContainerNode.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/dom/ContainerNode.cpp 2009-03-24 16:51:24.000000000 -0400 @@ -387,25 +387,25 @@ if (!m_firstChild) return false; - Node* n; + // The container node can be removed from event handlers. + RefPtr protect(this); - // do any prep work needed before actually starting to detach - // and remove... e.g. stop loading frames, fire unload events - for (n = m_firstChild; n; n = n->nextSibling()) - willRemoveChild(n); + // Do any prep work needed before actually starting to detach + // and remove... e.g. stop loading frames, fire unload events. + // FIXME: Adding new children from event handlers can cause an infinite loop here. + for (RefPtr n = m_firstChild; n; n = n->nextSibling()) + willRemoveChild(n.get()); // exclude this node when looking for removed focusedNode since only children will be removed document()->removeFocusedNodeOfSubtree(this, true); forbidEventDispatch(); int childCountDelta = 0; - while ((n = m_firstChild) != 0) { + while (RefPtr n = m_firstChild) { childCountDelta--; - Node *next = n->nextSibling(); + Node* next = n->nextSibling(); - n->ref(); - // Remove the node from the tree before calling detach or removedFromDocument (4427024, 4129744) n->setPreviousSibling(0); n->setNextSibling(0); @@ -420,8 +420,6 @@ if (n->inDocument()) n->removedFromDocument(); - - n->deref(); } allowEventDispatch(); diff -Naur WebKit-r41128/WebCore/dom/Tokenizer.h WebKit-r41137-nx/WebCore/dom/Tokenizer.h --- WebKit-r41128/WebCore/dom/Tokenizer.h 2009-01-21 00:14:15.000000000 -0500 +++ WebKit-r41137-nx/WebCore/dom/Tokenizer.h 2009-03-24 16:49:57.000000000 -0400 @@ -37,7 +37,7 @@ // received during executing a script must be appended, hence the // extra bool to be able to distinguish between both cases. // document.write() always uses false, while the loader uses true. - virtual bool write(const SegmentedString&, bool appendData) = 0; + virtual void write(const SegmentedString&, bool appendData) = 0; virtual void finish() = 0; virtual bool isWaitingForScripts() const = 0; virtual void stopParsing() { m_parserStopped = true; } diff -Naur WebKit-r41128/WebCore/dom/WorkerLocation.cpp WebKit-r41137-nx/WebCore/dom/WorkerLocation.cpp --- WebKit-r41128/WebCore/dom/WorkerLocation.cpp 2009-01-21 00:14:15.000000000 -0500 +++ WebKit-r41137-nx/WebCore/dom/WorkerLocation.cpp 2009-03-24 16:51:41.000000000 -0400 @@ -66,12 +66,12 @@ String WorkerLocation::search() const { - return m_url.query(); + return m_url.query().isEmpty() ? "" : "?" + m_url.query(); } String WorkerLocation::hash() const { - return m_url.ref().isNull() ? "" : "#" + m_url.ref(); + return m_url.ref().isEmpty() ? "" : "#" + m_url.ref(); } String WorkerLocation::toString() const diff -Naur WebKit-r41128/WebCore/dom/XMLTokenizer.cpp WebKit-r41137-nx/WebCore/dom/XMLTokenizer.cpp --- WebKit-r41128/WebCore/dom/XMLTokenizer.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/dom/XMLTokenizer.cpp 2009-03-24 16:50:04.000000000 -0400 @@ -89,7 +89,7 @@ m_currentNodeIsReferenced = nodeNeedsReference; } -bool XMLTokenizer::write(const SegmentedString& s, bool /*appendData*/) +void XMLTokenizer::write(const SegmentedString& s, bool /*appendData*/) { String parseString = s.toString(); @@ -97,15 +97,14 @@ m_originalSourceForTransform += parseString; if (m_parserStopped || m_sawXSLTransform) - return false; + return; if (m_parserPaused) { m_pendingSrc.append(s); - return false; + return; } doWrite(s.toString()); - return false; } void XMLTokenizer::handleError(ErrorType type, const char* m, int lineNumber, int columnNumber) diff -Naur WebKit-r41128/WebCore/dom/XMLTokenizer.h WebKit-r41137-nx/WebCore/dom/XMLTokenizer.h --- WebKit-r41128/WebCore/dom/XMLTokenizer.h 2009-01-22 18:57:28.000000000 -0500 +++ WebKit-r41137-nx/WebCore/dom/XMLTokenizer.h 2009-03-24 16:49:52.000000000 -0400 @@ -60,7 +60,7 @@ enum ErrorType { warning, nonFatal, fatal }; // from Tokenizer - virtual bool write(const SegmentedString&, bool appendData); + virtual void write(const SegmentedString&, bool appendData); virtual void finish(); virtual bool isWaitingForScripts() const; virtual void stopParsing(); diff -Naur WebKit-r41128/WebCore/GNUmakefile.am WebKit-r41137-nx/WebCore/GNUmakefile.am --- WebKit-r41128/WebCore/GNUmakefile.am 2009-02-20 22:38:13.000000000 -0500 +++ WebKit-r41137-nx/WebCore/GNUmakefile.am 2009-02-23 16:01:26.000000000 -0500 @@ -1447,14 +1447,9 @@ WebCore/platform/text/StringImpl.cpp \ WebCore/platform/text/StringImpl.h \ WebCore/platform/text/TextBoundaries.h \ - WebCore/platform/text/TextBoundariesICU.cpp \ WebCore/platform/text/TextBreakIterator.h \ - WebCore/platform/text/TextBreakIteratorICU.cpp \ - WebCore/platform/text/TextBreakIteratorInternalICU.h \ WebCore/platform/text/TextCodec.cpp \ WebCore/platform/text/TextCodec.h \ - WebCore/platform/text/TextCodecICU.cpp \ - WebCore/platform/text/TextCodecICU.h \ WebCore/platform/text/TextCodecLatin1.cpp \ WebCore/platform/text/TextCodecLatin1.h \ WebCore/platform/text/TextCodecUTF16.cpp \ @@ -1793,8 +1788,31 @@ WebCore/platform/image-decoders/png/PNGImageDecoder.cpp \ WebCore/platform/image-decoders/png/PNGImageDecoder.h \ WebCore/platform/image-decoders/xbm/XBMImageDecoder.cpp \ - WebCore/platform/image-decoders/xbm/XBMImageDecoder.h \ + WebCore/platform/image-decoders/xbm/XBMImageDecoder.h + +# ---- +# icu unicode backend +# ---- +if USE_ICU_UNICODE +webcoregtk_sources += \ + WebCore/platform/text/TextCodecICU.cpp \ + WebCore/platform/text/TextCodecICU.h \ + WebCore/platform/text/TextBoundariesICU.cpp \ + WebCore/platform/text/TextBreakIteratorICU.cpp \ + WebCore/platform/text/TextBreakIteratorInternalICU.h \ WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp +endif # USE_ICU_UNICODE + +# ---- +# glib unicode backend +# ---- +if USE_GLIB_UNICODE +webcoregtk_sources += \ + WebCore/platform/text/gtk/TextCodecGtk.cpp \ + WebCore/platform/text/gtk/TextCodecGtk.h \ + WebCore/platform/text/gtk/TextBoundariesGtk.cpp \ + WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp +endif # ---- # curl http backend diff -Naur WebKit-r41128/WebCore/html/HTMLAnchorElement.cpp WebKit-r41137-nx/WebCore/html/HTMLAnchorElement.cpp --- WebKit-r41128/WebCore/html/HTMLAnchorElement.cpp 2009-02-15 03:48:45.000000000 -0500 +++ WebKit-r41137-nx/WebCore/html/HTMLAnchorElement.cpp 2009-03-24 16:51:42.000000000 -0400 @@ -430,7 +430,8 @@ String HTMLAnchorElement::hash() const { - return "#" + href().ref(); + String ref = href().ref(); + return ref.isEmpty() ? "" : "#" + ref; } String HTMLAnchorElement::host() const @@ -463,7 +464,8 @@ String HTMLAnchorElement::search() const { - return href().query(); + String query = href().query(); + return query.isEmpty() ? "" : "?" + query; } String HTMLAnchorElement::text() const diff -Naur WebKit-r41128/WebCore/html/HTMLInputElement.cpp WebKit-r41137-nx/WebCore/html/HTMLInputElement.cpp --- WebKit-r41128/WebCore/html/HTMLInputElement.cpp 2009-02-16 02:39:40.000000000 -0500 +++ WebKit-r41137-nx/WebCore/html/HTMLInputElement.cpp 2009-02-23 16:01:26.000000000 -0500 @@ -173,7 +173,7 @@ bool HTMLInputElement::shouldUseInputMethod() const { - return m_type == TEXT || m_type == SEARCH || m_type == ISINDEX; + return m_type == TEXT || m_type == SEARCH || m_type == ISINDEX || m_type == PASSWORD; } void HTMLInputElement::dispatchFocusEvent() diff -Naur WebKit-r41128/WebCore/html/HTMLSelectElement.cpp WebKit-r41137-nx/WebCore/html/HTMLSelectElement.cpp --- WebKit-r41128/WebCore/html/HTMLSelectElement.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/html/HTMLSelectElement.cpp 2009-03-24 16:51:36.000000000 -0400 @@ -422,6 +422,9 @@ bool HTMLSelectElement::appendFormData(FormDataList& list, bool) { + if (name().isEmpty()) + return false; + bool successful = false; const Vector& items = listItems(); diff -Naur WebKit-r41128/WebCore/html/HTMLTokenizer.cpp WebKit-r41137-nx/WebCore/html/HTMLTokenizer.cpp --- WebKit-r41128/WebCore/html/HTMLTokenizer.cpp 2009-02-15 03:48:47.000000000 -0500 +++ WebKit-r41137-nx/WebCore/html/HTMLTokenizer.cpp 2009-03-24 16:50:20.000000000 -0400 @@ -1588,13 +1588,13 @@ return true; } -bool HTMLTokenizer::write(const SegmentedString& str, bool appendData) +void HTMLTokenizer::write(const SegmentedString& str, bool appendData) { if (!m_buffer) - return false; + return; if (m_parserStopped) - return false; + return; SegmentedString source(str); if (m_executingScript) @@ -1611,7 +1611,7 @@ m_preloadScanner->write(source); #endif } - return false; + return; } #if PRELOAD_SCANNER_ENABLED @@ -1626,7 +1626,7 @@ // Once a timer is set, it has control of when the tokenizer continues. if (m_timer.isActive()) - return false; + return; bool wasInWrite = m_inWrite; m_inWrite = true; @@ -1764,11 +1764,8 @@ m_state = state; - if (m_noMoreData && !m_inWrite && !state.loadingExtScript() && !m_executingScript && !m_timer.isActive()) { + if (m_noMoreData && !m_inWrite && !state.loadingExtScript() && !m_executingScript && !m_timer.isActive()) end(); // this actually causes us to be deleted - return true; - } - return false; } void HTMLTokenizer::stopParsing() diff -Naur WebKit-r41128/WebCore/html/HTMLTokenizer.h WebKit-r41137-nx/WebCore/html/HTMLTokenizer.h --- WebKit-r41128/WebCore/html/HTMLTokenizer.h 2009-01-21 00:14:17.000000000 -0500 +++ WebKit-r41137-nx/WebCore/html/HTMLTokenizer.h 2009-03-24 16:50:15.000000000 -0400 @@ -138,7 +138,7 @@ HTMLTokenizer(DocumentFragment*); virtual ~HTMLTokenizer(); - virtual bool write(const SegmentedString&, bool appendData); + virtual void write(const SegmentedString&, bool appendData); virtual void finish(); virtual void setForceSynchronous(bool force); virtual bool isWaitingForScripts() const; diff -Naur WebKit-r41128/WebCore/loader/DocLoader.cpp WebKit-r41137-nx/WebCore/loader/DocLoader.cpp --- WebKit-r41128/WebCore/loader/DocLoader.cpp 2009-01-27 02:55:34.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/DocLoader.cpp 2009-04-07 20:22:16.000000000 -0400 @@ -38,6 +38,7 @@ #include "DOMWindow.h" #include "Frame.h" #include "FrameLoader.h" +#include "FrameLoaderClient.h" #include "loader.h" #include "SecurityOrigin.h" #include "Settings.h" @@ -113,10 +114,10 @@ CachedImage* DocLoader::requestImage(const String& url) { CachedImage* resource = static_cast(requestResource(CachedResource::ImageResource, url, String())); - if (autoLoadImages() && resource && resource->stillNeedsLoad()) { - resource->setLoading(true); - cache()->loader()->load(this, resource, true); - } + if (autoLoadImages() && resource && resource->stillNeedsLoad()) { + resource->setLoading(true); + cache()->loader()->load(this, resource, true); + } return resource; } @@ -166,6 +167,11 @@ case CachedResource::FontResource: // These types of resources can be loaded from any origin. // FIXME: Are we sure about CachedResource::FontResource? +//#ifdef MAEMO_CHANGES +// if ( !m_doc->frame()->loader()->client()->dispatchDecidePolicyForNetworkResource(url) ) { +// return false; +// } +//#endif break; #if ENABLE(XSLT) case CachedResource::XSLStyleSheet: diff -Naur WebKit-r41128/WebCore/loader/EmptyClients.h WebKit-r41137-nx/WebCore/loader/EmptyClients.h --- WebKit-r41128/WebCore/loader/EmptyClients.h 2009-02-15 03:48:47.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/EmptyClients.h 2009-04-21 17:25:57.036136200 -0400 @@ -182,6 +182,9 @@ virtual Frame* dispatchCreatePage() { return 0; } virtual void dispatchShow() { } +#ifdef MAEMO_CHANGES + virtual bool dispatchDecidePolicyForNetworkResource(const KURL&) { return true; } +#endif virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String&, const ResourceRequest&) { } virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr, const String&) { } virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr) { } diff -Naur WebKit-r41128/WebCore/loader/FrameLoaderClient.h WebKit-r41137-nx/WebCore/loader/FrameLoaderClient.h --- WebKit-r41128/WebCore/loader/FrameLoaderClient.h 2009-02-15 03:48:47.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/FrameLoaderClient.h 2009-04-21 17:25:46.167131320 -0400 @@ -126,6 +126,9 @@ virtual Frame* dispatchCreatePage() = 0; virtual void dispatchShow() = 0; +#ifdef MAEMO_CHANGES + virtual bool dispatchDecidePolicyForNetworkResource(const KURL&) = 0; +#endif virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String& MIMEType, const ResourceRequest&) = 0; virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr, const String& frameName) = 0; virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr) = 0; diff -Naur WebKit-r41128/WebCore/loader/FTPDirectoryDocument.cpp WebKit-r41137-nx/WebCore/loader/FTPDirectoryDocument.cpp --- WebKit-r41128/WebCore/loader/FTPDirectoryDocument.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/FTPDirectoryDocument.cpp 2009-03-24 16:50:26.000000000 -0400 @@ -57,7 +57,7 @@ public: FTPDirectoryTokenizer(HTMLDocument*); - virtual bool write(const SegmentedString&, bool appendData); + virtual void write(const SegmentedString&, bool appendData); virtual void finish(); virtual bool isWaitingForScripts() const { return false; } @@ -399,7 +399,7 @@ bodyElement->appendChild(m_tableElement, ec); } -bool FTPDirectoryTokenizer::write(const SegmentedString& s, bool /*appendData*/) +void FTPDirectoryTokenizer::write(const SegmentedString& s, bool /*appendData*/) { // Make sure we have the table element to append to by loading the template set in the pref, or // creating a very basic document with the appropriate table @@ -439,7 +439,7 @@ if (!foundNewLine) { m_dest = m_buffer; - return false; + return; } UChar* start = m_buffer; @@ -460,8 +460,6 @@ // Copy the partial line we have left to the carryover buffer if (cursor - start > 1) m_carryOver.append(String(start, cursor - start - 1)); - - return false; } void FTPDirectoryTokenizer::finish() diff -Naur WebKit-r41128/WebCore/loader/ImageDocument.cpp WebKit-r41137-nx/WebCore/loader/ImageDocument.cpp --- WebKit-r41128/WebCore/loader/ImageDocument.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/ImageDocument.cpp 2009-03-24 16:50:34.000000000 -0400 @@ -63,7 +63,7 @@ public: ImageTokenizer(ImageDocument* doc) : m_doc(doc) {} - virtual bool write(const SegmentedString&, bool appendData); + virtual void write(const SegmentedString&, bool appendData); virtual void finish(); virtual bool isWaitingForScripts() const; @@ -91,10 +91,9 @@ // -------- -bool ImageTokenizer::write(const SegmentedString&, bool) +void ImageTokenizer::write(const SegmentedString&, bool) { ASSERT_NOT_REACHED(); - return false; } bool ImageTokenizer::writeRawData(const char*, int) diff -Naur WebKit-r41128/WebCore/loader/loader.cpp WebKit-r41137-nx/WebCore/loader/loader.cpp --- WebKit-r41128/WebCore/loader/loader.cpp 2009-02-15 03:48:47.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/loader.cpp 2009-04-25 20:18:48.126731240 -0400 @@ -49,7 +49,7 @@ #if REQUEST_MANAGEMENT_ENABLED // Match the parallel connection count used by the networking layer // FIXME should not hardcode something like this -static const unsigned maxRequestsInFlightPerHost = 4; +static const unsigned maxRequestsInFlightPerHost = 8; // Having a limit might still help getting more important resources first static const unsigned maxRequestsInFlightForNonHTTPProtocols = 20; #else diff -Naur WebKit-r41128/WebCore/loader/MainResourceLoader.cpp WebKit-r41137-nx/WebCore/loader/MainResourceLoader.cpp --- WebKit-r41128/WebCore/loader/MainResourceLoader.cpp 2009-02-15 03:48:47.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/MainResourceLoader.cpp 2009-05-04 19:12:49.825166073 -0400 @@ -45,6 +45,11 @@ #include "ResourceHandle.h" #include "Settings.h" +#ifdef MAEMO_CHANGES +#include "ResourceHandleInternal.h" +#include +#endif + // FIXME: More that is in common with SubresourceLoader should move up into ResourceLoader. namespace WebCore { @@ -219,9 +224,12 @@ return; } frameLoader()->client()->download(m_handle.get(), request(), m_handle.get()->request(), r); + // CURL reuses the same ResourceHandle to download the file, so we cannot close it. +#if !USE(CURL) // It might have gone missing if (frameLoader()) receivedError(interruptionForPolicyChangeError()); +#endif return; case PolicyIgnore: @@ -363,6 +371,13 @@ RefPtr dl = documentLoader(); #endif +#ifdef MAEMO_CHANGES + if (m_handle) { + ResourceHandleInternal* d = m_handle->getInternal(); + curl_easy_setopt(d->m_handle, CURLOPT_COOKIEJAR, "/home/user/.webkitcookies"); + } +#endif + frameLoader()->finishedLoading(); ResourceLoader::didFinishLoading(); diff -Naur WebKit-r41128/WebCore/loader/MediaDocument.cpp WebKit-r41137-nx/WebCore/loader/MediaDocument.cpp --- WebKit-r41128/WebCore/loader/MediaDocument.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/MediaDocument.cpp 2009-03-24 16:50:29.000000000 -0400 @@ -54,7 +54,7 @@ MediaTokenizer(Document* doc) : m_doc(doc), m_mediaElement(0) {} private: - virtual bool write(const SegmentedString&, bool appendData); + virtual void write(const SegmentedString&, bool appendData); virtual void stopParsing(); virtual void finish(); virtual bool isWaitingForScripts() const; @@ -68,10 +68,9 @@ HTMLMediaElement* m_mediaElement; }; -bool MediaTokenizer::write(const SegmentedString&, bool) +void MediaTokenizer::write(const SegmentedString&, bool) { ASSERT_NOT_REACHED(); - return false; } void MediaTokenizer::createDocumentStructure() diff -Naur WebKit-r41128/WebCore/loader/PluginDocument.cpp WebKit-r41137-nx/WebCore/loader/PluginDocument.cpp --- WebKit-r41128/WebCore/loader/PluginDocument.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/PluginDocument.cpp 2009-03-24 16:50:45.000000000 -0400 @@ -49,7 +49,7 @@ PluginTokenizer(Document* doc) : m_doc(doc), m_embedElement(0) {} private: - virtual bool write(const SegmentedString&, bool appendData); + virtual void write(const SegmentedString&, bool appendData); virtual void stopParsing(); virtual void finish(); virtual bool isWaitingForScripts() const; @@ -63,10 +63,9 @@ HTMLEmbedElement* m_embedElement; }; -bool PluginTokenizer::write(const SegmentedString&, bool) +void PluginTokenizer::write(const SegmentedString&, bool) { ASSERT_NOT_REACHED(); - return false; } void PluginTokenizer::createDocumentStructure() diff -Naur WebKit-r41128/WebCore/loader/ResourceLoader.cpp WebKit-r41137-nx/WebCore/loader/ResourceLoader.cpp --- WebKit-r41128/WebCore/loader/ResourceLoader.cpp 2009-01-21 00:14:18.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/ResourceLoader.cpp 2009-03-26 02:47:17.000000000 -0400 @@ -29,10 +29,12 @@ #include "config.h" #include "ResourceLoader.h" +#include "CString.h" #include "DocumentLoader.h" #include "Frame.h" #include "FrameLoader.h" +#include "FrameLoaderClient.h" #include "Page.h" #include "ProgressTracker.h" #include "ResourceHandle.h" @@ -171,7 +173,7 @@ m_resourceData = SharedBuffer::create(data, length); return; } - + if (ResourceHandle::supportsBufferedData()) { // Buffer data only if the connection has handed us the data because is has stopped buffering it. if (m_resourceData) @@ -387,6 +389,7 @@ return; } #endif + willSendRequest(request, redirectResponse); } diff -Naur WebKit-r41128/WebCore/loader/SubresourceLoader.cpp WebKit-r41137-nx/WebCore/loader/SubresourceLoader.cpp --- WebKit-r41128/WebCore/loader/SubresourceLoader.cpp 2009-01-21 00:14:18.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/SubresourceLoader.cpp 2009-03-30 19:36:13.000000000 -0400 @@ -32,6 +32,7 @@ #include "DocumentLoader.h" #include "Frame.h" #include "FrameLoader.h" +#include "FrameLoaderClient.h" #include "ResourceHandle.h" #include "SubresourceLoaderClient.h" #include diff -Naur WebKit-r41128/WebCore/loader/TextDocument.cpp WebKit-r41137-nx/WebCore/loader/TextDocument.cpp --- WebKit-r41128/WebCore/loader/TextDocument.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/loader/TextDocument.cpp 2009-03-24 16:50:41.000000000 -0400 @@ -43,7 +43,7 @@ TextTokenizer(Document*); TextTokenizer(HTMLViewSourceDocument*); - virtual bool write(const SegmentedString&, bool appendData); + virtual void write(const SegmentedString&, bool appendData); virtual void finish(); virtual bool isWaitingForScripts() const; @@ -93,7 +93,7 @@ m_dest = m_buffer; } -bool TextTokenizer::write(const SegmentedString& s, bool) +void TextTokenizer::write(const SegmentedString& s, bool) { ExceptionCode ec; @@ -142,7 +142,7 @@ String string = String(m_buffer, m_dest - m_buffer); if (inViewSourceMode()) { static_cast(m_doc)->addViewSourceText(string); - return false; + return; } unsigned charsLeft = string.length(); @@ -151,8 +151,6 @@ RefPtr text = Text::createWithLengthLimit(m_doc, string, charsLeft); m_preElement->appendChild(text, ec); } - - return false; } void TextTokenizer::finish() diff -Naur WebKit-r41128/WebCore/page/Location.cpp WebKit-r41137-nx/WebCore/page/Location.cpp --- WebKit-r41128/WebCore/page/Location.cpp 2009-01-21 00:14:18.000000000 -0500 +++ WebKit-r41137-nx/WebCore/page/Location.cpp 2009-03-24 16:51:42.000000000 -0400 @@ -111,7 +111,8 @@ if (!m_frame) return String(); - return url().query(); + const KURL& url = this->url(); + return url.query().isEmpty() ? "" : "?" + url.query(); } String Location::hash() const @@ -120,7 +121,7 @@ return String(); const KURL& url = this->url(); - return url.ref().isNull() ? "" : "#" + url.ref(); + return url.ref().isEmpty() ? "" : "#" + url.ref(); } String Location::toString() const diff -Naur WebKit-r41128/WebCore/page/Settings.cpp WebKit-r41137-nx/WebCore/page/Settings.cpp --- WebKit-r41128/WebCore/page/Settings.cpp 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/page/Settings.cpp 2009-04-20 17:58:37.604134120 -0400 @@ -244,6 +244,11 @@ setNeedsReapplyStylesInAllFrames(m_page); } +void Settings::setUserAgent(const String& userAgent) +{ + m_userAgent = userAgent; +} + void Settings::setShouldPrintBackgrounds(bool shouldPrintBackgrounds) { m_shouldPrintBackgrounds = shouldPrintBackgrounds; diff -Naur WebKit-r41128/WebCore/page/Settings.h WebKit-r41137-nx/WebCore/page/Settings.h --- WebKit-r41128/WebCore/page/Settings.h 2009-02-20 22:38:14.000000000 -0500 +++ WebKit-r41137-nx/WebCore/page/Settings.h 2009-04-20 17:58:37.628133680 -0400 @@ -116,6 +116,9 @@ void setUserStyleSheetLocation(const KURL&); const KURL& userStyleSheetLocation() const { return m_userStyleSheetLocation; } + void setUserAgent(const String&); + const String& userAgent() const { return m_userAgent; } + void setShouldPrintBackgrounds(bool); bool shouldPrintBackgrounds() const { return m_shouldPrintBackgrounds; } @@ -212,6 +215,7 @@ String m_ftpDirectoryTemplatePath; String m_localStorageDatabasePath; KURL m_userStyleSheetLocation; + String m_userAgent; AtomicString m_standardFontFamily; AtomicString m_fixedFontFamily; AtomicString m_serifFontFamily; diff -Naur WebKit-r41128/WebCore/platform/ContextMenu.cpp WebKit-r41137-nx/WebCore/platform/ContextMenu.cpp --- WebKit-r41128/WebCore/platform/ContextMenu.cpp 2009-02-15 03:48:48.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/ContextMenu.cpp 2009-02-26 02:13:04.000000000 -0500 @@ -297,12 +297,12 @@ } appendItem(CopyItem); } else { -#if PLATFORM(GTK) +/*#if PLATFORM(GTK) appendItem(BackItem); appendItem(ForwardItem); appendItem(StopItem); appendItem(ReloadItem); -#else +#else*/ if (loader->canGoBackOrForward(-1)) appendItem(BackItem); @@ -315,7 +315,7 @@ appendItem(StopItem); else appendItem(ReloadItem); -#endif +/*#endif*/ if (frame->page() && frame != frame->page()->mainFrame()) appendItem(OpenFrameItem); @@ -586,7 +586,7 @@ case ContextMenuItemTagCheckSpellingWhileTyping: shouldCheck = frame->editor()->isContinuousSpellCheckingEnabled(); break; -#if PLATFORM(GTK) +/*#if PLATFORM(GTK) case ContextMenuItemTagGoBack: shouldEnable = frame->loader()->canGoBackOrForward(-1); break; @@ -602,13 +602,13 @@ case ContextMenuItemTagFontMenu: shouldEnable = frame->editor()->canEditRichly(); break; -#else +#else*/ case ContextMenuItemTagGoBack: case ContextMenuItemTagGoForward: case ContextMenuItemTagStop: case ContextMenuItemTagReload: case ContextMenuItemTagFontMenu: -#endif +/*#endif*/ case ContextMenuItemTagNoAction: case ContextMenuItemTagOpenLinkInNewWindow: case ContextMenuItemTagDownloadLinkToDisk: diff -Naur WebKit-r41128/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp WebKit-r41137-nx/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp --- WebKit-r41128/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp 2009-02-12 18:01:53.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp 2009-02-23 16:01:26.000000000 -0500 @@ -39,8 +39,6 @@ #include "FontDescription.h" #include "GlyphBuffer.h" #include -#include -#include #include namespace WebCore { diff -Naur WebKit-r41128/WebCore/platform/gtk/gtk2drawing.c WebKit-r41137-nx/WebCore/platform/gtk/gtk2drawing.c --- WebKit-r41128/WebCore/platform/gtk/gtk2drawing.c 2009-01-27 02:55:34.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/gtk/gtk2drawing.c 2009-02-23 16:01:26.000000000 -0500 @@ -1925,7 +1925,7 @@ /* this is for drawing a prelight box */ if (state_type == GTK_STATE_PRELIGHT || state_type == GTK_STATE_ACTIVE) { gtk_paint_flat_box(style, drawable, GTK_STATE_PRELIGHT, - GTK_SHADOW_ETCHED_OUT, cliprect, widget, + GTK_SHADOW_NONE, cliprect, widget, // ETCHED_OUT "checkbutton", rect->x, rect->y, rect->width, rect->height); } @@ -2803,7 +2803,7 @@ w = gRadiobuttonWidget; } - *left = *top = *right = *bottom = GTK_CONTAINER(w)->border_width; + *left = *top = *right = *bottom = 2; //GTK_CONTAINER(w)->border_width; // In Maemo better use smaller borders? if (!interior_focus) { *left += (focus_width + focus_pad); diff -Naur WebKit-r41128/WebCore/platform/gtk/RenderThemeGtk.cpp WebKit-r41137-nx/WebCore/platform/gtk/RenderThemeGtk.cpp --- WebKit-r41128/WebCore/platform/gtk/RenderThemeGtk.cpp 2009-01-25 22:06:55.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/gtk/RenderThemeGtk.cpp 2009-02-23 16:01:26.000000000 -0500 @@ -229,7 +229,7 @@ // Other ports hard-code this to 13, but GTK+ users tend to demand the native look. // It could be made a configuration option values other than 13 actually break site compatibility. - int length = indicator_size + indicator_spacing; + int length = indicator_size + indicator_spacing; // Check if this helps Maemo rendering if (style->width().isIntrinsicOrAuto()) style->setWidth(Length(length, Fixed)); diff -Naur WebKit-r41128/WebCore/platform/KURL.cpp WebKit-r41137-nx/WebCore/platform/KURL.cpp --- WebKit-r41128/WebCore/platform/KURL.cpp 2009-02-20 22:38:15.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/KURL.cpp 2009-03-24 16:51:42.000000000 -0400 @@ -38,6 +38,10 @@ #include #elif USE(QT4_UNICODE) #include +#elif USE(GLIB_UNICODE) +#include +#include +#include #endif #include @@ -639,7 +643,10 @@ String KURL::query() const { - return m_string.substring(m_pathEnd, m_queryEnd - m_pathEnd); + if (m_queryEnd == m_pathEnd) + return String(); + + return m_string.substring(m_pathEnd + 1, m_queryEnd - (m_pathEnd + 1)); } String KURL::path() const @@ -823,7 +830,11 @@ } append(result, path()); - append(result, query()); + + if (m_pathEnd != m_queryEnd) { + result.append('?'); + append(result, query()); + } if (m_fragmentEnd != m_queryEnd) { result.append('#'); @@ -1384,6 +1395,19 @@ #elif USE(QT4_UNICODE) QByteArray result = QUrl::toAce(String(str, strLen)); buffer.append(result.constData(), result.length()); +#elif USE(GLIB_UNICODE) + // first translate to ucs4, libidn is expecting code points + GOwnPtr ucs4Hostname; + GOwnPtr ucs4Err; + ucs4Hostname.set(g_utf16_to_ucs4(str, strLen, 0, 0, &ucs4Err.outPtr())); + if(ucs4Err) + return; + char* encodedHostname = 0; + int err; + err = idna_to_ascii_4z(ucs4Hostname.get(), &encodedHostname, IDNA_ALLOW_UNASSIGNED); + if(err == IDNA_SUCCESS) + buffer.append(encodedHostname, strlen(encodedHostname)); + free(encodedHostname); #endif } diff -Naur WebKit-r41128/WebCore/platform/MIMETypeRegistry.cpp WebKit-r41137-nx/WebCore/platform/MIMETypeRegistry.cpp --- WebKit-r41128/WebCore/platform/MIMETypeRegistry.cpp 2009-02-20 22:38:15.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/MIMETypeRegistry.cpp 2009-02-23 16:01:26.000000000 -0500 @@ -186,6 +186,7 @@ "text/html", "text/xml", "text/xsl", +/* Mozilla asks before opening text/plain */ "text/plain", "text/", "application/xml", diff -Naur WebKit-r41128/WebCore/platform/network/curl/ResourceHandleCurl.cpp WebKit-r41137-nx/WebCore/platform/network/curl/ResourceHandleCurl.cpp --- WebKit-r41128/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2009-01-21 00:14:21.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2009-05-03 19:23:13.037127973 -0400 @@ -103,7 +103,10 @@ bool ResourceHandle::start(Frame* frame) { - ASSERT(frame); + /* + * The frame could be null is the ResourceHandle is not associated + * to any Frame, i.e. if we are downloading a file. + */ ResourceHandleManager::sharedInstance()->add(this); return true; } diff -Naur WebKit-r41128/WebCore/platform/network/curl/ResourceHandleManager.cpp WebKit-r41137-nx/WebCore/platform/network/curl/ResourceHandleManager.cpp --- WebKit-r41128/WebCore/platform/network/curl/ResourceHandleManager.cpp 2009-01-21 00:14:21.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/network/curl/ResourceHandleManager.cpp 2009-05-04 19:16:02.954614933 -0400 @@ -45,6 +45,9 @@ #include #include #include +#ifdef MAEMO_CHANGES +#include +#endif #if PLATFORM(GTK) #if GLIB_CHECK_VERSION(2,12,0) @@ -55,14 +58,17 @@ namespace WebCore { const int selectTimeoutMS = 5; -const double pollTimeSeconds = 0.05; +const double pollTimeSeconds = 0.0; //5; const int maxRunningJobs = 5; +#if MAEMO_CHANGES +bool cookies_loaded; +#endif static const bool ignoreSSLErrors = getenv("WEBKIT_IGNORE_SSL_ERRORS"); ResourceHandleManager::ResourceHandleManager() : m_downloadTimer(this, &ResourceHandleManager::downloadTimerCallback) - , m_cookieJarFileName(0) + , m_cookieJarFileName("/home/user/.webkitcookies") , m_runningJobs(0) { curl_global_init(CURL_GLOBAL_ALL); @@ -70,6 +76,9 @@ m_curlShareHandle = curl_share_init(); curl_share_setopt(m_curlShareHandle, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); curl_share_setopt(m_curlShareHandle, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); +#if MAEMO_CHANGES + cookies_loaded = false; +#endif } ResourceHandleManager::~ResourceHandleManager() @@ -175,9 +184,21 @@ CURLcode err; double contentLength = 0; - err = curl_easy_getinfo(h, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &contentLength); + String cLength = d->m_response.httpHeaderField("Content-Length"); + + int index = cLength.find(':'); + if (index == -1) { + index = 0; + } + + contentLength = cLength.substring(0, index-1).toDouble(); d->m_response.setExpectedContentLength(static_cast(contentLength)); +// CURL doesn't seem to get Content-Length properly .stripWhiteSpace() +// err = curl_easy_getinfo(h, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &contentLength); +// if (CURLE_OK == err) +// d->m_response.setExpectedContentLength(static_cast(contentLength)); + const char* hdr; err = curl_easy_getinfo(h, CURLINFO_EFFECTIVE_URL, &hdr); d->m_response.setUrl(KURL(hdr)); @@ -186,9 +207,23 @@ err = curl_easy_getinfo(h, CURLINFO_RESPONSE_CODE, &httpCode); d->m_response.setHTTPStatusCode(httpCode); - d->m_response.setMimeType(extractMIMETypeFromMediaType(d->m_response.httpHeaderField("Content-Type"))); - d->m_response.setTextEncodingName(extractCharsetFromMediaType(d->m_response.httpHeaderField("Content-Type"))); - d->m_response.setSuggestedFilename(filenameFromHTTPContentDisposition(d->m_response.httpHeaderField("Content-Disposition"))); + + if (d->m_response.httpHeaderField("Content-Type").isEmpty()) { + d->m_response.setMimeType("text/html"); + d->m_response.setTextEncodingName("UTF-8"); + } else { + d->m_response.setMimeType(extractMIMETypeFromMediaType(d->m_response.httpHeaderField("Content-Type"))); + d->m_response.setTextEncodingName(extractCharsetFromMediaType(d->m_response.httpHeaderField("Content-Type"))); + d->m_response.setSuggestedFilename(filenameFromHTTPContentDisposition(d->m_response.httpHeaderField("Content-Disposition"))); + } + +/* HTTPHeaderMap customHeaders = d->m_response.httpHeaderFields(); + printf( "-------------------\n" ); + if (!customHeaders.isEmpty()) { + HTTPHeaderMap::const_iterator end = customHeaders.end(); + for (HTTPHeaderMap::const_iterator it = customHeaders.begin(); it != end; ++it) + printf( "Key: %s, data: %s\n", it->first.string().utf8().data(), it->second.utf8().data()); + }*/ // HTTP redirection if (httpCode >= 300 && httpCode < 400) { @@ -368,6 +403,20 @@ if (!job->request().httpBody()) return; +/* struct curl_slist *heads = *headers; + printf( "POST, headers: \n" ); + for(;heads;heads = heads->next){ + char *line = strdup(heads->data); + char *word; + char *brk2; + word = strtok_r(line,": ",&brk2); + if(word){ + printf( "%s: %s\n", line, brk2 ); + } + free(line); + } + free(heads); +*/ Vector elements = job->request().httpBody()->elements(); size_t numElements = elements.size(); if (!numElements) @@ -411,6 +460,7 @@ if (getFileSize(element.m_filename, fileSizeResult)) { if (fileSizeResult > maxCurlOffT) { // File size is too big for specifying it to cURL + printf( "Too big POST transfer, not specifying file size. %d", fileSizeResult ); chunkedTransfer = true; break; } @@ -424,15 +474,23 @@ } // cURL guesses that we want chunked encoding as long as we specify the header - if (chunkedTransfer) + if (chunkedTransfer) { *headers = curl_slist_append(*headers, "Transfer-Encoding: chunked"); - else { + } else { if (sizeof(long long) == expectedSizeOfCurlOffT) curl_easy_setopt(d->m_handle, CURLOPT_POSTFIELDSIZE_LARGE, (long long)size); else curl_easy_setopt(d->m_handle, CURLOPT_POSTFIELDSIZE_LARGE, (int)size); } +/* HTTPHeaderMap customHeaders = job->request().httpHeaderFields(); + printf( "-------------------\n" ); + if (!customHeaders.isEmpty()) { + HTTPHeaderMap::const_iterator end = customHeaders.end(); + for (HTTPHeaderMap::const_iterator it = customHeaders.begin(); it != end; ++it) + printf( "Key: %s, data: %s\n", it->first.string().utf8().data(), it->second.utf8().data()); + }*/ + curl_easy_setopt(d->m_handle, CURLOPT_READFUNCTION, readCallback); curl_easy_setopt(d->m_handle, CURLOPT_READDATA, job); } @@ -504,6 +562,9 @@ String mimeType = extractMIMETypeFromMediaType(mediaType); String charset = extractCharsetFromMediaType(mediaType); + if (mimeType.isEmpty()) + mimeType = "application/octet-stream"; + ResourceResponse response; response.setMimeType(mimeType); @@ -633,14 +694,16 @@ curl_easy_setopt(d->m_handle, CURLOPT_HEADERFUNCTION, headerCallback); curl_easy_setopt(d->m_handle, CURLOPT_WRITEHEADER, job); curl_easy_setopt(d->m_handle, CURLOPT_AUTOREFERER, 1); + curl_easy_setopt(d->m_handle, CURLOPT_NOPROGRESS, 1); curl_easy_setopt(d->m_handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(d->m_handle, CURLOPT_MAXREDIRS, 10); curl_easy_setopt(d->m_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_easy_setopt(d->m_handle, CURLOPT_SHARE, m_curlShareHandle); + curl_easy_setopt(d->m_handle, CURLOPT_CAPATH, "/etc/ssl/certs"); curl_easy_setopt(d->m_handle, CURLOPT_DNS_CACHE_TIMEOUT, 60 * 5); // 5 minutes // FIXME: Enable SSL verification when we have a way of shipping certs // and/or reporting SSL errors to the user. - if (ignoreSSLErrors) +// if (ignoreSSLErrors) curl_easy_setopt(d->m_handle, CURLOPT_SSL_VERIFYPEER, false); // enable gzip and deflate through Accept-Encoding: curl_easy_setopt(d->m_handle, CURLOPT_ENCODING, ""); @@ -653,8 +716,14 @@ curl_easy_setopt(d->m_handle, CURLOPT_URL, d->m_url); if (m_cookieJarFileName) { +#ifdef MAEMO_CHANGES + if (!cookies_loaded) { + curl_easy_setopt(d->m_handle, CURLOPT_COOKIEFILE, m_cookieJarFileName); + cookies_loaded = true; + } +#else curl_easy_setopt(d->m_handle, CURLOPT_COOKIEFILE, m_cookieJarFileName); - curl_easy_setopt(d->m_handle, CURLOPT_COOKIEJAR, m_cookieJarFileName); +#endif } struct curl_slist* headers = 0; diff -Naur WebKit-r41128/WebCore/platform/network/HTTPParsers.cpp WebKit-r41137-nx/WebCore/platform/network/HTTPParsers.cpp --- WebKit-r41128/WebCore/platform/network/HTTPParsers.cpp 2009-01-21 00:14:21.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/network/HTTPParsers.cpp 2009-04-25 16:58:41.354731680 -0400 @@ -131,18 +131,18 @@ String extractMIMETypeFromMediaType(const String& mediaType) { - String mimeType; + Vector mimeType; unsigned length = mediaType.length(); + mimeType.reserveCapacity(length); for (unsigned offset = 0; offset < length; offset++) { UChar c = mediaType[offset]; if (c == ';') break; else if (isSpaceOrNewline(c)) // FIXME: This seems wrong, " " is an invalid MIME type character according to RFC 2045. bug 8644 continue; - // FIXME: This is a very slow way to build a string, given WebCore::String's implementation. - mimeType += String(&c, 1); + mimeType.append(c); } - return mimeType; + return String(mimeType.data(), mimeType.size()); } String extractCharsetFromMediaType(const String& mediaType) diff -Naur WebKit-r41128/WebCore/platform/network/soup/ResourceHandleSoup.cpp WebKit-r41137-nx/WebCore/platform/network/soup/ResourceHandleSoup.cpp --- WebKit-r41128/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2009-02-20 22:38:15.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -475,9 +475,12 @@ { ASSERT(!d->m_msg); - // If we are no longer attached to a Page, this must be an attempted load from an - // onUnload handler, so let's just block it. - if (!frame->page()) + + /* The frame could be null is the ResourceHandle is not associated to any + * Frame, i.e. if we are downloading a file. + * If the frame is not null but the page is null this must be an attempted + * load from an onUnload handler, so let's just block it. */ + if (frame && !frame->page()) return false; KURL url = request().url(); diff -Naur WebKit-r41128/WebCore/platform/ScrollView.cpp WebKit-r41137-nx/WebCore/platform/ScrollView.cpp --- WebKit-r41128/WebCore/platform/ScrollView.cpp 2009-02-13 00:50:35.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/ScrollView.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -281,6 +281,7 @@ void ScrollView::setScrollPosition(const IntPoint& scrollPoint) { +#if 0 if (prohibitsScrolling()) return; @@ -288,12 +289,13 @@ platformSetScrollPosition(scrollPoint); return; } +#endif IntPoint newScrollPosition = scrollPoint.shrunkTo(maximumScrollPosition()); newScrollPosition.clampNegativeToZero(); - if (newScrollPosition == scrollPosition()) - return; + //if (newScrollPosition == scrollPosition()) + // return; updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y())); } @@ -316,7 +318,8 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset) { // Don't allow re-entrancy into this function. - if (m_inUpdateScrollbars || prohibitsScrolling() || platformWidget()) + //if (m_inUpdateScrollbars || prohibitsScrolling() || platformWidget()) + if (m_inUpdateScrollbars || platformWidget()) return; m_inUpdateScrollbars = true; diff -Naur WebKit-r41128/WebCore/platform/text/gtk/TextBoundariesGtk.cpp WebKit-r41137-nx/WebCore/platform/text/gtk/TextBoundariesGtk.cpp --- WebKit-r41128/WebCore/platform/text/gtk/TextBoundariesGtk.cpp 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/gtk/TextBoundariesGtk.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2008 Jürg Billeter + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "TextBoundaries.h" + +#include + +#include "StringImpl.h" +#include "TextBreakIterator.h" + +namespace WebCore { + +int findNextWordFromIndex(const UChar* chars, int len, int position, bool forward) +{ + TextBreakIterator* it = wordBreakIterator(chars, len); + + if (forward) { + position = textBreakFollowing(it, position); + while (position != TextBreakDone) { + // We stop searching when the character preceeding the break + // is alphanumeric. + if (position < len && g_unichar_isalnum(chars[position - 1])) + return position; + + position = textBreakFollowing(it, position); + } + + return len; + } else { + position = textBreakPreceding(it, position); + while (position != TextBreakDone) { + // We stop searching when the character following the break + // is alphanumeric. + if (position > 0 && g_unichar_isalnum(chars[position])) + return position; + + position = textBreakPreceding(it, position); + } + + return 0; + } +} + +void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end) +{ + TextBreakIterator* it = wordBreakIterator(chars, len); + *end = textBreakFollowing(it, position); + if (*end < 0) + *end = textBreakLast(it); + *start = textBreakPrevious(it); +} + +} // namespace WebCore diff -Naur WebKit-r41128/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp WebKit-r41137-nx/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp --- WebKit-r41128/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -0,0 +1,241 @@ +/* + * Copyright (C) 2006 Lars Knoll + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2008 Dominik Röttsches + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "config.h" +#include "TextBreakIterator.h" + +#include + +#include + +namespace WebCore { + +enum UBreakIteratorType { + UBRK_CHARACTER, + UBRK_WORD, + UBRK_LINE, + UBRK_SENTENCE +}; + +class TextBreakIterator { +public: + UBreakIteratorType m_type; + int m_length; + PangoLogAttr* m_log_attrs; + + int m_index; +}; + +static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator*& iterator, + UBreakIteratorType type, const UChar* string, int length) +{ + if (!string) + return 0; + + if (!createdIterator) { + iterator = new TextBreakIterator(); + createdIterator = true; + } + if (!iterator) + return 0; + + long utf8len; + GOwnPtr utf8; + utf8.set(g_utf16_to_utf8(string, length, 0, &utf8len, 0)); + + // FIXME: assumes no surrogate pairs + + iterator->m_type = type; + iterator->m_length = length; + if(createdIterator) + g_free(iterator->m_log_attrs); + iterator->m_log_attrs = g_new0(PangoLogAttr, length + 1); + iterator->m_index = -1; + pango_get_log_attrs(utf8.get(), utf8len, -1, 0, iterator->m_log_attrs, length + 1); + + return iterator; +} + +TextBreakIterator* characterBreakIterator(const UChar* string, int length) +{ + static bool createdCharacterBreakIterator = false; + static TextBreakIterator* staticCharacterBreakIterator; + return setUpIterator(createdCharacterBreakIterator, + staticCharacterBreakIterator, UBRK_CHARACTER, string, length); +} + +TextBreakIterator* wordBreakIterator(const UChar* string, int length) +{ + static bool createdWordBreakIterator = false; + static TextBreakIterator* staticWordBreakIterator; + return setUpIterator(createdWordBreakIterator, + staticWordBreakIterator, UBRK_WORD, string, length); +} + +TextBreakIterator* lineBreakIterator(const UChar* string, int length) +{ + static bool createdLineBreakIterator = false; + static TextBreakIterator* staticLineBreakIterator; + return setUpIterator(createdLineBreakIterator, + staticLineBreakIterator, UBRK_LINE, string, length); +} + +TextBreakIterator* sentenceBreakIterator(const UChar* string, int length) +{ + static bool createdSentenceBreakIterator = false; + static TextBreakIterator* staticSentenceBreakIterator; + return setUpIterator(createdSentenceBreakIterator, + staticSentenceBreakIterator, UBRK_SENTENCE, string, length); +} + +int textBreakFirst(TextBreakIterator* bi) +{ + // see textBreakLast + + int firstCursorPosition = -1; + int pos = 0; + while(pos <= bi->m_length && (firstCursorPosition < 0)) { + if (bi->m_log_attrs[pos].is_cursor_position) + firstCursorPosition = pos; + } + bi->m_index = firstCursorPosition; + return firstCursorPosition; +} + +int textBreakLast(TextBreakIterator* bi) +{ + // textBreakLast is not meant to find breaks according to bi->m_type but really last character + // (cmp ICU documentation for ubrk_first and ubrk_last) + // so we should advance or traverse back based on bi->m_log_attrs cursor positions + + // from ICU docs for ubrk_last: + // "Determine the index immediately beyond the last character in the text being scanned." + + // If last character position in the original string is a whitespace, + // traverse to the left until the first non-white character position is found + // and return the position of the first white-space char after this one. + // otherwise return m_length, as "the first character beyond the last" is outside our string. + + bool whiteSpaceAtTheEnd = true; + int nextWhiteSpacePos = bi->m_length; + + int pos = bi->m_length; + while (pos >= 0 && whiteSpaceAtTheEnd) { + if (bi->m_log_attrs[pos].is_cursor_position) { + if (whiteSpaceAtTheEnd = bi->m_log_attrs[pos].is_white) + nextWhiteSpacePos = pos; + } + pos--; + } + bi->m_index = nextWhiteSpacePos; + return nextWhiteSpacePos; +} + +int textBreakNext(TextBreakIterator* bi) +{ + for (int i = bi->m_index + 1; i <= bi->m_length; i++) { + if (bi->m_type == UBRK_LINE && bi->m_log_attrs[i].is_line_break) { + bi->m_index = i; + return i; + } + if (bi->m_type == UBRK_WORD && (bi->m_log_attrs[i].is_word_start || bi->m_log_attrs[i].is_word_end)) { + // FIXME: Single multibyte characters (i.e. white space around them), such as the euro symbol €, + // are not marked as word_start & word_end as opposed to the way ICU does it + // This leads - for example - to different word selection behaviour when right clicking. + bi->m_index = i; + return i; + } + if (bi->m_type == UBRK_CHARACTER && bi->m_log_attrs[i].is_cursor_position) { + bi->m_index = i; + return i; + } + if (bi->m_type == UBRK_SENTENCE && (bi->m_log_attrs[i].is_sentence_start || bi->m_log_attrs[i].is_sentence_end)) { + bi->m_index = i; + return i; + } + } + return TextBreakDone; +} + +int textBreakPrevious(TextBreakIterator* bi) +{ + for (int i = bi->m_index - 1; i >= 0; i--) { + if (bi->m_type == UBRK_LINE && bi->m_log_attrs[i].is_line_break) { + bi->m_index = i; + return i; + } + if (bi->m_type == UBRK_WORD && (bi->m_log_attrs[i].is_word_start || bi->m_log_attrs[i].is_word_end)) { + bi->m_index = i; + return i; + } + if (bi->m_type == UBRK_CHARACTER && bi->m_log_attrs[i].is_cursor_position) { + bi->m_index = i; + return i; + } + if (bi->m_type == UBRK_SENTENCE && (bi->m_log_attrs[i].is_sentence_start || bi->m_log_attrs[i].is_sentence_end)) { + bi->m_index = i; + return i; + } + } + return textBreakFirst(bi); +} + +int textBreakPreceding(TextBreakIterator* bi, int pos) +{ + bi->m_index = pos; + return textBreakPrevious(bi); +} + +int textBreakFollowing(TextBreakIterator* bi, int pos) +{ + if (pos < 0) + pos = -1; + bi->m_index = pos; + return textBreakNext(bi); +} + +int textBreakCurrent(TextBreakIterator* bi) +{ + return bi->m_index; +} + +bool isTextBreak(TextBreakIterator* bi, int pos) +{ + if (bi->m_index >= 0) { + if (bi->m_type == UBRK_LINE && bi->m_log_attrs[bi->m_index].is_line_break) { + return true; + } + if (bi->m_type == UBRK_WORD && bi->m_log_attrs[bi->m_index].is_word_end) { + return true; + } + if (bi->m_type == UBRK_CHARACTER && bi->m_log_attrs[bi->m_index].is_char_break) { + return true; + } + if (bi->m_type == UBRK_SENTENCE && bi->m_log_attrs[bi->m_index].is_sentence_end) { + return true; + } + } + return FALSE; +} + +} diff -Naur WebKit-r41128/WebCore/platform/text/gtk/TextCodecGtk.cpp WebKit-r41137-nx/WebCore/platform/text/gtk/TextCodecGtk.cpp --- WebKit-r41128/WebCore/platform/text/gtk/TextCodecGtk.cpp 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/gtk/TextCodecGtk.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -0,0 +1,471 @@ +/* + * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2006 Alexey Proskuryakov + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2008 Dominik Röttsches + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "TextCodecGtk.h" + +#include "CString.h" +#include "PlatformString.h" +#include +#include +#include +#include "Logging.h" + +using std::auto_ptr; +using std::min; + +namespace WebCore { + + + +// appendOmittingBOM is gone (http://trac.webkit.org/changeset/33380), so we need to avoid generating extra BOM's +// here. This can be achieved by specifying the UTF-16 codecs' endianness explicitly when initializing iconv + +#if (G_BYTE_ORDER == G_BIG_ENDIAN) + const gchar* WebCore::TextCodecGtk::m_internalEncodingName = "UTF-16BE"; +#else + const gchar* WebCore::TextCodecGtk::m_internalEncodingName = "UTF-16LE"; +#endif + + +// list of text encodings and their aliases +// the first entry/"alias" is the canonical name, each alias list must be terminated by a 0 + +// Unicode +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_UTF_8 = { "UTF-8", 0}; + +// Western +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_1 = { "ISO-8859-1", "CP819", "IBM819", "ISO-IR-100", "ISO8859-1", "ISO_8859-1", "ISO_8859-1:1987", "L1", "LATIN1", "CSISOLATIN1", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACROMAN = { "MACROMAN", "MAC", "MACINTOSH", "CSMACINTOSH", 0}; + +// Japanese +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_SHIFT_JIS = { "Shift_JIS", "MS_KANJI", "SHIFT-JIS", "SJIS", "CSSHIFTJIS", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_JP = { "EUC_JP", "EUC-JP", "EUCJP", "EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", "CSEUCPKDFMTJAPANESE", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_2022_JP = { "ISO-2022-JP", 0}; + +// Traditional Chinese +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_BIG5 = { "BIG5", "BIG-5", "BIG-FIVE", "BIG5", "BIGFIVE", "CN-BIG5", "CSBIG5", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_BIG5_HKSCS = { "BIG5-HKSCS", "BIG5-HKSCS:2004", "BIG5HKSCS", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP950 = { "CP950", 0}; + +// Korean +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_2022_KR = { "ISO-2022-KR", "CSISO2022KR", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP949 = { "CP949", "UHC", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_KR = { "EUC-KR", "CSEUCKR", 0 }; + +// Arabic +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_6 = { "ISO-8859-6", "ARABIC", "ASMO-708", "ECMA-114", "ISO-IR-127", "ISO8859-6", "ISO_8859-6", "ISO_8859-6:1987", "CSISOLATINARABIC", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1256 = { "windows-1256", "CP1256", "MS-ARAB", 0}; // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case + +// Hebrew +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_8 = { "ISO-8859-8", "HEBREW", "ISO-8859-8", "ISO-IR-138", "ISO8859-8", "ISO_8859-8", "ISO_8859-8:1988", "CSISOLATINHEBREW", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1255 = { "windows-1255", "CP1255", "MS-HEBR", 0}; // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html + +// Greek +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_7 = { "ISO-8859-7", "ECMA-118", "ELOT_928", "GREEK", "GREEK8", "ISO-IR-126", "ISO8859-7", "ISO_8859-7", "ISO_8859-7:1987", "ISO_8859-7:2003", "CSI", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP869 = { "CP869", "869", "CP-GR", "IBM869", "CSIBM869", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_WINDOWS_1253 = { "WINDOWS-1253", 0 }; + +// Cyrillic +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_5 = { "ISO-8859-5", "CYRILLIC", "ISO-IR-144", "ISO8859-5", "ISO_8859-5", "ISO_8859-5:1988", "CSISOLATINCYRILLIC", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_KOI8_R = { "KOI8-R", "CSKOI8R", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP866 = { "CP866", "866", "IBM866", "CSIBM866", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_KOI8_U = { "KOI8-U", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_WINDOWS_1251 = { "windows-1251", "CP1251", 0}; // CP1251 added to pass /fast/encoding/charset-cp1251.html +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACCYRILLIC = { "mac-cyrillic", "MACCYRILLIC", "x-mac-cyrillic", 0}; + +// Thai +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP874 = { "CP874", "WINDOWS-874", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_TIS_620 = { "TIS-620", 0}; + +// Simplified Chinese +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_GBK = { "GBK", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_HZ = { "HZ", "HZ-GB-2312", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_GB18030 = { "GB18030", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_CN = { "EUC_CN", "EUCCN", "GB2312", "CN-GB", "CSGB2312", "EUC_CN", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_2312_80 = { "GB_2312-80", "CHINESE", "csISO58GB231280", "GB2312.1980-0", "ISO-IR-58" }; + +// Central European +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_2 = { "ISO-8859-2", "ISO-IR-101", "ISO8859-2", "ISO_8859-2", "ISO_8859-2:1987", "L2", "LATIN2", "CSISOLATIN2", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1250 = { "CP1250", "MS-EE", "WINDOWS-1250", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACCENTRALEUROPE = { "MACCENTRALEUROPE", 0}; + +// Vietnamese +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1258 = { "CP1258", "WINDOWS-1258", 0}; + +// Turkish +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1254 = { "CP1254", "MS-TURK", "WINDOWS-1254", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_9 = { "ISO-8859-9", "ISO-IR-148", "ISO8859-9", "ISO_8859-9", "ISO_8859-9:1989", "L5", "LATIN5", "CSISOLATIN5", 0}; + +// Baltic +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1257 = { "CP1257", "WINBALTRIM", "WINDOWS-1257", 0}; +TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_4 = { "ISO-8859-4", "ISO-IR-110", "ISO8859-4", "ISO_8859-4", "ISO_8859-4:1988", "L4", "LATIN4", "CSISOLATIN4", 0}; + +gconstpointer const TextCodecGtk::m_iconvBaseCodecList[] = { + // Unicode + &m_codecAliases_UTF_8, + + // Western + &m_codecAliases_ISO_8859_1 +}; + +gconstpointer const TextCodecGtk::m_iconvExtendedCodecList[] = +{ + // Western + &m_codecAliases_MACROMAN, + + // Japanese + &m_codecAliases_SHIFT_JIS, + &m_codecAliases_EUC_JP, + &m_codecAliases_ISO_2022_JP, + + // Simplified Chinese + &m_codecAliases_BIG5, + &m_codecAliases_BIG5_HKSCS, + &m_codecAliases_CP950, + + // Korean + &m_codecAliases_ISO_2022_KR, + &m_codecAliases_CP949, + &m_codecAliases_EUC_KR, + + // Arabic + &m_codecAliases_ISO_8859_6, + &m_codecAliases_CP1256, + + // Hebrew + &m_codecAliases_ISO_8859_8, + &m_codecAliases_CP1255, + + // Greek + &m_codecAliases_ISO_8859_7, + &m_codecAliases_CP869, + &m_codecAliases_WINDOWS_1253, + + // Cyrillic + &m_codecAliases_ISO_8859_5, + &m_codecAliases_KOI8_R, + &m_codecAliases_CP866, + &m_codecAliases_KOI8_U, + &m_codecAliases_WINDOWS_1251, + &m_codecAliases_MACCYRILLIC, + + // Thai + &m_codecAliases_CP874, + &m_codecAliases_TIS_620, + + // Traditional Chinese + &m_codecAliases_GBK, + &m_codecAliases_HZ, + &m_codecAliases_GB18030, + &m_codecAliases_EUC_CN, + &m_codecAliases_2312_80, + + // Central European + &m_codecAliases_ISO_8859_2, + &m_codecAliases_CP1250, + &m_codecAliases_MACCENTRALEUROPE, + + // Vietnamese + &m_codecAliases_CP1258, + + // Turkish + &m_codecAliases_CP1254, + &m_codecAliases_ISO_8859_9, + + // Baltic + &m_codecAliases_CP1257, + &m_codecAliases_ISO_8859_4 +}; + + +const size_t ConversionBufferSize = 16384; + + +static auto_ptr newTextCodecGtk(const TextEncoding& encoding, const void*) +{ +#ifndef NDEBUG + // too noisy if each UTF-8 codec creation is logged + // if (strcmp(encoding.name(), "UTF-8")) + // LOG(TextConversion, "creating new text codec for encoding name %s", encoding.name()); +#endif + + return auto_ptr(new TextCodecGtk(encoding)); +} + +gboolean TextCodecGtk::isEncodingAvailable(const gchar* encName) +{ + GIConv tester; + // test decoding + tester = g_iconv_open(m_internalEncodingName, encName); + if (tester == reinterpret_cast(-1)) { + LOG_ERROR("%s not decodable => not available!", encName); + return false; + } else { + g_iconv_close(tester); + // test encoding + tester = g_iconv_open(encName, m_internalEncodingName); + if (tester == reinterpret_cast(-1)) { + LOG_ERROR("%s not encodable => not available!", encName); + return false; + } else { + g_iconv_close(tester); + return true; + } + } +} + +void TextCodecGtk::registerEncodingNames(EncodingNameRegistrar registrar, bool extended) +{ + const void* const* encodingList; + unsigned int listLength = 0; + if (extended) { + encodingList = m_iconvExtendedCodecList; + listLength = sizeof(m_iconvExtendedCodecList)/sizeof(gpointer); + } else { + encodingList = m_iconvBaseCodecList; + listLength = sizeof(m_iconvBaseCodecList)/sizeof(gpointer); + } + + for (unsigned int i = 0; i < listLength; ++i) { + codecAliasList *codecAliases = static_cast(encodingList[i]); + int codecCount = -1; + const gchar *canonicalName, *currentAlias; + bool canonicalAvailable = true; + + // for each of the alias lists: + // bail out if canonical is not available, + // then continue testing each alias, + // if available, add it to the list, mapping it to its canonical name + + while ((currentAlias = (*codecAliases)[++codecCount]) && canonicalAvailable) { + bool currentAvailable = isEncodingAvailable(currentAlias); + + if (codecCount == 0 && currentAvailable) { + canonicalName = currentAlias; + canonicalAvailable = true; + LOG_VERBOSE(TextConversion, "registering encoding canonical %s", canonicalName); + registrar(canonicalName, canonicalName); + } else if (codecCount == 0 && !currentAvailable) + canonicalAvailable = false; + else if (codecCount > 0) { + if (isEncodingAvailable(currentAlias)) { + LOG_VERBOSE(TextConversion, "registering encoding name alias %s to canonical %s", currentAlias, canonicalName); + registrar(currentAlias, canonicalName); + } + } + } + + } +} + +void TextCodecGtk::registerCodecs(TextCodecRegistrar registrar, bool extended) +{ + const void* const* encodingList; + unsigned int listLength = 0; + if (extended) { + encodingList = m_iconvExtendedCodecList; + listLength = sizeof(m_iconvExtendedCodecList)/sizeof(gpointer); + } else { + encodingList = m_iconvBaseCodecList; + listLength = sizeof(m_iconvBaseCodecList)/sizeof(gpointer); + } + + for (unsigned int i = 0; i < listLength; ++i) { + codecAliasList *codecAliases = static_cast(encodingList[i]); + // by convention, the first "alias" should be the canonical name, see the definition of the alias lists + const gchar *codecName = (*codecAliases)[0]; + if (isEncodingAvailable(codecName)) + registrar(codecName, newTextCodecGtk, 0); + } +} + +void TextCodecGtk::registerBaseEncodingNames(EncodingNameRegistrar registrar) +{ + registerEncodingNames(registrar, false); +} + +void TextCodecGtk::registerBaseCodecs(TextCodecRegistrar registrar) +{ + registerCodecs(registrar, false); +} + +void TextCodecGtk::registerExtendedEncodingNames(EncodingNameRegistrar registrar) +{ + registerEncodingNames(registrar, true); +} + +void TextCodecGtk::registerExtendedCodecs(TextCodecRegistrar registrar) +{ + registerCodecs(registrar, true); +} + +TextCodecGtk::TextCodecGtk(const TextEncoding& encoding) + : m_encoding(encoding) + , m_numBufferedBytes(0) + , m_iconvDecoder(reinterpret_cast(-1)) + , m_iconvEncoder(reinterpret_cast(-1)) +{ +} + +TextCodecGtk::~TextCodecGtk() +{ + releaseIConv(); +} + +void TextCodecGtk::releaseIConv() const +{ + if (m_iconvDecoder != reinterpret_cast(-1)) { + g_iconv_close(m_iconvDecoder); + m_iconvDecoder = reinterpret_cast(-1); + } + if (m_iconvEncoder != reinterpret_cast(-1)) { + g_iconv_close(m_iconvEncoder); + m_iconvEncoder = reinterpret_cast(-1); + } +} + +void TextCodecGtk::createIConvDecoder() const +{ + ASSERT(m_iconvDecoder == reinterpret_cast(-1)); + + m_iconvDecoder = g_iconv_open(m_internalEncodingName, m_encoding.name()); +} + +void TextCodecGtk::createIConvEncoder() const +{ + ASSERT(m_iconvDecoder == reinterpret_cast(-1)); + + m_iconvEncoder = g_iconv_open(m_encoding.name(), m_internalEncodingName); +} + +String TextCodecGtk::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError) +{ + // Get a converter for the passed-in encoding. + if (m_iconvDecoder == reinterpret_cast(-1)) { + createIConvDecoder(); + ASSERT(m_iconvDecoder != reinterpret_cast(-1)); + if (m_iconvDecoder == reinterpret_cast(-1)) { + LOG_ERROR("error creating IConv encoder even though encoding was in table"); + return String(); + } + } + + size_t countWritten, countRead, conversionLength; + const char* conversionBytes; + char* prefixedBytes = 0; + + if (m_numBufferedBytes) { + conversionLength = length + m_numBufferedBytes; + prefixedBytes = static_cast(fastMalloc(conversionLength)); + memcpy(prefixedBytes, m_bufferedBytes, m_numBufferedBytes); + memcpy(prefixedBytes + m_numBufferedBytes, bytes, length); + + conversionBytes = prefixedBytes; + + // all buffered bytes are consumed now + m_numBufferedBytes = 0; + } else { + // no previously buffered partial data, + // just convert the data that was passed in + conversionBytes = bytes; + conversionLength = length; + } + + GOwnPtr err; + GOwnPtr buffer; + + if (conversionLength == 0) return ""; + + buffer.outPtr() = reinterpret_cast(g_convert_with_iconv(conversionBytes, conversionLength, m_iconvDecoder, &countRead, &countWritten, &err.outPtr())); + + + if (err) { + LOG_ERROR("GIConv conversion error"); + m_numBufferedBytes = 0; // reset state for subsequent calls to decode + fastFree(prefixedBytes); + sawError = true; + return String(); + } + + // Partial input at the end of the string may not result in an error being raised. + // From the gnome library documentation on g_convert_with_iconv: + // "Even if the conversion was successful, this may be less than len if there were partial characters at the end of the input." + // That's why we need to compare conversionLength against countRead + + m_numBufferedBytes = conversionLength - countRead; + if (m_numBufferedBytes > 0) { + if (flush) { + LOG_ERROR("Partial bytes at end of input while flush requested."); + m_numBufferedBytes = 0; // reset state for subsequent calls to decode + fastFree(prefixedBytes); + sawError = true; + return String(); + } + memcpy(m_bufferedBytes, conversionBytes + countRead, m_numBufferedBytes); + } + + fastFree(prefixedBytes); + + Vector result; + + result.append(buffer.get(), countWritten / sizeof(UChar)); + + return String::adopt(result); +} + +CString TextCodecGtk::encode(const UChar* characters, size_t length, UnencodableHandling handling) +{ + if (!length) + return ""; + + if (m_iconvEncoder == reinterpret_cast(-1)) + createIConvEncoder(); + if (m_iconvEncoder == reinterpret_cast(-1)) + return CString(); + + size_t count; + + GOwnPtr err; + GOwnPtr buffer; + + if (length == 0) return ""; + + buffer.outPtr() = g_convert_with_iconv(reinterpret_cast(characters), length * sizeof(UChar), m_iconvEncoder, 0, &count, &err.outPtr()); + if (err) { + LOG_ERROR("GIConv conversion error"); + return CString(); + } + + CString result = CString(buffer.get(), count); + + return result; +} + + +} // namespace WebCore diff -Naur WebKit-r41128/WebCore/platform/text/gtk/TextCodecGtk.h WebKit-r41137-nx/WebCore/platform/text/gtk/TextCodecGtk.h --- WebKit-r41128/WebCore/platform/text/gtk/TextCodecGtk.h 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/gtk/TextCodecGtk.h 2009-02-23 16:01:27.000000000 -0500 @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2006 Alexey Proskuryakov + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2008 Dominik Röttsches + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TextCodecGTK_h +#define TextCodecGTK_h + +#include + +#include "TextCodec.h" +#include "TextEncoding.h" + +namespace WebCore { + + class TextCodecGtk : public TextCodec { + public: + static void registerBaseEncodingNames(EncodingNameRegistrar); + static void registerBaseCodecs(TextCodecRegistrar); + + static void registerExtendedEncodingNames(EncodingNameRegistrar); + static void registerExtendedCodecs(TextCodecRegistrar); + + TextCodecGtk(const TextEncoding&); + virtual ~TextCodecGtk(); + + virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError); + virtual CString encode(const UChar*, size_t length, UnencodableHandling); + + private: + void createIConvDecoder() const; + void createIConvEncoder() const; + void releaseIConv() const; + + static void registerEncodingNames(EncodingNameRegistrar registrar, bool extended); + static void registerCodecs(TextCodecRegistrar registrar, bool extended); + static gboolean isEncodingAvailable(const gchar*); + + TextEncoding m_encoding; + size_t m_numBufferedBytes; + unsigned char m_bufferedBytes[16]; // bigger than any single multi-byte character + mutable GIConv m_iconvDecoder; + mutable GIConv m_iconvEncoder; + + static const gchar* m_internalEncodingName; + + typedef const gchar* const codecAliasList[]; + + // Unicode + static codecAliasList m_codecAliases_UTF_8; + + // Western + static codecAliasList m_codecAliases_ISO_8859_1; + static codecAliasList m_codecAliases_MACROMAN; + + // Japanese + static codecAliasList m_codecAliases_SHIFT_JIS; + static codecAliasList m_codecAliases_EUC_JP; + static codecAliasList m_codecAliases_ISO_2022_JP; + + // Traditional Chinese + static codecAliasList m_codecAliases_BIG5; + static codecAliasList m_codecAliases_BIG5_HKSCS; + static codecAliasList m_codecAliases_CP950; + + // Korean + static codecAliasList m_codecAliases_ISO_2022_KR; + static codecAliasList m_codecAliases_CP949; + static codecAliasList m_codecAliases_EUC_KR; + + // Arabic + static codecAliasList m_codecAliases_ISO_8859_6; + static codecAliasList m_codecAliases_CP1256; + + // Hebrew + static codecAliasList m_codecAliases_ISO_8859_8; + static codecAliasList m_codecAliases_CP1255; + + // Greek + static codecAliasList m_codecAliases_ISO_8859_7; + static codecAliasList m_codecAliases_CP869; + static codecAliasList m_codecAliases_WINDOWS_1253; + + // Cyrillic + static codecAliasList m_codecAliases_ISO_8859_5; + static codecAliasList m_codecAliases_KOI8_R; + static codecAliasList m_codecAliases_CP866; + static codecAliasList m_codecAliases_KOI8_U; + static codecAliasList m_codecAliases_WINDOWS_1251; + static codecAliasList m_codecAliases_MACCYRILLIC; + + // Thai + static codecAliasList m_codecAliases_CP874; + static codecAliasList m_codecAliases_TIS_620; + + // Simplified Chinese + static codecAliasList m_codecAliases_GBK; + static codecAliasList m_codecAliases_HZ; + static codecAliasList m_codecAliases_GB18030; + static codecAliasList m_codecAliases_EUC_CN; + static codecAliasList m_codecAliases_2312_80; + + // Central European + static codecAliasList m_codecAliases_ISO_8859_2; + static codecAliasList m_codecAliases_CP1250; + static codecAliasList m_codecAliases_MACCENTRALEUROPE; + + // Vietnamese + static codecAliasList m_codecAliases_CP1258; + + // Turkish + static codecAliasList m_codecAliases_CP1254; + static codecAliasList m_codecAliases_ISO_8859_9; + + // Baltic + static codecAliasList m_codecAliases_CP1257; + static codecAliasList m_codecAliases_ISO_8859_4; + + static gconstpointer const m_iconvBaseCodecList[]; + static gconstpointer const m_iconvExtendedCodecList[]; + + }; + +} // namespace WebCore + +#endif // TextCodecGTK_h diff -Naur WebKit-r41128/WebCore/platform/text/TextBreakIterator.h WebKit-r41137-nx/WebCore/platform/text/TextBreakIterator.h --- WebKit-r41128/WebCore/platform/text/TextBreakIterator.h 2008-12-24 23:47:41.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/TextBreakIterator.h 2009-02-23 16:01:27.000000000 -0500 @@ -35,7 +35,9 @@ TextBreakIterator* sentenceBreakIterator(const UChar*, int length); int textBreakFirst(TextBreakIterator*); + int textBreakLast(TextBreakIterator*); int textBreakNext(TextBreakIterator*); + int textBreakPrevious(TextBreakIterator*); int textBreakCurrent(TextBreakIterator*); int textBreakPreceding(TextBreakIterator*, int); int textBreakFollowing(TextBreakIterator*, int); diff -Naur WebKit-r41128/WebCore/platform/text/TextBreakIteratorICU.cpp WebKit-r41137-nx/WebCore/platform/text/TextBreakIteratorICU.cpp --- WebKit-r41128/WebCore/platform/text/TextBreakIteratorICU.cpp 2009-01-21 00:14:22.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/TextBreakIteratorICU.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -89,11 +89,21 @@ return ubrk_first(bi); } +int textBreakLast(TextBreakIterator* bi) +{ + return ubrk_last(bi); +} + int textBreakNext(TextBreakIterator* bi) { return ubrk_next(bi); } +int textBreakPrevious(TextBreakIterator* bi) +{ + return ubrk_previous(bi); +} + int textBreakPreceding(TextBreakIterator* bi, int pos) { return ubrk_preceding(bi, pos); diff -Naur WebKit-r41128/WebCore/platform/text/TextEncoding.cpp WebKit-r41137-nx/WebCore/platform/text/TextEncoding.cpp --- WebKit-r41128/WebCore/platform/text/TextEncoding.cpp 2009-01-21 00:14:22.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/TextEncoding.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -36,6 +36,9 @@ #include #elif USE(QT4_UNICODE) #include +#elif USE(GLIB_UNICODE) +#include +#include #endif #include #include @@ -114,6 +117,20 @@ QString str(reinterpret_cast(characters), length); str = str.normalized(QString::NormalizationForm_C); return newTextCodec(*this)->encode(reinterpret_cast(str.utf16()), str.length(), handling); +#elif USE(GLIB_UNICODE) + GOwnPtr utf8source; + utf8source.set(g_utf16_to_utf8(characters, length, 0, 0, 0)); + + GOwnPtr utf8normalized; + utf8normalized.set(g_utf8_normalize(utf8source.get(), -1, G_NORMALIZE_NFC)); + + long utf16length; + GOwnPtr utf16normalized; + utf16normalized.set(g_utf8_to_utf16(utf8normalized.get(), -1, 0, &utf16length, 0)); + + CString result = newTextCodec(*this)->encode(utf16normalized.get(), utf16length, handling); + + return result; #endif } diff -Naur WebKit-r41128/WebCore/platform/text/TextEncodingRegistry.cpp WebKit-r41137-nx/WebCore/platform/text/TextEncodingRegistry.cpp --- WebKit-r41128/WebCore/platform/text/TextEncodingRegistry.cpp 2009-01-21 00:14:22.000000000 -0500 +++ WebKit-r41137-nx/WebCore/platform/text/TextEncodingRegistry.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -47,6 +47,9 @@ #if PLATFORM(QT) #include "qt/TextCodecQt.h" #endif +#if PLATFORM(GTK) +#include "gtk/TextCodecGtk.h" +#endif using namespace WTF; @@ -189,6 +192,11 @@ TextCodecICU::registerBaseEncodingNames(addToTextEncodingNameMap); TextCodecICU::registerBaseCodecs(addToTextCodecMap); #endif + +#if USE(GLIB_UNICODE) + TextCodecGtk::registerBaseEncodingNames(addToTextEncodingNameMap); + TextCodecGtk::registerBaseCodecs(addToTextCodecMap); +#endif } static void extendTextCodecMaps() @@ -207,6 +215,11 @@ TextCodecMac::registerEncodingNames(addToTextEncodingNameMap); TextCodecMac::registerCodecs(addToTextCodecMap); #endif + +#if USE(GLIB_UNICODE) + TextCodecGtk::registerExtendedEncodingNames(addToTextEncodingNameMap); + TextCodecGtk::registerExtendedCodecs(addToTextCodecMap); +#endif } std::auto_ptr newTextCodec(const TextEncoding& encoding) diff -Naur WebKit-r41128/WebCore/rendering/SVGInlineTextBox.cpp WebKit-r41137-nx/WebCore/rendering/SVGInlineTextBox.cpp --- WebKit-r41128/WebCore/rendering/SVGInlineTextBox.cpp 2009-02-15 03:48:53.000000000 -0500 +++ WebKit-r41137-nx/WebCore/rendering/SVGInlineTextBox.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -484,7 +484,7 @@ float thickness = SVGRenderStyle::cssPrimitiveToLength(object, object->style()->svgStyle()->strokeWidth(), 1.0f); const Font& font = object->style()->font(); - thickness = max(thickness * powf(font.size(), 2.0f) / font.unitsPerEm(), 1.0f); + thickness = max(thickness * (float) pow(font.size(), 2.0f) / font.unitsPerEm(), 1.0f); if (decoration == UNDERLINE) y += thickness * 1.5f; // For compatibility with Batik/Opera diff -Naur WebKit-r41128/WebCore/svg/SVGLength.cpp WebKit-r41137-nx/WebCore/svg/SVGLength.cpp --- WebKit-r41128/WebCore/svg/SVGLength.cpp 2009-02-15 03:48:53.000000000 -0500 +++ WebKit-r41137-nx/WebCore/svg/SVGLength.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -314,7 +314,7 @@ else if (mode == LengthModeHeight) return value * height; else if (mode == LengthModeOther) - return value * sqrtf(powf(width, 2) + powf(height, 2)) / sqrtf(2.0f); + return value * sqrtf(pow(width, 2) + pow(height, 2)) / sqrtf(2.0f); return 0.0f; } diff -Naur WebKit-r41128/WebKit/gtk/tests/main.c WebKit-r41137-nx/WebKit/gtk/tests/main.c --- WebKit-r41128/WebKit/gtk/tests/main.c 2009-02-15 03:48:54.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/tests/main.c 2009-03-24 16:51:48.000000000 -0400 @@ -63,6 +63,98 @@ } static void +test_webkit_web_back_forward_list_order(void) +{ + WebKitWebView* webView; + WebKitWebBackForwardList* webBackForwardList; + WebKitWebHistoryItem* item1; + WebKitWebHistoryItem* item2; + WebKitWebHistoryItem* item3; + WebKitWebHistoryItem* item4; + WebKitWebHistoryItem* currentItem; + GList* backList = NULL; + GList* forwardList = NULL; + g_test_bug("22694"); + + webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g_object_ref_sink(webView); + + webkit_web_view_set_maintains_back_forward_list(webView, TRUE); + webBackForwardList = webkit_web_view_get_back_forward_list(webView); + g_assert(webBackForwardList); + + // Check that there is no item. + g_assert(!webkit_web_back_forward_list_get_current_item(webBackForwardList)); + g_assert_cmpint(webkit_web_back_forward_list_get_forward_length(webBackForwardList), ==, 0); + g_assert_cmpint(webkit_web_back_forward_list_get_back_length(webBackForwardList), ==, 0); + g_assert(!webkit_web_view_can_go_forward(webView)); + g_assert(!webkit_web_view_can_go_back(webView)); + + // Add a new items + item1 = webkit_web_history_item_new_with_data("http://example.com/1/", "Site 1"); + webkit_web_back_forward_list_add_item(webBackForwardList, item1); + g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item1)); + + item2 = webkit_web_history_item_new_with_data("http://example.com/2/", "Site 2"); + webkit_web_back_forward_list_add_item(webBackForwardList, item2); + g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item2)); + + item3 = webkit_web_history_item_new_with_data("http://example.com/3/", "Site 3"); + webkit_web_back_forward_list_add_item(webBackForwardList, item3); + g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item3)); + + item4 = webkit_web_history_item_new_with_data("http://example.com/4/", "Site 4"); + webkit_web_back_forward_list_add_item(webBackForwardList, item4); + g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item4)); + + // check the back list order + backList = webkit_web_back_forward_list_get_back_list_with_limit(webBackForwardList, 5); + g_assert(backList); + + currentItem = WEBKIT_WEB_HISTORY_ITEM(backList->data); + g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/3/"); + g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Site 3"); + backList = backList->next; + + currentItem = WEBKIT_WEB_HISTORY_ITEM(backList->data); + g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/2/"); + g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Site 2"); + backList = backList->next; + + currentItem = WEBKIT_WEB_HISTORY_ITEM(backList->data); + g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/1/"); + g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Site 1"); + g_list_free(backList); + + // check the forward list order + g_assert(webkit_web_view_go_to_back_forward_item(webView, item1)); + forwardList = webkit_web_back_forward_list_get_forward_list_with_limit(webBackForwardList,5); + g_assert(forwardList); + + currentItem = WEBKIT_WEB_HISTORY_ITEM(forwardList->data); + g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/4/"); + g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Site 4"); + forwardList = forwardList->next; + + currentItem = WEBKIT_WEB_HISTORY_ITEM(forwardList->data); + g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/3/"); + g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Site 3"); + forwardList = forwardList->next; + + currentItem = WEBKIT_WEB_HISTORY_ITEM(forwardList->data); + g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/2/"); + g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Site 2"); + + g_object_unref(currentItem); + g_object_unref(item1); + g_object_unref(item2); + g_object_unref(item3); + g_object_unref(item4); + g_list_free(forwardList); + g_object_unref(webView); +} + +static void test_webkit_web_back_forward_list_add_item(void) { WebKitWebView* webView; @@ -143,7 +235,7 @@ g_test_add_func("/webkit/webview/create_destroy", test_webkit_web_frame_create_destroy); g_test_add_func("/webkit/webframe/lifetime", test_webkit_web_frame_lifetime); g_test_add_func("/webkit/webbackforwardlist/add_item", test_webkit_web_back_forward_list_add_item); - + g_test_add_func("/webkit/webbackforwardlist/list_order", test_webkit_web_back_forward_list_order); return g_test_run (); } diff -Naur WebKit-r41128/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp --- WebKit-r41128/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp 2009-01-21 00:14:25.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp 2009-02-25 20:35:26.000000000 -0500 @@ -23,11 +23,13 @@ #include "HitTestResult.h" #include "KURL.h" #include "NotImplemented.h" +#include "CString.h" #include #include #include #include "webkitprivate.h" +#include "webkitwebdownload.h" using namespace WebCore; @@ -163,7 +165,18 @@ void ContextMenuClient::downloadURL(const KURL& url) { - notImplemented(); + WebKitWebDownload* download = webkit_web_download_new(url.string().utf8().data()); + + gboolean handled; + + g_signal_emit_by_name(m_webView, "download-created", download, &handled); + + if (handled) + webkit_web_download_start(download); + else { + webkit_web_download_cancel(download); + g_object_unref(download); + } } void ContextMenuClient::copyImageToClipboard(const HitTestResult&) diff -Naur WebKit-r41128/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp --- WebKit-r41128/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp 2009-02-15 03:48:54.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp 2009-03-30 18:22:43.000000000 -0400 @@ -72,6 +72,62 @@ editor->setComposition(preeditString, underlines, cursorPos, 0); } +static void imContextDeleteSurrounding(GtkIMContext* context, gint offset, gint length, EditorClient* client) +{ +#ifdef MAEMO_CHANGES + Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame(); + SelectionController* selection = frame->selection(); + if (selection) { + // Hack: we just select all text, so the following commit will overwrite all of it. + selection->selectAll(); + } +#endif +} + +static void imContextRetrieveSurrounding(GtkIMContext* context, EditorClient* client) +{ +#ifdef MAEMO_CHANGES + Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame(); + SelectionController* selection = frame->selection(); + if (selection) { + Element* element = selection->rootEditableElement(); + gchar* str = g_strdup(element->innerText().utf8().data()); + if (str != NULL) { + gtk_im_context_set_surrounding(context, str, strlen(str), selection->base().offset()); + g_free(str); + } + } +#endif +} + +static gboolean imContextHasSelection(GtkIMContext* context, EditorClient* client) +{ + Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame(); + SelectionController* selection = frame->selection(); + if (selection) { + return selection->start().offset() != selection->end().offset(); + } + return FALSE; +} + +static void imContextClipboardOperation(GtkIMContext* context, int operation, EditorClient* client) +{ +#ifdef MAEMO_CHANGES + switch(operation) + { + case GTK_IM_CONTEXT_CLIPBOARD_OP_COPY: + webkit_web_view_copy_clipboard(client->m_webView); + break; + case GTK_IM_CONTEXT_CLIPBOARD_OP_CUT: + webkit_web_view_cut_clipboard(client->m_webView); + break; + case GTK_IM_CONTEXT_CLIPBOARD_OP_PASTE: + webkit_web_view_paste_clipboard(client->m_webView); + break; + } +#endif +} + void EditorClient::setInputMethodState(bool active) { WebKitWebViewPrivate* priv = m_webView->priv; @@ -82,9 +138,7 @@ gtk_im_context_focus_out(priv->imContext); #ifdef MAEMO_CHANGES - if (active) - hildon_gtk_im_context_show(priv->imContext); - else + if (!active) hildon_gtk_im_context_hide(priv->imContext); #endif } @@ -459,6 +513,13 @@ { WebKitWebViewPrivate* priv = m_webView->priv; +#ifdef MAEMO_CHANGES + if (hildon_gtk_im_context_filter_event(priv->imContext, (GdkEvent*)event)) { + event->setDefaultHandled(); + return; + } +#endif + // TODO: Dispatch IE-compatible text input events for IM events. if (gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey())) event->setDefaultHandled(); @@ -470,6 +531,17 @@ WebKitWebViewPrivate* priv = m_webView->priv; g_signal_connect(priv->imContext, "commit", G_CALLBACK(imContextCommitted), this); g_signal_connect(priv->imContext, "preedit-changed", G_CALLBACK(imContextPreeditChanged), this); +#ifdef MAEMO_CHANGES + g_signal_connect(priv->imContext, "retrieve-surrounding", G_CALLBACK(imContextRetrieveSurrounding), this); + g_signal_connect(priv->imContext, "delete-surrounding", G_CALLBACK(imContextDeleteSurrounding), this); + g_signal_connect(priv->imContext, "has_selection", G_CALLBACK(imContextHasSelection), this); + g_signal_connect(priv->imContext, "clipboard_operation", G_CALLBACK(imContextClipboardOperation), this); + + int mode; + g_object_get(priv->imContext, "hildon-input-mode", &mode, NULL); + mode ^= HILDON_GTK_INPUT_MODE_AUTOCAP; + g_object_set(priv->imContext, "hildon-input-mode", mode, NULL); +#endif } EditorClient::~EditorClient() @@ -477,6 +549,12 @@ WebKitWebViewPrivate* priv = m_webView->priv; g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextCommitted, this); g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextPreeditChanged, this); +#ifdef MAEMO_CHANGES + g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextRetrieveSurrounding, this); + g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextDeleteSurrounding, this); + g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextHasSelection, this); + g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextClipboardOperation, this); +#endif } void EditorClient::textFieldDidBeginEditing(Element*) diff -Naur WebKit-r41128/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp --- WebKit-r41128/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp 2009-02-15 03:48:54.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp 2009-04-23 19:48:25.345018880 -0400 @@ -21,6 +21,7 @@ #include "config.h" #include "FrameLoaderClientGtk.h" +#include "ResourceHandleClient.h" #include "Color.h" #include "DocumentLoader.h" @@ -40,6 +41,8 @@ #include "MouseEvent.h" #include "NotImplemented.h" #include "PlatformString.h" +#include "ResourceHandle.h" +#include "ResourceHandleInternal.h" #include "PluginDatabase.h" #include "RenderPart.h" #include "ResourceRequest.h" @@ -80,85 +83,18 @@ g_object_unref(m_policyDecision); } -static String agentPlatform() -{ -#ifdef GDK_WINDOWING_X11 - return "X11"; -#elif defined(GDK_WINDOWING_WIN32) - return "Windows"; -#elif defined(GDK_WINDOWING_QUARTZ) - return "Macintosh"; -#elif defined(GDK_WINDOWING_DIRECTFB) - return "DirectFB"; -#else - notImplemented(); - return "Unknown"; -#endif -} - -static String agentOS() -{ -#if PLATFORM(DARWIN) -#if PLATFORM(X86) - return "Intel Mac OS X"; -#else - return "PPC Mac OS X"; -#endif -#elif PLATFORM(UNIX) - struct utsname name; - if (uname(&name) != -1) - return String::format("%s %s", name.sysname, name.machine); - else - return "Unknown"; -#elif PLATFORM(WIN_OS) - // FIXME: Compute the Windows version - return "Windows"; -#else - notImplemented(); - return "Unknown"; -#endif -} - -static String composeUserAgent() -{ - // This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html - // See also http://developer.apple.com/internet/safari/faq.html#anchor2 - - String ua; - - // Product - ua += "Mozilla/5.0"; - - // Comment - ua += " ("; - ua += agentPlatform(); // Platform - ua += "; U; "; // Security - ua += agentOS(); // OS-or-CPU - ua += "; "; - ua += defaultLanguage(); // Localization information - ua += ") "; - - // WebKit Product - // FIXME: The WebKit version is hardcoded - static const String webKitVersion = "528.5+"; - ua += "AppleWebKit/" + webKitVersion; - ua += " (KHTML, like Gecko, "; - // We mention Safari since many broken sites check for it (OmniWeb does this too) - // We re-use the WebKit version, though it doesn't seem to matter much in practice - ua += "Safari/" + webKitVersion; - ua += ") "; - - // Vendor Product - ua += g_get_prgname(); - - return ua; -} - String FrameLoaderClient::userAgent(const KURL&) { - if (m_userAgent.isEmpty()) - m_userAgent = composeUserAgent(); - + Frame* coreFrame = core(webFrame()); + ASSERT(coreFrame); + Settings* settings = coreFrame->settings(); + + if (m_userAgent.isEmpty() || settings->userAgent().isEmpty()) { + m_userAgent = composeUserAgent(); + } else if (!settings->userAgent().isEmpty()) { + m_userAgent = settings->userAgent(); + } + return m_userAgent; } @@ -264,6 +200,18 @@ m_response = response; } +#ifdef MAEMO_CHANGES +bool FrameLoaderClient::dispatchDecidePolicyForNetworkResource(const KURL& url) +{ + WebKitWebView* page = getViewFromFrame(m_frame); + + gboolean isHandled = false; + g_signal_emit_by_name(page, "resource-policy-decision-requested", m_frame, url.string().utf8().data(), &isHandled); + + return !isHandled; +} +#endif + void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String& mimeType, const ResourceRequest& resourceRequest) { ASSERT(policyFunction); @@ -423,7 +371,7 @@ String type = mimeType; // We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure if (type.isEmpty()) - type = MIMETypeRegistry::getMIMETypeForExtension(url.path().substring(url.path().reverseFind('.') + 1)); + type = MIMETypeRegistry::getMIMETypeForPath/*Extension*/(url.path().substring(url.path().reverseFind('.') + 1)); if (type.isEmpty()) return WebCore::ObjectContentFrame; @@ -754,9 +702,23 @@ g_signal_emit_by_name(m_frame, "load-done", false); } -void FrameLoaderClient::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) +void FrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest& initialRequest, const ResourceResponse& response) { - notImplemented(); + WebKitWebView* view = getViewFromFrame(m_frame); + // FIXME: Use initialRequest? + // FIXME: Don't create networkRequest from the URI but from the full object when the new API is merged. + WebKitNetworkRequest* networkRequest = webkit_network_request_new(request.url().string().utf8().data()); + WebKitWebDownload* download = webkit_web_download_new_from_existing_connection(handle, networkRequest, response); + gboolean handled; + g_signal_emit_by_name(view, "download-created", download, &handled); + + if (handled) { + webkit_web_download_start(download); + } + else { + handle->cancel(); + g_object_unref(download); + } } ResourceError FrameLoaderClient::cancelledError(const ResourceRequest&) diff -Naur WebKit-r41128/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h --- WebKit-r41128/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h 2009-02-15 03:48:54.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h 2009-04-21 17:24:09.124131840 -0400 @@ -90,6 +90,9 @@ virtual WebCore::Frame* dispatchCreatePage(); virtual void dispatchShow(); +#ifdef MAEMO_CHANGES + virtual bool dispatchDecidePolicyForNetworkResource(const WebCore::KURL&); +#endif virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WebCore::String& MIMEType, const WebCore::ResourceRequest&); virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr, const WebCore::String& frameName); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr); diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitdefines.h WebKit-r41137-nx/WebKit/gtk/webkit/webkitdefines.h --- WebKit-r41128/WebKit/gtk/webkit/webkitdefines.h 2009-01-21 00:14:25.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitdefines.h 2009-02-23 16:01:27.000000000 -0500 @@ -68,6 +68,9 @@ typedef struct _WebKitWebView WebKitWebView; typedef struct _WebKitWebViewClass WebKitWebViewClass; +typedef struct _WebKitWebDownload WebKitWebDownload; +typedef struct _WebKitWebDownloadClass WebKitWebDownloadClass; + G_END_DECLS #endif diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkit.h WebKit-r41137-nx/WebKit/gtk/webkit/webkit.h --- WebKit-r41128/WebKit/gtk/webkit/webkit.h 2009-01-21 00:14:25.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkit.h 2009-02-23 16:01:27.000000000 -0500 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitprivate.cpp WebKit-r41137-nx/WebKit/gtk/webkit/webkitprivate.cpp --- WebKit-r41128/WebKit/gtk/webkit/webkitprivate.cpp 2009-01-21 00:14:25.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitprivate.cpp 2009-04-22 21:27:15.268010810 -0400 @@ -24,6 +24,7 @@ #include "ChromeClientGtk.h" #include "FrameLoader.h" #include "FrameLoaderClientGtk.h" +#include "Language.h" #include "Logging.h" #include "NotImplemented.h" #include "PageCache.h" @@ -36,10 +37,88 @@ #include "DatabaseTracker.h" #endif +#if PLATFORM(UNIX) +#include +#endif + using namespace WebCore; namespace WebKit { +static String agentPlatform() +{ +#ifdef GDK_WINDOWING_X11 + return "X11"; +#elif defined(GDK_WINDOWING_WIN32) + return "Windows"; +#elif defined(GDK_WINDOWING_QUARTZ) + return "Macintosh"; +#elif defined(GDK_WINDOWING_DIRECTFB) + return "DirectFB"; +#else + notImplemented(); + return "Unknown"; +#endif +} + +static String agentOS() +{ +#if PLATFORM(DARWIN) +#if PLATFORM(X86) + return "Intel Mac OS X"; +#else + return "PPC Mac OS X"; +#endif +#elif PLATFORM(UNIX) + struct utsname name; + if (uname(&name) != -1) + return String::format("%s %s", name.sysname, name.machine); + else + return "Unknown"; +#elif PLATFORM(WIN_OS) + // FIXME: Compute the Windows version + return "Windows"; +#else + notImplemented(); + return "Unknown"; +#endif +} + +String composeUserAgent() +{ + // This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html + // See also http://developer.apple.com/internet/safari/faq.html#anchor2 + + String ua; + + // Product + ua += "Mozilla/5.0"; + + // Comment + ua += " ("; + ua += agentPlatform(); // Platform + ua += "; U; "; // Security + ua += agentOS(); // OS-or-CPU + ua += "; "; + ua += defaultLanguage(); // Localization information + ua += ") "; + + // WebKit Product + // FIXME: The WebKit version is hardcoded + static const String webKitVersion = "528.5+"; + ua += "AppleWebKit/" + webKitVersion; + ua += " (KHTML, like Gecko, "; + // We mention Safari since many broken sites check for it (OmniWeb does this too) + // We re-use the WebKit version, though it doesn't seem to matter much in practice + ua += "Safari/" + webKitVersion; + ua += ") "; + + // Vendor Product + ua += g_get_prgname(); + + return ua; +} + WebKitWebView* getViewFromFrame(WebKitWebFrame* frame) { WebKitWebFramePrivate* priv = frame->priv; diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitprivate.h WebKit-r41137-nx/WebKit/gtk/webkit/webkitprivate.h --- WebKit-r41128/WebKit/gtk/webkit/webkitprivate.h 2009-01-21 00:14:25.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitprivate.h 2009-04-22 21:28:31.700005250 -0400 @@ -27,11 +27,14 @@ * They are using WebCore which musn't be exposed to the outer world. */ +#include + #include #include #include #include #include +#include #include #include #include @@ -44,10 +47,16 @@ #include "InspectorClientGtk.h" #include "FrameLoaderClient.h" #include "WindowFeatures.h" +#include "ResourceHandleClient.h" +#include "ResourceResponse.h" #include +class DownloadClient; + namespace WebKit { + WebCore::String composeUserAgent(); + WebKitWebView* getViewFromFrame(WebKitWebFrame*); WebCore::Frame* core(WebKitWebFrame*); @@ -114,6 +123,20 @@ gchar* uri; }; + #define WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_DOWNLOAD, WebKitWebDownloadPrivate)) + typedef struct _WebKitWebDownloadPrivate WebKitWebDownloadPrivate; + struct _WebKitWebDownloadPrivate { + gchar* localUri; + gchar* suggestedFilename; + guint currentSize; + WebKitWebDownloadState state; + GIOChannel* outputChannel; + DownloadClient* downloadClient; + WebKitNetworkRequest* networkRequest; + WebCore::ResourceResponse* networkResponse; + RefPtr resourceHandle; + }; + PassRefPtr webkit_web_frame_init_with_web_view(WebKitWebView*, WebCore::HTMLFrameOwnerElement*); @@ -144,6 +167,9 @@ void webkit_web_policy_decision_cancel (WebKitWebPolicyDecision* decision); + WebKitWebDownload* + webkit_web_download_new_from_existing_connection(WebCore::ResourceHandle*, WebKitNetworkRequest*, const WebCore::ResourceResponse&); + // FIXME: Move these to webkitwebframe.h once their API has been discussed. WEBKIT_API GSList* diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp --- WebKit-r41128/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp 2009-02-15 03:48:54.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp 2009-03-24 16:51:48.000000000 -0400 @@ -193,7 +193,7 @@ forwardItems = g_list_prepend(forwardItems, g_object_ref(webHistoryItem)); } - return g_list_reverse(forwardItems); + return forwardItems; } /** @@ -223,8 +223,9 @@ backItems = g_list_prepend(backItems, g_object_ref(webHistoryItem)); } - return g_list_reverse(backItems); + return backItems; } + /** * webkit_web_back_forward_list_get_back_item: * @web_back_forward_list: a #WebBackForwardList diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitwebdownload.cpp WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebdownload.cpp --- WebKit-r41128/WebKit/gtk/webkit/webkitwebdownload.cpp 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebdownload.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -0,0 +1,633 @@ +/* + * Copyright (C) 2008 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" + +#include "CString.h" +#include "Noncopyable.h" +#include "NotImplemented.h" +#include "ResourceHandle.h" +#include "ResourceHandleClient.h" +#include "ResourceRequest.h" +#include "ResourceResponse.h" +#include "webkitmarshal.h" +#include "webkitwebdownload.h" +#include "webkitprivate.h" +#include + +using namespace WebKit; +using namespace WebCore; + +extern "C" { + +class DownloadClient : Noncopyable, public WebCore::ResourceHandleClient { + public: + DownloadClient(WebKitWebDownload*); + + virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&); + virtual void didReceiveData(ResourceHandle*, const char*, int, int); + virtual void didFinishLoading(ResourceHandle*); + virtual void didFail(ResourceHandle*, const ResourceError&); + virtual void wasBlocked(ResourceHandle*); + virtual void cannotShowURL(ResourceHandle*); + + private: + WebKitWebDownload* m_download; +}; + +enum { + /* normal signals */ + STARTED, + PROGRESS_UPDATE, + FINISHED, + ERROR, + LAST_SIGNAL +}; + +static guint webkit_web_download_signals[LAST_SIGNAL] = { 0, }; + +enum { + PROP_0, + + PROP_NETWORK_REQUEST, + PROP_LOCAL_URI, + PROP_SUGGESTED_FILENAME, + PROP_CURRENT_SIZE, + PROP_TOTAL_SIZE, +}; + +G_DEFINE_TYPE(WebKitWebDownload, webkit_web_download, G_TYPE_OBJECT); + +static void webkit_web_download_finalize(GObject* object) +{ + WebKitWebDownload* download = WEBKIT_WEB_DOWNLOAD(object); + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + + /* We don't call webkit_web_download_cancel() because we don't want to emit + * signals when finalising an object. */ + if (priv->resourceHandle) { + if (priv->state == WEBKIT_WEB_DOWNLOAD_STATE_STARTED) { + priv->resourceHandle->setClient(0); + priv->resourceHandle->cancel(); + } + priv->resourceHandle.release(); + } + + delete priv->downloadClient; + delete priv->networkResponse; + + g_free(priv->localUri); + g_free(priv->suggestedFilename); + if (priv->outputChannel) + g_io_channel_unref(priv->outputChannel); + g_object_unref(priv->networkRequest); + + G_OBJECT_CLASS(webkit_web_download_parent_class)->finalize(object); +} + +static void webkit_web_download_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) +{ + WebKitWebDownload* download = WEBKIT_WEB_DOWNLOAD(object); + + switch(prop_id) { + case PROP_NETWORK_REQUEST: + g_value_set_object(value, webkit_web_download_get_network_request(download)); + break; + case PROP_LOCAL_URI: + g_value_set_string(value, webkit_web_download_get_local_uri(download)); + break; + case PROP_SUGGESTED_FILENAME: + g_value_set_string(value, webkit_web_download_get_suggested_filename(download)); + break; + case PROP_CURRENT_SIZE: + g_value_set_uint64(value, webkit_web_download_get_current_size(download)); + break; + case PROP_TOTAL_SIZE: + g_value_set_uint64(value, webkit_web_download_get_total_size(download)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + } +} + +static void webkit_web_download_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec *pspec) +{ + WebKitWebDownload* download = WEBKIT_WEB_DOWNLOAD(object); + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + + switch(prop_id) { + case PROP_NETWORK_REQUEST: + priv->networkRequest = (WebKitNetworkRequest*)g_value_dup_object(value); + /* This is safe as network-request is a construct only property and suggestedFilename + * is initially null. */ + priv->suggestedFilename = g_path_get_basename(webkit_network_request_get_uri(priv->networkRequest)); + break; + case PROP_LOCAL_URI: + webkit_web_download_set_local_uri(download, g_value_get_string(value)); + break; + case PROP_SUGGESTED_FILENAME: + webkit_web_download_set_suggested_filename(download, g_value_get_string(value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + } +} + +static void webkit_web_download_class_init(WebKitWebDownloadClass* downloadClass) +{ + /* + * implementations of virtual methods + */ + GObjectClass* objectClass = G_OBJECT_CLASS(downloadClass); + objectClass->finalize = webkit_web_download_finalize; + objectClass->get_property = webkit_web_download_get_property; + objectClass->set_property = webkit_web_download_set_property; + + /** + * WebKitWebView::finished: + * @download: the object on which the signal is emitted + * + * The file has been successfully downloaded. + */ + webkit_web_download_signals[FINISHED] = g_signal_new("finished", + G_TYPE_FROM_CLASS(downloadClass), + (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + 0, + NULL, + NULL, + webkit_marshal_VOID__VOID, + G_TYPE_NONE, 0, + G_TYPE_NONE); + + /** + * WebKitWebView::started: + * @download: the object on which the signal is emitted + * + * The download has started. Happens just before the first progress-update signal. + */ + webkit_web_download_signals[STARTED] = g_signal_new("started", + G_TYPE_FROM_CLASS(downloadClass), + (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + 0, + NULL, + NULL, + webkit_marshal_VOID__VOID, + G_TYPE_NONE, 0, + G_TYPE_NONE); + + /** + * WebKitWebView::progress-update: + * @download: the object on which the signal is emitted + * @current_bytes: the current count of bytes downloaded + * @total_bytes: the total bytes count in the downloaded file, aka file size. + * + * Indicates progress in the download. + */ + webkit_web_download_signals[PROGRESS_UPDATE] = g_signal_new("progress-update", + G_TYPE_FROM_CLASS(downloadClass), + (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + 0, + NULL, + NULL, + webkit_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, + G_TYPE_UINT); + + /** + * WebKitWebView::progress-update: + * @download: the object on which the signal is emitted + * @current_bytes: the current count of bytes downloaded + * @total_bytes: the total bytes count in the downloaded file, aka file size. + * + * Indicates progress in the download. + */ + webkit_web_download_signals[ERROR] = g_signal_new("error", + G_TYPE_FROM_CLASS(downloadClass), + (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + 0, + g_signal_accumulator_true_handled, + NULL, + webkit_marshal_BOOLEAN__INT_INT_STRING, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_STRING); + + /* + * properties + */ + g_object_class_install_property(objectClass, + PROP_NETWORK_REQUEST, + g_param_spec_object( + "network-request", + "Network Request", + "The network request for the URI that should be downloaded", + WEBKIT_TYPE_NETWORK_REQUEST, + (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); + + g_object_class_install_property(objectClass, + PROP_LOCAL_URI, + g_param_spec_string( + "local-uri", + "Local URI", + "The local URI where to save the file", + "", + WEBKIT_PARAM_READWRITE)); + + g_object_class_install_property(objectClass, + PROP_SUGGESTED_FILENAME, + g_param_spec_string( + "suggested-filename", + "Suggested Filename", + "The filename suggested as default when saving", + "", + WEBKIT_PARAM_READWRITE)); + + g_object_class_install_property(objectClass, + PROP_CURRENT_SIZE, + g_param_spec_uint64( + "current-size", + "Current Size", + "The length of the data already downloaded", + 0, G_MAXUINT64, 0, + WEBKIT_PARAM_READABLE)); + + g_object_class_install_property(objectClass, + PROP_CURRENT_SIZE, + g_param_spec_uint64( + "total-size", + "Total Size", + "The total size of the file", + 0, G_MAXUINT64, 0, + WEBKIT_PARAM_READABLE)); + + g_type_class_add_private(downloadClass, sizeof(WebKitWebDownloadPrivate)); +} + +static void webkit_web_download_init(WebKitWebDownload* download) +{ + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + + priv->downloadClient = new DownloadClient(download); + priv->currentSize = 0; + priv->state = WEBKIT_WEB_DOWNLOAD_STATE_CREATED; +} + +WebKitWebDownload* webkit_web_download_new(const gchar* uri) +{ + g_return_val_if_fail(uri, 0); + + WebKitNetworkRequest* request = webkit_network_request_new(uri); + WebKitWebDownload* download = webkit_web_download_new_from_request(request); + g_object_unref(request); + return download; +} + +WebKitWebDownload* webkit_web_download_new_from_request(WebKitNetworkRequest* request) +{ + g_return_val_if_fail(request, 0); + + WebKitWebDownload* download = WEBKIT_WEB_DOWNLOAD(g_object_new(WEBKIT_TYPE_WEB_DOWNLOAD, "network-request", request, NULL)); + return download; +} + +// Private function. +// FIXME Use WebKitNetworkResponse when we have it +WebKitWebDownload* webkit_web_download_new_from_existing_connection(ResourceHandle* handle, WebKitNetworkRequest* request, const ResourceResponse& response) +{ + g_return_val_if_fail(request, 0); + + WebKitWebDownload* download = webkit_web_download_new_from_request (request); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + priv->resourceHandle = handle; + priv->networkResponse = new ResourceResponse(response); + + return download; +} + +static gboolean webkit_web_download_open_channel_with_tmp_file(WebKitWebDownload* download) +{ + gchar* filename; + gint fd = g_file_open_tmp("download-XXXXXX", &filename, 0); + if (fd < 0) + return FALSE; + + gchar* uri = g_filename_to_uri(filename, 0, 0); + g_free(filename); + if (!uri) + return FALSE; + + webkit_web_download_set_local_uri(download, uri); + g_free(uri); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + priv->outputChannel = g_io_channel_unix_new(fd); + if (priv->outputChannel) + g_io_channel_set_close_on_unref(priv->outputChannel, TRUE); + + if (priv->outputChannel) + g_io_channel_set_encoding(priv->outputChannel, 0, 0); + + return priv->outputChannel != 0; +} + +static gboolean webkit_web_download_open_channel_for_uri(WebKitWebDownload* download, const gchar* uri, gboolean append=FALSE) +{ + g_return_val_if_fail(uri, FALSE); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + gchar* filename = g_filename_from_uri(uri, 0, 0); + if (!filename) + return FALSE; + + priv->outputChannel = g_io_channel_new_file(filename, append ? "a" : "w", 0); + g_free(filename); + + if (priv->outputChannel) + g_io_channel_set_encoding(priv->outputChannel, 0, 0); + + return priv->outputChannel != 0; +} + +static void webkit_web_download_close_channel(WebKitWebDownload* download) +{ + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + if (priv->outputChannel) { + g_io_channel_unref(priv->outputChannel); + priv->outputChannel = 0; + } +} + +void webkit_web_download_start(WebKitWebDownload* download) +{ + g_return_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download)); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + g_return_if_fail(priv->state == WEBKIT_WEB_DOWNLOAD_STATE_CREATED); + + if (priv->resourceHandle) + priv->resourceHandle->setClient(priv->downloadClient); + else { + // FIXME use kit(priv->networkRequest) when WebKitNetworkRequest will be finished. + ResourceRequest request(webkit_network_request_get_uri(priv->networkRequest)); + priv->resourceHandle = ResourceHandle::create(request, priv->downloadClient, 0, false, false, false); + } + + if (priv->localUri) + webkit_web_download_open_channel_for_uri(download, priv->localUri); + else + webkit_web_download_open_channel_with_tmp_file(download); + + if (!priv->outputChannel) { + // FIXME Handle errors. + g_warning("Failed to create the output file: %s", priv->localUri); + return; + } +} + +void webkit_web_download_cancel (WebKitWebDownload* download) +{ + g_return_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download)); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + + if (priv->resourceHandle) + priv->resourceHandle->cancel(); + + priv->state = WEBKIT_WEB_DOWNLOAD_STATE_CANCELLED; + + gboolean handled; + g_signal_emit_by_name(download, "error", 0, WEBKIT_WEB_DOWNLOAD_ERROR_CANCELLED_BY_USER, "User cancelled the download", &handled); +} + +const gchar* webkit_web_download_get_uri(WebKitWebDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download), NULL); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + return webkit_network_request_get_uri(priv->networkRequest); +} + +WebKitNetworkRequest* webkit_web_download_get_network_request(WebKitWebDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download), NULL); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + return priv->networkRequest; +} + +static void webkit_web_download_set_response(WebKitWebDownload* download, const ResourceResponse& response) +{ + // FIXME Use WebKitNetworkResponse when it's merged + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + priv->networkResponse = new ResourceResponse(response); +} + +const gchar* webkit_web_download_get_suggested_filename(WebKitWebDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download), NULL); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + return priv->suggestedFilename; +} + +void webkit_web_download_set_suggested_filename(WebKitWebDownload* download, const gchar* filename) +{ + g_return_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download)); + g_return_if_fail(filename); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + if (priv->suggestedFilename && !strcmp(priv->suggestedFilename, filename)) + return; + + g_free(priv->suggestedFilename); + priv->suggestedFilename = g_strdup(filename); + g_object_notify(G_OBJECT(download), "suggested-filename"); +} + +const gchar* webkit_web_download_get_local_uri(WebKitWebDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download), NULL); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + return priv->localUri; +} + +void webkit_web_download_set_local_uri(WebKitWebDownload* download, const gchar* localUri) +{ + g_return_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download)); + g_return_if_fail(localUri); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + if (priv->localUri && !strcmp(priv->localUri, localUri)) + return; + + // FIXME can we have a better check? + if (priv->state != WEBKIT_WEB_DOWNLOAD_STATE_CREATED && priv->state != WEBKIT_WEB_DOWNLOAD_STATE_CANCELLED) { + ASSERT(priv->localUri); + + gboolean downloading = priv->outputChannel != 0; + if (downloading) + webkit_web_download_close_channel(download); + + gchar* srcFilename = g_filename_from_uri(priv->localUri, 0, 0); + gchar* destFilename = g_filename_from_uri(localUri, 0, 0); + if (!srcFilename || !destFilename) + return; + if (g_rename(srcFilename, destFilename) < 0) { + g_warning("Impossible to move the download from %s to %s", srcFilename, destFilename); + g_free(srcFilename); + g_free(destFilename); + return; + } + + g_free(srcFilename); + g_free(destFilename); + + if (downloading) { + if (!webkit_web_download_open_channel_for_uri(download, localUri, TRUE)) { + webkit_web_download_cancel(download); + return; + } + } + } + + g_free(priv->localUri); + priv->localUri = g_strdup(localUri); + g_object_notify(G_OBJECT(download), "local-uri"); +} + +WebKitWebDownloadState webkit_web_download_get_state (WebKitWebDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download), WEBKIT_WEB_DOWNLOAD_STATE_ERROR); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + return priv->state; +} + +// FIXME document that this can be different from expectedContentLength(). +guint64 webkit_web_download_get_total_size (WebKitWebDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download), 0); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + if (!priv->networkResponse) + return 0; + + return MAX(priv->currentSize, priv->networkResponse->expectedContentLength()); +} + +guint64 webkit_web_download_get_current_size (WebKitWebDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_DOWNLOAD(download), 0); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + return priv->currentSize; +} + +static void webkit_web_download_received_data(WebKitWebDownload* download, const gchar* data, int length) +{ + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + + if (priv->currentSize == 0) { + priv->state = WEBKIT_WEB_DOWNLOAD_STATE_STARTED; + g_signal_emit_by_name(download, "started"); + } + + ASSERT(priv->outputChannel); + /* FIXME Make this async? Note that it's not possible with GIOChannel unless you buffer + * the data in memory. */ + if (g_io_channel_write_chars(priv->outputChannel, data, length, NULL, NULL) != G_IO_STATUS_NORMAL) { + // FIXME check errors + g_assert_not_reached(); + } + + priv->currentSize += length; + g_object_notify(G_OBJECT(download), "current-size"); + + ASSERT(priv->networkResponse); + if (priv->currentSize > priv->networkResponse->expectedContentLength()) + g_object_notify(G_OBJECT(download), "total-size"); + + /* FIXME throttle the number of updates? + * should we remove the previous g_object_notify()s if we are going to throttle + * the progress updates? */ + g_signal_emit_by_name(download, "progress-update", (guint)priv->currentSize, (guint)webkit_web_download_get_total_size(download)); +} + +static void webkit_web_download_finished_loading(WebKitWebDownload* download) +{ + webkit_web_download_close_channel(download); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + priv->state = WEBKIT_WEB_DOWNLOAD_STATE_FINISHED; + g_signal_emit_by_name(download, "finished"); +} + +static void webkit_web_download_error(WebKitWebDownload* download, const ResourceError& error) +{ + webkit_web_download_close_channel(download); + + WebKitWebDownloadPrivate* priv = WEBKIT_WEB_DOWNLOAD_GET_PRIVATE(download); + priv->state = WEBKIT_WEB_DOWNLOAD_STATE_ERROR; + + gboolean handled; + g_signal_emit_by_name(download, "error", 0, WEBKIT_WEB_DOWNLOAD_ERROR_NETWORK, error.localizedDescription().utf8().data(), &handled); +} + +DownloadClient::DownloadClient(WebKitWebDownload* download) + : m_download(download) +{ +} + +void DownloadClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response) +{ + webkit_web_download_set_response(m_download, response); +} + +void DownloadClient::didReceiveData(ResourceHandle*, const char* data, int length, int lengthReceived) +{ + webkit_web_download_received_data(m_download, data, length); +} + +void DownloadClient::didFinishLoading(ResourceHandle*) +{ + webkit_web_download_finished_loading(m_download); +} + +void DownloadClient::didFail(ResourceHandle*, const ResourceError& error) +{ + webkit_web_download_error(m_download, error); +} + +void DownloadClient::wasBlocked(ResourceHandle*) +{ + // FIXME when we have the new frame loader signals and error handling. + notImplemented(); +} + +void DownloadClient::cannotShowURL(ResourceHandle*) +{ + // FIXME when we have the new frame loader signals and error handling. + notImplemented(); +} + +} diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitwebdownload.h WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebdownload.h --- WebKit-r41128/WebKit/gtk/webkit/webkitwebdownload.h 1969-12-31 19:00:00.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebdownload.h 2009-02-23 16:01:27.000000000 -0500 @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2008 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef WEBKIT_WEB_DOWNLOAD_H +#define WEBKIT_WEB_DOWNLOAD_H + +#include + +#include + +G_BEGIN_DECLS + +#define WEBKIT_TYPE_WEB_DOWNLOAD (webkit_web_download_get_type()) +#define WEBKIT_WEB_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_DOWNLOAD, WebKitWebDownload)) +#define WEBKIT_WEB_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_DOWNLOAD, WebKitWebDownloadClass)) +#define WEBKIT_IS_WEB_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_DOWNLOAD)) +#define WEBKIT_IS_WEB_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_DOWNLOAD)) +#define WEBKIT_WEB_DOWNLOAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_DOWNLOAD, WebKitWebDownloadClass)) + +typedef enum { + WEBKIT_WEB_DOWNLOAD_STATE_ERROR = -1, + WEBKIT_WEB_DOWNLOAD_STATE_CREATED = 0, + WEBKIT_WEB_DOWNLOAD_STATE_STARTED, + WEBKIT_WEB_DOWNLOAD_STATE_CANCELLED, + WEBKIT_WEB_DOWNLOAD_STATE_FINISHED +} WebKitWebDownloadState; + +typedef enum { + WEBKIT_WEB_DOWNLOAD_ERROR_CANCELLED_BY_USER, + WEBKIT_WEB_DOWNLOAD_ERROR_NETWORK +} WebKitWebDownloadError; + +struct _WebKitWebDownload { + GObject parent; +}; + +struct _WebKitWebDownloadClass { + GObjectClass parent; +}; + +WEBKIT_API GType +webkit_web_download_get_type (void); + +WEBKIT_API WebKitWebDownload * +webkit_web_download_new (const gchar *uri); + +WEBKIT_API WebKitWebDownload * +webkit_web_download_new_from_request (WebKitNetworkRequest *request); + +WEBKIT_API void +webkit_web_download_start (WebKitWebDownload *download); + +WEBKIT_API void +webkit_web_download_cancel (WebKitWebDownload *download); + +WEBKIT_API const gchar* +webkit_web_download_get_uri (WebKitWebDownload *download); + +WEBKIT_API WebKitNetworkRequest* +webkit_web_download_get_network_request (WebKitWebDownload *download); + +WEBKIT_API const gchar* +webkit_web_download_get_suggested_filename (WebKitWebDownload *download); + +WEBKIT_API void +webkit_web_download_set_suggested_filename (WebKitWebDownload *download, + const gchar *filename); + +WEBKIT_API const gchar* +webkit_web_download_get_local_uri (WebKitWebDownload *download); + +WEBKIT_API void +webkit_web_download_set_local_uri (WebKitWebDownload *download, + const gchar *local_uri); + +WEBKIT_API guint64 +webkit_web_download_get_total_size (WebKitWebDownload *download); + +WEBKIT_API guint64 +webkit_web_download_get_current_size (WebKitWebDownload *download); + +WEBKIT_API WebKitWebDownloadState +webkit_web_download_get_state (WebKitWebDownload *download); + +G_END_DECLS + +#endif diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitwebsettings.cpp WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebsettings.cpp --- WebKit-r41128/WebKit/gtk/webkit/webkitwebsettings.cpp 2009-01-21 00:14:25.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebsettings.cpp 2009-04-27 19:00:32.595729680 -0400 @@ -21,6 +21,7 @@ */ #include "config.h" +#include "CString.h" #include "webkitwebsettings.h" #include "webkitprivate.h" @@ -46,6 +47,7 @@ * */ +using namespace WebKit; using namespace WebCore; extern "C" { @@ -72,6 +74,7 @@ gboolean enable_plugins; gboolean resizable_text_areas; gchar* user_stylesheet_uri; + gchar* user_agent; gfloat zoom_step; gboolean enable_developer_extras; }; @@ -100,6 +103,7 @@ PROP_ENABLE_PLUGINS, PROP_RESIZABLE_TEXT_AREAS, PROP_USER_STYLESHEET_URI, + PROP_USER_AGENT, PROP_ZOOM_STEP, PROP_ENABLE_DEVELOPER_EXTRAS }; @@ -335,6 +339,16 @@ FALSE, flags)); + + g_object_class_install_property(gobject_class, + PROP_USER_AGENT, + g_param_spec_string( + "user-agent", + "User Agent", + "The default User Agent used by the Browser.", + composeUserAgent().utf8().data(), + flags)); + g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate)); } @@ -356,6 +370,7 @@ g_free(priv->sans_serif_font_family); g_free(priv->serif_font_family); g_free(priv->user_stylesheet_uri); + g_free(priv->user_agent); G_OBJECT_CLASS(webkit_web_settings_parent_class)->finalize(object); } @@ -431,6 +446,13 @@ g_free(priv->user_stylesheet_uri); priv->user_stylesheet_uri = g_strdup(g_value_get_string(value)); break; + case PROP_USER_AGENT: + g_free(priv->user_agent); + if (g_value_get_string(value) == NULL || strlen(g_value_get_string(value)) == 0) + priv->user_agent = g_strdup(composeUserAgent().utf8().data()); + else + priv->user_agent = g_strdup(g_value_get_string(value)); + break; case PROP_ZOOM_STEP: priv->zoom_step = g_value_get_float(value); break; @@ -506,6 +528,9 @@ case PROP_USER_STYLESHEET_URI: g_value_set_string(value, priv->user_stylesheet_uri); break; + case PROP_USER_AGENT: + g_value_set_string(value, priv->user_agent); + break; case PROP_ZOOM_STEP: g_value_set_float(value, priv->zoom_step); break; @@ -561,11 +586,12 @@ "enable-plugins", priv->enable_plugins, "resizable-text-areas", priv->resizable_text_areas, "user-stylesheet-uri", priv->user_stylesheet_uri, + "user-agent", priv->user_agent, "zoom-step", priv->zoom_step, "enable-developer-extras", priv->enable_developer_extras, NULL)); - return copy; + return copy; } /** diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitwebview.cpp WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebview.cpp --- WebKit-r41128/WebKit/gtk/webkit/webkitwebview.cpp 2009-02-15 03:48:54.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebview.cpp 2009-04-23 19:53:08.128016320 -0400 @@ -25,6 +25,7 @@ #include "config.h" +#include "webkitwebdownload.h" #include "webkitwebview.h" #include "webkitenumtypes.h" #include "webkitmarshal.h" @@ -49,14 +50,17 @@ #include "EventHandler.h" #include "FloatQuad.h" #include "FocusController.h" +#include "FloatQuad.h" #include "FrameLoaderTypes.h" #include "HitTestRequest.h" #include "HitTestResult.h" +#include "HTMLNames.h" #include "GraphicsContext.h" #include "InspectorClientGtk.h" #include "FrameLoader.h" #include "FrameView.h" #include "Editor.h" +#include "Text.h" #include "PasteboardHelper.h" #include "PlatformKeyboardEvent.h" #include "PlatformWheelEvent.h" @@ -103,6 +107,7 @@ using namespace WebKit; using namespace WebCore; +using namespace HTMLNames; extern "C" { @@ -111,6 +116,9 @@ NAVIGATION_REQUESTED, NAVIGATION_POLICY_DECISION_REQUESTED, MIME_TYPE_POLICY_DECISION_REQUESTED, +#ifdef MAEMO_CHANGES + RESOURCE_POLICY_DECISION_REQUESTED, +#endif CREATE_WEB_VIEW, WEB_VIEW_READY, WINDOW_OBJECT_CLEARED, @@ -132,6 +140,7 @@ COPY_CLIPBOARD, PASTE_CLIPBOARD, CUT_CLIPBOARD, + DOWNLOAD_CREATED, LAST_SIGNAL }; @@ -234,14 +243,14 @@ start.getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset); IntRect startCaretRect = renderer->localCaretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine); if (startCaretRect != IntRect()) - startCaretRect = renderer->localToAbsoluteQuad(FloatRect(startCaretRect)).enclosingBoundingBox(); + startCaretRect = renderer->localToAbsoluteQuad(FloatQuad(startCaretRect)).enclosingBoundingBox(); InlineBox* endInlineBox; int endCaretOffset; end.getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset); IntRect endCaretRect = renderer->localCaretRect(endInlineBox, endCaretOffset); if (endCaretRect != IntRect()) - endCaretRect = renderer->localToAbsoluteQuad(FloatRect(endCaretRect)).enclosingBoundingBox(); + endCaretRect = renderer->localToAbsoluteQuad(FloatQuad(endCaretRect)).enclosingBoundingBox(); IntRect firstRect; if (startCaretRect.y() == endCaretRect.y()) @@ -400,6 +409,25 @@ return FALSE; } +static void webkit_web_view_update_im_context(Frame* frame, WebKitWebViewPrivate* priv) { + SelectionController* selection = frame->selection(); + if (selection) { + Element* element = selection->rootEditableElement(); + int mode; + g_object_get(G_OBJECT(priv->imContext), "hildon-input-mode", &mode, NULL); + Node* node = element->shadowAncestorNode(); + if (node != NULL && node->hasTagName(inputTag)) + mode &= ~HILDON_GTK_INPUT_MODE_MULTILINE; + else + mode |= HILDON_GTK_INPUT_MODE_MULTILINE; + if (frame->document()->useSecureKeyboardEntryWhenActive()) + mode |= HILDON_GTK_INPUT_MODE_INVISIBLE; + else + mode &= ~HILDON_GTK_INPUT_MODE_INVISIBLE; + g_object_set(G_OBJECT(priv->imContext), "hildon-input-mode", mode, NULL); + } +} + static gboolean webkit_web_view_key_press_event(GtkWidget* widget, GdkEventKey* event) { WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); @@ -410,6 +438,15 @@ if (!frame->view()) return FALSE; +#ifdef MAEMO_CHANGES + if (frame && frame->editor()->canEdit()) { + WebKitWebViewPrivate* priv = webView->priv; + gtk_im_context_focus_in(priv->imContext); + if (gtk_im_context_filter_keypress(priv->imContext, event)) + return TRUE; + } +#endif + if (frame->eventHandler()->keyEvent(keyboardEvent)) return TRUE; @@ -455,6 +492,16 @@ if (!frame->view()) return FALSE; +#ifdef MAEMO_CHANGES + if (frame && frame->editor()->canEdit()) { + WebKitWebViewPrivate* priv = webView->priv; + webkit_web_view_update_im_context(frame, priv); + gtk_im_context_focus_in(priv->imContext); + if (gtk_im_context_filter_keypress(priv->imContext, event)) + return TRUE; + } +#endif + PlatformKeyboardEvent keyboardEvent(event); if (frame->eventHandler()->keyEvent(keyboardEvent)) @@ -487,12 +534,13 @@ Frame* focusedFrame = core(webView)->focusController()->focusedFrame(); - if (focusedFrame && focusedFrame->editor()->canEdit()) { #ifdef MAEMO_CHANGES + if (focusedFrame && focusedFrame->editor()->canEdit()) { WebKitWebViewPrivate* priv = webView->priv; + webkit_web_view_update_im_context(focusedFrame, priv); hildon_gtk_im_context_filter_event(priv->imContext, (GdkEvent*)event); -#endif } +#endif Frame* mainFrame = core(webView)->mainFrame(); if (!mainFrame->view()) @@ -810,6 +858,13 @@ frame->editor()->command("Paste").execute(); } +static gboolean webkit_web_view_real_download_created(WebKitWebView* web_view, WebKitWebDownload* download) +{ + webkit_web_download_cancel(download); + // Return false to indicate it wasn't handled therefore the download is deleted + return FALSE; +} + static void webkit_web_view_dispose(GObject* object) { WebKitWebView* webView = WEBKIT_WEB_VIEW(object); @@ -1056,6 +1111,19 @@ G_TYPE_STRING, WEBKIT_TYPE_WEB_POLICY_DECISION); +#ifdef MAEMO_CHANGES + webkit_web_view_signals[RESOURCE_POLICY_DECISION_REQUESTED] = g_signal_new("resource-policy-decision-requested", + G_TYPE_FROM_CLASS(webViewClass), + (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + 0, + g_signal_accumulator_true_handled, + NULL, + webkit_marshal_BOOLEAN__OBJECT_OBJECT_STRING, + G_TYPE_BOOLEAN, 3, + WEBKIT_TYPE_WEB_FRAME, + G_TYPE_STRING); +#endif + /** * WebKitWebView::window-object-cleared: * @web_view: the object on which the signal is emitted @@ -1083,6 +1151,24 @@ G_TYPE_POINTER, G_TYPE_POINTER); + /** + * WebKitWebView::download-created: + * @web_view: the object on which the signal is emitted + * @download: the message text + * @return: TRUE if the download was handled, otherwise it'll be cancelled. + * + * A new Download has been created + */ + webkit_web_view_signals[DOWNLOAD_CREATED] = g_signal_new("download-created", + G_TYPE_FROM_CLASS(webViewClass), + (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, download_created), + g_signal_accumulator_true_handled, + NULL, + webkit_marshal_BOOLEAN__OBJECT, + G_TYPE_BOOLEAN, 1, + G_TYPE_OBJECT); + /** * WebKitWebView::load-started: * @web_view: the object on which the signal is emitted @@ -1392,6 +1478,7 @@ webViewClass->cut_clipboard = webkit_web_view_real_cut_clipboard; webViewClass->copy_clipboard = webkit_web_view_real_copy_clipboard; webViewClass->paste_clipboard = webkit_web_view_real_paste_clipboard; + webViewClass->download_created = webkit_web_view_real_download_created; GObjectClass* objectClass = G_OBJECT_CLASS(webViewClass); objectClass->dispose = webkit_web_view_dispose; @@ -1623,7 +1710,7 @@ WebKitWebSettings* webSettings = priv->webSettings; Settings* settings = core(webView)->settings(); - gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri; + gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri, *userAgent; gboolean autoLoadImages, autoShrinkImages, printBackgrounds, enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas; g_object_get(webSettings, @@ -1641,6 +1728,7 @@ "enable-plugins", &enablePlugins, "resizable-text-areas", &resizableTextAreas, "user-stylesheet-uri", &userStylesheetUri, + "user-agent", &userAgent, "enable-developer-extras", &enableDeveloperExtras, NULL); @@ -1658,6 +1746,7 @@ settings->setPluginsEnabled(enablePlugins); settings->setTextAreasAreResizable(resizableTextAreas); settings->setUserStyleSheetLocation(KURL(KURL(), userStylesheetUri)); + settings->setUserAgent(userAgent); settings->setDeveloperExtrasEnabled(enableDeveloperExtras); g_free(defaultEncoding); @@ -1668,6 +1757,7 @@ g_free(sansSerifFontFamily); g_free(serifFontFamily); g_free(userStylesheetUri); + g_free(userAgent); webkit_web_view_screen_changed(webView, NULL, NULL); } @@ -1725,7 +1815,9 @@ settings->setTextAreasAreResizable(g_value_get_boolean(&value)); else if (name == g_intern_string("user-stylesheet-uri")) settings->setUserStyleSheetLocation(KURL(KURL(), g_value_get_string(&value))); - else if (name == g_intern_string("enable-developer-extras")) + else if (name == g_intern_string("user-agent")) + settings->setUserAgent(g_value_get_string(&value)); + else if (name == g_intern_string("enable-developer-extras")) settings->setDeveloperExtrasEnabled(g_value_get_boolean(&value)); else if (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name)) g_warning("Unexpected setting '%s'", name); @@ -1870,6 +1962,26 @@ } /** + * webkit_web_view_inspect: + * @web_view: a #WebKitWebView + * + * Activates the #WebKitWebInspector associated with the + * #WebKitWebView. The inspector is started with the document + * node of the currently focused frame, or the main frame of + * the #WebKitWebView. + * + * Since: 1.0.3 + */ +void webkit_web_view_inspect(WebKitWebView* webView) +{ + g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); + + Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); + + core(webView)->inspectorController()->inspect(frame->document()); +} + +/** * webkit_web_view_get_window_features * @web_view: a #WebKitWebView * diff -Naur WebKit-r41128/WebKit/gtk/webkit/webkitwebview.h WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebview.h --- WebKit-r41128/WebKit/gtk/webkit/webkitwebview.h 2009-02-15 03:48:54.000000000 -0500 +++ WebKit-r41137-nx/WebKit/gtk/webkit/webkitwebview.h 2009-03-30 20:00:08.000000000 -0400 @@ -102,6 +102,8 @@ void (* cut_clipboard) (WebKitWebView *web_view); void (* copy_clipboard) (WebKitWebView *web_view); void (* paste_clipboard) (WebKitWebView *web_view); + gboolean (* download_created) (WebKitWebView *web_view, + WebKitWebDownload *download); /* * internal @@ -270,6 +272,9 @@ WEBKIT_API WebKitWebInspector * webkit_web_view_get_inspector (WebKitWebView *web_view); +WEBKIT_API void +webkit_web_view_inspect (WebKitWebView *web_view); + WEBKIT_API WebKitWebWindowFeatures* webkit_web_view_get_window_features (WebKitWebView *web_view); diff -Naur WebKit-r41128/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp WebKit-r41137-nx/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp --- WebKit-r41128/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp 2009-01-21 00:14:31.000000000 -0500 +++ WebKit-r41137-nx/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -348,7 +348,7 @@ int main(int argc, char* argv[]) { - g_thread_init(NULL); +// g_thread_init(NULL); gtk_init(&argc, &argv); struct option options[] = { diff -Naur WebKit-r41128/WebKitTools/DumpRenderTree/LayoutTestController.cpp WebKit-r41137-nx/WebKitTools/DumpRenderTree/LayoutTestController.cpp --- WebKit-r41128/WebKitTools/DumpRenderTree/LayoutTestController.cpp 2009-02-15 03:48:56.000000000 -0500 +++ WebKit-r41137-nx/WebKitTools/DumpRenderTree/LayoutTestController.cpp 2009-02-23 16:01:27.000000000 -0500 @@ -734,7 +734,7 @@ return JSValueMakeUndefined(context); LayoutTestController* controller = reinterpret_cast(JSObjectGetPrivate(thisObject)); - return JSValueMakeNumber(context, controller->numberOfActiveAnimations()); + return JSValueMakeUndefined(context);//JSValueMakeNumber(context, controller->numberOfActiveAnimations()); } // Static Values diff -Naur WebKit-r41128/WebKitTools/GtkLauncher/main.c WebKit-r41137-nx/WebKitTools/GtkLauncher/main.c --- WebKit-r41128/WebKitTools/GtkLauncher/main.c 2009-01-27 02:55:35.000000000 -0500 +++ WebKit-r41137-nx/WebKitTools/GtkLauncher/main.c 2009-02-23 16:01:27.000000000 -0500 @@ -1,6 +1,7 @@ /* * Copyright (C) 2006, 2007 Apple Inc. * Copyright (C) 2007 Alp Toker + * Copyright (C) 2008 Collabora, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -106,6 +107,107 @@ webkit_web_view_go_forward (web_view); } +static gboolean +download_error_cb (WebKitWebDownload* download, guint domain, WebKitWebDownloadError error, const gchar * message, gpointer data) +{ + g_warning("Download Error: %s\n", message); + return TRUE; +} + +static void +download_finished_cb (WebKitWebDownload* download, gpointer data) +{ + gtk_button_set_label(GTK_BUTTON(data), GTK_STOCK_CLOSE); +} + +static void +download_progress_cb (WebKitWebDownload* download, guint current_bytes, guint total_bytes, gpointer progress_bar) +{ + if(GTK_IS_PROGRESS_BAR(progress_bar)) + { + gdouble progress = (double)current_bytes/total_bytes; + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), progress); + } +} + +static void +download_button_cb (GtkButton* button, WebKitWebDownload* download) +{ + if (webkit_web_download_get_state(download) == WEBKIT_WEB_DOWNLOAD_STATE_FINISHED || + webkit_web_download_get_state(download) == WEBKIT_WEB_DOWNLOAD_STATE_ERROR) { + GdkWindow* window = gtk_widget_get_parent_window(GTK_WIDGET(button)); + gdk_window_hide(window); + g_object_unref(download); + } else + webkit_web_download_cancel(download); +} + +static void +save_dialog_response_cb (GtkFileChooser *file_chooser, gint response, WebKitWebDownload* download) +{ + if (response == GTK_RESPONSE_OK) { + webkit_web_download_set_local_uri(download, gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_chooser))); + } /*else { + gtk_widget_destroy (window); + handled = FALSE; + }*/ + + gtk_widget_destroy (file_chooser); +} + +static gboolean +download_created_cb (WebKitWebView* view, WebKitWebDownload* download, gpointer data) +{ + gboolean handled = TRUE; + GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(window), "Download"); + + GtkWidget* vbox = gtk_vbox_new(TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + + GtkWidget* uri_label = gtk_label_new(NULL); + gtk_label_set_single_line_mode(GTK_LABEL(uri_label), FALSE); + gtk_label_set_markup(GTK_LABEL(uri_label), + g_strconcat("URI: ", + webkit_web_download_get_uri(download), + "\nFilename: ", + webkit_web_download_get_suggested_filename(download), + NULL) + ); + gtk_label_set_justify(GTK_LABEL(uri_label), GTK_JUSTIFY_LEFT); + gtk_box_pack_start(GTK_BOX(vbox), uri_label, FALSE, FALSE, 0); + + GtkWidget* progress_bar = gtk_progress_bar_new(); + gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(progress_bar), GTK_PROGRESS_LEFT_TO_RIGHT); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); + gtk_box_pack_start(GTK_BOX(vbox), progress_bar, FALSE, FALSE, 0); + + GtkWidget* button_box = gtk_hbutton_box_new(); + gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END); + GtkWidget* button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); + g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (download_button_cb), download); + gtk_box_pack_start(GTK_BOX(button_box), button, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), button_box, FALSE, FALSE, 0); + + gtk_container_add(GTK_CONTAINER(window), vbox); + + gtk_widget_show_all(GTK_WIDGET(window)); + + GtkWidget* file_chooser = gtk_file_chooser_dialog_new("Select destination...", GTK_WINDOW(window), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_OK, NULL); + gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_chooser), webkit_web_download_get_suggested_filename (download)); + g_signal_connect (G_OBJECT (file_chooser), "response", G_CALLBACK (save_dialog_response_cb), download); + gtk_widget_show (file_chooser); + + g_signal_connect (G_OBJECT (download), "finished", G_CALLBACK (download_finished_cb), button); + g_signal_connect (G_OBJECT (download), "progress-update", G_CALLBACK (download_progress_cb), progress_bar); + g_signal_connect (G_OBJECT (download), "error", G_CALLBACK (download_error_cb), window); + + if (handled) + g_object_ref(download); + + return handled; +} + static GtkWidget* create_browser () { @@ -119,6 +221,7 @@ g_signal_connect (G_OBJECT (web_view), "load-progress-changed", G_CALLBACK (progress_change_cb), web_view); g_signal_connect (G_OBJECT (web_view), "load-committed", G_CALLBACK (load_commit_cb), web_view); g_signal_connect (G_OBJECT (web_view), "hovering-over-link", G_CALLBACK (link_hover_cb), web_view); + g_signal_connect (G_OBJECT (web_view), "download-created", G_CALLBACK (download_created_cb), web_view); return scrolled_window; } @@ -183,8 +286,8 @@ main (int argc, char* argv[]) { gtk_init (&argc, &argv); - if (!g_thread_supported ()) - g_thread_init (NULL); +/* if (!g_thread_supported ()) + g_thread_init (NULL);*/ GtkWidget* vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), create_toolbar (), FALSE, FALSE, 0);