summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorCary Clark <>2009-04-14 06:33:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-14 06:33:00 -0700
commit563af33bc48281d19dce701398dbb88cb54fd7ec (patch)
tree395b4502f029dea8b25b342d66dc06b5d8f99985 /WebKit
parent5cfedfef172691d0f4bcf2be5ca3cddd8c9a47f4 (diff)
downloadexternal_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.zip
external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.gz
external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.bz2
AI 146110: add missing files to webkit
brings it in sync with webkit svn cl 42046 Automated import of CL 146110
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/ChangeLog111
-rw-r--r--WebKit/English.lproj/Localizable.stringsbin31908 -> 32130 bytes
-rw-r--r--WebKit/StringsNotToBeLocalized.txt47
-rw-r--r--WebKit/WebKit.xcodeproj/project.pbxproj58
-rw-r--r--WebKit/gtk/ChangeLog920
-rw-r--r--WebKit/gtk/NEWS54
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp14
-rw-r--r--WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp17
-rw-r--r--WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp7
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp208
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h7
-rw-r--r--WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp6
-rw-r--r--WebKit/gtk/WebCoreSupport/InspectorClientGtk.h2
-rw-r--r--WebKit/gtk/tests/testwebbackforwardlist.c288
-rw-r--r--WebKit/gtk/tests/testwebframe.c (renamed from WebKit/gtk/tests/main.c)1
-rw-r--r--WebKit/gtk/tests/testwebhistoryitem.c83
-rw-r--r--WebKit/gtk/webkit.pc.in2
-rw-r--r--WebKit/gtk/webkit/webkit.h2
-rw-r--r--WebKit/gtk/webkit/webkitdefines.h3
-rw-r--r--WebKit/gtk/webkit/webkitdownload.cpp818
-rw-r--r--WebKit/gtk/webkit/webkitdownload.h114
-rw-r--r--WebKit/gtk/webkit/webkitprivate.cpp36
-rw-r--r--WebKit/gtk/webkit/webkitprivate.h32
-rw-r--r--WebKit/gtk/webkit/webkitsoupauthdialog.c347
-rw-r--r--WebKit/gtk/webkit/webkitsoupauthdialog.h49
-rw-r--r--WebKit/gtk/webkit/webkitwebbackforwardlist.cpp32
-rw-r--r--WebKit/gtk/webkit/webkitwebbackforwardlist.h3
-rw-r--r--WebKit/gtk/webkit/webkitwebframe.cpp67
-rw-r--r--WebKit/gtk/webkit/webkitwebframe.h11
-rw-r--r--WebKit/gtk/webkit/webkitwebhistoryitem.cpp141
-rw-r--r--WebKit/gtk/webkit/webkitwebinspector.cpp41
-rw-r--r--WebKit/gtk/webkit/webkitwebsettings.cpp27
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp442
-rw-r--r--WebKit/gtk/webkit/webkitwebview.h36
-rw-r--r--WebKit/gtk/webkitmarshal.list17
-rw-r--r--WebKit/mac/Carbon/CarbonUtils.h4
-rw-r--r--WebKit/mac/Carbon/HIWebView.h4
-rw-r--r--WebKit/mac/ChangeLog2168
-rw-r--r--WebKit/mac/Configurations/Base.xcconfig5
-rw-r--r--WebKit/mac/Configurations/DebugRelease.xcconfig9
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig4
-rw-r--r--WebKit/mac/Configurations/WebKit.xcconfig20
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.h34
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m96
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m8
-rw-r--r--WebKit/mac/History/WebBackForwardList.mm30
-rw-r--r--WebKit/mac/History/WebHistory.mm40
-rw-r--r--WebKit/mac/History/WebHistoryInternal.h3
-rw-r--r--WebKit/mac/History/WebHistoryItem.mm17
-rw-r--r--WebKit/mac/History/WebHistoryItemInternal.h1
-rw-r--r--WebKit/mac/Misc/WebCache.mm6
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.mm2
-rw-r--r--WebKit/mac/Misc/WebIconDatabase.mm2
-rw-r--r--WebKit/mac/Misc/WebIconFetcher.mm6
-rw-r--r--WebKit/mac/Misc/WebKitNSStringExtras.m2
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h2
-rw-r--r--WebKit/mac/Misc/WebNSFileManagerExtras.m40
-rw-r--r--WebKit/mac/Misc/WebNSURLExtras.h1
-rw-r--r--WebKit/mac/Misc/WebNSURLExtras.mm1
-rw-r--r--WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm18
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h4
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm74
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h16
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm468
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h67
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm266
-rw-r--r--WebKit/mac/Plugins/Hosted/ProxyInstance.h6
-rw-r--r--WebKit/mac/Plugins/Hosted/ProxyInstance.mm93
-rw-r--r--WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h2
-rw-r--r--WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm66
-rw-r--r--WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs108
-rw-r--r--WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs110
-rw-r--r--WebKit/mac/Plugins/Hosted/WebTextInputWindowController.h46
-rw-r--r--WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m161
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm56
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.h11
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.mm27
-rw-r--r--WebKit/mac/Plugins/WebBasePluginPackage.mm10
-rw-r--r--WebKit/mac/Plugins/WebKitPluginContainerView.h43
-rw-r--r--WebKit/mac/Plugins/WebKitPluginContainerView.mm74
-rw-r--r--WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h8
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h14
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm82
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginPackage.mm (renamed from WebKit/mac/Plugins/WebNetscapePluginPackage.m)55
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.h9
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm291
-rw-r--r--WebKit/mac/Plugins/WebPlugin.h8
-rw-r--r--WebKit/mac/Plugins/WebPluginContainerPrivate.h14
-rw-r--r--WebKit/mac/Plugins/WebPluginController.mm51
-rw-r--r--WebKit/mac/Plugins/WebPluginViewFactory.h2
-rw-r--r--WebKit/mac/Plugins/npapi.mm15
-rw-r--r--WebKit/mac/Plugins/nptextinput.h108
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.h9
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.mm38
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.h1
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.mm57
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h7
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm68
-rw-r--r--WebKit/mac/WebCoreSupport/WebGeolocation.mm66
-rw-r--r--WebKit/mac/WebCoreSupport/WebGeolocationInternal.h38
-rw-r--r--WebKit/mac/WebCoreSupport/WebGeolocationPrivate.h37
-rw-r--r--WebKit/mac/WebCoreSupport/WebInspectorClient.h2
-rw-r--r--WebKit/mac/WebCoreSupport/WebInspectorClient.mm8
-rw-r--r--WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm8
-rw-r--r--WebKit/mac/WebCoreSupport/WebViewFactory.mm6
-rw-r--r--WebKit/mac/WebKitPrefix.h12
-rw-r--r--WebKit/mac/WebView/WebArchive.mm50
-rw-r--r--WebKit/mac/WebView/WebDataSource.mm29
-rw-r--r--WebKit/mac/WebView/WebFrame.mm81
-rw-r--r--WebKit/mac/WebView/WebFrameInternal.h3
-rw-r--r--WebKit/mac/WebView/WebFramePrivate.h5
-rw-r--r--WebKit/mac/WebView/WebFrameView.mm14
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentation.mm4
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm488
-rw-r--r--WebKit/mac/WebView/WebHTMLViewInternal.h7
-rw-r--r--WebKit/mac/WebView/WebHTMLViewPrivate.h1
-rw-r--r--WebKit/mac/WebView/WebPDFRepresentation.m4
-rw-r--r--WebKit/mac/WebView/WebPDFView.mm2
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h3
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm39
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h9
-rw-r--r--WebKit/mac/WebView/WebResource.mm28
-rw-r--r--WebKit/mac/WebView/WebScriptDebugDelegate.h2
-rw-r--r--WebKit/mac/WebView/WebScriptDebugger.mm37
-rw-r--r--WebKit/mac/WebView/WebTextIterator.h26
-rw-r--r--WebKit/mac/WebView/WebUIDelegate.h4
-rw-r--r--WebKit/mac/WebView/WebUIDelegatePrivate.h7
-rw-r--r--WebKit/mac/WebView/WebView.mm284
-rw-r--r--WebKit/mac/WebView/WebViewInternal.h24
-rw-r--r--WebKit/mac/WebView/WebViewPrivate.h7
-rw-r--r--WebKit/qt/Api/qwebdatabase.h2
-rw-r--r--WebKit/qt/Api/qwebframe.cpp145
-rw-r--r--WebKit/qt/Api/qwebframe.h3
-rw-r--r--WebKit/qt/Api/qwebframe_p.h1
-rw-r--r--WebKit/qt/Api/qwebpage.cpp141
-rw-r--r--WebKit/qt/Api/qwebpage.h3
-rw-r--r--WebKit/qt/Api/qwebpage_p.h3
-rw-r--r--WebKit/qt/Api/qwebsecurityorigin.h2
-rw-r--r--WebKit/qt/Api/qwebsettings.cpp35
-rw-r--r--WebKit/qt/Api/qwebsettings.h6
-rw-r--r--WebKit/qt/ChangeLog479
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp3
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp44
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h7
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorClientQt.cpp6
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorClientQt.h2
-rw-r--r--WebKit/qt/WebKit_pch.h2
-rw-r--r--WebKit/qt/tests/qwebframe/tst_qwebframe.cpp95
-rw-r--r--WebKit/qt/tests/qwebpage/tst_qwebpage.cpp11
-rw-r--r--WebKit/win/ChangeLog628
-rw-r--r--WebKit/win/DOMCoreClasses.cpp2
-rw-r--r--WebKit/win/DOMHTMLClasses.cpp14
-rwxr-xr-xWebKit/win/Interfaces/IWebFramePrivate.idl6
-rw-r--r--WebKit/win/Interfaces/IWebPreferencesPrivate.idl6
-rw-r--r--WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl14
-rwxr-xr-xWebKit/win/Interfaces/IWebUIDelegatePrivate.idl11
-rw-r--r--WebKit/win/Interfaces/IWebURLRequest.idl2
-rw-r--r--WebKit/win/Interfaces/IWebView.idl12
-rw-r--r--WebKit/win/Interfaces/IWebViewPrivate.idl2
-rw-r--r--WebKit/win/Interfaces/WebKit.idl1
-rw-r--r--WebKit/win/MarshallingHelpers.cpp5
-rw-r--r--WebKit/win/WebCache.cpp9
-rw-r--r--WebKit/win/WebCoreLocalizedStrings.cpp4
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp62
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.h5
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.cpp7
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.h2
-rw-r--r--WebKit/win/WebFrame.cpp99
-rw-r--r--WebKit/win/WebFrame.h11
-rw-r--r--WebKit/win/WebHistory.cpp42
-rw-r--r--WebKit/win/WebHistory.h8
-rw-r--r--WebKit/win/WebKit.vcproj/WebKit.def9
-rw-r--r--WebKit/win/WebKit.vcproj/WebKit.vcproj15
-rwxr-xr-xWebKit/win/WebKit.vcproj/WebKit_Cairo.def6
-rw-r--r--WebKit/win/WebKit.vcproj/WebKit_debug.def9
-rw-r--r--WebKit/win/WebMutableURLRequest.cpp27
-rw-r--r--WebKit/win/WebMutableURLRequest.h4
-rw-r--r--WebKit/win/WebPreferenceKeysPrivate.h2
-rw-r--r--WebKit/win/WebPreferences.cpp30
-rw-r--r--WebKit/win/WebPreferences.h12
-rw-r--r--WebKit/win/WebView.cpp95
-rw-r--r--WebKit/win/WebView.h8
-rw-r--r--WebKit/wx/ChangeLog90
-rw-r--r--WebKit/wx/WebFrame.cpp15
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp26
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.h12
-rw-r--r--WebKit/wx/WebKitSupport/InspectorClientWx.cpp6
-rw-r--r--WebKit/wx/WebKitSupport/InspectorClientWx.h2
-rw-r--r--WebKit/wx/WebView.cpp2
-rw-r--r--WebKit/wx/WebView.h2
-rw-r--r--WebKit/wx/bindings/python/webview.i3
-rw-r--r--WebKit/wx/bindings/python/wxwebkit-py.bkl3
-rw-r--r--WebKit/wx/dependencies.bkl10
-rw-r--r--WebKit/wx/presets/wxwebkit.bkl11
194 files changed, 10627 insertions, 2160 deletions
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 457e527..d7d9265 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,114 @@
+2009-03-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ * English.lproj/Localizable.strings: Updated.
+ * StringsNotToBeLocalized.txt: Updated for recent changes.
+
+2009-03-13 Greg Bolsinga <bolsinga@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Update Geolocation perimission dialogs to be asynchronous.
+ https://bugs.webkit.org/show_bug.cgi?id=24505
+
+ Add WebGeolocation, a wrapper around WebCore::Geolocation. It mimics the
+ coding style set by WebSecurityOrigin.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-03-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/6610666> Revise the Cocoa event model text API
+
+ Remove nptextinput.h
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-03-03 David Kilzer <ddkilzer@apple.com>
+
+ <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase
+
+ Reviewed by Mark Rowe.
+
+ The fix is to add INSTALLHDRS_COPY_PHASE = YES and
+ INSTALLHDRS_SCRIPT_PHASE = YES to WebKit.xcconfig, then to
+ make sure various build phase scripts work with the installhdrs
+ build phase.
+
+ * WebKit.xcodeproj/project.pbxproj:
+ - Added shell code to prevent running "Check For Global
+ Initializers", "Check For Exit Time Destructors" and "Check
+ For Weak VTables" scripts during the installhdrs build phase.
+ - Removed UMBRELLA_FRAMEWORKS_DIR from the Debug and Release
+ targets since it's no longer needed after defining
+ WEBCORE_PRIVATE_HEADERS_DIR in WebKit.xcconfig.
+
+2009-03-03 David Kilzer <ddkilzer@apple.com>
+
+ Remove last vestiges of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR from WebKit
+
+ Reviewed by Adam Roben.
+
+ Use of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR was removed in r37465
+ since NPAPI headers had migrated from JavaScriptCore to WebCore
+ before that.
+
+ * WebKit.xcodeproj/project.pbxproj: Removed
+ JAVASCRIPTCORE_PRIVATE_HEADERS_DIR build setting from from Debug
+ and Release configurations.
+
+2009-03-02 Anders Carlsson <andersca@apple.com>
+
+ WebNetscapePluginPackage.mm is an Objective-C++ file.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-03-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Rename WebNetscapePluginPackage.m to WebNetscapePluginPackage.mm
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-02-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add new files.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-02-13 Darin Adler <darin@apple.com>
+
+ * StringsNotToBeLocalized.txt: Updated for recent changes.
+
+2009-02-07 Darin Adler <darin@apple.com>
+
+ * StringsNotToBeLocalized.txt: Updated for recent changes.
+
+2009-02-04 Timothy Hatcher <timothy@apple.com>
+
+ Removed the WebDefaultScriptDebugDelegate now that we have CallScriptDebugDelegate.
+
+ <rdar://problem/6508457> Launching widget in Dashcode debugger is
+ super-slow due forwardInvocation: calling debug delegate
+
+ Reviewed by Oliver Hunt.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Remove WebKitPluginContainerView.{h|mm}, they aren't used anywhere.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2009-01-26 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
diff --git a/WebKit/English.lproj/Localizable.strings b/WebKit/English.lproj/Localizable.strings
index c1584f9..7c82945 100644
--- a/WebKit/English.lproj/Localizable.strings
+++ b/WebKit/English.lproj/Localizable.strings
Binary files differ
diff --git a/WebKit/StringsNotToBeLocalized.txt b/WebKit/StringsNotToBeLocalized.txt
index 2cc5d69..07fe282 100644
--- a/WebKit/StringsNotToBeLocalized.txt
+++ b/WebKit/StringsNotToBeLocalized.txt
@@ -7,6 +7,7 @@
" >>>"
" Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko) %@"
" Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko)"
+" Version/3.2.1"
" webViewDrawResizer delegate call"
"#"
"%"
@@ -42,6 +43,7 @@
","
"-"
"-1px"
+"-createPluginMIMETypesPreferences"
"-khtml-text-decorations-in-effect"
"."
"._"
@@ -103,16 +105,16 @@
"BEGIN:VCARD"
"BP_CreatePluginMIMETypesPreferences"
"CFDictionaryPropertyBag"
-"CFNetwork"
-"CFNetwork_debug"
-"CFURLCacheCopySharedURLCache"
"CSS"
"Content-Encoding"
"Content-Length"
"Content-Type"
+"D"
"DCMDictionaryServiceWindowShow"
"DELEGATE METHODS"
"DOCBASE"
+"DOMHTMLObjectElement"
+"DOMNode"
"DYLD_FRAMEWORK_PATH"
"DefaultDownloadDelegate"
"DefaultPolicyDelegate"
@@ -127,6 +129,7 @@
"FastMallocReturnedSize"
"FrameName"
"GEN_DOMObject"
+"GET"
"GroupName"
"HIDictionaryWindowShow"
"Helvetica"
@@ -159,7 +162,6 @@
"Library/Internet Plug-Ins"
"LresultFromObject"
"Lucida Grande"
-"MIMEType"
"MIME\\Database\\Content Type"
"MainPageJavaScript.js"
"MemoryStream"
@@ -224,6 +226,7 @@
"UseBackForwardList"
"User-Agent"
"Volumes"
+"W"
"WEBKIT_UNSET_DYLD_FRAMEWORK_PATH"
"WebActionButtonKey"
"WebActionElementKey"
@@ -307,6 +310,7 @@
"WebKitHistoryItemLimit"
"WebKitInspectorAttached"
"WebKitInspectorAttachedViewHeight"
+"WebKitInspectorHiddenPanels"
"WebKitLogLevel"
"WebKitOmitPDFSupport"
"WebKitOriginalBottomMargin"
@@ -399,6 +403,7 @@
"\n--------------------------------------------\n"
"\r"
"\xFF\xD8\xFF\xE0"
+"_isUsingAcceleratedCompositing"
"_top"
"a"
"ab"
@@ -435,6 +440,7 @@
"com.adobe.dreamweaver-9.0"
"com.apple.Aperture"
"com.apple.AppKit"
+"com.apple.Automator"
"com.apple.Dictionary"
"com.apple.HIWebView"
"com.apple.JavaAppletPlugin"
@@ -447,13 +453,14 @@
"com.apple.WebKit.PluginAgent"
"com.apple.hiview"
"com.apple.iWeb"
+"com.apple.installer"
"com.apple.mail"
"com.apple.quicktime.webplugin"
"com.apple.universalaccess"
"com.lizardtech.NPDjVu"
"com.macromedia.fireworks"
+"com.microsoft.SilverlightPlugin"
"com.microsoft.WMP.defaultplugin"
-"copyData"
"cpuType"
"dir"
"displayTitle"
@@ -464,11 +471,15 @@
"file:"
"frameName"
"ftp:"
+"groupName"
"htm"
"html"
+"http"
+"http:"
"http://"
"http://www.google.com/search?q="
"https"
+"https:"
"i"
"icon.db"
"image.pict"
@@ -486,6 +497,7 @@
"javascript:"
"js"
"lastVisitWasFailure"
+"lastVisitWasHTTPNonGet"
"lastVisitedDate"
"line-through"
"lineNumber"
@@ -497,7 +509,6 @@
"mainFrameIcon"
"mainFrameTitle"
"mainFrameURL"
-"mainResource"
"mimeType"
"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@"
"nullplugin"
@@ -506,14 +517,13 @@
"pluginspage"
"r"
"r+b"
+"redirectURLs"
"rgb(%.0f,%.0f,%.0f)"
"rgba(%.0f,%.0f,%.0f,%f)"
"s"
"sourceURL"
"src"
"sub"
-"subframeArchives"
-"subresources"
"text/calendar"
"text/directory"
"text/html"
@@ -530,13 +540,13 @@
"text/x-vcalendar"
"text/x-vcard"
"text/x-vcf"
-"textEncodingName"
"tiff"
"txt"
"u"
"userAgent"
"utf-16"
"vImagePermuteChannels_ARGB8888"
+"visibleName"
"visitCount"
"webkit-fake-url"
"webplugin"
@@ -555,25 +565,22 @@ WebKit/mac/Misc/WebCache.mm:"Images"
WebKit/mac/Misc/WebKitLogging.h:"<not running on main thread>"
WebKit/mac/Misc/WebKitVersionChecks.m:"WebKit"
WebKit/mac/Misc/WebNSNotificationCenterExtras.m
-WebKit/mac/Misc/WebNSObjectExtras.mm:"object"
-WebKit/mac/Misc/WebNSObjectExtras.mm:"selector"
-WebKit/mac/Misc/WebNSObjectExtras.mm:"result"
WebKit/mac/Misc/WebNSPasteboardExtras.mm
WebKit/mac/Misc/WebNSURLExtras.mm:"file"
WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:" OK\n"
WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:": "
WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:"HTTP "
WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:"identity"
+WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm:"%@ Plug-in Host - %@"
WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:" OK\n"
WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:": "
WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:"HTTP "
WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:"identity"
WebKit/mac/Plugins/WebBasePluginPackage.mm:"Java Applet Plugin Enabler"
-WebKit/mac/Plugins/WebNetscapePluginPackage.m:"RealPlayer Plugin"
-WebKit/mac/Plugins/WebNetscapePluginPackage.m:"main"
+WebKit/mac/Plugins/WebNetscapePluginPackage.mm:"RealPlayer Plugin"
+WebKit/mac/Plugins/WebNetscapePluginPackage.mm:"main"
WebKit/mac/Plugins/WebNetscapePluginView.mm:"height"
WebKit/mac/Plugins/WebNetscapePluginView.mm:"width"
-WebKit/mac/Plugins/nptextinput.h
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"dialog"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"fullscreen"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"height"
@@ -592,7 +599,6 @@ WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:"height"
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:"width"
WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"Web Inspector 2"
WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"inspector"
-WebKit/mac/WebView/WebArchive.mm:"result"
WebKit/mac/WebView/WebHTMLView.mm:"'%@'"
WebKit/mac/WebView/WebHTMLView.mm:"Version:"
WebKit/mac/WebView/WebHTMLView.mm:"applet"
@@ -605,6 +611,8 @@ WebKit/mac/WebView/WebHTMLView.mm:"direction"
WebKit/mac/WebView/WebHTMLView.mm:"font"
WebKit/mac/WebView/WebHTMLView.mm:"head"
WebKit/mac/WebView/WebHTMLView.mm:"italic"
+WebKit/mac/WebView/WebHTMLView.mm:"jpeg"
+WebKit/mac/WebView/WebHTMLView.mm:"jpg"
WebKit/mac/WebView/WebHTMLView.mm:"menu"
WebKit/mac/WebView/WebHTMLView.mm:"none"
WebKit/mac/WebView/WebHTMLView.mm:"normal"
@@ -619,15 +627,14 @@ WebKit/mac/WebView/WebHTMLView.mm:"underline"
WebKit/mac/WebView/WebHTMLView.mm:"white"
WebKit/mac/WebView/WebPreferenceKeysPrivate.h
WebKit/mac/WebView/WebPreferences.mm
-WebKit/mac/WebView/WebResource.mm:"URL"
-WebKit/mac/WebView/WebResource.mm:"data"
-WebKit/mac/WebView/WebResource.mm:"response"
-WebKit/mac/WebView/WebResource.mm:"result"
WebKit/mac/WebView/WebView.mm:"At least one WebView is still open."
WebKit/mac/WebView/WebView.mm:"At least one WebView was closed with fast teardown."
WebKit/mac/WebView/WebView.mm:"Preferences"
WebKit/mac/WebView/WebView.mm:"Search With Google"
WebKit/mac/WebView/WebView.mm:"control"
+WebKit/mac/WebView/WebView.mm:"data"
+WebKit/mac/WebView/WebView.mm:"decoder"
+WebKit/mac/WebView/WebView.mm:"frame"
WebKit/mac/WebView/WebView.mm:"return "
WebKit/win/AccessibleBase.cpp
WebKit/win/DOMCoreClasses.h
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index 698deb2..0df3e64 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -23,9 +23,10 @@
1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
1A4DF5E40EC8D104006BD4B4 /* WebBaseNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */; };
1A4DF5E50EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */; };
+ 1A74A28E0F4F75400082E228 /* WebTextInputWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A74A28C0F4F75400082E228 /* WebTextInputWindowController.h */; };
+ 1A74A28F0F4F75400082E228 /* WebTextInputWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A74A28D0F4F75400082E228 /* WebTextInputWindowController.m */; };
1A77B02E0EE7730500C8A1F9 /* WebPluginRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */; };
1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */; };
- 1A7F9C4C0DD3DDEA0028F8A5 /* nptextinput.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7F9C4B0DD3DDEA0028F8A5 /* nptextinput.h */; settings = {ATTRIBUTES = (Public, ); }; };
1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */; };
1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */; };
1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -109,8 +110,6 @@
65EEDE58084FFC9E0002DB25 /* WebNSFileManagerExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EEDE56084FFC9E0002DB25 /* WebNSFileManagerExtras.m */; };
65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoaderMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 65FFB7FA0AD0B7D30048CD05 /* WebDocumentLoaderMac.h */; };
65FFB7FD0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65FFB7FB0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm */; };
- 7E6FEF0108985A3E00C44C3F /* WebDefaultScriptDebugDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEEFF08985A3E00C44C3F /* WebDefaultScriptDebugDelegate.h */; };
- 7E6FEF0208985A3E00C44C3F /* WebDefaultScriptDebugDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEF0008985A3E00C44C3F /* WebDefaultScriptDebugDelegate.m */; };
7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */; };
9304B3000B02341500F7850D /* WebIconDatabaseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 9304B2FF0B02341500F7850D /* WebIconDatabaseInternal.h */; };
@@ -242,7 +241,7 @@
939810D00824BF01008DF038 /* WebPanelAuthenticationHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */; };
939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.mm */; };
939810D30824BF01008DF038 /* WebBasePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF47036652150000E506 /* WebBasePluginPackage.mm */; };
- 939810D60824BF01008DF038 /* WebNetscapePluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */; };
+ 939810D60824BF01008DF038 /* WebNetscapePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */; };
939810D90824BF01008DF038 /* WebNullPluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */; };
939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8467275D0367158500CA2ACA /* WebPluginController.mm */; };
939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717210288493C018635CA /* WebPluginDatabase.mm */; };
@@ -303,8 +302,6 @@
A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */; };
A7D3C5BD0B5773C5002CA450 /* WebPasteboardHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */; };
ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */; };
- BCDFA8F90C10B6F500D3A10C /* WebKitPluginContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */; };
- BCDFA9130C10B93E00D3A10C /* WebKitPluginContainerView.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */; };
C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */; };
C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0167BF70D7F5DD00028696E /* WebScriptDebugger.mm */; };
DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
@@ -317,6 +314,9 @@
EDE983810BCDF5FE00FDAE28 /* WebNSArrayExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = EDE9837F0BCDF5FE00FDAE28 /* WebNSArrayExtras.m */; };
F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = F834AAD50E64B1C700E2737C /* WebTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */ = {isa = PBXBuildFile; fileRef = F834AAD60E64B1C700E2737C /* WebTextIterator.mm */; };
+ FEF52DFA0F6748F200FF70EE /* WebGeolocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = FEF52DF70F6748F200FF70EE /* WebGeolocation.mm */; };
+ FEF52DFB0F6748F200FF70EE /* WebGeolocationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF52DF80F6748F200FF70EE /* WebGeolocationInternal.h */; };
+ FEF52DFC0F6748F200FF70EE /* WebGeolocationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF52DF90F6748F200FF70EE /* WebGeolocationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -336,9 +336,10 @@
1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginView.mm; sourceTree = "<group>"; };
1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginView.h; sourceTree = "<group>"; };
1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebBaseNetscapePluginView.mm; sourceTree = "<group>"; };
+ 1A74A28C0F4F75400082E228 /* WebTextInputWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTextInputWindowController.h; sourceTree = "<group>"; };
+ 1A74A28D0F4F75400082E228 /* WebTextInputWindowController.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = WebTextInputWindowController.m; sourceTree = "<group>"; };
1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginRequest.h; sourceTree = "<group>"; };
1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginRequest.m; sourceTree = "<group>"; };
- 1A7F9C4B0DD3DDEA0028F8A5 /* nptextinput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nptextinput.h; sourceTree = "<group>"; };
1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HostedNetscapePluginStream.h; sourceTree = "<group>"; };
1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HostedNetscapePluginStream.mm; sourceTree = "<group>"; };
1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgent.defs; sourceTree = "<group>"; };
@@ -478,8 +479,6 @@
65FFB7FB0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDocumentLoaderMac.mm; sourceTree = "<group>"; };
7082F56F038EADAA00A80180 /* WebKitNSStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNSStringExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
7082F570038EADAA00A80180 /* WebKitNSStringExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitNSStringExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 7E6FEEFF08985A3E00C44C3F /* WebDefaultScriptDebugDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultScriptDebugDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 7E6FEF0008985A3E00C44C3F /* WebDefaultScriptDebugDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultScriptDebugDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptDebugDelegate.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
830E81E005853AC000AD0891 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
@@ -547,8 +546,6 @@
A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardHelper.h; sourceTree = "<group>"; };
A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPasteboardHelper.mm; sourceTree = "<group>"; };
ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebKitPluginContainerView.h; sourceTree = "<group>"; };
- BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKitPluginContainerView.mm; sourceTree = "<group>"; };
BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebEditingDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSURLExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSURLExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -609,7 +606,7 @@
F5E0A76E02B8FEE401C1A525 /* WebURLsWithTitles.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebURLsWithTitles.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5E0A76F02B8FEE401C1A525 /* WebURLsWithTitles.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebURLsWithTitles.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNetscapePluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5F717200288493C018635CA /* WebPluginDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginDatabase.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5F717210288493C018635CA /* WebPluginDatabase.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebPluginDatabase.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5F717230288493C018635CA /* npapi.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = npapi.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -636,6 +633,9 @@
F834AAD60E64B1C700E2737C /* WebTextIterator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTextIterator.mm; sourceTree = "<group>"; };
F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebAuthenticationPanel.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebAuthenticationPanel.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ FEF52DF70F6748F200FF70EE /* WebGeolocation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGeolocation.mm; sourceTree = "<group>"; };
+ FEF52DF80F6748F200FF70EE /* WebGeolocationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGeolocationInternal.h; sourceTree = "<group>"; };
+ FEF52DF90F6748F200FF70EE /* WebGeolocationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGeolocationPrivate.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -747,6 +747,8 @@
1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */,
1AAF588E0EDCCEA3008D883D /* WebKitPluginHostTypes.defs */,
1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */,
+ 1A74A28C0F4F75400082E228 /* WebTextInputWindowController.h */,
+ 1A74A28D0F4F75400082E228 /* WebTextInputWindowController.m */,
);
path = Hosted;
sourceTree = "<group>";
@@ -941,8 +943,6 @@
BE95BEE505FD0805006E1513 /* WebDefaultEditingDelegate.m */,
5152FADF033FC50400CA2ACD /* WebDefaultPolicyDelegate.h */,
5152FAE0033FC50400CA2ACD /* WebDefaultPolicyDelegate.m */,
- 7E6FEEFF08985A3E00C44C3F /* WebDefaultScriptDebugDelegate.h */,
- 7E6FEF0008985A3E00C44C3F /* WebDefaultScriptDebugDelegate.m */,
515E27CF0458CA4B00CA2D3A /* WebDefaultUIDelegate.h */,
515E27D00458CA4B00CA2D3A /* WebDefaultUIDelegate.m */,
);
@@ -964,13 +964,12 @@
226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */,
226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */,
F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */,
- F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */,
+ F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */,
1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */,
1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */,
1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */,
1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */,
F5F717230288493C018635CA /* npapi.mm */,
- 1A7F9C4B0DD3DDEA0028F8A5 /* nptextinput.h */,
);
name = "Netscape Plug-ins";
sourceTree = "<group>";
@@ -979,8 +978,6 @@
isa = PBXGroup;
children = (
51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */,
- BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */,
- BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */,
848DFF840365FE6A00CA2ACA /* WebPlugin.h */,
848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */,
65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */,
@@ -1108,6 +1105,9 @@
4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */,
931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */,
931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */,
+ FEF52DF70F6748F200FF70EE /* WebGeolocation.mm */,
+ FEF52DF80F6748F200FF70EE /* WebGeolocationInternal.h */,
+ FEF52DF90F6748F200FF70EE /* WebGeolocationPrivate.h */,
51494CD40C7EBDE0004178C5 /* WebIconDatabaseClient.h */,
51494CD50C7EBDE0004178C5 /* WebIconDatabaseClient.mm */,
9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
@@ -1256,7 +1256,6 @@
9398104E0824BF01008DF038 /* WebDefaultContextMenuDelegate.h in Headers */,
9398108D0824BF01008DF038 /* WebDefaultEditingDelegate.h in Headers */,
9398104F0824BF01008DF038 /* WebDefaultPolicyDelegate.h in Headers */,
- 7E6FEF0108985A3E00C44C3F /* WebDefaultScriptDebugDelegate.h in Headers */,
939810760824BF01008DF038 /* WebDefaultUIDelegate.h in Headers */,
939810500824BF01008DF038 /* WebDocument.h in Headers */,
9398107F0824BF01008DF038 /* WebDocumentInternal.h in Headers */,
@@ -1315,7 +1314,6 @@
1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */,
1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */,
1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */,
- BCDFA8F90C10B6F500D3A10C /* WebKitPluginContainerView.h in Headers */,
1AAF58970EDCCF15008D883D /* WebKitPluginHost.defs in Headers */,
1AAF58980EDCCF15008D883D /* WebKitPluginHostTypes.defs in Headers */,
1AAF5D090EDDE71D008D883D /* WebKitPluginHostTypes.h in Headers */,
@@ -1394,8 +1392,10 @@
939810460824BF01008DF038 /* WebViewFactory.h in Headers */,
9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */,
939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
- 1A7F9C4C0DD3DDEA0028F8A5 /* nptextinput.h in Headers */,
1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */,
+ 1A74A28E0F4F75400082E228 /* WebTextInputWindowController.h in Headers */,
+ FEF52DFB0F6748F200FF70EE /* WebGeolocationInternal.h in Headers */,
+ FEF52DFC0F6748F200FF70EE /* WebGeolocationPrivate.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1517,7 +1517,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -f ../WebKitTools/Scripts/check-for-weak-vtables ]; then\n ../WebKitTools/Scripts/check-for-weak-vtables || exit $?\nfi";
+ shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-weak-vtables ]; then\n ../WebKitTools/Scripts/check-for-weak-vtables || exit $?\nfi";
};
5D2F7DB70C687A5A00B5B72B /* Update Info.plist with version information */ = {
isa = PBXShellScriptBuildPhase;
@@ -1547,7 +1547,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -f ../WebKitTools/Scripts/check-for-exit-time-destructors ]; then\n ../WebKitTools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
+ shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-exit-time-destructors ]; then\n ../WebKitTools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
};
939811300824BF01008DF038 /* Make Frameworks Symbolic Link */ = {
isa = PBXShellScriptBuildPhase;
@@ -1577,7 +1577,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -f ../WebKitTools/Scripts/check-for-global-initializers ]; then\n ../WebKitTools/Scripts/check-for-global-initializers || exit $?\nfi";
+ shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-global-initializers ]; then\n ../WebKitTools/Scripts/check-for-global-initializers || exit $?\nfi";
};
/* End PBXShellScriptBuildPhase section */
@@ -1615,7 +1615,6 @@
939810EF0824BF01008DF038 /* WebDefaultContextMenuDelegate.mm in Sources */,
9398111B0824BF01008DF038 /* WebDefaultEditingDelegate.m in Sources */,
939810F00824BF01008DF038 /* WebDefaultPolicyDelegate.m in Sources */,
- 7E6FEF0208985A3E00C44C3F /* WebDefaultScriptDebugDelegate.m in Sources */,
9398110A0824BF01008DF038 /* WebDefaultUIDelegate.m in Sources */,
65FFB7FD0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm in Sources */,
9398110B0824BF01008DF038 /* WebDownload.m in Sources */,
@@ -1647,7 +1646,6 @@
939810C40824BF01008DF038 /* WebKitNSStringExtras.m in Sources */,
1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */,
1AAF5D000EDDE604008D883D /* WebKitPluginClient.defs in Sources */,
- BCDFA9130C10B93E00D3A10C /* WebKitPluginContainerView.mm in Sources */,
1AAF5CF10EDDE586008D883D /* WebKitPluginHost.defs in Sources */,
939810C50824BF01008DF038 /* WebKitStatistics.m in Sources */,
9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */,
@@ -1674,7 +1672,7 @@
1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */,
1AEA66D90DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm in Sources */,
1AEA6A510DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm in Sources */,
- 939810D60824BF01008DF038 /* WebNetscapePluginPackage.m in Sources */,
+ 939810D60824BF01008DF038 /* WebNetscapePluginPackage.mm in Sources */,
1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */,
1C68F670095B5FC100C2984E /* WebNodeHighlight.m in Sources */,
1C68F672095B5FC100C2984E /* WebNodeHighlightView.m in Sources */,
@@ -1704,6 +1702,8 @@
939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */,
939810DD0824BF01008DF038 /* npapi.mm in Sources */,
1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */,
+ 1A74A28F0F4F75400082E228 /* WebTextInputWindowController.m in Sources */,
+ FEF52DFA0F6748F200FF70EE /* WebGeolocation.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1764,12 +1764,10 @@
buildSettings = {
DEBUG_DEFINES = "$(DEBUG_DEFINES_debug) ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH";
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
- JAVASCRIPTCORE_PRIVATE_HEADERS_DIR = "$(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders";
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
"-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)",
);
- UMBRELLA_FRAMEWORKS_DIR = "$(BUILT_PRODUCTS_DIR)";
};
name = Debug;
};
@@ -1779,12 +1777,10 @@
buildSettings = {
DEBUG_DEFINES = "$(DEBUG_DEFINES_$(CURRENT_VARIANT)) ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH";
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
- JAVASCRIPTCORE_PRIVATE_HEADERS_DIR = "$(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders";
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
"-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)",
);
- UMBRELLA_FRAMEWORKS_DIR = "$(BUILT_PRODUCTS_DIR)";
};
name = Release;
};
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index e6dc216..3691b4b 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,11 +1,810 @@
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-03-25 Gustavo Noronha Silva <gns@gnome.org>
- Merge r40508.
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=15793
+ [GTK] tooltip position doesn't update when hovering consecutive links
+
+ Work-around tooltips not updating their location when the elements
+ are consecutive, by clearing the tooltip when handling
+ mouseDidMoveOverElement.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::mouseDidMoveOverElement):
+
+2009-03-23 Alejandro Garcia Castro <alex@igalia.com>
+
+ Reviewed by Holger Freyther.
+
+ [Gtk] Current API does not allow us to open target="_blank" links
+ in new tabs instead of windows
+ https://bugs.webkit.org/show_bug.cgi?id=23932
+
+ Added a signal to the API (new-window-policy-decision-requested)
+ that allows the browser to decide the policy for the new window
+ request, if the signal is not handled we open the new window as
+ usual.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::getNavigationAction):
+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+ * webkit/webkitwebview.cpp:
+
+2009-03-20 Jan Michael Alonzo <jmalonzo@gmail.com>
+
+ Not reviewed. Fix style issues with my previous commit (r41866) as
+ suggested by Holger in https://bugs.webkit.org/show_bug.cgi?id=24493
+
+ * tests/testwebhistoryitem.c:
+ (test_webkit_web_history_item_get_data):
+ (test_webkit_web_history_item_alternate_title):
+
+2009-03-20 Jan Michael Alonzo <jmalonzo@gmail.com>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] Misc patches for WebKitWebHistoryItem
+ https://bugs.webkit.org/show_bug.cgi?id=24493
+
+ Add unit test for WebKitWebHistoryItem
+
+ * tests/testwebhistoryitem.c: Added.
+ (web_history_item_fixture_setup):
+ (web_history_item_fixture_teardown):
+ (test_webkit_web_history_item_get_data):
+ (test_webkit_web_history_item_alternate_title):
+ (main):
+
+2009-03-20 Jan Michael Alonzo <jmalonzo@gmail.com>
+
+ Reviewed by Holger Freyther.
+
+ Separate gtk unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=24039
+
+ Split the current single-file unit test to make it more
+ modularized and manageable in the future as more unit tests are
+ written.
+
+ * tests/main.c: Removed.
+ * tests/testwebbackforwardlist.c: Copied from WebKit/gtk/tests/main.c.
+ (main):
+ * tests/testwebframe.c: Copied from WebKit/gtk/tests/main.c.
+ (main):
+
+2009-03-16 Christian Dywan <christian@twotoasts.de>
+
+ Reviewed by Adam Roben.
+
+ [gtk] API implementation: url and title
+ http://bugs.webkit.org/show_bug.cgi?id=14807
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::dispatchDidChangeLocationWithinPage):
+ (WebKit::FrameLoaderClient::dispatchDidReceiveTitle):
+ (WebKit::FrameLoaderClient::dispatchDidCommitLoad):
+ * webkit/webkitwebview.cpp:
+ * webkit/webkitwebview.h: Implement "title" and "uri" properties as well
+ as according functions. "uri" always reflects the current location
+ including navigation inside the same page. title-changed is deprecated.
+
+2009-03-15 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix default policy decision to be ignore, on MIME checks, if
+ WebKit doesn't know how to handle the MIME type. The documentation
+ is already correct, and this was an oversight when the policy
+ decision code was first committed. Since 1.1.2 will be the first
+ release to support download, there is no practical change in
+ behavior.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType):
+
+2009-03-15 Xan Lopez <xlopez@igalia.com>
+
+ * NEWS: update for 1.1.2.
+
+2009-03-14 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] use of confirm dialog (yes/no) causes segfault
+ https://bugs.webkit.org/show_bug.cgi?id=20940
+
+ Change the script-confirm marshaller from OBJECT,STRING,BOOLEAN to
+ OBJECT,STRING,POINTER
+
+ * webkit/webkitwebview.cpp:
+ * webkitmarshal.list:
+
+2009-03-12 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24553
+ [GTK] Improvements to WebKitDownload
+
+ Rename 'state' to 'status' to match the naming in the frame
+ loader rework that we plan to land soonish, and make it a
+ property, for the same reason.
+
+ * webkit/webkitdownload.cpp:
+ (_WebKitDownloadPrivate::):
+ (_WebKitDownloadPrivate::webkit_download_finalize):
+ (_WebKitDownloadPrivate::webkit_download_get_property):
+ (_WebKitDownloadPrivate::webkit_download_set_property):
+ (_WebKitDownloadPrivate::webkit_download_class_init):
+ (_WebKitDownloadPrivate::webkit_download_init):
+ (_WebKitDownloadPrivate::webkit_download_start):
+ (_WebKitDownloadPrivate::webkit_download_cancel):
+ (_WebKitDownloadPrivate::webkit_download_set_destination_uri):
+ (_WebKitDownloadPrivate::webkit_download_get_status):
+ (_WebKitDownloadPrivate::webkit_download_set_status):
+ (_WebKitDownloadPrivate::webkit_download_received_data):
+ (_WebKitDownloadPrivate::webkit_download_finished_loading):
+ (_WebKitDownloadPrivate::webkit_download_error):
+ * webkit/webkitdownload.h:
+
+2009-03-12 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24553
+ [GTK] Improvements to WebKitDownload
+
+ Improved documentation for the download-requested signal, to make
+ its usage clear.
+
+ * webkit/webkitwebview.cpp:
+
+2009-03-12 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Alp Toker.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24541
+ Scrolling with home and end keys not always works
+
+ Also make page up and page down keys be handled by the webview key
+ event code, so that they also work in cases where the GTK+
+ scrollbars don't handle them directly, like in the bugzill's patch
+ review page.
+
+ * webkit/webkitwebview.cpp:
+
+2009-03-12 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Alp Toker.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24541
+ Scrolling with home and end keys not always works
+
+ Make home and end keys behave more consistently for scrolling the
+ view.
+
+ * webkit/webkitwebview.cpp:
+
+2009-03-12 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Alp Toker.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24254
+ [GTK] spacebar doesn't scroll down
+
+ Make spacebar and shift+spacebar scroll like page up and down
+ respectively would.
+
+ * webkit/webkitwebview.cpp:
+
+2009-03-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24493
+ [GTK] Misc patches for WebKitWebHistoryItem
+
+ Only run code in dispose once per instance.
+
+ * webkit/webkitwebhistoryitem.cpp:
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_dispose):
+
+2009-03-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24493
+ [GTK] Misc patches for WebKitWebHistoryItem
+
+ Call deref() on our internal HistoryItem on dispose, as we always
+ acquire it with a releaseRef() call to a PassRefPtr, which passes
+ ownership.
+
+ * webkit/webkitwebhistoryitem.cpp:
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_dispose):
+
+2009-03-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24493
+ [GTK] Misc patches for WebKitWebHistoryItem
+
+ return foo? foo : NULL == return foo
+
+ * webkit/webkitwebhistoryitem.cpp:
+ (WebKit::core):
+
+2009-03-11 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ Gtk] Implement LayoutTestControllerGtk::setPrivateBrowsingEnabled
+ https://bugs.webkit.org/show_bug.cgi?id=24487
+
+ Add private browsing option "enable-private-browsing" to WebKitWebSettings.
+
+ * webkit/webkitwebsettings.cpp:
+ (_WebKitWebSettingsPrivate::):
+ (_WebKitWebSettingsPrivate::webkit_web_settings_class_init):
+ (_WebKitWebSettingsPrivate::webkit_web_settings_set_property):
+ (_WebKitWebSettingsPrivate::webkit_web_settings_get_property):
+ (_WebKitWebSettingsPrivate::webkit_web_settings_copy):
+ * webkit/webkitwebview.cpp:
+
+2009-03-11 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] BackForward history leak?
+ https://bugs.webkit.org/show_bug.cgi?id=19528
+
+ Don't ref the history items when returning the back/forward list
+ Added test_webkit_web_history_item_lifetime test case for this.
+
+ * tests/main.c:
+ (test_webkit_web_history_item_lifetime):
+ (test_webkit_web_back_forward_list_order): Style fix.
+ (test_webkit_web_back_forward_list_add_item): Style fix.
+ (main):
+ * webkit/webkitwebbackforwardlist.cpp:
+ (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_forward_list_with_limit):
+ (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_back_list_with_limit):
+
+2009-03-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24493
+ [GTK] Misc patches for WebKitWebHistoryItem
+
+ Use g_hash_table_new_full so we can save the manual unref on the
+ values when removing them from the table.
+
+ * webkit/webkitwebhistoryitem.cpp:
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_dispose):
+
+2009-03-10 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24493
+ [GTK] Misc patches for WebKitWebHistoryItem
+
+ Use 'if (foo)' instead of 'if (foo != NULL)', per coding style
+ guidelines.
+
+ * webkit/webkitwebhistoryitem.cpp:
+ (_WebKitWebHistoryItemPrivate::webkit_history_item_remove):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_title):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_alternate_title):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_uri):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_original_uri):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_last_visited_time):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_target):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_is_target_item):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_children):
+
+2009-03-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Correct return value to false instead of NULL.
+
+ * webkit/webkitwebhistoryitem.cpp:
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_is_target_item):
+
+2009-03-08 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Mark Rowe.
+
+ Add javascript-profiling-enabled property and implement it. This
+ will enable/disable the profiler on the InstpectorController.
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebinspector.cpp:
+ (_WebKitWebInspectorPrivate::webkit_web_inspector_class_init):
+ (_WebKitWebInspectorPrivate::webkit_web_inspector_set_property):
+ (_WebKitWebInspectorPrivate::webkit_web_inspector_get_property):
+ (_WebKitWebInspectorPrivate::webkit_web_inspector_set_inspector_client):
+ * webkit/webkitwebview.cpp:
+
+2009-03-05 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Olliej.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24295
+ webkit_web_back_forward_list_add_item needs a Since tag
+
+ Add missing Since tag to webkit_web_back_forward_list_add_item
+ documentation.
+
+ * webkit/webkitwebbackforwardlist.cpp:
+
+2009-03-05 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24417
+ [GTK] WebKitDownload's _cancel and _dispose methods may emit warnings
+
+ NULL-check for timer on _cancel and _dispose, to avoid bad
+ warnings.
+
+ * webkit/webkitdownload.cpp:
+ (_WebKitDownloadPrivate::webkit_download_finalize):
+ (_WebKitDownloadPrivate::webkit_download_cancel):
+
+2009-03-02 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24287
+ [GTK] Move auth dialog feature to WebKit/
+
+ Add WebKitSoupAuthDialog and add it to the session in webkit_init.
+
+ * webkit/webkitprivate.cpp:
+ (currentToplevelCallback):
+ (webkit_init):
+ * webkit/webkitsoupauthdialog.c: Added.
+ (webkit_soup_auth_dialog_class_init):
+ (webkit_soup_auth_dialog_init):
+ (webkit_soup_auth_dialog_session_feature_init):
+ (free_authData):
+ (set_password_callback):
+ (response_callback):
+ (table_add_entry):
+ (show_auth_dialog):
+ (find_password_callback):
+ (session_authenticate):
+ (attach):
+ * webkit/webkitsoupauthdialog.h: Added.
+
+2009-03-03 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=16826
+ [Gtk] Implement WebKitDownload
+
+ Implement download, and provide a nice object wrapping the
+ download process. Initial work done by Marco Barisione and
+ Pierre-Luc Beaudoin for Collabora.
+
+ * WebCoreSupport/ContextMenuClientGtk.cpp:
+ (WebKit::ContextMenuClient::downloadURL):
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::download):
+ (WebKit::FrameLoaderClient::startDownload):
+ * webkit/webkit.h:
+ * webkit/webkitdefines.h:
+ * webkit/webkitdownload.cpp: Added.
+ (_WebKitDownloadPrivate::):
+ (_WebKitDownloadPrivate::webkit_download_dispose):
+ (_WebKitDownloadPrivate::webkit_download_finalize):
+ (_WebKitDownloadPrivate::webkit_download_get_property):
+ (_WebKitDownloadPrivate::webkit_download_set_property):
+ (_WebKitDownloadPrivate::webkit_download_class_init):
+ (_WebKitDownloadPrivate::webkit_download_init):
+ (_WebKitDownloadPrivate::webkit_download_new):
+ (_WebKitDownloadPrivate::webkit_download_open_stream_for_uri):
+ (_WebKitDownloadPrivate::webkit_download_close_stream):
+ (_WebKitDownloadPrivate::webkit_download_start):
+ (_WebKitDownloadPrivate::webkit_download_cancel):
+ (_WebKitDownloadPrivate::webkit_download_get_uri):
+ (_WebKitDownloadPrivate::webkit_download_get_network_request):
+ (_WebKitDownloadPrivate::webkit_download_set_response):
+ (_WebKitDownloadPrivate::webkit_download_get_suggested_filename):
+ (_WebKitDownloadPrivate::webkit_download_get_destination_uri):
+ (_WebKitDownloadPrivate::webkit_download_set_destination_uri):
+ (_WebKitDownloadPrivate::webkit_download_get_state):
+ (_WebKitDownloadPrivate::webkit_download_get_total_size):
+ (_WebKitDownloadPrivate::webkit_download_get_current_size):
+ (_WebKitDownloadPrivate::webkit_download_get_progress):
+ (_WebKitDownloadPrivate::webkit_download_get_elapsed_time):
+ (_WebKitDownloadPrivate::webkit_download_received_data):
+ (_WebKitDownloadPrivate::webkit_download_finished_loading):
+ (_WebKitDownloadPrivate::webkit_download_error):
+ (_WebKitDownloadPrivate::DownloadClient::DownloadClient):
+ (_WebKitDownloadPrivate::DownloadClient::didReceiveResponse):
+ (_WebKitDownloadPrivate::DownloadClient::didReceiveData):
+ (_WebKitDownloadPrivate::DownloadClient::didFinishLoading):
+ (_WebKitDownloadPrivate::DownloadClient::didFail):
+ (_WebKitDownloadPrivate::DownloadClient::wasBlocked):
+ (_WebKitDownloadPrivate::DownloadClient::cannotShowURL):
+ * webkit/webkitdownload.h: Added.
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebview.cpp:
+ * webkitmarshal.list:
+
+2009-03-01 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Gtk] get the HTTP layout tests going
+ https://bugs.webkit.org/show_bug.cgi?id=24259
+
+ Added API to get the response mime type from a frame. We need this
+ so we can decide if we need to dump the frame as text or its
+ render tree
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebframe.cpp:
+
+2009-03-01 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Gtk] get the HTTP layout tests going
+ https://bugs.webkit.org/show_bug.cgi?id=24259
+
+ Create a WebKitWebHistoryItem for each WebCore::HistoryItem when
+ necessary.
+ Add necessary API additions for us to be able to dump a WebKitWebHistoryItem
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebbackforwardlist.cpp:
+ (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_forward_list_with_limit):
+ (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_back_list_with_limit):
+ * webkit/webkitwebhistoryitem.cpp:
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_core_item):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_data):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_target):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_is_target_item):
+ (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_children):
+ (WebKit::core):
+ (WebKit::kit):
+
+2009-03-01 Christian Dywan <christian@twotoasts.de>
+
+ Reviewed by Holger Freyther.
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_get_encoding):
+ * webkit/webkitwebview.h: Implement 'encoding' and 'custom-encoding'
+ properties as well as webkit_web_view_get_encoding.
+
+2009-03-01 Gustavo Noronha Silva <gns@gnome.org>
+
+ Unreviewed simple wording fix for the NEWS file.
+
+ * NEWS:
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
+2009-03-01 Xan Lopez <xan@gnome.org>
+
+ Add NEWS file to track progress between releases.
+
+ * NEWS: Added.
+
+2009-02-28 Christian Dywan <christian@twotoasts.de>
+
+ Reviewed by Holger Freyther.
+
+ * webkit/webkitwebview.cpp: Let webkit_web_view_open add file:// if a
+ locale path is passed for compatibility, since we used to support that.
+
+2009-02-27 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by David Hyatt.
+
+ Automatically ignore empty requests to avoid crashing. This fixes
+ the crash in fast/loader/empty-embed-src-attribute.html.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType):
+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+
+2009-02-27 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24221
+ [GTK] Do not emit load-finished when being disposed
+
+ webkit_web_view_stop_load() is called from dispose() on
+ WebKitWebView. This eventually calls postProgressFinishedNotification
+ in FrameLoaderClientGtk, which emits load-finished. Add
+ a 'disposing' flag to WebView that we can check here, so
+ we avoid emitting signals on objects on their way to be
+ destroyed. This fixes a bunch of critical warnings when
+ closing a loading WebView.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::postProgressFinishedNotification):
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebview.cpp:
+
+2009-02-27 Xan Lopez <xan@gnome.org>
+
+ Rubber-stamped by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24222
+ [GTK] Remove checks for old glib versions
+
+ libsoup, which is a hard dependency, needs at least glib 2.15.3,
+ so remove all glib checks for versions older than that.
+
+ * webkit/webkitwebview.cpp:
+
+2009-02-26 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=16947
+ [GTK] Missing HTTP Auth challenge
+
+ Add new marshalers list.
+
+ * webkitmarshal.list: Added.
+
+2009-02-26 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24193
+ [GTK] Checkbuttons not activated with space
+
+ Do not swallow key events with GtkIMContext for non-editable
+ content.
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::EditorClient::handleInputMethodKeydown):
+
+2009-02-26 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24103
+ [GTK] Use correct return value for WebView button-release handler
+
+ We are returning whatever the core code tells us it did, but this
+ does not play well with the GTK+ model. GTK+ in general expects it
+ will see a button-release if it saw a button-press and no
+ motion/leave/etc events in between. EventHandler.cpp will, in some
+ cases, not handle press but handle release, confusing the parent
+ container of the WebView.
+
+ As a workaround return always FALSE for button-release (this is
+ the same than the Windows port does).
+
+ * webkit/webkitwebview.cpp:
+
+2009-02-26 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=17585
+ [gtk] get|set encoding api
+
+ Add functions to get and set a custom encoding an a view.
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_set_custom_encoding):
+ (webkit_web_view_get_custom_encoding):
+ * webkit/webkitwebview.h:
+
+2009-02-23 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22624
+ [SOUP][GTK] Need API to get SoupSession from WebKit.
+
+ Add API to get the default soup session.
+
+ * webkit/webkitwebview.cpp:
+ * webkit/webkitwebview.h:
+
+2009-02-23 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22624
+ [SOUP][GTK] Need API to get SoupSession from WebKit.
+
+ Add soup dependency to pc file.
+
+ * webkit.pc.in:
+
+2009-02-23 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ [GTK] Back / Forward history menus are flipped
+ https://bugs.webkit.org/show_bug.cgi?id=22694
+
+ Don't call g_list_reverse when returning the back or forward list.
+
+ * tests/main.c:
+ (test_webkit_web_back_forward_list_order):
+ (main):
+ * webkit/webkitwebbackforwardlist.cpp:
+ (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_forward_list_with_limit):
+ (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_back_list_with_limit):
+
+2009-02-17 Xan Lopez <xan@gnome.org>
+
+ Rubber-stamped by Alexey Proskuryakov.
+
+ Restoring change landed in r40715, which was accidentally undone
+ by r40918.
+
+ * webkit/webkitwebframe.cpp:
+
+2009-02-12 Christian Dywan <christian@twotoasts.de>
+
+ Reviewed by Holger Freyther.
+
+ http://bugs.webkit.org/show_bug.cgi?id=17176
+ [GTK] API: hovering-over-link and webkit_web_view_open /_load_foo
+
+ * webkit/webkitwebframe.cpp:
+ * webkit/webkitwebframe.h:
+ * webkit/webkitwebview.cpp:
+ * webkit/webkitwebview.h: Introduce webkit_web_frame_load_uri,
+ webkit_web_frame_load_string, webkit_web_view_load_uri and
+ webkit_web_view_load_request and unify implementations.
+
+2009-02-11 Dimitri Dupuis-latour <dupuislatour@apple.com>
+
+ Stub out InspectorClient::hiddenPanels.
+
+ Reviewed by Timothy Hatcher.
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::hiddenPanels):
+ * WebCoreSupport/InspectorClientGtk.h:
+
+2009-02-07 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Unreviewed build fix Use toNormalizedRange().
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::clipboard_get_contents_cb):
+
+2009-02-06 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::updateGlobalHistoryRedirectLinks):
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2009-02-06 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Holger Freyther.
+
+ Reported by Daniel Macks.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20412
+
+ Use positive numbers for the target info IDs, gtk_target_list_add
+ casts them to 'guint'. Also just start them from 0, since the
+ values are not relevant or magic in any way, they are just used as
+ tokens for the user of the API.
+
+ * webkit/webkitwebview.h:
+
+2009-02-06 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23769
+
+ Do not use empty ResourceError errors.
+
+ Rather create bogus but non-null errors, since some codepaths
+ expect these. For example, see DocumentLoader::mainReceivedError.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::cancelledError):
+ (WebKit::FrameLoaderClient::blockedError):
+ (WebKit::FrameLoaderClient::cannotShowURLError):
+ (WebKit::FrameLoaderClient::interruptForPolicyChangeError):
+ (WebKit::FrameLoaderClient::cannotShowMIMETypeError):
+ (WebKit::FrameLoaderClient::fileDoesNotExistError):
+ (WebKit::FrameLoaderClient::pluginWillHandleLoadError):
+
+2009-02-06 Xan Lopez <xan@gnome.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23761
+
+ Use two-arg KURL ctor.
+
+ We are using the one-arg ctor currently, but:
+
+ - It assumes the strings are already encoded, which is not
+ necesarily the case for us.
+
+ - The single-argument KURL ctors expect their input to already be
+ the output of a previous KURL::parse call, so for the general
+ case (ie, random user input) we need to use the two-arg ctor
+ anyway.
+
+ * webkit/webkitwebframe.cpp:
+ * webkit/webkitwebview.cpp:
+
+2009-02-05 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23708
+ Adds documentElementAvailable() callback to FrameLoaderClient.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::documentElementAvailable):
+ Stub out documentElementAvailable()
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+ Ditto.
+
+2009-02-03 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22988
+ [GTK] Need a public method to add a WebKitWebHistoryItem to
+ WebKitWebBackForwardList.
+
+ Wrap WebCore::BackForwardList::addItem.
+
+ * tests/main.c:
+ (test_webkit_web_back_forward_list_add_item):
+ (main):
+ * webkit/webkitwebbackforwardlist.cpp:
+ (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_add_item):
+ * webkit/webkitwebbackforwardlist.h:
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * webkit/webkitwebview.cpp:
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * webkit/webkitwebframe.cpp:
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::createFrame):
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
-
+
Track redirects in global history.
Keep GTK building.
@@ -15,17 +814,62 @@
(WebKit::FrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem):
* WebCoreSupport/FrameLoaderClientGtk.h:
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Build fix.
+
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Update for changes to WebCore.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::createPlugin):
+ (WebKit::FrameLoaderClient::createJavaAppletWidget):
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2009-02-02 Holger Hans Peter Freyther <zecke@selfish.org>
- Merge r40436.
+ Reviewed by Darin Adler.
- 2009-01-30 Geoffrey Garen <ggaren@apple.com>
+ Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView
+
+ https://bugs.webkit.org/show_bug.cgi?id=23428
+
+ FrameView::forceLayout could be killed but the comment might
+ contain a value over the the plain FrameView::layout...
+
+ Adjust the WebCore/WebKit consumers of these methods.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::forceLayout):
+ * webkit/webkitwebview.cpp:
+
+2009-01-30 Geoffrey Garen <ggaren@apple.com>
Build fix.
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::createFrame):
+2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22056
+
+ Kill FrameLoaderClient.cpp, move the code over to Frame::createView
+
+ FrameLoaderClient is supposed to be an interface, move the
+ to be shared code to Frame which is a controller and is
+ allowed to create a FrameView.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
+
2009-01-27 Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein
@@ -157,29 +1001,29 @@
Reviewed by Darin Adler.
[GTK] Fix the reference counting of WebKitWebFrames
-
+
The ownership is the following: WebKitWebView owns a WebCore::Page.
WebKitWebView is creating one WebKitWebFrame which will be the
mainFrame of the WebCore::Page (having the reference on the Frame).
-
+
The FrameLoaderClient has the reference of the WebKitWebFrame for
the main frame and also any other frame. This means when the
WebCore::Frame goes away the FrameLoaderClient will go away which
will normally remove the last reference of the WebKitWebFrame. Because
an API user might have g_object_ref'ed the WebKitWebFrame null
checks had to be added to WebKitWebFrame.
-
+
For WebCore::Frames created by the FrameLoaderClient the ownership
will be passed down to the FrameTree, the WebKitWebFrame is not holding
a reference to the WebCore::Frame.
-
+
Do not g_object_unref the mainFrame in the destructor of the
WebKitWebFrame as this will happen from within the WebCore::Page
destruction. Do not hold a reference to the WebCore::Frame (circle) in
WebKitWebFrame, add null checks as the WebCore::Frame might have gone
away. Do not keep track of the FrameLoaderClient in the private
structures as it was mostly unusued.
-
+
https://bugs.webkit.org/show_bug.cgi?id=21837
* WebCoreSupport/FrameLoaderClientGtk.cpp:
@@ -415,7 +1259,7 @@
Renderer::caretRect() is now localCaretRect(), which needs
converting to absolute coordinates (taking transforms into account).
-
+
* webkit/webkitwebview.cpp:
2008-12-01 Xan Lopez <xan@gnome.org>
@@ -930,7 +1774,7 @@
2008-10-06 David Hyatt <hyatt@apple.com>
Enable viewless Mac WebKit to paint some basic pages.
-
+
Reviewed by Sam Weinig
* WebCoreSupport/FrameLoaderClientGtk.cpp:
@@ -946,11 +1790,11 @@
2008-10-03 David Hyatt <hyatt@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=21340
-
+
Remove "containingWindow()/setContainingWindow()" from Widget. HostWindow covers this now.
Reviewed by Dan Bernstein & Darin Adler
-
+
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
@@ -970,7 +1814,7 @@
2008-10-03 David Hyatt <hyatt@apple.com>
Remove addToDirtyRegion.
-
+
Reviewed by Oliver Hunt
* WebCoreSupport/ChromeClientGtk.cpp:
@@ -978,7 +1822,7 @@
2008-10-02 David Hyatt <hyatt@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=21314
-
+
Make scrollBackingStore cross-platform.
Reviewed by Sam Weinig
@@ -991,9 +1835,9 @@
2008-10-01 David Hyatt <hyatt@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=21282
-
+
Make contentsToScreen/screenToContents cross-platform. Only implemented by Mac/Win right now.
-
+
Reviewed by Adam Roben
* WebCoreSupport/ChromeClientGtk.cpp:
@@ -1004,7 +1848,7 @@
2008-09-30 Dave Hyatt <hyatt@apple.com>
http://bugs.webkit.org/show_bug.cgi?id=21250
-
+
Rename updateContents to repaintContentRectangle and make it cross-platform by always sending
repaints up through the ChromeClient.
@@ -2396,9 +3240,9 @@
http://bugs.webkit.org/show_bug.cgi?id=16802
[GTK] Missing gtk properties
-
+
Add missing properties to WebKitViewFrame and WebKitWebView.
-
+
* WebView/webkitprivate.h: add some useful defines for param specs
* WebView/webkitwebframe.cpp:
(webkit_web_frame_get_property): added
@@ -2415,7 +3259,7 @@
http://bugs.webkit.org/show_bug.cgi?id=16654
[GTK] Signal "navigation-requested" does not react correctly on
return TRUE from callbacks
-
+
* WebView/webkitwebview.cpp: use our own accumulator for signals
returning WebKitNavigationResponse. The emission will be stopped
when any callback returns anything but
@@ -2587,7 +3431,7 @@
* WebView/webkitwebview.cpp:
* WebView/webkitwebview.h:
-2007-12-19 Christian Dywan <christian@twotoasts.de>
+2007-12-19 Christian Dywan <christian@twotoasts.de>
Reviewed by Alp Toker.
@@ -2602,7 +3446,7 @@
Reviewed by Holger Freyther.
Delete when Destroy functions are called to avoid leaks
-
+
This matches the Mac port.
* WebCoreSupport/ChromeClientGtk.cpp:
@@ -2849,7 +3693,7 @@
* WebView/webkitprivate.h:
(getFrameFromView): removed
-
+
* WebView/webkitwebview.cpp:
(webkit_web_view_expose_event):
(webkit_web_view_key_press_event): use focused frame
@@ -3275,7 +4119,7 @@
http://bugs.webkit.org/show_bug.cgi?id=15745
[GTK] Arrow keys do not Scroll
-
+
* Api/webkitgtkpage.cpp:
Support Up/Down/Right/Left keys to scroll. Slight hack, see FIXME for
@@ -3848,12 +4692,12 @@
2007-09-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler, Maciej Stachowiak, Mark Rowe, Tim Hatcher.
-
- Fixed <rdar://problem/5326009> Make non-browser WebKit clients have no
+
+ Fixed <rdar://problem/5326009> Make non-browser WebKit clients have no
memory cache, or a very tiny one
-
+
Keep the GTK build working with an empty stub.
-
+
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::didPerformFirstNavigation):
* WebCoreSupport/FrameLoaderClientGtk.h:
@@ -3863,7 +4707,7 @@
Reviewed by Sam.
<rdar://problem/5344848> IME is incorrectly used for key events when on non-editable regions
-
+
EditorClient::setInputMethodState stub
* WebCoreSupport/EditorClientGtk.cpp:
@@ -3879,7 +4723,7 @@
2007-08-17 Anders Carlsson <andersca@apple.com>
Build fix.
-
+
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::createPlugin):
* WebCoreSupport/FrameLoaderClientGtk.h:
@@ -3931,7 +4775,7 @@
Minor changes to the WebKit::EditorClient to allow removing
of text from TextFields. Remove the selectWordBeforeMenuEvent method
- which is not used and not within WebCore::EditorClient.
+ which is not used and not within WebCore::EditorClient.
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::shouldDeleteRange):
@@ -3949,7 +4793,7 @@
classes into the WebKit namespace. Change the class names to not contain Gtk.
The file names have to contain the Gtk suffix to not clash with files in WebCore (e.g.
bridge/EditorClient.h).
-
+
* Api/webkitgtkframe.cpp:
* Api/webkitgtkpage.cpp:
@@ -4424,7 +5268,7 @@
GtkAdjustment of the GtkLayout and reimplement the set_scroll_adjustments method and pass
the GtkAdjustments to ScrollView.
This makes having one GdkWindow for the complete FrameTree possible.
-
+
* gtk/Api/webkitgtkframe.cpp:
* gtk/Api/webkitgtkpage.cpp:
@@ -4515,7 +5359,7 @@
* gtk/Api/webkitgtkpage.cpp: Implement webkit_gtk_page_can_go_backward() and
webkit_gtk_page_can_go_forward() functions.
-2007-07-30 Diego Escalante Urrelo <diegoe@gnome.org>
+2007-07-30 Diego Escalante Urrelo <diegoe@gnome.org>
Reviewed by Alp Toker.
diff --git a/WebKit/gtk/NEWS b/WebKit/gtk/NEWS
new file mode 100644
index 0000000..c8f656c
--- /dev/null
+++ b/WebKit/gtk/NEWS
@@ -0,0 +1,54 @@
+================
+WebKitGTK+ 1.1.2
+================
+
+What's new in WebKitGTK+ 1.1.2?
+
+ - Added support for downloads: a new signal, 'download-requested',
+ will be emitted by WebKit when a dowload is requested. On top of
+ that, the download process has been encapsulated in a new object,
+ WebKitDownload, which allows the user to control it or to start
+ new downloads from the client side.
+ - Added webkit_web_view_get_encoding to get the automatic encoding
+ of the current page.
+ - Added GObject properties for 'encoding' and 'custom-encoding'.
+ - Added 'javascript-profiling-enabled' property to the WebInspector,
+ which allows to enable and disable the profiling functionality.
+ - Added API to create and add history items to WebKit's history.
+ - Improved debugging support with WEBKIT_DEBUG environment
+ variable. Most of the settings will only give useful output for
+ debug builds, but WEBKIT_DEBUG=Network will log all HTTP traffic
+ form libsoup to console. See WebCore/platform/gtk/LoggingGtk.cpp
+ for all the options available.
+ - Lots of bugfixes.
+
+================
+WebKitGTK+ 1.1.1
+================
+
+What's new in WebKitGTK+ 1.1.1?
+
+ - ABI compatibility with 1.0.3 was broken, so you will need to
+ recompile your application against 1.1.1
+ - Support for the CURL backend was dropped, libsoup is the only HTTP
+ backend now.
+ - webkit_get_default_session, to get the SoupSession used internally
+ by WebKit.
+ - 'create-web-view' signal, emitted when the creation of a new
+ window is requested.
+ - 'navigation-policy-decision-requested' signal, emitted when a
+ navigation to another page is requested.
+ - 'mime-type-policy-decision-requested' signal, emitted each time
+ WebKit is about to show a URI with a given MIME type.
+ - Support for the Web Inspector
+ (see http://webkit.org/blog/197/web-inspector-redesign/)
+ - HTTP authentication support, with optional gnome-keyring storage.
+ - New load functions: webkit_web_view_open, webkit_web_view_load_uri
+ and webkit_web_view_load_request. The old
+ webkit_web_view_load_string and webkit_web_view_load_html_string
+ are now deprecated.
+ - webkit_web_view_reload_bypass_cache
+ - webkit_web_view_{get,set}_custom_encoding, to override the
+ encoding of the current page.
+ - Improved stability and lots of bugfixes.
+
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 3557a3f..85f704a 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -358,6 +358,20 @@ void ChromeClient::contentsSizeChanged(Frame*, const IntSize&) const
void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags)
{
+ // If a tooltip must be displayed it will be, afterwards, when
+ // setToolTip is called; this is just a work-around to make sure
+ // it updates its location correctly; see
+ // https://bugs.webkit.org/show_bug.cgi?id=15793.
+ g_object_set(m_webView, "has-tooltip", FALSE, NULL);
+
+ GdkDisplay* gdkDisplay;
+ GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
+ if (GTK_WIDGET_TOPLEVEL(window))
+ gdkDisplay = gtk_widget_get_display(window);
+ else
+ gdkDisplay = gdk_display_get_default();
+ gtk_tooltip_trigger_tooltip_query(gdkDisplay);
+
// check if the element is a link...
bool isLink = hit.isLiveLink();
if (isLink) {
diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
index 490370c..42d4813 100644
--- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +21,7 @@
#include "ContextMenu.h"
#include "ContextMenuClientGtk.h"
+#include "CString.h"
#include "HitTestResult.h"
#include "KURL.h"
#include "NotImplemented.h"
@@ -163,7 +165,20 @@ void ContextMenuClient::contextMenuItemSelected(ContextMenuItem*, const ContextM
void ContextMenuClient::downloadURL(const KURL& url)
{
- notImplemented();
+ WebKitNetworkRequest* network_request = webkit_network_request_new(url.string().utf8().data());
+ WebKitDownload* download = webkit_download_new(network_request);
+ g_object_unref(network_request);
+
+ gboolean handled;
+ g_signal_emit_by_name(m_webView, "download-requested", download, &handled);
+
+ if (!handled) {
+ webkit_download_cancel(download);
+ g_object_unref(download);
+ return;
+ }
+
+ webkit_download_start(download);
}
void ContextMenuClient::copyImageToClipboard(const HitTestResult&)
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index e09178e..a1f2509 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -169,7 +169,7 @@ static void clipboard_get_contents_cb(GtkClipboard* clipboard, GtkSelectionData*
{
WebKitWebView* webView = reinterpret_cast<WebKitWebView*>(data);
Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
- PassRefPtr<Range> selectedRange = frame->selection()->toRange();
+ PassRefPtr<Range> selectedRange = frame->selection()->toNormalizedRange();
if (static_cast<gint>(info) == WEBKIT_WEB_VIEW_TARGET_INFO_HTML) {
String markup = createMarkup(selectedRange.get(), 0, AnnotateForInterchange);
@@ -457,8 +457,11 @@ void EditorClient::handleKeyboardEvent(KeyboardEvent* event)
void EditorClient::handleInputMethodKeydown(KeyboardEvent* event)
{
- WebKitWebViewPrivate* priv = m_webView->priv;
+ Frame* targetFrame = core(m_webView)->focusController()->focusedOrMainFrame();
+ if (!targetFrame || !targetFrame->editor()->canEdit())
+ return;
+ WebKitWebViewPrivate* priv = m_webView->priv;
// TODO: Dispatch IE-compatible text input events for IM events.
if (gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey()))
event->setDefaultHandled();
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 55d5024..a54aecc 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -3,6 +3,7 @@
* Copyright (C) 2007, 2008 Holger Hans Peter Freyther
* Copyright (C) 2007 Christian Dywan <christian@twotoasts.de>
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -28,10 +29,12 @@
#include "FrameLoader.h"
#include "FrameView.h"
#include "FrameTree.h"
+#include "HTMLAppletElement.h"
#include "HTMLFormElement.h"
#include "HTMLFrameElement.h"
#include "HTMLFrameOwnerElement.h"
#include "HTMLNames.h"
+#include "HTMLPlugInElement.h"
#include "JSDOMWindow.h"
#include "Language.h"
#include "MIMETypeRegistry.h"
@@ -40,6 +43,7 @@
#include "PlatformString.h"
#include "PluginDatabase.h"
#include "RenderPart.h"
+#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "CString.h"
#include "ProgressTracker.h"
@@ -245,8 +249,12 @@ void FrameLoaderClient::postProgressEstimateChangedNotification()
void FrameLoaderClient::postProgressFinishedNotification()
{
WebKitWebView* webView = getViewFromFrame(m_frame);
+ WebKitWebViewPrivate* privateData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
- g_signal_emit_by_name(webView, "load-finished", m_frame);
+ // We can get a stopLoad() from dispose when the object is being
+ // destroyed, don't emit the signal in that case.
+ if (!privateData->disposing)
+ g_signal_emit_by_name(webView, "load-finished", m_frame);
}
void FrameLoaderClient::frameLoaderDestroyed()
@@ -268,6 +276,11 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli
if (!policyFunction)
return;
+ if (resourceRequest.isNull()) {
+ (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+ return;
+ }
+
WebKitWebView* page = getViewFromFrame(m_frame);
WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data());
@@ -287,7 +300,40 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli
if (canShowMIMEType(mimeType))
webkit_web_policy_decision_use (policyDecision);
else
- webkit_web_policy_decision_download (policyDecision);
+ webkit_web_policy_decision_ignore (policyDecision);
+}
+
+static WebKitWebNavigationAction* getNavigationAction(const NavigationAction& action)
+{
+ gint button = -1;
+
+ const Event* event = action.event();
+ if (event && event->isMouseEvent()) {
+ const MouseEvent* mouseEvent = static_cast<const MouseEvent*>(event);
+ // DOM button values are 0, 1 and 2 for left, middle and right buttons.
+ // GTK+ uses 1, 2 and 3, so let's add 1 to remain consistent.
+ button = mouseEvent->button() + 1;
+ }
+
+ gint modifierFlags = 0;
+ UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(event));
+ if (keyStateEvent) {
+ if (keyStateEvent->shiftKey())
+ modifierFlags |= GDK_SHIFT_MASK;
+ if (keyStateEvent->ctrlKey())
+ modifierFlags |= GDK_CONTROL_MASK;
+ if (keyStateEvent->altKey())
+ modifierFlags |= GDK_MOD1_MASK;
+ if (keyStateEvent->metaKey())
+ modifierFlags |= GDK_MOD2_MASK;
+ }
+
+ return WEBKIT_WEB_NAVIGATION_ACTION(g_object_new(WEBKIT_TYPE_WEB_NAVIGATION_ACTION,
+ "reason", kit(action.type()),
+ "original-uri", action.url().string().utf8().data(),
+ "button", button,
+ "modifier-state", modifierFlags,
+ NULL));
}
void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>, const String& s)
@@ -295,9 +341,32 @@ void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFuncti
ASSERT(policyFunction);
if (!policyFunction)
return;
+
+ if (resourceRequest.isNull()) {
+ (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+ return;
+ }
+
+ WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction);
+
+ if (m_policyDecision)
+ g_object_unref(m_policyDecision);
+ m_policyDecision = policyDecision;
+
+ WebKitWebView* webView = getViewFromFrame(m_frame);
+ WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data());
+ WebKitWebNavigationAction* navigationAction = getNavigationAction(action);
+ gboolean isHandled = false;
+
+ g_signal_emit_by_name(webView, "new-window-policy-decision-requested", m_frame, request, navigationAction, policyDecision, &isHandled);
+
+ g_object_unref(navigationAction);
+ g_object_unref(request);
+
// FIXME: I think Qt version marshals this to another thread so when we
// have multi-threaded download, we might need to do the same
- (core(m_frame)->loader()->*policyFunction)(PolicyUse);
+ if (!isHandled)
+ (core(m_frame)->loader()->*policyFunction)(PolicyUse);
}
void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction policyFunction, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>)
@@ -306,6 +375,11 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct
if (!policyFunction)
return;
+ if (resourceRequest.isNull()) {
+ (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+ return;
+ }
+
WebKitWebView* webView = getViewFromFrame(m_frame);
WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data());
WebKitNavigationResponse response;
@@ -329,36 +403,7 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct
g_object_unref(m_policyDecision);
m_policyDecision = policyDecision;
- gint button = -1;
- gint modifierFlags = 0;
-
- const Event* event = action.event();
- if (event && event->isMouseEvent()) {
- const MouseEvent* mouseEvent = static_cast<const MouseEvent*>(event);
- // DOM button values are 0, 1 and 2 for left, middle and right buttons.
- // GTK+ uses 1, 2 and 3, so let's add 1 to remain consistent.
- button = mouseEvent->button() + 1;
- }
-
- UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(event));
- if (keyStateEvent) {
- if (keyStateEvent->shiftKey())
- modifierFlags |= GDK_SHIFT_MASK;
- if (keyStateEvent->ctrlKey())
- modifierFlags |= GDK_CONTROL_MASK;
- if (keyStateEvent->altKey())
- modifierFlags |= GDK_MOD1_MASK;
- if (keyStateEvent->metaKey())
- modifierFlags |= GDK_MOD2_MASK;
- }
-
- GObject* navigationAction = G_OBJECT(g_object_new(WEBKIT_TYPE_WEB_NAVIGATION_ACTION,
- "reason", kit(action.type()),
- "original-uri", action.url().string().utf8().data(),
- "button", button,
- "modifier-state", modifierFlags,
- NULL));
-
+ WebKitWebNavigationAction* navigationAction = getNavigationAction(action);
gboolean isHandled = false;
g_signal_emit_by_name(webView, "navigation-policy-decision-requested", m_frame, request, navigationAction, policyDecision, &isHandled);
@@ -370,7 +415,7 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct
webkit_web_policy_decision_use(m_policyDecision);
}
-Widget* FrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+Widget* FrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
PluginView* pluginView = PluginView::create(core(m_frame), pluginSize, element, url, paramNames, paramValues, mimeType, loadManually);
@@ -393,7 +438,7 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
childFrame->tree()->setName(name);
childFrame->init();
- childFrame->loader()->loadURL(url, referrer, String(), FrameLoadTypeRedirectWithLockedBackForwardList, 0, 0);
+ childFrame->loader()->loadURL(url, referrer, String(), false, FrameLoadTypeRedirectWithLockedBackForwardList, 0, 0);
// The frame's onload handler may have removed it from the document.
if (!childFrame->tree()->parent())
@@ -409,7 +454,7 @@ void FrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
m_hasSentResponseToPlugin = false;
}
-Widget* FrameLoaderClient::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL,
+Widget* FrameLoaderClient::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
const Vector<String>& paramNames, const Vector<String>& paramValues)
{
notImplemented();
@@ -469,6 +514,10 @@ void FrameLoaderClient::windowObjectCleared()
// The Win port has an example of how we might do this.
}
+void FrameLoaderClient::documentElementAvailable()
+{
+}
+
void FrameLoaderClient::didPerformFirstNavigation() const
{
}
@@ -524,7 +573,9 @@ void FrameLoaderClient::makeRepresentation(DocumentLoader*)
void FrameLoaderClient::forceLayout()
{
- core(m_frame)->forceLayout(true);
+ FrameView* view = core(m_frame)->view();
+ if (view)
+ view->forceLayout(true);
}
void FrameLoaderClient::forceLayoutForNonHTML()
@@ -569,7 +620,10 @@ void FrameLoaderClient::dispatchWillPerformClientRedirect(const KURL&, double, d
void FrameLoaderClient::dispatchDidChangeLocationWithinPage()
{
- notImplemented();
+ WebKitWebFramePrivate* priv = m_frame->priv;
+ g_free(priv->uri);
+ priv->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data());
+ g_object_notify(G_OBJECT(m_frame), "uri");
}
void FrameLoaderClient::dispatchWillClose()
@@ -590,11 +644,18 @@ void FrameLoaderClient::dispatchDidStartProvisionalLoad()
void FrameLoaderClient::dispatchDidReceiveTitle(const String& title)
{
- g_signal_emit_by_name(m_frame, "title-changed", title.utf8().data());
+ WebKitWebFramePrivate* priv = m_frame->priv;
+ g_free(priv->title);
+ priv->title = g_strdup(title.utf8().data());
+
+ g_signal_emit_by_name(m_frame, "title-changed", priv->title);
+ g_object_notify(G_OBJECT(m_frame), "title");
WebKitWebView* webView = getViewFromFrame(m_frame);
- if (m_frame == webkit_web_view_get_main_frame(webView))
+ if (m_frame == webkit_web_view_get_main_frame(webView)) {
g_signal_emit_by_name(webView, "title-changed", m_frame, title.utf8().data());
+ g_object_notify(G_OBJECT(webView), "title");
+ }
}
void FrameLoaderClient::dispatchDidCommitLoad()
@@ -602,15 +663,28 @@ void FrameLoaderClient::dispatchDidCommitLoad()
/* Update the URI once first data has been received.
* This means the URI is valid and successfully identify the page that's going to be loaded.
*/
- WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame);
- g_free(frameData->uri);
- frameData->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data());
+ g_object_freeze_notify(G_OBJECT(m_frame));
+
+ WebKitWebFramePrivate* priv = m_frame->priv;
+ g_free(priv->uri);
+ priv->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data());
+ g_free(priv->title);
+ priv->title = NULL;
+ g_object_notify(G_OBJECT(m_frame), "uri");
+ g_object_notify(G_OBJECT(m_frame), "title");
g_signal_emit_by_name(m_frame, "load-committed");
WebKitWebView* webView = getViewFromFrame(m_frame);
- if (m_frame == webkit_web_view_get_main_frame(webView))
+ if (m_frame == webkit_web_view_get_main_frame(webView)) {
+ g_object_freeze_notify(G_OBJECT(webView));
+ g_object_notify(G_OBJECT(webView), "uri");
+ g_object_notify(G_OBJECT(webView), "title");
+ g_object_thaw_notify(G_OBJECT(webView));
g_signal_emit_by_name(webView, "load-committed", m_frame);
+ }
+
+ g_object_thaw_notify(G_OBJECT(m_frame));
}
void FrameLoaderClient::dispatchDidFinishDocumentLoad()
@@ -746,51 +820,57 @@ void FrameLoaderClient::dispatchDidFailLoad(const ResourceError&)
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&, const ResourceResponse&)
{
- notImplemented();
+ // FIXME: We could reuse the same handle here, but when I tried
+ // implementing that the main load would fail and stop, so I have
+ // simplified this case for now.
+ handle->cancel();
+ startDownload(request);
}
ResourceError FrameLoaderClient::cancelledError(const ResourceRequest&)
{
notImplemented();
- return ResourceError();
+ ResourceError error("", 0, "", "");
+ error.setIsCancellation(true);
+ return error;
}
ResourceError FrameLoaderClient::blockedError(const ResourceRequest&)
{
notImplemented();
- return ResourceError();
+ return ResourceError("", 0, "", "");
}
ResourceError FrameLoaderClient::cannotShowURLError(const ResourceRequest&)
{
notImplemented();
- return ResourceError();
+ return ResourceError("", 0, "", "");
}
ResourceError FrameLoaderClient::interruptForPolicyChangeError(const ResourceRequest&)
{
notImplemented();
- return ResourceError();
+ return ResourceError("", 0, "", "");
}
ResourceError FrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse&)
{
notImplemented();
- return ResourceError();
+ return ResourceError("", 0, "", "");
}
ResourceError FrameLoaderClient::fileDoesNotExistError(const ResourceResponse&)
{
notImplemented();
- return ResourceError();
+ return ResourceError("", 0, "", "");
}
ResourceError FrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse&)
{
notImplemented();
- return ResourceError();
+ return ResourceError("", 0, "", "");
}
bool FrameLoaderClient::shouldFallBack(const ResourceError&)
@@ -832,9 +912,23 @@ void FrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceErro
}
}
-void FrameLoaderClient::startDownload(const ResourceRequest&)
+void FrameLoaderClient::startDownload(const ResourceRequest& request)
{
- notImplemented();
+ WebKitNetworkRequest* networkRequest = webkit_network_request_new(request.url().string().utf8().data());
+ WebKitDownload* download = webkit_download_new(networkRequest);
+ g_object_unref(networkRequest);
+
+ WebKitWebView* view = getViewFromFrame(m_frame);
+ gboolean handled;
+ g_signal_emit_by_name(view, "download-requested", download, &handled);
+
+ if (!handled) {
+ webkit_download_cancel(download);
+ g_object_unref(download);
+ return;
+ }
+
+ webkit_download_start(download);
}
void FrameLoaderClient::updateGlobalHistory()
@@ -842,7 +936,7 @@ void FrameLoaderClient::updateGlobalHistory()
notImplemented();
}
-void FrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem()
+void FrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
notImplemented();
}
@@ -865,7 +959,7 @@ void FrameLoaderClient::transitionToCommittedForNewPage()
Frame* frame = core(m_frame);
ASSERT(frame);
- WebCore::FrameLoaderClient::transitionToCommittedForNewPage(frame, size, backgroundColor, transparent, IntSize(), false);
+ frame->createView(size, backgroundColor, transparent, IntSize(), false);
// We need to do further manipulation on the FrameView if it was the mainFrame
if (frame != frame->page()->mainFrame())
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
index 82286e8..cb4786d 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
@@ -109,11 +109,12 @@ namespace WebKit {
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const WTF::Vector<WebCore::String>&, const WTF::Vector<WebCore::String>&, const WebCore::String&, bool);
+ virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WebCore::String>&, const WTF::Vector<WebCore::String>&, const WebCore::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
- virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL& baseURL, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues);
+ virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues);
virtual WebCore::String overrideMediaType() const;
virtual void windowObjectCleared();
+ virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
virtual void registerForIconNotification(bool);
@@ -131,7 +132,7 @@ namespace WebKit {
virtual void finishedLoading(WebCore::DocumentLoader*);
virtual void updateGlobalHistory();
- virtual void updateGlobalHistoryForRedirectWithoutHistoryItem();
+ virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const;
virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&);
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index ba3721a..faa3e28 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -104,6 +104,12 @@ String InspectorClient::localizedStringsURL()
return String();
}
+String InspectorClient::hiddenPanels()
+{
+ notImplemented();
+ return String();
+}
+
void InspectorClient::showWindow()
{
if (!m_webView)
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
index 4fba55d..43894b3 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
@@ -52,6 +52,8 @@ namespace WebKit {
virtual WebCore::String localizedStringsURL();
+ virtual WebCore::String hiddenPanels();
+
virtual void showWindow();
virtual void closeWindow();
diff --git a/WebKit/gtk/tests/testwebbackforwardlist.c b/WebKit/gtk/tests/testwebbackforwardlist.c
new file mode 100644
index 0000000..8d53c3e
--- /dev/null
+++ b/WebKit/gtk/tests/testwebbackforwardlist.c
@@ -0,0 +1,288 @@
+/*
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ *
+ * 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 <glib.h>
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
+
+#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
+
+static void test_webkit_web_history_item_lifetime(void)
+{
+ WebKitWebView* webView;
+ WebKitWebBackForwardList* backForwardList;
+ WebKitWebHistoryItem* currentItem;
+ WebKitWebHistoryItem* forwardItem;
+ WebKitWebHistoryItem* backItem;
+ WebKitWebHistoryItem* nthItem;
+ WebKitWebHistoryItem* item1;
+ WebKitWebHistoryItem* item2;
+ WebKitWebHistoryItem* item3;
+ WebKitWebHistoryItem* item4;
+ GList* backList = NULL;
+ GList* forwardList = NULL;
+ g_test_bug("19898");
+
+ webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+ g_object_ref_sink(webView);
+ backForwardList = webkit_web_view_get_back_forward_list(webView);
+ g_assert_cmpint(G_OBJECT(backForwardList)->ref_count, ==, 1);
+
+ /* add test items */
+ item1 = webkit_web_history_item_new_with_data("http://example.com/1/", "Site 1");
+ webkit_web_back_forward_list_add_item(backForwardList, item1);
+
+ item2 = webkit_web_history_item_new_with_data("http://example.com/2/", "Site 2");
+ webkit_web_back_forward_list_add_item(backForwardList, item2);
+
+ item3 = webkit_web_history_item_new_with_data("http://example.com/3/", "Site 3");
+ webkit_web_back_forward_list_add_item(backForwardList, item3);
+
+ item4 = webkit_web_history_item_new_with_data("http://example.com/4/", "Site 4");
+ webkit_web_back_forward_list_add_item(backForwardList, item4);
+
+ /* make sure these functions don't add unnecessary ref to the history item */
+ backItem = webkit_web_back_forward_list_get_back_item(backForwardList);
+ g_object_ref(backItem);
+ g_assert_cmpint(G_OBJECT(backItem)->ref_count, ==, 2);
+ g_object_unref(backItem);
+ g_assert_cmpint(G_OBJECT(backItem)->ref_count, ==, 1);
+
+ currentItem = webkit_web_back_forward_list_get_current_item(backForwardList);
+ g_object_ref(currentItem);
+ g_assert_cmpint(G_OBJECT(currentItem)->ref_count, ==, 2);
+ g_object_unref(currentItem);
+ g_assert_cmpint(G_OBJECT(currentItem)->ref_count, ==, 1);
+
+ webkit_web_back_forward_list_go_to_item(backForwardList, item2);
+ forwardItem = webkit_web_back_forward_list_get_forward_item(backForwardList);
+ g_object_ref(forwardItem);
+ g_assert_cmpint(G_OBJECT(forwardItem)->ref_count, ==, 2);
+ g_object_unref(forwardItem);
+ g_assert_cmpint(G_OBJECT(forwardItem)->ref_count, ==, 1);
+
+ nthItem = webkit_web_back_forward_list_get_nth_item(backForwardList, 1);
+ g_object_ref(nthItem);
+ g_assert_cmpint(G_OBJECT(nthItem)->ref_count, ==, 2);
+ g_object_unref(nthItem);
+ g_assert_cmpint(G_OBJECT(nthItem)->ref_count, ==, 1);
+
+ backList = webkit_web_back_forward_list_get_back_list_with_limit(backForwardList, 5);
+ for (; backList; backList = backList->next)
+ g_assert_cmpint(G_OBJECT(backList->data)->ref_count, ==, 1);
+
+ forwardList = webkit_web_back_forward_list_get_forward_list_with_limit(backForwardList, 5);
+ for (; forwardList; forwardList = forwardList->next)
+ g_assert_cmpint(G_OBJECT(forwardList->data)->ref_count, ==, 1);
+
+ g_list_free(forwardList);
+ g_list_free(backList);
+ g_object_unref(item1);
+ g_object_unref(item2);
+ g_object_unref(item3);
+ g_object_unref(item4);
+
+ g_object_ref(backForwardList);
+ g_object_unref(webView);
+
+ g_assert_cmpint(G_OBJECT(backForwardList)->ref_count, ==, 1);
+ g_object_unref(backForwardList);
+}
+
+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(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;
+ WebKitWebBackForwardList* webBackForwardList;
+ WebKitWebHistoryItem* addItem1;
+ WebKitWebHistoryItem* addItem2;
+ WebKitWebHistoryItem* backItem;
+ WebKitWebHistoryItem* currentItem;
+ g_test_bug("22988");
+
+ 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 item
+ addItem1 = webkit_web_history_item_new_with_data("http://example.com/", "Added site");
+ webkit_web_back_forward_list_add_item(webBackForwardList, addItem1);
+ g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, addItem1));
+
+ // Check that the added item is the current item.
+ currentItem = webkit_web_back_forward_list_get_current_item(webBackForwardList);
+ g_assert(currentItem);
+ 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));
+ g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/");
+ g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Added site");
+
+ // Add another item.
+ addItem2 = webkit_web_history_item_new_with_data("http://example.com/2/", "Added site 2");
+ webkit_web_back_forward_list_add_item(webBackForwardList, addItem2);
+ g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, addItem2));
+ g_object_unref(addItem2);
+
+ // Check that the added item is new current item.
+ currentItem = webkit_web_back_forward_list_get_current_item(webBackForwardList);
+ g_assert(currentItem);
+ 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), ==, 1);
+ g_assert(!webkit_web_view_can_go_forward(webView));
+ g_assert(webkit_web_view_can_go_back(webView));
+ g_assert_cmpstr(webkit_web_history_item_get_uri(currentItem), ==, "http://example.com/2/");
+ g_assert_cmpstr(webkit_web_history_item_get_title(currentItem), ==, "Added site 2");
+
+ backItem = webkit_web_back_forward_list_get_back_item(webBackForwardList);
+ g_assert(backItem);
+ g_assert_cmpstr(webkit_web_history_item_get_uri(backItem), ==, "http://example.com/");
+ g_assert_cmpstr(webkit_web_history_item_get_title(backItem), ==, "Added site");
+
+ // Go to the first added item.
+ g_assert(webkit_web_view_go_to_back_forward_item(webView, addItem1));
+ g_assert_cmpint(webkit_web_back_forward_list_get_forward_length(webBackForwardList), ==, 1);
+ 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));
+
+ g_object_unref(addItem1);
+ g_object_unref(webView);
+}
+
+int main(int argc, char** argv)
+{
+ g_thread_init(NULL);
+ gtk_test_init(&argc, &argv, NULL);
+
+ g_test_bug_base("https://bugs.webkit.org/");
+ 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);
+ g_test_add_func("/webkit/webhistoryitem/lifetime", test_webkit_web_history_item_lifetime);
+ return g_test_run ();
+}
+
+#else
+int main(int argc, char** argv)
+{
+ g_critical("You will need at least glib-2.16.0 and gtk-2.14.0 to run the unit tests. Doing nothing now.");
+ return 0;
+}
+
+#endif
diff --git a/WebKit/gtk/tests/main.c b/WebKit/gtk/tests/testwebframe.c
index 68f6d70..e2da29c 100644
--- a/WebKit/gtk/tests/main.c
+++ b/WebKit/gtk/tests/testwebframe.c
@@ -70,7 +70,6 @@ int main(int argc, char** argv)
g_test_bug_base("https://bugs.webkit.org/");
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);
-
return g_test_run ();
}
diff --git a/WebKit/gtk/tests/testwebhistoryitem.c b/WebKit/gtk/tests/testwebhistoryitem.c
new file mode 100644
index 0000000..6038c647
--- /dev/null
+++ b/WebKit/gtk/tests/testwebhistoryitem.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2009 Jan Michael Alonzo
+ *
+ * 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 <glib.h>
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
+
+#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
+
+typedef struct {
+ WebKitWebHistoryItem* item;
+} WebHistoryItemFixture;
+
+static void web_history_item_fixture_setup(WebHistoryItemFixture* fixture,
+ gconstpointer data)
+{
+ fixture->item = webkit_web_history_item_new_with_data("http://example.com/", "Example1");
+ g_assert_cmpint(G_OBJECT(fixture->item)->ref_count, == , 2);
+ g_assert(fixture->item != NULL);
+}
+
+static void web_history_item_fixture_teardown(WebHistoryItemFixture* fixture,
+ gconstpointer data)
+{
+ g_assert(fixture->item != NULL);
+ g_assert_cmpint(G_OBJECT(fixture->item)->ref_count, ==, 2);
+ g_object_unref(fixture->item);
+ g_assert_cmpint(G_OBJECT(fixture->item)->ref_count, ==, 1);
+}
+
+static void test_webkit_web_history_item_get_data(WebHistoryItemFixture* fixture,
+ gconstpointer data)
+{
+ g_assert_cmpstr(webkit_web_history_item_get_title(fixture->item), ==, "Example1");
+ g_assert_cmpstr(webkit_web_history_item_get_uri(fixture->item), ==, "http://example.com/");
+}
+
+static void test_webkit_web_history_item_alternate_title(WebHistoryItemFixture* fixture,
+ gconstpointer data)
+{
+ webkit_web_history_item_set_alternate_title(fixture->item, "Alternate title");
+ g_assert_cmpstr(webkit_web_history_item_get_alternate_title(fixture->item), ==, "Alternate title");
+}
+
+int main(int argc, char** argv)
+{
+ g_thread_init(NULL);
+ gtk_test_init(&argc, &argv, NULL);
+
+ g_test_bug_base("https://bugs.webkit.org/");
+ g_test_add("/webkit/webhistoryitem/get_data",
+ WebHistoryItemFixture, 0, web_history_item_fixture_setup,
+ test_webkit_web_history_item_get_data, web_history_item_fixture_teardown);
+ g_test_add("/webkit/webhistoryitem/alternate_title",
+ WebHistoryItemFixture, 0, web_history_item_fixture_setup,
+ test_webkit_web_history_item_alternate_title, web_history_item_fixture_teardown);
+ return g_test_run ();
+}
+
+#else
+int main(int argc, char** argv)
+{
+ g_critical("You will need at least glib-2.16.0 and gtk-2.14.0 to run the unit tests. Doing nothing now.");
+ return 0;
+}
+
+#endif
diff --git a/WebKit/gtk/webkit.pc.in b/WebKit/gtk/webkit.pc.in
index 0ce6f71..84d6115 100644
--- a/WebKit/gtk/webkit.pc.in
+++ b/WebKit/gtk/webkit.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
Name: WebKit
Description: Web content engine for GTK+
Version: @VERSION@
-Requires: gtk+-2.0
+Requires: gtk+-2.0 libsoup-2.4
Libs: -L${libdir} -lwebkit-1.0
Cflags: -I${includedir}/webkit-1.0
diff --git a/WebKit/gtk/webkit/webkit.h b/WebKit/gtk/webkit/webkit.h
index 8c868a2..c22165e 100644
--- a/WebKit/gtk/webkit/webkit.h
+++ b/WebKit/gtk/webkit/webkit.h
@@ -23,7 +23,9 @@
#include <webkit/webkitversion.h>
#include <webkit/webkitdefines.h>
+#include <webkit/webkitdownload.h>
#include <webkit/webkitnetworkrequest.h>
+#include <webkit/webkitsoupauthdialog.h>
#include <webkit/webkitwebframe.h>
#include <webkit/webkitwebsettings.h>
#include <webkit/webkitwebinspector.h>
diff --git a/WebKit/gtk/webkit/webkitdefines.h b/WebKit/gtk/webkit/webkitdefines.h
index f94e710..b0ab5e9 100644
--- a/WebKit/gtk/webkit/webkitdefines.h
+++ b/WebKit/gtk/webkit/webkitdefines.h
@@ -68,6 +68,9 @@ typedef struct _WebKitWebWindowFeaturesClass WebKitWebWindowFeaturesClass;
typedef struct _WebKitWebView WebKitWebView;
typedef struct _WebKitWebViewClass WebKitWebViewClass;
+typedef struct _WebKitDownload WebKitDownload;
+typedef struct _WebKitDownloadClass WebKitDownloadClass;
+
G_END_DECLS
#endif
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp
new file mode 100644
index 0000000..4488304
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -0,0 +1,818 @@
+/*
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
+ *
+ * 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 "ResourceHandleClient.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include "webkitdownload.h"
+#include "webkitenumtypes.h"
+#include "webkitmarshal.h"
+#include "webkitprivate.h"
+
+#include <glib/gstdio.h>
+
+using namespace WebKit;
+using namespace WebCore;
+
+class DownloadClient : Noncopyable, public ResourceHandleClient {
+ public:
+ DownloadClient(WebKitDownload*);
+
+ 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:
+ WebKitDownload* m_download;
+};
+
+extern "C" {
+
+#define WEBKIT_DOWNLOAD_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_DOWNLOAD, WebKitDownloadPrivate))
+
+struct _WebKitDownloadPrivate {
+ gchar* destinationURI;
+ gchar* suggestedFilename;
+ guint currentSize;
+ GTimer* timer;
+ WebKitDownloadStatus status;
+ GFileOutputStream* outputStream;
+ DownloadClient* downloadClient;
+ WebKitNetworkRequest* networkRequest;
+ ResourceResponse* networkResponse;
+ RefPtr<ResourceHandle> resourceHandle;
+};
+
+enum {
+ // Normal signals.
+ ERROR,
+ LAST_SIGNAL
+};
+
+static guint webkit_download_signals[LAST_SIGNAL] = { 0 };
+
+enum {
+ PROP_0,
+
+ PROP_NETWORK_REQUEST,
+ PROP_DESTINATION_URI,
+ PROP_SUGGESTED_FILENAME,
+ PROP_PROGRESS,
+ PROP_STATUS,
+ PROP_CURRENT_SIZE,
+ PROP_TOTAL_SIZE
+};
+
+G_DEFINE_TYPE(WebKitDownload, webkit_download, G_TYPE_OBJECT);
+
+
+static void webkit_download_set_status(WebKitDownload* download, WebKitDownloadStatus status);
+
+static void webkit_download_dispose(GObject* object)
+{
+ WebKitDownload* download = WEBKIT_DOWNLOAD(object);
+ WebKitDownloadPrivate* priv = download->priv;
+
+ if (priv->outputStream) {
+ g_object_unref(priv->outputStream);
+ priv->outputStream = NULL;
+ }
+
+ if (priv->networkRequest) {
+ g_object_unref(priv->networkRequest);
+ priv->networkRequest = NULL;
+ }
+
+ G_OBJECT_CLASS(webkit_download_parent_class)->dispose(object);
+}
+
+static void webkit_download_finalize(GObject* object)
+{
+ WebKitDownload* download = WEBKIT_DOWNLOAD(object);
+ WebKitDownloadPrivate* priv = download->priv;
+
+ // We don't call webkit_download_cancel() because we don't want to emit
+ // signals when finalizing an object.
+ if (priv->resourceHandle) {
+ if (priv->status == WEBKIT_DOWNLOAD_STATUS_STARTED) {
+ priv->resourceHandle->setClient(0);
+ priv->resourceHandle->cancel();
+ }
+ priv->resourceHandle.release();
+ }
+
+ delete priv->downloadClient;
+ delete priv->networkResponse;
+
+ // The download object may never have _start called on it, so we
+ // need to make sure timer is non-NULL.
+ if (priv->timer)
+ g_timer_destroy(priv->timer);
+
+ g_free(priv->destinationURI);
+ g_free(priv->suggestedFilename);
+
+ G_OBJECT_CLASS(webkit_download_parent_class)->finalize(object);
+}
+
+static void webkit_download_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+ WebKitDownload* download = WEBKIT_DOWNLOAD(object);
+
+ switch(prop_id) {
+ case PROP_NETWORK_REQUEST:
+ g_value_set_object(value, webkit_download_get_network_request(download));
+ break;
+ case PROP_DESTINATION_URI:
+ g_value_set_string(value, webkit_download_get_destination_uri(download));
+ break;
+ case PROP_SUGGESTED_FILENAME:
+ g_value_set_string(value, webkit_download_get_suggested_filename(download));
+ break;
+ case PROP_PROGRESS:
+ g_value_set_double(value, webkit_download_get_progress(download));
+ break;
+ case PROP_STATUS:
+ g_value_set_enum(value, webkit_download_get_status(download));
+ break;
+ case PROP_CURRENT_SIZE:
+ g_value_set_uint64(value, webkit_download_get_current_size(download));
+ break;
+ case PROP_TOTAL_SIZE:
+ g_value_set_uint64(value, webkit_download_get_total_size(download));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ }
+}
+
+static void webkit_download_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec *pspec)
+{
+ WebKitDownload* download = WEBKIT_DOWNLOAD(object);
+ WebKitDownloadPrivate* priv = download->priv;
+
+ switch(prop_id) {
+ case PROP_NETWORK_REQUEST:
+ priv->networkRequest = WEBKIT_NETWORK_REQUEST(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_DESTINATION_URI:
+ webkit_download_set_destination_uri(download, g_value_get_string(value));
+ break;
+ case PROP_STATUS:
+ webkit_download_set_status(download, static_cast<WebKitDownloadStatus>(g_value_get_enum(value)));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ }
+}
+
+static void webkit_download_class_init(WebKitDownloadClass* downloadClass)
+{
+ GObjectClass* objectClass = G_OBJECT_CLASS(downloadClass);
+ objectClass->dispose = webkit_download_dispose;
+ objectClass->finalize = webkit_download_finalize;
+ objectClass->get_property = webkit_download_get_property;
+ objectClass->set_property = webkit_download_set_property;
+
+ /**
+ * WebKitDownload::error:
+ * @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 an error in the download.
+ *
+ * Since: 1.1.2
+ */
+ webkit_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.
+
+ /**
+ * WebKitDownload:network-request
+ *
+ * The #WebKitNetworkRequest instance associated with the download.
+ *
+ * Since: 1.1.2
+ */
+ 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)));
+
+ /**
+ * WebKitDownload:destination-uri
+ *
+ * The URI of the save location for this download.
+ *
+ * Since: 1.1.2
+ */
+ g_object_class_install_property(objectClass,
+ PROP_DESTINATION_URI,
+ g_param_spec_string("destination-uri",
+ "Destination URI",
+ "The destination URI where to save the file",
+ "",
+ WEBKIT_PARAM_READWRITE));
+
+ /**
+ * WebKitDownload:suggested-filename
+ *
+ * The file name suggested as default when saving
+ *
+ * Since: 1.1.2
+ */
+ 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_READABLE));
+
+ /**
+ * WebKitDownload:progress:
+ *
+ * Determines the current progress of the download.
+ *
+ * Since: 1.1.2
+ */
+ g_object_class_install_property(objectClass, PROP_PROGRESS,
+ g_param_spec_double("progress",
+ "Progress",
+ "Determines the current progress of the download",
+ 0.0, 1.0, 1.0,
+ WEBKIT_PARAM_READABLE));
+
+ /**
+ * WebKitDownload:status:
+ *
+ * Determines the current status of the download.
+ *
+ * Since: 1.1.2
+ */
+ g_object_class_install_property(objectClass, PROP_STATUS,
+ g_param_spec_enum("status",
+ "Status",
+ "Determines the current status of the download",
+ WEBKIT_TYPE_DOWNLOAD_STATUS,
+ WEBKIT_DOWNLOAD_STATUS_CREATED,
+ WEBKIT_PARAM_READABLE));
+
+ /**
+ * WebKitDownload:current-size
+ *
+ * The length of the data already downloaded
+ *
+ * Since: 1.1.2
+ */
+ 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));
+
+ /**
+ * WebKitDownload:total-size
+ *
+ * The total size of the file
+ *
+ * Since: 1.1.2
+ */
+ 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(WebKitDownloadPrivate));
+}
+
+static void webkit_download_init(WebKitDownload* download)
+{
+ WebKitDownloadPrivate* priv = WEBKIT_DOWNLOAD_GET_PRIVATE(download);
+ download->priv = priv;
+
+ priv->downloadClient = new DownloadClient(download);
+ priv->currentSize = 0;
+ priv->status = WEBKIT_DOWNLOAD_STATUS_CREATED;
+}
+
+/**
+ * webkit_download_new:
+ * @request: a #WebKitNetworkRequest
+ *
+ * Creates a new #WebKitDownload object for the given
+ * #WebKitNetworkRequest object.
+ *
+ * Returns: the new #WebKitDownload
+ *
+ * Since: 1.1.2
+ */
+WebKitDownload* webkit_download_new(WebKitNetworkRequest* request)
+{
+ g_return_val_if_fail(request, NULL);
+
+ return WEBKIT_DOWNLOAD(g_object_new(WEBKIT_TYPE_DOWNLOAD, "network-request", request, NULL));
+}
+
+static gboolean webkit_download_open_stream_for_uri(WebKitDownload* download, const gchar* uri, gboolean append=FALSE)
+{
+ g_return_val_if_fail(uri, FALSE);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ GFile* file = g_file_new_for_uri(uri);
+ GError* error = NULL;
+
+ if (append)
+ priv->outputStream = g_file_append_to(file, G_FILE_CREATE_NONE, NULL, &error);
+ else
+ priv->outputStream = g_file_replace(file, NULL, TRUE, G_FILE_CREATE_NONE, NULL, &error);
+
+ g_object_unref(file);
+
+ if (error) {
+ gboolean handled;
+ g_signal_emit_by_name(download, "error", 0, WEBKIT_DOWNLOAD_ERROR_DESTINATION, error->message, &handled);
+ g_error_free(error);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void webkit_download_close_stream(WebKitDownload* download)
+{
+ WebKitDownloadPrivate* priv = download->priv;
+ if (priv->outputStream) {
+ g_object_unref(priv->outputStream);
+ priv->outputStream = NULL;
+ }
+}
+
+/**
+ * webkit_download_start:
+ * @download: the #WebKitDownload
+ *
+ * Initiates the download. Notice that you must have set the
+ * destination-uri property before calling this method.
+ *
+ * Since: 1.1.2
+ */
+void webkit_download_start(WebKitDownload* download)
+{
+ g_return_if_fail(WEBKIT_IS_DOWNLOAD(download));
+
+ WebKitDownloadPrivate* priv = download->priv;
+ g_return_if_fail(priv->destinationURI);
+ g_return_if_fail(priv->status == WEBKIT_DOWNLOAD_STATUS_CREATED);
+ g_return_if_fail(priv->timer == NULL);
+
+ if (priv->resourceHandle)
+ priv->resourceHandle->setClient(priv->downloadClient);
+ else {
+ // FIXME: Use the actual request object when WebKitNetworkRequest is finished.
+ ResourceRequest request(webkit_network_request_get_uri(priv->networkRequest));
+ priv->resourceHandle = ResourceHandle::create(request, priv->downloadClient, 0, false, false, false);
+ }
+
+ priv->timer = g_timer_new();
+ webkit_download_open_stream_for_uri(download, priv->destinationURI);
+}
+
+/**
+ * webkit_download_cancel:
+ * @download: the #WebKitDownload
+ *
+ * Cancels the download. Calling this will not free the
+ * #WebKitDownload object, so you still need to call
+ * g_object_unref() on it, if you are the owner of a reference. Notice
+ * that cancelling the download provokes the emission of the
+ * WebKitDownload::error signal, reporting that the download was
+ * cancelled.
+ *
+ * Since: 1.1.2
+ */
+void webkit_download_cancel(WebKitDownload* download)
+{
+ g_return_if_fail(WEBKIT_IS_DOWNLOAD(download));
+
+ WebKitDownloadPrivate* priv = download->priv;
+
+ // Cancel may be called even if start was not called, so we need
+ // to make sure timer is non-NULL.
+ if (priv->timer)
+ g_timer_stop(priv->timer);
+
+ if (priv->resourceHandle)
+ priv->resourceHandle->cancel();
+
+ webkit_download_set_status(download, WEBKIT_DOWNLOAD_STATUS_CANCELLED);
+
+ gboolean handled;
+ g_signal_emit_by_name(download, "error", 0, WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER, "User cancelled the download", &handled);
+}
+
+/**
+ * webkit_download_get_uri:
+ * @download: the #WebKitDownload
+ *
+ * Convenience method to retrieve the URI from the
+ * #WebKitNetworkRequest which is being downloaded.
+ *
+ * Returns: the uri
+ *
+ * Since: 1.1.2
+ */
+const gchar* webkit_download_get_uri(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), NULL);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ return webkit_network_request_get_uri(priv->networkRequest);
+}
+
+/**
+ * webkit_download_get_network_request:
+ * @download: the #WebKitDownload
+ *
+ * Retrieves the #WebKitNetworkRequest object that backs the download
+ * process.
+ *
+ * Returns: the #WebKitNetworkRequest instance
+ *
+ * Since: 1.1.2
+ */
+WebKitNetworkRequest* webkit_download_get_network_request(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), NULL);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ return priv->networkRequest;
+}
+
+static void webkit_download_set_response(WebKitDownload* download, const ResourceResponse& response)
+{
+ // FIXME Use WebKitNetworkResponse when it's merged.
+ WebKitDownloadPrivate* priv = download->priv;
+ priv->networkResponse = new ResourceResponse(response);
+}
+
+/**
+ * webkit_download_get_suggested_filename:
+ * @download: the #WebKitDownload
+ *
+ * Retrieves the filename that was suggested by the server, or the one
+ * derived by WebKit from the URI.
+ *
+ * Returns: the suggested filename
+ *
+ * Since: 1.1.2
+ */
+const gchar* webkit_download_get_suggested_filename(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), NULL);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ return priv->suggestedFilename;
+}
+
+/**
+ * webkit_download_get_destination_uri:
+ * @download: the #WebKitDownload
+ *
+ * Obtains the URI to which the downloaded file will be written. This
+ * must have been set by the application before calling
+ * webkit_download_start(), and may be %NULL.
+ *
+ * Returns: the destination URI or %NULL
+ *
+ * Since: 1.1.2
+ */
+const gchar* webkit_download_get_destination_uri(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), NULL);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ return priv->destinationURI;
+}
+
+/**
+ * webkit_download_set_destination_uri:
+ * @download: the #WebKitDownload
+ * @destination_uri: the destination URI
+ *
+ * Defines the URI that should be used to save the downloaded file to.
+ *
+ * Since: 1.1.2
+ */
+void webkit_download_set_destination_uri(WebKitDownload* download, const gchar* destination_uri)
+{
+ g_return_if_fail(WEBKIT_IS_DOWNLOAD(download));
+ g_return_if_fail(destination_uri);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ if (priv->destinationURI && !strcmp(priv->destinationURI, destination_uri))
+ return;
+
+ if (priv->status != WEBKIT_DOWNLOAD_STATUS_CREATED && priv->status != WEBKIT_DOWNLOAD_STATUS_CANCELLED) {
+ ASSERT(priv->destinationURI);
+
+ gboolean downloading = priv->outputStream != NULL;
+ if (downloading)
+ webkit_download_close_stream(download);
+
+ GFile* src = g_file_new_for_uri(priv->destinationURI);
+ GFile* dest = g_file_new_for_uri(destination_uri);
+ GError* error = NULL;
+
+ g_file_move(src, dest, G_FILE_COPY_BACKUP, NULL, NULL, NULL, &error);
+
+ g_object_unref(src);
+ g_object_unref(dest);
+
+ g_free(priv->destinationURI);
+ priv->destinationURI = g_strdup(destination_uri);
+
+ if (error) {
+ gboolean handled;
+ g_signal_emit_by_name(download, "error", 0, WEBKIT_DOWNLOAD_ERROR_DESTINATION, error->message, &handled);
+ g_error_free(error);
+ return;
+ }
+
+ if (downloading) {
+ if (!webkit_download_open_stream_for_uri(download, destination_uri, TRUE)) {
+ webkit_download_cancel(download);
+ return;
+ }
+ }
+ } else {
+ g_free(priv->destinationURI);
+ priv->destinationURI = g_strdup(destination_uri);
+ }
+
+ // Only notify change if everything went fine.
+ g_object_notify(G_OBJECT(download), "destination-uri");
+}
+
+/**
+ * webkit_download_get_status:
+ * @download: the #WebKitDownload
+ *
+ * Obtains the current status of the download, as a
+ * #WebKitDownloadStatus.
+ *
+ * Returns: the current #WebKitDownloadStatus
+ *
+ * Since: 1.1.2
+ */
+WebKitDownloadStatus webkit_download_get_status(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), WEBKIT_DOWNLOAD_STATUS_ERROR);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ return priv->status;
+}
+
+static void webkit_download_set_status(WebKitDownload* download, WebKitDownloadStatus status)
+{
+ g_return_if_fail(WEBKIT_IS_DOWNLOAD(download));
+
+ WebKitDownloadPrivate* priv = download->priv;
+ priv->status = status;
+
+ g_object_notify(G_OBJECT(download), "status");
+}
+
+/**
+ * webkit_download_get_total_size:
+ * @download: the #WebKitDownload
+ *
+ * Returns the expected total size of the download. This is expected
+ * because the server may provide incorrect or missing
+ * Content-Length. Notice that this may grow over time, as it will be
+ * always the same as current_size in the cases where current size
+ * surpasses it.
+ *
+ * Returns: the expected total size of the downloaded file
+ *
+ * Since: 1.1.2
+ */
+guint64 webkit_download_get_total_size(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), 0);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ if (!priv->networkResponse)
+ return 0;
+
+ return MAX(priv->currentSize, priv->networkResponse->expectedContentLength());
+}
+
+/**
+ * webkit_download_get_current_size:
+ * @download: the #WebKitDownload
+ *
+ * Current already downloaded size.
+ *
+ * Returns: the already downloaded size
+ *
+ * Since: 1.1.2
+ */
+guint64 webkit_download_get_current_size(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), 0);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ return priv->currentSize;
+}
+
+/**
+ * webkit_download_get_progress:
+ * @download: a #WebKitDownload
+ *
+ * Determines the current progress of the download.
+ *
+ * Returns: a #gdouble ranging from 0.0 to 1.0.
+ *
+ * Since: 1.1.2
+ */
+gdouble webkit_download_get_progress(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), 1.0);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ gdouble total_size = (gdouble)priv->networkResponse->expectedContentLength();
+
+ if (total_size == 0)
+ return 1.0;
+
+ return ((gdouble)priv->currentSize) / total_size;
+}
+
+/**
+ * webkit_download_get_elapsed_time:
+ * @download: a #WebKitDownload
+ *
+ * Elapsed time for the download in seconds, including any fractional
+ * part. If the download is finished, had an error or was cancelled
+ * this is the time between its start and the event.
+ *
+ * Returns: seconds since the download was started, as a #gdouble
+ *
+ * Since: 1.1.2
+ */
+gdouble webkit_download_get_elapsed_time(WebKitDownload* download)
+{
+ g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), 0.0);
+
+ WebKitDownloadPrivate* priv = download->priv;
+ return g_timer_elapsed(priv->timer, NULL);
+}
+
+static void webkit_download_received_data(WebKitDownload* download, const gchar* data, int length)
+{
+ WebKitDownloadPrivate* priv = download->priv;
+
+ if (priv->currentSize == 0)
+ webkit_download_set_status(download, WEBKIT_DOWNLOAD_STATUS_STARTED);
+
+ ASSERT(priv->outputStream);
+
+ gsize bytes_written;
+ GError* error = NULL;
+
+ g_output_stream_write_all(G_OUTPUT_STREAM(priv->outputStream),
+ data, length, &bytes_written, NULL, &error);
+
+ if (error) {
+ gboolean handled;
+ g_signal_emit_by_name(download, "error", 0, WEBKIT_DOWNLOAD_ERROR_DESTINATION, error->message, &handled);
+ g_error_free(error);
+ return;
+ }
+
+ 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_object_notify(G_OBJECT(download), "progress");
+}
+
+static void webkit_download_finished_loading(WebKitDownload* download)
+{
+ webkit_download_close_stream(download);
+
+ WebKitDownloadPrivate* priv = download->priv;
+
+ g_timer_stop(priv->timer);
+
+ g_object_notify(G_OBJECT(download), "progress");
+ webkit_download_set_status(download, WEBKIT_DOWNLOAD_STATUS_FINISHED);
+}
+
+static void webkit_download_error(WebKitDownload* download, const ResourceError& error)
+{
+ webkit_download_close_stream(download);
+
+ WebKitDownloadPrivate* priv = download->priv;
+
+ g_timer_stop(priv->timer);
+ webkit_download_set_status(download, WEBKIT_DOWNLOAD_STATUS_ERROR);
+
+ gboolean handled;
+ g_signal_emit_by_name(download, "error", 0, WEBKIT_DOWNLOAD_ERROR_NETWORK, error.localizedDescription().utf8().data(), &handled);
+}
+
+DownloadClient::DownloadClient(WebKitDownload* download)
+ : m_download(download)
+{
+}
+
+void DownloadClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
+{
+ webkit_download_set_response(m_download, response);
+}
+
+void DownloadClient::didReceiveData(ResourceHandle*, const char* data, int length, int lengthReceived)
+{
+ webkit_download_received_data(m_download, data, length);
+}
+
+void DownloadClient::didFinishLoading(ResourceHandle*)
+{
+ webkit_download_finished_loading(m_download);
+}
+
+void DownloadClient::didFail(ResourceHandle*, const ResourceError& error)
+{
+ webkit_download_error(m_download, error);
+}
+
+void DownloadClient::wasBlocked(ResourceHandle*)
+{
+ // FIXME: Implement this when we have the new frame loader signals
+ // and error handling.
+ notImplemented();
+}
+
+void DownloadClient::cannotShowURL(ResourceHandle*)
+{
+ // FIXME: Implement this when we have the new frame loader signals
+ // and error handling.
+ notImplemented();
+}
+
+}
diff --git a/WebKit/gtk/webkit/webkitdownload.h b/WebKit/gtk/webkit/webkitdownload.h
new file mode 100644
index 0000000..7c86c65
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitdownload.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
+ *
+ * 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_DOWNLOAD_H
+#define WEBKIT_DOWNLOAD_H
+
+#include <webkit/webkitdefines.h>
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_DOWNLOAD (webkit_download_get_type())
+#define WEBKIT_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOWNLOAD, WebKitDownload))
+#define WEBKIT_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_DOWNLOAD, WebKitDownloadClass))
+#define WEBKIT_IS_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOWNLOAD))
+#define WEBKIT_IS_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_DOWNLOAD))
+#define WEBKIT_DOWNLOAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_DOWNLOAD, WebKitDownloadClass))
+
+typedef enum {
+ WEBKIT_DOWNLOAD_STATUS_ERROR = -1,
+ WEBKIT_DOWNLOAD_STATUS_CREATED = 0,
+ WEBKIT_DOWNLOAD_STATUS_STARTED,
+ WEBKIT_DOWNLOAD_STATUS_CANCELLED,
+ WEBKIT_DOWNLOAD_STATUS_FINISHED
+} WebKitDownloadStatus;
+
+typedef enum {
+ WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER,
+ WEBKIT_DOWNLOAD_ERROR_DESTINATION,
+ WEBKIT_DOWNLOAD_ERROR_NETWORK
+} WebKitDownloadError;
+
+typedef struct _WebKitDownloadPrivate WebKitDownloadPrivate;
+
+struct _WebKitDownload {
+ GObject parent_instance;
+
+ WebKitDownloadPrivate *priv;
+};
+
+struct _WebKitDownloadClass {
+ GObjectClass parent_class;
+
+ /* Padding for future expansion */
+ void (*_webkit_reserved0) (void);
+ void (*_webkit_reserved1) (void);
+ void (*_webkit_reserved2) (void);
+ void (*_webkit_reserved3) (void);
+};
+
+WEBKIT_API GType
+webkit_download_get_type (void);
+
+WEBKIT_API WebKitDownload*
+webkit_download_new (WebKitNetworkRequest *request);
+
+WEBKIT_API void
+webkit_download_start (WebKitDownload *download);
+
+WEBKIT_API void
+webkit_download_cancel (WebKitDownload *download);
+
+WEBKIT_API const gchar*
+webkit_download_get_uri (WebKitDownload *download);
+
+WEBKIT_API WebKitNetworkRequest*
+webkit_download_get_network_request (WebKitDownload *download);
+
+WEBKIT_API const gchar*
+webkit_download_get_suggested_filename (WebKitDownload *download);
+
+WEBKIT_API const gchar*
+webkit_download_get_destination_uri (WebKitDownload *download);
+
+WEBKIT_API void
+webkit_download_set_destination_uri (WebKitDownload *download,
+ const gchar *destination_uri);
+
+WEBKIT_API gdouble
+webkit_download_get_progress (WebKitDownload *download);
+
+WEBKIT_API gdouble
+webkit_download_get_elapsed_time (WebKitDownload *download);
+
+WEBKIT_API guint64
+webkit_download_get_total_size (WebKitDownload *download);
+
+WEBKIT_API guint64
+webkit_download_get_current_size (WebKitDownload *download);
+
+WEBKIT_API WebKitDownloadStatus
+webkit_download_get_status (WebKitDownload *download);
+
+G_END_DECLS
+
+#endif
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
index e801981..c4264c9 100644
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ b/WebKit/gtk/webkit/webkitprivate.cpp
@@ -20,8 +20,10 @@
#include "config.h"
+#include "webkitsoupauthdialog.h"
#include "webkitprivate.h"
#include "ChromeClientGtk.h"
+#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClientGtk.h"
#include "Logging.h"
@@ -30,6 +32,9 @@
#include "PageGroup.h"
#include "Pasteboard.h"
#include "PasteboardHelperGtk.h"
+#include "ResourceHandle.h"
+#include "ResourceHandleClient.h"
+#include "ResourceHandleInternal.h"
#include <runtime/InitializeThreading.h>
#if ENABLE(DATABASE)
@@ -96,6 +101,31 @@ WebCore::NavigationType core(WebKitWebNavigationReason type)
} /** end namespace WebKit */
+static GtkWidget* currentToplevelCallback(WebKitSoupAuthDialog* feature, SoupMessage* message, gpointer userData)
+{
+ gpointer messageData = g_object_get_data(G_OBJECT(message), "resourceHandle");
+ if (!messageData)
+ return NULL;
+
+ ResourceHandle* handle = static_cast<ResourceHandle*>(messageData);
+ if (!handle)
+ return NULL;
+
+ ResourceHandleInternal* d = handle->getInternal();
+ if (!d)
+ return NULL;
+
+ WebCore::Frame* frame = d->m_frame;
+ if (!frame)
+ return NULL;
+
+ GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(frame->page()->chrome()->platformWindow()));
+ if (GTK_WIDGET_TOPLEVEL(toplevel))
+ return toplevel;
+ else
+ return NULL;
+}
+
void webkit_init()
{
static bool isInitialized = false;
@@ -121,4 +151,10 @@ void webkit_init()
PageGroup::setShouldTrackVisitedLinks(true);
Pasteboard::generalPasteboard()->setHelper(new WebKit::PasteboardHelperGtk());
+
+ SoupSession* session = webkit_get_default_session();
+ SoupSessionFeature* authDialog = static_cast<SoupSessionFeature*>(g_object_new(WEBKIT_TYPE_SOUP_AUTH_DIALOG, NULL));
+ g_signal_connect(authDialog, "current-toplevel", G_CALLBACK(currentToplevelCallback), NULL);
+ soup_session_add_feature(session, authDialog);
+ g_object_unref(authDialog);
}
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index ace996d..0b83a11 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007, 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2007, 2008, 2009 Holger Hans Peter Freyther
* Copyright (C) 2008 Jan Michael C. Alonzo
* Copyright (C) 2008 Collabora Ltd.
*
@@ -28,6 +28,7 @@
*/
#include <webkit/webkitdefines.h>
+#include <webkit/webkitdownload.h>
#include <webkit/webkitwebview.h>
#include <webkit/webkitwebframe.h>
#include <webkit/webkitwebpolicydecision.h>
@@ -43,10 +44,14 @@
#include "Frame.h"
#include "InspectorClientGtk.h"
#include "FrameLoaderClient.h"
+#include "ResourceHandle.h"
+#include "ResourceResponse.h"
#include "WindowFeatures.h"
#include <glib.h>
+class DownloadClient;
+
namespace WebKit {
WebKitWebView* getViewFromFrame(WebKitWebFrame*);
@@ -57,7 +62,7 @@ namespace WebKit {
WebKitWebView* kit(WebCore::Page*);
WebCore::HistoryItem* core(WebKitWebHistoryItem*);
- WebKitWebHistoryItem* kit(WebCore::HistoryItem*);
+ WebKitWebHistoryItem* kit(PassRefPtr<WebCore::HistoryItem>);
WebCore::BackForwardList* core(WebKitWebBackForwardList*);
@@ -101,6 +106,10 @@ extern "C" {
GtkAdjustment* verticalAdjustment;
gboolean zoomFullContent;
+ char* encoding;
+ char* customEncoding;
+
+ gboolean disposing;
};
#define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
@@ -120,11 +129,22 @@ extern "C" {
void
webkit_web_frame_core_frame_gone(WebKitWebFrame*);
+ // WebKitWebHistoryItem private
WebKitWebHistoryItem*
- webkit_web_history_item_new_with_core_item(WebCore::HistoryItem*);
+ webkit_web_history_item_new_with_core_item(PassRefPtr<WebCore::HistoryItem> historyItem);
+
+ WEBKIT_API G_CONST_RETURN gchar*
+ webkit_web_history_item_get_target(WebKitWebHistoryItem*);
+
+ WEBKIT_API gboolean
+ webkit_web_history_item_is_target_item(WebKitWebHistoryItem*);
+
+ WEBKIT_API GList*
+ webkit_web_history_item_get_children(WebKitWebHistoryItem*);
+ // end WebKitWebHistoryItem private
void
- webkit_web_inspector_set_inspector_client(WebKitWebInspector*, WebKit::InspectorClient*);
+ webkit_web_inspector_set_inspector_client(WebKitWebInspector*, WebCore::Page*);
void
webkit_web_inspector_set_web_view(WebKitWebInspector *web_inspector, WebKitWebView *web_view);
@@ -144,6 +164,10 @@ extern "C" {
void
webkit_web_policy_decision_cancel (WebKitWebPolicyDecision* decision);
+ // FIXME: move this functionality into a 'WebKitWebDataSource' once implemented
+ WEBKIT_API gchar*
+ webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame);
+
// FIXME: Move these to webkitwebframe.h once their API has been discussed.
WEBKIT_API GSList*
diff --git a/WebKit/gtk/webkit/webkitsoupauthdialog.c b/WebKit/gtk/webkit/webkitsoupauthdialog.c
new file mode 100644
index 0000000..139000b
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitsoupauthdialog.c
@@ -0,0 +1,347 @@
+/*
+ * Copyright (C) 2009 Igalia S.L.
+ *
+ * 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 <gtk/gtk.h>
+#include <libsoup/soup.h>
+#if USE(GNOMEKEYRING)
+#include <gnome-keyring.h>
+#endif
+
+#include "webkitmarshal.h"
+#include "webkitsoupauthdialog.h"
+
+static void webkit_soup_auth_dialog_session_feature_init(SoupSessionFeatureInterface* feature_interface, gpointer interface_data);
+static void attach(SoupSessionFeature* manager, SoupSession* session);
+static void detach(SoupSessionFeature* manager, SoupSession* session);
+
+enum {
+ CURRENT_TOPLEVEL,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE_WITH_CODE(WebKitSoupAuthDialog, webkit_soup_auth_dialog, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE(SOUP_TYPE_SESSION_FEATURE,
+ webkit_soup_auth_dialog_session_feature_init))
+
+static void webkit_soup_auth_dialog_class_init(WebKitSoupAuthDialogClass* klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS(klass);
+
+ signals[CURRENT_TOPLEVEL] =
+ g_signal_new("current-toplevel",
+ G_OBJECT_CLASS_TYPE(object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(WebKitSoupAuthDialogClass, current_toplevel),
+ NULL, NULL,
+ webkit_marshal_OBJECT__OBJECT,
+ GTK_TYPE_WIDGET, 1,
+ SOUP_TYPE_MESSAGE);
+}
+
+static void webkit_soup_auth_dialog_init(WebKitSoupAuthDialog* instance)
+{
+}
+
+static void webkit_soup_auth_dialog_session_feature_init(SoupSessionFeatureInterface *feature_interface,
+ gpointer interface_data)
+{
+ feature_interface->attach = attach;
+ feature_interface->detach = detach;
+}
+
+typedef struct _WebKitAuthData {
+ SoupMessage* msg;
+ SoupAuth* auth;
+ SoupSession* session;
+ SoupSessionFeature* manager;
+ GtkWidget* loginEntry;
+ GtkWidget* passwordEntry;
+#if USE(GNOMEKEYRING)
+ GtkWidget* checkButton;
+#endif
+} WebKitAuthData;
+
+static void free_authData(WebKitAuthData* authData)
+{
+ g_object_unref(authData->msg);
+ g_slice_free(WebKitAuthData, authData);
+}
+
+#if USE(GNOMEKEYRING)
+static void set_password_callback(GnomeKeyringResult result, guint32 val, gpointer user_data)
+{
+ /* Dummy callback, gnome_keyring_set_network_password does not accept a NULL one */
+}
+#endif
+
+static void response_callback(GtkDialog* dialog, gint response_id, WebKitAuthData* authData)
+{
+ const char* login;
+ const char* password;
+#if USE(GNOMEKEYRING)
+ SoupURI* uri;
+ gboolean storePassword;
+#endif
+
+ switch(response_id) {
+ case GTK_RESPONSE_OK:
+ login = gtk_entry_get_text(GTK_ENTRY(authData->loginEntry));
+ password = gtk_entry_get_text(GTK_ENTRY(authData->passwordEntry));
+ soup_auth_authenticate(authData->auth, login, password);
+
+#if USE(GNOMEKEYRING)
+ storePassword = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(authData->checkButton));
+ if (storePassword) {
+ uri = soup_message_get_uri(authData->msg);
+ gnome_keyring_set_network_password(NULL,
+ login,
+ soup_auth_get_realm(authData->auth),
+ uri->host,
+ NULL,
+ uri->scheme,
+ soup_auth_get_scheme_name(authData->auth),
+ uri->port,
+ password,
+ (GnomeKeyringOperationGetIntCallback)set_password_callback,
+ NULL,
+ NULL);
+ }
+#endif
+ default:
+ break;
+ }
+
+ soup_session_unpause_message(authData->session, authData->msg);
+ free_authData(authData);
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+}
+
+static GtkWidget *
+table_add_entry (GtkWidget* table,
+ int row,
+ const char* label_text,
+ const char* value,
+ gpointer user_data)
+{
+ GtkWidget* entry;
+ GtkWidget* label;
+
+ label = gtk_label_new(label_text);
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+
+ entry = gtk_entry_new();
+ gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
+
+ if (value)
+ gtk_entry_set_text(GTK_ENTRY(entry), value);
+
+ gtk_table_attach(GTK_TABLE(table), label,
+ 0, 1, row, row + 1,
+ GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ gtk_table_attach_defaults(GTK_TABLE(table), entry,
+ 1, 2, row, row + 1);
+
+ return entry;
+}
+
+static void show_auth_dialog(WebKitAuthData* authData, const char* login, const char* password)
+{
+ GtkWidget* toplevel;
+ GtkWidget* widget;
+ GtkDialog* dialog;
+ GtkWindow* window;
+ GtkWidget* entryContainer;
+ GtkWidget* hbox;
+ GtkWidget* mainVBox;
+ GtkWidget* vbox;
+ GtkWidget* icon;
+ GtkWidget* table;
+ GtkWidget* messageLabel;
+ char* message;
+ SoupURI* uri;
+#if USE(GNOMEKEYRING)
+ GtkWidget* rememberBox;
+ GtkWidget* checkButton;
+#endif
+
+ /* From GTK+ gtkmountoperation.c, modified and simplified. LGPL 2 license */
+
+ widget = gtk_dialog_new();
+ window = GTK_WINDOW(widget);
+ dialog = GTK_DIALOG(widget);
+
+ gtk_dialog_add_buttons(dialog,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
+
+ /* Set the dialog up with HIG properties */
+ gtk_dialog_set_has_separator(dialog, FALSE);
+ gtk_container_set_border_width(GTK_CONTAINER (dialog), 5);
+ gtk_box_set_spacing(GTK_BOX(dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width(GTK_CONTAINER (dialog->action_area), 5);
+ gtk_box_set_spacing(GTK_BOX(dialog->action_area), 6);
+
+ gtk_window_set_resizable(window, FALSE);
+ gtk_window_set_title(window, "");
+ gtk_window_set_icon_name(window, GTK_STOCK_DIALOG_AUTHENTICATION);
+
+ gtk_dialog_set_default_response(dialog, GTK_RESPONSE_OK);
+
+ /* Get the current toplevel */
+ g_signal_emit(authData->manager, signals[CURRENT_TOPLEVEL], 0, authData->msg, &toplevel);
+
+ if (toplevel)
+ gtk_window_set_transient_for(window, GTK_WINDOW(toplevel));
+
+ /* Build contents */
+ hbox = gtk_hbox_new(FALSE, 12);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 5);
+ gtk_box_pack_start(GTK_BOX(dialog->vbox), hbox, TRUE, TRUE, 0);
+
+ icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_AUTHENTICATION,
+ GTK_ICON_SIZE_DIALOG);
+
+ gtk_misc_set_alignment(GTK_MISC(icon), 0.5, 0.0);
+ gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
+
+ mainVBox = gtk_vbox_new(FALSE, 18);
+ gtk_box_pack_start(GTK_BOX(hbox), mainVBox, TRUE, TRUE, 0);
+
+ uri = soup_message_get_uri(authData->msg);
+ message = g_strdup_printf("A username and password are being requested by the site %s", uri->host);
+ messageLabel = gtk_label_new(message);
+ g_free(message);
+ gtk_misc_set_alignment(GTK_MISC(messageLabel), 0.0, 0.5);
+ gtk_label_set_line_wrap(GTK_LABEL(messageLabel), TRUE);
+ gtk_box_pack_start(GTK_BOX(mainVBox), GTK_WIDGET(messageLabel),
+ FALSE, FALSE, 0);
+
+ vbox = gtk_vbox_new(FALSE, 6);
+ gtk_box_pack_start(GTK_BOX (mainVBox), vbox, FALSE, FALSE, 0);
+
+ /* The table that holds the entries */
+ entryContainer = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
+
+ gtk_alignment_set_padding(GTK_ALIGNMENT(entryContainer),
+ 0, 0, 0, 0);
+
+ gtk_box_pack_start(GTK_BOX(vbox), entryContainer,
+ FALSE, FALSE, 0);
+
+ table = gtk_table_new(2, 2, FALSE);
+ gtk_table_set_col_spacings(GTK_TABLE (table), 12);
+ gtk_table_set_row_spacings(GTK_TABLE (table), 6);
+ gtk_container_add(GTK_CONTAINER(entryContainer), table);
+
+ authData->loginEntry = table_add_entry(table, 0, "Username:",
+ login, NULL);
+ authData->passwordEntry = table_add_entry(table, 1, "Password:",
+ password, NULL);
+
+ gtk_entry_set_visibility(GTK_ENTRY(authData->passwordEntry), FALSE);
+
+#if USE(GNOMEKEYRING)
+ rememberBox = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (vbox), rememberBox,
+ FALSE, FALSE, 0);
+
+ checkButton = gtk_check_button_new_with_label("Remember password");
+ if (login && password)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkButton), TRUE);
+ gtk_label_set_line_wrap(GTK_LABEL(gtk_bin_get_child(GTK_BIN(checkButton))), TRUE);
+ gtk_box_pack_start (GTK_BOX (rememberBox), checkButton, FALSE, FALSE, 0);
+ authData->checkButton = checkButton;
+#endif
+
+ g_signal_connect(dialog, "response", G_CALLBACK(response_callback), authData);
+ gtk_widget_show_all(widget);
+}
+
+#if USE(GNOMEKEYRING)
+static void find_password_callback(GnomeKeyringResult result, GList* list, WebKitAuthData* authData)
+{
+ GList* p;
+ const char* login = NULL;
+ const char* password = NULL;
+
+ for (p = list; p; p = p->next) {
+ /* FIXME: support multiple logins/passwords ? */
+ GnomeKeyringNetworkPasswordData* data = (GnomeKeyringNetworkPasswordData*)p->data;
+ login = data->user;
+ password = data->password;
+ break;
+ }
+
+ show_auth_dialog(authData, login, password);
+}
+#endif
+
+static void session_authenticate(SoupSession* session, SoupMessage* msg, SoupAuth* auth, gboolean retrying, gpointer user_data)
+{
+ SoupURI* uri;
+ WebKitAuthData* authData;
+ SoupSessionFeature* manager = (SoupSessionFeature*)user_data;
+
+ soup_session_pause_message(session, msg);
+ /* We need to make sure the message sticks around when pausing it */
+ g_object_ref(msg);
+
+ uri = soup_message_get_uri(msg);
+ authData = g_slice_new(WebKitAuthData);
+ authData->msg = msg;
+ authData->auth = auth;
+ authData->session = session;
+ authData->manager = manager;
+
+ /*
+ * If we have gnome-keyring let's try to find the password first in the ring.
+ * Otherwise just show the dialog straight away
+ */
+#if USE(GNOMEKEYRING)
+ gnome_keyring_find_network_password(NULL,
+ soup_auth_get_realm(auth),
+ uri->host,
+ NULL,
+ uri->scheme,
+ soup_auth_get_scheme_name(auth),
+ uri->port,
+ (GnomeKeyringOperationGetListCallback)find_password_callback,
+ authData,
+ NULL);
+#else
+ show_auth_dialog(authData, NULL, NULL);
+#endif
+}
+
+static void attach(SoupSessionFeature* manager, SoupSession* session)
+{
+ g_signal_connect(session, "authenticate", G_CALLBACK(session_authenticate), manager);
+}
+
+static void detach(SoupSessionFeature* manager, SoupSession* session)
+{
+ g_signal_handlers_disconnect_by_func(session, session_authenticate, manager);
+}
+
+
diff --git a/WebKit/gtk/webkit/webkitsoupauthdialog.h b/WebKit/gtk/webkit/webkitsoupauthdialog.h
new file mode 100644
index 0000000..2c030b4
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitsoupauthdialog.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2009 Igalia S.L.
+ *
+ * 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 <gtk/gtk.h>
+#include <libsoup/soup.h>
+
+#ifndef WEBKIT_SOUP_AUTH_DIALOG_H
+#define WEBKIT_SOUP_AUTH_DIALOG_H 1
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_SOUP_AUTH_DIALOG (webkit_soup_auth_dialog_get_type ())
+#define WEBKIT_SOUP_AUTH_DIALOG(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), WEBKIT_TYPE_SOUP_AUTH_DIALOG, WebKitSoupAuthDialog))
+#define WEBKIT_SOUP_AUTH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WEBKIT_TYPE_SOUP_AUTH_DIALOG, WebKitSoupAuthDialog))
+#define WEBKIT_IS_SOUP_AUTH_DIALOG(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), WEBKIT_TYPE_SOUP_AUTH_DIALOG))
+#define WEBKIT_IS_SOUP_AUTH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WEBKIT_TYPE_SOUP_AUTH_DIALOG))
+#define WEBKIT_SOUP_AUTH_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WEBKIT_TYPE_SOUP_AUTH_DIALOG, WebKitSoupAuthDialog))
+
+typedef struct {
+ GObject parent_instance;
+} WebKitSoupAuthDialog;
+
+typedef struct {
+ GObjectClass parent_class;
+
+ GtkWidget* (*current_toplevel) (WebKitSoupAuthDialog* feature, SoupMessage* message);
+} WebKitSoupAuthDialogClass;
+
+GType webkit_soup_auth_dialog_get_type (void);
+
+G_END_DECLS
+
+#endif /* WEBKIT_SOUP_AUTH_DIALOG_H */
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
index 3899f4b..5c93df0 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
@@ -189,11 +189,11 @@ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackFor
backForwardList->forwardListWithLimit(limit, items);
for (unsigned i = 0; i < items.size(); i++) {
- WebKitWebHistoryItem* webHistoryItem = webkit_web_history_item_new_with_core_item(items[i].get());
- forwardItems = g_list_prepend(forwardItems, g_object_ref(webHistoryItem));
+ WebKitWebHistoryItem* webHistoryItem = kit(items[i]);
+ forwardItems = g_list_prepend(forwardItems, webHistoryItem);
}
- return g_list_reverse(forwardItems);
+ return forwardItems;
}
/**
@@ -219,12 +219,13 @@ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwar
backForwardList->backListWithLimit(limit, items);
for (unsigned i = 0; i < items.size(); i++) {
- WebKitWebHistoryItem* webHistoryItem = webkit_web_history_item_new_with_core_item(items[i].get());
- backItems = g_list_prepend(backItems, g_object_ref(webHistoryItem));
+ WebKitWebHistoryItem* webHistoryItem = kit(items[i]);
+ backItems = g_list_prepend(backItems, webHistoryItem);
}
- return g_list_reverse(backItems);
+ return backItems;
}
+
/**
* webkit_web_back_forward_list_get_back_item:
* @web_back_forward_list: a #WebBackForwardList
@@ -389,6 +390,25 @@ void webkit_web_back_forward_list_set_limit(WebKitWebBackForwardList* webBackFor
backForwardList->setCapacity(limit);
}
+/**
+ * webkit_web_back_forward_list_add_item:
+ * @web_back_forward_list: a #WebKitWebBackForwardList
+ * @history_item: the #WebKitWebHistoryItem to add
+ *
+ * Adds the item to the #WebKitWebBackForwardList.
+ *
+ * Since: 1.1.1
+ */
+void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForwardList, WebKitWebHistoryItem *webHistoryItem)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList));
+
+ WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::HistoryItem* historyItem = core(webHistoryItem);
+
+ backForwardList->addItem(historyItem);
+}
+
} /* end extern "C" */
WebCore::BackForwardList* WebKit::core(WebKitWebBackForwardList* webBackForwardList)
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.h b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
index fb641f0..a44cbcd 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.h
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
@@ -107,6 +107,9 @@ webkit_web_back_forward_list_get_limit (WebKitWebBackForwardLi
WEBKIT_API void
webkit_web_back_forward_list_set_limit (WebKitWebBackForwardList *web_back_forward_list,
gint limit);
+WEBKIT_API void
+webkit_web_back_forward_list_add_item (WebKitWebBackForwardList *web_back_forward_list,
+ WebKitWebHistoryItem *history_item);
G_END_DECLS
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index 38e23a4..e2b10b6 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -5,6 +5,7 @@
* Copyright (C) 2008 Christian Dywan <christian@imendio.com>
* Copyright (C) 2008 Collabora Ltd.
* Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2009 Jan Alonzo <jmalonzo@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -31,6 +32,7 @@
#include "AnimationController.h"
#include "CString.h"
+#include "DocumentLoader.h"
#include "FrameLoader.h"
#include "FrameLoaderClientGtk.h"
#include "FrameTree.h"
@@ -43,6 +45,7 @@
#include "RenderTreeAsText.h"
#include "JSDOMBinding.h"
#include "ScriptController.h"
+#include "SubstituteData.h"
#include <JavaScriptCore/APICast.h>
@@ -373,6 +376,60 @@ WebKitWebFrame* webkit_web_frame_get_parent(WebKitWebFrame* frame)
}
/**
+ * webkit_web_frame_load_uri:
+ * @frame: a #WebKitWebFrame
+ * @uri: an URI string
+ *
+ * Requests loading of the specified URI string.
+ *
+ * Since: 1.1.1
+ */
+void webkit_web_frame_load_uri(WebKitWebFrame* frame, const gchar* uri)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
+ g_return_if_fail(uri);
+
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return;
+
+ coreFrame->loader()->load(ResourceRequest(KURL(KURL(), String::fromUTF8(uri))), false);
+}
+
+/**
+ * webkit_web_frame_load_string:
+ * @frame: a #WebKitWebFrame
+ * @content: an URI string
+ * @mime_type: the MIME type, or %NULL
+ * @encoding: the encoding, or %NULL
+ * @base_uri: the base URI for relative locations
+ *
+ * Requests loading of the given @content with the specified @mime_type,
+ * @encoding and @base_uri.
+ *
+ * If @mime_type is %NULL, "text/html" is assumed.
+ *
+ * If @encoding is %NULL, "UTF-8" is assumed.
+ *
+ * Since: 1.1.1
+ */
+void webkit_web_frame_load_string(WebKitWebFrame* frame, const gchar* content, const gchar* contentMimeType, const gchar* contentEncoding, const gchar* baseUri)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
+ g_return_if_fail(content);
+
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return;
+
+ KURL url(KURL(), baseUri ? String::fromUTF8(baseUri) : "");
+ RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(content, strlen(content));
+ SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", blankURL(), url);
+
+ coreFrame->loader()->load(ResourceRequest(url), substituteData, false);
+}
+
+/**
* webkit_web_frame_load_request:
* @frame: a #WebKitWebFrame
* @request: a #WebKitNetworkRequest
@@ -394,7 +451,7 @@ void webkit_web_frame_load_request(WebKitWebFrame* frame, WebKitNetworkRequest*
// TODO: Use the ResourceRequest carried by WebKitNetworkRequest when it is implemented.
String string = String::fromUTF8(webkit_network_request_get_uri(request));
- coreFrame->loader()->load(ResourceRequest(KURL(string)));
+ coreFrame->loader()->load(ResourceRequest(KURL(KURL(), string)), false);
}
/**
@@ -662,4 +719,12 @@ unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame)
return controller->numberOfActiveAnimations();
}
+gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame)
+{
+ Frame* coreFrame = core(frame);
+ DocumentLoader* docLoader = coreFrame->loader()->documentLoader();
+ String mimeType = docLoader->responseMIMEType();
+ return g_strdup(mimeType.utf8().data());
+}
+
}
diff --git a/WebKit/gtk/webkit/webkitwebframe.h b/WebKit/gtk/webkit/webkitwebframe.h
index fcdace6..7e24565 100644
--- a/WebKit/gtk/webkit/webkitwebframe.h
+++ b/WebKit/gtk/webkit/webkitwebframe.h
@@ -81,6 +81,17 @@ WEBKIT_API WebKitWebFrame*
webkit_web_frame_get_parent (WebKitWebFrame *frame);
WEBKIT_API void
+webkit_web_frame_load_uri (WebKitWebFrame *frame,
+ const gchar *uri);
+
+WEBKIT_API void
+webkit_web_frame_load_string (WebKitWebFrame *frame,
+ const gchar *content,
+ const gchar *mime_type,
+ const gchar *encoding,
+ const gchar *base_uri);
+
+WEBKIT_API void
webkit_web_frame_load_request (WebKitWebFrame *frame,
WebKitNetworkRequest *request);
diff --git a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
index 8cdaa90..42e6a9b 100644
--- a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
+++ b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Jan Michael C. Alonzo
+ * Copyright (C) 2008, 2009 Jan Michael C. Alonzo
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -17,7 +17,6 @@
* Boston, MA 02110-1301, USA.
*/
-
#include "config.h"
#include "webkitwebhistoryitem.h"
@@ -53,12 +52,14 @@ using namespace WebKit;
extern "C" {
struct _WebKitWebHistoryItemPrivate {
- WTF::RefPtr<WebCore::HistoryItem> historyItem;
+ WebCore::HistoryItem* historyItem;
WebCore::CString title;
WebCore::CString alternateTitle;
WebCore::CString uri;
WebCore::CString originalUri;
+
+ gboolean disposed;
};
#define WEBKIT_WEB_HISTORY_ITEM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_HISTORY_ITEM, WebKitWebHistoryItemPrivate))
@@ -81,7 +82,7 @@ static void webkit_web_history_item_get_property(GObject* object, guint prop_id,
static GHashTable* webkit_history_items()
{
- static GHashTable* historyItems = g_hash_table_new(g_direct_hash, g_direct_equal);
+ static GHashTable* historyItems = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_object_unref);
return historyItems;
}
@@ -94,27 +95,24 @@ static void webkit_history_item_add(WebKitWebHistoryItem* webHistoryItem, WebCor
g_hash_table_insert(table, historyItem, g_object_ref(webHistoryItem));
}
-static void webkit_history_item_remove(WebCore::HistoryItem* historyItem)
-{
- GHashTable* table = webkit_history_items();
- WebKitWebHistoryItem* webHistoryItem = (WebKitWebHistoryItem*) g_hash_table_lookup(table, historyItem);
-
- g_return_if_fail(webHistoryItem != NULL);
-
- g_hash_table_remove(table, historyItem);
- g_object_unref(webHistoryItem);
-}
-
static void webkit_web_history_item_dispose(GObject* object)
{
WebKitWebHistoryItem* webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(object);
+ WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
+ WebCore::HistoryItem* item = core(webHistoryItem);
- webkit_history_item_remove(core(webHistoryItem));
+ if (!priv->disposed) {
+ GHashTable* table = webkit_history_items();
- /* destroy table if empty */
- GHashTable* table = webkit_history_items();
- if (!g_hash_table_size(table))
- g_hash_table_destroy(table);
+ g_hash_table_remove(table, item);
+ item->deref();
+
+ /* destroy table if empty */
+ if (!g_hash_table_size(table))
+ g_hash_table_destroy(table);
+
+ priv->disposed = true;
+ }
G_OBJECT_CLASS(webkit_web_history_item_parent_class)->dispose(object);
}
@@ -270,21 +268,9 @@ static void webkit_web_history_item_get_property(GObject* object, guint prop_id,
}
/* Helper function to create a new WebHistoryItem instance when needed */
-WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(WebCore::HistoryItem* item)
+WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(PassRefPtr<WebCore::HistoryItem> historyItem)
{
- WebKitWebHistoryItem* webHistoryItem = kit(item);
-
- if (webHistoryItem)
- g_object_ref(webHistoryItem);
- else {
- webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
- WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
-
- priv->historyItem = item;
- webkit_history_item_add(webHistoryItem, priv->historyItem.get());
- }
-
- return webHistoryItem;
+ return kit(historyItem);
}
@@ -300,8 +286,9 @@ WebKitWebHistoryItem* webkit_web_history_item_new()
WebKitWebHistoryItem* webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
- priv->historyItem = WebCore::HistoryItem::create();
- webkit_history_item_add(webHistoryItem, priv->historyItem.get());
+ RefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create();
+ priv->historyItem = item.release().releaseRef();
+ webkit_history_item_add(webHistoryItem, priv->historyItem);
return webHistoryItem;
}
@@ -323,8 +310,9 @@ WebKitWebHistoryItem* webkit_web_history_item_new_with_data(const gchar* uri, co
WebKitWebHistoryItem* webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
- priv->historyItem = WebCore::HistoryItem::create(historyUri, historyTitle, 0);
- webkit_history_item_add(webHistoryItem, priv->historyItem.get());
+ RefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create(historyUri, historyTitle, 0);
+ priv->historyItem = item.release().releaseRef();
+ webkit_history_item_add(webHistoryItem, priv->historyItem);
return webHistoryItem;
}
@@ -341,7 +329,7 @@ G_CONST_RETURN gchar* webkit_web_history_item_get_title(WebKitWebHistoryItem* we
WebCore::HistoryItem* item = core(webHistoryItem);
- g_return_val_if_fail(item != NULL, NULL);
+ g_return_val_if_fail(item, NULL);
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
priv->title = item->title().utf8();
@@ -363,7 +351,7 @@ G_CONST_RETURN gchar* webkit_web_history_item_get_alternate_title(WebKitWebHisto
WebCore::HistoryItem* item = core(webHistoryItem);
- g_return_val_if_fail(item != NULL, NULL);
+ g_return_val_if_fail(item, NULL);
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
priv->alternateTitle = item->alternateTitle().utf8();
@@ -403,7 +391,7 @@ G_CONST_RETURN gchar* webkit_web_history_item_get_uri(WebKitWebHistoryItem* webH
WebCore::HistoryItem* item = core(WEBKIT_WEB_HISTORY_ITEM(webHistoryItem));
- g_return_val_if_fail(item != NULL, NULL);
+ g_return_val_if_fail(item, NULL);
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
priv->uri = item->urlString().utf8();
@@ -425,7 +413,7 @@ G_CONST_RETURN gchar* webkit_web_history_item_get_original_uri(WebKitWebHistoryI
WebCore::HistoryItem* item = core(WEBKIT_WEB_HISTORY_ITEM(webHistoryItem));
- g_return_val_if_fail(item != NULL, NULL);
+ g_return_val_if_fail(item, NULL);
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
priv->originalUri = item->originalURLString().utf8();
@@ -447,31 +435,84 @@ gdouble webkit_web_history_item_get_last_visited_time(WebKitWebHistoryItem* webH
WebCore::HistoryItem* item = core(WEBKIT_WEB_HISTORY_ITEM(webHistoryItem));
- g_return_val_if_fail(item != NULL, 0);
+ g_return_val_if_fail(item, 0);
return item->lastVisitedTime();
}
+/* private methods */
+
+G_CONST_RETURN gchar* webkit_web_history_item_get_target(WebKitWebHistoryItem* webHistoryItem)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), NULL);
+
+ WebCore::HistoryItem* item = core(webHistoryItem);
+
+ g_return_val_if_fail(item, NULL);
+
+ WebCore::CString t = item->target().utf8();
+ return g_strdup(t.data());
+}
+
+gboolean webkit_web_history_item_is_target_item(WebKitWebHistoryItem* webHistoryItem)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), false);
+
+ WebCore::HistoryItem* item = core(webHistoryItem);
+
+ g_return_val_if_fail(item, false);
+
+ return item->isTargetItem();
+}
+
+GList* webkit_web_history_item_get_children(WebKitWebHistoryItem* webHistoryItem)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), NULL);
+
+ WebCore::HistoryItem* item = core(webHistoryItem);
+
+ g_return_val_if_fail(item, NULL);
+
+ const WebCore::HistoryItemVector& children = item->children();
+ if (!children.size())
+ return NULL;
+
+ unsigned size = children.size();
+ GList* kids = NULL;
+ for (unsigned i = 0; i < size; ++i)
+ kids = g_list_prepend(kids, kit(children[i].get()));
+
+ return g_list_reverse(kids);
+}
+
} /* end extern "C" */
WebCore::HistoryItem* WebKit::core(WebKitWebHistoryItem* webHistoryItem)
{
g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), NULL);
- WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
- WTF::RefPtr<WebCore::HistoryItem> historyItem = priv->historyItem;
-
- return historyItem ? historyItem.get() : 0;
+ return webHistoryItem->priv->historyItem;
}
-WebKitWebHistoryItem* WebKit::kit(WebCore::HistoryItem* historyItem)
+WebKitWebHistoryItem* WebKit::kit(PassRefPtr<WebCore::HistoryItem> historyItem)
{
- g_return_val_if_fail(historyItem != NULL, NULL);
+ g_return_val_if_fail(historyItem, NULL);
+
+ RefPtr<WebCore::HistoryItem> item = historyItem;
WebKitWebHistoryItem* webHistoryItem;
GHashTable* table = webkit_history_items();
- webHistoryItem = (WebKitWebHistoryItem*) g_hash_table_lookup(table, historyItem);
+ webHistoryItem = (WebKitWebHistoryItem*) g_hash_table_lookup(table, item.get());
+
+ if (!webHistoryItem) {
+ webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
+ WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
+
+ priv->historyItem = item.release().releaseRef();
+ webkit_history_item_add(webHistoryItem, priv->historyItem);
+ }
+
return webHistoryItem;
}
diff --git a/WebKit/gtk/webkit/webkitwebinspector.cpp b/WebKit/gtk/webkit/webkitwebinspector.cpp
index b8f8d9e..8e1c8c0 100644
--- a/WebKit/gtk/webkit/webkitwebinspector.cpp
+++ b/WebKit/gtk/webkit/webkitwebinspector.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 Gustavo Noronha Silva
- * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2008, 2009 Holger Hans Peter Freyther
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -75,12 +75,13 @@ enum {
PROP_WEB_VIEW,
PROP_INSPECTED_URI,
+ PROP_JAVASCRIPT_PROFILING_ENABLED
};
G_DEFINE_TYPE(WebKitWebInspector, webkit_web_inspector, G_TYPE_OBJECT)
struct _WebKitWebInspectorPrivate {
- InspectorClient* inspectorClient;
+ WebCore::Page* page;
WebKitWebView* inspector_view;
gchar* inspected_uri;
};
@@ -274,6 +275,23 @@ static void webkit_web_inspector_class_init(WebKitWebInspectorClass* klass)
NULL,
WEBKIT_PARAM_READABLE));
+ /**
+ * WebKitWebInspector:javascript-profiling-enabled
+ *
+ * This is enabling JavaScript profiling in the Inspector. This means
+ * that Console.profiles will return the profiles.
+ *
+ * Since: 1.1.1
+ */
+ g_object_class_install_property(gobject_class,
+ PROP_JAVASCRIPT_PROFILING_ENABLED,
+ g_param_spec_boolean(
+ "javascript-profiling-enabled",
+ "Enable JavaScript profiling",
+ "Profile the executed JavaScript.",
+ FALSE,
+ WEBKIT_PARAM_READWRITE));
+
g_type_class_add_private(klass, sizeof(WebKitWebInspectorPrivate));
}
@@ -298,7 +316,19 @@ static void webkit_web_inspector_finalize(GObject* object)
static void webkit_web_inspector_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
{
+ WebKitWebInspector* web_inspector = WEBKIT_WEB_INSPECTOR(object);
+ WebKitWebInspectorPrivate* priv = web_inspector->priv;
+
switch(prop_id) {
+ case PROP_JAVASCRIPT_PROFILING_ENABLED: {
+ bool enabled = g_value_get_boolean(value);
+ WebCore::InspectorController* controller = priv->page->inspectorController();
+ if (enabled)
+ controller->enableProfiler();
+ else
+ controller->disableProfiler();
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -317,6 +347,9 @@ static void webkit_web_inspector_get_property(GObject* object, guint prop_id, GV
case PROP_INSPECTED_URI:
g_value_set_string(value, priv->inspected_uri);
break;
+ case PROP_JAVASCRIPT_PROFILING_ENABLED:
+ g_value_set_boolean(value, priv->page->inspectorController()->profilerEnabled());
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -388,11 +421,11 @@ const gchar* webkit_web_inspector_get_inspected_uri(WebKitWebInspector *web_insp
}
void
-webkit_web_inspector_set_inspector_client(WebKitWebInspector* web_inspector, WebKit::InspectorClient* inspectorClient)
+webkit_web_inspector_set_inspector_client(WebKitWebInspector* web_inspector, WebCore::Page* page)
{
WebKitWebInspectorPrivate* priv = web_inspector->priv;
- priv->inspectorClient = inspectorClient;
+ priv->page = page;
}
}
diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
index aa38c6c..d31ec2f 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -74,6 +74,7 @@ struct _WebKitWebSettingsPrivate {
gchar* user_stylesheet_uri;
gfloat zoom_step;
gboolean enable_developer_extras;
+ gboolean enable_private_browsing;
};
#define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
@@ -101,7 +102,8 @@ enum {
PROP_RESIZABLE_TEXT_AREAS,
PROP_USER_STYLESHEET_URI,
PROP_ZOOM_STEP,
- PROP_ENABLE_DEVELOPER_EXTRAS
+ PROP_ENABLE_DEVELOPER_EXTRAS,
+ PROP_ENABLE_PRIVATE_BROWSING
};
static void webkit_web_settings_finalize(GObject* object);
@@ -335,6 +337,22 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
FALSE,
flags));
+ /**
+ * WebKitWebSettings:enable-private-browsing:
+ *
+ * Whether to enable private browsing mode.
+ *
+ * Since 1.1.2
+ */
+ g_object_class_install_property(gobject_class,
+ PROP_ENABLE_PRIVATE_BROWSING,
+ g_param_spec_boolean(
+ "enable-private-browsing",
+ "Enable Private Browsing",
+ "Enables private browsing mode",
+ FALSE,
+ flags));
+
g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
}
@@ -437,6 +455,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
case PROP_ENABLE_DEVELOPER_EXTRAS:
priv->enable_developer_extras = g_value_get_boolean(value);
break;
+ case PROP_ENABLE_PRIVATE_BROWSING:
+ priv->enable_private_browsing = g_value_get_boolean(value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -512,6 +533,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
case PROP_ENABLE_DEVELOPER_EXTRAS:
g_value_set_boolean(value, priv->enable_developer_extras);
break;
+ case PROP_ENABLE_PRIVATE_BROWSING:
+ g_value_set_boolean(value, priv->enable_private_browsing);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -563,6 +587,7 @@ WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
"user-stylesheet-uri", priv->user_stylesheet_uri,
"zoom-step", priv->zoom_step,
"enable-developer-extras", priv->enable_developer_extras,
+ "enable-private-browsing", priv->enable_private_browsing,
NULL));
return copy;
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 0ea6ed5..d6a0d54 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -1,12 +1,13 @@
/*
* Copyright (C) 2007, 2008 Holger Hans Peter Freyther
- * Copyright (C) 2007, 2008 Christian Dywan <christian@imendio.com>
+ * Copyright (C) 2007, 2008, 2009 Christian Dywan <christian@imendio.com>
* Copyright (C) 2007 Xan Lopez <xan@gnome.org>
* Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
* Copyright (C) 2008 Jan Alonzo <jmalonzo@unpluggable.com>
* Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org>
* Copyright (C) 2008 Nuanti Ltd.
* Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2009 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -25,6 +26,7 @@
#include "config.h"
+#include "webkitdownload.h"
#include "webkitwebview.h"
#include "webkitenumtypes.h"
#include "webkitmarshal.h"
@@ -43,6 +45,7 @@
#include "ContextMenuController.h"
#include "Cursor.h"
#include "Document.h"
+#include "DocumentLoader.h"
#include "DragClientGtk.h"
#include "Editor.h"
#include "EditorClientGtk.h"
@@ -56,13 +59,12 @@
#include "InspectorClientGtk.h"
#include "FrameLoader.h"
#include "FrameView.h"
-#include "Editor.h"
#include "PasteboardHelper.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformWheelEvent.h"
+#include "ResourceHandle.h"
#include "ScriptValue.h"
#include "Scrollbar.h"
-#include "SubstituteData.h"
#include <wtf/GOwnPtr.h>
#include <gdk/gdkkeysyms.h>
@@ -110,6 +112,7 @@ extern "C" {
enum {
/* normal signals */
NAVIGATION_REQUESTED,
+ NEW_WINDOW_POLICY_DECISION_REQUESTED,
NAVIGATION_POLICY_DECISION_REQUESTED,
MIME_TYPE_POLICY_DECISION_REQUESTED,
CREATE_WEB_VIEW,
@@ -133,12 +136,15 @@ enum {
COPY_CLIPBOARD,
PASTE_CLIPBOARD,
CUT_CLIPBOARD,
+ DOWNLOAD_REQUESTED,
LAST_SIGNAL
};
enum {
PROP_0,
+ PROP_TITLE,
+ PROP_URI,
PROP_COPY_TARGET_LIST,
PROP_PASTE_TARGET_LIST,
PROP_EDITABLE,
@@ -147,7 +153,9 @@ enum {
PROP_WINDOW_FEATURES,
PROP_TRANSPARENT,
PROP_ZOOM_LEVEL,
- PROP_FULL_CONTENT_ZOOM
+ PROP_FULL_CONTENT_ZOOM,
+ PROP_ENCODING,
+ PROP_CUSTOM_ENCODING
};
static guint webkit_web_view_signals[LAST_SIGNAL] = { 0, };
@@ -276,6 +284,12 @@ static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue*
WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
switch(prop_id) {
+ case PROP_TITLE:
+ g_value_set_string(value, webkit_web_view_get_title(webView));
+ break;
+ case PROP_URI:
+ g_value_set_string(value, webkit_web_view_get_uri(webView));
+ break;
#if GTK_CHECK_VERSION(2,10,0)
case PROP_COPY_TARGET_LIST:
g_value_set_boxed(value, webkit_web_view_get_copy_target_list(webView));
@@ -305,6 +319,12 @@ static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue*
case PROP_FULL_CONTENT_ZOOM:
g_value_set_boolean(value, webkit_web_view_get_full_content_zoom(webView));
break;
+ case PROP_ENCODING:
+ g_value_set_string(value, webkit_web_view_get_encoding(webView));
+ break;
+ case PROP_CUSTOM_ENCODING:
+ g_value_set_string(value, webkit_web_view_get_custom_encoding(webView));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
@@ -333,6 +353,9 @@ static void webkit_web_view_set_property(GObject* object, guint prop_id, const G
case PROP_FULL_CONTENT_ZOOM:
webkit_web_view_set_full_content_zoom(webView, g_value_get_boolean(value));
break;
+ case PROP_CUSTOM_ENCODING:
+ webkit_web_view_set_custom_encoding(webView, g_value_get_string(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
@@ -436,11 +459,23 @@ static gboolean webkit_web_view_key_press_event(GtkWidget* widget, GdkEventKey*
case GDK_Left:
view->scrollBy(IntSize(-cScrollbarPixelsPerLineStep, 0));
return TRUE;
+ case GDK_space:
+ if ((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
+ view->scrollBy(IntSize(0, -view->visibleHeight()));
+ else
+ view->scrollBy(IntSize(0, view->visibleHeight()));
+ return TRUE;
+ case GDK_Page_Up:
+ view->scrollBy(IntSize(0, -view->visibleHeight()));
+ return TRUE;
+ case GDK_Page_Down:
+ view->scrollBy(IntSize(0, view->visibleHeight()));
+ return TRUE;
case GDK_Home:
- frame->selection()->modify(alteration, SelectionController::BACKWARD, DocumentBoundary, true);
+ view->scrollBy(IntSize(0, -view->contentsHeight()));
return TRUE;
case GDK_End:
- frame->selection()->modify(alteration, SelectionController::FORWARD, DocumentBoundary, true);
+ view->scrollBy(IntSize(0, view->contentsHeight()));
return TRUE;
}
@@ -496,10 +531,17 @@ static gboolean webkit_web_view_button_release_event(GtkWidget* widget, GdkEvent
}
Frame* mainFrame = core(webView)->mainFrame();
- if (!mainFrame->view())
- return FALSE;
+ if (mainFrame->view())
+ mainFrame->eventHandler()->handleMouseReleaseEvent(PlatformMouseEvent(event));
+
+ /* We always return FALSE here because WebKit can, for the same click, decide
+ * to not handle press-event but handle release-event, which can totally confuse
+ * some GTK+ containers when there are no other events in between. This way we
+ * guarantee that this case never happens, and that if press-event goes through
+ * release-event also goes through.
+ */
- return mainFrame->eventHandler()->handleMouseReleaseEvent(PlatformMouseEvent(event));
+ return FALSE;
}
static gboolean webkit_web_view_motion_event(GtkWidget* widget, GdkEventMotion* event)
@@ -536,7 +578,7 @@ static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allo
return;
frame->view()->resize(allocation->width, allocation->height);
- frame->forceLayout();
+ frame->view()->forceLayout();
frame->view()->adjustViewSize();
}
@@ -816,6 +858,8 @@ static void webkit_web_view_dispose(GObject* object)
WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
WebKitWebViewPrivate* priv = webView->priv;
+ priv->disposing = TRUE;
+
if (priv->corePage) {
webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(object));
@@ -864,6 +908,17 @@ static void webkit_web_view_dispose(GObject* object)
G_OBJECT_CLASS(webkit_web_view_parent_class)->dispose(object);
}
+static void webkit_web_view_finalize(GObject* object)
+{
+ WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
+ WebKitWebViewPrivate* priv = webView->priv;
+
+ g_free(priv->encoding);
+ g_free(priv->customEncoding);
+
+ G_OBJECT_CLASS(webkit_web_view_parent_class)->finalize(object);
+}
+
static gboolean webkit_create_web_view_request_handled(GSignalInvocationHint* ihint, GValue* returnAccu, const GValue* handlerReturn, gpointer dummy)
{
gpointer newWebView = g_value_get_object(handlerReturn);
@@ -998,6 +1053,45 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
WEBKIT_TYPE_NETWORK_REQUEST);
/**
+ * WebKitWebView::new-window-policy-decision-requested:
+ * @web_view: the object on which the signal is emitted
+ * @frame: the #WebKitWebFrame that required the navigation
+ * @request: a #WebKitNetworkRequest
+ * @navigation_action: a #WebKitWebNavigation
+ * @policy_decision: a #WebKitWebPolicyDecision
+ * @return: TRUE if the signal will be handled, FALSE to have the
+ * default behavior apply
+ *
+ * Emitted when @frame requests opening a new window. With this
+ * signal the browser can use the context of the request to decide
+ * about the new window. If the request is not handled the default
+ * behavior is to allow opening the new window to load the url,
+ * which will cause a create-web-view signal emission where the
+ * browser handles the new window action but without information
+ * of the context that caused the navigation. The following
+ * navigation-policy-decision-requested emissions will load the
+ * page after the creation of the new window just with the
+ * information of this new navigation context, without any
+ * information about the action that made this new window to be
+ * opened.
+ *
+ * Since: 1.1.4
+ */
+ webkit_web_view_signals[NEW_WINDOW_POLICY_DECISION_REQUESTED] =
+ g_signal_new("new-window-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_OBJECT_OBJECT,
+ G_TYPE_BOOLEAN, 4,
+ WEBKIT_TYPE_WEB_FRAME,
+ WEBKIT_TYPE_NETWORK_REQUEST,
+ WEBKIT_TYPE_WEB_NAVIGATION_ACTION,
+ WEBKIT_TYPE_WEB_POLICY_DECISION);
+
+ /**
* WebKitWebView::navigation-policy-decision-requested:
* @web_view: the object on which the signal is emitted
* @frame: the #WebKitWebFrame that required the navigation
@@ -1085,6 +1179,34 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
G_TYPE_POINTER);
/**
+ * WebKitWebView::download-requested:
+ * @web_view: the object on which the signal is emitted
+ * @download: a #WebKitDownload object that lets you control the
+ * download process
+ * @return: %TRUE if the download should be performed, %FALSE to cancel it.
+ *
+ * A new Download is being requested. By default, if the signal is
+ * not handled, the download is cancelled. Notice that while
+ * handling this signal you must set the target URI using
+ * webkit_download_set_target_uri().
+ *
+ * If you intend to handle downloads yourself rather than using
+ * the #WebKitDownload helper object you must handle this signal,
+ * and return %FALSE.
+ *
+ * Since: 1.1.2
+ */
+ webkit_web_view_signals[DOWNLOAD_REQUESTED] = g_signal_new("download-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,
+ G_TYPE_BOOLEAN, 1,
+ G_TYPE_OBJECT);
+
+ /**
* WebKitWebView::load-started:
* @web_view: the object on which the signal is emitted
* @frame: the frame going to do the load
@@ -1151,6 +1273,8 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
* @title: the new title
*
* When a #WebKitWebFrame changes the document title this signal is emitted.
+ *
+ * Deprecated: 1.1.4: Use "notify::title" instead.
*/
webkit_web_view_signals[TITLE_CHANGED] = g_signal_new("title-changed",
G_TYPE_FROM_CLASS(webViewClass),
@@ -1284,9 +1408,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
G_STRUCT_OFFSET(WebKitWebViewClass, script_confirm),
g_signal_accumulator_true_handled,
NULL,
- webkit_marshal_BOOLEAN__OBJECT_STRING_BOOLEAN,
+ webkit_marshal_BOOLEAN__OBJECT_STRING_POINTER,
G_TYPE_BOOLEAN, 3,
- WEBKIT_TYPE_WEB_FRAME, G_TYPE_STRING, G_TYPE_BOOLEAN);
+ WEBKIT_TYPE_WEB_FRAME, G_TYPE_STRING, G_TYPE_POINTER);
/**
* WebKitWebView::script-prompt:
@@ -1396,6 +1520,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
GObjectClass* objectClass = G_OBJECT_CLASS(webViewClass);
objectClass->dispose = webkit_web_view_dispose;
+ objectClass->finalize = webkit_web_view_finalize;
objectClass->get_property = webkit_web_view_get_property;
objectClass->set_property = webkit_web_view_set_property;
@@ -1461,6 +1586,34 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
* properties
*/
+ /**
+ * WebKitWebView:title:
+ *
+ * Returns the @web_view's document title.
+ *
+ * Since: 1.1.4
+ */
+ g_object_class_install_property(objectClass, PROP_TITLE,
+ g_param_spec_string("title",
+ "Title",
+ "Returns the @web_view's document title",
+ NULL,
+ WEBKIT_PARAM_READABLE));
+
+ /**
+ * WebKitWebView:uri:
+ *
+ * Returns the current URI of the contents displayed by the @web_view.
+ *
+ * Since: 1.1.4
+ */
+ g_object_class_install_property(objectClass, PROP_URI,
+ g_param_spec_string("uri",
+ "URI",
+ "Returns the current URI of the contents displayed by the @web_view",
+ NULL,
+ WEBKIT_PARAM_READABLE));
+
#if GTK_CHECK_VERSION(2,10,0)
/**
* WebKitWebView:copy-target-list:
@@ -1570,6 +1723,34 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
FALSE,
WEBKIT_PARAM_READWRITE));
+ /**
+ * WebKitWebView:encoding:
+ *
+ * The default encoding of the web view.
+ *
+ * Since: 1.1.2
+ */
+ g_object_class_install_property(objectClass, PROP_ENCODING,
+ g_param_spec_string("encoding",
+ "Encoding",
+ "The default encoding of the web view",
+ NULL,
+ WEBKIT_PARAM_READABLE));
+
+ /**
+ * WebKitWebView:custom-encoding:
+ *
+ * The custom encoding of the web view.
+ *
+ * Since: 1.1.2
+ */
+ g_object_class_install_property(objectClass, PROP_CUSTOM_ENCODING,
+ g_param_spec_string("custom-encoding",
+ "Custom Encoding",
+ "The custom encoding of the web view",
+ NULL,
+ WEBKIT_PARAM_READWRITE));
+
g_type_class_add_private(webViewClass, sizeof(WebKitWebViewPrivate));
}
@@ -1625,7 +1806,9 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
Settings* settings = core(webView)->settings();
gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri;
- gboolean autoLoadImages, autoShrinkImages, printBackgrounds, enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas;
+ gboolean autoLoadImages, autoShrinkImages, printBackgrounds,
+ enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas,
+ enablePrivateBrowsing;
g_object_get(webSettings,
"default-encoding", &defaultEncoding,
@@ -1643,6 +1826,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
"resizable-text-areas", &resizableTextAreas,
"user-stylesheet-uri", &userStylesheetUri,
"enable-developer-extras", &enableDeveloperExtras,
+ "enable-private-browsing", &enablePrivateBrowsing,
NULL);
settings->setDefaultTextEncodingName(defaultEncoding);
@@ -1658,8 +1842,9 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
settings->setJavaScriptEnabled(enableScripts);
settings->setPluginsEnabled(enablePlugins);
settings->setTextAreasAreResizable(resizableTextAreas);
- settings->setUserStyleSheetLocation(KURL(userStylesheetUri));
+ settings->setUserStyleSheetLocation(KURL(KURL(), userStylesheetUri));
settings->setDeveloperExtrasEnabled(enableDeveloperExtras);
+ settings->setPrivateBrowsingEnabled(enablePrivateBrowsing);
g_free(defaultEncoding);
g_free(cursiveFontFamily);
@@ -1725,9 +1910,11 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
else if (name == g_intern_string("resizable-text-areas"))
settings->setTextAreasAreResizable(g_value_get_boolean(&value));
else if (name == g_intern_string("user-stylesheet-uri"))
- settings->setUserStyleSheetLocation(KURL(g_value_get_string(&value)));
+ settings->setUserStyleSheetLocation(KURL(KURL(), g_value_get_string(&value)));
else if (name == g_intern_string("enable-developer-extras"))
settings->setDeveloperExtrasEnabled(g_value_get_boolean(&value));
+ else if (name == g_intern_string("enable-private-browsing"))
+ settings->setPrivateBrowsingEnabled(g_value_get_boolean(&value));
else if (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name))
g_warning("Unexpected setting '%s'", name);
g_value_unset(&value);
@@ -1746,20 +1933,13 @@ static void webkit_web_view_init(WebKitWebView* webView)
// We also add a simple wrapper class to provide the public
// interface for the Web Inspector.
priv->webInspector = WEBKIT_WEB_INSPECTOR(g_object_new(WEBKIT_TYPE_WEB_INSPECTOR, NULL));
- webkit_web_inspector_set_inspector_client(priv->webInspector, inspectorClient);
+ webkit_web_inspector_set_inspector_client(priv->webInspector, priv->corePage);
priv->horizontalAdjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
priv->verticalAdjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
-#if GLIB_CHECK_VERSION(2,10,0)
g_object_ref_sink(priv->horizontalAdjustment);
g_object_ref_sink(priv->verticalAdjustment);
-#else
- g_object_ref(priv->horizontalAdjustment);
- gtk_object_sink(GTK_OBJECT(priv->horizontalAdjustment));
- g_object_ref(priv->verticalAdjustment);
- gtk_object_sink(GTK_OBJECT(priv->verticalAdjustment));
-#endif
GTK_WIDGET_SET_FLAGS(webView, GTK_CAN_FOCUS);
priv->mainFrame = WEBKIT_WEB_FRAME(webkit_web_frame_new(webView));
@@ -1890,6 +2070,42 @@ WebKitWebWindowFeatures* webkit_web_view_get_window_features(WebKitWebView* webV
}
/**
+ * webkit_web_view_get_title:
+ * @web_view: a #WebKitWebView
+ *
+ * Returns the @web_view's document title
+ *
+ * Since: 1.1.4
+ *
+ * Return value: the title of @web_view
+ */
+G_CONST_RETURN gchar* webkit_web_view_get_title(WebKitWebView* webView)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
+
+ WebKitWebViewPrivate* priv = webView->priv;
+ return priv->mainFrame->priv->title;
+}
+
+/**
+ * webkit_web_view_get_uri:
+ * @web_view: a #WebKitWebView
+ *
+ * Returns the current URI of the contents displayed by the @web_view
+ *
+ * Since: 1.1.4
+ *
+ * Return value: the URI of @web_view
+ */
+G_CONST_RETURN gchar* webkit_web_view_get_uri(WebKitWebView* webView)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
+
+ WebKitWebViewPrivate* priv = webView->priv;
+ return priv->mainFrame->priv->uri;
+}
+
+/**
* webkit_web_view_set_maintains_back_forward_list:
* @web_view: a #WebKitWebView
* @flag: to tell the view to maintain a back or forward list
@@ -2048,13 +2264,29 @@ gboolean webkit_web_view_can_go_forward(WebKitWebView* webView)
return TRUE;
}
+/**
+ * webkit_web_view_open:
+ * @web_view: a #WebKitWebView
+ * @uri: an URI
+ *
+ * Requests loading of the specified URI string.
+ *
+ * Deprecated: 1.1.1: Use webkit_web_view_load_uri() instead.
+ */
void webkit_web_view_open(WebKitWebView* webView, const gchar* uri)
{
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
g_return_if_fail(uri);
- Frame* frame = core(webView)->mainFrame();
- frame->loader()->load(ResourceRequest(KURL(String::fromUTF8(uri))));
+ // We used to support local paths, unlike the newer
+ // function webkit_web_view_load_uri
+ if (g_path_is_absolute(uri)) {
+ gchar* fileUri = g_strdup_printf("file://%s", uri);
+ webkit_web_view_load_uri(webView, fileUri);
+ g_free(fileUri);
+ }
+ else
+ webkit_web_view_load_uri(webView, uri);
}
void webkit_web_view_reload(WebKitWebView* webView)
@@ -2079,20 +2311,57 @@ void webkit_web_view_reload_bypass_cache(WebKitWebView* webView)
core(webView)->mainFrame()->loader()->reload(true);
}
-void webkit_web_view_load_string(WebKitWebView* webView, const gchar* content, const gchar* contentMimeType, const gchar* contentEncoding, const gchar* baseUri)
+/**
+ * webkit_web_view_load_uri:
+ * @web_view: a #WebKitWebView
+ * @uri: an URI string
+ *
+ * Requests loading of the specified URI string.
+ *
+ * Since: 1.1.1
+ */
+void webkit_web_view_load_uri(WebKitWebView* webView, const gchar* uri)
{
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
- g_return_if_fail(content);
+ g_return_if_fail(uri);
- Frame* frame = core(webView)->mainFrame();
+ WebKitWebFrame* frame = webView->priv->mainFrame;
+ webkit_web_frame_load_uri(frame, uri);
+}
- KURL url(baseUri ? String::fromUTF8(baseUri) : "");
- RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(content, strlen(content));
- SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL("about:blank"), url);
+/**
++ * webkit_web_view_load_string:
++ * @web_view: a #WebKitWebView
++ * @content: an URI string
++ * @mime_type: the MIME type, or %NULL
++ * @encoding: the encoding, or %NULL
++ * @base_uri: the base URI for relative locations
++ *
++ * Requests loading of the given @content with the specified @mime_type,
++ * @encoding and @base_uri.
++ *
++ * If @mime_type is %NULL, "text/html" is assumed.
++ *
++ * If @encoding is %NULL, "UTF-8" is assumed.
++ */
+void webkit_web_view_load_string(WebKitWebView* webView, const gchar* content, const gchar* mimeType, const gchar* encoding, const gchar* baseUri)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+ g_return_if_fail(content);
- frame->loader()->load(ResourceRequest(url), substituteData);
+ WebKitWebFrame* frame = webView->priv->mainFrame;
+ webkit_web_frame_load_string(frame, content, mimeType, encoding, baseUri);
}
-
+/**
+ * webkit_web_view_load_html_string:
+ * @web_view: a #WebKitWebView
+ * @content: an URI string
+ * @base_uri: the base URI for relative locations
+ *
+ * Requests loading of the given @content with the specified @base_uri.
+ *
+ * Deprecated: 1.1.1: Use webkit_web_view_load_string() instead.
+ */
void webkit_web_view_load_html_string(WebKitWebView* webView, const gchar* content, const gchar* baseUri)
{
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
@@ -2101,6 +2370,28 @@ void webkit_web_view_load_html_string(WebKitWebView* webView, const gchar* conte
webkit_web_view_load_string(webView, content, NULL, NULL, baseUri);
}
+/**
+ * webkit_web_view_load_request:
+ * @web_view: a #WebKitWebView
+ * @request: a #WebKitNetworkRequest
+ *
+ * Requests loading of the specified asynchronous client request.
+ *
+ * Creates a provisional data source that will transition to a committed data
+ * source once any data has been received. Use webkit_web_view_stop_loading() to
+ * stop the load.
+ *
+ * Since: 1.1.1
+ */
+void webkit_web_view_load_request(WebKitWebView* webView, WebKitNetworkRequest* request)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+ g_return_if_fail(WEBKIT_IS_NETWORK_REQUEST(request));
+
+ WebKitWebFrame* frame = webView->priv->mainFrame;
+ webkit_web_frame_load_request(frame, request);
+}
+
void webkit_web_view_stop_loading(WebKitWebView* webView)
{
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
@@ -2673,4 +2964,89 @@ void webkit_web_view_set_full_content_zoom(WebKitWebView* webView, gboolean zoom
g_object_notify(G_OBJECT(webView), "full-content-zoom");
}
+/**
+ * webkit_get_default_session:
+ *
+ * Retrieves the default #SoupSession used by all web views.
+ * Note that the session features are added by WebKit on demand,
+ * so if you insert your own #SoupCookieJar before any network
+ * traffic occurs, WebKit will use it instead of the default.
+ *
+ * Return value: the default #SoupSession
+ *
+ * Since: 1.1.1
+ */
+SoupSession* webkit_get_default_session ()
+{
+ return ResourceHandle::defaultSession();
+}
+
+}
+
+/**
+ * webkit_web_view_get_encoding:
+ * @web_view: a #WebKitWebView
+ *
+ * Returns the default encoding of the #WebKitWebView.
+ *
+ * Return value: the default encoding
+ *
+ * Since: 1.1.1
+ */
+const gchar* webkit_web_view_get_encoding(WebKitWebView* webView)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
+
+ String encoding = core(webView)->mainFrame()->loader()->encoding();
+
+ if (!encoding.isEmpty()) {
+ WebKitWebViewPrivate* priv = webView->priv;
+ g_free(priv->encoding);
+ priv->encoding = g_strdup(encoding.utf8().data());
+ return priv->encoding;
+ } else
+ return NULL;
+}
+
+/**
+ * webkit_web_view_set_custom_encoding:
+ * @web_view: a #WebKitWebView
+ * @encoding: the new encoding, or %NULL to restore the default encoding
+ *
+ * Sets the current #WebKitWebView encoding, without modifying the default one,
+ * and reloads the page.
+ *
+ * Since: 1.1.1
+ */
+void webkit_web_view_set_custom_encoding(WebKitWebView* webView, const char* encoding)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+
+ core(webView)->mainFrame()->loader()->reloadWithOverrideEncoding(String::fromUTF8(encoding));
+}
+
+/**
+ * webkit_web_view_get_custom_encoding:
+ * @web_view: a #WebKitWebView
+ *
+ * Returns the current encoding of the #WebKitWebView, not the default-encoding
+ * of WebKitWebSettings.
+ *
+ * Return value: a string containing the current custom encoding for @web_view, or %NULL if there's none set.
+ *
+ * Since: 1.1.1
+ */
+const char* webkit_web_view_get_custom_encoding(WebKitWebView* webView)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
+
+ String overrideEncoding = core(webView)->mainFrame()->loader()->documentLoader()->overrideEncoding();
+
+ if (!overrideEncoding.isEmpty()) {
+ WebKitWebViewPrivate* priv = webView->priv;
+ g_free (priv->customEncoding);
+ priv->customEncoding = g_strdup(overrideEncoding.utf8().data());
+ return priv->customEncoding;
+ } else
+ return NULL;
}
diff --git a/WebKit/gtk/webkit/webkitwebview.h b/WebKit/gtk/webkit/webkitwebview.h
index 2bb8c61..1455a79 100644
--- a/WebKit/gtk/webkit/webkitwebview.h
+++ b/WebKit/gtk/webkit/webkitwebview.h
@@ -23,6 +23,7 @@
#define WEBKIT_WEB_VIEW_H
#include <gtk/gtk.h>
+#include <libsoup/soup.h>
#include <JavaScriptCore/JSBase.h>
#include <webkit/webkitdefines.h>
@@ -49,8 +50,8 @@ typedef enum {
typedef enum
{
- WEBKIT_WEB_VIEW_TARGET_INFO_HTML = - 1,
- WEBKIT_WEB_VIEW_TARGET_INFO_TEXT = - 2
+ WEBKIT_WEB_VIEW_TARGET_INFO_HTML,
+ WEBKIT_WEB_VIEW_TARGET_INFO_TEXT
} WebKitWebViewTargetInfo;
struct _WebKitWebView {
@@ -126,6 +127,12 @@ webkit_web_view_get_type (void);
WEBKIT_API GtkWidget *
webkit_web_view_new (void);
+WEBKIT_API G_CONST_RETURN gchar *
+webkit_web_view_get_title (WebKitWebView *web_view);
+
+WEBKIT_API G_CONST_RETURN gchar *
+webkit_web_view_get_uri (WebKitWebView *web_view);
+
WEBKIT_API void
webkit_web_view_set_maintains_back_forward_list (WebKitWebView *web_view,
gboolean flag);
@@ -171,10 +178,14 @@ WEBKIT_API void
webkit_web_view_reload_bypass_cache (WebKitWebView *web_view);
WEBKIT_API void
+webkit_web_view_load_uri (WebKitWebView *web_view,
+ const gchar *uri);
+
+WEBKIT_API void
webkit_web_view_load_string (WebKitWebView *web_view,
const gchar *content,
- const gchar *content_mime_type,
- const gchar *content_encoding,
+ const gchar *mime_type,
+ const gchar *encoding,
const gchar *base_uri);
WEBKIT_API void
@@ -182,6 +193,10 @@ webkit_web_view_load_html_string (WebKitWebView *web_view,
const gchar *content,
const gchar *base_uri);
+WEBKIT_API void
+webkit_web_view_load_request (WebKitWebView *web_view,
+ WebKitNetworkRequest *request);
+
WEBKIT_API gboolean
webkit_web_view_search_text (WebKitWebView *web_view,
const gchar *text,
@@ -296,6 +311,19 @@ WEBKIT_API void
webkit_web_view_set_full_content_zoom (WebKitWebView *web_view,
gboolean full_content_zoom);
+WEBKIT_API SoupSession*
+webkit_get_default_session (void);
+
+WEBKIT_API const gchar*
+webkit_web_view_get_encoding (WebKitWebView * webView);
+
+WEBKIT_API void
+webkit_web_view_set_custom_encoding (WebKitWebView * webView,
+ const gchar * encoding);
+
+WEBKIT_API const char*
+webkit_web_view_get_custom_encoding (WebKitWebView * webView);
+
G_END_DECLS
#endif
diff --git a/WebKit/gtk/webkitmarshal.list b/WebKit/gtk/webkitmarshal.list
new file mode 100644
index 0000000..b714a7c
--- /dev/null
+++ b/WebKit/gtk/webkitmarshal.list
@@ -0,0 +1,17 @@
+BOOLEAN:INT,INT,STRING
+BOOLEAN:OBJECT
+BOOLEAN:OBJECT,OBJECT,OBJECT,OBJECT
+BOOLEAN:OBJECT,OBJECT,STRING,OBJECT
+BOOLEAN:OBJECT,STRING
+BOOLEAN:OBJECT,STRING,POINTER
+BOOLEAN:OBJECT,STRING,STRING,STRING
+BOOLEAN:STRING,INT,STRING
+BOOLEAN:VOID
+ENUM:OBJECT,OBJECT
+OBJECT:OBJECT
+OBJECT:VOID
+VOID:OBJECT,OBJECT
+VOID:OBJECT,POINTER,POINTER
+VOID:OBJECT,STRING
+VOID:STRING
+VOID:STRING,STRING
diff --git a/WebKit/mac/Carbon/CarbonUtils.h b/WebKit/mac/Carbon/CarbonUtils.h
index f005286..166de7b 100644
--- a/WebKit/mac/Carbon/CarbonUtils.h
+++ b/WebKit/mac/Carbon/CarbonUtils.h
@@ -45,12 +45,12 @@ extern "C" {
#endif
extern void
-WebInitForCarbon(void) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
+WebInitForCarbon(void) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
#ifdef __OBJC__
extern CGImageRef
-WebConvertNSImageToCGImageRef(NSImage * inImage) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
+WebConvertNSImageToCGImageRef(NSImage * inImage) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
#endif
diff --git a/WebKit/mac/Carbon/HIWebView.h b/WebKit/mac/Carbon/HIWebView.h
index 5483472..bc67453 100644
--- a/WebKit/mac/Carbon/HIWebView.h
+++ b/WebKit/mac/Carbon/HIWebView.h
@@ -67,7 +67,7 @@ extern "C" {
* Non-Carbon CFM: not available
*/
extern OSStatus
-HIWebViewCreate(HIViewRef * outControl) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
+HIWebViewCreate(HIViewRef * outControl) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
#ifdef __OBJC__
@@ -91,7 +91,7 @@ HIWebViewCreate(HIViewRef * outControl) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_B
* Non-Carbon CFM: not available
*/
extern WebView *
-HIWebViewGetWebView(HIViewRef inView) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
+HIWebViewGetWebView(HIViewRef inView) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
#endif
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 16a69b1..dbf2427 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,8 +1,1214 @@
-2009-02-18 Mark Rowe <mrowe@apple.com>
+2009-03-26 Jungshik Shin <jshin@chromium.org>
- Merge r41071.
+ Reviewed by Alexey Proskuryakov.
+
+ Add WebPreferences for encoding autodetection on Mac.
+
+ http://bugs.webkit.org/show_bug.cgi?id=16482
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences usesEncodingDetector]):
+ (-[WebPreferences setUsesEncodingDetector:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2009-03-26 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ - Fix <rdar://problem/6687055> and <rdar://problem/6713639>.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCInvalidateRect):
+ Call NetscapePluginInstanceProxy::invalidateRect.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::cleanup):
+ Stop the request timer, set m_pluginView to nil.
+
+ (WebKit::NetscapePluginInstanceProxy::pluginHostDied):
+ No need to set m_pluginView to nil here anymore, it's now done in cleanup().
+
+ (WebKit::NetscapePluginInstanceProxy::performRequest):
+ (WebKit::NetscapePluginInstanceProxy::requestTimerFired):
+ Assert that the plug-in view is not nil.
+
+ (WebKit::NetscapePluginInstanceProxy::invalidateRect):
+ Call setNeedsDisplayInRect here.
+
+2009-03-25 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/6714964>
+ CrashTracer: [REGRESSION] 51 crashes in Safari at com.apple.WebKit • WebNetscapePluginStream::deliverData + 775
+
+ Don't release m_deliveryData since it's a RetainPtr. Also, use adoptNS instead of releasing newDeliveryData manually.
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::deliverData):
+
+2009-03-25 Mike Thole <mthole@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ <rdar://problem/6453738> call SetWindow when user creates a new tab
+
+ CoreGraphics plug-ins now receive an NPP_SetWindow call when moving to a background tab.
+ Flash is excluded from this change in behavior, as it has historical WebKit-specific code
+ that isn't compatible with this change.
+
+ * Plugins/WebNetscapePluginView.h:
+ Added an _isFlash ivar.
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView _createPlugin]):
+ Set the new _isFlash ivar based on the bundle identifier.
+ (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]):
+ When using the CG drawing model and in a non-drawable state, set the portState
+ to NULL and return early.
+ (-[WebNetscapePluginView updateAndSetWindow]):
+ When using the CG drawing model, call -setWindowIfNecessary even if the portState is NULL.
+ Flash is an exception to this, due to its historical behavior.
+ (-[WebNetscapePluginView setWindowIfNecessary]):
+ Removed an assertion that was no longer true. The [NSView focus] view
+ is no longer guaranteed to be 'self' at this point.
+ Also modified the debug logging for CG plug-ins to include the size of the
+ window's clipRect, which was useful in verifying the correct behavior of this patch.
+
+2009-03-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ - speculative fix for <rdar://problem/6630134> Crash at
+ Editor::compositionRange()
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView markedRange]): Null-check the Frame like most other
+ methods in this class.
+
+2009-03-23 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for <rdar://problem/6140966>
+ Empty Caches does not clear the Cross-site XMLHttpRequest preflight cache
+
+ * Misc/WebCache.mm:
+ (+[WebCache empty]):
+
+2009-03-23 Adele Peterson <adele@apple.com>
+
+ Reviewed by Mark Rowe & Dave Hyatt.
+
+ Merge some of the individual Mail quirks into two settings that we can check for future quirks.
+
+ * WebView/WebView.mm:
+ (runningLeopardMail):
+ (runningTigerMail):
+ (-[WebView _preferencesChangedNotification:]):
+
+2009-03-23 Darin Adler <darin@apple.com>
+
+ * WebView/WebTextIterator.h: Fixed a spelling error in a comment.
+
+2009-03-22 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - fix <rdar://problem/6640741> Messages not displaying after the
+ Safari 4 beta was installed
+
+ Mail assumes that if -[WebArchive subresources] is not nil, then it
+ contains at least one object.
+
+ * WebView/WebArchive.mm:
+ (-[WebArchive subresources]): Preserve the behavior of returning nil
+ if there are no subresources.
+
+2009-03-20 Adele Peterson <adele@apple.com>
+
+ Build fix.
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]):
+
+2009-03-20 Timothy Hatcher <timothy@apple.com>
+
+ Change how threading exceptions are checked so they are reported
+ by what round they were added. That way WebKit can decided the
+ behavior per-round based on linked-on-or-after checks.
+
+ <rdar://problem/6626741&6648478&6635474&6674079>
+
+ Reviewed by Darin Adler.
+
+ * History/WebBackForwardList.mm: Use the new WebCoreThreadViolationCheckRoundOne macro.
+ * History/WebHistoryItem.mm: Ditto.
+ * Misc/WebIconDatabase.mm: Ditto.
+
+ * WebView/WebArchive.mm: Use the new WebCoreThreadViolationCheckRoundTwo macro.
+ * WebView/WebResource.mm: Ditto.
+ (+[WebResource _needMailThreadWorkaroundIfCalledOffMainThread]): Check Mail's bundle version
+ to truly decide if it is an old Mail client.
+ * WebView/WebView.mm: Ditto.
+
+ * Misc/WebKitVersionChecks.h: Add a new linked-on-or-after version define.
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView initWithFrame:]): Set the default thread violation behavior per-round
+ based on difference version checks and the Mail workaround check.
+
+2009-03-20 Darin Adler <darin@apple.com>
+
+ Reviewed by Timothy Hatcher.
+
+ * WebView/WebTextIterator.h: Improved comments to point out some of the pitfalls
+ of this SPI.
+
+2009-03-20 Darin Adler <darin@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Use a better technique to handle finding out if something responds to a selector
+ in WebHTMLView's doCommandBySelector method.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView doCommandBySelector:]): Removed unneeded check for 0 coreFrame;
+ this is already handled by coreCommandBySelector: so doesn't need to be checked
+ twice. Got rid of initial value for eventWasHandled boolean to make it more clear.
+ Use WebResponderChainSink to find out if a command is handled rather than walking
+ the responder chain explicitly.
+ (-[WebResponderChainSink initWithResponderChain:]): Added.
+ (-[WebResponderChainSink detach]): Added.
+ (-[WebResponderChainSink receivedUnhandledCommand]): Added.
+ (-[WebResponderChainSink noResponderFor:]): Added.
+ (-[WebResponderChainSink doCommandBySelector:]): Added.
+
+2009-03-19 Timothy Hatcher <timothy@apple.com>
+
+ Remove #ifndef BUILDING_ON_TIGER around code that schedules runloop modes
+ for Page, so the new RunLoopTimer in WebCore always gets a default mode.
+ Fixes the layout test failures on the Tiger build bots.
+
+ Reviewed by Mark Rowe.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+ (-[WebView scheduleInRunLoop:forMode:]):
+ (-[WebView unscheduleFromRunLoop:forMode:]):
+
+2009-03-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ WebKit side of <rdar://problem/6688244>.
+
+ Try reinitializing the vendor port if it's invalid.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+
+2009-03-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/6504776>
+ CrashTracer: [USER] 188 crashes in Safari at com.apple.WebCore • WTF::HashTableIterator<WTF::RefPtr<WebCore::ResourceLoader>, ...
+
+ If the m_pluginView member was zeroed out as a result of making a call into the plug-in, the pluginFunctionCallDepth would be off
+ causing the plug-in never to be stopped. Simplify the code by using a RAII object.
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (PluginStopDeferrer::PluginStopDeferrer):
+ (PluginStopDeferrer::~PluginStopDeferrer):
+ (WebNetscapePluginStream::startStream):
+ (WebNetscapePluginStream::wantsAllStreams):
+ (WebNetscapePluginStream::destroyStream):
+
+2009-03-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ <rdar://problem/6687005> Need support for new move-left/right selectors.
+
+ * WebView/WebHTMLView.mm: Added the four new selectors to the command-forwarding list.
+ * WebView/WebView.mm: Ditto.
+
+2009-03-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Bug 24477: REGRESSION (r41467): Page Down key scrolls two pages
+ https://bugs.webkit.org/show_bug.cgi?id=24477
+ rdar://problem/6674184
+
+ * WebView/WebHTMLView.mm:
+ (responderChainRespondsToSelector): Added.
+ (-[WebHTMLView doCommandBySelector:]): Set eventWasHandled based on whether we
+ can find a responder that responds to this selector rather than always assuming
+ the selector will not be handled.
+
+2009-03-17 Mark Rowe <mrowe@apple.com>
+
+ Fix the build.
+
+ * Plugins/Hosted/HostedNetscapePluginStream.mm:
+
+2009-03-17 David Kilzer <ddkilzer@apple.com>
+
+ Use -[NSURLResponse(WebCoreURLResponse) _webcore_MIMEType] consistently
+
+ Reviewed by Darin Adler.
+
+ WebKit r30323 added -_webcore_MIMEType to fix issues with
+ incorrect MIME types in NS[HTTP]URLResponse objects. However,
+ uses of -[NSURLResponse MIMEType] still persist in WebKit that
+ should be switched to use -_webcore_MIMEType. Note that
+ -[WebDataSource _responseMIMEType] calls back into WebCore to
+ get the MIME type from the ResourceResponse object, which has
+ already retrieved it via -_webcore_MIMEType.
+
+ * Plugins/Hosted/HostedNetscapePluginStream.mm:
+ (WebKit::HostedNetscapePluginStream::didReceiveResponse): Use
+ -_webcore_MIMEType.
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::didReceiveResponse): Ditto.
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView pluginView:receivedData:]): Ditto.
+ * Plugins/WebPluginController.mm:
+ (-[WebPluginController pluginView:receivedResponse:]): Ditto.
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation _isDisplayingWebArchive]): Use
+ -[WebDataSource _responseMIMEType] instead.
+ * WebView/WebPDFRepresentation.m:
+ (-[WebPDFRepresentation finishedLoadingWithDataSource:]): Ditto.
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView menuForEvent:]): Ditto.
+
+2009-03-17 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler
+
+ https://bugs.webkit.org/show_bug.cgi?id=24396
+
+ Add WTF_USE_ACCELERATED_COMPOSITING, defined to 0 for now.
+
+ * WebKitPrefix.h:
+
+2009-03-17 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Mark Rowe.
+
+ Get BUILDING_ON_* defines from Platform.h.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24630
+
+ * WebKitPrefix.h:
+
+2009-03-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/6577174> Rename the text directionality submenus to “Paragraph Direction” and “Selection Direction”
+
+ * WebCoreSupport/WebViewFactory.mm:
+ (-[WebViewFactory contextMenuItemTagParagraphDirectionMenu]): Changed string here, but only
+ post-Leopard, since we want this to match the Mac OS X menu on Tiger and Leopard.
+ (-[WebViewFactory contextMenuItemTagSelectionDirectionMenu]): Changed string here.
+
+2009-03-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Don't mig_deallocate random data in case an instance proxy method returns false.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCEvaluate):
+ (WKPCInvoke):
+ (WKPCInvokeDefault):
+ (WKPCGetProperty):
+ (WKPCEnumerate):
+
+2009-03-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ <rdar://problem/6633944>
+ REGRESSION (Safari 4 PB): Many crashes in Flip4Mac involving loading the plugin
+
+ Defer loading while calling webPlugInInitialize since it can end up spinning the run loop.
+
+ * Plugins/WebPluginController.mm:
+ (-[WebPluginController addPlugin:]):
+
+2009-03-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fix <rdar://problem/6622601>
+
+ Make sure to update both the window frame and the plug-in frame.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView addWindowObservers]):
+
+2009-03-15 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ - fix <rdar://problem/6607773> WebKit should support the "Default"
+ paragraph writing direction -- or at least validate the menu item
+ appropriately
+
+ Made WebHTMLView validate user interface items with the selector
+ -makeBaseWritingDirectionNatural: by returning NO and, if the item is
+ a menu item, setting its state to "off".
+
+ Strictly speaking, since -makeBaseWritingDirectionNatural: is never
+ valid for WebViews, WebHTMLView should not need to respond to it and
+ validate it, however because other responders respond to all three
+ -makeBaseWritingDirection*: messages and set the menu item state, having
+ WebHTMLView do the same makes application developers' lives easier.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
+ (-[WebHTMLView makeBaseWritingDirectionNatural:]):
+
+2009-03-13 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Dan Bernstein.
+
+ Take advantage of the ability of recent versions of Xcode to easily switch the active
+ architecture.
+
+ * Configurations/DebugRelease.xcconfig:
+
+2009-03-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker and Geoffrey Garen.
+
+ <rdar://problem/6590384>
+ REGRESSION (Safari 3-4): Tiger-only Crash occurs at WebView hostWindow () after reloading a set of tabs then quitting
+
+ When we're doing fast teardown, plug-in views can be destroyed from -[WebView dealloc]'s [super dealloc] call,
+ and thus calling -[WebView hostWindow] will crash since _private is nil.
+
+ * WebView/WebView.mm:
+ (-[WebView hostWindow]):
+
+2009-03-13 Anders Carlsson <andersca@apple.com>
+
+ And yet another attempt...
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.h:
+ (WebNetscapePluginEventHandlerCocoa::installKeyEventHandler):
+ (WebNetscapePluginEventHandlerCocoa::removeKeyEventHandler):
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+
+2009-03-13 Anders Carlsson <andersca@apple.com>
+
+ Another attempt at fixing the build.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa):
+
+2009-03-13 Anders Carlsson <andersca@apple.com>
+
+ Try to fix the SL build.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.h:
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::keyDown):
+
+2009-03-13 Greg Bolsinga <bolsinga@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Update Geolocation perimission dialogs to be asynchronous.
+ https://bugs.webkit.org/show_bug.cgi?id=24505
+
+ WebGeolocation is a wrapper around WebCore::Geolocation. It mimics the
+ coding style set by WebSecurityOrigin.
+
+ WebChromeClient now calls the private UI delegate method
+ -webView:frame:requestGeolocationPermission:securityOrigin:
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::requestGeolocationPermissionForFrame):
+ * WebCoreSupport/WebGeolocation.mm: Added.
+ (WebCore::if):
+ (-[WebGeolocation shouldClearCache]):
+ (-[WebGeolocation setIsAllowed:]):
+ (-[WebGeolocation dealloc]):
+ * WebCoreSupport/WebGeolocationInternal.h: Added.
+ * WebCoreSupport/WebGeolocationPrivate.h: Added.
+ * WebView/WebUIDelegatePrivate.h:
+
+2009-03-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/6610666> Revise the Cocoa event model text API
+
+ Replace the text input API with a simpler API that uses a separate text input window.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.h:
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa):
+ Initialize m_keyEventHandler to 0.
+
+ (WebNetscapePluginEventHandlerCocoa::keyDown):
+ If the plug-in returns 0 from NPP_HandleEvent, pass the event to the TSM machinery.
+
+ (WebNetscapePluginEventHandlerCocoa::focusChanged):
+ Install/remove the key event handler as needed.
+
+ (WebNetscapePluginEventHandlerCocoa::handleTSMEvent):
+ Get the text and send a TextInput event.
+
+ * Plugins/WebNetscapePluginView.h:
+ * Plugins/WebNetscapePluginView.mm:
+ Remove the old text input API.
+
+ (-[WebNetscapePluginView inputContext]):
+ Always return nil here.
+
+ * Plugins/npapi.mm:
+ * Plugins/nptextinput.h: Removed.
+
+2009-03-12 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mike Thole and Mark Rowe.
+
+ Fix <rdar://problem/6624105>.
+
+ Make sure to process incoming messages for the NSEventTrackingRunLoopMode as well.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
+
+2009-03-12 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ WebKit side of <rdar://problem/6607801>
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::destroy):
+ Pass a requestID to _WKPCDestroyPluginInstance and wait until we get a reply back.
+
+ * Plugins/Hosted/WebKitPluginHost.defs:
+ Add requestID parameter.
+
+2009-03-12 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage _unloadWithShutdown:]): Simply a small SUPPORT_CFM code block.
+
+2009-03-12 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Fixed: <rdar://problem/5815862> Opening a subclassed NSWindow from a Safari plugin causes Safari to crash on Quit
+
+ This fix addresses crashes in both Silverlight and ChemDraw. This type of crash would occur because AppKit still
+ had a reference to open windows that the plugin created (which no longer exist).
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage _unloadWithShutdown:]): Do not unload the plug-in bundle on browser shutdown.
+
+2009-03-11 David Kilzer <ddkilzer@apple.com>
+
+ Remove duplicate header include
+
+ Rubber-stamped by Mark Rowe.
+
+ * WebView/WebView.mm: Remove duplicate #include <runtime/InitializeThreading.h>.
+ Also realphabetized lowercase #include statements.
+
+2009-03-11 David Kilzer <ddkilzer@apple.com>
+
+ Clarify comments regarding order of FEATURE_DEFINES
+
+ Rubber-stamped by Mark Rowe.
+
+ * Configurations/WebKit.xcconfig: Added warning about the
+ consequences when FEATURE_DEFINES are not kept in sync.
+
+2009-03-11 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKit side of <rdar://problem/6656147>.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::instantiatePlugin):
+ Pass the requestID to _WKPHInstantiatePlugin.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ Pass the requestID to setCurrentReply.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ (WebKit::NetscapePluginInstanceProxy::setCurrentReply):
+ Store the reply in a map with the requestID as the key.
+
+ (WebKit::NetscapePluginInstanceProxy::waitForReply):
+ Wait for a reply that matches the given requestID.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
+ Initialize member variables.
+
+ (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy):
+ Delete all requests.
+
+ (WebKit::NetscapePluginInstanceProxy::print):
+ Pass the requestID to _WKPHPluginInstancePrint.
+
+ (WebKit::NetscapePluginInstanceProxy::loadRequest):
+ Rename m_currentRequestID to m_currentURLRequestID.
+
+ (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply):
+ Process requests until we find a reply with the right requestID.
+
+ (WebKit::NetscapePluginInstanceProxy::createBindingsInstance):
+ Pass a requestID to the _WKPH function.
+
+ (WebKit::NetscapePluginInstanceProxy::nextRequestID):
+ Ditto.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ Pass a requestID to the _WKPH functions.
+
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/Hosted/WebKitPluginHost.defs:
+ Add requestID parameters.
+
+2009-03-11 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix <rdar://problem/6620064>.
+
+ * Plugins/WebPluginContainerPrivate.h:
+
+2009-03-10 Xan Lopez <xlopez@igalia.com>
+
+ Build fix, no review.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _smartDeleteRangeForProposedRange:]):
+
+2009-03-09 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ WebKit side of <rdar://problem/6530007>
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCEnumerate):
+ Call NetscapePluginInstanceProxy::enumerate.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::enumerate):
+ Enumerate the JS object and serialize its values.
+
+ * Plugins/Hosted/ProxyInstance.h:
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::getPropertyNames):
+ Ask the plug-in host to get the property names and deserialize them.
+
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/Hosted/WebKitPluginHost.defs:
+
+2009-03-09 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Oliver Hunt and Cameron Zwarich
+
+ https://bugs.webkit.org/show_bug.cgi?id=24440
+
+ The sublayer added to WebHTMLView to host accelerated compositing layers needs to
+ be a subclass of NSView which allows context menu clicks through.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebLayerHostingView rightMouseDown:]):
+ (-[WebHTMLView attachRootLayer:]):
+
+2009-03-08 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Split ScrollAlignment and ScrollBehavior out of RenderLayer.h so that
+ Frame.h no longer needs to include it. This cuts the size of the symbols
+ for a debug build by around 3%.
+
+ * Plugins/WebNetscapePluginView.mm:
+ * WebView/WebFrame.mm:
+ (-[WebFrame _scrollDOMRangeToVisible:]):
+ (-[WebFrame _insertParagraphSeparatorInQuotedContent]):
+ (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView jumpToSelection:]):
+ (-[WebHTMLView centerSelectionInVisibleArea:]):
+
+2009-03-07 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ - fix a bug where debug builds were clearing the HTML5 application cache
+ on application termination
+
+ * WebView/WebView.mm:
+ (-[WebView _close]): Call -[WebCache setDisabled:YES] instead of
+ -[WebCache empty].
+
+2009-03-06 Douglas R. Davidson <ddavidso@apple.com>
+
+ Reviewed by Justin Garcia.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24108
+
+ Update spelling and grammar checking to use the new combined text
+ checking (with automatic language identification) on Snow Leopard.
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::checkSpellingAndGrammarOfParagraph):
+
+2009-03-05 Adele Peterson <adele@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=24079
+ <rdar://problem/6611233> REGRESSION (r39549): Page loads cannot be interrupted with Command-. or Escape
+ <rdar://problem/6636563> Ctrl-tab shortcut doesn't switch tabs when focus is in text field
+
+ * WebView/WebHTMLView.mm: (-[WebHTMLView doCommandBySelector:]):
+ If WebKit does not support the command, we need to pass the selector to super. In this case,
+ we'll consider the event not to be handled. This is not perfect because in theory, [super doCommandBySelector:]
+ can do some action that would cause WebKit to need to consider the event handled. But in practice, I've found no
+ example of that happening and causing broken behavior.
+
+2009-03-04 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/6206172> Adoption of new Cocoa API for dictionary contextual menu
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+
+2009-03-04 Adam Barth <abath@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24356
+
+ Fix WebKit style for allowUniversalAccessFromFileURLs.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences allowUniversalAccessFromFileURLs]):
+ (-[WebPreferences setAllowUniversalAccessFromFileURLs:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2009-03-03 David Kilzer <ddkilzer@apple.com>
+
+ <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase
+
+ Reviewed by Mark Rowe.
+
+ The fix is to add INSTALLHDRS_COPY_PHASE = YES and
+ INSTALLHDRS_SCRIPT_PHASE = YES to WebKit.xcconfig, then to
+ make sure various build phase scripts work with the installhdrs
+ build phase.
+
+ * Configurations/Base.xcconfig: Defined REAL_PLATFORM_NAME
+ based on PLATFORM_NAME to work around the missing definition on
+ Tiger.
+ * Configurations/WebKit.xcconfig: Added
+ WEBCORE_PRIVATE_HEADERS_DIR variable to remove definition of
+ UMBRELLA_FRAMEWORKS_DIR for Debug and Release builds in the
+ Xcode project file. Added INSTALLHDRS_COPY_PHASE = YES and
+ INSTALLHDRS_SCRIPT_PHASE = YES.
+
+2009-03-03 David Kilzer <ddkilzer@apple.com>
+
+ Remove last vestiges of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR from WebKit
+
+ Reviewed by Adam Roben.
+
+ Use of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR was removed in r37465
+ since NPAPI headers had migrated from JavaScriptCore to WebCore
+ before that.
+
+ * Configurations/WebKit.xcconfig: Removed definition of
+ JAVASCRIPTCORE_PRIVATE_HEADERS_DIR used in Production builds.
+
+2009-03-03 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix <rdar://problem/6633834>.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::instantiatePlugin):
+ Create a new plug-in instance if the plug-in host has crashed.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::invalidate):
+ Add a null check for the plug-in host proxy.
+
+2009-03-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Enable Geolocation (except on Tiger and Leopard).
+
+ * Configurations/WebKit.xcconfig:
+
+2009-03-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ WebKit part of <rdar://problem/6638658>.
+
+ * Plugins/Hosted/NetscapePluginHostManager.h:
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::createPropertyListFile):
+ Spawn the plug-in host and wait for it to create the property list.
+
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage createPropertyListFile]):
+ Factor code out into a new method.
+
+ (-[WebBasePluginPackage pListForPath:createFile:]):
+ Call the newly added createPropertyListFile method.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage createPropertyListFile]):
+ Tell the plug-in host manager to create a property list file for us.
+
+2009-03-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Geoffrey Garen.
+
+ Fix for <rdar://problem/6507404> Add Geolocation support.
+
+ This is not yet turned on for any Mac platform.
+
+ Add SPI to ask the embedding application whether to allow
+ Geolocation for an origin.
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::shouldAllowGeolocationForFrame):
+ * WebView/WebUIDelegatePrivate.h:
+
+2009-03-02 Anders Carlsson <andersca@apple.com>
+
+ Fix PowerPC build.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage _tryLoad]):
+
+2009-03-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by John Sullivan, Ada Chan.
+
+ Factor loading code out into its own method and get rid of a bunch of gotos.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage _tryLoad]):
+ (-[WebNetscapePluginPackage load]):
+
+2009-03-02 Anders Carlsson <andersca@apple.com>
+
+ Build fix.
+
+ * Plugins/WebNetscapeDeprecatedFunctions.h:
+
+2009-03-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Rename WebNetscapePluginPackage.m to WebNetscapePluginPackage.mm
+
+ * Plugins/WebNetscapePluginPackage.m: Removed.
+ * Plugins/WebNetscapePluginPackage.mm: Copied from mac/Plugins/WebNetscapePluginPackage.m.
+
+2009-03-01 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKit side of <rdar://problem/6449689>
+
+ Pass the visible name to the plug-in host.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+
+2009-02-27 Alice Liu <alice.liu@apple.com>
+
+ Fix <rdar://problem/6531265> REGRESSION (r39185): adding ".jpeg"
+ extension to images that already have .jpg extension
+
+ Reviewed by Oliver Hunt.
+
+ * WebView/WebHTMLView.mm:
+ (-[NSString matchesExtensionEquivalent:]):
+ (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
+ Relax the check for the proper extension to allow for known
+ equivalents, special-cased in matchesExtensionEquivalent function.
+
+2009-02-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ <rdar://problem/6631436>
+ CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit • WebKit::NetscapePluginInstanceProxy::addValueToArray + 55
+
+ Port the NPN_Evaluate code over from WebCore instead of using the frame loader.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::evaluate):
+
+2009-02-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ WebKit side of <rdar://problem/6626814>.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCInvokeDefault):
+ Make InvokeDefault async.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::addValueToArray):
+ Handle passing NPObjects back to the plug-in host.
+
+ * Plugins/Hosted/ProxyInstance.h:
+ (WebKit::ProxyInstance::objectID):
+ Add objectID getter.
+
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ Make InvokeDefault a simpleroutine.
+
+2009-02-27 Timothy Hatcher <timothy@apple.com>
+
+ Fixes an exception by null checking the WebResource before adding it to
+ the subresources array.
+
+ <rdar://problem/5950769> Bug in [WebDataSource subresources] can throw an exception
+
+ Reviewed by Geoff Garen and Anders Carlsson.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource subresources]): Null check the WebResource before adding it.
+
+2009-02-27 Timothy Hatcher <timothy@apple.com>
+
+ Adds a workaround for Automator creating a WebView from a secondary thread.
+
+ <rdar://problem/6631951> REGRESSION (Safari 4 Beta): Automator crash on
+ secondary thread beneath -[WebView initWithFrame:frameName:groupName:]
+
+ Reviewed by Geoff Garen.
+
+ * WebView/WebView.mm:
+ (needsWebViewInitThreadWorkaround): Check for com.apple.Automator.
+
+2009-02-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a preference to reduce the power of file:// URLs.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences allowUniversalAccessFromFileUrls]):
+ (-[WebPreferences setAllowUniversalAccessFromFileUrls:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2009-02-27 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Anders Carlsson
+
+ https://bugs.webkit.org/show_bug.cgi?id=24242
+
+ setCursor(), and resetCursorRects() on Tiger, were using global, not local
+ coordinates for elementAtPoint:
+
+ * WebView/WebHTMLView.mm:
+ (resetCursorRects):
+ (setCursor):
+
+2009-02-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a preference to reduce the power of file:// URLs.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences allowUniversalAccessFromFileUrls]):
+ (-[WebPreferences setAllowUniversalAccessFromFileUrls:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2009-02-26 Adele Peterson <adele@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Fix for <rdar://problem/6618166>
+ https://bugs.webkit.org/show_bug.cgi?id=24216
+ (REGRESSION r36919) Safari 4 Beta causes MSN Messenger's text entry field to lose focus after entering a message
+
+ During a series of firstResponder changes, at some point while the WebHTMLView was losing first responder status,
+ we incorrectly marked the page as active, and then when the WebHTMLView became first responder again, setActive did nothing.
+ This change restores behavior from before r36919 to check if the WebHTMLView is in the middle of losing first responder when calling setActive.
+
+ In addition to updating editing/selection/designmode-no-caret.html results, I also made sure the test cases that were
+ fixed in r36919 and r38570 are still fixed.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView resignFirstResponder]): Keep track if we're in the process of resigning first responder.
+ (-[WebHTMLView _isResigningFirstResponder]): Added.
+ * WebView/WebHTMLViewInternal.h:
+ * WebView/WebView.mm: (-[WebView _updateFocusedAndActiveStateForFrame:]): Don't set the page to be active
+ if the document view is currently resigning first responder.
+
+2009-02-25 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ Fix <rdar://problem/6623697>.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::print):
+ Ask the plug-in host to print, create a CGImage of the returned bytes and draw
+ the image into the passed in context.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView drawRect:]):
+ When printing, call NetscapePluginInstanceProxy::print.
+
+ * Plugins/Hosted/WebKitPluginHost.defs:
+
+2009-02-19 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24024
+ REGRESSION (r39845): Assertion failure in -[WebHistoryItem dictionaryRepresentation] when
+ archiving a submission to about:blank
+
+ I don't know how to make an automated test for this bug.
+
+ * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
+ Account for the fact that HTTP method may be non-empty for non-HTTP requests.
+
+2009-02-25 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ Naming change from
+ Bug 24143: Crash occurs at WebCore::AccessibilityTable::isTableExposableThroughAccessibility() when applying a link in GMail
+ https://bugs.webkit.org/show_bug.cgi?id=24143
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _accessibilityTree]):
+
+2009-02-25 Simon Fraser <simon.fraser@apple.com>
+
+ Build fix with ACCELERATED_COMPOSITING turned on.
+
+ I missed a spot in my last commit in renaming to
+ _stoppedAcceleratedCompositingForFrame:
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView close]):
+
+2009-02-25 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein
+
+ https://bugs.webkit.org/show_bug.cgi?id=23854
+
+ Make an observable property, _isUsingAcceleratedCompositing, on
+ WebView that DumpRenderTree can use to specialize behavior.
+
+ This is implemented via a count of Frames that are using
+ accelerated compositing.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLViewPrivate clear]):
+ (-[WebHTMLView close]):
+ (-[WebHTMLView attachRootLayer:]):
+ (-[WebHTMLView detachRootLayer]):
+ * WebView/WebView.mm:
+ (+[WebView automaticallyNotifiesObserversForKey:]):
+ (-[WebView _startedAcceleratedCompositingForFrame:]):
+ (-[WebView _stoppedAcceleratedCompositingForFrame:]):
+ (-[WebView _isUsingAcceleratedCompositing]):
+ * WebView/WebViewInternal.h:
+ * WebView/WebViewPrivate.h:
+
+2009-02-24 Sam Weinig <sam@webkit.org>
- 2009-02-18 Dan Bernstein <mitz@apple.com>
+ Reviewed by Geoffrey Garen.
+
+ Related to <rdar://problem/6590295>
+ Allow disabling javascript: urls.
+
+ * WebView/WebView.mm:
+ (-[WebView _setJavaScriptURLsAreAllowed:]):
+ * WebView/WebViewPrivate.h:
+
+2009-02-24 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros
+
+ * Carbon/CarbonUtils.h:
+ * Carbon/HIWebView.h:
+ * Plugins/WebPlugin.h:
+ * Plugins/WebPluginViewFactory.h:
+ * WebView/WebUIDelegate.h:
+
+2009-02-24 Peter Ammon <pammon@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Fix <rdar://problem/6251410> Services can modify non-editable content in Safari
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView validRequestorForSendType:returnType:]): Return self only if we can handle
+ both the send and return type. We should also handle a nil send or return type by ignoring
+ the argument and returning whether we can handle the other type passed in.
+
+2009-02-23 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Geoffrey Garen and Darin Adler.
+
+ WebKit side of <rdar://problem/6613151>.
+
+ Make sure to vm_deallocate all memory we get from MIG callbacks.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (DataDeallocator::DataDeallocator):
+ (DataDeallocator::~DataDeallocator):
+ Add a simple deallocator class.
+
+ (WKPCStatusText):
+ (WKPCLoadURL):
+ (WKPCBooleanAndDataReply):
+ (WKPCEvaluate):
+ (WKPCGetStringIdentifier):
+ (WKPCInvoke):
+ (WKPCInvokeDefault):
+ (WKPCConstruct):
+ (WKPCSetProperty):
+ Use the new deallocator class.
+
+2009-02-23 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix <rdar://problem/6450656>.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::insertText):
+ Add insert text which just calls the new WKPH function.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView inputContext]):
+ Get the input context from the shared input panel.
+
+ (-[WebHostedNetscapePluginView keyDown:]):
+ Let the shared input panel have a go at the event first.
+
+ * Plugins/Hosted/WebKitPluginHost.defs:
+ Add new InsertText function.
+
+2009-02-23 Mark Rowe <mrowe@apple.com>
+
+ Fix the build after r41126.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::invoke):
+ (WebKit::NetscapePluginInstanceProxy::invokeDefault):
+ (WebKit::NetscapePluginInstanceProxy::construct):
+
+2009-02-22 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - fix <rdar://problem/5966123> REGRESSION (r30741): Generic Sun Applet loading logo appears half off screen
+
+ * WebCoreSupport/WebFrameLoaderClient.mm: Correct a copy & paste error
+ in r30741, and assign the height value, rather than the width, to the
+ "height" parameter.
+
+2009-02-21 Anders Carlsson <andersca@apple.com>
+
+ Fix build.
+
+ * Plugins/Hosted/WebTextInputWindowController.m:
+
+2009-02-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add a shared floating text input window implementation, to be used by the hosted plug-in view.
+
+ * Plugins/Hosted/WebTextInputWindowController.h: Added.
+ * Plugins/Hosted/WebTextInputWindowController.m: Added.
+
+2009-02-20 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by andersca.
+
+ <rdar://problem/6496140> Safari sometimes hangs in WKSetMetadataURL for several seconds after downloading a file
+
+ Spawn a background thread for WKSetMetadataURL because this function will not return until mds has journaled the data
+ we are trying to set. Depending on what other I/O is going on, it can take some time.
+
+ * Misc/WebNSFileManagerExtras.m: Import pthread.h and FoundationExtras.h
+ (setMetaData): Added. Calls WKSetMetadataURL().
+ (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]): Call setMetaData on a background thread
+
+2009-02-19 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - WebKit part of fixing https://bugs.webkit.org/show_bug.cgi?id=24027
+ Do not send loader callbacks during CSS styling
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Reverted the
+ iChat-specific quirk added in <http://trac.webkit.org/changeset/41071>.
+
+2009-02-18 Dan Bernstein <mitz@apple.com>
Reviewed by Brady Eidson.
@@ -12,30 +1218,154 @@
(-[WebView _preferencesChangedNotification:]): Activate the WebCore
workaround for this crash in iChat.
-2009-02-13 Mark Rowe <mrowe@apple.com>
+2009-02-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fix for <rdar://problem/6542390>
+
+ There's no need to call setDefersLoading here - we already defer anything a plug-in can do that
+ would cause a load to begin.
+
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView sendEvent:isDrawRect:]):
+
+2009-02-18 Adam Roben <aroben@apple.com>
+
+ Add SPI to get WebKit's custom pointing-hand cursor
+
+ Reviewed by John Sullivan.
+
+ * WebView/WebView.mm:
+ (+[WebView _pointingHandCursor]): Added. Returns the custom
+ pointing-hand cursor that WebKit uses.
+ * WebView/WebViewPrivate.h: Added +_pointingHandCursor.
+
+2009-02-17 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Antti Koivisto.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23917
+ Allow a WebKit plug-in to act as a proxy for the <audio> and <video>
+ element.
- Merge r40940.
+ * Plugins/WebPluginContainerPrivate.h:
+ * Plugins/WebPluginController.mm:
+ (mediaProxyClient): New, cast to HTMLMediaElement if it is a video or audio element
+ (-[WebPluginController _setMediaPlayerProxy:forElement:]): New, pass proxy to HTMLMediaElement
+ (-[WebPluginController _postMediaPlayerNotification:forElement:]): New, deliver event to HTMLMediaElement
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin): Don't allow a media player proxy plug-in to be chosen by
+ file extension, only want a match for the new MIME type proxy plug-ins should have.
- 2009-02-12 Anders Carlsson <andersca@apple.com>
+2009-02-13 Anders Carlsson <andersca@apple.com>
Reviewed by Kevin Decker.
- <rdar://problem/6579412>
- REGRESSION (3.2.1-ToT): Crash in Silverlight viewing streaming lecture
+ <rdar://problem/6584834> ESPN radio live stream link hangs Safari
+
+ When a plug-in invokes JavaScript code that will destroy the plug-in, we need to
+ defer destruction until we're done executing the script.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WebKit::PluginDestroyDeferrer::PluginDestroyDeferrer):
+ (WebKit::PluginDestroyDeferrer::~PluginDestroyDeferrer):
+ Add a simple RAII object for deferring destruction of the plug-in instance.
+
+ (WKPCEvaluate):
+ (WKPCInvoke):
+ (WKPCInvokeDefault):
+ (WKPCConstruct):
+ (WKPCGetProperty):
+ (WKPCSetProperty):
+ (WKPCRemoveProperty):
+ (WKPCHasProperty):
+ (WKPCHasMethod):
+ Use the PluginDestroyDeferrer.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ (WebKit::NetscapePluginInstanceProxy::pluginID):
+ Assert that the plug-in ID is not 0 here.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
+ Initialize the call depth.
+
+ (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy):
+ Set the plug-in ID to 0 to aid debugging.
+
+ (WebKit::NetscapePluginInstanceProxy::willCallPluginFunction):
+ Increment the call depth.
+
+ (WebKit::NetscapePluginInstanceProxy::didCallPluginFunction):
+ Decrement the call depth, if it's 0 and we should stop the plug-in, do so.
+
+ (WebKit::NetscapePluginInstanceProxy::shouldStop):
+ If we're called this with a non-zero call depth, set shouldStopSoon to true.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView shouldStop]):
+ Call the proxy.
+
+2009-02-12 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Kevin Decker
+
+ <rdar://problem/6582180> - Wrong HTTP method applied to history item.
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::updateGlobalHistory): Check the original request, not any
+ redirected request.
+
+2009-02-12 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ <rdar://problem/6579412>
+ REGRESSION (3.2.1-ToT): Crash in Silverlight viewing streaming lecture
+
* Plugins/WebNetscapePluginView.h:
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView userAgent]):
Apply workaround for Silverlight workaround.
-
+
(-[WebNetscapePluginView _createPlugin]):
Check if the plug-in that we're creating is the silverlight plug-in.
-2009-02-13 Mark Rowe <mrowe@apple.com>
+2009-02-12 Brady Eidson <beidson@apple.com>
- Merge r40920.
+ Reviewed by Darin Adler
- 2009-02-12 Brady Eidson <beidson@apple.com>
+ Fix potential ref-count or null-deref problems with C++ objects as Obj-C members.
+
+ * History/WebBackForwardList.mm:
+ (-[WebBackForwardList dealloc]): Null check before deref()'ing.
+ (-[WebBackForwardList finalize]): Ditto.
+
+ * Misc/WebIconFetcher.mm:
+ (-[WebIconFetcher dealloc]): Null check before deref()'ing.
+ (-[WebIconFetcher finalize]): Ditto.
+
+ * WebCoreSupport/WebEditorClient.mm: Change to use RefPtr<> instead of ref()/deref().
+ (-[WebEditCommand initWithEditCommand:]):
+ (-[WebEditCommand dealloc]):
+ (-[WebEditCommand finalize]):
+ (-[WebEditCommand command]):
+
+ * WebView/WebArchive.mm: Change to use RefPtr<> instead of ref()/deref().
+ (-[WebArchivePrivate init]):
+ (-[WebArchivePrivate initWithCoreArchive:]):
+ (-[WebArchivePrivate coreArchive]):
+ (-[WebArchivePrivate setCoreArchive:]):
+ (-[WebArchivePrivate dealloc]):
+ (-[WebArchivePrivate finalize]):
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSourcePrivate dealloc]): Null check before deref()'ing.
+ (-[WebDataSourcePrivate finalize]): Ditto.
+
+2009-02-12 Brady Eidson <beidson@apple.com>
Reviewed by Kevin Decker
@@ -51,22 +1381,14 @@
(-[WebArchivePrivate finalize]): Ditto
(-[WebArchive initWithData:]): If the LegacyWebArchive cannot be created, return nil instead of an invalid object.
-2009-02-12 Mark Rowe <mrowe@apple.com>
-
- Merge r40884.
-
- 2009-02-11 Mark Rowe <mrowe@apple.com>
+2009-02-11 Mark Rowe <mrowe@apple.com>
Fix the build.
* History/WebHistory.mm:
(-[WebHistoryPrivate visitedURL:withTitle:]): Use ASSERT_UNUSED in a manner that makes sense.
-2009-02-12 Mark Rowe <mrowe@apple.com>
-
- Merge r40882.
-
- 2009-02-11 Brady Eidson <beidson@apple.com>
+2009-02-11 Brady Eidson <beidson@apple.com>
Reviewed by Mark Rowe
@@ -84,17 +1406,41 @@
(-[WebHistoryPrivate addItems:]):
(-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]):
-2009-02-11 Mark Rowe <mrowe@apple.com>
+2009-02-11 Dimitri Dupuis-latour <dupuislatour@apple.com>
- Merge r40851.
+ Added a preference to disable some Inspector's panels (rdar://6419624, rdar://6419645).
+ This is controlled via the 'WebKitInspectorHiddenPanels' key; if nothing is specified, all panels are shown.
- 2009-02-10 John Sullivan <sullivan@apple.com>
+ Reviewed by Timothy Hatcher.
- Reviewed by Dan Bernstein
+ * WebCoreSupport/WebInspectorClient.h:
+ * WebCoreSupport/WebInspectorClient.mm:
+ (WebInspectorClient::hiddenPanels):
+
+2009-02-11 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+ <rdar://problem/6562920> Pasted text should be normalized to NFC
+
+ * Misc/WebNSURLExtras.mm: (-[NSURL _web_userVisibleString]): Route the URL string through
+ -[NSString precomposedStringWithCanonicalMapping].
+
+ * WebCoreSupport/WebPasteboardHelper.mm:
+ (WebPasteboardHelper::plainTextFromPasteboard): Ditto.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
+ Ditto. The affected cases are all plain text ones - RTF, RTFD and HTML are assumed to be
+ precomposed already, and the conversion is performed outside WebKit for those anyway.
+
+2009-02-10 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Dan Bernstein
+
<https://bugs.webkit.org/show_bug.cgi?id=23889>, <rdar://problem/6572300>
Negative visit counts stored in History.plist aren't corrected.
-
+
It's not clear how a huge negative visit count ended up in History.plist, but we can't
trust data read from disk so we can at least reset this to something sane. WebCore has
no guard against a visit count overflowing an int, but that seems very unlikely to have
@@ -103,30 +1449,185 @@
* History/WebHistoryItem.mm:
(-[WebHistoryItem initFromDictionaryRepresentation:]):
If a negative visit count is in the dictionary, replace it with 1. If a negative daily or
- weekly visit count is in the dictionary, replace it with 0.
+ weekly visit count is in the dictionary, replace it with 0.
+
+2009-02-10 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Dan Bernstein
+
+ <https://bugs.webkit.org/show_bug.cgi?id=23891>
+ [WebHistoryItem _setVisitCount:] is unused and should be removed
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem _setVisitCount:]):
+ removed this unused method, which is a synonym for setVisitCount: that was introduced
+ recently and abandoned even more recently
+
+ * History/WebHistoryItemInternal.h:
+ removed declaration of _setVisitCount:
+
+2009-02-10 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ <rdar://problem/6573916>
+ CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit • WebKit::NetscapePluginInstanceProxy::pluginHostDied + 25.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::instantiatePlugin):
+ If we failed to instantiate the plug-in, invalidate the instance proxy.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::invalidate):
+ Remove the instance from the plug-in host's set.
+
+ (WebKit::NetscapePluginInstanceProxy::destroy):
+ Call invalidate().
+
+2009-02-09 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix <https://bugs.webkit.org/show_bug.cgi?id=23863> / <rdar://problem/6571390>.
+ Bug 23863: Reproducible crash in Mail with TOT WebKit when creating a new message
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _removeMouseMovedObserverUnconditionally]): Nil-check _private as it may have not
+ yet been initialized if this WebHTMLView was loaded from a nib.
+ (-[WebHTMLView _removeSuperviewObservers]): Ditto.
+
+2009-02-09 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Dave Hyatt.
+
+ Rename Selection to VisibleSelection to allow us to separate
+ the selections the user works with from the ones used by
+ the JS editing APIs.
+ https://bugs.webkit.org/show_bug.cgi?id=23852
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _selectNSRange:]):
+ * WebView/WebView.mm:
+ (-[WebView textIteratorForRect:]):
+
+2009-02-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ Fix crash when plug-in host dies.
+
+ * Plugins/Hosted/HostedNetscapePluginStream.mm:
+ (WebKit::HostedNetscapePluginStream::didFail):
+
+2009-02-05 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Justin Garcia.
+
+ DOMSelection.getRangeAt() returns a different range than the selection
+ https://bugs.webkit.org/show_bug.cgi?id=23601
+
+ Rename toRange to toNormalizedRange and add new firstRange which returns an unmodified range
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
+ (-[WebFrame _markDOMRange]):
+ (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]):
+ (-[WebFrame _selectedNSRange]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _selectedRange]):
+ (-[WebTextCompleteController doCompletion]):
+ (-[WebHTMLView selectedAttributedString]):
+ * WebView/WebView.mm:
+ (-[WebView textIteratorForRect:]):
+ (-[WebView selectedDOMRange]):
+
+2009-02-06 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Part III of <rdar://problem/6552272>.
+
+ Refactored to use the redirect data WebCore makes available, instead of
+ tracking loading state in WebKit.
+
+ * History/WebHistory.mm:
+ (-[WebHistoryPrivate dealloc]):
+ (-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
+ (-[WebHistory _visitedURLForRedirectWithoutHistoryItem:]):
+ * History/WebHistoryInternal.h:
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::updateGlobalHistory):
+ (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
+
+2009-02-06 Anders Carlsson <andersca@apple.com>
-2009-02-06 Mark Rowe <mrowe@apple.com>
+ Reviewed by Sam Weinig.
- Merge r40727.
+ <rdar://problem/6562220>
+ CrashTracer: [USER] 21 crashes in Safari at com.apple.WebKit • WebKit::NetscapePluginHostProxy::port
+
+ Make the handling of crashes in the plug-in host more robust.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.h:
+ Add m_portSet.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
+ Initialize m_portSet.
+
+ (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy):
+ Free m_portSet.
+
+ (WebKit::NetscapePluginHostProxy::processRequests):
+ Listen for messages on the port set. If we get a message to the port death notification port,
+ then call pluginHostDied. Otherwise, process the message.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::cleanup):
+ Factor code that should be shared between destroy() and pluginHostDied() into cleanup.
+
+ (WebKit::NetscapePluginInstanceProxy::destroy):
+ Call cleanup().
+
+ (WebKit::NetscapePluginInstanceProxy::pluginHostDied):
+ Call cleanup().
+
+ (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply):
+ Call NetscapePluginHostProxy::processRequests.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::invalidate):
+ Add a null check for the host proxy.
- 2009-02-06 Dan Bernstein <mitz@apple.com>
+2009-02-06 Dan Bernstein <mitz@apple.com>
- try to fix the Tiger build
* Misc/WebNSArrayExtras.h:
-2009-02-06 Mark Rowe <mrowe@apple.com>
+2009-02-06 Anders Carlsson <andersca@apple.com>
- Merge r40711.
+ Reviewed by Dan Bernstein.
- 2009-02-05 Maciej Stachowiak <mjs@apple.com> and Brady Eidson <beidson@apple.com>
+ <rdar://problem/6563650>
+ Add Netscape plug-in API to tell the browser not to load streams (some plug-ins handle network loading manually)
+
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView loadStream]):
+ (-[WebNetscapePluginView pluginView:receivedData:]):
+ (-[WebNetscapePluginView _shouldCancelSrcStream]):
+
+2009-02-05 Maciej Stachowiak <mjs@apple.com> and Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein and Geoff Garen.
- WebKit code to track per-day and per-week visit counts in history
For now this data is only exposed via SPI for performance reasons.
-
+
* History/WebHistoryItem.mm:
(-[WebHistoryItem initFromDictionaryRepresentation:]): Add parsing support
for new data.
@@ -145,41 +1646,190 @@
* Misc/WebNSArrayExtras.m:
(-[NSArray _webkit_numberAtIndex:]): Helper to retrieve an NSNumber or nil from an NSArray
(-[NSArray _webkit_stringAtIndex:]): Helper to retrieve an NSString of nil from an NSArray
+
+2009-02-05 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23708
+ Adds documentElementAvailable() callback to FrameLoaderClient.
-2009-02-06 Mark Rowe <mrowe@apple.com>
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ Stub out documentElementAvailable().
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ Ditto.
+
+2009-02-05 Dan Bernstein <mitz@apple.com>
+
+ - build fix
- Merge r40680.
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::initGlobalCallFrame):
- 2009-02-05 Beth Dakin <bdakin@apple.com>
+2009-02-05 Beth Dakin <bdakin@apple.com>
Reviewed by John Sullivan and Brady Eidson.
- Fix for <rdar://problem/6557595> REGRESSION: In Mail, selecting a
+ Fix for <rdar://problem/6557595> REGRESSION: In Mail, selecting a
mail note message doesn't display it in Mail's preview pane
- This was failing because revision 36962 removed a version of
- setVerticalScrollingMode that mail calls. This patch simply adds
+ This was failing because revision 36962 removed a version of
+ setVerticalScrollingMode that mail calls. This patch simply adds
that method back.
* WebView/WebDynamicScrollBarsView.m:
(-[WebDynamicScrollBarsView setVerticalScrollingMode:]):
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-02-04 Anders Carlsson <andersca@apple.com>
+
+ Build fix fix.
- Merge r40514.
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::initGlobalCallFrame):
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
+2009-02-04 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change PCHasProperty, PCHasMethod and PCGetProperty into simpleroutines.
+
+ Rename PHEvaluateReply to PHBooleanAndDataReply and add PHBooleanReply.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCEvaluate):
+ (WKPCInvoke):
+ (WKPCGetProperty):
+ (WKPCHasProperty):
+ (WKPCHasMethod):
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/Hosted/WebKitPluginHost.defs:
+
+2009-02-04 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Fix 64-bit build.
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::initGlobalCallFrame):
+
+2009-02-04 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Part I of <rdar://problem/6552272>.
+
+ Clear the redirectURLs entry when first visiting a site, so sites that
+ only redirect you the first time you visit them can later learn that
+ they don't redirect.
+
+ * History/WebHistory.mm:
+ (-[WebHistory _visitedURL:withTitle:method:wasFailure:serverRedirectURL:isClientRedirect:]):
+
+2009-02-04 Timothy Hatcher <timothy@apple.com>
+
+ Change the WebSourceId typedef from int to intptr_t now that <rdar://problem/6263297> is fixed.
+
+ <rdar://problem/6263293> WebScriptDebugDelegate should use intptr_t for sourceId, not int
+
+ Reviewed by Oliver Hunt.
+
+ * WebView/WebScriptDebugDelegate.h:
+
+2009-02-04 Timothy Hatcher <timothy@apple.com>
+
+ Switched over from using the WebSafeForwarder for the Script Debug
+ delegate and added high performance CallScriptDebugDelegate functions.
+
+ <rdar://problem/6508457> Launching widget in Dashcode debugger is
+ super-slow due forwardInvocation: calling debug delegate
+
+ Reviewed by Oliver Hunt.
+
+ * DefaultDelegates/WebDefaultScriptDebugDelegate.h: Removed.
+ * DefaultDelegates/WebDefaultScriptDebugDelegate.m: Removed.
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::initGlobalCallFrame): Use CallScriptDebugDelegate.
+ (WebScriptDebugger::sourceParsed): Ditto.
+ (WebScriptDebugger::callEvent): Ditto.
+ (WebScriptDebugger::atStatement): Ditto.
+ (WebScriptDebugger::returnEvent): Ditto.
+ (WebScriptDebugger::exception): Ditto.
+ * WebView/WebView.mm:
+ (-[WebViewPrivate dealloc]): Removed scriptDebugDelegateForwarder.
+ (-[WebView _cacheScriptDebugDelegateImplementations]): Added. Gets the
+ method implementations for the script debug delegate. Also caches what
+ didParseSource method to use.
+ (WebViewGetScriptDebugDelegateImplementations): Added. Returns the
+ WebScriptDebugDelegateImplementations structure.
+ (-[WebView setScriptDebugDelegate:]): Call _cacheScriptDebugDelegateImplementations.
+ (CallDelegate): Added more overloaded versions that take different arguments.
+ (CallScriptDebugDelegate): Added overloaded versions that take different arguments.
+ * WebView/WebViewInternal.h:
+
+2009-02-03 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dave Hyatt
+
+ https://bugs.webkit.org/show_bug.cgi?id=23365
+
+ Hook up accelerated compositing layers the native
+ view system on Mac.
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::attachRootGraphicsLayer):
+ (WebChromeClient::setNeedsOneShotDrawingSynchronization):
+ New methods to hook up the root GraphicsLayer to the native
+ view system, and to synchronize layer changes with view-based
+ drawing when layers come and go.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLViewPrivate clear]):
+ Clear the pointer to layerHostingView.
+
+ (-[WebHTMLView _setAsideSubviews]):
+ (-[WebHTMLView willRemoveSubview:]):
+ Keep the special layer-hosting view in the subviews even
+ when the rest of the subviews are ripped out for
+ painting.
+
+ (-[WebHTMLView _isUsingAcceleratedCompositing]):
+ New utility method for DumpRenderTree to know if we're
+ hosting layers.
+
+ (-[WebHTMLView drawRect:]):
+ Call -disableScreenUpdatesUntilFlush if we have to
+ synchronize layer changes with painting.
+
+ (-[WebHTMLView attachRootLayer:]):
+ (-[WebHTMLView detachRootLayer]):
+ Attach and detach the root GraphicsLayer.
+
+ * WebView/WebViewInternal.h:
+ * WebView/WebHTMLViewInternal.h:
+ * WebView/WebHTMLViewPrivate.h:
+ New method declarations.
+
+ * WebView/WebView.mm:
+ (-[WebView _needsOneShotDrawingSynchronization]):
+ (-[WebView _setNeedsOneShotDrawingSynchronization:]):
+ Set the flag to say if we need to synchronize layer
+ changes and painting on the next -drawRect: call.
+
+ (-[WebView viewWillMoveToWindow:]):
+ (-[WebView viewDidMoveToWindow]):
+ Call new notifications that the view was added to or removed from
+ the window, which are required by the layer hosting mechanism.
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
Build fix.
* Plugins/WebPluginController.mm:
(-[WebPluginController webPlugInContainerLoadRequest:inFrame:]):
-2009-02-03 Mark Rowe <mrowe@apple.com>
-
- Merge r40508.
-
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
@@ -208,54 +1858,210 @@
(-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):
* WebView/WebFramePrivate.h: Updated for rename and extra parameter.
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-02-02 Anders Carlsson <andersca@apple.com>
- Merge r40382.
+ Reviewed by Dan Bernstein.
- 2009-01-29 Sam Weinig <sam@webkit.org>
+ Work around a limitation in MIG where two functions can't have the same name even if they're
+ not in the same subsystem.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply):
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/Hosted/WebKitPluginHost.defs:
- Reviewed by Anders Carlsson.
+2009-02-02 Anders Carlsson <andersca@apple.com>
- Second step in tracking the urls a HistoryItem was redirected through
- Add SPI to access the array of redirect urls associated with a HistoryItem.
+ Reviewed by Sam Weinig.
- * History/WebHistoryItem.mm:
- (-[WebHistoryItem dictionaryRepresentation]):
- (-[WebHistoryItem _redirectURLs]):
- * History/WebHistoryItemPrivate.h:
+ Implement WKPCGetPluginElementObject.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCGetPluginElementNPObject):
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::getPluginElementNPObject):
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView WebCore::]):
+
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Build fix.
+
+ * WebView/WebHTMLView.mm:
+
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Make WebBaseNetscapePluginView hold a reference to a HTMLPlugInElement instead of a DOMElement.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.h:
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+ (-[WebBaseNetscapePluginView _windowClipRect]):
+ (-[WebBaseNetscapePluginView visibleRect]):
+ (-[WebBaseNetscapePluginView dataSource]):
+ * Plugins/WebKitPluginContainerView.h: Removed.
+ * Plugins/WebKitPluginContainerView.mm: Removed.
+ * Plugins/WebNetscapePluginView.h:
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+ (-[WebNetscapePluginView getVariable:value:]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin):
+
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Update for changes to WebCore.
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin):
+
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Oliver Hunt.
-2009-02-03 Mark Rowe <mrowe@apple.com>
+ When a new Web View was not created, report back to the plug-in host.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::performRequest):
+ * Plugins/Hosted/WebKitPluginHost.defs:
+
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ Draw the regular missing plug-in icon instead of a red rect when a plug-in has crashed.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView drawRect:]):
+
+2009-02-02 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Darin Adler.
+
+ Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView
+
+ https://bugs.webkit.org/show_bug.cgi?id=23428
+
+ FrameView::forceLayout could be killed but the comment might
+ contain a value over the the plain FrameView::layout...
+
+ Adjust the WebCore/WebKit consumers of these methods.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
+ (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]):
+
+2009-01-31 John Sullivan <sullivan@apple.com>
- Merge r40380.
+ https://bugs.webkit.org/show_bug.cgi?id=23665
- 2009-01-29 Sam Weinig <sam@webkit.org>
+ Cleaned up code to add/remove NSNotification observers, to avoid performance hit
+ of calling removeObserver with unspecified notifications, or calling removeObserver
+ multiple times for the same notification.
+
+ Reviewed by Darin Adler
+
+ * WebView/WebHTMLView.mm:
+ added observingMouseMovedNotifications, observingSuperviewNotifications, and
+ observingWindowNotifications as BOOL ivars of _private object
+ (-[WebHTMLView _removeMouseMovedObserverUnconditionally]):
+ moved to file-internal section of file, added leading underscore, now bails out
+ if we aren't observing the relevant notifications, now records that we are no longer
+ observing the relevant notifications
+ (-[WebHTMLView _removeSuperviewObservers]):
+ ditto, also stores [NSNoticationCenter defaultCenter] in local var to avoid objc dispatch
+ (-[WebHTMLView _removeWindowObservers]):
+ ditto
+ (-[WebHTMLView close]):
+ replace general removeObserver: call with three specific calls for all the notifications
+ that this class actually observes
+ (-[WebHTMLView addMouseMovedObserver]):
+ bail out if already observing relevant notifications, now records that we are observing
+ the relevant notifications
+ (-[WebHTMLView removeMouseMovedObserver]):
+ updated for name change
+ (-[WebHTMLView addSuperviewObservers]):
+ bail out if already observing relevant notifications, now records that we are observing
+ the relevant notifications; also stores [NSNoticationCenter defaultCenter] in local var
+ to avoid objc dispatch
+ (-[WebHTMLView addWindowObservers]):
+ ditto
+ (-[WebHTMLView viewWillMoveToSuperview:]):
+ updated for name change
+ (-[WebHTMLView viewWillMoveToWindow:]):
+ updated for name changes
+
+2009-01-31 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
- First step in tracking the urls a HistoryItem was redirected through.
+ Fix code that assumes all command selectors end in colons.
+ rdar://problem/6545874
- * History/WebHistoryItem.mm:
- (-[WebHistoryItem initFromDictionaryRepresentation:]):
- (-[WebHistoryItem dictionaryRepresentation]):
- * Misc/WebNSDictionaryExtras.h:
- * Misc/WebNSDictionaryExtras.m:
- (-[NSDictionary _webkit_arrayForKey:]): Add helper.
+ * WebView/WebHTMLView.mm:
+ (commandNameForSelector): Don't assert, just return a null string, when
+ the selector doesn't end in a colon.
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-01-30 Adam Barth <abarth@webkit.org>
- Merge r40436.
+ Reviewed by Sam Weinig.
- 2009-01-30 Geoffrey Garen <ggaren@apple.com>
+ Add a pref to disable web security.
- Build fix.
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences isWebSecurityEnabled]):
+ (-[WebPreferences setWebSecurityEnabled:]):
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
- * WebView/WebFramePrivate.h:
+2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Darin Adler.
+
+ Move Frame::sendResizeEvent and Frame::sendScrollEvent to EventHandler
+
+ Carry out the move and catch up in two call sites.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _frameOrBoundsChanged]):
+
+2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Darin Adler.
+
+ isFrameSet was moved from Frame to Document. Update the
+ WebKit usage.
-2009-02-03 Mark Rowe <mrowe@apple.com>
+ * WebView/WebFrame.mm:
+ (-[WebFrame _isFrameSet]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView knowsPageRange:]):
- Merge r40432.
+2009-01-30 Geoffrey Garen <ggaren@apple.com>
- 2009-01-30 Geoffrey Garen <ggaren@apple.com>
+ Build fix.
+
+ * WebView/WebFramePrivate.h:
+
+2009-01-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
@@ -265,24 +2071,59 @@
* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-01-30 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
- Merge r40353.
+ Fix <rdar://problem/6544048>
+
+ Have NetscapePluginInstanceProxy keep track of all the ProxyInstance objects associated.
+
+ When the plug-in instance is destroyed, invalidate all proxy instances.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::destroy):
+ (WebKit::NetscapePluginInstanceProxy::addInstance):
+ (WebKit::NetscapePluginInstanceProxy::removeInstance):
+ * Plugins/Hosted/ProxyInstance.h:
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::ProxyInstance):
+ (WebKit::ProxyInstance::~ProxyInstance):
+ (WebKit::ProxyInstance::invalidate):
- 2009-01-28 Geoffrey Garen <ggaren@apple.com>
+2009-01-30 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
- Updated for WebCore rename.
+ Fix <rdar://problem/6490778>.
+
+ Change the NPRuntime related functions to use IdentifierRep directly, and make sure to always
+ validate IdentifierReps before dereferencing them.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCEvaluate):
+ (WKPCGetStringIdentifier):
+ (WKPCGetIntIdentifier):
+ (identifierFromIdentifierRep):
+ (WKPCInvoke):
+ (WKPCGetProperty):
+ (WKPCSetProperty):
+ (WKPCRemoveProperty):
+ (WKPCHasProperty):
+ (WKPCHasMethod):
+ (WKPCIdentifierInfo):
- * WebView/WebView.mm:
- (-[WebView setCustomTextEncodingName:]):
+2009-01-30 Brady Eidson <beidson@apple.com>
-2009-02-03 Mark Rowe <mrowe@apple.com>
+ Reviewed by Sam Weinig
+
+ Remove FrameLoaderClient code that is now handled by FrameLoader itself
- Merge r40397.
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::frameLoadCompleted):
- 2009-01-29 Stephanie Lewis <slewis@apple.com>
+2009-01-29 Stephanie Lewis <slewis@apple.com>
RS by Oliver Hunt.
@@ -290,11 +2131,147 @@
* WebKit.order:
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-01-29 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Second step in tracking the urls a HistoryItem was redirected through
+ Add SPI to access the array of redirect urls associated with a HistoryItem.
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem dictionaryRepresentation]):
+ (-[WebHistoryItem _redirectURLs]):
+ * History/WebHistoryItemPrivate.h:
+
+2009-01-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Always activate the plug-in host process if we're in "modal mode" and are being told to activate.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.h:
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WebKit::NetscapePluginHostProxy::pluginHostDied):
+ Call endModal here.
+
+ (WebKit::NetscapePluginHostProxy::applicationDidBecomeActive):
+ If we're modal, we should always bring the plug-in host process to the front.
+
+ (WebKit::NetscapePluginHostProxy::beginModal):
+ Add an observer for the NSApplicationWillBecomeActiveNotification callback.
+
+ (WebKit::NetscapePluginHostProxy::endModal):
+ Remove the observer.
+
+2009-01-29 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ First step in tracking the urls a HistoryItem was redirected through.
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem initFromDictionaryRepresentation:]):
+ (-[WebHistoryItem dictionaryRepresentation]):
+ * Misc/WebNSDictionaryExtras.h:
+ * Misc/WebNSDictionaryExtras.m:
+ (-[NSDictionary _webkit_arrayForKey:]): Add helper.
+
+2009-01-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Pass the PSN of the client to the host, and get the PSN of the host back when checking in.
+
+ * Plugins/Hosted/NetscapePluginHostManager.h:
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::hostForPackage):
+ Get the current PSN and pass it to spawnPluginHost.
+
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+ Pass the PSN to the "check in" function.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.h:
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
+
+ (WebKit::NetscapePluginHostProxy::pluginHostDied):
+ Fix a bug noticed by Julien Chaffraix. Call endModal if necessary.
+
+ (WebKit::NetscapePluginHostProxy::beginModal):
+ (WebKit::NetscapePluginHostProxy::endModal):
+ (WebKit::NetscapePluginHostProxy::setModal):
+ Split out the code that does all of the work into beginModal and endModal methods.
+
+ * Plugins/Hosted/WebKitPluginHost.defs:
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView loadStream]):
+
+2009-01-29 David Kilzer <ddkilzer@apple.com>
+
+ Remove semi-colons from the end of ObjC method implementations
+
+ Rubber-stamped by Adam Roben.
+
+ $ find WebKit -name \*.m -o -name \*.mm -exec perl -e 'undef $/; $s = <>; while ($s =~ m/[\n\r][-+].*;[\s\r\n]+\{/g) { print "$ARGV: $&\n"; }' {} \;
+
+ * DefaultDelegates/WebDefaultUIDelegate.m:
+ (-[WebDefaultUIDelegate webView:setResizable:]):
+ (-[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]):
+ (-[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:]):
+ (-[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:]):
+ * History/WebBackForwardList.mm:
+ (-[WebBackForwardList addItem:]):
+ (-[WebBackForwardList backListWithLimit:]):
+ (-[WebBackForwardList forwardListWithLimit:]):
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem alternateTitle]):
+ (-[WebHistoryItem setViewState:]):
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:]):
+ * Misc/WebKitNSStringExtras.m:
+ (-[NSString _web_drawAtPoint:font:textColor:]):
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView setAttributeKeys:andValues:]):
+ * WebCoreSupport/WebEditorClient.mm:
+ (-[WebEditCommand command]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _getVisibleRect:]):
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView elementAtPoint:allowShadowContent:]):
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences setAllowsAnimatedImages:]):
+ (-[WebPreferences setAutosaves:]):
+ (-[WebPreferences PDFDisplayMode]):
+ * WebView/WebView.mm:
+ (+[WebView _viewClass:andRepresentationClass:forMIMEType:]):
+ (-[WebView _viewClass:andRepresentationClass:forMIMEType:]):
+ (+[WebView _unregisterViewClassAndRepresentationClassForMIMEType:]):
+ (+[WebView _registerViewClass:representationClass:forURLScheme:]):
+ (-[WebView _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]):
+ (-[WebView _insertNewlineInQuotedContent]):
+
+2009-01-28 Geoffrey Garen <ggaren@apple.com>
- Merge r40332.
+ Reviewed by Sam Weinig.
+
+ Updated for WebCore rename.
+
+ * WebView/WebView.mm:
+ (-[WebView setCustomTextEncodingName:]):
+
+2009-01-28 David Kilzer <ddkilzer@apple.com>
+
+ Add missing declaration for -[NSURL(WebNSURLExtras) _webkit_isFileURL]
+
+ Reviewed by Dan Bernstein.
- 2009-01-28 Sam Weinig <sam@webkit.org>
+ * Misc/WebNSURLExtras.h:
+ (-[NSURL(WebNSURLExtras) _webkit_isFileURL]): Added missing
+ declaration after the implementation was added in r9258.
+
+2009-01-28 Sam Weinig <sam@webkit.org>
Reviewed by Geoff Garen.
@@ -304,6 +2281,19 @@
* WebView/WebScriptDebugDelegate.mm:
(-[WebScriptCallFrame scopeChain]): Wrap JSActivations in DebuggerActivations.
+2009-01-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Fix two bugs with Core Animation based plug-ins.
+
+ 1. The plug-in view was marked as opaque even though it's not.
+ (This would leave garbage in the plug-in view).
+ 2. The plug-in layer needs to have autoresizing turned on.
+
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView setLayer:]):
+
2009-01-27 Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein
diff --git a/WebKit/mac/Configurations/Base.xcconfig b/WebKit/mac/Configurations/Base.xcconfig
index 2c83815..8ed667f 100644
--- a/WebKit/mac/Configurations/Base.xcconfig
+++ b/WebKit/mac/Configurations/Base.xcconfig
@@ -25,6 +25,11 @@ VALID_ARCHS = i386 ppc x86_64 ppc64;
WARNING_CFLAGS = -Wall -Wextra -Wcast-align -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings;
+REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME));
+REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx);
+REAL_PLATFORM_NAME_macosx = macosx;
+
+
// DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
// We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
DEBUG_DEFINES_debug = DISABLE_THREAD_CHECK;
diff --git a/WebKit/mac/Configurations/DebugRelease.xcconfig b/WebKit/mac/Configurations/DebugRelease.xcconfig
index 10699fb..fab0906 100644
--- a/WebKit/mac/Configurations/DebugRelease.xcconfig
+++ b/WebKit/mac/Configurations/DebugRelease.xcconfig
@@ -1,5 +1,12 @@
#include "Base.xcconfig"
-ARCHS = $(NATIVE_ARCH);
+
+ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR));
+ARCHS_ = $(ARCHS_1040);
+ARCHS_1040 = $(NATIVE_ARCH);
+ARCHS_1050 = $(NATIVE_ARCH);
+ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT);
+
+ONLY_ACTIVE_ARCH = YES;
MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR));
MACOSX_DEPLOYMENT_TARGET_ = 10.4;
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index bf339bf..ab0aa9b 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -1,5 +1,5 @@
-MAJOR_VERSION = 528;
-MINOR_VERSION = 16;
+MAJOR_VERSION = 530;
+MINOR_VERSION = 5;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebKit/mac/Configurations/WebKit.xcconfig b/WebKit/mac/Configurations/WebKit.xcconfig
index 0937fdb..12d47ea 100644
--- a/WebKit/mac/Configurations/WebKit.xcconfig
+++ b/WebKit/mac/Configurations/WebKit.xcconfig
@@ -11,11 +11,23 @@ GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) FRAMEWORK_NAM
HEADER_SEARCH_PATHS = $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu "${BUILT_PRODUCTS_DIR}/usr/local/include" "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit" $(HEADER_SEARCH_PATHS);
INFOPLIST_FILE = mac/Info.plist;
INSTALL_PATH = $(SYSTEM_LIBRARY_DIR)/Frameworks;
-JAVASCRIPTCORE_PRIVATE_HEADERS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaScriptCore.framework/PrivateHeaders;
+INSTALLHDRS_COPY_PHASE = YES;
+INSTALLHDRS_SCRIPT_PHASE = YES;
PRODUCT_NAME = WebKit;
UMBRELLA_FRAMEWORKS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
-WEBCORE_PRIVATE_HEADERS_DIR = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
OTHER_LDFLAGS = -sub_umbrella WebCore $(OTHER_LDFLAGS);
-// This needs to be kept sorted, and in sync with FEATURE_DEFINES in JavaScriptCore.xcconfig, WebCore.xcconfig and the default settings of build-webkit.
-FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
+WEBCORE_PRIVATE_HEADERS_DIR = $(WEBCORE_PRIVATE_HEADERS_DIR_$(REAL_PLATFORM_NAME)_$(CONFIGURATION));
+WEBCORE_PRIVATE_HEADERS_DIR_macosx_Release = $(WEBCORE_PRIVATE_HEADERS_engineering);
+WEBCORE_PRIVATE_HEADERS_DIR_macosx_Debug = $(WEBCORE_PRIVATE_HEADERS_engineering);
+WEBCORE_PRIVATE_HEADERS_DIR_macosx_Production = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
+WEBCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/WebCore.framework/PrivateHeaders;
+
+// This needs to be kept sorted, and in sync with FEATURE_DEFINES in JavaScriptCore.xcconfig, WebCore.xcconfig and
+// the default settings of build-webkit to prevent needless rebuilding when using both Xcode and build-webkit.
+FEATURE_DEFINES = $(FEATURE_DEFINES_$(MAC_OS_X_VERSION_MAJOR));
+FEATURE_DEFINES_BASE = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
+FEATURE_DEFINES_ = $(FEATURE_DEFINES_1040);
+FEATURE_DEFINES_1040 = $(FEATURE_DEFINES_BASE);
+FEATURE_DEFINES_1050 = $(FEATURE_DEFINES_BASE);
+FEATURE_DEFINES_1060 = $(FEATURE_DEFINES_BASE) ENABLE_GEOLOCATION;
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.h b/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.h
deleted file mode 100644
index b548212..0000000
--- a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
- *
- * 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 Computer, 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.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface WebDefaultScriptDebugDelegate : NSObject
-+ (WebDefaultScriptDebugDelegate *)sharedScriptDebugDelegate;
-@end
-
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m
deleted file mode 100644
index 85cef90..0000000
--- a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
- *
- * 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 Computer, 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.
- */
-
-#import <WebKit/WebScriptDebugDelegate.h>
-#import "WebDefaultScriptDebugDelegate.h"
-#import "WebTypesInternal.h"
-
-@implementation WebDefaultScriptDebugDelegate
-
-static WebDefaultScriptDebugDelegate *sharedDelegate = nil;
-
-+ (WebDefaultScriptDebugDelegate *)sharedScriptDebugDelegate
-{
- if (!sharedDelegate) {
- sharedDelegate = [[WebDefaultScriptDebugDelegate alloc] init];
- }
- return sharedDelegate;
-}
-
-- (void)webView:(WebView *)webView didParseSource:(NSString *)source
- fromURL:(NSString *)url
- sourceId:(WebSourceId)sid
- forWebFrame:(WebFrame *)webFrame
-{
-}
-
-- (void)webView:(WebView *)webView didParseSource:(NSString *)source
- baseLineNumber:(NSUInteger)lineNumber
- fromURL:(NSURL *)url
- sourceId:(WebSourceId)sid
- forWebFrame:(WebFrame *)webFrame
-{
-}
-
-- (void)webView:(WebView *)webView failedToParseSource:(NSString *)source
- baseLineNumber:(NSUInteger)lineNumber
- fromURL:(NSURL *)url
- withError:(NSError *)error
- forWebFrame:(WebFrame *)webFrame
-{
-}
-
-- (void)webView:(WebView *)webView didEnterCallFrame:(WebScriptCallFrame *)frame
- sourceId:(WebSourceId)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
-}
-
-- (void)webView:(WebView *)webView willExecuteStatement:(WebScriptCallFrame *)frame
- sourceId:(WebSourceId)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
-}
-
-- (void)webView:(WebView *)webView willLeaveCallFrame:(WebScriptCallFrame *)frame
- sourceId:(WebSourceId)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
-}
-
-- (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame
- sourceId:(WebSourceId)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
-}
-
-@end
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m
index aa5df4a..68fa05e 100644
--- a/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m
+++ b/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m
@@ -134,7 +134,7 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
return [[wv window] showsResizeIndicator];
}
-- (void)webView: (WebView *)wv setResizable:(BOOL)resizable;
+- (void)webView: (WebView *)wv setResizable:(BOOL)resizable
{
// FIXME: This doesn't actually change the resizability of the window,
// only visibility of the indicator.
@@ -193,7 +193,7 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
return YES;
}
-- (NSUInteger)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
+- (NSUInteger)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo
{
return WebDragDestinationActionAny;
}
@@ -202,12 +202,12 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
{
}
-- (NSUInteger)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point;
+- (NSUInteger)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point
{
return WebDragSourceActionAny;
}
-- (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard;
+- (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard
{
}
diff --git a/WebKit/mac/History/WebBackForwardList.mm b/WebKit/mac/History/WebBackForwardList.mm
index 20988b8..2f0c214 100644
--- a/WebKit/mac/History/WebBackForwardList.mm
+++ b/WebKit/mac/History/WebBackForwardList.mm
@@ -82,7 +82,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
- (id)initWithBackForwardList:(PassRefPtr<BackForwardList>)backForwardList
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundOne();
self = [super init];
if (!self)
return nil;
@@ -115,20 +115,26 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
return;
BackForwardList* backForwardList = core(self);
- ASSERT(backForwardList->closed());
- backForwardLists().remove(backForwardList);
- backForwardList->deref();
-
+ ASSERT(backForwardList);
+ if (backForwardList) {
+ ASSERT(backForwardList->closed());
+ backForwardLists().remove(backForwardList);
+ backForwardList->deref();
+ }
+
[super dealloc];
}
- (void)finalize
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundOne();
BackForwardList* backForwardList = core(self);
- ASSERT(backForwardList->closed());
- backForwardLists().remove(backForwardList);
- backForwardList->deref();
+ ASSERT(backForwardList);
+ if (backForwardList) {
+ ASSERT(backForwardList->closed());
+ backForwardLists().remove(backForwardList);
+ backForwardList->deref();
+ }
[super finalize];
}
@@ -138,7 +144,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
core(self)->close();
}
-- (void)addItem:(WebHistoryItem *)entry;
+- (void)addItem:(WebHistoryItem *)entry
{
core(self)->addItem(core(entry));
@@ -198,14 +204,14 @@ static NSArray* vectorToNSArray(HistoryItemVector& list)
return result;
}
-- (NSArray *)backListWithLimit:(int)limit;
+- (NSArray *)backListWithLimit:(int)limit
{
HistoryItemVector list;
core(self)->backListWithLimit(limit, list);
return vectorToNSArray(list);
}
-- (NSArray *)forwardListWithLimit:(int)limit;
+- (NSArray *)forwardListWithLimit:(int)limit
{
HistoryItemVector list;
core(self)->forwardListWithLimit(limit, list);
diff --git a/WebKit/mac/History/WebHistory.mm b/WebKit/mac/History/WebHistory.mm
index 417aadb..313378b 100644
--- a/WebKit/mac/History/WebHistory.mm
+++ b/WebKit/mac/History/WebHistory.mm
@@ -60,7 +60,6 @@ NSString *DatesArrayKey = @"WebHistoryDates";
NSMutableDictionary *_entriesByURL;
DateToEntriesMap* _entriesByDate;
NSMutableArray *_orderedLastVisitedDays;
- WebHistoryItem *_lastVisitedEntry;
BOOL itemLimitSet;
int itemLimit;
BOOL ageInDaysLimitSet;
@@ -94,9 +93,6 @@ NSString *DatesArrayKey = @"WebHistoryDates";
- (void)addVisitedLinksToPageGroup:(PageGroup&)group;
-- (WebHistoryItem *)lastVisitedEntry;
-- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry;
-
@end
@implementation WebHistoryPrivate
@@ -127,7 +123,6 @@ NSString *DatesArrayKey = @"WebHistoryDates";
{
[_entriesByURL release];
[_orderedLastVisitedDays release];
- [_lastVisitedEntry release];
delete _entriesByDate;
[super dealloc];
}
@@ -648,19 +643,6 @@ static WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
}
}
-- (WebHistoryItem *)lastVisitedEntry
-{
- return _lastVisitedEntry;
-}
-
-- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry
-{
- if (_lastVisitedEntry == lastVisitedEntry)
- return;
- [_lastVisitedEntry release];
- _lastVisitedEntry = [lastVisitedEntry retain];
-}
-
@end
@implementation WebHistory
@@ -821,39 +803,23 @@ static WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
@implementation WebHistory (WebInternal)
-- (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure serverRedirectURL:(NSString *)serverRedirectURL isClientRedirect:(BOOL)isClientRedirect
+- (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure
{
- if (isClientRedirect) {
- ASSERT(!serverRedirectURL);
- if (WebHistoryItem *lastVisitedEntry = [_historyPrivate lastVisitedEntry])
- core(lastVisitedEntry)->addRedirectURL([url _web_originalDataAsString]);
- }
-
WebHistoryItem *entry = [_historyPrivate visitedURL:url withTitle:title];
- [_historyPrivate setLastVisitedEntry:entry];
HistoryItem* item = core(entry);
item->setLastVisitWasFailure(wasFailure);
if ([method length])
- item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"]);
+ item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"]));
- if (serverRedirectURL) {
- ASSERT(!isClientRedirect);
- item->addRedirectURL(serverRedirectURL);
- }
+ item->setRedirectURLs(std::auto_ptr<Vector<String> >());
NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil];
[self _sendNotification:WebHistoryItemsAddedNotification entries:entries];
[entries release];
}
-- (void)_visitedURLForRedirectWithoutHistoryItem:(NSURL *)url
-{
- if (WebHistoryItem *lastVisitedEntry = [_historyPrivate lastVisitedEntry])
- core(lastVisitedEntry)->addRedirectURL([url _web_originalDataAsString]);
-}
-
- (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group
{
[_historyPrivate addVisitedLinksToPageGroup:group];
diff --git a/WebKit/mac/History/WebHistoryInternal.h b/WebKit/mac/History/WebHistoryInternal.h
index 9e69734..b4431c5 100644
--- a/WebKit/mac/History/WebHistoryInternal.h
+++ b/WebKit/mac/History/WebHistoryInternal.h
@@ -33,7 +33,6 @@ namespace WebCore {
}
@interface WebHistory (WebInternal)
-- (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure serverRedirectURL:(NSString *)serverRedirectURL isClientRedirect:(BOOL)isClientRedirect;
-- (void)_visitedURLForRedirectWithoutHistoryItem:(NSURL *)url;
+- (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure;
- (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group;
@end
diff --git a/WebKit/mac/History/WebHistoryItem.mm b/WebKit/mac/History/WebHistoryItem.mm
index 1d2de1d..ca80437 100644
--- a/WebKit/mac/History/WebHistoryItem.mm
+++ b/WebKit/mac/History/WebHistoryItem.mm
@@ -107,7 +107,7 @@ void WKNotifyHistoryItemChanged()
- (id)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundOne();
return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, time)];
}
@@ -126,7 +126,7 @@ void WKNotifyHistoryItemChanged()
- (void)finalize
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundOne();
// FIXME: ~HistoryItem is what releases the history item's icon from the icon database
// It's probably not good to release icons from the database only when the object is garbage-collected.
// Need to change design so this happens at a predictable time.
@@ -140,7 +140,7 @@ void WKNotifyHistoryItemChanged()
- (id)copyWithZone:(NSZone *)zone
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundOne();
WebHistoryItem *copy = (WebHistoryItem *)NSCopyObject(self, 0, zone);
RefPtr<HistoryItem> item = core(_private)->copy();
copy->_private = kitPrivate(item.get());
@@ -175,7 +175,7 @@ void WKNotifyHistoryItemChanged()
core(_private)->setAlternateTitle(alternateTitle);
}
-- (NSString *)alternateTitle;
+- (NSString *)alternateTitle
{
return nsStringNilIfEmpty(core(_private)->alternateTitle());
}
@@ -299,7 +299,7 @@ static WebWindowWatcher *_windowWatcher = nil;
- (id)initWithWebCoreHistoryItem:(PassRefPtr<HistoryItem>)item
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundOne();
// Need to tell WebCore what function to call for the
// "History Item has Changed" notification - no harm in doing this
// everytime a WebHistoryItem is created
@@ -325,7 +325,7 @@ static WebWindowWatcher *_windowWatcher = nil;
core(_private)->setVisitCount(count);
}
-- (void)setViewState:(id)statePList;
+- (void)setViewState:(id)statePList
{
core(_private)->setViewState(statePList);
}
@@ -422,11 +422,6 @@ static WebWindowWatcher *_windowWatcher = nil;
core(_private)->visited(title, [NSDate timeIntervalSinceReferenceDate]);
}
-- (void)_setVisitCount:(int)count
-{
- core(_private)->setVisitCount(count);
-}
-
- (void)_recordInitialVisit
{
core(_private)->recordInitialVisit();
diff --git a/WebKit/mac/History/WebHistoryItemInternal.h b/WebKit/mac/History/WebHistoryItemInternal.h
index 74a8074..fe2ae1a 100644
--- a/WebKit/mac/History/WebHistoryItemInternal.h
+++ b/WebKit/mac/History/WebHistoryItemInternal.h
@@ -52,7 +52,6 @@ extern void WKNotifyHistoryItemChanged();
- (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem;
- (void)setTitle:(NSString *)title;
- (void)_visitedWithTitle:(NSString *)title;
-- (void)_setVisitCount:(int)count;
- (void)_recordInitialVisit;
@end
diff --git a/WebKit/mac/Misc/WebCache.mm b/WebKit/mac/Misc/WebCache.mm
index a60159f..46fb341 100644
--- a/WebKit/mac/Misc/WebCache.mm
+++ b/WebKit/mac/Misc/WebCache.mm
@@ -30,6 +30,7 @@
#import "WebViewInternal.h"
#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/Cache.h>
+#import <WebCore/CrossOriginPreflightResultCache.h>
@implementation WebCache
@@ -107,9 +108,12 @@
WebCacheModel cacheModel = [WebView _cacheModel];
[WebView _setCacheModel:WebCacheModelDocumentViewer];
[WebView _setCacheModel:cacheModel];
-
+
// Empty the application cache.
WebCore::cacheStorage().empty();
+
+ // Empty the Cross-Origin Preflight cache
+ WebCore::CrossOriginPreflightResultCache::shared().empty();
}
+ (void)setDisabled:(BOOL)disabled
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm
index 05c2659..2fe5710 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -95,7 +95,7 @@ using namespace WebCore;
gcController().garbageCollectNow();
}
-+ (void)garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:(BOOL)waitUntilDone;
++ (void)garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:(BOOL)waitUntilDone
{
gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
}
diff --git a/WebKit/mac/Misc/WebIconDatabase.mm b/WebKit/mac/Misc/WebIconDatabase.mm
index 3b42406..d4df14b 100644
--- a/WebKit/mac/Misc/WebIconDatabase.mm
+++ b/WebKit/mac/Misc/WebIconDatabase.mm
@@ -94,7 +94,7 @@ static WebIconDatabaseClient* defaultClient()
- init
{
[super init];
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundOne();
_private = [[WebIconDatabasePrivate alloc] init];
diff --git a/WebKit/mac/Misc/WebIconFetcher.mm b/WebKit/mac/Misc/WebIconFetcher.mm
index bec7c12..a31ab7d 100644
--- a/WebKit/mac/Misc/WebIconFetcher.mm
+++ b/WebKit/mac/Misc/WebIconFetcher.mm
@@ -71,14 +71,16 @@ private:
- (void)dealloc
{
- reinterpret_cast<IconFetcher*>(_private)->deref();
+ if (_private)
+ reinterpret_cast<IconFetcher*>(_private)->deref();
[super dealloc];
}
- (void)finalize
{
- reinterpret_cast<IconFetcher*>(_private)->deref();
+ if (_private)
+ reinterpret_cast<IconFetcher*>(_private)->deref();
[super finalize];
}
diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.m b/WebKit/mac/Misc/WebKitNSStringExtras.m
index 2e75e9e..f3077d3 100644
--- a/WebKit/mac/Misc/WebKitNSStringExtras.m
+++ b/WebKit/mac/Misc/WebKitNSStringExtras.m
@@ -50,7 +50,7 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
return YES;
}
-- (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor;
+- (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor
{
// FIXME: Would be more efficient to change this to C++ and use Vector<UChar, 2048>.
unsigned length = [self length];
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h
index 6c60d6a..169b4cf 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.h
+++ b/WebKit/mac/Misc/WebKitVersionChecks.h
@@ -49,8 +49,8 @@
#define WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES 0x020E0000 // 526.0.0
#define WEBKIT_FIRST_VERSION_WITH_MORE_STRICT_LOCAL_RESOURCE_SECURITY_RESTRICTION 0x02100200 // 528.2.0
#define WEBKIT_FIRST_VERSION_WITH_RELOAD_FROM_ORIGIN 0x02100700 // 528.7.0
-#define WEBKIT_FIRST_VERSION_WITHOUT_MAIL_THREAD_WORKAROUND 0x02100700 // 528.7.0
#define WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND 0x02100700 // 528.7.0
+#define WEBKIT_FIRST_VERSION_WITH_ROUND_TWO_MAIN_THREAD_EXCEPTIONS 0x02120400 // 530.4.0
#ifdef __cplusplus
extern "C" {
diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.m b/WebKit/mac/Misc/WebNSFileManagerExtras.m
index 0c10725..f32b4c0 100644
--- a/WebKit/mac/Misc/WebNSFileManagerExtras.m
+++ b/WebKit/mac/Misc/WebNSFileManagerExtras.m
@@ -28,10 +28,12 @@
#import <WebKit/WebNSFileManagerExtras.h>
+#import <WebCore/FoundationExtras.h>
#import <WebKit/WebKitNSStringExtras.h>
#import <WebKitSystemInterface.h>
#import <wtf/Assertions.h>
+#import <pthread.h>
#import <sys/mount.h>
@implementation NSFileManager (WebNSFileManagerExtras)
@@ -144,11 +146,47 @@
return [carbonPathPieces componentsJoinedByString:@":"];
}
+typedef struct MetaDataInfo
+{
+ NSString *URLString;
+ NSString *referrer;
+ NSString *path;
+} MetaDataInfo;
+
+static void *setMetaData(void* context)
+{
+ MetaDataInfo *info = (MetaDataInfo *)context;
+ WKSetMetadataURL(info->URLString, info->referrer, info->path);
+
+ HardRelease(info->URLString);
+ HardRelease(info->referrer);
+ HardRelease(info->path);
+
+ free(info);
+ return 0;
+}
+
- (void)_webkit_setMetadataURL:(NSString *)URLString referrer:(NSString *)referrer atPath:(NSString *)path
{
ASSERT(URLString);
ASSERT(path);
- WKSetMetadataURL(URLString, referrer, path);
+
+ // Spawn a background thread for WKSetMetadataURL because this function will not return until mds has
+ // journaled the data we're're trying to set. Depending on what other I/O is going on, it can take some
+ // time.
+ pthread_t tid;
+ pthread_attr_t attr;
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+
+ MetaDataInfo *info = malloc(sizeof(MetaDataInfo));
+
+ info->URLString = HardRetainWithNSRelease([URLString copy]);
+ info->referrer = HardRetainWithNSRelease([referrer copy]);
+ info->path = HardRetainWithNSRelease([path copy]);
+
+ pthread_create(&tid, &attr, setMetaData, info);
+ pthread_attr_destroy(&attr);
}
- (NSString *)_webkit_startupVolumeName
diff --git a/WebKit/mac/Misc/WebNSURLExtras.h b/WebKit/mac/Misc/WebNSURLExtras.h
index f8823b9..40f7cf7 100644
--- a/WebKit/mac/Misc/WebNSURLExtras.h
+++ b/WebKit/mac/Misc/WebNSURLExtras.h
@@ -60,6 +60,7 @@
- (NSURL *)_webkit_URLByRemovingResourceSpecifier;
- (BOOL)_webkit_isJavaScriptURL;
+- (BOOL)_webkit_isFileURL;
- (NSString *)_webkit_scriptIfJavaScriptURL;
- (BOOL)_webkit_isFTPDirectoryURL;
diff --git a/WebKit/mac/Misc/WebNSURLExtras.mm b/WebKit/mac/Misc/WebNSURLExtras.mm
index b388c22..a081f1a 100644
--- a/WebKit/mac/Misc/WebNSURLExtras.mm
+++ b/WebKit/mac/Misc/WebNSURLExtras.mm
@@ -571,6 +571,7 @@ static CFStringRef createStringWithEscapedUnsafeCharacters(CFStringRef string)
free(after);
result = mapHostNames(result, !needsHostNameDecoding);
+ result = [result precomposedStringWithCanonicalMapping];
return WebCFAutorelease(createStringWithEscapedUnsafeCharacters((CFStringRef)result));
}
diff --git a/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm b/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
index 68e25ab..c2abc92 100644
--- a/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
@@ -29,16 +29,17 @@
#import "NetscapePluginHostProxy.h"
#import "NetscapePluginInstanceProxy.h"
-#import <WebCore/DocumentLoader.h>
-#import <WebCore/Frame.h>
-#import <WebCore/FrameLoader.h>
-#import "WebHostedNetscapePluginView.h"
#import "WebFrameInternal.h"
+#import "WebHostedNetscapePluginView.h"
#import "WebKitErrorsPrivate.h"
-#import "WebNSURLExtras.h"
-#import "WebNSURLRequestExtras.h"
#import "WebKitPluginHost.h"
#import "WebKitSystemInterface.h"
+#import "WebNSURLExtras.h"
+#import "WebNSURLRequestExtras.h"
+#import <WebCore/DocumentLoader.h>
+#import <WebCore/Frame.h>
+#import <WebCore/FrameLoader.h>
+#import <WebCore/WebCoreURLResponse.h>
using namespace WebCore;
@@ -151,7 +152,7 @@ void HostedNetscapePluginStream::didReceiveResponse(NetscapePlugInStreamLoader*,
[theHeaders appendBytes:"\0" length:1];
}
- startStream([r URL], expectedContentLength, WKGetNSURLResponseLastModifiedDate(r), [r MIMEType], theHeaders);
+ startStream([r URL], expectedContentLength, WKGetNSURLResponseLastModifiedDate(r), [r _webcore_MIMEType], theHeaders);
}
static NPReason reasonForError(NSError *error)
@@ -167,7 +168,8 @@ static NPReason reasonForError(NSError *error)
void HostedNetscapePluginStream::didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError& error)
{
- _WKPHStreamDidFail(m_instance->hostProxy()->port(), m_instance->pluginID(), m_streamID, reasonForError(error));
+ if (NetscapePluginHostProxy* hostProxy = m_instance->hostProxy())
+ _WKPHStreamDidFail(hostProxy->port(), m_instance->pluginID(), m_streamID, reasonForError(error));
}
bool HostedNetscapePluginStream::wantsAllStreams() const
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
index 8e539f3..d550dac 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
@@ -47,13 +47,15 @@ public:
void pluginHostDied(NetscapePluginHostProxy*);
+ static void createPropertyListFile(WebNetscapePluginPackage *);
+
private:
NetscapePluginHostProxy* hostForPackage(WebNetscapePluginPackage *);
NetscapePluginHostManager();
~NetscapePluginHostManager();
- bool spawnPluginHost(WebNetscapePluginPackage *, mach_port_t clientPort, mach_port_t& pluginHostPort);
+ bool spawnPluginHost(WebNetscapePluginPackage *, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN);
bool initializeVendorPort();
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
index 9cedc42..08a6d6a 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
@@ -33,6 +33,7 @@
#import "WebNetscapePluginPackage.h"
#import <mach/mach_port.h>
#import <servers/bootstrap.h>
+#import <spawn.h>
#import <wtf/Assertions.h>
#import <wtf/RetainPtr.h>
#import <wtf/StdLibExtras.h>
@@ -77,12 +78,13 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePl
return 0;
mach_port_t pluginHostPort;
- if (!spawnPluginHost(package, clientPort, pluginHostPort)) {
+ ProcessSerialNumber pluginHostPSN;
+ if (!spawnPluginHost(package, clientPort, pluginHostPort, pluginHostPSN)) {
mach_port_destroy(mach_task_self(), clientPort);
return 0;
}
- NetscapePluginHostProxy* hostProxy = new NetscapePluginHostProxy(clientPort, pluginHostPort);
+ NetscapePluginHostProxy* hostProxy = new NetscapePluginHostProxy(clientPort, pluginHostPort, pluginHostPSN);
CFRetain(package);
result.first->second = hostProxy;
@@ -90,7 +92,7 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePl
return hostProxy;
}
-bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *package, mach_port_t clientPort, mach_port_t& pluginHostPort)
+bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *package, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN)
{
if (m_pluginVendorPort == MACH_PORT_NULL) {
if (!initializeVendorPort())
@@ -116,13 +118,26 @@ bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *packag
kern_return_t kr = _WKPASpawnPluginHost(m_pluginVendorPort, reinterpret_cast<uint8_t*>(const_cast<void*>([data bytes])), [data length], &pluginHostPort);
+ if (kr == MACH_SEND_INVALID_DEST) {
+ // The plug-in vendor port has gone away for some reason. Try to reinitialize it.
+ m_pluginVendorPort = MACH_PORT_NULL;
+ if (!initializeVendorPort())
+ return false;
+
+ // And spawn the plug-in host again.
+ kr = _WKPASpawnPluginHost(m_pluginVendorPort, reinterpret_cast<uint8_t*>(const_cast<void*>([data bytes])), [data length], &pluginHostPort);
+ }
+
if (kr != KERN_SUCCESS) {
// FIXME: Check for invalid dest and try to re-spawn the plug-in agent.
LOG_ERROR("Failed to spawn plug-in host, error %x", kr);
return false;
}
+ NSString *visibleName = [NSString stringWithFormat:@"%@ Plug-in Host - %@", [[NSProcessInfo processInfo] processName], [package filename]];
+
NSDictionary *hostProperties = [[NSDictionary alloc] initWithObjectsAndKeys:
+ visibleName, @"visibleName",
[package path], @"bundlePath",
nil];
@@ -130,8 +145,12 @@ bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *packag
ASSERT(data);
[hostProperties release];
-
- kr = _WKPHCheckInWithPluginHost(pluginHostPort, (uint8_t*)[data bytes], [data length], clientPort, renderServerPort);
+
+ ProcessSerialNumber psn;
+ GetCurrentProcess(&psn);
+
+ kr = _WKPHCheckInWithPluginHost(pluginHostPort, (uint8_t*)[data bytes], [data length], clientPort, psn.highLongOfPSN, psn.lowLongOfPSN, renderServerPort,
+ &pluginHostPSN.highLongOfPSN, &pluginHostPSN.lowLongOfPSN);
if (kr != KERN_SUCCESS) {
mach_port_deallocate(mach_task_self(), pluginHostPort);
@@ -205,7 +224,8 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl
ASSERT(data);
RefPtr<NetscapePluginInstanceProxy> instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView);
- kern_return_t kr = _WKPHInstantiatePlugin(hostProxy->port(), (uint8_t*)[data bytes], [data length], instance->pluginID());
+ uint32_t requestID = instance->nextRequestID();
+ kern_return_t kr = _WKPHInstantiatePlugin(hostProxy->port(), requestID, (uint8_t*)[data bytes], [data length], instance->pluginID());
if (kr == MACH_SEND_INVALID_DEST) {
// The plug-in host must have died, but we haven't received the death notification yet.
pluginHostDied(hostProxy);
@@ -213,22 +233,52 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl
// Try to spawn it again.
hostProxy = hostForPackage(pluginPackage);
- kr = _WKPHInstantiatePlugin(hostProxy->port(), (uint8_t*)[data bytes], [data length], instance->pluginID());
+ // Create a new instance.
+ instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView);
+ requestID = instance->nextRequestID();
+ kr = _WKPHInstantiatePlugin(hostProxy->port(), requestID, (uint8_t*)[data bytes], [data length], instance->pluginID());
}
- auto_ptr<NetscapePluginInstanceProxy::InstantiatePluginReply> reply = instance->waitForReply<NetscapePluginInstanceProxy::InstantiatePluginReply>();
- if (!reply.get())
- return 0;
-
- if (reply->m_resultCode != KERN_SUCCESS)
+ auto_ptr<NetscapePluginInstanceProxy::InstantiatePluginReply> reply = instance->waitForReply<NetscapePluginInstanceProxy::InstantiatePluginReply>(requestID);
+ if (!reply.get() || reply->m_resultCode != KERN_SUCCESS) {
+ instance->invalidate();
return 0;
+ }
instance->setRenderContextID(reply->m_renderContextID);
instance->setUseSoftwareRenderer(reply->m_useSoftwareRenderer);
return instance.release();
}
+
+void NetscapePluginHostManager::createPropertyListFile(WebNetscapePluginPackage *package)
+{
+ NSString *pluginHostAppPath = [[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] pathForAuxiliaryExecutable:pluginHostAppName];
+ NSString *pluginHostAppExecutablePath = [[NSBundle bundleWithPath:pluginHostAppPath] executablePath];
+ NSString *bundlePath = [package path];
+
+ pid_t pid;
+ posix_spawnattr_t attr;
+ posix_spawnattr_init(&attr);
+
+ // Set the architecture.
+ size_t ocount = 0;
+ int cpuTypes[1] = { [package pluginHostArchitecture] };
+ posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &ocount);
+
+ // Spawn the plug-in host and tell it to call the registration function.
+ const char* args[] = { [pluginHostAppExecutablePath fileSystemRepresentation], "-createPluginMIMETypesPreferences", [bundlePath fileSystemRepresentation], 0 };
+
+ int result = posix_spawn(&pid, args[0], 0, &attr, const_cast<char* const*>(args), 0);
+ posix_spawnattr_destroy(&attr);
+
+ if (!result && pid > 0) {
+ // Wait for the process to finish.
+ while (waitpid(pid, 0, 0) == -1) { }
+ }
+}
+
} // namespace WebKit
#endif // USE(PLUGIN_HOST_PROCESS)
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
index c597eec..4676f47 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
@@ -39,7 +39,7 @@ class NetscapePluginInstanceProxy;
class NetscapePluginHostProxy {
public:
- NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort);
+ NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort, const ProcessSerialNumber& pluginHostPSN);
mach_port_t port() const { return m_pluginHostPort; }
mach_port_t clientPort() const { return m_clientPort; }
@@ -52,9 +52,16 @@ public:
void setMenuBarVisible(bool);
void setModal(bool);
+ void applicationDidBecomeActive();
+
+ bool processRequests();
+
private:
~NetscapePluginHostProxy();
void pluginHostDied();
+
+ void beginModal();
+ void endModal();
static void deadNameNotificationCallback(CFMachPortRef port, void *msg, CFIndex size, void *info);
@@ -62,6 +69,8 @@ private:
PluginInstanceMap m_instances;
mach_port_t m_clientPort;
+ mach_port_t m_portSet;
+
#ifdef USE_LIBDISPATCH
dispatch_source_t m_clientPortSource;
#else
@@ -70,10 +79,11 @@ private:
mach_port_t m_pluginHostPort;
RetainPtr<CFMachPortRef> m_deadNameNotificationPort;
+ RetainPtr<id> m_activationObserver;
RetainPtr<NSWindow *> m_placeholderWindow;
- unsigned m_modalCount;
-
+ unsigned m_isModal;
bool m_menuBarIsVisible;
+ const ProcessSerialNumber m_pluginHostPSN;
};
} // namespace WebKit
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index 14af429..c0beb2f 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -37,8 +37,8 @@
#import "WebHostedNetscapePluginView.h"
#import "WebKitSystemInterface.h"
#import <WebCore/Frame.h>
+#import <WebCore/IdentifierRep.h>
#import <WebCore/ScriptController.h>
-#import <WebCore/npruntime_impl.h>
extern "C" {
#import "WebKitPluginHost.h"
@@ -51,19 +51,23 @@ using namespace WebCore;
namespace WebKit {
-static String fromUTF8WithLatin1Fallback(const char* data, int length = -1)
-{
- if (length == -1)
- length = strlen(data);
-
- String result = String::fromUTF8(data, length);
-
- if (result.isNull())
- result = String(data, length);
-
- return result;
-}
+class PluginDestroyDeferrer {
+public:
+ PluginDestroyDeferrer(NetscapePluginInstanceProxy* proxy)
+ : m_proxy(proxy)
+ {
+ m_proxy->willCallPluginFunction();
+ }
+ ~PluginDestroyDeferrer()
+ {
+ m_proxy->didCallPluginFunction();
+ }
+
+private:
+ RefPtr<NetscapePluginInstanceProxy> m_proxy;
+};
+
typedef HashMap<mach_port_t, NetscapePluginHostProxy*> PluginProxyMap;
static PluginProxyMap& pluginProxyMap()
{
@@ -72,11 +76,13 @@ static PluginProxyMap& pluginProxyMap()
return pluginProxyMap;
}
-NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort)
+NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort, const ProcessSerialNumber& pluginHostPSN)
: m_clientPort(clientPort)
+ , m_portSet(MACH_PORT_NULL)
, m_pluginHostPort(pluginHostPort)
- , m_modalCount(0)
+ , m_isModal(false)
, m_menuBarIsVisible(true)
+ , m_pluginHostPSN(pluginHostPSN)
{
pluginProxyMap().add(m_clientPort, this);
@@ -95,17 +101,25 @@ NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_po
#ifdef USE_LIBDISPATCH
// FIXME: Unfortunately we can't use a dispatch source here until <rdar://problem/6393180> has been resolved.
- m_clientPortSource = dispatch_source_mig_create(m_clientPort, WKPCWebKitPluginClient_subsystem.maxsize, 0,
+ m_clientPortSource = dispatch_source_mig_create(m_clientPort, WKWebKitPluginClient_subsystem.maxsize, 0,
dispatch_get_main_queue(), WebKitPluginClient_server);
#else
- m_clientPortSource.adoptCF(WKCreateMIGServerSource((mig_subsystem_t)&WKPCWebKitPluginClient_subsystem, m_clientPort));
+ m_clientPortSource.adoptCF(WKCreateMIGServerSource((mig_subsystem_t)&WKWebKitPluginClient_subsystem, m_clientPort));
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), kCFRunLoopDefaultMode);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSEventTrackingRunLoopMode);
#endif
}
NetscapePluginHostProxy::~NetscapePluginHostProxy()
{
pluginProxyMap().remove(m_clientPort);
+
+ // Free the port set
+ if (m_portSet) {
+ mach_port_extract_member(mach_task_self(), m_clientPort, m_portSet);
+ mach_port_extract_member(mach_task_self(), CFMachPortGetPort(m_deadNameNotificationPort.get()), m_portSet);
+ mach_port_destroy(mach_task_self(), m_portSet);
+ }
ASSERT(m_clientPortSource);
#ifdef USE_LIBDISPATCH
@@ -128,15 +142,12 @@ void NetscapePluginHostProxy::pluginHostDied()
NetscapePluginHostManager::shared().pluginHostDied(this);
// The plug-in crashed while its menu bar was hidden. Make sure to show it.
- if (m_menuBarIsVisible)
+ if (!m_menuBarIsVisible)
setMenuBarVisible(true);
// The plug-in crashed while it had a modal dialog up.
- if (m_modalCount) {
- m_modalCount = 1;
-
- setModal(false);
- }
+ if (m_isModal)
+ endModal();
delete this;
}
@@ -180,44 +191,137 @@ void NetscapePluginHostProxy::setMenuBarVisible(bool visible)
}
}
-void NetscapePluginHostProxy::setModal(bool modal)
+void NetscapePluginHostProxy::applicationDidBecomeActive()
{
- if (modal) {
- if (!m_modalCount++) {
- ASSERT(!m_placeholderWindow);
-
- m_placeholderWindow.adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
-
- // We need to be able to get the setModal(false) call from the plug-in host.
- CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSModalPanelRunLoopMode);
+ SetFrontProcess(&m_pluginHostPSN);
+}
- [NSApp runModalForWindow:m_placeholderWindow.get()];
- }
- } else {
- if (!--m_modalCount) {
- ASSERT(m_placeholderWindow);
-
- CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSModalPanelRunLoopMode);
+void NetscapePluginHostProxy::beginModal()
+{
+ ASSERT(!m_placeholderWindow);
+ ASSERT(!m_activationObserver);
+
+ m_placeholderWindow.adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+
+ m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillBecomeActiveNotification object:NSApp queue:nil
+ usingBlock:^(NSNotification *){ applicationDidBecomeActive(); }];
+
+ // We need to be able to get the setModal(false) call from the plug-in host.
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSModalPanelRunLoopMode);
+
+ [NSApp runModalForWindow:m_placeholderWindow.get()];
+}
+
+void NetscapePluginHostProxy::endModal()
+{
+ ASSERT(m_placeholderWindow);
+ ASSERT(m_activationObserver);
+
+ [[NSNotificationCenter defaultCenter] removeObserver:m_activationObserver.get()];
+ m_activationObserver = nil;
+
+ CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSModalPanelRunLoopMode);
+
+ [NSApp stopModal];
+ [m_placeholderWindow.get() orderOut:nil];
+ m_placeholderWindow = 0;
+
+ // Make ourselves the front process.
+ ProcessSerialNumber psn;
+ GetCurrentProcess(&psn);
+ SetFrontProcess(&psn);
+}
+
- [NSApp stopModal];
- [m_placeholderWindow.get() orderOut:nil];
- m_placeholderWindow = 0;
+void NetscapePluginHostProxy::setModal(bool modal)
+{
+ if (modal == m_isModal)
+ return;
+
+ m_isModal = modal;
+
+ if (m_isModal)
+ beginModal();
+ else
+ endModal();
+}
+
+bool NetscapePluginHostProxy::processRequests()
+{
+ if (!m_portSet) {
+ mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &m_portSet);
+ mach_port_insert_member(mach_task_self(), m_clientPort, m_portSet);
+ mach_port_insert_member(mach_task_self(), CFMachPortGetPort(m_deadNameNotificationPort.get()), m_portSet);
+ }
+
+ char buffer[4096];
+
+ mach_msg_header_t* msg = reinterpret_cast<mach_msg_header_t*>(buffer);
+
+ kern_return_t kr = mach_msg(msg, MACH_RCV_MSG, 0, sizeof(buffer), m_portSet, 0, MACH_PORT_NULL);
+
+ if (kr != KERN_SUCCESS) {
+ LOG_ERROR("Could not receive mach message, error %x", kr);
+ return false;
+ }
+
+ if (msg->msgh_local_port == m_clientPort) {
+ __ReplyUnion__WKWebKitPluginClient_subsystem reply;
+ mach_msg_header_t* replyHeader = reinterpret_cast<mach_msg_header_t*>(&reply);
+
+ if (WebKitPluginClient_server(msg, replyHeader) && replyHeader->msgh_remote_port != MACH_PORT_NULL) {
+ kr = mach_msg(replyHeader, MACH_SEND_MSG, replyHeader->msgh_size, 0, MACH_PORT_NULL, 0, MACH_PORT_NULL);
- // Make ourselves the front process.
- ProcessSerialNumber psn;
- GetCurrentProcess(&psn);
- SetFrontProcess(&psn);
+ if (kr != KERN_SUCCESS) {
+ LOG_ERROR("Could not send mach message, error %x", kr);
+ return false;
+ }
}
- }
-}
+
+ return true;
+ }
+ if (msg->msgh_local_port == CFMachPortGetPort(m_deadNameNotificationPort.get())) {
+ ASSERT(msg->msgh_id == MACH_NOTIFY_DEAD_NAME);
+ pluginHostDied();
+ return false;
+ }
+
+ ASSERT_NOT_REACHED();
+ return false;
+}
+
} // namespace WebKit
using namespace WebKit;
+// Helper class for deallocating data
+class DataDeallocator {
+public:
+ DataDeallocator(data_t data, mach_msg_type_number_t dataLength)
+ : m_data(reinterpret_cast<vm_address_t>(data))
+ , m_dataLength(dataLength)
+ {
+ }
+
+ ~DataDeallocator()
+ {
+ if (!m_data)
+ return;
+
+ vm_deallocate(mach_task_self(), m_data, m_dataLength);
+ }
+
+private:
+ vm_address_t m_data;
+ vm_size_t m_dataLength;
+};
+
// MiG callbacks
kern_return_t WKPCStatusText(mach_port_t clientPort, uint32_t pluginID, data_t text, mach_msg_type_number_t textCnt)
{
+ DataDeallocator deallocator(text, textCnt);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -234,6 +338,10 @@ kern_return_t WKPCLoadURL(mach_port_t clientPort, uint32_t pluginID, data_t url,
data_t postData, mach_msg_type_number_t postDataLength, uint32_t flags,
uint16_t* outResult, uint32_t* outStreamID)
{
+ DataDeallocator urlDeallocator(url, urlLength);
+ DataDeallocator targetDeallocator(target, targetLength);
+ DataDeallocator postDataDeallocator(postData, postDataLength);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -278,12 +386,11 @@ kern_return_t WKPCInvalidateRect(mach_port_t clientPort, uint32_t pluginID, doub
if (!instanceProxy)
return KERN_FAILURE;
- [instanceProxy->pluginView() setNeedsDisplayInRect:NSMakeRect(x, y, width, height)];
-
+ instanceProxy->invalidateRect(x, y, width, height);
return KERN_SUCCESS;
}
-kern_return_t WKPCGetScriptableNPObjectReply(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID)
+kern_return_t WKPCGetScriptableNPObjectReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
@@ -293,11 +400,11 @@ kern_return_t WKPCGetScriptableNPObjectReply(mach_port_t clientPort, uint32_t pl
if (!instanceProxy)
return KERN_FAILURE;
- instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::GetScriptableNPObjectReply(objectID));
+ instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::GetScriptableNPObjectReply(objectID));
return KERN_SUCCESS;
}
-kern_return_t WKPCBooleanReply(mach_port_t clientPort, uint32_t pluginID, boolean_t result)
+kern_return_t WKPCBooleanReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, boolean_t result)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
@@ -307,12 +414,14 @@ kern_return_t WKPCBooleanReply(mach_port_t clientPort, uint32_t pluginID, boolea
if (!instanceProxy)
return KERN_FAILURE;
- instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::BooleanReply(result));
+ instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::BooleanReply(result));
return KERN_SUCCESS;
}
-kern_return_t WKPCBooleanAndDataReply(mach_port_t clientPort, uint32_t pluginID, boolean_t returnValue, data_t resultData, mach_msg_type_number_t resultLength)
+kern_return_t WKPCBooleanAndDataReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, boolean_t returnValue, data_t resultData, mach_msg_type_number_t resultLength)
{
+ DataDeallocator deallocator(resultData, resultLength);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -321,13 +430,13 @@ kern_return_t WKPCBooleanAndDataReply(mach_port_t clientPort, uint32_t pluginID,
if (!instanceProxy)
return KERN_FAILURE;
- RetainPtr<CFDataRef> result = CFDataCreate(0, reinterpret_cast<UInt8*>(resultData), resultLength);
- instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::BooleanAndDataReply(returnValue, result));
+ RetainPtr<CFDataRef> result(AdoptCF, CFDataCreate(0, reinterpret_cast<UInt8*>(resultData), resultLength));
+ instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::BooleanAndDataReply(returnValue, result));
return KERN_SUCCESS;
}
-kern_return_t WKPCInstantiatePluginReply(mach_port_t clientPort, uint32_t pluginID, kern_return_t result, uint32_t renderContextID, boolean_t useSoftwareRenderer)
+kern_return_t WKPCInstantiatePluginReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, kern_return_t result, uint32_t renderContextID, boolean_t useSoftwareRenderer)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
@@ -337,7 +446,7 @@ kern_return_t WKPCInstantiatePluginReply(mach_port_t clientPort, uint32_t plugin
if (!instanceProxy)
return KERN_FAILURE;
- instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::InstantiatePluginReply(result, renderContextID, useSoftwareRenderer));
+ instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::InstantiatePluginReply(result, renderContextID, useSoftwareRenderer));
return KERN_SUCCESS;
}
@@ -359,6 +468,24 @@ kern_return_t WKPCGetWindowNPObject(mach_port_t clientPort, uint32_t pluginID, u
return KERN_SUCCESS;
}
+kern_return_t WKPCGetPluginElementNPObject(mach_port_t clientPort, uint32_t pluginID, uint32_t* outObjectID)
+{
+ NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
+ if (!hostProxy)
+ return KERN_FAILURE;
+
+ NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
+ if (!instanceProxy)
+ return KERN_FAILURE;
+
+ uint32_t objectID;
+ if (!instanceProxy->getPluginElementNPObject(objectID))
+ return KERN_FAILURE;
+
+ *outObjectID = objectID;
+ return KERN_SUCCESS;
+}
+
kern_return_t WKPCReleaseObject(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
@@ -373,8 +500,10 @@ kern_return_t WKPCReleaseObject(mach_port_t clientPort, uint32_t pluginID, uint3
return KERN_SUCCESS;
}
-kern_return_t WKPCEvaluate(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, data_t scriptData, mach_msg_type_number_t scriptLength)
+kern_return_t WKPCEvaluate(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, data_t scriptData, mach_msg_type_number_t scriptLength)
{
+ DataDeallocator deallocator(scriptData, scriptLength);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -383,24 +512,28 @@ kern_return_t WKPCEvaluate(mach_port_t clientPort, uint32_t pluginID, uint32_t o
if (!instanceProxy)
return KERN_FAILURE;
- String script = fromUTF8WithLatin1Fallback(scriptData, scriptLength);
+ PluginDestroyDeferrer deferrer(instanceProxy);
- data_t resultData;
- mach_msg_type_number_t resultLength;
+ String script = String::fromUTF8WithLatin1Fallback(scriptData, scriptLength);
+ data_t resultData = 0;
+ mach_msg_type_number_t resultLength = 0;
boolean_t returnValue = instanceProxy->evaluate(objectID, script, resultData, resultLength);
- _WKPHEvaluateReply(hostProxy->port(), instanceProxy->pluginID(), returnValue, resultData, resultLength);
- mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
+ _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
+ if (resultData)
+ mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
return KERN_SUCCESS;
}
kern_return_t WKPCGetStringIdentifier(mach_port_t clientPort, data_t name, mach_msg_type_number_t nameCnt, uint64_t* identifier)
{
- COMPILE_ASSERT(sizeof(*identifier) == sizeof(NPIdentifier), identifier_sizes);
+ DataDeallocator deallocator(name, nameCnt);
+
+ COMPILE_ASSERT(sizeof(*identifier) == sizeof(IdentifierRep*), identifier_sizes);
- *identifier = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(name));
+ *identifier = reinterpret_cast<uint64_t>(IdentifierRep::get(name));
return KERN_SUCCESS;
}
@@ -408,23 +541,24 @@ kern_return_t WKPCGetIntIdentifier(mach_port_t clientPort, int32_t value, uint64
{
COMPILE_ASSERT(sizeof(*identifier) == sizeof(NPIdentifier), identifier_sizes);
- *identifier = reinterpret_cast<uint64_t>(_NPN_GetIntIdentifier(value));
+ *identifier = reinterpret_cast<uint64_t>(IdentifierRep::get(value));
return KERN_SUCCESS;
}
-static Identifier identifierFromServerIdentifier(uint64_t serverIdentifier)
+static Identifier identifierFromIdentifierRep(IdentifierRep* identifier)
{
- NPIdentifier identifier = reinterpret_cast<NPIdentifier>(serverIdentifier);
- ASSERT(_NPN_IdentifierIsString(identifier));
-
- String s = fromUTF8WithLatin1Fallback(_NPN_UTF8FromIdentifier(identifier));
-
- return Identifier(JSDOMWindow::commonJSGlobalData(), s);
+ ASSERT(IdentifierRep::isValid(identifier));
+ ASSERT(identifier->isString());
+
+ const char* str = identifier->string();
+ return Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str)));
}
-kern_return_t WKPCInvoke(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t identifier,
+kern_return_t WKPCInvoke(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier,
data_t argumentsData, mach_msg_type_number_t argumentsLength)
{
+ DataDeallocator deallocator(argumentsData, argumentsLength);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -433,23 +567,32 @@ kern_return_t WKPCInvoke(mach_port_t clientPort, uint32_t pluginID, uint32_t obj
if (!instanceProxy)
return KERN_FAILURE;
- Identifier methodNameIdentifier = identifierFromServerIdentifier(identifier);
-
- data_t resultData;
- mach_msg_type_number_t resultLength;
+ PluginDestroyDeferrer deferrer(instanceProxy);
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
+ if (!IdentifierRep::isValid(identifier)) {
+ _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false, 0, 0);
+ return KERN_SUCCESS;
+ }
+
+ Identifier methodNameIdentifier = identifierFromIdentifierRep(identifier);
+
+ data_t resultData = 0;
+ mach_msg_type_number_t resultLength = 0;
boolean_t returnValue = instanceProxy->invoke(objectID, methodNameIdentifier, argumentsData, argumentsLength, resultData, resultLength);
- _WKPHEvaluateReply(hostProxy->port(), instanceProxy->pluginID(), returnValue, resultData, resultLength);
- mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
+ _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
+ if (resultData)
+ mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
return KERN_SUCCESS;
}
-kern_return_t WKPCInvokeDefault(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID,
- data_t argumentsData, mach_msg_type_number_t argumentsLength,
- boolean_t*returnValue, data_t* resultData, mach_msg_type_number_t* resultLength)
+kern_return_t WKPCInvokeDefault(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID,
+ data_t argumentsData, mach_msg_type_number_t argumentsLength)
{
+ DataDeallocator deallocator(argumentsData, argumentsLength);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -458,15 +601,25 @@ kern_return_t WKPCInvokeDefault(mach_port_t clientPort, uint32_t pluginID, uint3
if (!instanceProxy)
return KERN_FAILURE;
- *returnValue = instanceProxy->invokeDefault(objectID, argumentsData, argumentsLength, *resultData, *resultLength);
+ PluginDestroyDeferrer deferrer(instanceProxy);
+
+ data_t resultData = 0;
+ mach_msg_type_number_t resultLength = 0;
+ boolean_t returnValue = instanceProxy->invokeDefault(objectID, argumentsData, argumentsLength, resultData, resultLength);
+
+ _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
+ if (resultData)
+ mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
return KERN_SUCCESS;
}
kern_return_t WKPCConstruct(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID,
data_t argumentsData, mach_msg_type_number_t argumentsLength,
- boolean_t*returnValue, data_t* resultData, mach_msg_type_number_t* resultLength)
+ boolean_t* returnValue, data_t* resultData, mach_msg_type_number_t* resultLength)
{
+ DataDeallocator deallocator(argumentsData, argumentsLength);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -475,12 +628,14 @@ kern_return_t WKPCConstruct(mach_port_t clientPort, uint32_t pluginID, uint32_t
if (!instanceProxy)
return KERN_FAILURE;
+ PluginDestroyDeferrer deferrer(instanceProxy);
+
*returnValue = instanceProxy->construct(objectID, argumentsData, argumentsLength, *resultData, *resultLength);
return KERN_SUCCESS;
}
-kern_return_t WKPCGetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t identifier, boolean_t*returnValue, data_t* resultData, mach_msg_type_number_t* resultLength)
+kern_return_t WKPCGetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
@@ -490,21 +645,33 @@ kern_return_t WKPCGetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_
if (!instanceProxy)
return KERN_FAILURE;
- NPIdentifier npIdentifier = reinterpret_cast<NPIdentifier>(identifier);
- if (_NPN_IdentifierIsString(npIdentifier)) {
- const NPUTF8* propertyName = _NPN_UTF8FromIdentifier(npIdentifier);
- String propertyNameString = fromUTF8WithLatin1Fallback(propertyName);
-
- Identifier propertyNameIdentifier = identifierFromServerIdentifier(identifier);
- *returnValue = instanceProxy->getProperty(objectID, propertyNameIdentifier, *resultData, *resultLength);
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
+ if (!IdentifierRep::isValid(identifier))
+ return KERN_FAILURE;
+
+ PluginDestroyDeferrer deferrer(instanceProxy);
+
+ data_t resultData = 0;
+ mach_msg_type_number_t resultLength = 0;
+ boolean_t returnValue;
+
+ if (identifier->isString()) {
+ Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier);
+ returnValue = instanceProxy->getProperty(objectID, propertyNameIdentifier, resultData, resultLength);
} else
- *returnValue = instanceProxy->setProperty(objectID, _NPN_IntFromIdentifier(npIdentifier), *resultData, *resultLength);
+ returnValue = instanceProxy->setProperty(objectID, identifier->number(), resultData, resultLength);
+
+ _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
+ if (resultData)
+ mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
return KERN_SUCCESS;
}
-kern_return_t WKPCSetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t identifier, data_t valueData, mach_msg_type_number_t valueLength, boolean_t*returnValue)
+kern_return_t WKPCSetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t serverIdentifier, data_t valueData, mach_msg_type_number_t valueLength, boolean_t* returnValue)
{
+ DataDeallocator deallocator(valueData, valueLength);
+
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
return KERN_FAILURE;
@@ -512,21 +679,23 @@ kern_return_t WKPCSetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_
NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
if (!instanceProxy)
return KERN_FAILURE;
+
+ PluginDestroyDeferrer deferrer(instanceProxy);
+
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
+ if (!IdentifierRep::isValid(identifier))
+ *returnValue = false;
- NPIdentifier npIdentifier = reinterpret_cast<NPIdentifier>(identifier);
- if (_NPN_IdentifierIsString(npIdentifier)) {
- const NPUTF8* propertyName = _NPN_UTF8FromIdentifier(npIdentifier);
- String propertyNameString = fromUTF8WithLatin1Fallback(propertyName);
-
- Identifier propertyNameIdentifier = identifierFromServerIdentifier(identifier);
+ if (identifier->isString()) {
+ Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier);
*returnValue = instanceProxy->setProperty(objectID, propertyNameIdentifier, valueData, valueLength);
} else
- *returnValue = instanceProxy->setProperty(objectID, _NPN_IntFromIdentifier(npIdentifier), valueData, valueLength);
+ *returnValue = instanceProxy->setProperty(objectID, identifier->number(), valueData, valueLength);
return KERN_SUCCESS;
}
-kern_return_t WKPCRemoveProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t identifier, boolean_t*returnValue)
+kern_return_t WKPCRemoveProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t serverIdentifier, boolean_t* returnValue)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
@@ -536,20 +705,22 @@ kern_return_t WKPCRemoveProperty(mach_port_t clientPort, uint32_t pluginID, uint
if (!instanceProxy)
return KERN_FAILURE;
- NPIdentifier npIdentifier = reinterpret_cast<NPIdentifier>(identifier);
- if (_NPN_IdentifierIsString(npIdentifier)) {
- const NPUTF8* propertyName = _NPN_UTF8FromIdentifier(npIdentifier);
- String propertyNameString = fromUTF8WithLatin1Fallback(propertyName);
+ PluginDestroyDeferrer deferrer(instanceProxy);
+
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
+ if (!IdentifierRep::isValid(identifier))
+ return KERN_FAILURE;
- Identifier propertyNameIdentifier = identifierFromServerIdentifier(identifier);
+ if (identifier->isString()) {
+ Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier);
*returnValue = instanceProxy->removeProperty(objectID, propertyNameIdentifier);
} else
- *returnValue = instanceProxy->removeProperty(objectID, _NPN_IntFromIdentifier(npIdentifier));
+ *returnValue = instanceProxy->removeProperty(objectID, identifier->number());
return KERN_SUCCESS;
}
-kern_return_t WKPCHasProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t identifier, boolean_t*returnValue)
+kern_return_t WKPCHasProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
@@ -559,20 +730,27 @@ kern_return_t WKPCHasProperty(mach_port_t clientPort, uint32_t pluginID, uint32_
if (!instanceProxy)
return KERN_FAILURE;
- NPIdentifier npIdentifier = reinterpret_cast<NPIdentifier>(identifier);
- if (_NPN_IdentifierIsString(npIdentifier)) {
- const NPUTF8* propertyName = _NPN_UTF8FromIdentifier(npIdentifier);
- String propertyNameString = fromUTF8WithLatin1Fallback(propertyName);
-
- Identifier propertyNameIdentifier = identifierFromServerIdentifier(identifier);
- *returnValue = instanceProxy->hasProperty(objectID, propertyNameIdentifier);
+ PluginDestroyDeferrer deferrer(instanceProxy);
+
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
+ if (!IdentifierRep::isValid(identifier)) {
+ _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false);
+ return KERN_SUCCESS;
+ }
+
+ boolean_t returnValue;
+ if (identifier->isString()) {
+ Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier);
+ returnValue = instanceProxy->hasProperty(objectID, propertyNameIdentifier);
} else
- *returnValue = instanceProxy->hasProperty(objectID, _NPN_IntFromIdentifier(npIdentifier));
+ returnValue = instanceProxy->hasProperty(objectID, identifier->number());
+
+ _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue);
return KERN_SUCCESS;
}
-kern_return_t WKPCHasMethod(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t identifier, boolean_t*returnValue)
+kern_return_t WKPCHasMethod(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
if (!hostProxy)
@@ -582,22 +760,34 @@ kern_return_t WKPCHasMethod(mach_port_t clientPort, uint32_t pluginID, uint32_t
if (!instanceProxy)
return KERN_FAILURE;
- Identifier methodNameIdentifier = identifierFromServerIdentifier(identifier);
- *returnValue = instanceProxy->hasMethod(objectID, methodNameIdentifier);
+ PluginDestroyDeferrer deferrer(instanceProxy);
+
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
+ if (!IdentifierRep::isValid(identifier)) {
+ _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false);
+ return KERN_SUCCESS;
+ }
+
+ Identifier methodNameIdentifier = identifierFromIdentifierRep(identifier);
+ boolean_t returnValue = instanceProxy->hasMethod(objectID, methodNameIdentifier);
+
+ _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue);
return KERN_SUCCESS;
}
kern_return_t WKPCIdentifierInfo(mach_port_t clientPort, uint64_t serverIdentifier, data_t* infoData, mach_msg_type_number_t* infoLength)
{
- NPIdentifier identifier = reinterpret_cast<NPIdentifier>(serverIdentifier);
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
+ if (!IdentifierRep::isValid(identifier))
+ return KERN_FAILURE;
id info;
- if (_NPN_IdentifierIsString(identifier)) {
- char* s = _NPN_UTF8FromIdentifier(identifier);
- info = [NSData dataWithBytesNoCopy:s length:strlen(s) freeWhenDone:NO];
+ if (identifier->isString()) {
+ const char* str = identifier->string();
+ info = [NSData dataWithBytesNoCopy:(void*)str length:strlen(str) freeWhenDone:NO];
} else
- info = [NSNumber numberWithInt:_NPN_IntFromIdentifier(identifier)];
+ info = [NSNumber numberWithInt:identifier->number()];
RetainPtr<NSData*> data = [NSPropertyListSerialization dataFromPropertyList:info format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
ASSERT(data);
@@ -610,6 +800,28 @@ kern_return_t WKPCIdentifierInfo(mach_port_t clientPort, uint64_t serverIdentifi
return KERN_SUCCESS;
}
+kern_return_t WKPCEnumerate(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID)
+{
+ NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
+ if (!hostProxy)
+ return KERN_FAILURE;
+
+ NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
+ if (!instanceProxy)
+ return KERN_FAILURE;
+
+ data_t resultData = 0;
+ mach_msg_type_number_t resultLength = 0;
+ boolean_t returnValue = instanceProxy->enumerate(objectID, resultData, resultLength);
+
+ _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
+
+ if (resultData)
+ mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
+
+ return KERN_SUCCESS;
+}
+
kern_return_t WKPCSetMenuBarVisible(mach_port_t clientPort, boolean_t menuBarVisible)
{
NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
index 343aa41..3f9132d 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
@@ -54,6 +54,7 @@ namespace WebKit {
class HostedNetscapePluginStream;
class NetscapePluginHostProxy;
+class ProxyInstance;
class NetscapePluginInstanceProxy : public RefCounted<NetscapePluginInstanceProxy> {
public:
@@ -63,7 +64,12 @@ public:
}
~NetscapePluginInstanceProxy();
- uint32_t pluginID() const { return m_pluginID; }
+ uint32_t pluginID() const
+ {
+ ASSERT(m_pluginID);
+
+ return m_pluginID;
+ }
uint32_t renderContextID() const { return m_renderContextID; }
void setRenderContextID(uint32_t renderContextID) { m_renderContextID = renderContextID; }
@@ -86,17 +92,25 @@ public:
void mouseEvent(NSView *pluginView, NSEvent *, NPCocoaEventType);
void keyEvent(NSView *pluginView, NSEvent *, NPCocoaEventType);
+ void insertText(NSString *);
+
+ void print(CGContextRef, unsigned width, unsigned height);
+
void startTimers(bool throttleTimers);
void stopTimers();
+ void invalidateRect(double x, double y, double width, double height);
+
// NPRuntime
bool getWindowNPObject(uint32_t& objectID);
+ bool getPluginElementNPObject(uint32_t& objectID);
void releaseObject(uint32_t objectID);
bool evaluate(uint32_t objectID, const WebCore::String& script, data_t& resultData, mach_msg_type_number_t& resultLength);
bool invoke(uint32_t objectID, const JSC::Identifier& methodName, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength);
bool invokeDefault(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength);
bool construct(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength);
+ bool enumerate(uint32_t objectID, data_t& resultData, mach_msg_type_number_t& resultLength);
bool getProperty(uint32_t objectID, const JSC::Identifier& propertyName, data_t &resultData, mach_msg_type_number_t& resultLength);
bool getProperty(uint32_t objectID, unsigned propertyName, data_t &resultData, mach_msg_type_number_t& resultLength);
@@ -116,6 +130,17 @@ public:
void marshalValue(JSC::ExecState*, JSC::JSValuePtr value, data_t& resultData, mach_msg_type_number_t& resultLength);
JSC::JSValuePtr demarshalValue(JSC::ExecState*, const char* valueData, mach_msg_type_number_t valueLength);
+ void addInstance(ProxyInstance*);
+ void removeInstance(ProxyInstance*);
+
+ void invalidate();
+
+ void willCallPluginFunction();
+ void didCallPluginFunction();
+ bool shouldStop();
+
+ uint32_t nextRequestID();
+
// Reply structs
struct Reply {
enum Type {
@@ -125,7 +150,11 @@ public:
Boolean
};
- Reply(Type type) : m_type(type) { }
+ Reply(Type type)
+ : m_type(type)
+ {
+ }
+
virtual ~Reply() { }
Type m_type;
@@ -185,24 +214,23 @@ public:
RetainPtr<CFDataRef> m_result;
};
- void setCurrentReply(Reply* reply)
+ void setCurrentReply(uint32_t requestID, Reply* reply)
{
- ASSERT(!m_currentReply.get());
- m_currentReply = std::auto_ptr<Reply>(reply);
+ ASSERT(!m_replies.contains(requestID));
+ m_replies.set(requestID, reply);
}
template <typename T>
- std::auto_ptr<T> waitForReply()
+ std::auto_ptr<T> waitForReply(uint32_t requestID)
{
m_waitingForReply = true;
-
- processRequestsAndWaitForReply();
-
- if (m_currentReply.get())
- ASSERT(m_currentReply->m_type == T::ReplyType);
+
+ Reply* reply = processRequestsAndWaitForReply(requestID);
+ if (reply)
+ ASSERT(reply->m_type == T::ReplyType);
m_waitingForReply = false;
- return std::auto_ptr<T>(static_cast<T*>(m_currentReply.release()));
+ return std::auto_ptr<T>(static_cast<T*>(reply));
}
private:
@@ -215,7 +243,9 @@ private:
void evaluateJavaScript(PluginRequest*);
void stopAllStreams();
- void processRequestsAndWaitForReply();
+ Reply* processRequestsAndWaitForReply(uint32_t requestID);
+
+ void cleanup();
NetscapePluginHostProxy* m_pluginHostProxy;
WebHostedNetscapePluginView *m_pluginView;
@@ -226,14 +256,14 @@ private:
HashMap<uint32_t, RefPtr<HostedNetscapePluginStream> > m_streams;
- uint32_t m_currentRequestID;
+ uint32_t m_currentURLRequestID;
uint32_t m_pluginID;
uint32_t m_renderContextID;
boolean_t m_useSoftwareRenderer;
bool m_waitingForReply;
- std::auto_ptr<Reply> m_currentReply;
+ HashMap<uint32_t, Reply*> m_replies;
// NPRuntime
uint32_t idForObject(JSC::JSObject*);
@@ -246,6 +276,13 @@ private:
uint32_t m_objectIDCounter;
typedef HashMap<uint32_t, JSC::ProtectedPtr<JSC::JSObject> > ObjectMap;
ObjectMap m_objects;
+
+ typedef HashSet<ProxyInstance*> ProxyInstanceSet;
+ ProxyInstanceSet m_instances;
+
+ unsigned m_pluginFunctionCallDepth;
+ bool m_shouldStopSoon;
+ uint32_t m_currentRequestID;
};
} // namespace WebKit
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 6d0df52..2ef921a 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -46,10 +46,12 @@
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameTree.h>
+#import <WebCore/npruntime_impl.h>
#import <WebCore/runtime_object.h>
#import <WebCore/ScriptController.h>
#import <WebCore/ScriptValue.h>
#include <runtime/JSLock.h>
+#include <runtime/PropertyNameArray.h>
#import <utility>
extern "C" {
@@ -92,11 +94,14 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy
: m_pluginHostProxy(pluginHostProxy)
, m_pluginView(pluginView)
, m_requestTimer(this, &NetscapePluginInstanceProxy::requestTimerFired)
- , m_currentRequestID(0)
+ , m_currentURLRequestID(0)
, m_renderContextID(0)
, m_useSoftwareRenderer(false)
, m_waitingForReply(false)
, m_objectIDCounter(0)
+ , m_pluginFunctionCallDepth(0)
+ , m_shouldStopSoon(false)
+ , m_currentRequestID(0)
{
ASSERT(m_pluginView);
@@ -111,6 +116,9 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy
NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy()
{
ASSERT(!m_pluginHostProxy);
+
+ m_pluginID = 0;
+ deleteAllValues(m_replies);
}
void NetscapePluginInstanceProxy::resize(NSRect size, NSRect clipRect)
@@ -126,20 +134,53 @@ void NetscapePluginInstanceProxy::stopAllStreams()
streamsCopy[i]->stop();
}
-void NetscapePluginInstanceProxy::destroy()
+void NetscapePluginInstanceProxy::cleanup()
{
stopAllStreams();
- _WKPHDestroyPluginInstance(m_pluginHostProxy->port(), m_pluginID);
+ m_requestTimer.stop();
// Clear the object map, this will cause any outstanding JS objects that the plug-in had a reference to
// to go away when the next garbage collection takes place.
m_objects.clear();
+ if (Frame* frame = core([m_pluginView webFrame]))
+ frame->script()->cleanupScriptObjectsForPlugin(m_pluginView);
+
+ ProxyInstanceSet instances;
+ instances.swap(m_instances);
+
+ // Invalidate all proxy instances.
+ ProxyInstanceSet::const_iterator end = instances.end();
+ for (ProxyInstanceSet::const_iterator it = instances.begin(); it != end; ++it)
+ (*it)->invalidate();
+
+ m_pluginView = nil;
+}
+
+void NetscapePluginInstanceProxy::invalidate()
+{
+ // If the plug-in host has died, the proxy will be null.
+ if (!m_pluginHostProxy)
+ return;
+
m_pluginHostProxy->removePluginInstance(this);
m_pluginHostProxy = 0;
}
+void NetscapePluginInstanceProxy::destroy()
+{
+ uint32_t requestID = nextRequestID();
+
+ _WKPHDestroyPluginInstance(m_pluginHostProxy->port(), m_pluginID, requestID);
+
+ // We don't care about the reply here - we just want to block until the plug-in instance has been torn down.
+ waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
+
+ cleanup();
+ invalidate();
+}
+
HostedNetscapePluginStream *NetscapePluginInstanceProxy::pluginStream(uint32_t streamID)
{
return m_streams.get(streamID).get();
@@ -152,12 +193,11 @@ void NetscapePluginInstanceProxy::disconnectStream(HostedNetscapePluginStream* s
void NetscapePluginInstanceProxy::pluginHostDied()
{
- stopAllStreams();
-
m_pluginHostProxy = 0;
-
+
[m_pluginView pluginHostDied];
- m_pluginView = nil;
+
+ cleanup();
}
void NetscapePluginInstanceProxy::focusChanged(bool hasFocus)
@@ -218,6 +258,37 @@ void NetscapePluginInstanceProxy::keyEvent(NSView *pluginView, NSEvent *event, N
[event isARepeat], [event keyCode]);
}
+void NetscapePluginInstanceProxy::insertText(NSString *text)
+{
+ NSData *textData = [text dataUsingEncoding:NSUTF8StringEncoding];
+
+ _WKPHPluginInstanceInsertText(m_pluginHostProxy->port(), m_pluginID,
+ const_cast<char*>(reinterpret_cast<const char*>([textData bytes])), [textData length]);
+}
+
+void NetscapePluginInstanceProxy::print(CGContextRef context, unsigned width, unsigned height)
+{
+ uint32_t requestID = nextRequestID();
+ _WKPHPluginInstancePrint(m_pluginHostProxy->port(), m_pluginID, requestID, width, height);
+
+ auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
+ if (!reply.get() || !reply->m_returnValue)
+ return;
+
+ RetainPtr<CGDataProvider> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(reply->m_result.get()));
+ RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
+ RetainPtr<CGImageRef> image(AdoptCF, CGImageCreate(width, height, 8, 32, width * 4, colorSpace.get(), kCGImageAlphaFirst, dataProvider.get(), 0, false, kCGRenderingIntentDefault));
+
+ // Flip the context and draw the image.
+ CGContextSaveGState(context);
+ CGContextTranslateCTM(context, 0.0, height);
+ CGContextScaleCTM(context, 1.0, -1.0);
+
+ CGContextDrawImage(context, CGRectMake(0, 0, width, height), image.get());
+
+ CGContextRestoreGState(context);
+}
+
void NetscapePluginInstanceProxy::stopTimers()
{
_WKPHPluginInstanceStopTimers(m_pluginHostProxy->port(), m_pluginID);
@@ -309,6 +380,8 @@ NPError NetscapePluginInstanceProxy::loadURL(const char* url, const char* target
void NetscapePluginInstanceProxy::performRequest(PluginRequest* pluginRequest)
{
+ ASSERT(m_pluginView);
+
NSURLRequest *request = pluginRequest->request();
NSString *frameName = pluginRequest->frameName();
WebFrame *frame = nil;
@@ -329,8 +402,10 @@ void NetscapePluginInstanceProxy::performRequest(PluginRequest* pluginRequest)
windowFeatures:features];
[features release];
- if (!newWebView)
+ if (!newWebView) {
+ _WKPHLoadURLNotify(m_pluginHostProxy->port(), m_pluginID, pluginRequest->requestID(), NPERR_GENERIC_ERROR);
return;
+ }
frame = [newWebView mainFrame];
core(frame)->tree()->setName(frameName);
@@ -379,6 +454,7 @@ void NetscapePluginInstanceProxy::evaluateJavaScript(PluginRequest* pluginReques
void NetscapePluginInstanceProxy::requestTimerFired(Timer<NetscapePluginInstanceProxy>*)
{
ASSERT(!m_pluginRequests.isEmpty());
+ ASSERT(m_pluginView);
PluginRequest* request = m_pluginRequests.first();
m_pluginRequests.removeFirst();
@@ -427,7 +503,7 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch
}
// FIXME: Handle wraparound
- requestID = ++m_currentRequestID;
+ requestID = ++m_currentURLRequestID;
if (cTarget || JSString) {
// Make when targetting a frame or evaluating a JS string, perform the request after a delay because we don't
@@ -451,15 +527,17 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch
return NPERR_NO_ERROR;
}
-void NetscapePluginInstanceProxy::processRequestsAndWaitForReply()
+NetscapePluginInstanceProxy::Reply* NetscapePluginInstanceProxy::processRequestsAndWaitForReply(uint32_t requestID)
{
- while (!m_currentReply.get()) {
- kern_return_t kr = mach_msg_server_once(WebKitPluginClient_server, WKPCWebKitPluginClient_subsystem.maxsize + MAX_TRAILER_SIZE, m_pluginHostProxy->clientPort(), 0);
- if (kr != KERN_SUCCESS) {
- m_currentReply.reset();
- break;
- }
+ Reply* reply = 0;
+
+ while (!(reply = m_replies.take(requestID))) {
+ if (!m_pluginHostProxy->processRequests())
+ return 0;
}
+
+ ASSERT(reply);
+ return reply;
}
uint32_t NetscapePluginInstanceProxy::idForObject(JSObject* object)
@@ -490,7 +568,21 @@ bool NetscapePluginInstanceProxy::getWindowNPObject(uint32_t& objectID)
return true;
}
+
+bool NetscapePluginInstanceProxy::getPluginElementNPObject(uint32_t& objectID)
+{
+ Frame* frame = core([m_pluginView webFrame]);
+ if (!frame)
+ return false;
+ if (JSObject* object = frame->script()->jsObjectForPluginElement([m_pluginView element]))
+ objectID = idForObject(object);
+ else
+ objectID = 0;
+
+ return true;
+}
+
void NetscapePluginInstanceProxy::releaseObject(uint32_t objectID)
{
m_objects.remove(objectID);
@@ -507,11 +599,25 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri
Frame* frame = core([m_pluginView webFrame]);
if (!frame)
return false;
+
+ JSLock lock(false);
- ExecState* exec = frame->script()->globalObject()->globalExec();
- JSValuePtr value = frame->loader()->executeScript(script).jsValue();
+ ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject();
+ ExecState* exec = globalObject->globalExec();
+
+ globalObject->globalData()->timeoutChecker.start();
+ Completion completion = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(script));
+ globalObject->globalData()->timeoutChecker.stop();
+ ComplType type = completion.complType();
- marshalValue(exec, value, resultData, resultLength);
+ JSValuePtr result;
+ if (type == Normal)
+ result = completion.value();
+
+ if (!result)
+ result = jsUndefined();
+
+ marshalValue(exec, result, resultData, resultLength);
exec->clearException();
return true;
}
@@ -541,9 +647,9 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me
demarshalValues(exec, argumentsData, argumentsLength, argList);
ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject();
- globalObject->startTimeoutCheck();
+ globalObject->globalData()->timeoutChecker.start();
JSValuePtr value = call(exec, function, callType, callData, object, argList);
- globalObject->stopTimeoutCheck();
+ globalObject->globalData()->timeoutChecker.stop();
marshalValue(exec, value, resultData, resultLength);
exec->clearException();
@@ -571,9 +677,9 @@ bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argume
demarshalValues(exec, argumentsData, argumentsLength, argList);
ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject();
- globalObject->startTimeoutCheck();
+ globalObject->globalData()->timeoutChecker.start();
JSValuePtr value = call(exec, object, callType, callData, object, argList);
- globalObject->stopTimeoutCheck();
+ globalObject->globalData()->timeoutChecker.stop();
marshalValue(exec, value, resultData, resultLength);
exec->clearException();
@@ -602,9 +708,9 @@ bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsD
demarshalValues(exec, argumentsData, argumentsLength, argList);
ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject();
- globalObject->startTimeoutCheck();
+ globalObject->globalData()->timeoutChecker.start();
JSValuePtr value = JSC::construct(exec, object, constructType, constructData, argList);
- globalObject->stopTimeoutCheck();
+ globalObject->globalData()->timeoutChecker.stop();
marshalValue(exec, value, resultData, resultLength);
exec->clearException();
@@ -785,6 +891,42 @@ bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier&
return !func.isUndefined();
}
+bool NetscapePluginInstanceProxy::enumerate(uint32_t objectID, data_t& resultData, mach_msg_type_number_t& resultLength)
+{
+ JSObject* object = m_objects.get(objectID);
+ if (!object)
+ return false;
+
+ Frame* frame = core([m_pluginView webFrame]);
+ if (!frame)
+ return false;
+
+ ExecState* exec = frame->script()->globalObject()->globalExec();
+ JSLock lock(false);
+
+ PropertyNameArray propertyNames(exec);
+ object->getPropertyNames(exec, propertyNames);
+
+ NSMutableArray *array = [[NSMutableArray alloc] init];
+ for (unsigned i = 0; i < propertyNames.size(); i++) {
+ uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().c_str()));
+
+ [array addObject:[NSNumber numberWithLongLong:methodName]];
+ }
+
+ NSData *data = [NSPropertyListSerialization dataFromPropertyList:array format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
+ ASSERT(data);
+
+ resultLength = [data length];
+ mig_allocate(reinterpret_cast<vm_address_t*>(&resultData), resultLength);
+
+ memcpy(resultData, [data bytes], resultLength);
+
+ exec->clearException();
+
+ return true;
+}
+
void NetscapePluginInstanceProxy::addValueToArray(NSMutableArray *array, ExecState* exec, JSValuePtr value)
{
JSLock lock(false);
@@ -803,8 +945,11 @@ void NetscapePluginInstanceProxy::addValueToArray(NSMutableArray *array, ExecSta
else if (value.isObject()) {
JSObject* object = asObject(value);
if (object->classInfo() == &RuntimeObjectImp::s_info) {
- // FIXME: Handle ProxyInstance objects.
- ASSERT_NOT_REACHED();
+ RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(object);
+ if (ProxyInstance* instance = static_cast<ProxyInstance*>(imp->getInternalInstance())) {
+ [array addObject:[NSNumber numberWithInt:NPObjectValueType]];
+ [array addObject:[NSNumber numberWithInt:instance->objectID()]];
+ }
} else {
[array addObject:[NSNumber numberWithInt:JSObjectValueType]];
[array addObject:[NSNumber numberWithInt:idForObject(object)]];
@@ -928,10 +1073,12 @@ void NetscapePluginInstanceProxy::demarshalValues(ExecState* exec, data_t values
PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr<RootObject> rootObject)
{
- if (_WKPHGetScriptableNPObject(m_pluginHostProxy->port(), m_pluginID) != KERN_SUCCESS)
+ uint32_t requestID = nextRequestID();
+
+ if (_WKPHGetScriptableNPObject(m_pluginHostProxy->port(), m_pluginID, requestID) != KERN_SUCCESS)
return 0;
- auto_ptr<GetScriptableNPObjectReply> reply = waitForReply<GetScriptableNPObjectReply>();
+ auto_ptr<GetScriptableNPObjectReply> reply = waitForReply<GetScriptableNPObjectReply>(requestID);
if (!reply.get())
return 0;
@@ -941,6 +1088,67 @@ PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRef
return ProxyInstance::create(rootObject, this, reply->m_objectID);
}
+void NetscapePluginInstanceProxy::addInstance(ProxyInstance* instance)
+{
+ ASSERT(!m_instances.contains(instance));
+
+ m_instances.add(instance);
+}
+
+void NetscapePluginInstanceProxy::removeInstance(ProxyInstance* instance)
+{
+ ASSERT(m_instances.contains(instance));
+
+ m_instances.remove(instance);
+}
+
+void NetscapePluginInstanceProxy::willCallPluginFunction()
+{
+ m_pluginFunctionCallDepth++;
+}
+
+void NetscapePluginInstanceProxy::didCallPluginFunction()
+{
+ ASSERT(m_pluginFunctionCallDepth > 0);
+ m_pluginFunctionCallDepth--;
+
+ // If -stop was called while we were calling into a plug-in function, and we're no longer
+ // inside a plug-in function, stop now.
+ if (!m_pluginFunctionCallDepth && m_shouldStopSoon) {
+ m_shouldStopSoon = false;
+ [m_pluginView stop];
+ }
+}
+
+bool NetscapePluginInstanceProxy::shouldStop()
+{
+ if (m_pluginFunctionCallDepth) {
+ m_shouldStopSoon = true;
+ return false;
+ }
+
+ return true;
+}
+
+uint32_t NetscapePluginInstanceProxy::nextRequestID()
+{
+ uint32_t requestID = ++m_currentRequestID;
+
+ // We don't want to return the HashMap empty/deleted "special keys"
+ if (requestID == 0 || requestID == static_cast<uint32_t>(-1))
+ return nextRequestID();
+
+ return requestID;
+}
+
+void NetscapePluginInstanceProxy::invalidateRect(double x, double y, double width, double height)
+{
+ ASSERT(m_pluginView);
+
+ [m_pluginView setNeedsDisplayInRect:NSMakeRect(x, y, width, height)];
+}
+
+
} // namespace WebKit
#endif // USE(PLUGIN_HOST_PROCESS)
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.h b/WebKit/mac/Plugins/Hosted/ProxyInstance.h
index 014e388..1e2e2dc 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.h
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.h
@@ -52,6 +52,10 @@ public:
JSC::JSValuePtr fieldValue(JSC::ExecState*, const JSC::Bindings::Field*) const;
void setFieldValue(JSC::ExecState*, const JSC::Bindings::Field*, JSC::JSValuePtr) const;
+ void invalidate();
+
+ uint32_t objectID() const { return m_objectID; }
+
private:
ProxyInstance(PassRefPtr<JSC::Bindings::RootObject>, NetscapePluginInstanceProxy*, uint32_t objectID);
@@ -68,6 +72,8 @@ private:
virtual JSC::JSValuePtr defaultValue(JSC::ExecState*, JSC::PreferredPrimitiveType) const;
virtual JSC::JSValuePtr valueOf(JSC::ExecState*) const;
+ virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);
+
JSC::JSValuePtr stringValue(JSC::ExecState*) const;
JSC::JSValuePtr numberValue(JSC::ExecState*) const;
JSC::JSValuePtr booleanValue() const;
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
index 8d6aaee..01e64ba 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
@@ -29,6 +29,9 @@
#import "NetscapePluginHostProxy.h"
#import "NetscapePluginInstanceProxy.h"
+#import <runtime/PropertyNameArray.h>
+#import <WebCore/IdentifierRep.h>
+#import <WebCore/JSDOMWindow.h>
#import <WebCore/npruntime_impl.h>
extern "C" {
@@ -38,6 +41,7 @@ extern "C" {
using namespace JSC;
using namespace JSC::Bindings;
using namespace std;
+using namespace WebCore;
namespace WebKit {
@@ -109,15 +113,20 @@ ProxyInstance::ProxyInstance(PassRefPtr<RootObject> rootObject, NetscapePluginIn
, m_instanceProxy(instanceProxy)
, m_objectID(objectID)
{
+ m_instanceProxy->addInstance(this);
}
ProxyInstance::~ProxyInstance()
{
deleteAllValues(m_fields);
deleteAllValues(m_methods);
+
+ if (!m_instanceProxy)
+ return;
- _WKPHNPObjectRelease(m_instanceProxy->hostProxy()->port(),
- m_instanceProxy->pluginID(), m_objectID);
+ m_instanceProxy->removeInstance(this);
+
+ invalidate();
}
JSC::Bindings::Class *ProxyInstance::getClass() const
@@ -128,12 +137,14 @@ JSC::Bindings::Class *ProxyInstance::getClass() const
JSValuePtr ProxyInstance::invoke(JSC::ExecState* exec, InvokeType type, uint64_t identifier, const JSC::ArgList& args)
{
RetainPtr<NSData*> arguments(m_instanceProxy->marshalValues(exec, args));
-
- if (_WKPHNPObjectInvoke(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), m_objectID,
+
+ uint32_t requestID = m_instanceProxy->nextRequestID();
+
+ if (_WKPHNPObjectInvoke(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID,
type, identifier, (char*)[arguments.get() bytes], [arguments.get() length]) != KERN_SUCCESS)
return jsUndefined();
- auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>();
+ auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
if (!reply.get() || !reply->m_returnValue)
return jsUndefined();
@@ -151,12 +162,14 @@ JSValuePtr ProxyInstance::invokeMethod(ExecState* exec, const MethodList& method
bool ProxyInstance::supportsInvokeDefaultMethod() const
{
+ uint32_t requestID = m_instanceProxy->nextRequestID();
+
if (_WKPHNPObjectHasInvokeDefaultMethod(m_instanceProxy->hostProxy()->port(),
- m_instanceProxy->pluginID(),
+ m_instanceProxy->pluginID(), requestID,
m_objectID) != KERN_SUCCESS)
return false;
- auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>();
+ auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
if (reply.get() && reply->m_result)
return true;
@@ -170,12 +183,14 @@ JSValuePtr ProxyInstance::invokeDefaultMethod(ExecState* exec, const ArgList& ar
bool ProxyInstance::supportsConstruct() const
{
+ uint32_t requestID = m_instanceProxy->nextRequestID();
+
if (_WKPHNPObjectHasConstructMethod(m_instanceProxy->hostProxy()->port(),
- m_instanceProxy->pluginID(),
+ m_instanceProxy->pluginID(), requestID,
m_objectID) != KERN_SUCCESS)
return false;
- auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>();
+ auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
if (reply.get() && reply->m_result)
return true;
@@ -219,6 +234,36 @@ JSValuePtr ProxyInstance::valueOf(ExecState* exec) const
return stringValue(exec);
}
+void ProxyInstance::getPropertyNames(ExecState* exec, PropertyNameArray& nameArray)
+{
+ uint32_t requestID = m_instanceProxy->nextRequestID();
+
+ if (_WKPHNPObjectEnumerate(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID) != KERN_SUCCESS)
+ return;
+
+ auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
+
+ if (!reply.get() || !reply->m_returnValue)
+ return;
+
+ RetainPtr<NSArray*> array = [NSPropertyListSerialization propertyListFromData:(NSData *)reply->m_result.get()
+ mutabilityOption:NSPropertyListImmutable
+ format:0
+ errorDescription:0];
+
+ for (NSNumber *number in array.get()) {
+ IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>([number longLongValue]);
+ if (!IdentifierRep::isValid(identifier))
+ continue;
+
+ if (identifier->isString()) {
+ const char* str = identifier->string();
+ nameArray.add(Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str))));
+ } else
+ nameArray.add(Identifier::from(exec, identifier->number()));
+ }
+}
+
MethodList ProxyInstance::methodsNamed(const Identifier& identifier)
{
if (Method* method = m_methods.get(identifier.ustring().rep())) {
@@ -228,12 +273,14 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier)
}
uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
+ uint32_t requestID = m_instanceProxy->nextRequestID();
+
if (_WKPHNPObjectHasMethod(m_instanceProxy->hostProxy()->port(),
- m_instanceProxy->pluginID(),
+ m_instanceProxy->pluginID(), requestID,
m_objectID, methodName) != KERN_SUCCESS)
return MethodList();
- auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>();
+ auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
if (reply.get() && reply->m_result) {
Method* method = new ProxyMethod(methodName);
@@ -253,12 +300,14 @@ Field* ProxyInstance::fieldNamed(const Identifier& identifier)
return field;
uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
+ uint32_t requestID = m_instanceProxy->nextRequestID();
+
if (_WKPHNPObjectHasProperty(m_instanceProxy->hostProxy()->port(),
- m_instanceProxy->pluginID(),
+ m_instanceProxy->pluginID(), requestID,
m_objectID, propertyName) != KERN_SUCCESS)
return 0;
- auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>();
+ auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
if (reply.get() && reply->m_result) {
Field* field = new ProxyField(propertyName);
@@ -273,13 +322,14 @@ Field* ProxyInstance::fieldNamed(const Identifier& identifier)
JSC::JSValuePtr ProxyInstance::fieldValue(ExecState* exec, const Field* field) const
{
uint64_t serverIdentifier = static_cast<const ProxyField*>(field)->serverIdentifier();
+ uint32_t requestID = m_instanceProxy->nextRequestID();
if (_WKPHNPObjectGetProperty(m_instanceProxy->hostProxy()->port(),
- m_instanceProxy->pluginID(),
+ m_instanceProxy->pluginID(), requestID,
m_objectID, serverIdentifier) != KERN_SUCCESS)
return jsUndefined();
- auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>();
+ auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
if (!reply.get() || !reply->m_returnValue)
return jsUndefined();
@@ -289,19 +339,28 @@ JSC::JSValuePtr ProxyInstance::fieldValue(ExecState* exec, const Field* field) c
void ProxyInstance::setFieldValue(ExecState* exec, const Field* field, JSValuePtr value) const
{
uint64_t serverIdentifier = static_cast<const ProxyField*>(field)->serverIdentifier();
+ uint32_t requestID = m_instanceProxy->nextRequestID();
data_t valueData;
mach_msg_type_number_t valueLength;
m_instanceProxy->marshalValue(exec, value, valueData, valueLength);
kern_return_t kr = _WKPHNPObjectSetProperty(m_instanceProxy->hostProxy()->port(),
- m_instanceProxy->pluginID(),
+ m_instanceProxy->pluginID(), requestID,
m_objectID, serverIdentifier, valueData, valueLength);
mig_deallocate(reinterpret_cast<vm_address_t>(valueData), valueLength);
if (kr != KERN_SUCCESS)
return;
- auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>();
+ auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
+}
+
+void ProxyInstance::invalidate()
+{
+ if (NetscapePluginHostProxy* hostProxy = m_instanceProxy->hostProxy())
+ _WKPHNPObjectRelease(hostProxy->port(),
+ m_instanceProxy->pluginID(), m_objectID);
+ m_instanceProxy = 0;
}
} // namespace WebKit
diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h
index 14b0dc1..8b68b7b 100644
--- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h
+++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h
@@ -54,7 +54,7 @@ namespace WebKit {
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement;
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
- (void)pluginHostDied;
@end
diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
index f30c2cb..c17d249 100644
--- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
@@ -29,11 +29,13 @@
#import "NetscapePluginInstanceProxy.h"
#import "NetscapePluginHostManager.h"
#import "NetscapePluginHostProxy.h"
+#import "WebTextInputWindowController.h"
#import "WebView.h"
#import "WebViewInternal.h"
#import "WebUIDelegate.h"
#import <CoreFoundation/CoreFoundation.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/runtime.h>
#import <WebCore/runtime_root.h>
#import <WebCore/WebCoreObjCExtras.h>
@@ -66,9 +68,9 @@ extern "C" {
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)element
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element
{
- self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually DOMElement:element];
+ self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually element:element];
if (!self)
return nil;
@@ -149,7 +151,10 @@ extern "C" {
- (BOOL)shouldStop
{
- return YES;
+ if (!_proxy)
+ return YES;
+
+ return _proxy->shouldStop();
}
- (void)destroyPlugin
@@ -197,13 +202,17 @@ extern "C" {
ASSERT([self window]);
- NSWindow *theWindow = [self window];
+ NSWindow *window = [self window];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self selector:@selector(windowFrameDidChange:)
- name:NSWindowDidMoveNotification object:theWindow];
+ name:NSWindowDidMoveNotification object:window];
[notificationCenter addObserver:self selector:@selector(windowFrameDidChange:)
- name:NSWindowDidResizeNotification object:theWindow];
+ name:NSWindowDidResizeNotification object:window];
+
+ if (_proxy)
+ _proxy->windowFrameChanged([window frame]);
+ [self updateAndSetWindow];
}
- (void)removeWindowObservers
@@ -245,10 +254,24 @@ extern "C" {
_proxy->mouseEvent(self, event, NPCocoaEventMouseExited);
}
+- (NSTextInputContext *)inputContext
+{
+ return [[WebTextInputWindowController sharedTextInputWindowController] inputContext];
+}
+
- (void)keyDown:(NSEvent *)event
{
- if (_isStarted && _proxy)
- _proxy->keyEvent(self, event, NPCocoaEventKeyDown);
+ if (!_isStarted || !_proxy)
+ return;
+
+ NSString *string = nil;
+ if ([[WebTextInputWindowController sharedTextInputWindowController] interpretKeyEvent:event string:&string]) {
+ if (string)
+ _proxy->insertText(string);
+ return;
+ }
+
+ _proxy->keyEvent(self, event, NPCocoaEventKeyDown);
}
- (void)keyUp:(NSEvent *)event
@@ -274,15 +297,32 @@ extern "C" {
- (void)drawRect:(NSRect)rect
{
if (_proxy) {
- if (_softwareRenderer)
- WKSoftwareCARendererRender(_softwareRenderer, (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], NSRectToCGRect(rect));
+ if (_softwareRenderer) {
+ if ([NSGraphicsContext currentContextDrawingToScreen])
+ WKSoftwareCARendererRender(_softwareRenderer, (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], NSRectToCGRect(rect));
+ else
+ _proxy->print(reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]), [self bounds].size.width, [self bounds].size.height);
+ }
+
return;
}
if (_pluginHostDied) {
- // Fill the area with a nice red color for now.
- [[NSColor redColor] set];
- NSRectFill(rect);
+ static NSImage *nullPlugInImage;
+ if (!nullPlugInImage) {
+ NSBundle *bundle = [NSBundle bundleForClass:[WebHostedNetscapePluginView class]];
+ nullPlugInImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"nullplugin" ofType:@"tiff"]];
+ [nullPlugInImage setFlipped:YES];
+ }
+
+ if (!nullPlugInImage)
+ return;
+
+ NSSize imageSize = [nullPlugInImage size];
+ NSSize viewSize = [self bounds].size;
+
+ NSPoint point = NSMakePoint((viewSize.width - imageSize.width) / 2.0, (viewSize.height - imageSize.height) / 2.0);
+ [nullPlugInImage drawAtPoint:point fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
}
}
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
index 1aab38d..6128517 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
@@ -28,14 +28,14 @@
// FIXME: Come up with a better name.
subsystem WebKitPluginClient 300;
-serverprefix WKPC;
-userprefix _WKPC;
+serverprefix WK;
+userprefix _WK;
-simpleroutine StatusText(clientPort :mach_port_t;
+simpleroutine PCStatusText(clientPort :mach_port_t;
pluginID :uint32_t;
text :data_t);
-routine LoadURL(clientPort :mach_port_t;
+routine PCLoadURL(clientPort :mach_port_t;
pluginID :uint32_t;
url :data_t;
target :data_t;
@@ -44,12 +44,12 @@ routine LoadURL(clientPort :mach_port_t;
out resultCode :uint16_t;
out requestID :uint32_t);
-simpleroutine CancelLoadURL(clientPort :mach_port_t;
+simpleroutine PCCancelLoadURL(clientPort :mach_port_t;
pluginID :uint32_t;
streamID :uint32_t;
reason :int16_t);
-simpleroutine InvalidateRect(clientPort :mach_port_t;
+simpleroutine PCInvalidateRect(clientPort :mach_port_t;
pluginID :uint32_t;
x :double;
y :double;
@@ -58,109 +58,119 @@ simpleroutine InvalidateRect(clientPort :mach_port_t;
// NPRuntime
-routine GetStringIdentifier(clientPort :mach_port_t;
+routine PCGetStringIdentifier(clientPort :mach_port_t;
name :data_t;
out identifier :uint64_t);
-routine GetIntIdentifier(clientPort :mach_port_t;
+routine PCGetIntIdentifier(clientPort :mach_port_t;
value :int32_t;
out identifier: uint64_t);
-routine GetWindowNPObject(clientPort :mach_port_t;
+routine PCGetWindowNPObject(clientPort :mach_port_t;
pluginID :uint32_t;
out objectID :uint32_t);
+routine PCGetPluginElementNPObject(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ out objectID :uint32_t);
-routine ReleaseObject(clientPort :mach_port_t;
+routine PCReleaseObject(clientPort :mach_port_t;
pluginID :uint32_t;
objectID :uint32_t);
-simpleroutine Evaluate(clientPort :mach_port_t;
+simpleroutine PCEvaluate(clientPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
script :data_t);
-simpleroutine Invoke(clientPort :mach_port_t;
+simpleroutine PCInvoke(clientPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
methodNameIdentifier :uint64_t;
arguments :data_t);
-routine InvokeDefault(clientPort :mach_port_t;
+simpleroutine PCInvokeDefault(clientPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
- arguments :data_t;
- out returnValue :boolean_t;
- out result :data_t, dealloc);
+ arguments :data_t);
-routine Construct(clientPort :mach_port_t;
+routine PCConstruct(clientPort :mach_port_t;
pluginID :uint32_t;
objectID :uint32_t;
arguments :data_t;
out returnValue :boolean_t;
out result :data_t, dealloc);
-routine GetProperty(clientPort :mach_port_t;
- pluginID :uint32_t;
- objectID :uint32_t;
- propertyNameIdentifier :uint64_t;
- out returnValue :boolean_t;
- out result :data_t, dealloc);
+simpleroutine PCGetProperty(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ objectID :uint32_t;
+ propertyNameIdentifier :uint64_t);
-routine SetProperty(clientPort :mach_port_t;
+routine PCSetProperty(clientPort :mach_port_t;
pluginID :uint32_t;
objectID :uint32_t;
propertyNameIdentifier :uint64_t;
value :data_t;
out returnValue :boolean_t);
-routine RemoveProperty(clientPort :mach_port_t;
+routine PCRemoveProperty(clientPort :mach_port_t;
pluginID :uint32_t;
objectID :uint32_t;
propertyNameIdentifier :uint64_t;
out returnValue :boolean_t);
-routine HasProperty(clientPort :mach_port_t;
- pluginID :uint32_t;
- objectID :uint32_t;
- propertyNameIdentifier :uint64_t;
- out returnValue :boolean_t);
+simpleroutine PCHasProperty(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ objectID :uint32_t;
+ propertyNameIdentifier :uint64_t);
-routine HasMethod(clientPort :mach_port_t;
- pluginID :uint32_t;
- objectID :uint32_t;
- methodNameIdentifier :uint64_t;
- out returnValue :boolean_t);
+simpleroutine PCHasMethod(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ objectID :uint32_t;
+ methodNameIdentifier :uint64_t);
-routine IdentifierInfo(clientPort :mach_port_t;
+routine PCIdentifierInfo(clientPort :mach_port_t;
identifier :uint64_t;
out info :data_t, dealloc);
+simpleroutine PCEnumerate(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ objectID :uint32_t);
+
// Misc
-simpleroutine SetMenuBarVisible(clientPort :mach_port_t;
+simpleroutine PCSetMenuBarVisible(clientPort :mach_port_t;
visible :boolean_t);
-simpleroutine SetModal(clientPort :mach_port_t;
+simpleroutine PCSetModal(clientPort :mach_port_t;
modal :boolean_t);
// Replies
-simpleroutine InstantiatePluginReply(clientPort :mach_port_t;
+simpleroutine PCInstantiatePluginReply(clientPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
result :kern_return_t;
renderContextID :uint32_t;
useSoftwareRenderer :boolean_t);
-simpleroutine GetScriptableNPObjectReply(clientPort :mach_port_t;
+simpleroutine PCGetScriptableNPObjectReply(clientPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t);
-simpleroutine BooleanReply(clientPort :mach_port_t;
- pluginID :uint32_t;
- result :boolean_t);
+simpleroutine PCBooleanReply(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ result :boolean_t);
-simpleroutine BooleanAndDataReply(clientPort :mach_port_t;
- pluginID :uint32_t;
- returnValue :boolean_t;
- result :data_t);
-
-
+simpleroutine PCBooleanAndDataReply(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ returnValue :boolean_t;
+ result :data_t);
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
index 4fe96f9..c6c38aa 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
@@ -27,31 +27,36 @@
subsystem WebKitPluginHost 300;
-serverprefix WKPH;
-userprefix _WKPH;
+serverprefix WK;
+userprefix _WK;
-routine CheckInWithPluginHost(pluginHostPort :mach_port_t;
+routine PHCheckInWithPluginHost(pluginHostPort :mach_port_t;
options :plist_bytes_t;
clientPort :mach_port_make_send_t;
- renderPort :mach_port_copy_send_t);
-
-simpleroutine InstantiatePlugin(pluginHostPort :mach_port_t;
+ clientPSNHigh :uint32_t;
+ clientPSNLow :uint32_t;
+ renderPort :mach_port_copy_send_t;
+ out pluginHostPSNHigh :uint32_t;
+ out pluginHostPSNLow :uint32_t);
+
+simpleroutine PHInstantiatePlugin(pluginHostPort :mach_port_t;
+ requestID :uint32_t;
options :plist_bytes_t;
pluginID :uint32_t);
-simpleroutine ResizePluginInstance(pluginHostPort :mach_port_t;
+simpleroutine PHResizePluginInstance(pluginHostPort :mach_port_t;
pluginID :uint32_t;
x :double;
y :double;
width :double;
height :double);
-simpleroutine PluginInstanceFocusChanged(pluginHostPort :mach_port_t;
+simpleroutine PHPluginInstanceFocusChanged(pluginHostPort :mach_port_t;
pluginID :uint32_t;
hasFocus :boolean_t);
-simpleroutine PluginInstanceWindowFocusChanged(pluginHostPort :mach_port_t;
+simpleroutine PHPluginInstanceWindowFocusChanged(pluginHostPort :mach_port_t;
pluginID :uint32_t;
hasFocus :boolean_t);
-simpleroutine PluginInstanceWindowFrameChanged(pluginHostPort :mach_port_t;
+simpleroutine PHPluginInstanceWindowFrameChanged(pluginHostPort :mach_port_t;
pluginID :uint32_t;
x :double;
y :double;
@@ -59,7 +64,7 @@ simpleroutine PluginInstanceWindowFrameChanged(pluginHostPort :mach_port_t;
height :double;
maxScreenY :double);
-simpleroutine PluginInstanceMouseEvent(pluginHostPort :mach_port_t;
+simpleroutine PHPluginInstanceMouseEvent(pluginHostPort :mach_port_t;
pluginID :uint32_t;
timestamp :double;
eventType :uint32_t;
@@ -75,7 +80,7 @@ simpleroutine PluginInstanceMouseEvent(pluginHostPort :mach_port_t;
deltaY :double;
deltaZ: double);
-simpleroutine PluginInstanceKeyboardEvent(pluginHostPort :mach_port_t;
+simpleroutine PHPluginInstanceKeyboardEvent(pluginHostPort :mach_port_t;
pluginID :uint32_t;
timestamp :double;
eventType :uint32_t;
@@ -84,19 +89,30 @@ simpleroutine PluginInstanceKeyboardEvent(pluginHostPort :mach_port_t;
charactersIgnoringModifiers :data_t;
isARepeat :boolean_t;
keyCode :uint16_t);
-
-simpleroutine PluginInstanceStartTimers(pluginHostPort :mach_port_t;
+
+simpleroutine PHPluginInstanceInsertText(pluginHostPort :mach_port_t;
+ pluginID :uint32_t;
+ text :data_t);
+
+simpleroutine PHPluginInstanceStartTimers(pluginHostPort :mach_port_t;
pluginID :uint32_t;
throttleTimers :boolean_t);
-simpleroutine PluginInstanceStopTimers(pluginHostPort :mach_port_t;
+simpleroutine PHPluginInstanceStopTimers(pluginHostPort :mach_port_t;
pluginID :uint32_t);
-simpleroutine DestroyPluginInstance(pluginHostPort :mach_port_t;
- pluginID :uint32_t);
+simpleroutine PHPluginInstancePrint(pluginHostPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ width :uint32_t;
+ height :uint32_t);
+
+simpleroutine PHDestroyPluginInstance(pluginHostPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t);
// Streams
-simpleroutine StartStream(pluginHostPort :mach_port_t;
+simpleroutine PHStartStream(pluginHostPort :mach_port_t;
pluginID :uint32_t;
streamID :uint32_t;
responseURL :data_t;
@@ -105,68 +121,92 @@ simpleroutine StartStream(pluginHostPort :mach_port_t;
mimeType :data_t;
headers :data_t);
-simpleroutine StreamDidReceiveData(pluginHostPort :mach_port_t;
+simpleroutine PHStreamDidReceiveData(pluginHostPort :mach_port_t;
pluginID :uint32_t;
streamID :uint32_t;
data :data_t);
-simpleroutine StreamDidFinishLoading(pluginHostPort :mach_port_t;
+simpleroutine PHStreamDidFinishLoading(pluginHostPort :mach_port_t;
pluginID :uint32_t;
streamID :uint32_t);
-simpleroutine StreamDidFail(pluginHostPort :mach_port_t;
+simpleroutine PHStreamDidFail(pluginHostPort :mach_port_t;
pluginID :uint32_t;
streamID :uint32_t;
reason :int16_t);
+simpleroutine PHLoadURLNotify(pluginHostPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ reason :int16_t);
+
// NPRuntime
-simpleroutine GetScriptableNPObject(pluginHostPort :mach_port_t;
- pluginID :uint32_t);
+simpleroutine PHGetScriptableNPObject(pluginHostPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t);
-simpleroutine NPObjectHasProperty(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectHasProperty(pluginHostPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
propertyName :uint64_t);
-simpleroutine NPObjectHasMethod(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectHasMethod(pluginHostPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
methodName :uint64_t);
-simpleroutine NPObjectInvoke(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectInvoke(pluginHostPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
invokeType :uint32_t;
methodName :uint64_t;
arguments :data_t);
-simpleroutine NPObjectHasInvokeDefaultMethod(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectHasInvokeDefaultMethod(pluginHostPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t);
-simpleroutine NPObjectHasConstructMethod(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectHasConstructMethod(pluginHostPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t);
-simpleroutine NPObjectGetProperty(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectGetProperty(pluginHostPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
propertyName :uint64_t);
-simpleroutine NPObjectSetProperty(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectSetProperty(pluginHostPort :mach_port_t;
pluginID :uint32_t;
+ requestID :uint32_t;
objectID :uint32_t;
propertyName :uint64_t;
value :data_t);
-simpleroutine NPObjectRelease(pluginHostPort :mach_port_t;
+simpleroutine PHNPObjectRelease(pluginHostPort :mach_port_t;
pluginID :uint32_t;
objectID :uint32_t);
+simpleroutine PHNPObjectEnumerate(pluginHostPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ objectID :uint32_t);
+
// Replies
-simpleroutine EvaluateReply(pluginHostPort :mach_port_t;
- pluginID :uint32_t;
- returnValue :boolean_t;
- result :data_t);
+simpleroutine PHBooleanReply(clientPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ result :boolean_t);
+
+simpleroutine PHBooleanAndDataReply(pluginHostPort :mach_port_t;
+ pluginID :uint32_t;
+ requestID :uint32_t;
+ returnValue :boolean_t;
+ result :data_t);
diff --git a/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.h b/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.h
new file mode 100644
index 0000000..9f036ee
--- /dev/null
+++ b/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * 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 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 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.
+ */
+
+#if USE(PLUGIN_HOST_PROCESS)
+
+#ifndef WebTextInputWindowController_h
+#define WebTextInputWindowController_h
+
+@class WebTextInputPanel;
+
+@interface WebTextInputWindowController : NSObject {
+ WebTextInputPanel *_panel;
+}
+
++ (WebTextInputWindowController *)sharedTextInputWindowController;
+
+- (NSTextInputContext *)inputContext;
+- (BOOL)interpretKeyEvent:(NSEvent *)event string:(NSString **)string;
+
+@end
+
+#endif // WebTextInputWindowController_h
+
+#endif // USE(PLUGIN_HOST_PROCESS)
diff --git a/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m b/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m
new file mode 100644
index 0000000..c168e6e
--- /dev/null
+++ b/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * 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 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 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.
+ */
+
+#if USE(PLUGIN_HOST_PROCESS)
+
+#import "WebTextInputWindowController.h"
+
+#import <WebKitSystemInterface.h>
+
+@interface WebTextInputPanel : NSPanel {
+ NSTextView *_inputTextView;
+}
+
+- (NSTextInputContext *)_inputContext;
+- (BOOL)_interpretKeyEvent:(NSEvent *)event string:(NSString **)string;
+
+@end
+
+#define inputWindowHeight 20
+
+@implementation WebTextInputPanel
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [_inputTextView release];
+
+ [super dealloc];
+}
+
+- (id)init
+{
+ self = [super initWithContentRect:NSZeroRect styleMask:WKGetInputPanelWindowStyle() backing:NSBackingStoreBuffered defer:YES];
+ if (!self)
+ return nil;
+
+ // Set the frame size.
+ NSRect visibleFrame = [[NSScreen mainScreen] visibleFrame];
+ NSRect frame = NSMakeRect(visibleFrame.origin.x, visibleFrame.origin.y, visibleFrame.size.width, inputWindowHeight);
+
+ [self setFrame:frame display:NO];
+
+ _inputTextView = [[NSTextView alloc] initWithFrame:[self.contentView frame]];
+ _inputTextView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable | NSViewMaxXMargin | NSViewMinXMargin | NSViewMaxYMargin | NSViewMinYMargin;
+
+ NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:[self.contentView frame]];
+ scrollView.documentView = _inputTextView;
+ self.contentView = scrollView;
+ [scrollView release];
+
+ [self setFloatingPanel:YES];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(_keyboardInputSourceChanged:)
+ name:NSTextInputContextKeyboardSelectionDidChangeNotification
+ object:nil];
+
+ return self;
+}
+
+- (void)_keyboardInputSourceChanged:(NSNotification *)notification
+{
+ [_inputTextView setString:@""];
+ [self orderOut:nil];
+}
+
+- (BOOL)_interpretKeyEvent:(NSEvent *)event string:(NSString **)string
+{
+ BOOL hadMarkedText = [_inputTextView hasMarkedText];
+
+ *string = nil;
+
+ if (![[_inputTextView inputContext] handleEvent:event])
+ return NO;
+
+ if ([_inputTextView hasMarkedText]) {
+ // Don't show the input method window for dead keys
+ if ([[event characters] length] > 0)
+ [self orderFront:nil];
+
+ return YES;
+ }
+
+ if (hadMarkedText) {
+ [self orderOut:nil];
+
+ NSString *text = [[_inputTextView textStorage] string];
+ if ([text length] > 0)
+ *string = [[text copy] autorelease];
+ }
+
+ [_inputTextView setString:@""];
+ return hadMarkedText;
+}
+
+- (NSTextInputContext *)_inputContext
+{
+ return [_inputTextView inputContext];
+}
+
+@end
+
+@implementation WebTextInputWindowController
+
++ (WebTextInputWindowController *)sharedTextInputWindowController
+{
+ static WebTextInputWindowController *textInputWindowController;
+ if (!textInputWindowController)
+ textInputWindowController = [[WebTextInputWindowController alloc] init];
+
+ return textInputWindowController;
+}
+
+- (id)init
+{
+ self = [super init];
+ if (!self)
+ return nil;
+
+ _panel = [[WebTextInputPanel alloc] init];
+
+ return self;
+}
+
+- (NSTextInputContext *)inputContext
+{
+ return [_panel _inputContext];
+}
+
+- (BOOL)interpretKeyEvent:(NSEvent *)event string:(NSString **)string
+{
+ return [_panel _interpretKeyEvent:event string:string];
+}
+
+@end
+
+#endif // USE(PLUGIN_HOST_PROCESS)
+
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
index a29be2d..96f7644 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
@@ -43,6 +43,7 @@
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/WebCoreObjCExtras.h>
+#import <WebCore/WebCoreURLResponse.h>
#import <WebKitSystemInterface.h>
#import <wtf/HashMap.h>
#import <wtf/StdLibExtras.h>
@@ -53,6 +54,26 @@ using namespace WebCore;
static NSString *CarbonPathFromPOSIXPath(NSString *posixPath);
+class PluginStopDeferrer {
+public:
+ PluginStopDeferrer(WebNetscapePluginView* pluginView)
+ : m_pluginView(pluginView)
+ {
+ ASSERT(m_pluginView);
+
+ [m_pluginView.get() willCallPlugInFunction];
+ }
+
+ ~PluginStopDeferrer()
+ {
+ ASSERT(m_pluginView);
+ [m_pluginView.get() didCallPlugInFunction];
+ }
+
+private:
+ RetainPtr<WebNetscapePluginView> m_pluginView;
+};
+
typedef HashMap<NPStream*, NPP> StreamMap;
static StreamMap& streams()
{
@@ -217,9 +238,12 @@ void WebNetscapePluginStream::startStream(NSURL *url, long long expectedContentL
// FIXME: Need a way to check if stream is seekable
- [m_pluginView.get() willCallPlugInFunction];
- NPError npErr = m_pluginFuncs->newstream(m_plugin, (char *)[m_mimeType.get() UTF8String], &m_stream, NO, &m_transferMode);
- [m_pluginView.get() didCallPlugInFunction];
+ NPError npErr;
+ {
+ PluginStopDeferrer deferrer(m_pluginView.get());
+ npErr = m_pluginFuncs->newstream(m_plugin, (char *)[m_mimeType.get() UTF8String], &m_stream, NO, &m_transferMode);
+ }
+
LOG(Plugins, "NPP_NewStream URL=%@ MIME=%@ error=%d", m_responseURL.get(), m_mimeType.get(), npErr);
if (npErr != NPERR_NO_ERROR) {
@@ -324,7 +348,7 @@ void WebNetscapePluginStream::didReceiveResponse(NetscapePlugInStreamLoader*, co
// startStreamResponseURL:... will null-terminate.
}
- startStream([r URL], expectedContentLength, WKGetNSURLResponseLastModifiedDate(r), [r MIMEType], theHeaders);
+ startStream([r URL], expectedContentLength, WKGetNSURLResponseLastModifiedDate(r), [r _webcore_MIMEType], theHeaders);
}
void WebNetscapePluginStream::startStreamWithResponse(NSURLResponse *response)
@@ -339,12 +363,11 @@ bool WebNetscapePluginStream::wantsAllStreams() const
void *value = 0;
NPError error;
- [m_pluginView.get() willCallPlugInFunction];
{
+ PluginStopDeferrer deferrer(m_pluginView.get());
JSC::JSLock::DropAllLocks dropAllLocks(false);
error = m_pluginFuncs->getvalue(m_plugin, NPPVpluginWantsAllNetworkStreams, &value);
}
- [m_pluginView.get() didCallPlugInFunction];
if (error != NPERR_NO_ERROR)
return false;
@@ -369,9 +392,9 @@ void WebNetscapePluginStream::destroyStream()
ASSERT(m_path);
NSString *carbonPath = CarbonPathFromPOSIXPath(m_path.get());
ASSERT(carbonPath != NULL);
- [m_pluginView.get() willCallPlugInFunction];
+
+ PluginStopDeferrer deferrer(m_pluginView.get());
m_pluginFuncs->asfile(m_plugin, &m_stream, [carbonPath fileSystemRepresentation]);
- [m_pluginView.get() didCallPlugInFunction];
LOG(Plugins, "NPP_StreamAsFile responseURL=%@ path=%s", m_responseURL.get(), carbonPath);
}
@@ -394,12 +417,11 @@ void WebNetscapePluginStream::destroyStream()
}
if (m_newStreamSuccessful) {
- [m_pluginView.get() willCallPlugInFunction];
+ PluginStopDeferrer deferrer(m_pluginView.get());
#if !LOG_DISABLED
NPError npErr =
#endif
m_pluginFuncs->destroystream(m_plugin, &m_stream, m_reason);
- [m_pluginView.get() didCallPlugInFunction];
LOG(Plugins, "NPP_DestroyStream responseURL=%@ error=%d", m_responseURL.get(), npErr);
}
@@ -415,9 +437,8 @@ void WebNetscapePluginStream::destroyStream()
if (m_sendNotification) {
// NPP_URLNotify expects the request URL, not the response URL.
- [m_pluginView.get() willCallPlugInFunction];
+ PluginStopDeferrer deferrer(m_pluginView.get());
m_pluginFuncs->urlnotify(m_plugin, [m_requestURL.get() _web_URLCString], m_reason, m_notifyData);
- [m_pluginView.get() didCallPlugInFunction];
LOG(Plugins, "NPP_URLNotify requestURL=%@ reason=%d", m_requestURL.get(), m_reason);
}
@@ -488,9 +509,8 @@ void WebNetscapePluginStream::deliverData()
int32 totalBytesDelivered = 0;
while (totalBytesDelivered < totalBytes) {
- [m_pluginView.get() willCallPlugInFunction];
+ PluginStopDeferrer deferrer(m_pluginView.get());
int32 deliveryBytes = m_pluginFuncs->writeready(m_plugin, &m_stream);
- [m_pluginView.get() didCallPlugInFunction];
LOG(Plugins, "NPP_WriteReady responseURL=%@ bytes=%d", m_responseURL.get(), deliveryBytes);
if (m_isTerminated)
@@ -504,9 +524,8 @@ void WebNetscapePluginStream::deliverData()
} else {
deliveryBytes = MIN(deliveryBytes, totalBytes - totalBytesDelivered);
NSData *subdata = [m_deliveryData.get() subdataWithRange:NSMakeRange(totalBytesDelivered, deliveryBytes)];
- [m_pluginView.get() willCallPlugInFunction];
+ PluginStopDeferrer deferrer(m_pluginView.get());
deliveryBytes = m_pluginFuncs->write(m_plugin, &m_stream, m_offset, [subdata length], (void *)[subdata bytes]);
- [m_pluginView.get() didCallPlugInFunction];
if (deliveryBytes < 0) {
// Netscape documentation says that a negative result from NPP_Write means cancel the load.
cancelLoadAndDestroyStreamWithError(pluginCancelledConnectionError());
@@ -523,9 +542,8 @@ void WebNetscapePluginStream::deliverData()
if (totalBytesDelivered < totalBytes) {
NSMutableData *newDeliveryData = [[NSMutableData alloc] initWithCapacity:totalBytes - totalBytesDelivered];
[newDeliveryData appendBytes:(char *)[m_deliveryData.get() bytes] + totalBytesDelivered length:totalBytes - totalBytesDelivered];
- [m_deliveryData.get() release];
- m_deliveryData = newDeliveryData;
- [newDeliveryData release];
+
+ m_deliveryData.adoptNS(newDeliveryData);
} else {
[m_deliveryData.get() setLength:0];
if (m_reason != WEB_REASON_NONE)
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
index b2ea2b1..ec0a3df 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
@@ -31,6 +31,8 @@
#import "WebNetscapePluginPackage.h"
+#import <wtf/PassRefPtr.h>
+#import <wtf/RefPtr.h>
#import <wtf/RetainPtr.h>
@class DOMElement;
@@ -38,6 +40,10 @@
@class WebFrame;
@class WebView;
+namespace WebCore {
+ class HTMLPlugInElement;
+}
+
@interface WebBaseNetscapePluginView : NSView
{
RetainPtr<WebNetscapePluginPackage> _pluginPackage;
@@ -52,7 +58,7 @@
BOOL _hasFocus;
BOOL _isCompletelyObscured;
- RetainPtr<DOMElement> _element;
+ RefPtr<WebCore::HTMLPlugInElement> _element;
RetainPtr<NSString> _MIMEType;
RetainPtr<NSURL> _baseURL;
RetainPtr<NSURL> _sourceURL;
@@ -68,7 +74,7 @@
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement;
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
- (WebNetscapePluginPackage *)pluginPackage;
@@ -83,6 +89,7 @@
- (WebDataSource *)dataSource;
- (WebView *)webView;
- (NSWindow *)currentWindow;
+- (WebCore::HTMLPlugInElement*)element;
- (void)removeTrackingRect;
- (void)resetTrackingRect;
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index a2a8b50..26057fa 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -44,7 +44,9 @@
#import <WebCore/Element.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/Page.h>
+#import <WebCore/RenderView.h>
#import <WebKit/DOMPrivate.h>
#import <runtime/InitializeThreading.h>
#import <wtf/Assertions.h>
@@ -73,14 +75,14 @@ using namespace WebCore;
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element
{
self = [super initWithFrame:frame];
if (!self)
return nil;
_pluginPackage = pluginPackage;
- _element = anElement;
+ _element = element;
_sourceURL.adoptNS([URL copy]);
_baseURL.adoptNS([baseURL copy]);
_MIMEType.adoptNS([MIME copy]);
@@ -237,11 +239,23 @@ using namespace WebCore;
[self startTimers];
}
+- (NSRect)_windowClipRect
+{
+ RenderObject* renderer = _element->renderer();
+
+ if (renderer && renderer->view()) {
+ if (FrameView* frameView = renderer->view()->frameView())
+ return frameView->windowClipRectForLayer(renderer->enclosingLayer(), true);
+ }
+
+ return NSZeroRect;
+}
+
- (NSRect)visibleRect
{
// WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch
// that clip now.
- return NSIntersectionRect([self convertRect:[_element.get() _windowClipRect] fromView:nil], [super visibleRect]);
+ return NSIntersectionRect([self convertRect:[self _windowClipRect] fromView:nil], [super visibleRect]);
}
- (BOOL)acceptsFirstResponder
@@ -558,7 +572,7 @@ using namespace WebCore;
- (WebDataSource *)dataSource
{
- WebFrame *webFrame = kit(core(_element.get())->document()->frame());
+ WebFrame *webFrame = kit(_element->document()->frame());
return [webFrame _dataSource];
}
@@ -577,6 +591,11 @@ using namespace WebCore;
return [self window] ? [self window] : [[self webView] hostWindow];
}
+- (WebCore::HTMLPlugInElement*)element
+{
+ return _element.get();
+}
+
// We want to treat these as regular keyboard events.
- (void)cut:(id)sender
diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.mm b/WebKit/mac/Plugins/WebBasePluginPackage.mm
index 7b5ef8e..1bddbcf 100644
--- a/WebKit/mac/Plugins/WebBasePluginPackage.mm
+++ b/WebKit/mac/Plugins/WebBasePluginPackage.mm
@@ -198,12 +198,18 @@
{
}
-- (NSDictionary *)pListForPath:(NSString *)pListPath createFile:(BOOL)createFile
+- (void)createPropertyListFile
{
- if (createFile && [self load] && BP_CreatePluginMIMETypesPreferences) {
+ if ([self load] && BP_CreatePluginMIMETypesPreferences) {
BP_CreatePluginMIMETypesPreferences();
[self unload];
}
+}
+
+- (NSDictionary *)pListForPath:(NSString *)pListPath createFile:(BOOL)createFile
+{
+ if (createFile)
+ [self createPropertyListFile];
NSDictionary *pList = nil;
NSData *data = [NSData dataWithContentsOfFile:pListPath];
diff --git a/WebKit/mac/Plugins/WebKitPluginContainerView.h b/WebKit/mac/Plugins/WebKitPluginContainerView.h
deleted file mode 100644
index a67c105..0000000
--- a/WebKit/mac/Plugins/WebKitPluginContainerView.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * 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 Computer, 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.
- */
-
-#import <Cocoa/Cocoa.h>
-
-@class DOMElement;
-
-@interface WebKitPluginContainerView : NSView
-{
- DOMElement *_element;
-}
-
-- (id)initWithFrame:(NSRect)r
- DOMElement:(DOMElement *)anElement;
-
-- (id)objectForWebScript;
-
-@end
diff --git a/WebKit/mac/Plugins/WebKitPluginContainerView.mm b/WebKit/mac/Plugins/WebKitPluginContainerView.mm
deleted file mode 100644
index fb61644..0000000
--- a/WebKit/mac/Plugins/WebKitPluginContainerView.mm
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * 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 Computer, 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.
- */
-
-#import "WebKitPluginContainerView.h"
-#import <WebKit/DOMPrivate.h>
-
-@implementation WebKitPluginContainerView
-
-- (id)initWithFrame:(NSRect)frame
- DOMElement:(DOMElement *)anElement
-{
- [super initWithFrame:frame];
-
- _element = [anElement retain];
-
- return self;
-}
-
-- (void)dealloc
-{
- [_element release];
-
- [super dealloc];
-}
-
-- (NSRect)visibleRect
-{
- if (![self window])
- return [super visibleRect];
-
- // WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch
- // that clip now.
- return NSIntersectionRect([self convertRect:[_element _windowClipRect] fromView:nil], [super visibleRect]);
-}
-
-- (BOOL)respondsToSelector:(SEL)selector
-{
- if (selector == @selector(objectForWebScript))
- return [[[self subviews] objectAtIndex: 0] respondsToSelector:selector];
- return [super respondsToSelector:selector];
-}
-
-- (id)objectForWebScript
-{
- return [[[self subviews] objectAtIndex: 0] objectForWebScript];
-}
-
-@end
-
diff --git a/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h b/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h
index 93c3194..dc8bf4d 100644
--- a/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h
+++ b/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h
@@ -27,9 +27,17 @@
#import <CoreServices/CoreServices.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern OSErr WebGetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions options, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage);
extern OSErr WebCloseConnection(CFragConnectionID *connID);
extern SInt16 WebLMGetCurApRefNum(void);
extern void WebLMSetCurApRefNum(SInt16 value);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) */
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h
index 8b6f6e7..4613fcd 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h
@@ -53,10 +53,24 @@ public:
virtual void focusChanged(bool hasFocus);
virtual void* platformWindow(NSWindow*);
+
private:
bool sendMouseEvent(NSEvent*, NPCocoaEventType);
bool sendKeyEvent(NSEvent*, NPCocoaEventType);
bool sendEvent(NPCocoaEvent*);
+
+#ifndef __LP64__
+ void installKeyEventHandler();
+ void removeKeyEventHandler();
+
+ static OSStatus TSMEventHandler(EventHandlerCallRef, EventRef, void *eventHandler);
+ OSStatus handleTSMEvent(EventRef);
+
+ EventHandlerRef m_keyEventHandler;
+#else
+ inline void installKeyEventHandler() { }
+ void removeKeyEventHandler() { }
+#endif
};
#endif //WebNetscapePluginEventHandlerCocoa_h
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
index 288a356..e3fb362 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
@@ -27,10 +27,16 @@
#import "WebNetscapePluginEventHandlerCocoa.h"
+#import "WebKitSystemInterface.h"
#import "WebNetscapePluginView.h"
+#import <wtf/UnusedParam.h>
+#import <wtf/Vector.h>
WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa(WebNetscapePluginView* pluginView)
: WebNetscapePluginEventHandler(pluginView)
+#ifndef __LP64__
+ , m_keyEventHandler(0)
+#endif
{
}
@@ -117,9 +123,13 @@ void WebNetscapePluginEventHandlerCocoa::keyDown(NSEvent *event)
{
bool retval = sendKeyEvent(event, NPCocoaEventKeyDown);
+#ifndef __LP64__
// If the plug-in did not handle the event, pass it on to the Input Manager.
- if (!retval)
- [m_pluginView interpretKeyEvents:[NSArray arrayWithObject:event]];
+ if (retval)
+ WKSendKeyEventToTSM(event);
+#else
+ UNUSED_PARAM(retval);
+#endif
}
void WebNetscapePluginEventHandlerCocoa::keyUp(NSEvent *event)
@@ -173,6 +183,11 @@ void WebNetscapePluginEventHandlerCocoa::focusChanged(bool hasFocus)
event.data.focus.hasFocus = hasFocus;
sendEvent(&event);
+
+ if (hasFocus)
+ installKeyEventHandler();
+ else
+ removeKeyEventHandler();
}
void* WebNetscapePluginEventHandlerCocoa::platformWindow(NSWindow* window)
@@ -202,4 +217,67 @@ bool WebNetscapePluginEventHandlerCocoa::sendEvent(NPCocoaEvent* event)
return result;
}
+#ifndef __LP64__
+
+void WebNetscapePluginEventHandlerCocoa::installKeyEventHandler()
+{
+ static const EventTypeSpec TSMEvents[] =
+ {
+ { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }
+ };
+
+ if (!m_keyEventHandler)
+ InstallEventHandler(GetWindowEventTarget((WindowRef)[[m_pluginView window] windowRef]),
+ NewEventHandlerUPP(TSMEventHandler),
+ GetEventTypeCount(TSMEvents),
+ TSMEvents,
+ this,
+ &m_keyEventHandler);
+}
+
+void WebNetscapePluginEventHandlerCocoa::removeKeyEventHandler()
+{
+ if (m_keyEventHandler) {
+ RemoveEventHandler(m_keyEventHandler);
+ m_keyEventHandler = 0;
+ }
+}
+
+OSStatus WebNetscapePluginEventHandlerCocoa::TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef event, void* eventHandler)
+{
+ return static_cast<WebNetscapePluginEventHandlerCocoa*>(eventHandler)->handleTSMEvent(event);
+}
+
+OSStatus WebNetscapePluginEventHandlerCocoa::handleTSMEvent(EventRef eventRef)
+{
+ ASSERT(GetEventKind(eventRef) == kEventTextInputUnicodeForKeyEvent);
+
+ // Get the text buffer size.
+ ByteCount size;
+ OSStatus result = GetEventParameter(eventRef, kEventParamTextInputSendText, typeUnicodeText, 0, 0, &size, 0);
+ if (result != noErr)
+ return result;
+
+ unsigned length = size / sizeof(UniChar);
+ Vector<UniChar, 16> characters(length);
+
+ // Now get the actual text.
+ result = GetEventParameter(eventRef, kEventParamTextInputSendText, typeUnicodeText, 0, size, 0, characters.data());
+ if (result != noErr)
+ return result;
+
+ RetainPtr<CFStringRef> text(AdoptCF, CFStringCreateWithCharacters(0, characters.data(), length));
+
+ NPCocoaEvent event;
+
+ initializeEvent(&event, NPCocoaEventTextInput);
+ event.data.text.text = (NPNSString*)text.get();
+
+ sendEvent(&event);
+
+ return noErr;
+}
+
+#endif // __LP64__
+
#endif // ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.m b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm
index b3ad0bd..38ddddc 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginPackage.m
+++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm
@@ -35,6 +35,12 @@
#import "WebNetscapeDeprecatedFunctions.h"
#import <WebCore/npruntime_impl.h>
+#if USE(PLUGIN_HOST_PROCESS)
+#import "NetscapePluginHostManager.h"
+
+using namespace WebKit;
+#endif
+
#ifdef SUPPORT_CFM
typedef void (* FunctionPointer)(void);
typedef void (* TransitionVector)(void);
@@ -288,6 +294,12 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
{
return pluginHostArchitecture;
}
+
+- (void)createPropertyListFile
+{
+ NetscapePluginHostManager::createPropertyListFile(self);
+}
+
#endif
- (void)launchRealPlayer
@@ -323,8 +335,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
[self _unloadWithShutdown:YES];
}
-- (BOOL)load
-{
+- (BOOL)_tryLoad
+{
NP_GetEntryPointsFuncPtr NP_GetEntryPoints = NULL;
NP_InitializeFuncPtr NP_Initialize = NULL;
NPError npErr;
@@ -347,7 +359,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
if (isBundle) {
#endif
if (!CFBundleLoadExecutable(cfBundle))
- goto abort;
+ return NO;
#if !LOG_DISABLED
currentTime = CFAbsoluteTimeGetCurrent();
duration = currentTime - start;
@@ -359,14 +371,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
if (isCFM) {
pluginMainFunc = (MainFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("main") );
if (!pluginMainFunc)
- goto abort;
+ return NO;
} else {
#endif
NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Initialize"));
NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_GetEntryPoints"));
NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Shutdown"));
if (!NP_Initialize || !NP_GetEntryPoints || !NP_Shutdown)
- goto abort;
+ return NO;
#ifdef SUPPORT_CFM
}
} else {
@@ -378,17 +390,17 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
err = FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], &fref, NULL);
if (err != noErr) {
LOG_ERROR("FSPathMakeRef failed. Error=%d", err);
- goto abort;
+ return NO;
}
err = FSGetCatalogInfo(&fref, kFSCatInfoNone, NULL, NULL, &spec, NULL);
if (err != noErr) {
LOG_ERROR("FSGetCatalogInfo failed. Error=%d", err);
- goto abort;
+ return NO;
}
err = WebGetDiskFragment(&spec, 0, kCFragGoesToEOF, nil, kPrivateCFragCopy, &connID, (Ptr *)&pluginMainFunc, nil);
if (err != noErr) {
LOG_ERROR("WebGetDiskFragment failed. Error=%d", err);
- goto abort;
+ return NO;
}
#if !LOG_DISABLED
currentTime = CFAbsoluteTimeGetCurrent();
@@ -399,7 +411,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
pluginMainFunc = (MainFuncPtr)functionPointerForTVector((TransitionVector)pluginMainFunc);
if (!pluginMainFunc) {
- goto abort;
+ return NO;
}
// NOTE: pluginMainFunc is freed after it is called. Be sure not to return before that.
@@ -480,14 +492,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
NP_Shutdown = (NPP_ShutdownProcPtr)functionPointerForTVector((TransitionVector)shutdownFunction);
if (!isBundle)
// Don't free pluginMainFunc if we got it from a bundle because it is owned by CFBundle in that case.
- free(pluginMainFunc);
+ free(reinterpret_cast<void*>(pluginMainFunc));
// Workaround for 3270576. The RealPlayer plug-in fails to load if its preference file is out of date.
// Launch the RealPlayer application to refresh the file.
if (npErr != NPERR_NO_ERROR) {
if (npErr == NPERR_MODULE_LOAD_FAILED_ERROR && [[self filename] isEqualToString:RealPlayerPluginFilename])
[self launchRealPlayer];
- goto abort;
+ return NO;
}
#if !LOG_DISABLED
currentTime = CFAbsoluteTimeGetCurrent();
@@ -514,7 +526,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
pluginFuncs.setvalue = (NPP_SetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setvalue);
// LiveConnect support
- pluginFuncs.javaClass = (NPP_GetJavaClassProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass);
+ pluginFuncs.javaClass = (JRIGlobalRef)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass);
if (pluginFuncs.javaClass) {
LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass);
} else {
@@ -586,7 +598,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
LOG(Plugins, "%f NP_Initialize timing started", initializeStart);
npErr = NP_Initialize(&browserFuncs);
if (npErr != NPERR_NO_ERROR)
- goto abort;
+ return NO;
#if !LOG_DISABLED
currentTime = CFAbsoluteTimeGetCurrent();
duration = currentTime - initializeStart;
@@ -597,7 +609,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
npErr = NP_GetEntryPoints(&pluginFuncs);
if (npErr != NPERR_NO_ERROR)
- goto abort;
+ return NO;
pluginSize = pluginFuncs.size;
pluginVersion = pluginFuncs.version;
@@ -617,9 +629,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
#endif
LOG(Plugins, "%f Total load time: %f seconds", currentTime, duration);
- return [super load];
+ return YES;
+}
+
+- (BOOL)load
+{
+ if ([self _tryLoad])
+ return [super load];
-abort:
[self _unloadWithShutdown:NO];
return NO;
}
@@ -724,11 +741,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer fp)
[self closeResourceFile:resourceRef];
#ifdef SUPPORT_CFM
- if (isBundle)
-#endif
- CFBundleUnloadExecutable(cfBundle);
-#ifdef SUPPORT_CFM
- else
+ if (!isBundle)
WebCloseConnection(&connID);
#endif
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.h b/WebKit/mac/Plugins/WebNetscapePluginView.h
index 9d2555b..783b7fb 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.h
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.h
@@ -52,14 +52,12 @@ typedef union PluginPort {
NP_CGContext cgPort;
} PluginPort;
-typedef struct _NPPluginTextInputFuncs NPPluginTextInputFuncs;
-
// Because the Adobe 7.x Acrobat plug-in has a hard coded check for a view named
// "WebNetscapePluginDocumentView", this class must retain the old name in order
// for the plug-in to function correctly. (rdar://problem/4699455)
#define WebNetscapePluginView WebNetscapePluginDocumentView
-@interface WebNetscapePluginView : WebBaseNetscapePluginView<WebPluginManualLoader, NSTextInput>
+@interface WebNetscapePluginView : WebBaseNetscapePluginView<WebPluginManualLoader>
{
RefPtr<WebNetscapePluginStream> _manualStream;
#ifndef BUILDING_ON_TIGER
@@ -101,9 +99,8 @@ typedef struct _NPPluginTextInputFuncs NPPluginTextInputFuncs;
HashSet<RefPtr<WebNetscapePluginStream> > streams;
RetainPtr<NSMutableDictionary> _pendingFrameLoads;
+ BOOL _isFlash;
BOOL _isSilverlight;
-
- NPPluginTextInputFuncs *textInputFuncs;
}
+ (WebNetscapePluginView *)currentPluginView;
@@ -117,7 +114,7 @@ typedef struct _NPPluginTextInputFuncs NPPluginTextInputFuncs;
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement;
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
- (NPP)plugin;
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index a792e21..cef33a4 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -35,6 +35,7 @@
#import "WebFrameInternal.h"
#import "WebFrameView.h"
#import "WebGraphicsExtras.h"
+#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
#import "WebKitNSStringExtras.h"
#import "WebKitSystemInterface.h"
@@ -59,19 +60,22 @@
#import <WebCore/Element.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
-#import <WebCore/FrameTree.h>
+#import <WebCore/FrameTree.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/Page.h>
#import <WebCore/PluginMainThreadScheduler.h>
#import <WebCore/ScriptController.h>
#import <WebCore/SoftLinking.h>
#import <WebCore/WebCoreObjCExtras.h>
-#import <WebKit/nptextinput.h>
+#import <WebCore/WebCoreURLResponse.h>
#import <WebKit/DOMPrivate.h>
#import <WebKit/WebUIDelegate.h>
#import <runtime/InitializeThreading.h>
#import <wtf/Assertions.h>
#import <objc/objc-runtime.h>
+using std::max;
+
#define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification"
#define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification"
@@ -91,6 +95,7 @@ static inline bool isDrawingModelQuickDraw(NPDrawingModel drawingModel)
- (void)_destroyPlugin;
- (NSBitmapImageRep *)_printedPluginBitmap;
- (void)_redeliverStream;
+- (BOOL)_shouldCancelSrcStream;
@end
static WebNetscapePluginView *currentPluginView = nil;
@@ -489,6 +494,11 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
#endif /* NP_NO_QUICKDRAW */
case NPDrawingModelCoreGraphics: {
+ if (![self canDraw]) {
+ portState = NULL;
+ break;
+ }
+
ASSERT([NSView focusView] == self);
CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
@@ -620,10 +630,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
if (!page)
return NO;
- bool wasDeferring = page->defersLoading();
- if (!wasDeferring)
- page->setDefersLoading(true);
-
// Can only send drawRect (updateEvt) to CoreGraphics plugins when actually drawing
ASSERT((drawingModel != NPDrawingModelCoreGraphics) || !eventIsDrawRect || [NSView focusView] == self);
@@ -667,9 +673,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
free(portState);
}
- if (!wasDeferring)
- page->setDefersLoading(false);
-
return acceptedEvent;
}
@@ -894,10 +897,18 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
{
// A plug-in can only update if it's (1) already been started (2) isn't stopped
// and (3) is able to draw on-screen. To meet condition (3) the plug-in must not
- // be hidden and be attached to a window. QuickDraw plug-ins are an important
- // excpetion to rule (3) because they manually must be told when to stop writing
+ // be hidden and be attached to a window. There are two exceptions to this rule:
+ //
+ // Exception 1: QuickDraw plug-ins must be manually told when to stop writing
// bits to the window backing store, thus to do so requires a new call to
// NPP_SetWindow() with an empty NPWindow struct.
+ //
+ // Exception 2: CoreGraphics plug-ins expect to have their drawable area updated
+ // when they are moved to a background tab, via a NPP_SetWindow call. This is
+ // accomplished by allowing -saveAndSetNewPortStateForUpdate to "clip-out" the window's
+ // clipRect. Flash is curently an exception to this. See 6453738.
+ //
+
if (!_isStarted)
return;
@@ -907,9 +918,11 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
#else
if (drawingModel == NPDrawingModelQuickDraw)
[self tellQuickTimeToChill];
- else if (drawingModel == NPDrawingModelCoreGraphics && ![self canDraw])
+ else if (drawingModel == NPDrawingModelCoreGraphics && ![self canDraw] && _isFlash) {
+ // The Flash plug-in does not expect an NPP_SetWindow call from WebKit in this case.
+ // See Exception 2 above.
return;
-
+ }
#endif // NP_NO_QUICKDRAW
BOOL didLockFocus = [NSView focusView] != self && [self lockFocusIfCanDraw];
@@ -920,7 +933,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
[self restorePortState:portState];
if (portState != (PortState)1)
free(portState);
- }
+ } else if (drawingModel == NPDrawingModelCoreGraphics)
+ [self setWindowIfNecessary];
+
if (didLockFocus)
[self unlockFocus];
}
@@ -938,11 +953,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
NPError npErr;
ASSERT(!inSetWindow);
- inSetWindow = YES;
-
- // A CoreGraphics plugin's window may only be set while the plugin is being updated
- ASSERT((drawingModel != NPDrawingModelCoreGraphics) || [NSView focusView] == self);
-
+ inSetWindow = YES;
[self willCallPlugInFunction];
{
JSC::JSLock::DropAllLocks dropAllLocks(false);
@@ -961,8 +972,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
#endif /* NP_NO_QUICKDRAW */
case NPDrawingModelCoreGraphics:
- LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d",
- npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height);
+ LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d window.clipRect size:%dx%d",
+ npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height,
+ window.clipRect.right - window.clipRect.left, window.clipRect.bottom - window.clipRect.top);
break;
case NPDrawingModelCoreAnimation:
@@ -1056,19 +1068,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
// Create the event handler
_eventHandler.set(WebNetscapePluginEventHandler::create(self));
-
- // Get the text input vtable
- if (eventModel == NPEventModelCocoa) {
- [self willCallPlugInFunction];
- {
- JSC::JSLock::DropAllLocks dropAllLocks(false);
- NPPluginTextInputFuncs *value = 0;
- if (![_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginTextInputFuncs, &value) == NPERR_NO_ERROR && value)
- textInputFuncs = value;
- }
- [self didCallPlugInFunction];
- }
-
+
return YES;
}
@@ -1076,14 +1076,19 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
- (void)setLayer:(CALayer *)newLayer
{
[super setLayer:newLayer];
-
- if (_pluginLayer)
+
+ if (_pluginLayer) {
+ _pluginLayer.get().autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
[newLayer addSublayer:_pluginLayer.get()];
+ }
}
#endif
- (void)loadStream
{
+ if ([self _shouldCancelSrcStream])
+ return;
+
if (_loadManually) {
[self _redeliverStream];
return;
@@ -1136,8 +1141,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
[_pluginPackage.get() close];
_eventHandler.clear();
-
- textInputFuncs = 0;
}
- (NPEventModel)eventModel
@@ -1150,7 +1153,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
return plugin;
}
-- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values;
+- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values
{
ASSERT([keys count] == [values count]);
@@ -1203,9 +1206,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)element
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element
{
- self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually DOMElement:element];
+ self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually element:element];
if (!self)
return nil;
@@ -1358,7 +1361,20 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
return;
if (!_manualStream->plugin()) {
-
+ // Check if the load should be cancelled
+ if ([self _shouldCancelSrcStream]) {
+ NSURLResponse *response = [[self dataSource] response];
+
+ NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInWillHandleLoad
+ contentURL:[response URL]
+ pluginPageURL:nil
+ pluginName:nil // FIXME: Get this from somewhere
+ MIMEType:[response _webcore_MIMEType]];
+ [[self dataSource] _documentLoader]->cancelMainResourceLoad(error);
+ [error release];
+ return;
+ }
+
_manualStream->setRequestURL([[[self dataSource] request] URL]);
_manualStream->setPlugin([self plugin]);
ASSERT(_manualStream->plugin());
@@ -1392,160 +1408,11 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
_manualStream->didFinishLoading(0);
}
-#pragma mark NSTextInput implementation
-
- (NSTextInputContext *)inputContext
{
-#ifndef NP_NO_CARBON
- if (!_isStarted || eventModel == NPEventModelCarbon)
- return nil;
-#endif
-
- return [super inputContext];
-}
-
-- (BOOL)hasMarkedText
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->hasMarkedText)
- return textInputFuncs->hasMarkedText(plugin);
-
- return NO;
-}
-
-- (void)insertText:(id)aString
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->insertText)
- textInputFuncs->insertText(plugin, aString);
-}
-
-- (NSRange)markedRange
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->markedRange)
- return textInputFuncs->markedRange(plugin);
-
- return NSMakeRange(NSNotFound, 0);
-}
-
-- (NSRange)selectedRange
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->selectedRange)
- return textInputFuncs->selectedRange(plugin);
-
- return NSMakeRange(NSNotFound, 0);
-}
-
-- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->setMarkedText)
- textInputFuncs->setMarkedText(plugin, aString, selRange);
-}
-
-- (void)unmarkText
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->unmarkText)
- textInputFuncs->unmarkText(plugin);
-}
-
-- (NSArray *)validAttributesForMarkedText
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->validAttributesForMarkedText)
- return textInputFuncs->validAttributesForMarkedText(plugin);
-
- return [NSArray array];
-}
-
-- (NSAttributedString *)attributedSubstringFromRange:(NSRange)theRange
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->attributedSubstringFromRange)
- return textInputFuncs->attributedSubstringFromRange(plugin, theRange);
-
return nil;
}
-- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->characterIndexForPoint) {
- // Convert the point to window coordinates
- NSPoint point = [[self window] convertScreenToBase:thePoint];
-
- // And view coordinates
- point = [self convertPoint:point fromView:nil];
-
- return textInputFuncs->characterIndexForPoint(plugin, point);
- }
-
- return NSNotFound;
-}
-
-- (void)doCommandBySelector:(SEL)aSelector
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->doCommandBySelector)
- textInputFuncs->doCommandBySelector(plugin, aSelector);
-}
-
-- (NSRect)firstRectForCharacterRange:(NSRange)theRange
-{
- ASSERT(eventModel == NPEventModelCocoa);
- ASSERT(_isStarted);
-
- if (textInputFuncs && textInputFuncs->firstRectForCharacterRange) {
- NSRect rect = textInputFuncs->firstRectForCharacterRange(plugin, theRange);
-
- // Convert the rect to window coordinates
- rect = [self convertRect:rect toView:nil];
-
- // Convert the rect location to screen coordinates
- rect.origin = [[self window] convertBaseToScreen:rect.origin];
-
- return rect;
- }
-
- return NSZeroRect;
-}
-
-// test for 10.4 because of <rdar://problem/4243463>
-#ifdef BUILDING_ON_TIGER
-- (long)conversationIdentifier
-{
- return (long)self;
-}
-#else
-- (NSInteger)conversationIdentifier
-{
- return (NSInteger)self;
-}
-#endif
-
@end
@implementation WebNetscapePluginView (WebNPPCallbacks)
@@ -1945,11 +1812,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
(float)invalidRect->right - invalidRect->left, (float)invalidRect->bottom - invalidRect->top)];
}
--(BOOL)isOpaque
-{
- return YES;
-}
-
- (void)invalidateRegion:(NPRegion)invalidRegion
{
LOG(Plugins, "NPN_InvalidateRegion");
@@ -1986,18 +1848,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
[[self window] displayIfNeeded];
}
-static NPBrowserTextInputFuncs *browserTextInputFuncs()
-{
- static NPBrowserTextInputFuncs inputFuncs = {
- 0,
- sizeof(NPBrowserTextInputFuncs),
- NPN_MarkedTextAbandoned,
- NPN_MarkedTextSelectionChanged
- };
-
- return &inputFuncs;
-}
-
- (NPError)getVariable:(NPNVariable)variable value:(void *)value
{
switch (variable) {
@@ -2021,7 +1871,7 @@ static NPBrowserTextInputFuncs *browserTextInputFuncs()
if (!_element)
return NPERR_GENERIC_ERROR;
- NPObject *plugInScriptObject = (NPObject *)[_element.get() _NPObject];
+ NPObject *plugInScriptObject = _element->getNPObject();
// Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess>
if (plugInScriptObject)
@@ -2082,14 +1932,7 @@ static NPBrowserTextInputFuncs *browserTextInputFuncs()
*(NPBool *)value = TRUE;
return NPERR_NO_ERROR;
}
-
- case NPNVbrowserTextInputFuncs:
- {
- if (eventModel == NPEventModelCocoa) {
- *(NPBrowserTextInputFuncs **)value = browserTextInputFuncs();
- return NPERR_NO_ERROR;
- }
- }
+
default:
break;
}
@@ -2205,6 +2048,19 @@ static NPBrowserTextInputFuncs *browserTextInputFuncs()
@implementation WebNetscapePluginView (Internal)
+- (BOOL)_shouldCancelSrcStream
+{
+ ASSERT(_isStarted);
+
+ // Check if we should cancel the load
+ NPBool cancelSrcStream = 0;
+ if ([_pluginPackage.get() pluginFuncs]->getvalue &&
+ [_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginCancelSrcStream, &cancelSrcStream) == NPERR_NO_ERROR && cancelSrcStream)
+ return YES;
+
+ return NO;
+}
+
- (NPError)_createPlugin
{
plugin = (NPP)calloc(1, sizeof(NPP_t));
@@ -2217,6 +2073,7 @@ static NPBrowserTextInputFuncs *browserTextInputFuncs()
PluginMainThreadScheduler::scheduler().registerPlugin(plugin);
+ _isFlash = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"];
_isSilverlight = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.SilverlightPlugin"];
[[self class] setCurrentPluginView:self];
diff --git a/WebKit/mac/Plugins/WebPlugin.h b/WebKit/mac/Plugins/WebPlugin.h
index bd0600e..797634f 100644
--- a/WebKit/mac/Plugins/WebPlugin.h
+++ b/WebKit/mac/Plugins/WebPlugin.h
@@ -100,7 +100,7 @@
@discussion This method is only sent to the plug-in if the
WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
*/
-- (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_AFTER_WEBKIT_VERSION_3_1);
+- (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
/*!
@method webPlugInMainResourceDidReceiveData:
@@ -109,7 +109,7 @@
@discussion This method is only sent to the plug-in if the
WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
*/
-- (void)webPlugInMainResourceDidReceiveData:(NSData *)data WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_AFTER_WEBKIT_VERSION_3_1);
+- (void)webPlugInMainResourceDidReceiveData:(NSData *)data WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
/*!
@method webPlugInMainResourceDidFailWithError:
@@ -118,7 +118,7 @@
@discussion This method is only sent to the plug-in if the
WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
*/
-- (void)webPlugInMainResourceDidFailWithError:(NSError *)error WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_AFTER_WEBKIT_VERSION_3_1);
+- (void)webPlugInMainResourceDidFailWithError:(NSError *)error WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
/*!
@method webPlugInMainResourceDidFinishLoading
@@ -127,6 +127,6 @@
@discussion This method is only sent to the plug-in if the
WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
*/
-- (void)webPlugInMainResourceDidFinishLoading WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_AFTER_WEBKIT_VERSION_3_1);
+- (void)webPlugInMainResourceDidFinishLoading WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
@end
diff --git a/WebKit/mac/Plugins/WebPluginContainerPrivate.h b/WebKit/mac/Plugins/WebPluginContainerPrivate.h
index c9d64d5..af7251d 100644
--- a/WebKit/mac/Plugins/WebPluginContainerPrivate.h
+++ b/WebKit/mac/Plugins/WebPluginContainerPrivate.h
@@ -28,10 +28,24 @@
#import <Cocoa/Cocoa.h>
+#if !defined(ENABLE_PLUGIN_PROXY_FOR_VIDEO)
+#define ENABLE_PLUGIN_PROXY_FOR_VIDEO 1
+#endif
+
+#if ENABLE_PLUGIN_PROXY_FOR_VIDEO
+@class WebMediaPlayerProxy;
+#endif
+
@interface NSObject (WebPlugInContainerPrivate)
- (id)_webPluginContainerCheckIfAllowedToLoadRequest:(NSURLRequest *)Request inFrame:(NSString *)target resultObject:(id)obj selector:(SEL)selector;
- (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)checkIdentifier;
+#if ENABLE_PLUGIN_PROXY_FOR_VIDEO
+- (void)_webPluginContainerSetMediaPlayerProxy:(WebMediaPlayerProxy *)proxy forElement:(DOMElement *)element;
+
+- (void)_webPluginContainerPostMediaPlayerNotification:(int)notification forElement:(DOMElement *)element;
+#endif
+
@end
diff --git a/WebKit/mac/Plugins/WebPluginController.mm b/WebKit/mac/Plugins/WebPluginController.mm
index b618bd6..54d9615 100644
--- a/WebKit/mac/Plugins/WebPluginController.mm
+++ b/WebKit/mac/Plugins/WebPluginController.mm
@@ -31,12 +31,17 @@
#import <Foundation/NSURLRequest.h>
#import <runtime/JSLock.h>
+#import <WebCore/DocumentLoader.h>
+#import <WebCore/DOMNodeInternal.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
-#import <WebCore/ResourceRequest.h>
+#import <WebCore/HTMLMediaElement.h>
+#import <WebCore/HTMLNames.h>
+#import <WebCore/MediaPlayerProxy.h>
#import <WebCore/PlatformString.h>
-#import <WebCore/DocumentLoader.h>
+#import <WebCore/ResourceRequest.h>
#import <WebCore/ScriptController.h>
+#import <WebCore/WebCoreURLResponse.h>
#import <WebKit/WebDataSourceInternal.h>
#import <WebKit/WebFrameInternal.h>
#import <WebKit/WebFrameView.h>
@@ -55,6 +60,7 @@
#import <WebKit/WebViewInternal.h>
using namespace WebCore;
+using namespace HTMLNames;
@interface NSView (PluginSecrets)
- (void)setContainingWindow:(NSWindow *)w;
@@ -185,6 +191,10 @@ static NSMutableSet *pluginViews = nil;
[_views addObject:view];
[[_documentView _webView] addPluginInstanceView:view];
+ BOOL oldDefersCallbacks = [[self webView] defersCallbacks];
+ if (!oldDefersCallbacks)
+ [[self webView] setDefersCallbacks:YES];
+
LOG(Plugins, "initializing plug-in %@", view);
if ([view respondsToSelector:@selector(webPlugInInitialize)]) {
JSC::JSLock::DropAllLocks dropAllLocks(false);
@@ -194,6 +204,9 @@ static NSMutableSet *pluginViews = nil;
[view pluginInitialize];
}
+ if (!oldDefersCallbacks)
+ [[self webView] setDefersCallbacks:NO];
+
if (_started) {
LOG(Plugins, "starting plug-in %@", view);
if ([view respondsToSelector:@selector(webPlugInStart)]) {
@@ -406,7 +419,7 @@ static void cancelOutstandingCheck(const void *item, void *context)
contentURL:[response URL]
pluginPageURL:nil
pluginName:nil // FIXME: Get this from somewhere
- MIMEType:[response MIMEType]];
+ MIMEType:[response _webcore_MIMEType]];
[_dataSource _documentLoader]->cancelMainResourceLoad(error);
[error release];
}
@@ -430,4 +443,36 @@ static void cancelOutstandingCheck(const void *item, void *context)
[pluginView webPlugInMainResourceDidFinishLoading];
}
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+static WebCore::HTMLMediaElement* mediaProxyClient(DOMElement* element)
+{
+ if (!element) {
+ LOG_ERROR("nil element passed");
+ return nil;
+ }
+
+ Node* node = [element _node];
+ if (!node || (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag))) {
+ LOG_ERROR("invalid media element passed");
+ return nil;
+ }
+
+ return static_cast<WebCore::HTMLMediaElement*>(node);
+}
+
+- (void)_webPluginContainerSetMediaPlayerProxy:(WebMediaPlayerProxy *)proxy forElement:(DOMElement *)element
+{
+ WebCore::HTMLMediaElement* client = mediaProxyClient(element);
+ if (client)
+ client->setMediaPlayerProxy(proxy);
+}
+
+- (void)_webPluginContainerPostMediaPlayerNotification:(int)notification forElement:(DOMElement *)element
+{
+ WebCore::HTMLMediaElement* client = mediaProxyClient(element);
+ if (client)
+ client->deliverNotification((MediaPlayerProxyNotificationType)notification);
+}
+#endif
+
@end
diff --git a/WebKit/mac/Plugins/WebPluginViewFactory.h b/WebKit/mac/Plugins/WebPluginViewFactory.h
index 583a73d..a215906 100644
--- a/WebKit/mac/Plugins/WebPluginViewFactory.h
+++ b/WebKit/mac/Plugins/WebPluginViewFactory.h
@@ -66,7 +66,7 @@ extern NSString *WebPlugInContainingElementKey;
For compatibility with older versions of WebKit, the plug-in should assume that the value for
WebPlugInShouldLoadMainResourceKey is NO if it is absent from the arguments dictionary.
*/
-extern NSString *WebPlugInShouldLoadMainResourceKey AVAILABLE_AFTER_WEBKIT_VERSION_3_1;
+extern NSString *WebPlugInShouldLoadMainResourceKey AVAILABLE_IN_WEBKIT_VERSION_4_0;
/*!
@protocol WebPlugInViewFactory
diff --git a/WebKit/mac/Plugins/npapi.mm b/WebKit/mac/Plugins/npapi.mm
index eb32c2b..79eff2a 100644
--- a/WebKit/mac/Plugins/npapi.mm
+++ b/WebKit/mac/Plugins/npapi.mm
@@ -28,7 +28,6 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
#import <WebKit/npapi.h>
-#import <WebKit/nptextinput.h>
#import "WebNetscapePluginView.h"
#import "WebKitLogging.h"
@@ -192,18 +191,4 @@ NPError NPN_PopUpContextMenu(NPP instance, NPMenu *menu)
return [pluginViewForInstance(instance) popUpContextMenu:menu];
}
-void NPN_MarkedTextAbandoned(NPP instance)
-{
- WebNetscapePluginView *pluginView = pluginViewForInstance(instance);
-
- [[NSInputManager currentInputManager] markedTextAbandoned:pluginView];
-}
-
-void NPN_MarkedTextSelectionChanged(NPP instance, NSRange newSel)
-{
- WebNetscapePluginView *pluginView = pluginViewForInstance(instance);
-
- [[NSInputManager currentInputManager] markedTextSelectionChanged:newSel client:pluginView];
-}
-
#endif
diff --git a/WebKit/mac/Plugins/nptextinput.h b/WebKit/mac/Plugins/nptextinput.h
deleted file mode 100644
index 2ed3146..0000000
--- a/WebKit/mac/Plugins/nptextinput.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2008, Apple Inc. and The Mozilla Foundation.
- * All rights reserved.
- *
- * 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 names of Apple Inc. ("Apple") or The Mozilla
- * Foundation ("Mozilla") nor the names of their contributors may be used
- * to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR 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, MOZILLA OR
- * THEIR 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 __OBJC__
-#error "npinput.h can only be included from Objective-C code."
-#endif
-
-#ifndef _NP_TEXTINPUT_H_
-#define _NP_TEXTINPUT_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <WebKit/npapi.h>
-
-#import <Cocoa/Cocoa.h>
-
-typedef void (*NPP_InsertTextFunc)(NPP npp, id aString);
-typedef void (*NPP_DoCommandBySelectorFunc)(NPP npp, SEL aSelector);
-typedef void (*NPP_SetMarkedTextFunc)(NPP npp, id aString, NSRange selRange);
-typedef void (*NPP_UnmarkTextFunc)(NPP npp);
-typedef BOOL (*NPP_HasMarkedTextFunc)(NPP npp);
-typedef NSAttributedString * (*NPP_AttributedSubstringFromRangeFunc)(NPP npp, NSRange theRange);
-typedef NSRange (*NPP_MarkedRangeFunc)(NPP npp);
-typedef NSRange (*NPP_SelectedRangeFunc)(NPP npp);
-typedef NSRect (*NPP_FirstRectForCharacterRangeFunc)(NPP npp, NSRange theRange);
-typedef unsigned long long (*NPP_CharacterIndexForPointFunc)(NPP npp, NSPoint thePoint);
-typedef NSArray *(*NPP_ValidAttributesForMarkedTextFunc)(NPP npp);
-
-typedef struct _NPPluginTextInputFuncs {
- uint16 size;
- uint16 version;
-
- NPP_InsertTextFunc insertText;
- NPP_DoCommandBySelectorFunc doCommandBySelector;
- NPP_SetMarkedTextFunc setMarkedText;
- NPP_UnmarkTextFunc unmarkText;
- NPP_HasMarkedTextFunc hasMarkedText;
- NPP_AttributedSubstringFromRangeFunc attributedSubstringFromRange;
- NPP_MarkedRangeFunc markedRange;
- NPP_SelectedRangeFunc selectedRange;
- NPP_FirstRectForCharacterRangeFunc firstRectForCharacterRange;
- NPP_CharacterIndexForPointFunc characterIndexForPoint;
- NPP_ValidAttributesForMarkedTextFunc validAttributesForMarkedText;
-} NPPluginTextInputFuncs;
-
-void NPP_InsertText(NPP npp, id aString);
-void NPP_DoCommandBySelector(NPP npp, SEL aSelector);
-void NPP_SetMarkedText(NPP npp, id aString, NSRange selRange);
-void NPP_UnmarkText(NPP npp);
-BOOL NPP_HasMarkedText(NPP npp);
-NSAttributedString *NPP_AttributedSubstringFromRange(NPP npp, NSRange theRange);
-NSRange NPP_MarkedRange(NPP npp);
-NSRange NPP_SelectedRange(NPP npp);
-NSRect NPP_FirstRectForCharacterRange(NPP npp, NSRange theRange);
-unsigned long long NPP_CharacterIndexForPoint(NPP npp, NSPoint thePoint);
-NSArray *NPP_ValidAttributesForMarkedText(NPP npp);
-
-typedef void (*NPN_MarkedTextAbandonedFunc)(NPP npp);
-typedef void (*NPN_MarkedTextSelectionChangedFunc)(NPP npp, NSRange newSel);
-
-typedef struct _NPBrowserTextInputFuncs {
- uint16 size;
- uint16 version;
-
- NPN_MarkedTextAbandonedFunc markedTextAbandoned;
- NPN_MarkedTextSelectionChangedFunc markedTextSelectionChanged;
-} NPBrowserTextInputFuncs;
-
-void NPN_MarkedTextAbandoned(NPP npp);
-void NPN_MarkedTextSelectionChanged(NPP npp, NSRange newSel);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 29a4c25..b2f04f1 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
@@ -135,6 +135,13 @@ public:
virtual void disableSuddenTermination();
virtual void formStateDidChange(const WebCore::Node*) { }
+#if USE(ACCELERATED_COMPOSITING)
+ virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
+ virtual void setNeedsOneShotDrawingSynchronization();
+#endif
+
+ virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
+
private:
WebView *m_webView;
};
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 6b5d138..79dd641 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,7 @@
#import "WebElementDictionary.h"
#import "WebFrameInternal.h"
#import "WebFrameView.h"
+#import "WebGeolocationInternal.h"
#import "WebHTMLViewInternal.h"
#import "WebHistoryInternal.h"
#import "WebKitSystemInterface.h"
@@ -49,6 +50,7 @@
#import <WebCore/FloatRect.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoadRequest.h>
+#import <WebCore/Geolocation.h>
#import <WebCore/HitTestResult.h>
#import <WebCore/IntRect.h>
#import <WebCore/Page.h>
@@ -61,6 +63,10 @@
#import <wtf/PassRefPtr.h>
#import <wtf/Vector.h>
+#if USE(ACCELERATED_COMPOSITING)
+#import <WebCore/GraphicsLayer.h>
+#endif
+
@interface NSView (WebNSViewDetails)
- (NSView *)_findLastViewInKeyViewLoop;
@end
@@ -643,6 +649,36 @@ void WebChromeClient::enableSuddenTermination()
#endif
}
+#if USE(ACCELERATED_COMPOSITING)
+void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
+{
+ WebFrameView *frameView = [kit(frame) frameView];
+ WebHTMLView *docView = (WebHTMLView *)[frameView documentView];
+ if (graphicsLayer)
+ [docView attachRootLayer:graphicsLayer->nativeLayer()];
+ else
+ [docView detachRootLayer];
+}
+
+void WebChromeClient::setNeedsOneShotDrawingSynchronization()
+{
+ [m_webView _setNeedsOneShotDrawingSynchronization:YES];
+}
+#endif
+
+void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()];
+ WebGeolocation *webGeolocation = [[WebGeolocation alloc] _initWithWebCoreGeolocation:geolocation];
+ CallUIDelegate(m_webView, @selector(webView:frame:requestGeolocationPermission:securityOrigin:), kit(frame), webGeolocation, webOrigin);
+ [webOrigin release];
+ [webGeolocation release];
+
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
@implementation WebOpenPanelResultListener
- (id)initWithChooser:(PassRefPtr<FileChooser>)chooser
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h
index 2845b97..fd4b46f 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h
@@ -101,6 +101,7 @@ public:
virtual void learnWord(const WebCore::String&);
virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
+ virtual void checkSpellingAndGrammarOfParagraph(const UChar* text, int length, bool checkGrammar, WTF::Vector<WebCore::TextCheckingResult>& results);
virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&);
virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&);
virtual void showSpellingUI(bool show);
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index 67d3cc2..9911a32 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -80,7 +80,7 @@ WebViewInsertAction kit(EditorInsertAction coreAction)
@interface WebEditCommand : NSObject
{
- EditCommand *m_command;
+ RefPtr<EditCommand> m_command;
}
+ (WebEditCommand *)commandWithEditCommand:(PassRefPtr<EditCommand>)command;
@@ -102,7 +102,7 @@ WebViewInsertAction kit(EditorInsertAction coreAction)
{
ASSERT(command);
[super init];
- m_command = command.releaseRef();
+ m_command = command;
return self;
}
@@ -110,15 +110,14 @@ WebViewInsertAction kit(EditorInsertAction coreAction)
{
if (WebCoreObjCScheduleDeallocateOnMainThread([WebEditCommand class], self))
return;
-
- m_command->deref();
+
[super dealloc];
}
- (void)finalize
{
ASSERT_MAIN_THREAD();
- m_command->deref();
+
[super finalize];
}
@@ -127,9 +126,9 @@ WebViewInsertAction kit(EditorInsertAction coreAction)
return [[[WebEditCommand alloc] initWithEditCommand:command] autorelease];
}
-- (EditCommand *)command;
+- (EditCommand *)command
{
- return m_command;
+ return m_command.get();
}
@end
@@ -596,6 +595,50 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector
#endif
}
+void WebEditorClient::checkSpellingAndGrammarOfParagraph(const UChar* text, int length, bool checkGrammar, Vector<TextCheckingResult>& results)
+{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO];
+ NSTextCheckingTypes checkingTypes = checkGrammar ? (NSTextCheckingTypeOrthography | NSTextCheckingTypeSpelling | NSTextCheckingTypeGrammar) : (NSTextCheckingTypeOrthography | NSTextCheckingTypeSpelling);
+ NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:checkingTypes options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL];
+ [textString release];
+ for (NSTextCheckingResult *incomingResult in incomingResults) {
+ NSRange resultRange = [incomingResult range];
+ NSTextCheckingType resultType = [incomingResult resultType];
+ ASSERT(resultRange.location != NSNotFound && resultRange.length > 0);
+ if (NSTextCheckingTypeSpelling == resultType) {
+ TextCheckingResult result;
+ result.resultType = 1;
+ result.location = resultRange.location;
+ result.length = resultRange.length;
+ results.append(result);
+ } else if (checkGrammar && NSTextCheckingTypeGrammar == resultType) {
+ TextCheckingResult result;
+ NSArray *details = [incomingResult grammarDetails];
+ result.resultType = 2;
+ result.location = resultRange.location;
+ result.length = resultRange.length;
+ for (NSDictionary *incomingDetail in details) {
+ ASSERT(incomingDetail);
+ GrammarDetail detail;
+ NSValue *detailRangeAsNSValue = [incomingDetail objectForKey:NSGrammarRange];
+ ASSERT(detailRangeAsNSValue);
+ NSRange detailNSRange = [detailRangeAsNSValue rangeValue];
+ ASSERT(detailNSRange.location != NSNotFound && detailNSRange.length > 0);
+ detail.location = detailNSRange.location;
+ detail.length = detailNSRange.length;
+ detail.userDescription = [incomingDetail objectForKey:NSGrammarUserDescription];
+ NSArray *guesses = [incomingDetail objectForKey:NSGrammarCorrections];
+ for (NSString *guess in guesses)
+ detail.guesses.append(String(guess));
+ result.details.append(detail);
+ }
+ results.append(result);
+ }
+ }
+#endif
+}
+
void WebEditorClient::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
{
#ifndef BUILDING_ON_TIGER
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 03c00ee..823e0a4 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -139,7 +139,7 @@ private:
virtual void committedLoad(WebCore::DocumentLoader*, const char*, int);
virtual void finishedLoading(WebCore::DocumentLoader*);
virtual void updateGlobalHistory();
- virtual void updateGlobalHistoryForRedirectWithoutHistoryItem();
+ virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const;
@@ -177,17 +177,18 @@ private:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*,
const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const Vector<WebCore::String>&,
+ virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&,
const Vector<WebCore::String>&, const WebCore::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
- virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL& baseURL,
+ virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL,
const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues);
virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType);
virtual WebCore::String overrideMediaType() const;
virtual void windowObjectCleared();
+ virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
virtual void registerForIconNotification(bool listen);
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index 6f02729..95ac174 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -84,11 +84,13 @@
#import <WebCore/FrameLoaderTypes.h>
#import <WebCore/FrameTree.h>
#import <WebCore/FrameView.h>
+#import <WebCore/HTMLAppletElement.h>
#import <WebCore/HTMLHeadElement.h>
#import <WebCore/HTMLFormElement.h>
#import <WebCore/HTMLFrameElement.h>
#import <WebCore/HTMLFrameOwnerElement.h>
#import <WebCore/HTMLNames.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/HistoryItem.h>
#import <WebCore/HitTestResult.h>
#import <WebCore/IconDatabase.h>
@@ -786,39 +788,27 @@ void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
void WebFrameLoaderClient::updateGlobalHistory()
{
DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader();
-
- if (loader->urlForHistoryReflectsServerRedirect()) {
- [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory()
- withTitle:loader->title()
- method:loader->request().httpMethod()
- wasFailure:loader->urlForHistoryReflectsFailure()
- serverRedirectURL:loader->url()
- isClientRedirect:NO];
- return;
- }
-
- if (loader->urlForHistoryReflectsClientRedirect()) {
- [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory()
- withTitle:loader->title()
- method:loader->request().httpMethod()
- wasFailure:loader->urlForHistoryReflectsFailure()
- serverRedirectURL:nil
- isClientRedirect:YES];
- return;
- }
-
[[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory()
withTitle:loader->title()
- method:loader->request().httpMethod()
- wasFailure:loader->urlForHistoryReflectsFailure()
- serverRedirectURL:nil
- isClientRedirect:NO];
+ method:loader->originalRequestCopy().httpMethod()
+ wasFailure:loader->urlForHistoryReflectsFailure()];
+
+ updateGlobalHistoryRedirectLinks();
}
-void WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem()
+void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader();
- [[WebHistory optionalSharedHistory] _visitedURLForRedirectWithoutHistoryItem:loader->url()];
+
+ if (!loader->clientRedirectSourceForHistory().isNull()) {
+ if (WebHistoryItem *item = [[WebHistory optionalSharedHistory] _itemForURLString:loader->clientRedirectSourceForHistory()])
+ core(item)->addRedirectURL(loader->clientRedirectDestinationForHistory());
+ }
+
+ if (!loader->serverRedirectSourceForHistory().isNull()) {
+ if (WebHistoryItem *item = [[WebHistory optionalSharedHistory] _itemForURLString:loader->serverRedirectSourceForHistory()])
+ core(item)->addRedirectURL(loader->serverRedirectDestinationForHistory());
+ }
}
bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const
@@ -907,13 +897,8 @@ void WebFrameLoaderClient::frameLoadCompleted()
// See WebFrameLoaderClient::provisionalLoadStarted.
if ([getWebView(m_webFrame.get()) drawsBackground])
[[m_webFrame->_private->webFrameView _scrollView] setDrawsBackground:YES];
-
- // Even if already complete, we might have set a previous item on a frame that
- // didn't do any data loading on the past transaction. Make sure to clear these out.
- core(m_webFrame.get())->loader()->setPreviousHistoryItem(0);
}
-
void WebFrameLoaderClient::saveViewStateToItem(HistoryItem* item)
{
if (!item)
@@ -1399,7 +1384,7 @@ static Class netscapePluginViewClass()
#endif
}
-Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element, const KURL& url,
+Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElement* element, const KURL& url,
const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -1442,6 +1427,12 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element
}
NSString *extension = [[URL path] pathExtension];
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+ // don't allow proxy plug-in selection by file extension
+ if (element->hasTagName(videoTag) || element->hasTagName(audioTag))
+ extension = @"";
+#endif
+
if (!pluginPackage && [extension length] != 0) {
pluginPackage = [webView _pluginForExtension:extension];
if (pluginPackage) {
@@ -1470,7 +1461,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element
attributeKeys:kit(paramNames)
attributeValues:kit(paramValues)
loadManually:loadManually
- DOMElement:kit(element)] autorelease];
+ element:element] autorelease];
return new NetscapePluginWidget(pluginView);
}
@@ -1524,7 +1515,7 @@ void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
END_BLOCK_OBJC_EXCEPTIONS;
}
-Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, Element* element, const KURL& baseURL,
+Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, HTMLAppletElement* element, const KURL& baseURL,
const Vector<String>& paramNames, const Vector<String>& paramValues)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -1548,7 +1539,7 @@ Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, Elemen
}
if (parameterValue(paramNames, paramValues, "height").isNull()) {
[names addObject:@"height"];
- [values addObject:[NSString stringWithFormat:@"%d", size.width()]];
+ [values addObject:[NSString stringWithFormat:@"%d", size.height()]];
}
view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, names, values, baseURL, kit(element), NO);
}
@@ -1562,7 +1553,7 @@ Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, Elemen
attributeKeys:kit(paramNames)
attributeValues:kit(paramValues)
loadManually:NO
- DOMElement:kit(element)] autorelease];
+ element:element] autorelease];
} else {
ASSERT_NOT_REACHED();
}
@@ -1596,6 +1587,9 @@ String WebFrameLoaderClient::overrideMediaType() const
return String();
}
+void WebFrameLoaderClient::documentElementAvailable() {
+}
+
void WebFrameLoaderClient::windowObjectCleared()
{
Frame *frame = core(m_webFrame.get());
diff --git a/WebKit/mac/WebCoreSupport/WebGeolocation.mm b/WebKit/mac/WebCoreSupport/WebGeolocation.mm
new file mode 100644
index 0000000..89d6ad9
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebGeolocation.mm
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * 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 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 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.
+ */
+
+#import "WebGeolocationInternal.h"
+#import <WebCore/Geolocation.h>
+
+using namespace WebCore;
+
+@implementation WebGeolocation (WebInternal)
+
+- (id)_initWithWebCoreGeolocation:(WebCoreGeolocation *)geolocation
+{
+ ASSERT(geolocation);
+
+ self = [super init];
+ if (self) {
+ geolocation->ref();
+ _private = reinterpret_cast<WebGeolocationPrivate*>(geolocation);
+ }
+ return self;
+}
+
+@end
+
+@implementation WebGeolocation
+
+- (BOOL)shouldClearCache
+{
+ return reinterpret_cast<Geolocation*>(_private)->shouldClearCache();
+}
+
+- (void)setIsAllowed:(BOOL)allowed
+{
+ reinterpret_cast<Geolocation*>(_private)->setIsAllowed(allowed);
+}
+
+- (void)dealloc
+{
+ if (_private)
+ reinterpret_cast<Geolocation*>(_private)->deref();
+ [super dealloc];
+}
+
+@end
diff --git a/WebKit/mac/WebCoreSupport/WebGeolocationInternal.h b/WebKit/mac/WebCoreSupport/WebGeolocationInternal.h
new file mode 100644
index 0000000..8145d4d
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebGeolocationInternal.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * 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 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 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.
+ */
+
+#import "WebGeolocationPrivate.h"
+
+namespace WebCore {
+ class Geolocation;
+}
+
+typedef WebCore::Geolocation WebCoreGeolocation;
+
+@interface WebGeolocation (WebInternal)
+
+- (id)_initWithWebCoreGeolocation:(WebCoreGeolocation *)geolocation;
+
+@end
diff --git a/WebKit/mac/WebCoreSupport/WebGeolocationPrivate.h b/WebKit/mac/WebCoreSupport/WebGeolocationPrivate.h
new file mode 100644
index 0000000..5807f7c
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebGeolocationPrivate.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * 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 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 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.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class WebGeolocationPrivate;
+
+@interface WebGeolocation : NSObject {
+@private
+ WebGeolocationPrivate *_private;
+}
+
+- (BOOL)shouldClearCache;
+- (void)setIsAllowed:(BOOL)allowed;
+@end
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
index 6a807c7..41a8fa5 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
@@ -48,6 +48,8 @@ public:
virtual WebCore::Page* createPage();
virtual WebCore::String localizedStringsURL();
+ virtual WebCore::String hiddenPanels();
+
virtual void showWindow();
virtual void closeWindow();
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index 03d85ae..cc4cfdb 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -94,6 +94,14 @@ String WebInspectorClient::localizedStringsURL()
return String();
}
+String WebInspectorClient::hiddenPanels()
+{
+ NSString *hiddenPanels = [[NSUserDefaults standardUserDefaults] stringForKey:@"WebKitInspectorHiddenPanels"];
+ if (hiddenPanels)
+ return hiddenPanels;
+ return String();
+}
+
void WebInspectorClient::showWindow()
{
updateWindowTitle();
diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
index 274045f..a8c49ff 100644
--- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
+++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
@@ -53,7 +53,7 @@ String WebPasteboardHelper::plainTextFromPasteboard(const NSPasteboard *pasteboa
NSArray *types = [pasteboard types];
if ([types containsObject:NSStringPboardType])
- return [pasteboard stringForType:NSStringPboardType];
+ return [[pasteboard stringForType:NSStringPboardType] precomposedStringWithCanonicalMapping];
NSAttributedString *attributedString = nil;
NSString *string;
@@ -63,15 +63,15 @@ String WebPasteboardHelper::plainTextFromPasteboard(const NSPasteboard *pasteboa
if (!attributedString && [types containsObject:NSRTFPboardType])
attributedString = [[NSAttributedString alloc] initWithRTF:[pasteboard dataForType:NSRTFPboardType] documentAttributes:nil];
if (attributedString) {
- string = [[attributedString string] copy];
+ string = [[attributedString string] precomposedStringWithCanonicalMapping];
[attributedString release];
- return [string autorelease];
+ return string;
}
if ([types containsObject:NSFilenamesPboardType]) {
string = [[pasteboard propertyListForType:NSFilenamesPboardType] componentsJoinedByString:@"\n"];
if (string)
- return string;
+ return [string precomposedStringWithCanonicalMapping];
}
NSURL *URL;
diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
index 9ccdfff..ea82acc 100644
--- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm
+++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
@@ -341,12 +341,16 @@
- (NSString *)contextMenuItemTagWritingDirectionMenu
{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
+#else
return UI_STRING("Writing Direction", "Writing direction context sub-menu item");
+#endif
}
- (NSString *)contextMenuItemTagTextDirectionMenu
{
- return UI_STRING("Text Direction", "Text direction context sub-menu item");
+ return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
}
- (NSString *)contextMenuItemTagDefaultDirection
diff --git a/WebKit/mac/WebKitPrefix.h b/WebKit/mac/WebKitPrefix.h
index 3e26ab4..4ecd713 100644
--- a/WebKit/mac/WebKitPrefix.h
+++ b/WebKit/mac/WebKitPrefix.h
@@ -68,20 +68,20 @@ typedef float CGFloat;
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
-#define BUILDING_ON_TIGER 1
-#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
-#define BUILDING_ON_LEOPARD 1
-#endif
#endif
+#include <wtf/Platform.h>
+
#include "EmptyProtocolDefinitions.h"
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && defined(__x86_64__)
#define WTF_USE_PLUGIN_HOST_PROCESS 1
#endif
-#include <wtf/Platform.h>
+// Accelerated compositing (also needs to be set in WebCore/config.h)
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#define WTF_USE_ACCELERATED_COMPOSITING 0
+#endif
/* WebKit has no way to pull settings from WebCore/config.h for now */
/* so we assume WebKit is always being compiled on top of JavaScriptCore */
diff --git a/WebKit/mac/WebView/WebArchive.mm b/WebKit/mac/WebView/WebArchive.mm
index c6cc9b1..89c8335 100644
--- a/WebKit/mac/WebView/WebArchive.mm
+++ b/WebKit/mac/WebView/WebArchive.mm
@@ -53,7 +53,7 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
NSArray *cachedSubresources;
NSArray *cachedSubframeArchives;
@private
- LegacyWebArchive* coreArchive;
+ RefPtr<LegacyWebArchive> coreArchive;
}
- (id)initWithCoreArchive:(PassRefPtr<LegacyWebArchive>)coreArchive;
@@ -76,7 +76,7 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
self = [super init];
if (!self)
return nil;
- coreArchive = LegacyWebArchive::create().releaseRef();
+ coreArchive = LegacyWebArchive::create();
return self;
}
@@ -87,33 +87,26 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
[self release];
return nil;
}
- coreArchive = _coreArchive.releaseRef();
+ coreArchive = _coreArchive;
return self;
}
- (LegacyWebArchive*)coreArchive
{
- return coreArchive;
+ return coreArchive.get();
}
- (void)setCoreArchive:(PassRefPtr<LegacyWebArchive>)newCoreArchive
{
ASSERT(coreArchive);
ASSERT(newCoreArchive);
- if (coreArchive)
- coreArchive->deref();
- coreArchive = newCoreArchive.releaseRef();
+ coreArchive = newCoreArchive;
}
- (void)dealloc
{
if (WebCoreObjCScheduleDeallocateOnMainThread([WebArchivePrivate class], self))
return;
-
- if (coreArchive) {
- coreArchive->deref();
- coreArchive = 0;
- }
[cachedMainResource release];
[cachedSubresources release];
@@ -122,23 +115,13 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
[super dealloc];
}
-- (void)finalize
-{
- if (coreArchive) {
- coreArchive->deref();
- coreArchive = 0;
- }
-
- [super finalize];
-}
-
@end
@implementation WebArchive
- (id)init
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
self = [super init];
if (!self)
@@ -166,7 +149,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
return [[self _webkit_invokeOnMainThread] initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
self = [super init];
if (!self)
@@ -219,7 +202,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
- (id)initWithData:(NSData *)data
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
self = [super init];
if (!self)
@@ -296,7 +279,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
return [[self _webkit_invokeOnMainThread] mainResource];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
// Currently from WebKit API perspective, WebArchives are entirely immutable once created
// If they ever become mutable, we'll need to rethink this.
@@ -316,7 +299,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
return [[self _webkit_invokeOnMainThread] subresources];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
// Currently from WebKit API perspective, WebArchives are entirely immutable once created
// If they ever become mutable, we'll need to rethink this.
@@ -337,8 +320,9 @@ static BOOL isArrayOfClass(id object, Class elementClass)
}
}
}
-
- return [[_private->cachedSubresources retain] autorelease];
+ // Maintain the WebKit 3 behavior of this API, which is documented and
+ // relied upon by some clients, of returning nil if there are no subresources.
+ return [_private->cachedSubresources count] ? [[_private->cachedSubresources retain] autorelease] : nil;
}
- (NSArray *)subframeArchives
@@ -348,7 +332,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
return [[self _webkit_invokeOnMainThread] subframeArchives];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
// Currently from WebKit API perspective, WebArchives are entirely immutable once created
// If they ever become mutable, we'll need to rethink this.
@@ -373,7 +357,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
- (NSData *)data
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
#if !LOG_DISABLED
CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
@@ -396,7 +380,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
- (id)_initWithCoreLegacyWebArchive:(PassRefPtr<WebCore::LegacyWebArchive>)coreLegacyWebArchive
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
self = [super init];
if (!self)
@@ -413,7 +397,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
- (WebCore::LegacyWebArchive *)_coreLegacyWebArchive
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
return [_private coreArchive];
}
diff --git a/WebKit/mac/WebView/WebDataSource.mm b/WebKit/mac/WebView/WebDataSource.mm
index 12afcb3..57347d3 100644
--- a/WebKit/mac/WebView/WebDataSource.mm
+++ b/WebKit/mac/WebView/WebDataSource.mm
@@ -88,9 +88,12 @@ using namespace WebCore;
if (WebCoreObjCScheduleDeallocateOnMainThread([WebDataSourcePrivate class], self))
return;
- ASSERT(!loader->isLoading());
- loader->detachDataSource();
- loader->deref();
+ ASSERT(loader);
+ if (loader) {
+ ASSERT(!loader->isLoading());
+ loader->detachDataSource();
+ loader->deref();
+ }
[representation release];
@@ -101,9 +104,12 @@ using namespace WebCore;
{
ASSERT_MAIN_THREAD();
- ASSERT(!loader->isLoading());
- loader->detachDataSource();
- loader->deref();
+ ASSERT(loader);
+ if (loader) {
+ ASSERT(!loader->isLoading());
+ loader->detachDataSource();
+ loader->deref();
+ }
[super finalize];
}
@@ -484,9 +490,14 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
_private->loader->getSubresources(coreSubresources);
NSMutableArray *subresources = [[NSMutableArray alloc] initWithCapacity:coreSubresources.size()];
- for (unsigned i = 0; i < coreSubresources.size(); ++i)
- [subresources addObject:[[[WebResource alloc] _initWithCoreResource:coreSubresources[i]] autorelease]];
-
+ for (unsigned i = 0; i < coreSubresources.size(); ++i) {
+ WebResource *resource = [[WebResource alloc] _initWithCoreResource:coreSubresources[i]];
+ if (resource) {
+ [subresources addObject:resource];
+ [resource release];
+ }
+ }
+
return [subresources autorelease];
}
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 0ac300e..2aa5fab 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -611,7 +611,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
// We need to give the part the opportunity to adjust the page height at each step.
for (float i = 0; i < docHeight; i += currPageHeight) {
float proposedBottom = min(docHeight, i + printHeight);
- _private->coreFrame->adjustPageHeight(&proposedBottom, i, proposedBottom, i);
+ view->adjustPageHeight(&proposedBottom, i, proposedBottom, i);
currPageHeight = max(1.0f, proposedBottom - i);
for (float j = 0; j < docWidth; j += printWidth) {
NSValue* val = [NSValue valueWithRect: NSMakeRect(j, i, printWidth, currPageHeight)];
@@ -622,7 +622,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return pages;
}
-- (BOOL)_getVisibleRect:(NSRect*)rect;
+- (BOOL)_getVisibleRect:(NSRect*)rect
{
ASSERT_ARG(rect, rect);
if (RenderPart* ownerRenderer = _private->coreFrame->ownerRenderer()) {
@@ -678,7 +678,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
if (startNode && startNode->renderer()) {
RenderLayer *layer = startNode->renderer()->enclosingLayer();
if (layer)
- layer->scrollRectToVisible(enclosingIntRect(rangeRect), false, RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignToEdgeIfNeeded);
+ layer->scrollRectToVisible(enclosingIntRect(rangeRect), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
}
}
@@ -701,7 +701,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
RenderView* root = static_cast<RenderView *>(_private->coreFrame->document()->renderer());
if (!root)
return nil;
- return _private->coreFrame->document()->axObjectCache()->get(root)->wrapper();
+ return _private->coreFrame->document()->axObjectCache()->getOrCreate(root)->wrapper();
#else
return nil;
#endif
@@ -715,7 +715,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
SelectionController selection;
selection.setSelection(_private->coreFrame->selection()->selection());
selection.modify(alteration, direction, granularity);
- return [DOMRange _wrapRange:selection.toRange().get()];
+ return [DOMRange _wrapRange:selection.toNormalizedRange().get()];
}
- (TextGranularity)_selectionGranularity
@@ -793,7 +793,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (DOMRange *)_markDOMRange
{
- return [DOMRange _wrapRange:_private->coreFrame->mark().toRange().get()];
+ return [DOMRange _wrapRange:_private->coreFrame->mark().toNormalizedRange().get()];
}
// Given proposedRange, returns an extended range that includes adjacent whitespace that should
@@ -824,8 +824,8 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
RefPtr<Range> range = _private->coreFrame->document()->createRange();
int exception = 0;
- range->setStart(newStart.node(), newStart.offset(), exception);
- range->setEnd(newStart.node(), newStart.offset(), exception);
+ range->setStart(newStart.node(), newStart.m_offset, exception);
+ range->setEnd(newStart.node(), newStart.m_offset, exception);
return [DOMRange _wrapRange:range.get()];
}
@@ -909,15 +909,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return [DOMDocumentFragment _wrapDocumentFragment:createFragmentFromNodes(_private->coreFrame->document(), nodesVector).get()];
}
-- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
-{
- if (_private->coreFrame->selection()->isNone() || !fragment)
- return;
-
- applyCommand(ReplaceSelectionCommand::create(_private->coreFrame->document(), [fragment _documentFragment], selectReplacement, smartReplace, matchStyle));
- _private->coreFrame->revealSelection(RenderLayer::gAlignToEdgeIfNeeded);
-}
-
- (void)_replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
{
DOMDocumentFragment *fragment = [DOMDocumentFragment _wrapDocumentFragment:_private->coreFrame->document()->createDocumentFragment().get()];
@@ -925,41 +916,19 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
[self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:matchStyle];
}
-- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
-{
- DOMDocumentFragment *fragment = [self _documentFragmentWithMarkupString:markupString baseURLString:baseURLString];
- [self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:NO];
-}
-
-- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
-{
- [self _replaceSelectionWithFragment:kit(createFragmentFromText(_private->coreFrame->selection()->toRange().get(), text).get())
- selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:YES];
-}
-
- (void)_insertParagraphSeparatorInQuotedContent
{
if (_private->coreFrame->selection()->isNone())
return;
TypingCommand::insertParagraphSeparatorInQuotedContent(_private->coreFrame->document());
- _private->coreFrame->revealSelection(RenderLayer::gAlignToEdgeIfNeeded);
+ _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
- (VisiblePosition)_visiblePositionForPoint:(NSPoint)point
{
- IntPoint outerPoint(point);
- HitTestResult result = _private->coreFrame->eventHandler()->hitTestResultAtPoint(outerPoint, true);
- Node* node = result.innerNode();
- if (!node)
- return VisiblePosition();
- RenderObject* renderer = node->renderer();
- if (!renderer)
- return VisiblePosition();
- VisiblePosition visiblePos = renderer->positionForCoordinates(result.localPoint().x(), result.localPoint().y());
- if (visiblePos.isNull())
- visiblePos = VisiblePosition(Position(node, 0));
- return visiblePos;
+ // FIXME: Someone with access to Apple's sources could remove this needless wrapper call.
+ return _private->coreFrame->visiblePositionForPoint(IntPoint(point));
}
- (DOMRange *)_characterRangeAtPoint:(NSPoint)point
@@ -1094,7 +1063,8 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (BOOL)_isFrameSet
{
- return _private->coreFrame->isFrameSet();
+ Document* document = _private->coreFrame->document();
+ return document && document->isFrameSet();
}
- (BOOL)_firstLayoutDone
@@ -1109,14 +1079,14 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (NSRange)_selectedNSRange
{
- return [self _convertToNSRange:_private->coreFrame->selection()->toRange().get()];
+ return [self _convertToNSRange:_private->coreFrame->selection()->toNormalizedRange().get()];
}
- (void)_selectNSRange:(NSRange)range
{
RefPtr<Range> domRange = [self _convertToDOMRange:range];
if (domRange)
- _private->coreFrame->selection()->setSelection(Selection(domRange.get(), SEL_DEFAULT_AFFINITY));
+ _private->coreFrame->selection()->setSelection(VisibleSelection(domRange.get(), SEL_DEFAULT_AFFINITY));
}
- (BOOL)_isDisplayingStandaloneImage
@@ -1217,6 +1187,27 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return controller->numberOfActiveAnimations();
}
+- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
+{
+ if (_private->coreFrame->selection()->isNone() || !fragment)
+ return;
+
+ applyCommand(ReplaceSelectionCommand::create(_private->coreFrame->document(), [fragment _documentFragment], selectReplacement, smartReplace, matchStyle));
+ _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+}
+
+- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
+{
+ DOMDocumentFragment* fragment = kit(createFragmentFromText(_private->coreFrame->selection()->toNormalizedRange().get(), text).get());
+ [self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:YES];
+}
+
+- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
+{
+ DOMDocumentFragment *fragment = [self _documentFragmentWithMarkupString:markupString baseURLString:baseURLString];
+ [self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:NO];
+}
+
@end
@implementation WebFrame
diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h
index fa17ed9..473e691 100644
--- a/WebKit/mac/WebView/WebFrameInternal.h
+++ b/WebKit/mac/WebView/WebFrameInternal.h
@@ -167,10 +167,7 @@ WebView *getWebView(WebFrame *webFrame);
- (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
- (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes;
-- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
- (void)_replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
-- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
-- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
- (void)_insertParagraphSeparatorInQuotedContent;
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index 2ea686e..e3e3540 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -35,6 +35,7 @@
#define ENABLE_NETSCAPE_PLUGIN_API 1
#endif
+@class DOMDocumentFragment;
@class DOMNode;
@class WebIconFetcher;
@class WebScriptObject;
@@ -95,4 +96,8 @@ typedef enum {
// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
- (unsigned) _numberOfActiveAnimations;
+- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
+- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
+- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
+
@end
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index 132fb93..bc51bb5 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -49,6 +49,7 @@
#import "WebNSWindowExtras.h"
#import "WebPDFView.h"
#import "WebPreferenceKeysPrivate.h"
+#import "WebResourceInternal.h"
#import "WebSystemInterface.h"
#import "WebViewFactory.h"
#import "WebViewInternal.h"
@@ -314,9 +315,18 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
WKDisableCGDeferredUpdates();
if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_MAIN_THREAD_EXCEPTIONS))
- setDefaultThreadViolationBehavior(LogOnFirstThreadViolation);
+ setDefaultThreadViolationBehavior(LogOnFirstThreadViolation, ThreadViolationRoundOne);
+
+ bool throwExceptionsForRoundTwo = WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_ROUND_TWO_MAIN_THREAD_EXCEPTIONS);
+#ifdef MAIL_THREAD_WORKAROUND
+ // Even if old Mail is linked with new WebKit, don't throw exceptions.
+ if (needMailThreadWorkaround())
+ throwExceptionsForRoundTwo = false;
+#endif
+ if (!throwExceptionsForRoundTwo)
+ setDefaultThreadViolationBehavior(LogOnFirstThreadViolation, ThreadViolationRoundTwo);
}
-
+
_private = [[WebFrameViewPrivate alloc] init];
WebDynamicScrollBarsView *scrollView = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, frame.size.width, frame.size.height)];
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 604a17a..3f69870 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -137,7 +137,7 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
[super finalize];
}
-- (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView;
+- (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView
{
_private->manualLoader = manualLoader;
_private->pluginView = pluginView;
@@ -150,7 +150,7 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (BOOL)_isDisplayingWebArchive
{
- return [[[_private->dataSource response] MIMEType] _webkit_isCaseInsensitiveEqualToString:@"application/x-webarchive"];
+ return [[_private->dataSource _responseMIMEType] _webkit_isCaseInsensitiveEqualToString:@"application/x-webarchive"];
}
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index be4d8db..c4ca174 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -48,7 +48,6 @@
#import "WebHTMLViewInternal.h"
#import "WebKitLogging.h"
#import "WebKitNSStringExtras.h"
-#import "WebKitPluginContainerView.h"
#import "WebKitVersionChecks.h"
#import "WebLocalizableStrings.h"
#import "WebNodeHighlight.h"
@@ -114,6 +113,10 @@
#import <limits>
#import <runtime/InitializeThreading.h>
+#if USE(ACCELERATED_COMPOSITING)
+#import <QuartzCore/QuartzCore.h>
+#endif
+
using namespace WebCore;
using namespace HTMLNames;
using namespace WTF;
@@ -129,6 +132,15 @@ using namespace WTF;
}
@end
+@interface WebResponderChainSink : NSResponder {
+ NSResponder* _lastResponderInChain;
+ BOOL _receivedUnhandledCommand;
+}
+- (id)initWithResponderChain:(NSResponder *)chain;
+- (void)detach;
+- (BOOL)receivedUnhandledCommand;
+@end
+
static IMP oldSetCursorIMP = NULL;
#ifdef BUILDING_ON_TIGER
@@ -142,7 +154,7 @@ static void resetCursorRects(NSWindow* self, SEL cmd)
if ([view isKindOfClass:[WebHTMLView class]]) {
WebHTMLView *htmlView = (WebHTMLView*)view;
NSPoint localPoint = [htmlView convertPoint:point fromView:nil];
- NSDictionary *dict = [htmlView elementAtPoint:point allowShadowContent:NO];
+ NSDictionary *dict = [htmlView elementAtPoint:localPoint allowShadowContent:NO];
DOMElement *element = [dict objectForKey:WebElementDOMNodeKey];
if (![element isKindOfClass:[DOMHTMLAppletElement class]] && ![element isKindOfClass:[DOMHTMLObjectElement class]] &&
![element isKindOfClass:[DOMHTMLEmbedElement class]])
@@ -164,7 +176,7 @@ static void setCursor(NSWindow* self, SEL cmd, NSPoint point)
if ([view isKindOfClass:[WebHTMLView class]]) {
WebHTMLView *htmlView = (WebHTMLView*)view;
NSPoint localPoint = [htmlView convertPoint:point fromView:nil];
- NSDictionary *dict = [htmlView elementAtPoint:point allowShadowContent:NO];
+ NSDictionary *dict = [htmlView elementAtPoint:localPoint allowShadowContent:NO];
DOMElement *element = [dict objectForKey:WebElementDOMNodeKey];
if (![element isKindOfClass:[DOMHTMLAppletElement class]] && ![element isKindOfClass:[DOMHTMLObjectElement class]] &&
![element isKindOfClass:[DOMHTMLEmbedElement class]])
@@ -174,6 +186,20 @@ static void setCursor(NSWindow* self, SEL cmd, NSPoint point)
}
#endif
+#if USE(ACCELERATED_COMPOSITING)
+@interface WebLayerHostingView : NSView
+@end
+
+@implementation WebLayerHostingView
+// Empty NSViews intercept rightMouseDown: to do context menu handling, but we need the WebLayerHostingView to
+// let right mouse clicks through.
+- (void)rightMouseDown:(NSEvent *)theEvent
+{
+ [[self nextResponder] performSelector:_cmd withObject:theEvent];
+}
+@end
+#endif // USE(ACCELERATED_COMPOSITING)
+
extern "C" {
// Need to declare these attribute names because AppKit exports them but does not make them available in API or SPI headers.
@@ -289,6 +315,9 @@ static CachedResourceClient* promisedDataClient()
- (NSString *)_plainTextFromPasteboard:(NSPasteboard *)pasteboard;
- (void)_pasteWithPasteboard:(NSPasteboard *)pasteboard allowPlainText:(BOOL)allowPlainText;
- (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard;
+- (void)_removeMouseMovedObserverUnconditionally;
+- (void)_removeSuperviewObservers;
+- (void)_removeWindowObservers;
- (BOOL)_shouldInsertFragment:(DOMDocumentFragment *)fragment replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action;
- (BOOL)_shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action;
- (BOOL)_shouldReplaceSelectionWithText:(NSString *)text givenAction:(WebViewInsertAction)action;
@@ -372,9 +401,17 @@ struct WebHTMLViewInterpretKeyEventsParameters {
BOOL ignoringMouseDraggedEvents;
BOOL printing;
BOOL avoidingPrintOrphan;
+ BOOL observingMouseMovedNotifications;
+ BOOL observingSuperviewNotifications;
+ BOOL observingWindowNotifications;
+ BOOL resigningFirstResponder;
id savedSubviews;
BOOL subviewsSetAside;
+
+#if USE(ACCELERATED_COMPOSITING)
+ NSView *layerHostingView;
+#endif
NSEvent *mouseDownEvent; // Kept after handling the event.
BOOL handlingMouseDownEvent;
@@ -523,6 +560,10 @@ static NSCellStateValue kit(TriState state)
dataSource = nil;
highlighters = nil;
promisedDragTIFFDataSource = 0;
+
+#if USE(ACCELERATED_COMPOSITING)
+ layerHostingView = nil;
+#endif
}
@end
@@ -755,6 +796,49 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
[[self _frame] _replaceSelectionWithText:text selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard]];
}
+- (void)_removeMouseMovedObserverUnconditionally
+{
+ if (!_private || !_private->observingMouseMovedNotifications)
+ return;
+
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:WKMouseMovedNotification() object:nil];
+ _private->observingMouseMovedNotifications = false;
+}
+
+- (void)_removeSuperviewObservers
+{
+ if (!_private || !_private->observingSuperviewNotifications)
+ return;
+
+ NSView *superview = [self superview];
+ if (!superview || ![self window])
+ return;
+
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter removeObserver:self name:NSViewFrameDidChangeNotification object:superview];
+ [notificationCenter removeObserver:self name:NSViewBoundsDidChangeNotification object:superview];
+
+ _private->observingSuperviewNotifications = false;
+}
+
+- (void)_removeWindowObservers
+{
+ if (!_private->observingWindowNotifications)
+ return;
+
+ NSWindow *window = [self window];
+ if (!window)
+ return;
+
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil];
+ [notificationCenter removeObserver:self name:NSWindowDidResignKeyNotification object:nil];
+ [notificationCenter removeObserver:self name:NSWindowWillCloseNotification object:window];
+ [notificationCenter removeObserver:self name:WKWindowWillOrderOnScreenNotification() object:window];
+
+ _private->observingWindowNotifications = false;
+}
+
- (BOOL)_shouldInsertFragment:(DOMDocumentFragment *)fragment replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action
{
WebView *webView = [self _webView];
@@ -789,7 +873,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
- (DOMRange *)_selectedRange
{
Frame* coreFrame = core([self _frame]);
- return coreFrame ? kit(coreFrame->selection()->toRange().get()) : nil;
+ return coreFrame ? kit(coreFrame->selection()->toNormalizedRange().get()) : nil;
}
- (BOOL)_shouldDeleteRange:(DOMRange *)range
@@ -1064,7 +1148,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
NSPoint origin = [[self superview] bounds].origin;
if (!NSEqualPoints(_private->lastScrollPosition, origin)) {
if (Frame* coreFrame = core([self _frame]))
- coreFrame->sendScrollEvent();
+ coreFrame->eventHandler()->sendScrollEvent();
[_private->compController endRevertingChange:NO moveLeft:NO];
WebView *webView = [self _webView];
@@ -1088,15 +1172,34 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
ASSERT(!_private->subviewsSetAside);
ASSERT(_private->savedSubviews == nil);
_private->savedSubviews = _subviews;
+#if USE(ACCELERATED_COMPOSITING)
+ // We need to keep the layer-hosting view in the subviews, otherwise the layers flash.
+ if (_private->layerHostingView) {
+ NSArray* newSubviews = [[NSArray alloc] initWithObjects:_private->layerHostingView, nil];
+ _subviews = newSubviews;
+ } else
+ _subviews = nil;
+#else
_subviews = nil;
+#endif
_private->subviewsSetAside = YES;
}
- (void)_restoreSubviews
{
ASSERT(_private->subviewsSetAside);
+#if USE(ACCELERATED_COMPOSITING)
+ if (_private->layerHostingView) {
+ [_subviews release];
+ _subviews = _private->savedSubviews;
+ } else {
+ ASSERT(_subviews == nil);
+ _subviews = _private->savedSubviews;
+ }
+#else
ASSERT(_subviews == nil);
_subviews = _private->savedSubviews;
+#endif
_private->savedSubviews = nil;
_private->subviewsSetAside = NO;
}
@@ -1111,7 +1214,9 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
- (void)willRemoveSubview:(NSView *)subview
{
- if (_private->enumeratingSubviews)
+ // Have to null-check _private, since this can be called via -dealloc when
+ // cleaning up the the layerHostingView.
+ if (_private && _private->enumeratingSubviews)
LOG(View, "A view of class %s was removed during subview enumeration for layout or printing mode change. We will still do layout or the printing mode change even though this view is no longer in the view hierarchy.", object_getClassName([subview class]));
}
@@ -1833,7 +1938,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
- (void)close
{
- // Check for a nil _private here incase we were created with initWithCoder. In that case, the WebView is just throwing
+ // Check for a nil _private here in case we were created with initWithCoder. In that case, the WebView is just throwing
// out the archived WebHTMLView and recreating a new one if needed. So close doesn't need to do anything in that case.
if (!_private || _private->closed)
return;
@@ -1843,14 +1948,21 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
[self _cancelUpdateMouseoverTimer];
[self _cancelUpdateFocusedAndActiveStateTimer];
[self _clearLastHitViewIfSelf];
- // FIXME: This is slow; should remove individual observers instead.
- [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [self _removeMouseMovedObserverUnconditionally];
+ [self _removeWindowObservers];
+ [self _removeSuperviewObservers];
[_private->pluginController destroyAllPlugins];
[_private->pluginController setDataSource:nil];
// remove tooltips before clearing _private so removeTrackingRect: will work correctly
[self removeAllToolTips];
+
+#if USE(ACCELERATED_COMPOSITING)
+ if (_private->layerHostingView)
+ [[self _webView] _stoppedAcceleratedCompositingForFrame:[self _frame]];
+#endif
+
[_private clear];
-
+
Page* page = core([self _webView]);
if (page)
page->dragController()->setDraggingImageURL(KURL());
@@ -1976,10 +2088,10 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
if (!document)
return nil;
DOMHTMLAnchorElement *anchor = (DOMHTMLAnchorElement *)[document createElement:@"a"];
- NSString *URLString = [URL _web_originalDataAsString];
+ NSString *URLString = [URL _web_originalDataAsString]; // Original data is ASCII-only, so there is no need to precompose.
if ([URLString length] == 0)
return nil;
- NSString *URLTitleString = [pasteboard stringForType:WebURLNamePboardType];
+ NSString *URLTitleString = [[pasteboard stringForType:WebURLNamePboardType] precomposedStringWithCanonicalMapping];
DOMText *text = [document createTextNode:URLTitleString];
[anchor setHref:URLString];
[anchor appendChild:text];
@@ -1988,7 +2100,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
return fragment;
}
if (pboardType == NSStringPboardType)
- return kit(createFragmentFromText(core(context), [pasteboard stringForType:NSStringPboardType]).get());
+ return kit(createFragmentFromText(core(context), [[pasteboard stringForType:NSStringPboardType] precomposedStringWithCanonicalMapping]).get());
return nil;
}
@@ -2022,6 +2134,15 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
}
#endif
+- (BOOL)_isUsingAcceleratedCompositing
+{
+#if USE(ACCELERATED_COMPOSITING)
+ return _private->layerHostingView != nil;
+#else
+ return NO;
+#endif
+}
+
@end
@implementation NSView (WebHTMLViewFileInternal)
@@ -2052,6 +2173,23 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
@end
+@interface NSString (WebHTMLViewFileInternal)
+- (BOOL)matchesExtensionEquivalent:(NSString *)extension;
+@end
+
+@implementation NSString (WebHTMLViewFileInternal)
+
+- (BOOL)matchesExtensionEquivalent:(NSString *)extension
+{
+ if ([self hasSuffix:extension])
+ return YES;
+ else if ([extension isEqualToString:@"jpeg"] && [self hasSuffix:@"jpg"])
+ return YES;
+ return NO;
+}
+
+@end
+
#ifdef BUILDING_ON_TIGER
// The following is a workaround for
@@ -2167,8 +2305,8 @@ static String commandNameForSelector(SEL selector)
// Remove the trailing colon.
const char* selectorName = sel_getName(selector);
size_t selectorNameLength = strlen(selectorName);
- ASSERT(selectorNameLength >= 2);
- ASSERT(selectorName[selectorNameLength - 1] == ':');
+ if (selectorNameLength < 2 || selectorName[selectorNameLength - 1] != ':')
+ return String();
return String(selectorName, selectorNameLength - 1);
}
@@ -2267,6 +2405,10 @@ WEBCORE_COMMAND(moveToEndOfParagraph)
WEBCORE_COMMAND(moveToEndOfParagraphAndModifySelection)
WEBCORE_COMMAND(moveToEndOfSentence)
WEBCORE_COMMAND(moveToEndOfSentenceAndModifySelection)
+WEBCORE_COMMAND(moveToLeftEndOfLine)
+WEBCORE_COMMAND(moveToLeftEndOfLineAndModifySelection)
+WEBCORE_COMMAND(moveToRightEndOfLine)
+WEBCORE_COMMAND(moveToRightEndOfLineAndModifySelection)
WEBCORE_COMMAND(moveUp)
WEBCORE_COMMAND(moveUpAndModifySelection)
WEBCORE_COMMAND(moveWordBackward)
@@ -2335,11 +2477,10 @@ WEBCORE_COMMAND(yankAndSelect)
- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType
{
- if (sendType != nil && [[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]) {
- return self;
- } else if (returnType != nil && [[[self class] _insertablePasteboardTypes] containsObject:returnType] && [self _isEditable]) {
+ BOOL isSendTypeOK = !sendType || ([[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]);
+ BOOL isReturnTypeOK = !returnType || ([[[self class] _insertablePasteboardTypes] containsObject:returnType] && [self _isEditable]);
+ if (isSendTypeOK && isReturnTypeOK)
return self;
- }
return [[self nextResponder] validRequestorForSendType:sendType returnType:returnType];
}
@@ -2353,7 +2494,7 @@ WEBCORE_COMMAND(yankAndSelect)
COMMAND_PROLOGUE
if (Frame* coreFrame = core([self _frame]))
- coreFrame->revealSelection(RenderLayer::gAlignCenterAlways);
+ coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
}
- (NSCellStateValue)selectionHasStyle:(CSSStyleDeclaration*)style
@@ -2426,7 +2567,14 @@ WEBCORE_COMMAND(yankAndSelect)
}
return [self _canEdit];
}
-
+
+ if (action == @selector(makeBaseWritingDirectionNatural:)) {
+ NSMenuItem *menuItem = (NSMenuItem *)item;
+ if ([menuItem isKindOfClass:[NSMenuItem class]])
+ [menuItem setState:NSOffState];
+ return NO;
+ }
+
if (action == @selector(toggleBaseWritingDirection:)) {
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
@@ -2566,7 +2714,7 @@ WEBCORE_COMMAND(yankAndSelect)
- (void)addMouseMovedObserver
{
- if (!_private->dataSource || ![self _isTopHTMLView])
+ if (!_private->dataSource || ![self _isTopHTMLView] || _private->observingMouseMovedNotifications)
return;
// Unless the Dashboard asks us to do this for all windows, keep an observer going only for the key window.
@@ -2580,12 +2728,7 @@ WEBCORE_COMMAND(yankAndSelect)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mouseMovedNotification:)
name:WKMouseMovedNotification() object:nil];
[self _frameOrBoundsChanged];
-}
-
-- (void)removeMouseMovedObserverUnconditionally
-{
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:WKMouseMovedNotification() object:nil];
+ _private->observingMouseMovedNotifications = true;
}
- (void)removeMouseMovedObserver
@@ -2597,7 +2740,7 @@ WEBCORE_COMMAND(yankAndSelect)
#endif
[[self _webView] _mouseDidMoveOverElement:nil modifierFlags:0];
- [self removeMouseMovedObserverUnconditionally];
+ [self _removeMouseMovedObserverUnconditionally];
}
- (void)addSuperviewObservers
@@ -2610,66 +2753,48 @@ WEBCORE_COMMAND(yankAndSelect)
// to extend the background the full height of the space and because some elements have
// sizes that are based on the total size of the view.
- NSView *superview = [self superview];
- if (superview && [self window]) {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_frameOrBoundsChanged)
- name:NSViewFrameDidChangeNotification object:superview];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_frameOrBoundsChanged)
- name:NSViewBoundsDidChangeNotification object:superview];
-
- // In addition to registering for frame/bounds change notifications, call -_frameOrBoundsChanged.
- // It will check the current size/scroll against the previous layout's size/scroll. We need to
- // do this here to catch the case where the WebView is laid out at one size, removed from its
- // window, resized, and inserted into another window. Our frame/bounds changed notifications
- // will not be sent in that situation, since we only watch for changes while in the view hierarchy.
- [self _frameOrBoundsChanged];
- }
-}
+ if (_private->observingSuperviewNotifications)
+ return;
-- (void)removeSuperviewObservers
-{
NSView *superview = [self superview];
- if (superview && [self window]) {
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:NSViewFrameDidChangeNotification object:superview];
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:NSViewBoundsDidChangeNotification object:superview];
- }
+ if (!superview || ![self window])
+ return;
+
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter addObserver:self selector:@selector(_frameOrBoundsChanged) name:NSViewFrameDidChangeNotification object:superview];
+ [notificationCenter addObserver:self selector:@selector(_frameOrBoundsChanged) name:NSViewBoundsDidChangeNotification object:superview];
+
+ // In addition to registering for frame/bounds change notifications, call -_frameOrBoundsChanged.
+ // It will check the current size/scroll against the previous layout's size/scroll. We need to
+ // do this here to catch the case where the WebView is laid out at one size, removed from its
+ // window, resized, and inserted into another window. Our frame/bounds changed notifications
+ // will not be sent in that situation, since we only watch for changes while in the view hierarchy.
+ [self _frameOrBoundsChanged];
+
+ _private->observingSuperviewNotifications = true;
}
- (void)addWindowObservers
{
+ if (_private->observingWindowNotifications)
+ return;
+
NSWindow *window = [self window];
- if (window) {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:)
- name:NSWindowDidBecomeKeyNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidResignKey:)
- name:NSWindowDidResignKeyNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:)
- name:NSWindowWillCloseNotification object:window];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillOrderOnScreen:)
- name:WKWindowWillOrderOnScreenNotification() object:window];
- }
-}
-
-- (void)removeWindowObservers
-{
- NSWindow *window = [self window];
- if (window) {
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:NSWindowDidBecomeKeyNotification object:nil];
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:NSWindowDidResignKeyNotification object:nil];
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:NSWindowWillCloseNotification object:window];
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:WKWindowWillOrderOnScreenNotification() object:window];
- }
+ if (!window)
+ return;
+
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:nil];
+ [notificationCenter addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:nil];
+ [notificationCenter addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:window];
+ [notificationCenter addObserver:self selector:@selector(windowWillOrderOnScreen:) name:WKWindowWillOrderOnScreenNotification() object:window];
+
+ _private->observingWindowNotifications = true;
}
- (void)viewWillMoveToSuperview:(NSView *)newSuperview
{
- [self removeSuperviewObservers];
+ [self _removeSuperviewObservers];
}
- (void)viewDidMoveToSuperview
@@ -2694,9 +2819,9 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
return;
// FIXME: Some of these calls may not work because this view may be already removed from it's superview.
- [self removeMouseMovedObserverUnconditionally];
- [self removeWindowObservers];
- [self removeSuperviewObservers];
+ [self _removeMouseMovedObserverUnconditionally];
+ [self _removeWindowObservers];
+ [self _removeSuperviewObservers];
[self _cancelUpdateMouseoverTimer];
[self _cancelUpdateFocusedAndActiveStateTimer];
@@ -2811,12 +2936,14 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
return;
}
- if (minPageWidth > 0.0)
- coreFrame->forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth, adjustViewSize);
- else {
- coreFrame->forceLayout(!adjustViewSize);
- if (adjustViewSize)
- coreFrame->view()->adjustViewSize();
+ if (FrameView* coreView = coreFrame->view()) {
+ if (minPageWidth > 0.0)
+ coreView->forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth, adjustViewSize);
+ else {
+ coreView->forceLayout(!adjustViewSize);
+ if (adjustViewSize)
+ coreView->adjustViewSize();
+ }
}
_private->needsLayout = NO;
@@ -2993,6 +3120,16 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
if (subviewsWereSetAside)
[self _setAsideSubviews];
+
+#if USE(ACCELERATED_COMPOSITING)
+ if ([[self _webView] _needsOneShotDrawingSynchronization]) {
+ // Disable screen updates so that drawing into the NSView and
+ // CALayer updates appear on the screen at the same time.
+ [[self window] disableScreenUpdatesUntilFlush];
+ [CATransaction flush];
+ [[self _webView] _setNeedsOneShotDrawingSynchronization:NO];
+ }
+#endif
}
// Turn off the additional clip while computing our visibleRect.
@@ -3250,8 +3387,8 @@ done:
draggingImageURL = [response URL];
wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease];
NSString* filename = [response suggestedFilename];
- String trueExtension = tiffResource->image()->filenameExtension();
- if (![filename hasSuffix:trueExtension])
+ NSString* trueExtension(tiffResource->image()->filenameExtension());
+ if (![filename matchesExtensionEquivalent:trueExtension])
filename = [[filename stringByAppendingString:@"."] stringByAppendingString:trueExtension];
[wrapper setPreferredFilename:filename];
}
@@ -3356,6 +3493,7 @@ noPromisedData:
{
BOOL resign = [super resignFirstResponder];
if (resign) {
+ _private->resigningFirstResponder = YES;
[_private->compController endRevertingChange:NO moveLeft:NO];
if (![self maintainsInactiveSelection]) {
[self deselectAll];
@@ -3363,6 +3501,7 @@ noPromisedData:
[self clearFocus];
}
[self _updateFocusedAndActiveState];
+ _private->resigningFirstResponder = NO;
}
return resign;
}
@@ -3443,7 +3582,8 @@ noPromisedData:
[self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
float newBottomFloat = *newBottom;
- core([self _frame])->adjustPageHeight(&newBottomFloat, oldTop, oldBottom, bottomLimit);
+ if (FrameView* view = core([self _frame])->view())
+ view->adjustPageHeight(&newBottomFloat, oldTop, oldBottom, bottomLimit);
#ifdef __LP64__
// If the new bottom is equal to the old bottom (when both are treated as floats), we just copy
@@ -3548,7 +3688,7 @@ noPromisedData:
Frame* frame = core([self _frame]);
if (!frame)
return NO;
- if (!frame->isFrameSet()) {
+ if (!frame->document() || !frame->document()->isFrameSet()) {
float paperWidth = [self _availablePaperWidthForPrintOperation:[NSPrintOperation currentOperation]];
minLayoutWidth = paperWidth * PrintingMinimumShrinkFactor;
maxLayoutWidth = paperWidth * PrintingMaximumShrinkFactor;
@@ -3742,7 +3882,7 @@ noPromisedData:
COMMAND_PROLOGUE
if (Frame* coreFrame = core([self _frame]))
- coreFrame->revealSelection(RenderLayer::gAlignCenterAlways);
+ coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
}
- (NSData *)_selectionStartFontAttributesAsRTF
@@ -4456,6 +4596,11 @@ static BOOL writingDirectionKeyBindingsEnabled()
}
#endif
+- (void)makeBaseWritingDirectionNatural:(id)sender
+{
+ LOG_ERROR("Sent from %@.", sender);
+}
+
#if 0
// CSS does not have a way to specify an outline font, which may make this difficult to implement.
@@ -4764,6 +4909,27 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
if ([[[self selectedString] _webkit_stringByTrimmingWhitespace] length] == 0)
return;
+ NSAttributedString *attrString = [self selectedAttributedString];
+
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return;
+
+ NSRect rect = coreFrame->selectionBounds();
+
+#ifndef BUILDING_ON_TIGER
+ NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)];
+ NSFont *font = [attributes objectForKey:NSFontAttributeName];
+ if (font)
+ rect.origin.y += [font ascender];
+#endif
+
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ [self showDefinitionForAttributedString:attrString atPoint:rect.origin];
+ return;
+#endif
+
+
// We soft link to get the function that displays the dictionary (either pop-up window or app) to avoid the performance
// penalty of linking to another framework. This function changed signature as well as framework between Tiger and Leopard,
// so the two cases are handled separately.
@@ -4795,12 +4961,6 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
return;
}
- NSAttributedString *attrString = [self selectedAttributedString];
-
- Frame* coreFrame = core([self _frame]);
- if (!coreFrame)
- return;
-
#ifdef BUILDING_ON_TIGER
// FIXME: must check for right-to-left here
NSWritingDirection writingDirection = NSWritingDirectionLeftToRight;
@@ -4808,7 +4968,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
// FIXME: the dictionary API expects the rect for the first line of selection. Passing
// the rect for the entire selection, as we do here, positions the pop-up window near
// the bottom of the selection rather than at the selected word.
- NSRect rect = [self convertRect:coreFrame->selectionBounds() toView:nil];
+ rect = [self convertRect:rect toView:nil];
rect.origin = [[self window] convertBaseToScreen:rect.origin];
NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil];
dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0);
@@ -4816,19 +4976,12 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
// The HIDictionaryWindowShow function requires the origin, in CG screen coordinates, of the first character of text in the selection.
// FIXME 4945808: We approximate this in a way that works well when a single word is selected, and less well in some other cases
// (but no worse than we did in Tiger)
- NSRect rect = coreFrame->selectionBounds();
-
- NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)];
- NSFont *font = [attributes objectForKey:NSFontAttributeName];
- if (font)
- rect.origin.y += [font ascender];
-
NSPoint windowPoint = [self convertPoint:rect.origin toView:nil];
NSPoint screenPoint = [[self window] convertBaseToScreen:windowPoint];
dictionaryServiceWindowShow(nil, attrString, CFRangeMake(0, [attrString length]), nil,
coreGraphicsScreenPointForAppKitScreenPoint(screenPoint), false, nil);
-#endif
+#endif
}
- (void)_hoverFeedbackSuspendedChanged
@@ -4877,19 +5030,21 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
if ([self coreCommandBySelector:NSSelectorFromString(commands[i].commandName)].isTextInsertion())
haveTextInsertionCommands = true;
}
- if (!haveTextInsertionCommands || platformEvent->type() == PlatformKeyboardEvent::Char)
- for (size_t i = 0; i < size; ++i)
+ if (!haveTextInsertionCommands || platformEvent->type() == PlatformKeyboardEvent::Char) {
+ for (size_t i = 0; i < size; ++i) {
if (commands[i].commandName == "insertText:")
[self insertText:commands[i].text];
else
[self doCommandBySelector:NSSelectorFromString(commands[i].commandName)];
+ }
+ }
}
_private->interpretKeyEventsParameters = 0;
}
return (!_private->receivedNOOP && parameters.eventWasHandled) || parameters.consumedByIM;
}
-- (WebCore::CachedImage*)promisedDragTIFFDataSource
+- (WebCore::CachedImage*)promisedDragTIFFDataSource
{
return _private->promisedDragTIFFDataSource;
}
@@ -4944,6 +5099,45 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
[[self _pluginController] destroyAllPlugins];
}
+- (BOOL)_isResigningFirstResponder
+{
+ return _private->resigningFirstResponder;
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+- (void)attachRootLayer:(CALayer*)layer
+{
+ if (!_private->layerHostingView) {
+ WebLayerHostingView* hostingView = [[WebLayerHostingView alloc] initWithFrame:[self bounds]];
+ [hostingView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+ [self addSubview:hostingView];
+ [hostingView release];
+ // hostingView is owned by being a subview of self
+ _private->layerHostingView = hostingView;
+ [[self _webView] _startedAcceleratedCompositingForFrame:[self _frame]];
+ }
+
+ // Make a container layer, which will get sized/positioned by AppKit and CA
+ CALayer* viewLayer = [CALayer layer];
+ [_private->layerHostingView setLayer:viewLayer];
+ [_private->layerHostingView setWantsLayer:YES];
+
+ // Parent our root layer in the container layer
+ [viewLayer addSublayer:layer];
+}
+
+- (void)detachRootLayer
+{
+ if (_private->layerHostingView) {
+ [_private->layerHostingView setLayer:nil];
+ [_private->layerHostingView setWantsLayer:NO];
+ [_private->layerHostingView removeFromSuperview];
+ _private->layerHostingView = nil;
+ [[self _webView] _stoppedAcceleratedCompositingForFrame:[self _frame]];
+ }
+}
+#endif
+
@end
@implementation WebHTMLView (WebNSTextInputSupport)
@@ -5058,7 +5252,11 @@ static BOOL isInPasswordField(Frame* coreFrame)
- (NSRange)markedRange
{
WebFrame *webFrame = [self _frame];
- NSRange result = [webFrame _convertToNSRange:core(webFrame)->editor()->compositionRange().get()];
+ Frame* coreFrame = core(webFrame);
+ if (!coreFrame)
+ return NSMakeRange(0, 0);
+ NSRange result = [webFrame _convertToNSRange:coreFrame->editor()->compositionRange().get()];
+
LOG(TextInput, "markedRange -> (%u, %u)", result.location, result.length);
return result;
}
@@ -5214,26 +5412,29 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
// Make sure that only direct calls to doCommandBySelector: see the parameters by setting to 0.
_private->interpretKeyEventsParameters = 0;
- bool eventWasHandled = true;
+ bool eventWasHandled;
WebView *webView = [self _webView];
- Frame* coreFrame = core([self _frame]);
- if (![[webView _editingDelegateForwarder] webView:webView doCommandBySelector:selector] && coreFrame) {
+ if ([[webView _editingDelegateForwarder] webView:webView doCommandBySelector:selector])
+ eventWasHandled = true;
+ else {
Editor::Command command = [self coreCommandBySelector:selector];
if (command.isSupported())
eventWasHandled = command.execute(event);
- else if ([self _canEdit]) {
- // If the command is unsupported and the WebHTMLView is editable, then pass the
- // selector to super and say that the event was handled. If the WebHTMLView is
- // not editable, then do not say that the event was handled. This is important
- // because of selectors like scrollPageDown:, which come as input method events
- // when editing is enabled but keyboard events when it is not. These events are
- // handled by the next responder in the responder chain.
+ else {
+ // If WebKit does not support this command, we need to pass the selector to super.
_private->selectorForDoCommandBySelector = selector;
+
+ // The sink does two things: 1) Tells us if the responder went unhandled, and
+ // 2) prevents any NSBeep; we don't ever want to beep here.
+ WebResponderChainSink *sink = [[WebResponderChainSink alloc] initWithResponderChain:self];
[super doCommandBySelector:selector];
+ eventWasHandled = ![sink receivedUnhandledCommand];
+ [sink detach];
+ [sink release];
+
_private->selectorForDoCommandBySelector = 0;
- } else
- eventWasHandled = false;
+ }
}
if (parameters)
@@ -5474,7 +5675,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
// Get preceeding word stem
WebFrame *frame = [_view _frame];
- DOMRange *selection = kit(core(frame)->selection()->toRange().get());
+ DOMRange *selection = kit(core(frame)->selection()->toNormalizedRange().get());
DOMRange *wholeWord = [frame _rangeByAlteringCurrentSelection:SelectionController::EXTEND
direction:SelectionController::BACKWARD granularity:WordGranularity];
DOMRange *prefix = [wholeWord cloneRange];
@@ -5744,7 +5945,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
if (!attributedString) {
Frame* coreFrame = core([self _frame]);
if (coreFrame) {
- RefPtr<Range> range = coreFrame->selection()->selection().toRange();
+ RefPtr<Range> range = coreFrame->selection()->selection().toNormalizedRange();
attributedString = [NSAttributedString _web_attributedStringFromRange:range.get()];
}
}
@@ -5773,7 +5974,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
return [self elementAtPoint:point allowShadowContent:NO];
}
-- (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow;
+- (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow
{
Frame* coreFrame = core([self _frame]);
if (!coreFrame)
@@ -5847,3 +6048,38 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
}
@end
+
+@implementation WebResponderChainSink
+
+- (id)initWithResponderChain:(NSResponder *)chain
+{
+ self = [super init];
+ _lastResponderInChain = chain;
+ while (NSResponder *next = [_lastResponderInChain nextResponder])
+ _lastResponderInChain = next;
+ [_lastResponderInChain setNextResponder:self];
+ return self;
+}
+
+- (void)detach
+{
+ [_lastResponderInChain setNextResponder:nil];
+ _lastResponderInChain = nil;
+}
+
+- (BOOL)receivedUnhandledCommand
+{
+ return _receivedUnhandledCommand;
+}
+
+- (void)noResponderFor:(SEL)selector
+{
+ _receivedUnhandledCommand = YES;
+}
+
+- (void)doCommandBySelector:(SEL)selector
+{
+ _receivedUnhandledCommand = YES;
+}
+
+@end
diff --git a/WebKit/mac/WebView/WebHTMLViewInternal.h b/WebKit/mac/WebView/WebHTMLViewInternal.h
index 0fb0cdc..a32df02 100644
--- a/WebKit/mac/WebView/WebHTMLViewInternal.h
+++ b/WebKit/mac/WebView/WebHTMLViewInternal.h
@@ -58,4 +58,11 @@ namespace WebCore {
- (void)setPromisedDragTIFFDataSource:(WebCore::CachedImage*)source;
- (void)_web_layoutIfNeededRecursive;
- (void)_destroyAllWebPlugins;
+- (BOOL)_isResigningFirstResponder;
+
+#if USE(ACCELERATED_COMPOSITING)
+- (void)attachRootLayer:(CALayer*)layer;
+- (void)detachRootLayer;
+#endif
+
@end
diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h
index 40de97f..0d73884 100644
--- a/WebKit/mac/WebView/WebHTMLViewPrivate.h
+++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h
@@ -119,6 +119,7 @@
// SPI for DumpRenderTree
- (void)_updateFocusedAndActiveState;
+- (BOOL)_isUsingAcceleratedCompositing;
// SPI for printing (should be converted to API someday). When the WebHTMLView isn't being printed
// directly, this method must be called before paginating, or the computed height might be incorrect.
diff --git a/WebKit/mac/WebView/WebPDFRepresentation.m b/WebKit/mac/WebView/WebPDFRepresentation.m
index 1a2ddab..7eae380 100644
--- a/WebKit/mac/WebView/WebPDFRepresentation.m
+++ b/WebKit/mac/WebView/WebPDFRepresentation.m
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebDataSource.h>
+#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebFrameView.h>
#import <WebKit/WebNSObjectExtras.h>
@@ -111,7 +111,7 @@
NSData *data = [dataSource data];
NSArray *postScriptMIMETypes = [[self class] postScriptMIMETypes];
- NSString *mimeType = [[dataSource response] MIMEType];
+ NSString *mimeType = [dataSource _responseMIMEType];
if ([postScriptMIMETypes containsObject:mimeType]) {
data = [self convertPostScriptDataSourceToPDF:data];
if ([data length] == 0)
diff --git a/WebKit/mac/WebView/WebPDFView.mm b/WebKit/mac/WebView/WebPDFView.mm
index 2cb5374..0c872b9 100644
--- a/WebKit/mac/WebView/WebPDFView.mm
+++ b/WebKit/mac/WebView/WebPDFView.mm
@@ -341,7 +341,7 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
NSString *appName = nil;
NSImage *appIcon = nil;
- _applicationInfoForMIMEType([[dataSource response] MIMEType], &appName, &appIcon);
+ _applicationInfoForMIMEType([dataSource _responseMIMEType], &appName, &appIcon);
if (!appName)
appName = UI_STRING("Finder", "Default application name for Open With context menu");
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 98daec0..e22113c 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -41,6 +41,7 @@
#define WebKitDefaultFontSizePreferenceKey @"WebKitDefaultFontSize"
#define WebKitDefaultFixedFontSizePreferenceKey @"WebKitDefaultFixedFontSize"
#define WebKitDefaultTextEncodingNamePreferenceKey @"WebKitDefaultTextEncodingName"
+#define WebKitUsesEncodingDetectorPreferenceKey @"WebKitUsesEncodingDetector"
#define WebKitUserStyleSheetEnabledPreferenceKey @"WebKitUserStyleSheetEnabledPreferenceKey"
#define WebKitUserStyleSheetLocationPreferenceKey @"WebKitUserStyleSheetLocationPreferenceKey"
#define WebKitShouldPrintBackgroundsPreferenceKey @"WebKitShouldPrintBackgroundsPreferenceKey"
@@ -48,6 +49,8 @@
#define WebKitShrinksStandaloneImagesToFitPreferenceKey @"WebKitShrinksStandaloneImagesToFit"
#define WebKitJavaEnabledPreferenceKey @"WebKitJavaEnabled"
#define WebKitJavaScriptEnabledPreferenceKey @"WebKitJavaScriptEnabled"
+#define WebKitWebSecurityEnabledPreferenceKey @"WebKitWebSecurityEnabled"
+#define WebKitAllowUniversalAccessFromFileURLsPreferenceKey @"WebKitAllowUniversalAccessFromFileURLs"
#define WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey @"WebKitJavaScriptCanOpenWindowsAutomatically"
#define WebKitPluginsEnabledPreferenceKey @"WebKitPluginsEnabled"
#define WebKitDatabasesEnabledPreferenceKey @"WebKitDatabasesEnabledPreferenceKey"
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index e595861..6db14bd 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -306,6 +306,7 @@ static WebCacheModel cacheModelForMainBundle(void)
@"16", WebKitDefaultFontSizePreferenceKey,
@"13", WebKitDefaultFixedFontSizePreferenceKey,
@"ISO-8859-1", WebKitDefaultTextEncodingNamePreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitUsesEncodingDetectorPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUserStyleSheetEnabledPreferenceKey,
@"", WebKitUserStyleSheetLocationPreferenceKey,
[NSNumber numberWithBool:NO], WebKitShouldPrintBackgroundsPreferenceKey,
@@ -313,6 +314,8 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitShrinksStandaloneImagesToFitPreferenceKey,
[NSNumber numberWithBool:YES], WebKitJavaEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitJavaScriptEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitWebSecurityEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitAllowUniversalAccessFromFileURLsPreferenceKey,
[NSNumber numberWithBool:YES], WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
[NSNumber numberWithBool:YES], WebKitPluginsEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitDatabasesEnabledPreferenceKey,
@@ -663,7 +666,7 @@ static WebCacheModel cacheModelForMainBundle(void)
return [self _boolValueForKey: WebKitAllowAnimatedImagesPreferenceKey];
}
-- (void)setAllowsAnimatedImages:(BOOL)flag;
+- (void)setAllowsAnimatedImages:(BOOL)flag
{
[self _setBoolValue: flag forKey: WebKitAllowAnimatedImagesPreferenceKey];
}
@@ -688,7 +691,7 @@ static WebCacheModel cacheModelForMainBundle(void)
return [self _boolValueForKey: WebKitDisplayImagesKey];
}
-- (void)setAutosaves:(BOOL)flag;
+- (void)setAutosaves:(BOOL)flag
{
_private->autosaves = flag;
}
@@ -862,6 +865,36 @@ static WebCacheModel cacheModelForMainBundle(void)
_private->automaticallyDetectsCacheModel = automaticallyDetectsCacheModel;
}
+- (BOOL)usesEncodingDetector
+{
+ return [self _boolValueForKey: WebKitUsesEncodingDetectorPreferenceKey];
+}
+
+- (void)setUsesEncodingDetector:(BOOL)flag
+{
+ [self _setBoolValue: flag forKey: WebKitUsesEncodingDetectorPreferenceKey];
+}
+
+- (BOOL)isWebSecurityEnabled
+{
+ return [self _boolValueForKey: WebKitWebSecurityEnabledPreferenceKey];
+}
+
+- (void)setWebSecurityEnabled:(BOOL)flag
+{
+ [self _setBoolValue: flag forKey: WebKitWebSecurityEnabledPreferenceKey];
+}
+
+- (BOOL)allowUniversalAccessFromFileURLs
+{
+ return [self _boolValueForKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey];
+}
+
+- (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag
+{
+ [self _setBoolValue: flag forKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey];
+}
+
- (NSTimeInterval)_backForwardCacheExpirationInterval
{
// FIXME: There's probably no good reason to read from the standard user defaults instead of self.
@@ -878,7 +911,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[self _setFloatValue:factor forKey:WebKitPDFScaleFactorPreferenceKey];
}
-- (PDFDisplayMode)PDFDisplayMode;
+- (PDFDisplayMode)PDFDisplayMode
{
PDFDisplayMode value = [self _integerValueForKey:WebKitPDFDisplayModePreferenceKey];
if (value != kPDFDisplaySinglePage && value != kPDFDisplaySinglePageContinuous && value != kPDFDisplayTwoUp && value != kPDFDisplayTwoUpContinuous) {
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 99ff49c..ae94cce 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -59,6 +59,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)applicationChromeModeEnabled;
- (void)setApplicationChromeModeEnabled:(BOOL)flag;
+- (BOOL)usesEncodingDetector;
+- (void)setUsesEncodingDetector:(BOOL)flag;
+
- (BOOL)respectStandardStyleKeyEquivalents;
- (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
@@ -89,6 +92,12 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)localStorageEnabled;
- (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
+- (BOOL)isWebSecurityEnabled;
+- (void)setWebSecurityEnabled:(BOOL)flag;
+
+- (BOOL)allowUniversalAccessFromFileURLs;
+- (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
+
- (BOOL)zoomsTextOnly;
- (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
diff --git a/WebKit/mac/WebView/WebResource.mm b/WebKit/mac/WebView/WebResource.mm
index a5caa41..e62ed1e 100644
--- a/WebKit/mac/WebView/WebResource.mm
+++ b/WebKit/mac/WebView/WebResource.mm
@@ -121,7 +121,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
- (id)initWithCoder:(NSCoder *)decoder
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
self = [super init];
if (!self)
@@ -205,7 +205,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] data];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
if (!_private->coreResource)
return nil;
@@ -221,7 +221,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] URL];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
if (!_private->coreResource)
return nil;
@@ -236,7 +236,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] MIMEType];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
if (!_private->coreResource)
return nil;
@@ -251,7 +251,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] textEncodingName];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
if (!_private->coreResource)
return nil;
@@ -266,7 +266,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] frameName];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
if (!_private->coreResource)
return nil;
@@ -323,7 +323,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
}
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
if (!_private->coreResource)
return;
@@ -343,7 +343,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:response copyData:copyData];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
self = [super init];
if (!self)
@@ -379,7 +379,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] _suggestedFilename];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
if (!_private->coreResource)
return nil;
@@ -404,7 +404,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] _response];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
NSURLResponse *response = nil;
if (_private->coreResource)
@@ -419,7 +419,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return [[self _webkit_invokeOnMainThread] _stringValue];
#endif
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
WebCore::TextEncoding encoding;
if (_private->coreResource)
@@ -435,12 +435,14 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
#ifdef MAIL_THREAD_WORKAROUND
+static const double newMailBundleVersion = 1050.0;
+
@implementation WebResource (WebMailThreadWorkaround)
+ (BOOL)_needMailThreadWorkaroundIfCalledOffMainThread
{
- static BOOL isOldMail = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_MAIL_THREAD_WORKAROUND)
- && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mail"];
+ static BOOL isOldMail = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mail"]
+ && [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey] doubleValue] < newMailBundleVersion;
return isOldMail;
}
diff --git a/WebKit/mac/WebView/WebScriptDebugDelegate.h b/WebKit/mac/WebView/WebScriptDebugDelegate.h
index 7334127..823cc35 100644
--- a/WebKit/mac/WebView/WebScriptDebugDelegate.h
+++ b/WebKit/mac/WebView/WebScriptDebugDelegate.h
@@ -37,7 +37,7 @@
#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
typedef int WebSourceId;
#else
-typedef int WebSourceId; // FIXME <rdar://problem/6263293>: Turn this int into an intptr_t once <rdar://problem/6263297> is fixed.
+typedef intptr_t WebSourceId;
#endif
@class WebView;
diff --git a/WebKit/mac/WebView/WebScriptDebugger.mm b/WebKit/mac/WebView/WebScriptDebugger.mm
index d97cbcf..384f826 100644
--- a/WebKit/mac/WebView/WebScriptDebugger.mm
+++ b/WebKit/mac/WebView/WebScriptDebugger.mm
@@ -94,7 +94,9 @@ void WebScriptDebugger::initGlobalCallFrame(const DebuggerCallFrame& debuggerCal
m_globalCallFrame = m_topCallFrame;
WebView *webView = [webFrame webView];
- [[webView _scriptDebugDelegateForwarder] webView:webView didEnterCallFrame:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(0) line:-1 forWebFrame:webFrame];
+ WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView);
+ if (implementations->didEnterCallFrameFunc)
+ CallScriptDebugDelegate(implementations->didEnterCallFrameFunc, webView, @selector(webView:didEnterCallFrame:sourceId:line:forWebFrame:), m_topCallFrame.get(), static_cast<NSInteger>(0), -1, webFrame);
m_callingDelegate = false;
}
@@ -112,14 +114,23 @@ void WebScriptDebugger::sourceParsed(ExecState* exec, const SourceCode& source,
WebFrame *webFrame = toWebFrame(exec->dynamicGlobalObject());
WebView *webView = [webFrame webView];
+ WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView);
+
if (errorLine == -1) {
- [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:nsSource baseLineNumber:source.firstLine() fromURL:nsURL sourceId:static_cast<WebSourceId>(source.provider()->asID()) forWebFrame:webFrame];
- [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:nsSource fromURL:[nsURL absoluteString] sourceId:static_cast<WebSourceId>(source.provider()->asID()) forWebFrame:webFrame]; // deprecated delegate method
+ if (implementations->didParseSourceFunc) {
+ if (implementations->didParseSourceExpectsBaseLineNumber)
+ CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:), nsSource, source.firstLine(), nsURL, source.provider()->asID(), webFrame);
+ else
+ CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:), nsSource, [nsURL absoluteString], source.provider()->asID(), webFrame);
+ }
} else {
NSString* nsErrorMessage = toNSString(errorMsg);
NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:nsErrorMessage, WebScriptErrorDescriptionKey, [NSNumber numberWithUnsignedInt:errorLine], WebScriptErrorLineNumberKey, nil];
NSError *error = [[NSError alloc] initWithDomain:WebScriptErrorDomain code:WebScriptGeneralErrorCode userInfo:info];
- [[webView _scriptDebugDelegateForwarder] webView:webView failedToParseSource:nsSource baseLineNumber:source.firstLine() fromURL:nsURL withError:error forWebFrame:webFrame];
+
+ if (implementations->failedToParseSourceFunc)
+ CallScriptDebugDelegate(implementations->failedToParseSourceFunc, webView, @selector(webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:), nsSource, source.firstLine(), nsURL, error, webFrame);
+
[error release];
[info release];
}
@@ -139,7 +150,9 @@ void WebScriptDebugger::callEvent(const DebuggerCallFrame& debuggerCallFrame, in
m_topCallFrame.adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script()->windowScriptObject() debugger:this caller:m_topCallFrame.get() debuggerCallFrame:debuggerCallFrame]);
WebView *webView = [webFrame webView];
- [[webView _scriptDebugDelegateForwarder] webView:webView didEnterCallFrame:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame];
+ WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView);
+ if (implementations->didEnterCallFrameFunc)
+ CallScriptDebugDelegate(implementations->didEnterCallFrameFunc, webView, @selector(webView:didEnterCallFrame:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame);
m_callingDelegate = false;
}
@@ -155,7 +168,10 @@ void WebScriptDebugger::atStatement(const DebuggerCallFrame& debuggerCallFrame,
WebView *webView = [webFrame webView];
[m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame];
- [[webView _scriptDebugDelegateForwarder] webView:webView willExecuteStatement:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame];
+
+ WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView);
+ if (implementations->willExecuteStatementFunc)
+ CallScriptDebugDelegate(implementations->willExecuteStatementFunc, webView, @selector(webView:willExecuteStatement:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame);
m_callingDelegate = false;
}
@@ -171,7 +187,10 @@ void WebScriptDebugger::returnEvent(const DebuggerCallFrame& debuggerCallFrame,
WebView *webView = [webFrame webView];
[m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame];
- [[webView _scriptDebugDelegateForwarder] webView:webView willLeaveCallFrame:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame];
+
+ WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView);
+ if (implementations->willLeaveCallFrameFunc)
+ CallScriptDebugDelegate(implementations->willLeaveCallFrameFunc, webView, @selector(webView:willLeaveCallFrame:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame);
[m_topCallFrame.get() _clearDebuggerCallFrame];
m_topCallFrame = [m_topCallFrame.get() caller];
@@ -190,7 +209,9 @@ void WebScriptDebugger::exception(const DebuggerCallFrame& debuggerCallFrame, in
WebView *webView = [webFrame webView];
[m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame];
- [[webView _scriptDebugDelegateForwarder] webView:webView exceptionWasRaised:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame];
+ WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView);
+ if (implementations->exceptionWasRaisedFunc)
+ CallScriptDebugDelegate(implementations->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame);
m_callingDelegate = false;
}
diff --git a/WebKit/mac/WebView/WebTextIterator.h b/WebKit/mac/WebView/WebTextIterator.h
index ab5ca4e..d0c92f9 100644
--- a/WebKit/mac/WebView/WebTextIterator.h
+++ b/WebKit/mac/WebView/WebTextIterator.h
@@ -44,7 +44,9 @@
/*!
@method advance
- @abstract Makes the WebTextIterator iterate to the next visible text element.
+ @abstract Moves the WebTextIterator to the next bit of text or boundary between runs of text.
+ The iterator can break up runs of text however it finds convenient, so clients need to handle
+ text runs that are broken up into arbitrary pieces.
*/
- (void)advance;
@@ -55,22 +57,30 @@
- (BOOL)atEnd;
/*!
- @method currentRange
- @result A range, indicating the position within the document of the current text.
+ @method currentTextLength
+ @result Length of the current text. Length of zero means that the iterator is at a boundary,
+ such as an image, that separates runs of text.
*/
-- (DOMRange *)currentRange;
+- (WebNSUInteger)currentTextLength;
/*!
@method currentTextPointer
- @result A pointer to the current text. The pointer becomes invalid after any modification is made to the document; it must be used right away.
+ @result A pointer to the current text. Like the WebTextIterator itself, the pointer becomes
+ invalid after any modification is made to the document; it must be used before the document
+ is changed or the iterator is advanced.
*/
- (const unichar *)currentTextPointer;
/*!
- @method currentTextLength
- @result lengthPtr Length of the current text.
+ @method currentRange
+ @abstract A function that identifies the specific document range that text corresponds to.
+ This can be quite costly to compute for non-text items, so when possible this should only
+ be called once the caller has determined that the text is text it wants to process. If you
+ call currentRange every time you advance the iterator, performance will be extremely slow
+ due to the cost of computing a DOM range.
+ @result A DOM range indicating the position within the document of the current text.
*/
-- (WebNSUInteger)currentTextLength;
+- (DOMRange *)currentRange;
@end
diff --git a/WebKit/mac/WebView/WebUIDelegate.h b/WebKit/mac/WebView/WebUIDelegate.h
index 8440bcb..c3dd9ff 100644
--- a/WebKit/mac/WebView/WebUIDelegate.h
+++ b/WebKit/mac/WebView/WebUIDelegate.h
@@ -133,7 +133,7 @@ typedef enum {
@abstract Call this method to return an array of filenames from the file open panel.
@param fileNames
*/
-- (void)chooseFilenames:(NSArray *)fileNames WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_AFTER_WEBKIT_VERSION_3_1);
+- (void)chooseFilenames:(NSArray *)fileNames WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
/*!
@method cancel
@@ -419,7 +419,7 @@ typedef enum {
@discussion This method is passed a callback object instead of giving a return
value so that it can be handled with a sheet.
*/
-- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener allowMultipleFiles:(BOOL)allowMultipleFiles WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_AFTER_WEBKIT_VERSION_3_1);
+- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener allowMultipleFiles:(BOOL)allowMultipleFiles WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
/*!
@method webView:mouseDidMoveOverElement:modifierFlags:
diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h
index bb4d780..8e67963 100644
--- a/WebKit/mac/WebView/WebUIDelegatePrivate.h
+++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -74,6 +74,7 @@ enum {
WebMenuItemTagTextDirectionRightToLeft,
WebMenuItemTagBaseApplication = 10000
};
+@class WebGeolocation;
@class WebSecurityOrigin;
@interface NSObject (WebUIDelegatePrivate)
@@ -109,5 +110,7 @@ enum {
- (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename;
- (NSString *)webView:(WebView *)sender generateReplacementFile:(NSString *)path;
-
+
+- (BOOL)webView:(WebView *)sender frame:(WebFrame *)frame requestGeolocationPermission:(WebGeolocation *)geolocation securityOrigin:(WebSecurityOrigin *)origin;
+
@end
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index d3bbf4e..de3628a 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -39,7 +39,6 @@
#import "WebDatabaseManagerInternal.h"
#import "WebDefaultEditingDelegate.h"
#import "WebDefaultPolicyDelegate.h"
-#import "WebDefaultScriptDebugDelegate.h"
#import "WebDefaultUIDelegate.h"
#import "WebDocument.h"
#import "WebDocumentInternal.h"
@@ -84,6 +83,7 @@
#import "WebPolicyDelegate.h"
#import "WebPreferenceKeysPrivate.h"
#import "WebPreferencesPrivate.h"
+#import "WebScriptDebugDelegate.h"
#import "WebTextIterator.h"
#import "WebUIDelegate.h"
#import "WebUIDelegatePrivate.h"
@@ -92,6 +92,7 @@
#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/Cache.h>
#import <WebCore/ColorMac.h>
+#import <WebCore/Cursor.h>
#import <WebCore/Document.h>
#import <WebCore/DocumentLoader.h>
#import <WebCore/DragController.h>
@@ -128,15 +129,14 @@
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMPrivate.h>
#import <WebKitSystemInterface.h>
+#import <mach-o/dyld.h>
+#import <objc/objc-auto.h>
+#import <objc/objc-runtime.h>
#import <runtime/ArrayPrototype.h>
#import <runtime/DateInstance.h>
#import <runtime/InitializeThreading.h>
#import <runtime/JSLock.h>
#import <runtime/JSValue.h>
-#import <mach-o/dyld.h>
-#import <objc/objc-auto.h>
-#import <objc/objc-runtime.h>
-#import <runtime/InitializeThreading.h>
#import <wtf/Assertions.h>
#import <wtf/HashTraits.h>
#import <wtf/RefCountedLeakCounter.h>
@@ -232,6 +232,10 @@ macro(moveToEndOfParagraph) \
macro(moveToEndOfParagraphAndModifySelection) \
macro(moveToEndOfSentence) \
macro(moveToEndOfSentenceAndModifySelection) \
+macro(moveToLeftEndOfLine) \
+macro(moveToLeftEndOfLineAndModifySelection) \
+macro(moveToRightEndOfLine) \
+macro(moveToRightEndOfLineAndModifySelection) \
macro(moveUp) \
macro(moveUpAndModifySelection) \
macro(moveWordBackward) \
@@ -287,6 +291,11 @@ macro(yankAndSelect) \
#define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode")
#define UniversalAccessDomain CFSTR("com.apple.universalaccess")
+#if USE(ACCELERATED_COMPOSITING)
+#define UsingAcceleratedCompositingProperty @"_isUsingAcceleratedCompositing"
+#endif
+
+
static BOOL s_didSetCacheModel;
static WebCacheModel s_cacheModel = WebCacheModelDocumentViewer;
@@ -340,7 +349,6 @@ static const char webViewIsOpen[] = "At least one WebView is still open.";
id editingDelegate;
id editingDelegateForwarder;
id scriptDebugDelegate;
- id scriptDebugDelegateForwarder;
WebInspector *inspector;
WebNodeHighlight *currentNodeHighlight;
@@ -362,6 +370,7 @@ static const char webViewIsOpen[] = "At least one WebView is still open.";
WebResourceDelegateImplementationCache resourceLoadDelegateImplementations;
WebFrameLoadDelegateImplementationCache frameLoadDelegateImplementations;
+ WebScriptDebugDelegateImplementationCache scriptDebugDelegateImplementations;
void *observationInfo;
@@ -406,6 +415,14 @@ static const char webViewIsOpen[] = "At least one WebView is still open.";
// When this flag is set, we will not make any subviews underneath this WebView. This means no WebFrameViews and no WebHTMLViews.
BOOL useDocumentViews;
+
+#if USE(ACCELERATED_COMPOSITING)
+ // When this flag is set, next time a WebHTMLView draws, it needs to temporarily disable screen updates
+ // so that the NSView drawing is visually synchronized with CALayer updates.
+ BOOL needsOneShotDrawingSynchronization;
+ // Number of WebHTMLViews using accelerated compositing. Used to implement _isUsingAcceleratedCompositing.
+ int acceleratedFramesCount;
+#endif
}
@end
@@ -535,7 +552,6 @@ static BOOL grammarCheckingEnabled;
[UIDelegateForwarder release];
[frameLoadDelegateForwarder release];
[editingDelegateForwarder release];
- [scriptDebugDelegateForwarder release];
[mediaStyle release];
@@ -661,6 +677,22 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
initialized = YES;
}
+static bool runningLeopardMail()
+{
+#ifdef BUILDING_ON_LEOPARD
+ return [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mail"];
+#endif
+ return NO;
+}
+
+static bool runningTigerMail()
+{
+#ifdef BUILDING_ON_TIGER
+ return [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mail"];
+#endif
+ return NO;
+}
+
- (void)_registerDraggedTypes
{
NSArray *editableTypes = [WebHTMLView _insertablePasteboardTypes];
@@ -678,7 +710,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
{
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
#ifndef NDEBUG
WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
@@ -722,11 +754,15 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
[WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
#ifndef BUILDING_ON_TIGER
+ NSRunLoop *runLoop = [NSRunLoop mainRunLoop];
+#else
+ NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
+#endif
+
if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES))
- [self scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
+ [self scheduleInRunLoop:runLoop forMode:(NSString *)kCFRunLoopCommonModes];
else
- [self scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
-#endif
+ [self scheduleInRunLoop:runLoop forMode:NSDefaultRunLoopMode];
[self _addToAllWebViewsSet];
[self setGroupName:groupName];
@@ -905,7 +941,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
return uniqueExtensions;
}
-+ (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType;
++ (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType
{
MIMEType = [MIMEType lowercaseString];
Class viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:YES] _webkit_objectForMIMEType:MIMEType];
@@ -938,7 +974,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
return NO;
}
-- (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType;
+- (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType
{
if ([[self class] _viewClass:vClass andRepresentationClass:rClass forMIMEType:MIMEType])
return YES;
@@ -1089,7 +1125,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
// Need this to make leak messages accurate.
if (applicationIsTerminating) {
gcController().garbageCollectNow();
- [WebCache empty];
+ [WebCache setDisabled:YES];
}
#endif
}
@@ -1296,6 +1332,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
settings->setDefaultFixedFontSize([preferences defaultFixedFontSize]);
settings->setDefaultFontSize([preferences defaultFontSize]);
settings->setDefaultTextEncodingName([preferences defaultTextEncodingName]);
+ settings->setUsesEncodingDetector([preferences usesEncodingDetector]);
settings->setFantasyFontFamily([preferences fantasyFontFamily]);
settings->setFixedFontFamily([preferences fixedFontFamily]);
settings->setForceFTPDirectoryListings([preferences _forceFTPDirectoryListings]);
@@ -1303,6 +1340,8 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
settings->setLocalStorageDatabasePath([preferences _localStorageDatabasePath]);
settings->setJavaEnabled([preferences isJavaEnabled]);
settings->setJavaScriptEnabled([preferences isJavaScriptEnabled]);
+ settings->setWebSecurityEnabled([preferences isWebSecurityEnabled]);
+ settings->setAllowUniversalAccessFromFileURLs([preferences allowUniversalAccessFromFileURLs]);
settings->setJavaScriptCanOpenWindowsAutomatically([preferences javaScriptCanOpenWindowsAutomatically]);
settings->setMinimumFontSize([preferences minimumFontSize]);
settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]);
@@ -1332,15 +1371,13 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
settings->setUserStyleSheetLocation([NSURL URLWithString:@""]);
settings->setNeedsAdobeFrameReloadingQuirk([self _needsAdobeFrameReloadingQuirk]);
settings->setNeedsKeyboardEventDisambiguationQuirks([self _needsKeyboardEventDisambiguationQuirks]);
+ settings->setNeedsLeopardMailQuirks(runningLeopardMail());
+ settings->setNeedsTigerMailQuirks(runningTigerMail());
settings->setNeedsSiteSpecificQuirks(_private->useSiteSpecificSpoofing);
settings->setWebArchiveDebugModeEnabled([preferences webArchiveDebugModeEnabled]);
- settings->disableRangeMutationForOldAppleMail(WKAppVersionCheckLessThan(@"com.apple.mail", -1, 4.0));
settings->setOfflineWebApplicationCacheEnabled([preferences offlineWebApplicationCacheEnabled]);
settings->setZoomsTextOnly([preferences zoomsTextOnly]);
settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
-#ifdef BUILDING_ON_LEOPARD
- settings->setNeedsIChatMemoryCacheCallsQuirk([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.iChat"]);
-#endif
}
static inline IMP getMethod(id o, SEL s)
@@ -1418,6 +1455,37 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return &webView->_private->frameLoadDelegateImplementations;
}
+- (void)_cacheScriptDebugDelegateImplementations
+{
+ WebScriptDebugDelegateImplementationCache *cache = &_private->scriptDebugDelegateImplementations;
+ id delegate = _private->scriptDebugDelegate;
+
+ if (!delegate) {
+ bzero(cache, sizeof(WebScriptDebugDelegateImplementationCache));
+ return;
+ }
+
+ cache->didParseSourceFunc = getMethod(delegate, @selector(webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:));
+ if (cache->didParseSourceFunc)
+ cache->didParseSourceExpectsBaseLineNumber = YES;
+ else
+ cache->didParseSourceFunc = getMethod(delegate, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:));
+
+ cache->failedToParseSourceFunc = getMethod(delegate, @selector(webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:));
+ cache->didEnterCallFrameFunc = getMethod(delegate, @selector(webView:didEnterCallFrame:sourceId:line:forWebFrame:));
+ cache->willExecuteStatementFunc = getMethod(delegate, @selector(webView:willExecuteStatement:sourceId:line:forWebFrame:));
+ cache->willLeaveCallFrameFunc = getMethod(delegate, @selector(webView:willLeaveCallFrame:sourceId:line:forWebFrame:));
+ cache->exceptionWasRaisedFunc = getMethod(delegate, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:));
+}
+
+WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *webView)
+{
+ static WebScriptDebugDelegateImplementationCache empty;
+ if (!webView)
+ return &empty;
+ return &webView->_private->scriptDebugDelegateImplementations;
+}
+
- (id)_policyDelegateForwarder
{
if (!_private->policyDelegateForwarder)
@@ -1444,19 +1512,12 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return _private->editingDelegateForwarder;
}
-- (id)_scriptDebugDelegateForwarder
-{
- if (!_private->scriptDebugDelegateForwarder)
- _private->scriptDebugDelegateForwarder = [[_WebSafeForwarder alloc] initWithTarget:_private->scriptDebugDelegate defaultTarget:[WebDefaultScriptDebugDelegate sharedScriptDebugDelegate] catchExceptions:_private->catchesDelegateExceptions];
- return _private->scriptDebugDelegateForwarder;
-}
-
- (void)_closeWindow
{
[[self _UIDelegateForwarder] webViewClose:self];
}
-+ (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType;
++ (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType
{
[[WebFrameView _viewTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType];
[[WebDataSource _repTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType];
@@ -1467,7 +1528,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
MIMETypeRegistry::getSupportedNonImageMIMETypes().remove(MIMEType);
}
-+ (void)_registerViewClass:(Class)viewClass representationClass:(Class)representationClass forURLScheme:(NSString *)URLScheme;
++ (void)_registerViewClass:(Class)viewClass representationClass:(Class)representationClass forURLScheme:(NSString *)URLScheme
{
NSString *MIMEType = [self _generatedMIMETypeForURLScheme:URLScheme];
[self registerViewClass:viewClass representationClass:representationClass forMIMEType:MIMEType];
@@ -1559,7 +1620,11 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
static NSSet *manualNotifyKeys = nil;
if (!manualNotifyKeys)
manualNotifyKeys = [[NSSet alloc] initWithObjects:_WebMainFrameURLKey, _WebIsLoadingKey, _WebEstimatedProgressKey,
- _WebCanGoBackKey, _WebCanGoForwardKey, _WebMainFrameTitleKey, _WebMainFrameIconKey, _WebMainFrameDocumentKey, nil];
+ _WebCanGoBackKey, _WebCanGoForwardKey, _WebMainFrameTitleKey, _WebMainFrameIconKey, _WebMainFrameDocumentKey,
+#if USE(ACCELERATED_COMPOSITING)
+ UsingAcceleratedCompositingProperty, // used by DRT
+#endif
+ nil];
if ([manualNotifyKeys containsObject:key])
return NO;
return YES;
@@ -1994,9 +2059,9 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
if (!coreFrame)
return nil;
- Selection selectionInsideRect(coreFrame->visiblePositionForPoint(rectStart), coreFrame->visiblePositionForPoint(rectEnd));
+ VisibleSelection selectionInsideRect(coreFrame->visiblePositionForPoint(rectStart), coreFrame->visiblePositionForPoint(rectEnd));
- return [[[WebTextIterator alloc] initWithRange:[DOMRange _wrapRange:selectionInsideRect.toRange().get()]] autorelease];
+ return [[[WebTextIterator alloc] initWithRange:[DOMRange _wrapRange:selectionInsideRect.toNormalizedRange().get()]] autorelease];
}
- (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
@@ -2071,6 +2136,59 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return _private->page->areMemoryCacheClientCallsEnabled();
}
+- (void)_setJavaScriptURLsAreAllowed:(BOOL)areAllowed
+{
+ _private->page->setJavaScriptURLsAreAllowed(areAllowed);
+}
+
++ (NSCursor *)_pointingHandCursor
+{
+ return handCursor().impl();
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+- (BOOL)_needsOneShotDrawingSynchronization
+{
+ return _private->needsOneShotDrawingSynchronization;
+}
+
+- (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization
+{
+ _private->needsOneShotDrawingSynchronization = needsSynchronization;
+}
+
+- (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame
+{
+ BOOL entering = _private->acceleratedFramesCount == 0;
+ if (entering)
+ [self willChangeValueForKey:UsingAcceleratedCompositingProperty];
+ ++_private->acceleratedFramesCount;
+ if (entering)
+ [self didChangeValueForKey:UsingAcceleratedCompositingProperty];
+}
+
+- (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame
+{
+ BOOL leaving = _private->acceleratedFramesCount == 1;
+ ASSERT(_private->acceleratedFramesCount > 0);
+
+ if (leaving)
+ [self willChangeValueForKey:UsingAcceleratedCompositingProperty];
+ --_private->acceleratedFramesCount;
+ if (leaving)
+ [self didChangeValueForKey:UsingAcceleratedCompositingProperty];
+}
+#endif
+
+- (BOOL)_isUsingAcceleratedCompositing
+{
+#if USE(ACCELERATED_COMPOSITING)
+ return _private->acceleratedFramesCount > 0;
+#else
+ return NO;
+#endif
+}
+
@end
@implementation _WebSafeForwarder
@@ -2270,9 +2388,10 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
static bool needsWebViewInitThreadWorkaround()
{
- static BOOL isOldInstaller = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND)
- && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.installer"];
- return isOldInstaller && !pthread_main_np();
+ static BOOL isOldClient = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND)
+ && ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.installer"] ||
+ [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Automator"]);
+ return isOldClient && !pthread_main_np();
}
- (id)initWithFrame:(NSRect)f
@@ -2285,7 +2404,7 @@ static bool needsWebViewInitThreadWorkaround()
if (needsWebViewInitThreadWorkaround())
return [[self _webkit_invokeOnMainThread] initWithFrame:f frameName:frameName groupName:groupName];
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
return [self _initWithFrame:f frameName:frameName groupName:groupName usesDocumentViews:YES];
}
@@ -2294,7 +2413,7 @@ static bool needsWebViewInitThreadWorkaround()
if (needsWebViewInitThreadWorkaround())
return [[self _webkit_invokeOnMainThread] initWithCoder:decoder];
- WebCoreThreadViolationCheck();
+ WebCoreThreadViolationCheckRoundTwo();
WebView *result = nil;
@try {
@@ -2500,7 +2619,8 @@ static bool needsWebViewInitThreadWorkaround()
[self removeWindowObservers];
[self removeSizeObservers];
- }
+ } else
+ _private->page->willMoveOffscreen();
}
- (void)viewDidMoveToWindow
@@ -2515,6 +2635,7 @@ static bool needsWebViewInitThreadWorkaround()
if ([self window]) {
[self addWindowObservers];
[self addSizeObservers];
+ _private->page->didMoveOnscreen();
}
}
@@ -2538,10 +2659,14 @@ static bool needsWebViewInitThreadWorkaround()
BOOL windowIsKey = [window isKeyWindow];
BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow];
- NSResponder *firstResponder = [window firstResponder];
+ WebFrameView *mainFrameView = [[self mainFrame] frameView];
+ id <WebDocumentView> documentView = [mainFrameView documentView];
+ BOOL documentViewIsResigningFirstResponder = [documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _isResigningFirstResponder];
+
+ NSResponder *firstResponder = [window firstResponder];
if ([firstResponder isKindOfClass:[NSView class]]
- && [(NSView*)firstResponder isDescendantOf:[[self mainFrame] frameView]])
- page->focusController()->setActive(windowIsKey);
+ && [(NSView *)firstResponder isDescendantOf:mainFrameView])
+ page->focusController()->setActive(windowIsKey && !documentViewIsResigningFirstResponder);
Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
frame->selection()->setFocused(frame == focusedFrame && windowOrSheetIsKey);
@@ -3001,6 +3126,11 @@ static bool needsWebViewInitThreadWorkaround()
- (NSWindow *)hostWindow
{
+ // -[WebView hostWindow] can sometimes be called from the WebView's [super dealloc] method
+ // so we check here to make sure it's not null.
+ if (!_private)
+ return nil;
+
return _private->hostWindow;
}
@@ -3522,18 +3652,14 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode
{
-#ifndef BUILDING_ON_TIGER
if (runLoop && mode)
core(self)->addSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode));
-#endif
}
- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode
{
-#ifndef BUILDING_ON_TIGER
if (runLoop && mode)
core(self)->removeSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode));
-#endif
}
- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection
@@ -3660,8 +3786,8 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
- (void)setScriptDebugDelegate:(id)delegate
{
_private->scriptDebugDelegate = delegate;
- [_private->scriptDebugDelegateForwarder release];
- _private->scriptDebugDelegateForwarder = nil;
+ [self _cacheScriptDebugDelegateImplementations];
+
if (delegate)
[self _attachScriptDebuggerToAllFrames];
else
@@ -4058,7 +4184,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValuePtr jsV
return kit(page->mainFrame()->editor()->rangeForPoint(IntPoint([self convertPoint:point toView:nil])).get());
}
-- (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
+- (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag
{
// FIXME: This quirk is needed due to <rdar://problem/4985321> - We can phase it out once Aperture can adopt the new behavior on their end
if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_APERTURE_QUIRK) && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Aperture"])
@@ -4096,7 +4222,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValuePtr jsV
Frame* coreFrame = core([self _selectedOrMainFrame]);
if (!coreFrame)
return nil;
- return kit(coreFrame->selection()->toRange().get());
+ return kit(coreFrame->selection()->toNormalizedRange().get());
}
- (NSSelectionAffinity)selectionAffinity
@@ -4370,7 +4496,7 @@ FOR_EACH_RESPONDER_SELECTOR(FORWARD)
@implementation WebView (WebViewEditingInMail)
-- (void)_insertNewlineInQuotedContent;
+- (void)_insertNewlineInQuotedContent
{
[[self _selectedOrMainFrame] _insertParagraphSeparatorInQuotedContent];
}
@@ -5148,6 +5274,20 @@ static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SE
return nil;
}
+static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer1, NSInteger integer2, id object2)
+{
+ if (!delegate)
+ return nil;
+ if (!self->_private->catchesDelegateExceptions)
+ return implementation(delegate, selector, self, object1, integer1, integer2, object2);
+ @try {
+ return implementation(delegate, selector, self, object1, integer1, integer2, object2);
+ } @catch(id exception) {
+ ReportDiscardedDelegateException(selector, exception);
+ }
+ return nil;
+}
+
static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, id object2, NSInteger integer, id object3)
{
if (!delegate)
@@ -5162,6 +5302,34 @@ static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SE
return nil;
}
+static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer1, id object2, NSInteger integer2, id object3)
+{
+ if (!delegate)
+ return nil;
+ if (!self->_private->catchesDelegateExceptions)
+ return implementation(delegate, selector, self, object1, integer1, object2, integer2, object3);
+ @try {
+ return implementation(delegate, selector, self, object1, integer1, object2, integer2, object3);
+ } @catch(id exception) {
+ ReportDiscardedDelegateException(selector, exception);
+ }
+ return nil;
+}
+
+static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer, id object2, id object3, id object4)
+{
+ if (!delegate)
+ return nil;
+ if (!self->_private->catchesDelegateExceptions)
+ return implementation(delegate, selector, self, object1, integer, object2, object3, object4);
+ @try {
+ return implementation(delegate, selector, self, object1, integer, object2, object3, object4);
+ } @catch(id exception) {
+ ReportDiscardedDelegateException(selector, exception);
+ }
+ return nil;
+}
+
static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSTimeInterval interval, id object2, id object3)
{
if (!delegate)
@@ -5303,6 +5471,26 @@ BOOL CallResourceLoadDelegateReturningBoolean(BOOL result, IMP implementation, W
return result;
}
+id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, NSInteger integer, id object3)
+{
+ return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, object2, integer, object3);
+}
+
+id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer1, id object2, NSInteger integer2, id object3)
+{
+ return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer1, object2, integer2, object3);
+}
+
+id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer, id object2, id object3, id object4)
+{
+ return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer, object2, object3, object4);
+}
+
+id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer1, NSInteger integer2, id object2)
+{
+ return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer1, integer2, object2);
+}
+
// The form delegate needs to have it's own implementation, because the first argument is never the WebView
id CallFormDelegate(WebView *self, SEL selector, id object1, id object2)
diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h
index 25afb64..ad4f19c 100644
--- a/WebKit/mac/WebView/WebViewInternal.h
+++ b/WebKit/mac/WebView/WebViewInternal.h
@@ -81,7 +81,6 @@ typedef WebCore::Page WebCorePage;
- (id)_UIDelegateForwarder;
- (id)_editingDelegateForwarder;
- (id)_policyDelegateForwarder;
-- (id)_scriptDebugDelegateForwarder;
- (void)_pushPerformingProgrammaticFocus;
- (void)_popPerformingProgrammaticFocus;
- (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response;
@@ -145,6 +144,13 @@ typedef WebCore::Page WebCorePage;
+ (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame;
+#if USE(ACCELERATED_COMPOSITING)
+- (BOOL)_needsOneShotDrawingSynchronization;
+- (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization;
+- (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame;
+- (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame;
+#endif
+
@end
typedef struct _WebResourceDelegateImplementationCache {
@@ -183,8 +189,19 @@ typedef struct _WebFrameLoadDelegateImplementationCache {
IMP didFinishDocumentLoadForFrameFunc;
} WebFrameLoadDelegateImplementationCache;
+typedef struct _WebScriptDebugDelegateImplementationCache {
+ BOOL didParseSourceExpectsBaseLineNumber;
+ IMP didParseSourceFunc;
+ IMP failedToParseSourceFunc;
+ IMP didEnterCallFrameFunc;
+ IMP willExecuteStatementFunc;
+ IMP willLeaveCallFrameFunc;
+ IMP exceptionWasRaisedFunc;
+} WebScriptDebugDelegateImplementationCache;
+
WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *webView);
WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementations(WebView *webView);
+WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *webView);
#ifdef __cplusplus
@@ -220,4 +237,9 @@ id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, NSInteger, id);
BOOL CallResourceLoadDelegateReturningBoolean(BOOL, IMP, WebView *, SEL, id, id);
+id CallScriptDebugDelegate(IMP, WebView *, SEL, id, id, NSInteger, id);
+id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, NSInteger, id);
+id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, id, id);
+id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, NSInteger, id);
+
#endif
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index 95e1249..ada0e01 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -406,6 +406,13 @@ Could be worth adding to the API.
- (void)setMemoryCacheDelegateCallsEnabled:(BOOL)suspend;
- (BOOL)areMemoryCacheDelegateCallsEnabled;
+- (void)_setJavaScriptURLsAreAllowed:(BOOL)setJavaScriptURLsAreAllowed;
+
++ (NSCursor *)_pointingHandCursor;
+
+// SPI for DumpRenderTree
+- (BOOL)_isUsingAcceleratedCompositing;
+
@end
@interface WebView (WebViewPrintingPrivate)
diff --git a/WebKit/qt/Api/qwebdatabase.h b/WebKit/qt/Api/qwebdatabase.h
index f4c368a..4e832bb 100644
--- a/WebKit/qt/Api/qwebdatabase.h
+++ b/WebKit/qt/Api/qwebdatabase.h
@@ -26,7 +26,7 @@
namespace WebCore {
class DatabaseDetails;
-};
+}
class QWebDatabasePrivate;
class QWebSecurityOrigin;
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 4e82d54..725a880 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2008,2009 Nokia Corporation and/or its subsidiary(-ies)
Copyright (C) 2007 Staikos Computing Services Inc.
This library is free software; you can redistribute it and/or
@@ -106,6 +106,63 @@ void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* qframe, bool
controller->disableProfiler();
}
+// Pause a given CSS animation or transition on the target node at a specific time.
+// If the animation or transition is already paused, it will update its pause time.
+// This method is only intended to be used for testing the CSS animation and transition system.
+bool QWEBKIT_EXPORT qt_drt_pauseAnimation(QWebFrame *qframe, const QString &animationName, double time, const QString &elementId)
+{
+ Frame* frame = QWebFramePrivate::core(qframe);
+ if (!frame)
+ return false;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return false;
+
+ Document* doc = frame->document();
+ Q_ASSERT(doc);
+
+ Node* coreNode = doc->getElementById(elementId);
+ if (!coreNode || !coreNode->renderer())
+ return false;
+
+ return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time);
+}
+
+bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame *qframe, const QString &propertyName, double time, const QString &elementId)
+{
+ Frame* frame = QWebFramePrivate::core(qframe);
+ if (!frame)
+ return false;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return false;
+
+ Document* doc = frame->document();
+ Q_ASSERT(doc);
+
+ Node* coreNode = doc->getElementById(elementId);
+ if (!coreNode || !coreNode->renderer())
+ return false;
+
+ return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time);
+}
+
+// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
+int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame *qframe)
+{
+ Frame* frame = QWebFramePrivate::core(qframe);
+ if (!frame)
+ return false;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return false;
+
+ return controller->numberOfActiveAnimations();
+}
+
void QWebFramePrivate::init(QWebFrame *qframe, WebCore::Page *webcorePage, QWebFrameData *frameData)
{
q = qframe;
@@ -224,7 +281,7 @@ QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData)
if (!frameData->url.isEmpty()) {
WebCore::ResourceRequest request(frameData->url, frameData->referrer);
- d->frame->loader()->load(request, frameData->name);
+ d->frame->loader()->load(request, frameData->name, false);
}
}
@@ -255,24 +312,48 @@ QWebFrame::~QWebFrame()
If you want to ensure that your QObjects remain accessible after loading a
new URL, you should add them in a slot connected to the
javaScriptWindowObjectCleared() signal.
+
+ The \a object will never be explicitly deleted by QtWebKit.
*/
void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object)
{
- JSC::JSLock lock(false);
- JSDOMWindow *window = toJSDOMWindow(d->frame);
- JSC::Bindings::RootObject *root = d->frame->script()->bindingRootObject();
- if (!window) {
- qDebug() << "Warning: couldn't get window object";
- return;
- }
+ addToJavaScriptWindowObject(name, object, QScriptEngine::QtOwnership);
+}
+
+/*!
+ \fn void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership own)
+ \overload
+
+ Make \a object available under \a name from within the frame's JavaScript
+ context. The \a object will be inserted as a child of the frame's window
+ object.
+
+ Qt properties will be exposed as JavaScript properties and slots as
+ JavaScript methods.
+
+ If you want to ensure that your QObjects remain accessible after loading a
+ new URL, you should add them in a slot connected to the
+ javaScriptWindowObjectCleared() signal.
+
+ The ownership of \a object is specified using \a own.
+*/
+void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership)
+{
+ JSC::JSLock lock(false);
+ JSDOMWindow* window = toJSDOMWindow(d->frame);
+ JSC::Bindings::RootObject* root = d->frame->script()->bindingRootObject();
+ if (!window) {
+ qDebug() << "Warning: couldn't get window object";
+ return;
+ }
- JSC::ExecState* exec = window->globalExec();
+ JSC::ExecState* exec = window->globalExec();
- JSC::JSObject *runtimeObject =
- JSC::Bindings::QtInstance::getQtInstance(object, root)->createRuntimeObject(exec);
+ JSC::JSObject* runtimeObject =
+ JSC::Bindings::QtInstance::getQtInstance(object, root, ownership)->createRuntimeObject(exec);
- JSC::PutPropertySlot slot;
- window->put(exec, JSC::Identifier(exec, (const UChar *) name.constData(), name.length()), runtimeObject, slot);
+ JSC::PutPropertySlot slot;
+ window->put(exec, JSC::Identifier(exec, (const UChar *) name.constData(), name.length()), runtimeObject, slot);
}
/*!
@@ -475,7 +556,7 @@ void QWebFrame::load(const QWebNetworkRequest &req)
if (!postData.isEmpty())
request.setHTTPBody(WebCore::FormData::create(postData.constData(), postData.size()));
- d->frame->loader()->load(request);
+ d->frame->loader()->load(request, false);
if (d->parentFrame())
d->page->d->insideOpenCall = false;
@@ -531,7 +612,7 @@ void QWebFrame::load(const QNetworkRequest &req,
if (!body.isEmpty())
request.setHTTPBody(WebCore::FormData::create(body.constData(), body.size()));
- d->frame->loader()->load(request);
+ d->frame->loader()->load(request, false);
if (d->parentFrame())
d->page->d->insideOpenCall = false;
@@ -556,7 +637,7 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
const QByteArray utf8 = html.toUtf8();
WTF::RefPtr<WebCore::SharedBuffer> data = WebCore::SharedBuffer::create(utf8.constData(), utf8.length());
WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), kurl);
- d->frame->loader()->load(request, substituteData);
+ d->frame->loader()->load(request, substituteData, false);
}
/*!
@@ -577,7 +658,7 @@ void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, cons
if (actualMimeType.isEmpty())
actualMimeType = QLatin1String("text/html");
WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), kurl);
- d->frame->loader()->load(request, substituteData);
+ d->frame->loader()->load(request, substituteData, false);
}
@@ -886,7 +967,7 @@ QWebHitTestResult QWebFrame::hitTestContent(const QPoint &pos) const
if (!d->frame->view() || !d->frame->contentRenderer())
return QWebHitTestResult();
- HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false);
+ HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
return QWebHitTestResult(new QWebHitTestResultPrivate(result));
}
@@ -905,6 +986,10 @@ bool QWebFrame::event(QEvent *e)
*/
void QWebFrame::print(QPrinter *printer) const
{
+ QPainter painter;
+ if (!painter.begin(printer))
+ return;
+
const qreal zoomFactorX = printer->logicalDpiX() / qt_defaultDpi();
const qreal zoomFactorY = printer->logicalDpiY() / qt_defaultDpi();
@@ -950,7 +1035,6 @@ void QWebFrame::print(QPrinter *printer) const
ascending = false;
}
- QPainter painter(printer);
painter.scale(zoomFactorX, zoomFactorY);
GraphicsContext ctx(&painter);
@@ -988,7 +1072,8 @@ void QWebFrame::print(QPrinter *printer) const
#endif // QT_NO_PRINTER
/*!
- Evaluate JavaScript defined by \a scriptSource using this frame as context.
+ Evaluates the JavaScript defined by \a scriptSource using this frame as context
+ and returns the result of the last executed statement.
\sa addToJavaScriptWindowObject(), javaScriptWindowObjectCleared()
*/
@@ -1135,6 +1220,9 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult
WebCore::Frame *wframe = hitTest.targetFrame();
if (wframe)
linkTargetFrame = QWebFramePrivate::kit(wframe);
+ Element* urlElement = hitTest.URLElement();
+ if (urlElement)
+ linkTarget = urlElement->target();
isContentEditable = hitTest.isContentEditable();
isContentSelected = hitTest.isSelected();
@@ -1279,7 +1367,22 @@ QUrl QWebHitTestResult::linkTitle() const
}
/*!
+ \since 4.6
+ Returns the name of the target frame that will load the link if it is activated.
+
+ \sa linkTargetFrame
+*/
+QString QWebHitTestResult::linkTarget() const
+{
+ if (!d)
+ return 0;
+ return d->linkTarget;
+}
+
+/*!
Returns the frame that will load the link if it is activated.
+
+ \sa linkTarget
*/
QWebFrame *QWebHitTestResult::linkTargetFrame() const
{
diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h
index e53e2b5..d0fa193 100644
--- a/WebKit/qt/Api/qwebframe.h
+++ b/WebKit/qt/Api/qwebframe.h
@@ -25,6 +25,7 @@
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
#include <QtGui/qicon.h>
+#include <QtScript/qscriptengine.h>
#if QT_VERSION >= 0x040400
#include <QtNetwork/qnetworkaccessmanager.h>
#endif
@@ -77,6 +78,7 @@ public:
QUrl linkUrl() const;
QUrl linkTitle() const;
QWebFrame *linkTargetFrame() const;
+ QString linkTarget() const;
QString alternateText() const; // for img, area, input and applet
@@ -129,6 +131,7 @@ public:
void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
void addToJavaScriptWindowObject(const QString &name, QObject *object);
+ void addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership);
QString toHtml() const;
QString toPlainText() const;
QString renderTreeDump() const;
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 30f94cf..c541cd3 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -107,6 +107,7 @@ public:
QUrl linkUrl;
QString linkTitle;
QPointer<QWebFrame> linkTargetFrame;
+ QString linkTarget;
QString alternateText;
QUrl imageUrl;
QPixmap pixmap;
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index df40fa6..ed94489 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -64,6 +64,7 @@
#include "HitTestResult.h"
#include "WindowFeatures.h"
#include "LocalizedStrings.h"
+#include "Cache.h"
#include "runtime/InitializeThreading.h"
#include <QApplication>
@@ -429,6 +430,14 @@ void QWebPagePrivate::_q_webActionTriggered(bool checked)
q->triggerAction(action, checked);
}
+#ifndef NDEBUG
+void QWebPagePrivate::_q_cleanupLeakMessages()
+{
+ // Need this to make leak messages accurate.
+ cache()->setCapacities(0, 0, 0);
+}
+#endif
+
void QWebPagePrivate::updateAction(QWebPage::WebAction action)
{
QAction *a = actions[action];
@@ -454,60 +463,35 @@ void QWebPagePrivate::updateAction(QWebPage::WebAction action)
case QWebPage::Reload:
enabled = !loader->isLoading();
break;
- case QWebPage::Cut:
- enabled = editor->canCut();
- break;
- case QWebPage::Copy:
- enabled = editor->canCopy();
- break;
- case QWebPage::Paste:
- enabled = editor->canPaste();
- break;
#ifndef QT_NO_UNDOSTACK
case QWebPage::Undo:
case QWebPage::Redo:
// those two are handled by QUndoStack
break;
#endif // QT_NO_UNDOSTACK
- case QWebPage::MoveToNextChar:
- case QWebPage::MoveToPreviousChar:
- case QWebPage::MoveToNextWord:
- case QWebPage::MoveToPreviousWord:
- case QWebPage::MoveToNextLine:
- case QWebPage::MoveToPreviousLine:
- case QWebPage::MoveToStartOfLine:
- case QWebPage::MoveToEndOfLine:
- case QWebPage::MoveToStartOfBlock:
- case QWebPage::MoveToEndOfBlock:
- case QWebPage::MoveToStartOfDocument:
- case QWebPage::MoveToEndOfDocument:
- case QWebPage::SelectNextChar:
- case QWebPage::SelectPreviousChar:
- case QWebPage::SelectNextWord:
- case QWebPage::SelectPreviousWord:
- case QWebPage::SelectNextLine:
- case QWebPage::SelectPreviousLine:
- case QWebPage::SelectStartOfLine:
- case QWebPage::SelectEndOfLine:
- case QWebPage::SelectStartOfBlock:
- case QWebPage::SelectEndOfBlock:
- case QWebPage::SelectStartOfDocument:
- case QWebPage::SelectEndOfDocument:
- case QWebPage::DeleteStartOfWord:
- case QWebPage::DeleteEndOfWord:
+ case QWebPage::SelectAll: // editor command is always enabled
+ break;
case QWebPage::SetTextDirectionDefault:
case QWebPage::SetTextDirectionLeftToRight:
case QWebPage::SetTextDirectionRightToLeft:
- case QWebPage::ToggleBold:
- case QWebPage::ToggleItalic:
- case QWebPage::ToggleUnderline:
- enabled = editor->canEditRichly();
- if (enabled)
- checked = editor->command(editorCommandForWebActions(action)).state() != FalseTriState;
- else
- checked = false;
+ enabled = editor->canEdit();
+ checked = false;
+ break;
+ default: {
+ // see if it's an editor command
+ const char* commandName = editorCommandForWebActions(action);
+
+ // if it's an editor command, let it's logic determine state
+ if (commandName) {
+ Editor::Command command = editor->command(commandName);
+ enabled = command.isEnabled();
+ if (enabled)
+ checked = command.state() != FalseTriState;
+ else
+ checked = false;
+ }
break;
- default: break;
+ }
}
a->setEnabled(enabled);
@@ -561,6 +545,8 @@ void QWebPagePrivate::updateEditorActions()
updateAction(QWebPage::ToggleBold);
updateAction(QWebPage::ToggleItalic);
updateAction(QWebPage::ToggleUnderline);
+ updateAction(QWebPage::InsertParagraphSeparator);
+ updateAction(QWebPage::InsertLineSeparator);
}
void QWebPagePrivate::timerEvent(QTimerEvent *ev)
@@ -1052,9 +1038,9 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
case Qt::ImCursorPosition: {
Frame *frame = d->page->focusController()->focusedFrame();
if (frame) {
- Selection selection = frame->selection()->selection();
+ VisibleSelection selection = frame->selection()->selection();
if (selection.isCaret()) {
- return QVariant(selection.start().offset());
+ return QVariant(selection.start().m_offset);
}
}
return QVariant();
@@ -1119,8 +1105,13 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
\enum QWebPage::WebAction
This enum describes the types of action which can be performed on the web page.
- Actions which are related to text editing, cursor movement, and text selection
- only have an effect if \l contentEditable is true.
+
+ Actions only have an effect when they are applicable. The availability of
+ actions can be be determined by checking \l{QAction::}{enabled()} on the
+ action returned by \l{QWebPage::}{action()}.
+
+ One method of enabling the text editing, cursor movement, and text selection actions
+ is by setting \l contentEditable to true.
\value NoWebAction No action is triggered.
\value OpenLink Open the current link.
@@ -1251,6 +1242,9 @@ QWebPage::QWebPage(QObject *parent)
setView(qobject_cast<QWidget *>(parent));
connect(this, SIGNAL(loadProgress(int)), this, SLOT(_q_onLoadProgressChanged(int)));
+#ifndef NDEBUG
+ connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(_q_cleanupLeakMessages()));
+#endif
}
/*!
@@ -1340,7 +1334,7 @@ void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber,
void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
{
#ifndef QT_NO_MESSAGEBOX
- QMessageBox::information(d->view, mainFrame()->title(), msg, QMessageBox::Ok);
+ QMessageBox::information(d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
#endif
}
@@ -1355,7 +1349,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
#ifdef QT_NO_MESSAGEBOX
return true;
#else
- return QMessageBox::Yes == QMessageBox::information(d->view, mainFrame()->title(), msg, QMessageBox::Yes, QMessageBox::No);
+ return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No);
#endif
}
@@ -1372,7 +1366,7 @@ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QStr
{
bool ok = false;
#ifndef QT_NO_INPUTDIALOG
- QString x = QInputDialog::getText(d->view, mainFrame()->title(), msg, QLineEdit::Normal, defaultValue, &ok);
+ QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);
if (ok && result) {
*result = x;
}
@@ -1471,9 +1465,16 @@ void QWebPage::triggerAction(WebAction action, bool checked)
openNewWindow(url, frame);
break;
}
- case CopyLinkToClipboard:
+ case CopyLinkToClipboard: {
+#if defined(Q_WS_X11)
+ bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
+ Pasteboard::generalPasteboard()->setSelectionMode(true);
+ editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText());
+ Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
+#endif
editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText());
break;
+ }
case OpenImageInNewWindow:
openNewWindow(d->hitTestResult.imageUrl(), frame);
break;
@@ -1550,7 +1551,7 @@ void QWebPage::setViewportSize(const QSize &size) const
if (frame->d->frame && frame->d->frame->view()) {
WebCore::FrameView* view = frame->d->frame->view();
view->setFrameRect(QRect(QPoint(0, 0), size));
- frame->d->frame->forceLayout();
+ view->forceLayout();
view->adjustViewSize();
}
}
@@ -1580,7 +1581,7 @@ void QWebPage::setFixedLayoutSize(const QSize &size) const
if (frame->d->frame && frame->d->frame->view()) {
WebCore::FrameView* view = frame->d->frame->view();
view->setFixedLayoutSize(size);
- frame->d->frame->forceLayout();
+ view->forceLayout();
}
}
@@ -1602,7 +1603,7 @@ void QWebPage::setUseFixedLayout(bool useFixedLayout)
if (frame->d->frame && frame->d->frame->view()) {
WebCore::FrameView* view = frame->d->frame->view();
view->setUseFixedLayout(useFixedLayout);
- frame->d->frame->forceLayout();
+ view->forceLayout();
}
}
@@ -1632,7 +1633,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkReques
return true;
case DelegateExternalLinks:
- if (WebCore::FrameLoader::shouldTreatSchemeAsLocal(request.url().scheme()))
+ if (WebCore::FrameLoader::shouldTreatURLSchemeAsLocal(request.url().scheme()))
return true;
emit linkClicked(request.url());
return false;
@@ -1790,6 +1791,9 @@ QAction *QWebPage::action(WebAction action) const
case MoveToEndOfDocument:
text = tr("Move the cursor to the end of the document");
break;
+ case SelectAll:
+ text = tr("Select all");
+ break;
case SelectNextChar:
text = tr("Select to the next character");
break;
@@ -1862,6 +1866,13 @@ QAction *QWebPage::action(WebAction action) const
text = contextMenuItemTagInspectElement();
break;
+ case InsertParagraphSeparator:
+ text = tr("Insert a new paragraph");
+ break;
+ case InsertLineSeparator:
+ text = tr("Insert a new line");
+ break;
+
case NoWebAction:
return 0;
}
@@ -2389,7 +2400,8 @@ QWebPluginFactory *QWebPage::pluginFactory() const
\list
\o %Platform% and %Subplatform% are expanded to the windowing system and the operation system.
\o %Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true.
- \o %Locale% is replaced with QLocale::name().
+ \o %Locale% is replaced with QLocale::name(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage,
+ then a default constructed QLocale is used instead.
\o %WebKitVersion% currently expands to 527+
\o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version.
\endlist
@@ -2577,7 +2589,7 @@ void QWebPagePrivate::_q_onLoadProgressChanged(int) {
\sa bytesReceived()
*/
quint64 QWebPage::totalBytes() const {
- return d->m_bytesReceived;
+ return d->m_totalBytes;
}
@@ -2587,7 +2599,7 @@ quint64 QWebPage::totalBytes() const {
\sa totalBytes()
*/
quint64 QWebPage::bytesReceived() const {
- return d->m_totalBytes;
+ return d->m_bytesReceived;
}
/*!
@@ -2621,10 +2633,13 @@ quint64 QWebPage::bytesReceived() const {
/*!
\fn void QWebPage::linkHovered(const QString &link, const QString &title, const QString &textContent)
- This signal is emitted when the mouse is hovering over a link.
- The first parameter is the \a link url, the second is the link \a title
- if any, and third \a textContent is the text content. Method is emitter with both
- empty parameters when the mouse isn't hovering over any link element.
+ This signal is emitted when the mouse hovers over a link.
+
+ \a link contains the link url.
+ \a title is the link element's title, if it is specified in the markup.
+ \a textContent provides text within the link element, e.g., text inside an HTML anchor tag.
+
+ When the mouse leaves the link element the signal is emitted with empty parameters.
\sa linkClicked()
*/
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index 2bbbc2a..2853fcc 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -325,6 +325,9 @@ protected:
private:
Q_PRIVATE_SLOT(d, void _q_onLoadProgressChanged(int))
Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked))
+#ifndef NDEBUG
+ Q_PRIVATE_SLOT(d, void _q_cleanupLeakMessages())
+#endif
QWebPagePrivate *d;
friend class QWebFrame;
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index fd915a2..a897bf1 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -79,6 +79,9 @@ public:
void _q_onLoadProgressChanged(int);
void _q_webActionTriggered(bool checked);
+#ifndef NDEBUG
+ void _q_cleanupLeakMessages();
+#endif
void updateAction(QWebPage::WebAction action);
void updateNavigationActions();
void updateEditorActions();
diff --git a/WebKit/qt/Api/qwebsecurityorigin.h b/WebKit/qt/Api/qwebsecurityorigin.h
index ebe4a77..b52194d 100644
--- a/WebKit/qt/Api/qwebsecurityorigin.h
+++ b/WebKit/qt/Api/qwebsecurityorigin.h
@@ -28,7 +28,7 @@
namespace WebCore {
class SecurityOrigin;
class ChromeClientQt;
-};
+}
class QWebSecurityOriginPrivate;
class QWebDatabase;
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index 42baf93..f6acc42 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -183,6 +183,10 @@ void QWebSettingsPrivate::apply()
value = attributes.value(QWebSettings::LocalStorageDatabaseEnabled,
global->attributes.value(QWebSettings::LocalStorageDatabaseEnabled));
settings->setLocalStorageEnabled(value);
+
+ value = attributes.value(QWebSettings::AllowUniversalAccessFromFileUrls,
+ global->attributes.value(QWebSettings::AllowUniversalAccessFromFileUrls));
+ settings->setAllowUniversalAccessFromFileURLs(value);
} else {
QList<QWebSettingsPrivate *> settings = *::allSettings();
for (int i = 0; i < settings.count(); ++i)
@@ -236,10 +240,6 @@ QWebSettings *QWebSettings::globalSettings()
setOfflineStoragePath() with an appropriate file path, and can limit the quota
for each application by calling setOfflineStorageDefaultQuota().
- The performance of Web applications can be enhanced with the use of an
- offline cache. This can be enabled by calling setOfflineWebApplicationCache()
- with an appropriate file path.
-
\sa QWebPage::settings(), QWebView::settings(), {Browser}
*/
@@ -292,8 +292,7 @@ QWebSettings *QWebSettings::globalSettings()
programs.
\value JavaEnabled Enables or disables Java applets.
Currently Java applets are not supported.
- \value PluginsEnabled Enables or disables plugins in web pages.
- Currently Flash and other plugins are not supported.
+ \value PluginsEnabled Enables or disables plugins in Web pages.
\value PrivateBrowsingEnabled Private browsing prevents WebKit from
recording visited pages in the history and storing web page icons.
\value JavascriptCanOpenWindows Specifies whether JavaScript programs
@@ -315,6 +314,8 @@ QWebSettings *QWebSettings::globalSettings()
web application cache feature is enabled or not.
\value LocalStorageDatabaseEnabled Specifies whether support for the HTML 5
local storage feature is enabled or not.
+ \value AllowUniversalAccessFromFileUrls Specifies whether documents from file
+ Urls should be granted universal access (e.g., to HTTP and HTTPS documents).
*/
/*!
@@ -343,6 +344,7 @@ QWebSettings::QWebSettings()
d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true);
d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true);
d->attributes.insert(QWebSettings::LocalStorageDatabaseEnabled, true);
+ d->attributes.insert(QWebSettings::AllowUniversalAccessFromFileUrls, true);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
}
@@ -710,9 +712,10 @@ qint64 QWebSettings::offlineStorageDefaultQuota()
return QWebSettings::globalSettings()->d->offlineStorageDefaultQuota;
}
-/*!
- \since 4.5
-
+/*
+ \internal
+ \relates QWebSettings
+
Sets the path for HTML5 offline web application cache storage to \a path.
\a path must point to an existing directory where the cache is stored.
@@ -721,22 +724,23 @@ qint64 QWebSettings::offlineStorageDefaultQuota()
\sa offlineWebApplicationCachePath()
*/
-void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
+void QWEBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QString& path)
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
WebCore::cacheStorage().setCacheDirectory(path);
#endif
}
-/*!
- \since 4.5
-
+/*
+ \internal
+ \relates QWebSettings
+
Returns the path of the HTML5 offline web application cache storage
or an empty string if the feature is disabled.
\sa setOfflineWebApplicationCachePath()
*/
-QString QWebSettings::offlineWebApplicationCachePath()
+QString QWEBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
return WebCore::cacheStorage().cacheDirectory();
@@ -747,6 +751,7 @@ QString QWebSettings::offlineWebApplicationCachePath()
/*
\since 4.5
+ \relates QWebSettings
Sets the path for HTML5 local storage databases to \a path.
@@ -756,7 +761,6 @@ QString QWebSettings::offlineWebApplicationCachePath()
\sa localStorageDatabasePath()
*/
-
void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path)
{
QWebSettingsPrivate *d = settings->handle();
@@ -766,6 +770,7 @@ void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* set
/*
\since 4.5
+ \relates QWebSettings
Returns the path for HTML5 local storage databases
or an empty string if the feature is disabled.
diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h
index 4251fbb..5610797 100644
--- a/WebKit/qt/Api/qwebsettings.h
+++ b/WebKit/qt/Api/qwebsettings.h
@@ -63,7 +63,8 @@ public:
PrintElementBackgrounds,
OfflineStorageDatabaseEnabled,
OfflineWebApplicationCacheEnabled,
- LocalStorageDatabaseEnabled
+ LocalStorageDatabaseEnabled,
+ AllowUniversalAccessFromFileUrls
};
enum WebGraphic {
MissingImageGraphic,
@@ -112,9 +113,6 @@ public:
static void setOfflineStorageDefaultQuota(qint64 maximumSize);
static qint64 offlineStorageDefaultQuota();
- static void setOfflineWebApplicationCachePath(const QString& path);
- static QString offlineWebApplicationCachePath();
-
inline QWebSettingsPrivate* handle() const { return d; }
private:
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 04575c9..ba6d3ae 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,8 +1,355 @@
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-03-26 Simon Hausmann <simon.hausmann@nokia.com>
- Merge r40508.
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Fix the documentation of the QLocale usage in userAgentForUrl.
+
+ * Api/qwebpage.cpp:
+
+2009-03-20 Erik L. Bunce <elbunce@xendom.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix for InsertParagraphSeparator and InsertLineSeparator so that
+ QWebPage::action() creates QActions for them. Also make sure they get
+ updated appropriately.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPage::action):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::textEditing):
+
+2009-03-20 Erik L. Bunce <elbunce@xendom.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix QWebPage::WebActions action states to more closely match when they are
+ actually applicable and remove erroneous documentation.
+
+ * Most WebActions implemented using editor commands now use the
+ Editor::Command::isEnabled() to control their availability.
+ * SelectAll is always enabled (since it's editor command is).
+ * SetTextDirection{} family of WebActions are available when canEdit() is true
+ and not just canEditRichly().
+
+ Fix and clarify documentation about the availability of various web actions.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateEditorActions):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::textSelection):
+
+2009-03-19 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fixes pedantic compilation in QtWebKit.
+
+ There are no semi-colons after namespace declarations.
+
+ * Api/qwebdatabase.h:
+ * Api/qwebsecurityorigin.h:
+
+2009-03-19 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Removed obsolete warning about Flash and other plugins.
+
+ * Api/qwebsettings.cpp:
+
+2009-03-19 Paul Olav Tvete <paul.tvete@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Properly escape tooltip text
+
+ ManualTest: http://xkcd.com/554/
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::setToolTip):
+
+2009-03-10 Adam Treat <adam.treat@torchmobile.com>
+
+ Build fix for Qt after r41555.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::acceptNavigationRequest):
+
+2009-03-10 Xan Lopez <xlopez@igalia.com>
+
+ Build fix, no review.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::inputMethodQuery):
+
+2009-03-07 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Cameron Zwarich.
+
+ These methods are clearly returning the wrong values as the two were
+ returning swapped information.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::totalBytes):
+ (QWebPage::bytesReceived):
+
+2009-03-05 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] NPAPI plugins are supported, adjust the API documentation.
+
+ * Api/qwebsettings.cpp:
+
+2009-03-04 Adam Barth <abath@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24356
+
+ Fix WebKit style for allowUniversalAccessFromFileURLs.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
+2009-03-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24340
+
+ Expose AllowUniversalAccessFromFileUrls to Qt clients.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+
+2009-03-03 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Create and update the action for SelectAll.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPage::action):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::textSelection):
+
+2009-03-02 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Eric Seidel.
+
+ Add three new drt helper functions that enable all of the tests in
+ LayoutTests/animation/* and LayoutTests/transitions/* to now pass.
+
+ * Api/qwebframe.cpp:
+ (qt_drt_pauseAnimation):
+ (qt_drt_pauseTransitionOfProperty):
+ (qt_drt_numberOfActiveAnimations):
+
+2009-03-02 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
+
+ Reviewed by George Staikos.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21230
+ On X11 match the behavior of Firefox and also copy the url to the
+ clipboard selection when the action Copy Link Location is executed.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+
+2009-02-25 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix the documentation for the linkHovered signal.
+
+ * Api/qwebpage.cpp:
+
+2009-02-23 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24094
+ Make sure to empty the cache on exit to get rid of superfluous leak messages
+ for CachedResource's in order to keep the leak messages accurate. This
+ is analagous to what the Mac port is doing on application exit when all
+ WebView's have been closed.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::_q_cleanupLeakMessages):
+ (QWebPage::QWebPage):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2009-02-23 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix the Copyright notices in a few files
+
+ * WebKit_pch.h:
+
+2009-02-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Avoid loading plugins when they're disabled in the settings.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::canShowMIMEType): Don't call into the
+ PluginDatabase if plugins are disabled in the settings.
+
+2009-02-13 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
+
+ Reviewed by Nikolas Zimmermann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23738
+ Expose the url elements target frame string. This is the sister function
+ to the existing linkTargetFrame which returns the QWebFrame*. When the
+ linkTargetFrame is 0 it is useful to know what the target was to be.
+
+ * Api/qwebframe.cpp:
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+ (QWebHitTestResult::linkTarget):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-02-13 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Removed documentation for internal functions.
+
+ * Api/qwebsettings.cpp:
+
+2009-02-13 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Corrected some minor qdoc errors.
+
+ * Api/qwebsettings.cpp:
+
+2009-02-11 Dimitri Dupuis-latour <dupuislatour@apple.com>
+
+ Stub out InspectorClientQt::hiddenPanels.
+
+ Reviewed by Timothy Hatcher.
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::hiddenPanels):
+ * WebCoreSupport/InspectorClientQt.h:
+
+2009-02-10 Karsten Heimrich <kheimric@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fixes missing navigation/url update while clicking on anchor inside
+ webpage.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage):
+ update and emit in case we navigate inside a webpage
+
+2009-02-10 Adam Treat <adam.treat@torchmobile.com>
+
+ Fix the Qt build as class Selection is now VisibleSelection.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::inputMethodQuery):
+
+2009-02-06 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::updateGlobalHistoryRedirectLinks):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-02-06 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc - made 2 functions internal as they are not part of the API anymore (and this fixes 2 qdoc warnings)
+
+ * Api/qwebsettings.cpp:
+
+2009-02-06 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added an overload of QWebFrame::addToJavaScriptWindowObject that takes a QScriptEngine::ValueOwnership parameter.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject): New overload.
+ * Api/qwebframe.h:
+ * tests/qwebframe/tst_qwebframe.cpp: Added unit tests for ownership
+ models.
+
+2009-02-06 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by Holger Freyther.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::documentElementAvailable):)
+ Fix compile error in Qt build introduced by the below change (r40694).
+
+2009-02-05 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23708
+ Adds documentElementAvailable() callback to FrameLoaderClient.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClient::documentElementAvailable):
+ Stub out documentElementAvailable().
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ Ditto.
+
+2009-02-04 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Documented the return value of the evaluateJavaScript() function.
+
+ * Api/qwebframe.cpp:
+
+2009-02-03 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added a unit test to verify the succesful conversion from QByteArray to
+ JSByteArray and back to QByteArray.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ (QWebFrame::load):
+ (QWebFrame::setHtml):
+ (QWebFrame::setContent):
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
@@ -15,22 +362,78 @@
(WebCore::FrameLoaderClientQt::createFrame):
* WebCoreSupport/FrameLoaderClientQt.h:
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Update for changes to WebCore.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ (WebCore::FrameLoaderClientQt::createJavaAppletWidget):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-02-02 Adam Treat <adam.treat@torchmobile.com>
- Merge r40436.
+ Reviewed by Nikolas Zimmermann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23587
+ Refactor HitTestRequest to eliminate all the ugly boolean arguments and
+ use an enum bitflag instead. Cleanup all the code that constructs the
+ various HitTestRequests to make the code more readable.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::hitTestContent):
- 2009-01-30 Geoffrey Garen <ggaren@apple.com>
+2009-02-02 Adam Treat <adam.treat@torchmobile.com>
+
+ Fix the Qt build to call forceLayout on the view instead.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setFixedLayoutSize):
+ (QWebPage::setUseFixedLayout):
+
+2009-02-02 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Darin Adler.
+
+ Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView
+
+ https://bugs.webkit.org/show_bug.cgi?id=23428
+
+ FrameView::forceLayout could be killed but the comment might
+ contain a value over the the plain FrameView::layout...
+
+ Adjust the WebCore/WebKit consumers of these methods.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setViewportSize):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::forceLayout):
+
+2009-01-30 Geoffrey Garen <ggaren@apple.com>
Build fix.
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::createFrame):
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
- Merge r40432.
+ https://bugs.webkit.org/show_bug.cgi?id=22056
+
+ Kill FrameLoaderClient.cpp, move the code over to Frame::createView
+
+ FrameLoaderClient is supposed to be an interface, move the
+ to be shared code to Frame which is a controller and is
+ allowed to create a FrameView.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
- 2009-01-30 Geoffrey Garen <ggaren@apple.com>
+2009-01-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
@@ -40,6 +443,64 @@
* Api/qwebpage.cpp:
(QWebPage::triggerAction):
+2009-01-30 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Remove FrameLoaderClient code that is now handled by FrameLoader itself
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::frameLoadCompleted):
+
+2009-01-30 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Hide the Offline Web Application Cache path API from the public API
+ for now.
+
+ * Api/qwebsettings.cpp:
+ (qt_websettings_setOfflineWebApplicationCachePath):
+ (qt_websettings_offlineWebApplicationCachePath):
+ * Api/qwebsettings.h:
+
+2009-01-28 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Nikolas Zimmermann and George Staikos.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23557
+ Do not clip the QWebFrame::hitTestContent method to the visible viewport
+ and add a regression test to make sure it works.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::hitTestContent):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-28 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ Provide default implementations of JavaScript dialog boxes like in
+ most web browsers, i.e. indicate that is from JavaScript and show the
+ frame URL.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+
+2009-01-27 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ http://www.qtsoftware.com/developer/task-tracker/index_html?id=238391&method=entry
+
+ [Qt] If QPainter fails to start on a QPrinter instance, do not
+ continue printing.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+
2009-01-27 Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index c545769..fa52d6c 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -47,6 +47,7 @@
#include "qwebsecurityorigin_p.h"
#include <qtooltip.h>
+#include <qtextdocument.h>
namespace WebCore
{
@@ -373,7 +374,7 @@ void ChromeClientQt::setToolTip(const String &tip)
view->setToolTip(QString());
QToolTip::hideText();
} else {
- QString dtip = QLatin1String("<p>") + tip + QLatin1String("</p>");
+ QString dtip = QLatin1String("<p>") + Qt::escape(tip) + QLatin1String("</p>");
view->setToolTip(dtip);
}
#else
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index af96201..025bd4f 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -45,11 +45,14 @@
#include "RenderPart.h"
#include "ResourceRequest.h"
#include "HistoryItem.h"
+#include "HTMLAppletElement.h"
#include "HTMLFormElement.h"
+#include "HTMLPlugInElement.h"
#include "NotImplemented.h"
#include "QNetworkReplyHandler.h"
#include "ResourceHandleInternal.h"
#include "ResourceHandle.h"
+#include "Settings.h"
#include "qwebpage.h"
#include "qwebframe.h"
@@ -214,12 +217,12 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
QBrush brush = m_webFrame->page()->palette().brush(QPalette::Base);
QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor();
- WebCore::FrameLoaderClient::transitionToCommittedForNewPage(m_frame, m_webFrame->page()->viewportSize(),
- backgroundColor, !backgroundColor.alpha(),
- m_webFrame->page()->fixedLayoutSize(),
- m_webFrame->page()->useFixedLayout(),
- (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
- (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
+ m_frame->createView(m_webFrame->page()->viewportSize(),
+ backgroundColor, !backgroundColor.alpha(),
+ m_webFrame->page()->fixedLayoutSize(),
+ m_webFrame->page()->useFixedLayout(),
+ (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
+ (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
}
@@ -231,7 +234,9 @@ void FrameLoaderClientQt::makeRepresentation(DocumentLoader*)
void FrameLoaderClientQt::forceLayout()
{
- m_frame->forceLayout(true);
+ FrameView* view = m_frame->view();
+ if (view)
+ view->forceLayout(true);
}
@@ -298,7 +303,11 @@ void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage()
if (dumpFrameLoaderCallbacks)
printf("%s - didChangeLocationWithinPageForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- notImplemented();
+ if (!m_webFrame)
+ return;
+
+ emit m_webFrame->urlChanged(m_webFrame->url());
+ m_webFrame->page()->d->updateNavigationActions();
}
@@ -508,7 +517,8 @@ bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const
if (MIMETypeRegistry::isSupportedNonImageMIMEType(MIMEType))
return true;
- if (PluginDatabase::installedPlugins()->isMIMETypeRegistered(MIMEType))
+ if (m_frame && m_frame->settings() && m_frame->settings()->arePluginsEnabled()
+ && PluginDatabase::installedPlugins()->isMIMETypeRegistered(MIMEType))
return true;
return false;
@@ -530,9 +540,6 @@ String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String& URLSchem
void FrameLoaderClientQt::frameLoadCompleted()
{
// Note: Can be called multiple times.
- // Even if already complete, we might have set a previous item on a frame that
- // didn't do any data loading on the past transaction. Make sure to clear these out.
- m_frame->loader()->setPreviousHistoryItem(0);
}
@@ -608,6 +615,11 @@ void FrameLoaderClientQt::windowObjectCleared()
emit m_webFrame->javaScriptWindowObjectCleared();
}
+void FrameLoaderClientQt::documentElementAvailable()
+{
+ return;
+}
+
void FrameLoaderClientQt::didPerformFirstNavigation() const
{
if (m_frame->tree()->parent() || !m_webFrame)
@@ -627,7 +639,7 @@ void FrameLoaderClientQt::updateGlobalHistory()
history->addHistoryEntry(m_frame->loader()->documentLoader()->urlForHistory().prettyURL());
}
-void FrameLoaderClientQt::updateGlobalHistoryForRedirectWithoutHistoryItem()
+void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks()
{
}
@@ -971,7 +983,7 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
FrameLoadType loadType = m_frame->loader()->loadType();
FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedBackForwardList;
- childFrame->loader()->loadURL(frameData.url, frameData.referrer, String(), childLoadType, 0, 0);
+ childFrame->loader()->loadURL(frameData.url, frameData.referrer, String(), false, childLoadType, 0, 0);
// The frame's onload handler may have removed it from the document.
if (!childFrame->tree()->parent())
@@ -1060,7 +1072,7 @@ public:
}
};
-Widget* FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames,
+Widget* FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames,
const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
// qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.prettyURL() << mimeType;
@@ -1148,7 +1160,7 @@ void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget)
m_hasSentResponseToPlugin = false;
}
-Widget* FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL,
+Widget* FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
const Vector<String>& paramNames, const Vector<String>& paramValues)
{
notImplemented();
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 908d2aa..c49bb62 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -147,7 +147,7 @@ namespace WebCore {
virtual void finishedLoading(DocumentLoader*);
virtual void updateGlobalHistory();
- virtual void updateGlobalHistoryForRedirectWithoutHistoryItem();
+ virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
virtual ResourceError cancelledError(const ResourceRequest&);
@@ -187,15 +187,16 @@ namespace WebCore {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) ;
- virtual Widget* createPlugin(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);
+ virtual Widget* createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);
virtual void redirectDataToPlugin(Widget* pluginWidget);
- virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues);
+ virtual Widget* createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues);
virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
virtual String overrideMediaType() const;
virtual void windowObjectCleared();
+ virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
virtual void registerForIconNotification(bool);
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 7335280..fe4d43a 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -114,6 +114,12 @@ String InspectorClientQt::localizedStringsURL()
return String();
}
+String InspectorClientQt::hiddenPanels()
+{
+ notImplemented();
+ return String();
+}
+
void InspectorClientQt::showWindow()
{
if (!m_webPage)
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index 49c2d56..60ed77a 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -52,6 +52,8 @@ namespace WebCore {
virtual String localizedStringsURL();
+ virtual String hiddenPanels();
+
virtual void showWindow();
virtual void closeWindow();
virtual bool windowVisible();
diff --git a/WebKit/qt/WebKit_pch.h b/WebKit/qt/WebKit_pch.h
index 9ef73f6..ae8ec88 100644
--- a/WebKit/qt/WebKit_pch.h
+++ b/WebKit/qt/WebKit_pch.h
@@ -1,7 +1,7 @@
/*
* This file is part of the precompiled header for all of WebKit.
*
- * Copyright (C) 2007 Trolltech
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 38a3543..d9c97c8 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2008,2009 Nokia Corporation and/or its subsidiary(-ies)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -576,6 +576,9 @@ private slots:
void ipv6HostEncoding();
void metaData();
void popupFocus();
+ void hitTestContent();
+ void jsByteArray();
+ void ownership();
private:
QString evalJS(const QString&s) {
// Convert an undefined return variant to the string "undefined"
@@ -2272,5 +2275,95 @@ void tst_QWebFrame::popupFocus()
"The input field should have a blinking caret");
}
+void tst_QWebFrame::hitTestContent()
+{
+ QString html("<html><body><p>A paragraph</p><br/><br/><br/><a href=\"about:blank\" target=\"_foo\">link text</a></body></html>");
+
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->setHtml(html);
+ page.setViewportSize(QSize(200, 0)); //no height so link is not visible
+ QWebHitTestResult result = frame->hitTestContent(QPoint(10, 100));
+ QCOMPARE(result.linkText(), QString("link text"));
+ QCOMPARE(result.linkTarget(), QString("_foo"));
+}
+
+void tst_QWebFrame::jsByteArray()
+{
+ QByteArray ba("hello world");
+ m_myObject->setByteArrayProperty(ba);
+
+ // read-only property
+ QCOMPARE(m_myObject->byteArrayProperty(), ba);
+ QString type;
+ QVariant v = evalJSV("myObject.byteArrayProperty");
+ QCOMPARE(int(v.type()), int(QVariant::ByteArray));
+
+ QCOMPARE(v.toByteArray(), ba);
+}
+
+void tst_QWebFrame::ownership()
+{
+ // test ownership
+ {
+ QPointer<QObject> ptr = new QObject();
+ QVERIFY(ptr != 0);
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", ptr, QScriptEngine::ScriptOwnership);
+ }
+ QVERIFY(ptr == 0);
+ }
+ {
+ QPointer<QObject> ptr = new QObject();
+ QVERIFY(ptr != 0);
+ QObject* before = ptr;
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", ptr, QScriptEngine::QtOwnership);
+ }
+ QVERIFY(ptr == before);
+ delete ptr;
+ }
+ {
+ QObject* parent = new QObject();
+ QObject* child = new QObject(parent);
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", child, QScriptEngine::QtOwnership);
+ QVariant v = frame->evaluateJavaScript("test");
+ QCOMPARE(qvariant_cast<QObject*>(v), child);
+ delete parent;
+ v = frame->evaluateJavaScript("test");
+ QCOMPARE(qvariant_cast<QObject*>(v), (QObject *)0);
+ }
+ {
+ QPointer<QObject> ptr = new QObject();
+ QVERIFY(ptr != 0);
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", ptr, QScriptEngine::AutoOwnership);
+ }
+ // no parent, so it should be like ScriptOwnership
+ QVERIFY(ptr == 0);
+ }
+ {
+ QObject* parent = new QObject();
+ QPointer<QObject> child = new QObject(parent);
+ QVERIFY(child != 0);
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", child, QScriptEngine::AutoOwnership);
+ }
+ // has parent, so it should be like QtOwnership
+ QVERIFY(child != 0);
+ delete parent;
+ }
+}
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 6f2ce3b..d85e880 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -879,6 +879,7 @@ void tst_QWebPage::textSelection()
QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
// these actions must exist
+ QVERIFY(page->action(QWebPage::SelectAll) != 0);
QVERIFY(page->action(QWebPage::SelectNextChar) != 0);
QVERIFY(page->action(QWebPage::SelectPreviousChar) != 0);
QVERIFY(page->action(QWebPage::SelectNextWord) != 0);
@@ -906,10 +907,14 @@ void tst_QWebPage::textSelection()
QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), false);
QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), false);
+ // ..but SelectAll is awalys enabled
+ QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true);
+
// make it editable before navigating the cursor
page->setContentEditable(true);
// here the actions are enabled after contentEditable is true
+ QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true);
@@ -951,6 +956,8 @@ void tst_QWebPage::textEditing()
QVERIFY(page->action(QWebPage::ToggleBold) != 0);
QVERIFY(page->action(QWebPage::ToggleItalic) != 0);
QVERIFY(page->action(QWebPage::ToggleUnderline) != 0);
+ QVERIFY(page->action(QWebPage::InsertParagraphSeparator) != 0);
+ QVERIFY(page->action(QWebPage::InsertLineSeparator) != 0);
// right now they are disabled because contentEditable is false
QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), false);
@@ -961,6 +968,8 @@ void tst_QWebPage::textEditing()
QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), false);
QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), false);
QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), false);
// make it editable before navigating the cursor
page->setContentEditable(true);
@@ -974,6 +983,8 @@ void tst_QWebPage::textEditing()
QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), true);
delete page;
}
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index bbafe2e..5f89f66 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,19 +1,291 @@
-2009-02-12 Mark Rowe <mrowe@apple.com>
+2009-03-26 Dan Bernstein <mitz@apple.com>
- Merge r40886.
+ Reviewed by Adam Roben.
+
+ - add close() to the WebView API.
+
+ * Interfaces/IWebView.idl:
+ * WebView.cpp:
+ (WebView::close):
+ * WebView.h:
+
+2009-03-24 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24779
+ Conditionalize CFNetwork-specific code in WebView to permit
+ support for other network backends.
+
+ * WebView.cpp:
+ (WebView::setCacheModel): Add CFNETWORK check around CFNetwork
+ specific cache implementation.
+ (updateSharedSettingsFromPreferencesIfNeeded): Add CFNETWORK
+ check around use of CFHTTPCookie code.
+
+2009-03-23 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for <rdar://problem/6140966>
+ Empty Caches does not clear the Cross-site XMLHttpRequest preflight cache
+
+ * WebCache.cpp:
+ (WebCache::empty): Also add application cache emptying to match the mac.
+
+2009-03-18 Steve Falkenburg <sfalken@apple.com>
+
+ Add webViewClosing to private UI delegate.
+
+ Reviewed by Adam Roben.
+
+ * Interfaces/IWebUIDelegatePrivate.idl:
+ * Interfaces/WebKit.idl:
+ * WebView.cpp:
+ (WebView::close):
+
+2009-03-17 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ - WebKit part of adding a mechanism for controlling the caching of
+ responses through WebFrameLoaderClient
+
+ * Interfaces/IWebResourceLoadDelegatePrivate.idl: Added the
+ IWebResourceLoadDelegatePrivate3 interface, containing the new
+ delegate method shouldCacheResponse().
+
+ * Interfaces/IWebURLRequest.idl: Added the isEqual() method.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::shouldCacheResponse): Implemented this new
+ FrameLoaderDelegate method by calling through to the resource load
+ delegate, if it implements shouldCacheResponse(), and returning true
+ otherwise.
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+
+ * WebMutableURLRequest.cpp:
+ (WebMutableURLRequest::isEqual): Added.
+ (WebMutableURLRequest::setValue): Implemented.
+
+ * WebMutableURLRequest.h: Declared isEqual().
+
+2009-03-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/6577174> Rename the text directionality submenus to “Paragraph Direction” and “Selection Direction”
+
+ For now, change only the localized strings, not the terminology in the code.
+
+ * WebCoreLocalizedStrings.cpp:
+ (WebCore::contextMenuItemTagWritingDirectionMenu): Changed string here.
+ (WebCore::contextMenuItemTagTextDirectionMenu): And here.
+
+2009-03-16 Adam Roben <aroben@apple.com>
+
+ Add IWebFramePrivate::isDisplayingStandaloneImage
+
+ This uses the same logic that -[WebFrame _isDisplayingStandaloneImage]
+ uses.
+
+ Reviewed by Darin Adler.
+
+ * Interfaces/IWebFramePrivate.idl: Added isDisplayingStandaloneImage.
+
+ * WebFrame.cpp:
+ (WebFrame::isDisplayingStandaloneImage): Added. Returns true if our
+ Document is an image document.
+
+ * WebFrame.h: Added isDisplayingStandaloneImage.
+
+2009-03-12 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Darin Fisher.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24502
+ Make horizontal scrolling on Windows always go the correct direction.
+
+ * WebView.cpp:
+ (WebView::mouseWheel):
+ (WebViewWndProc):
+ * WebView.h:
+
+2009-03-12 Adam Roben <aroben@apple.com>
+
+ Implement DOMHTMLDocument::title
+
+ Reviewed by Dan Bernstein.
+
+ * DOMHTMLClasses.cpp:
+ (DOMHTMLDocument::title): Call through to WebCore::Document (with
+ obligatory COM error checking/type conversions).
+
+2009-03-11 Adam Roben <aroben@apple.com>
+
+ Export functions needed by ThreadSpecific from WebKit
+
+ Reviewed by John Sullivan.
+
+ * WebKit.vcproj/WebKit.def:
+ * WebKit.vcproj/WebKit_debug.def:
+ Export WTF::tlsKeyCount and WTF::tlsKeys.
+
+2009-03-10 Steve Falkenburg <sfalken@apple.com>
+
+ <rdar://problem/6662167> When clicking in Top Sites search field, WebHistory::findIndex fails causing crash in BookmarksSearcher::collectHistorySearchResults
+
+ Round CFAbsoluteDates to the nearest second when converting to/from the Windows DATE format.
+
+ This corrects for inaccuracies introduced by round-tripping between DATE (day based) and CFAbsoluteDate (second based).
+ The WebKit COM API on Windows uses DATE, while our history storage uses CFAbsoluteTime. This could lead to WebKit
+ saying there was browsing history for a particular day, and then return no history items when we requested a
+ list of sites visited that day.
+
+ Reviewed by Ada Chan.
+
+ * MarshallingHelpers.cpp:
+ (MarshallingHelpers::DATEToCFAbsoluteTime):
+ (MarshallingHelpers::CFAbsoluteTimeToDATE):
- 2009-02-11 Brady Eidson <beidson@apple.com>
+2009-03-08 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Split ScrollAlignment and ScrollBehavior out of RenderLayer.h so that
+ Frame.h no longer needs to include it. This cuts the size of the symbols
+ for a debug build by around 3%.
+
+ * WebView.cpp:
+ (WebView::centerSelectionInVisibleArea):
+
+2009-03-07 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ - WebKit part of removing build-time and run-time support for legacy
+ versions of CFNetwork and Core Graphics
+
+ * WebView.cpp:
+ (WebView::setCacheModel):
+
+2009-03-04 Adam Barth <abath@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24356
+
+ Fix WebKit style for allowUniversalAccessFromFileURLs.
+
+ * Interfaces/IWebPreferencesPrivate.idl:
+ * WebPreferenceKeysPrivate.h:
+ * WebPreferences.cpp:
+ (WebPreferences::initializeDefaultSettings):
+ (WebPreferences::allowUniversalAccessFromFileURLs):
+ (WebPreferences::setAllowUniversalAccessFromFileURLs):
+ * WebPreferences.h:
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2009-02-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a preference to reduce the power of file:// URLs.
+
+ * Interfaces/IWebPreferencesPrivate.idl:
+ * WebPreferenceKeysPrivate.h:
+ * WebPreferences.cpp:
+ (WebPreferences::initializeDefaultSettings):
+ (WebPreferences::allowUniversalAccessFromFileUrls):
+ (WebPreferences::setAllowUniversalAccessFromFileUrls):
+ * WebPreferences.h:
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2009-02-19 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24024
+ REGRESSION (r39845): Assertion failure in -[WebHistoryItem dictionaryRepresentation] when
+ archiving a submission to about:blank
+
+ I don't know how to make an automated test for this bug.
+
+ * WebHistory.cpp: (WebHistory::visitedURL): Account for the fact that HTTP method may be
+ non-empty for non-HTTP requests.
+
+2009-02-25 Andreia Gaita <shana@jitted.com>
+
+ Reviewed by Alp Toker.
+
+ Update Win def files with recent JavaScriptCore API additions.
+
+ * WebKit.vcproj/WebKit.def:
+ * WebKit.vcproj/WebKit_Cairo.def:
+ * WebKit.vcproj/WebKit_debug.def:
+
+2009-02-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Geoffrey Garen.
+
+ Related to <rdar://problem/6590295>
+ Allow disabling javascript: urls.
+
+ * Interfaces/IWebViewPrivate.idl:
+ * WebView.cpp:
+ (WebView::setJavaScriptURLsAreAllowed):
+ * WebView.h:
+
+2009-02-24 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ * WebKit.vcproj/WebKit.def:
+ * WebKit.vcproj/WebKit_debug.def:
+ Export WTF::ThreadCondition::timedWait.
+
+2009-02-12 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Kevin Decker
+
+ <rdar://problem/6582180> - Wrong HTTP method applied to history item.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::updateGlobalHistory): Check the original request, not any
+ redirected request.
+
+2009-02-11 Brady Eidson <beidson@apple.com>
Fix my last checkin for more effect.
* WebHistoryItem.cpp:
(WebHistoryItem::initFromDictionaryRepresentation):
-2009-02-12 Mark Rowe <mrowe@apple.com>
+2009-02-11 Adam Roben <aroben@apple.com>
+
+ Windows fix for Bug 22239: Implement missing animation & transition
+ APIs on LayoutTestController for non-mac platforms
+
+ <https://bugs.webkit.org/show_bug.cgi?id=22239>
+
+ Reviewed by Simon Fraser.
+
+ * Interfaces/IWebFramePrivate.idl: Added pauseAnimation,
+ pauseTransition, and numberOfActiveAnimations.
+
+ * WebFrame.cpp:
+ (WebFrame::pauseAnimation):
+ (WebFrame::pauseTransition):
+ (WebFrame::numberOfActiveAnimation):
+ Added. These all call through to AnimationController.
- Merge r40882.
+ * WebFrame.h: Added pauseAnimation, pauseTransition, and
+ numberOfActiveAnimations.
- 2009-02-11 Brady Eidson <beidson@apple.com>
+2009-02-11 Brady Eidson <beidson@apple.com>
Reviewed by Mark Rowe
@@ -35,11 +307,96 @@
(WebHistoryItem::initFromDictionaryRepresentation): Add the negative-visit-count-correction-logic as implemented
for Mac in http://trac.webkit.org/changeset/40851.
-2009-02-06 Mark Rowe <mrowe@apple.com>
+2009-02-11 Dimitri Dupuis-latour <dupuislatour@apple.com>
+
+ Stub out WebInspectorClient::hiddenPanels.
+
+ Reviewed by Timothy Hatcher.
+
+ * WebCoreSupport/WebInspectorClient.cpp:
+ (WebInspectorClient::hiddenPanels):
+ * WebCoreSupport/WebInspectorClient.h:
+
+2009-02-11 Adam Roben <aroben@apple.com>
+
+ Don't release the shared WebHistory instance on quit
+
+ This matches Mac, and prevents a race condition when the process exits
+ that depends on the order in which global destructors are invoked.
+
+ Reviewed by Alexey Proskuryakov.
+
+ * WebHistory.cpp:
+ (sharedHistoryStorage): Changed to use DEFINE_STATIC_LOCAL so the
+ destructor is never called.
+
+2009-02-10 Adam Roben <aroben@apple.com>
+
+ Fix recursive WebView destruction when running DumpRenderTree
+
+ DumpRenderTree would call DestroyWindow on a WebView's host window,
+ which would send a WM_DESTROY message to the WebView's window. Inside
+ the WebView's WndProc, we would hold a ref to the WebView, then call
+ close() and revokeDragDrop(), which would release all remaining
+ references to the WebView other than the ref we held in the WndProc.
+ When the WndProc exited, the final ref to the WebView would be
+ released, invoking WebView's destructor. At this point,
+ IsWindow(m_viewWindow) would return true, since we were still in the
+ process of handling WM_DESTROY, so we would call DestroyWindow on the
+ WebView's window again, re-entering the WndProc and re-reffing the
+ WebView, leading to recursive destruction.
+
+ Reviewed by Alexey Proskuryakov.
+
+ * WebView.cpp:
+ (WebView::~WebView): Don't call DestroyWindow if our window is already
+ being destroyed.
+ (WebViewWndProc): Only hold an extra ref to the WebView when we're not
+ being destroyed.
+
+2009-02-06 Adam Roben <aroben@apple.com>
+
+ Build fix
+
+ Reviewed by Sam Weinig.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp: Added missing #include.
+ (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks): Removed
+ incorrect .get(), and changed to use the new overload of
+ WebHistory::itemForURLString.
+
+ * WebHistory.cpp:
+ (WebHistory::itemForURLString): Made this const.
+ (WebHistory::itemForURLString): Added an overload that takes a
+ WebCore::String and returns the IWebHistoryItem instead of using an
+ out parameter.
+
+ * WebHistory.h: Added public overload of itemForURLString.
+
+ * WebView.cpp:
+ (WebView::prepareCandidateWindow):
+ (WebView::onIMERequestCharPosition):
+ (WebView::onIMERequestReconvertString):
+ Updated for toRange -> toNormalizedRange rename.
- Merge r40726.
+2009-02-06 Geoffrey Garen <ggaren@apple.com>
- 2009-02-06 Dan Bernstein <mitz@apple.com>
+ Reviewed by Sam Weinig.
+
+ Part III of <rdar://problem/6552272>.
+
+ Refactored to use the redirect data WebCore makes available, instead of
+ tracking loading state in WebKit.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::updateGlobalHistory):
+ (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebHistory.cpp:
+ (WebHistory::visitedURL):
+ * WebHistory.h:
+
+2009-02-06 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
@@ -51,11 +408,14 @@
size. Also reduced the inline capacity of the vector used for weekly visit
counts to 5, which is the expected maximum size.
-2009-02-06 Mark Rowe <mrowe@apple.com>
+2009-02-06 Brent Fulgham <bfulgham@webkit.org>
- Merge r40713.
+ Build fix.
- 2009-02-06 Maciej Stachowiak <mjs@apple.com>
+ * WebKit.vcproj/WebKit.vcproj: Re-enable missing file in Release
+ target of Cairo.
+
+2009-02-06 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Dan Bernstein.
@@ -64,11 +424,7 @@
* WebHistoryItem.cpp:
(WebHistoryItem::initFromDictionaryRepresentation):
-2009-02-06 Mark Rowe <mrowe@apple.com>
-
- Merge r40712.
-
- 2009-02-05 Maciej Stachowiak <mjs@apple.com> and Brady Eidson <beidson@apple.com>
+2009-02-05 Maciej Stachowiak <mjs@apple.com> and Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein and Geoff Garen..
@@ -89,89 +445,74 @@
(WebHistoryItem::recordInitialVisit): Tell WebCore to record an initial visit.
* WebHistoryItem.h:
-2009-02-04 Steve Falkenburg <sfalken@apple.com>
+2009-02-05 Brent Fulgham <bfulgham@webkit.org>
- Merge r40365.
+ Reviewed by Sam Weinig <sam@webkit.org>
- 2009-01-29 Adam Roben <aroben@apple.com>
+ Build fix. Update file for recently removed EventTargetNodeCast.
+ * DOMCoreClasses.cpp:
+ (DOMNode::dispatchEvent):
- Build fix after r40353
+2009-02-05 Aaron Boodman <aa@chromium.org>
- * WebCoreSupport/WebFrameLoaderClient.cpp:
- (WebFrameLoaderClient::loadURLIntoChild): Removed the check for
- FrameLoadTypeReloadAllowingStaleData.
+ Reviewed by Dave Hyatt.
-2009-02-04 Steve Falkenburg <sfalken@apple.com>
+ https://bugs.webkit.org/show_bug.cgi?id=23708
+ Adds documentElementAvailable() callback to FrameLoaderClient.
- Merge r40511.
+ * WebFrame.cpp:
+ (WebFrame::documentElementAvailable):
+ Stub out documentElementAvailable()
+ * WebFrame.h:
+ Ditto.
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
+2009-02-04 Geoffrey Garen <ggaren@apple.com>
Build fix.
- * WebCoreSupport/WebFrameLoaderClient.cpp:
- (WebFrameLoaderClient::loadURLIntoChild):
-
-2009-02-04 Steve Falkenburg <sfalken@apple.com>
-
- Merge part of r40470.
-
- 2009-01-31 Matt Lilek <webkit@mattlilek.com>
-
- Not reviewed, build fixes.
-
- * WebCoreSupport/WebContextMenuClient.cpp:
- (WebContextMenuClient::searchWithGoogle):
-
-2009-02-03 Mark Rowe <mrowe@apple.com>
-
- Merge r40392.
-
- 2009-01-29 Sam Weinig <sam@webkit.org>
+ * WebHistory.cpp:
+ (WebHistory::visitedURL):
- Fix Windows build
+2009-02-04 Geoffrey Garen <ggaren@apple.com>
- * WebHistoryItem.cpp:
- (WebHistoryItem::initFromDictionaryRepresentation):
+ Reviewed by Mark Rowe.
+
+ Part I of <rdar://problem/6552272>.
-2009-02-03 Mark Rowe <mrowe@apple.com>
+ Clear the redirectURLs entry when first visiting a site, so sites that
+ only redirect you the first time you visit them can later learn that
+ they don't redirect.
- Merge r40529.
+ * WebHistory.cpp:
+ (WebHistory::visitedURL):
- 2009-02-03 Geoffrey Garen <ggaren@apple.com>
+2009-02-03 Geoffrey Garen <ggaren@apple.com>
Build fix.
* WebHistory.cpp:
(WebHistory::visitedURL):
-2009-02-03 Mark Rowe <mrowe@apple.com>
-
- Merge r40528.
-
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
Build fix.
* WebHistory.cpp:
(WebHistory::visitedURL):
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-02-02 Hiroaki Nakamura <hnakamur@gmail.com>
- Merge r40511.
-
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
-
- Build fix.
-
- * WebCoreSupport/WebFrameLoaderClient.cpp:
- (WebFrameLoaderClient::loadURLIntoChild):
+ Reviewed by Adam Roben.
-2009-02-03 Mark Rowe <mrowe@apple.com>
+ Fixes https://bugs.webkit.org/show_bug.cgi?id=15813
+ Modify pre-build step to properly handle the errorlevel
+ shell command.
- Merge r40508.
+ * WebKit.vcproj/WebKit.vcproj: Change errorlevel handling
+ for all targets so prefast is only enabled in builds
+ where /analyze is available.
- 2009-02-02 Geoffrey Garen <ggaren@apple.com>
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
@@ -199,11 +540,7 @@
* WebHistory.h: See above.
-2009-02-03 Mark Rowe <mrowe@apple.com>
-
- Merge r40503.
-
- 2009-02-02 Brady Eidson <beidson@apple.com>
+2009-02-02 Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein
@@ -221,42 +558,69 @@
(WebHistoryItem::visitedWithTitle):
* WebHistoryItem.h:
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-02-02 Anders Carlsson <andersca@apple.com>
- Merge r40382.
+ Fix build.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::createPlugin):
+ * WebCoreSupport/WebFrameLoaderClient.h:
- 2009-01-29 Sam Weinig <sam@webkit.org>
+2009-02-02 Anders Carlsson <andersca@apple.com>
- Reviewed by Anders Carlsson.
+ Reviewed by Dan Bernstein.
- Second step in tracking the urls a HistoryItem was redirected through
- Add SPI to access the array of redirect urls associated with a HistoryItem.
+ Update for changes to WebCore.
- * Interfaces/IWebHistoryItemPrivate.idl:
- * WebHistoryItem.cpp:
- (WebHistoryItem::dictionaryRepresentation):
- (WebHistoryItem::redirectURLs):
- * WebHistoryItem.h:
+ * WebFrame.cpp:
+ (WebFrame::createJavaAppletWidget):
+ * WebFrame.h:
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-02-02 Holger Hans Peter Freyther <zecke@selfish.org>
- Merge r40380.
+ Reviewed by Darin Adler.
- 2009-01-29 Sam Weinig <sam@webkit.org>
+ Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView
- Reviewed by Mark Rowe.
+ https://bugs.webkit.org/show_bug.cgi?id=23428
- First step in tracking the urls a HistoryItem was redirected through.
+ FrameView::forceLayout could be killed but the comment might
+ contain a value over the the plain FrameView::layout...
- * WebHistoryItem.cpp:
- (WebHistoryItem::initFromDictionaryRepresentation):
- (WebHistoryItem::dictionaryRepresentation):
+ Adjust the WebCore/WebKit consumers of these methods.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::forceLayout):
+
+2009-01-31 Matt Lilek <webkit@mattlilek.com>
+
+ Not reviewed, build fixes.
+
+ * WebCoreSupport/WebContextMenuClient.cpp:
+ (WebContextMenuClient::searchWithGoogle):
+ * WebFrame.cpp:
+ (WebFrame::setInPrintingMode):
+ (WebFrame::isFrameSet):
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2009-01-30 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
-2009-02-03 Mark Rowe <mrowe@apple.com>
+ Add a pref to disable web security.
- Merge r40436.
+ * Interfaces/IWebPreferencesPrivate.idl:
+ * WebPreferenceKeysPrivate.h:
+ * WebPreferences.cpp:
+ (WebPreferences::initializeDefaultSettings):
+ (WebPreferences::isWebSecurityEnabled):
+ (WebPreferences::setWebSecurityEnabled):
+ * WebPreferences.h:
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
- 2009-01-30 Geoffrey Garen <ggaren@apple.com>
+2009-01-30 Geoffrey Garen <ggaren@apple.com>
Build fix.
@@ -264,24 +628,59 @@
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::loadURLIntoChild):
-2009-02-03 Mark Rowe <mrowe@apple.com>
+2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org>
- Merge r40353.
+ Reviewed by Simon Hausmann.
- 2009-01-28 Geoffrey Garen <ggaren@apple.com>
+ Kill FrameLoaderClient.cpp, move the code over to Frame::createView
- Reviewed by Sam Weinig.
+ FrameLoaderClient is supposed to be an interface, move the
+ to be shared code to Frame which is a controller and is
+ allowed to create a FrameView.
- Updated for WebCore rename.
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
- * WebView.cpp:
- (WebView::setCustomTextEncodingName):
+2009-01-30 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
-2009-02-03 Mark Rowe <mrowe@apple.com>
+ Remove FrameLoaderClient code that is now handled by FrameLoader itself
- Merge r40366.
+ * WebFrame.cpp:
+ (WebFrame::frameLoadCompleted):
+
+2009-01-29 Sam Weinig <sam@webkit.org>
+
+ Fix Windows build
+
+ * WebHistoryItem.cpp:
+ (WebHistoryItem::initFromDictionaryRepresentation):
+
+2009-01-29 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Second step in tracking the urls a HistoryItem was redirected through
+ Add SPI to access the array of redirect urls associated with a HistoryItem.
+
+ * Interfaces/IWebHistoryItemPrivate.idl:
+ * WebHistoryItem.cpp:
+ (WebHistoryItem::dictionaryRepresentation):
+ (WebHistoryItem::redirectURLs):
+ * WebHistoryItem.h:
+
+2009-01-29 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ First step in tracking the urls a HistoryItem was redirected through.
- 2009-01-29 Adam Roben <aroben@apple.com>
+ * WebHistoryItem.cpp:
+ (WebHistoryItem::initFromDictionaryRepresentation):
+ (WebHistoryItem::dictionaryRepresentation):
+
+2009-01-29 Adam Roben <aroben@apple.com>
Fix Bug 23623: Windowed Flash instances aren't captured when a WebView
receives a WM_PRINTCLIENT message
@@ -313,6 +712,23 @@
* WebView.h: Added windowsToPaint parameters to paintIntoBackingStore
and updateBackingStore (which I also made private).
+2009-01-29 Adam Roben <aroben@apple.com>
+
+ Build fix after r40353
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::loadURLIntoChild): Removed the check for
+ FrameLoadTypeReloadAllowingStaleData.
+
+2009-01-28 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Updated for WebCore rename.
+
+ * WebView.cpp:
+ (WebView::setCustomTextEncodingName):
+
2009-01-27 Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein
diff --git a/WebKit/win/DOMCoreClasses.cpp b/WebKit/win/DOMCoreClasses.cpp
index 2da3e28..19f076f 100644
--- a/WebKit/win/DOMCoreClasses.cpp
+++ b/WebKit/win/DOMCoreClasses.cpp
@@ -381,7 +381,7 @@ HRESULT STDMETHODCALLTYPE DOMNode::dispatchEvent(
return hr;
WebCore::ExceptionCode ec = 0;
- *result = WebCore::EventTargetNodeCast(m_node)->dispatchEvent(domEvent->coreEvent(), ec) ? TRUE : FALSE;
+ *result = m_node->dispatchEvent(domEvent->coreEvent(), ec) ? TRUE : FALSE;
#if 0 // FIXME - raise dom exceptions
WebCore::raiseOnDOMError(ec);
#endif
diff --git a/WebKit/win/DOMHTMLClasses.cpp b/WebKit/win/DOMHTMLClasses.cpp
index 037aa88..ceb0374 100644
--- a/WebKit/win/DOMHTMLClasses.cpp
+++ b/WebKit/win/DOMHTMLClasses.cpp
@@ -180,10 +180,18 @@ HRESULT STDMETHODCALLTYPE DOMHTMLDocument::QueryInterface(REFIID riid, void** pp
// DOMHTMLDocument ------------------------------------------------------------
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::title(
- /* [retval][out] */ BSTR* /*result*/)
+ /* [retval][out] */ BSTR* result)
{
- ASSERT_NOT_REACHED();
- return E_NOTIMPL;
+ if (!result)
+ return E_POINTER;
+
+ *result = 0;
+
+ if (!m_document || !m_document->isHTMLDocument())
+ return E_FAIL;
+
+ *result = BString(m_document->title()).release();
+ return S_OK;
}
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::setTitle(
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index d1f6cbf..f00bec5 100755
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -83,4 +83,10 @@ interface IWebFramePrivate : IUnknown
HRESULT paintDocumentRectToContext([in] RECT rect, [in] OLE_HANDLE deviceContext);
HRESULT elementDoesAutoComplete([in] IDOMElement* element, [out, retval] BOOL* result);
+
+ HRESULT pauseAnimation([in] BSTR animationName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* animationWasRunning);
+ HRESULT pauseTransition([in] BSTR propertyName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* transitionWasRunning);
+ HRESULT numberOfActiveAnimations([out, retval] UINT* number);
+
+ HRESULT isDisplayingStandaloneImage([out, retval] BOOL* result);
}
diff --git a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
index aa1073f..b9e05ec 100644
--- a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
+++ b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
@@ -69,4 +69,10 @@ interface IWebPreferencesPrivate : IUnknown
HRESULT setFontSmoothingContrast([in] float contrast);
HRESULT fontSmoothingContrast([out, retval] float* contrast);
+
+ HRESULT isWebSecurityEnabled([out, retval] BOOL* enabled);
+ HRESULT setWebSecurityEnabled([in] BOOL enabled);
+
+ HRESULT allowUniversalAccessFromFileURLs([out, retval] BOOL *allowAccess);
+ HRESULT setAllowUniversalAccessFromFileURLs([in] BOOL allowAccess);
}
diff --git a/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl b/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl
index 95040bf..df23091 100644
--- a/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl
+++ b/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,7 +35,6 @@ interface IWebDataSource;
interface IWebURLResponse;
interface IWebURLRequest;
-
/*!
@category WebResourceLoadDelegatePrivate
*/
@@ -70,3 +69,14 @@ interface IWebResourceLoadDelegatePrivate2 : IWebResourceLoadDelegatePrivate
{
HRESULT shouldUseCredentialStorage([in] IWebView* webView, [in] unsigned long identifier, [in] IWebDataSource* dataSource, [out, retval] BOOL* shouldUse);
}
+
+[
+ object,
+ oleautomation,
+ uuid(099DC3C1-34B5-4169-ABBF-0C63CBC25605),
+ pointer_default(unique)
+]
+interface IWebResourceLoadDelegatePrivate3 : IWebResourceLoadDelegatePrivate2
+{
+ HRESULT shouldCacheResponse([in] IWebView* webView, [in] unsigned long identifier, [in] IWebURLResponse* response, [in] const char* data, [in] unsigned long long length, [in] IWebDataSource* dataSource, [out, retval] BOOL* shouldCache);
+}
diff --git a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
index 5ef53d9..c6d3bbd 100755
--- a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
+++ b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
@@ -92,3 +92,14 @@ interface IWebUIDelegatePrivate4 : IWebUIDelegatePrivate3
HRESULT embeddedViewWithArguments([in] IWebView* sender, [in] IWebFrame* frame, [in] IPropertyBag* arguments, [out, retval] IWebEmbeddedView** view);
HRESULT webViewSendResizeMessage([in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam);
}
+
+[
+ object,
+ oleautomation,
+ uuid(df3b4283-6868-4a1f-97f6-baf0b33f239c),
+ pointer_default(unique)
+]
+interface IWebUIDelegatePrivate5 : IWebUIDelegatePrivate4
+{
+ HRESULT webViewClosing([in] IWebView* sender);
+}
diff --git a/WebKit/win/Interfaces/IWebURLRequest.idl b/WebKit/win/Interfaces/IWebURLRequest.idl
index 0f72fa8..4b27592 100644
--- a/WebKit/win/Interfaces/IWebURLRequest.idl
+++ b/WebKit/win/Interfaces/IWebURLRequest.idl
@@ -110,4 +110,6 @@ interface IWebURLRequest : IUnknown
HRESULT isEmpty([out, retval] BOOL* result);
HRESULT mutableCopy([out, retval] IWebMutableURLRequest** result);
+
+ HRESULT isEqual([in] IWebURLRequest* other, [out, retval] BOOL* result);
}
diff --git a/WebKit/win/Interfaces/IWebView.idl b/WebKit/win/Interfaces/IWebView.idl
index e38406b..04e996c 100644
--- a/WebKit/win/Interfaces/IWebView.idl
+++ b/WebKit/win/Interfaces/IWebView.idl
@@ -723,6 +723,18 @@ interface IWebView : IUnknown
+ (void)registerURLSchemeAsLocal:(NSString *)scheme;
*/
HRESULT registerURLSchemeAsLocal([in] BSTR scheme);
+
+ /*!
+ @method close
+ @abstract Closes the receiver, unloading its web page and canceling any pending loads.
+ Once the receiver has closed, it will no longer respond to requests or fire delegate methods.
+ (However, the -close method itself may fire delegate methods.)
+ @discussion A garbage collected application is required to call close when the receiver is no longer needed.
+ The close method will be called automatically when the window or hostWindow closes and shouldCloseWithWindow returns YES.
+ A non-garbage collected application can still call close, providing a convenient way to prevent receiver
+ from doing any more loading and firing any future delegate methods.
+ */
+ HRESULT close();
}
/*
diff --git a/WebKit/win/Interfaces/IWebViewPrivate.idl b/WebKit/win/Interfaces/IWebViewPrivate.idl
index c32a20b..4362f89 100644
--- a/WebKit/win/Interfaces/IWebViewPrivate.idl
+++ b/WebKit/win/Interfaces/IWebViewPrivate.idl
@@ -157,4 +157,6 @@ interface IWebViewPrivate : IUnknown
HRESULT registerEmbeddedViewMIMEType([in] BSTR mimeType);
HRESULT setMemoryCacheDelegateCallsEnabled([in] BOOL enabled);
+
+ HRESULT setJavaScriptURLsAreAllowed([in] BOOL areAllowed);
}
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index a78a5d3..338ab71 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -367,3 +367,4 @@ library WebKit
}
}
+
diff --git a/WebKit/win/MarshallingHelpers.cpp b/WebKit/win/MarshallingHelpers.cpp
index 60f2749..0cec6de 100644
--- a/WebKit/win/MarshallingHelpers.cpp
+++ b/WebKit/win/MarshallingHelpers.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "WebKitDLL.h"
#include "MarshallingHelpers.h"
+#include "MathExtras.h"
#pragma warning(push, 0)
#include <WebCore/IntRect.h>
@@ -144,12 +145,12 @@ CFAbsoluteTime MarshallingHelpers::DATEToCFAbsoluteTime(DATE date)
// the reference date. Positive values indicate dates/times after the
// reference date.
- return (date + windowsEpochAbsoluteTime()) * secondsPerDay;
+ return round((date + windowsEpochAbsoluteTime()) * secondsPerDay);
}
DATE MarshallingHelpers::CFAbsoluteTimeToDATE(CFAbsoluteTime absoluteTime)
{
- return (absoluteTime/secondsPerDay - windowsEpochAbsoluteTime());
+ return (round(absoluteTime)/secondsPerDay - windowsEpochAbsoluteTime());
}
// utility method to store a 1-dim string vector into a newly created SAFEARRAY
diff --git a/WebKit/win/WebCache.cpp b/WebKit/win/WebCache.cpp
index 2e5c2e9..c7351b0 100644
--- a/WebKit/win/WebCache.cpp
+++ b/WebKit/win/WebCache.cpp
@@ -30,7 +30,9 @@
#include "CFDictionaryPropertyBag.h"
#pragma warning(push, 0)
+#include <WebCore/ApplicationCacheStorage.h>
#include <WebCore/Cache.h>
+#include <WebCore/CrossOriginPreflightResultCache.h>
#pragma warning(pop)
// WebCache ---------------------------------------------------------------------------
@@ -206,6 +208,13 @@ HRESULT STDMETHODCALLTYPE WebCache::empty( void)
return S_OK;
WebCore::cache()->setDisabled(true);
WebCore::cache()->setDisabled(false);
+
+ // Empty the application cache.
+ WebCore::cacheStorage().empty();
+
+ // Empty the Cross-Origin Preflight cache
+ WebCore::CrossOriginPreflightResultCache::shared().empty();
+
return S_OK;
}
diff --git a/WebKit/win/WebCoreLocalizedStrings.cpp b/WebKit/win/WebCoreLocalizedStrings.cpp
index 21dc35d..c383818 100644
--- a/WebKit/win/WebCoreLocalizedStrings.cpp
+++ b/WebKit/win/WebCoreLocalizedStrings.cpp
@@ -68,8 +68,8 @@ String WebCore::contextMenuItemTagBold() { return String(LPCTSTR_UI_STRING("Bold
String WebCore::contextMenuItemTagItalic() { return String(LPCTSTR_UI_STRING("Italic", "Italic context menu item")); }
String WebCore::contextMenuItemTagUnderline() { return String(LPCTSTR_UI_STRING("Underline", "Underline context menu item")); }
String WebCore::contextMenuItemTagOutline() { return String(LPCTSTR_UI_STRING("Outline", "Outline context menu item")); }
-String WebCore::contextMenuItemTagWritingDirectionMenu() { return String(LPCTSTR_UI_STRING("Writing Direction", "Writing direction context sub-menu item")); }
-String WebCore::contextMenuItemTagTextDirectionMenu() { return String(LPCTSTR_UI_STRING("Text Direction", "Text direction context sub-menu item")); }
+String WebCore::contextMenuItemTagWritingDirectionMenu() { return String(LPCTSTR_UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item")); }
+String WebCore::contextMenuItemTagTextDirectionMenu() { return String(LPCTSTR_UI_STRING("Selection Direction", "Selection direction context sub-menu item")); }
String WebCore::contextMenuItemTagDefaultDirection() { return String(LPCTSTR_UI_STRING("Default", "Default writing direction context menu item")); }
String WebCore::contextMenuItemTagLeftToRight() { return String(LPCTSTR_UI_STRING("Left to Right", "Left to Right context menu item")); }
String WebCore::contextMenuItemTagRightToLeft() { return String(LPCTSTR_UI_STRING("Right to Left", "Right to Left context menu item")); }
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 1af1673..c307660 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -41,6 +41,7 @@
#include "WebError.h"
#include "WebFrame.h"
#include "WebHistory.h"
+#include "WebHistoryItem.h"
#include "WebMutableURLRequest.h"
#include "WebNotificationCenter.h"
#include "WebScriptDebugServer.h"
@@ -53,9 +54,11 @@
#include <WebCore/FrameLoader.h>
#include <WebCore/FrameTree.h>
#include <WebCore/FrameView.h>
+#include <WebCore/HTMLAppletElement.h>
#include <WebCore/HTMLFrameElement.h>
#include <WebCore/HTMLFrameOwnerElement.h>
#include <WebCore/HTMLNames.h>
+#include <WebCore/HTMLPlugInElement.h>
#include <WebCore/HistoryItem.h>
#include <WebCore/Page.h>
#include <WebCore/PluginPackage.h>
@@ -91,7 +94,9 @@ bool WebFrameLoaderClient::hasWebView() const
void WebFrameLoaderClient::forceLayout()
{
- core(m_webFrame)->forceLayout(true);
+ FrameView* view = core(m_webFrame)->view();
+ if (view)
+ view->forceLayout(true);
}
void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
@@ -221,6 +226,25 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsign
resourceLoadDelegate->didFailLoadingWithError(webView, identifier, webError.get(), getWebDataSource(loader));
}
+bool WebFrameLoaderClient::shouldCacheResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const unsigned char* data, const unsigned long long length)
+{
+ WebView* webView = m_webFrame->webView();
+ COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
+ if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
+ return true;
+
+ COMPtr<IWebResourceLoadDelegatePrivate3> resourceLoadDelegatePrivate(Query, resourceLoadDelegate);
+ if (!resourceLoadDelegatePrivate)
+ return true;
+
+ COMPtr<IWebURLResponse> urlResponse(WebURLResponse::createInstance(response));
+ BOOL shouldCache;
+ if (SUCCEEDED(resourceLoadDelegatePrivate->shouldCacheResponse(webView, identifier, urlResponse.get(), data, length, getWebDataSource(loader), &shouldCache)))
+ return shouldCache;
+
+ return true;
+}
+
void WebFrameLoaderClient::dispatchDidHandleOnloadEvents()
{
WebView* webView = m_webFrame->webView();
@@ -457,27 +481,31 @@ void WebFrameLoaderClient::updateGlobalHistory()
return;
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
-
- if (loader->urlForHistoryReflectsServerRedirect()) {
- history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), loader->url(), false);
- return;
- }
-
- if (loader->urlForHistoryReflectsClientRedirect()) {
- history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), true);
- return;
- }
-
- history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), false);
+ history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure());
+ updateGlobalHistoryRedirectLinks();
}
-void WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem()
+void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
WebHistory* history = WebHistory::sharedHistory();
if (!history)
return;
+
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
- history->visitedURLForRedirectWithoutHistoryItem(loader->url());
+
+ if (!loader->clientRedirectSourceForHistory().isNull()) {
+ if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) {
+ COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem);
+ webHistoryItem->historyItem()->addRedirectURL(loader->clientRedirectDestinationForHistory());
+ }
+ }
+
+ if (!loader->serverRedirectSourceForHistory().isNull()) {
+ if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->serverRedirectSourceForHistory())) {
+ COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem);
+ webHistoryItem->historyItem()->addRedirectURL(loader->serverRedirectDestinationForHistory());
+ }
+ }
}
bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem*) const
@@ -548,7 +576,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
view->frameRect(&rect);
bool transparent = view->transparent();
Color backgroundColor = transparent ? Color::transparent : Color::white;
- WebCore::FrameLoaderClient::transitionToCommittedForNewPage(core(m_webFrame), IntRect(rect).size(), backgroundColor, transparent, IntSize(), false);
+ core(m_webFrame)->createView(IntRect(rect).size(), backgroundColor, transparent, IntSize(), false);
}
bool WebFrameLoaderClient::canCachePage() const
@@ -627,7 +655,7 @@ void WebFrameLoaderClient::loadURLIntoChild(const KURL& originalURL, const Strin
core(childFrame)->loader()->loadURL(url, referrer, frameName, false, childLoadType, 0, 0);
}
-Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
WebView* webView = m_webFrame->webView();
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index 3877273..ac7a8c7 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -56,6 +56,7 @@ public:
virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived);
virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier);
virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&);
+ virtual bool shouldCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&, const unsigned char* data, unsigned long long length);
virtual void dispatchDidHandleOnloadEvents();
virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
@@ -86,7 +87,7 @@ public:
virtual void finishedLoading(WebCore::DocumentLoader*);
virtual void updateGlobalHistory();
- virtual void updateGlobalHistoryForRedirectWithoutHistoryItem();
+ virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const;
virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
@@ -100,7 +101,7 @@ public:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually);
+ virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
virtual bool shouldUsePluginDocument(const WebCore::String& mimeType) const;
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 56cf0df..5bb1a83 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -201,6 +201,13 @@ String WebInspectorClient::localizedStringsURL()
return CFURLGetString(url.get());
}
+
+String WebInspectorClient::hiddenPanels()
+{
+ // FIXME: implement this
+ return String();
+}
+
void WebInspectorClient::showWindow()
{
showWindowWithoutNotifications();
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h
index 86317f6..b497788 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -50,6 +50,8 @@ public:
virtual WebCore::String localizedStringsURL();
+ virtual WebCore::String hiddenPanels();
+
virtual void showWindow();
virtual void closeWindow();
virtual bool windowVisible();
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 009111a..f1877fe 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -69,10 +69,12 @@
#include <WebCore/GDIObjectCounter.h>
#include <WebCore/GraphicsContext.h>
#include <WebCore/HistoryItem.h>
+#include <WebCore/HTMLAppletElement.h>
#include <WebCore/HTMLFormElement.h>
#include <WebCore/HTMLFormControlElement.h>
#include <WebCore/HTMLInputElement.h>
#include <WebCore/HTMLNames.h>
+#include <WebCore/HTMLPlugInElement.h>
#include <WebCore/JSDOMWindow.h>
#include <WebCore/KeyboardEvent.h>
#include <WebCore/MIMETypeRegistry.h>
@@ -1049,6 +1051,87 @@ HRESULT WebFrame::elementDoesAutoComplete(IDOMElement *element, BOOL *result)
return S_OK;
}
+HRESULT WebFrame::pauseAnimation(BSTR animationName, IDOMNode* node, double secondsFromNow, BOOL* animationWasRunning)
+{
+ if (!node || !animationWasRunning)
+ return E_POINTER;
+
+ *animationWasRunning = FALSE;
+
+ Frame* frame = core(this);
+ if (!frame)
+ return E_FAIL;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return E_FAIL;
+
+ COMPtr<DOMNode> domNode(Query, node);
+ if (!domNode)
+ return E_FAIL;
+
+ *animationWasRunning = controller->pauseAnimationAtTime(domNode->node()->renderer(), String(animationName, SysStringLen(animationName)), secondsFromNow);
+ return S_OK;
+}
+
+HRESULT WebFrame::pauseTransition(BSTR propertyName, IDOMNode* node, double secondsFromNow, BOOL* transitionWasRunning)
+{
+ if (!node || !transitionWasRunning)
+ return E_POINTER;
+
+ *transitionWasRunning = FALSE;
+
+ Frame* frame = core(this);
+ if (!frame)
+ return E_FAIL;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return E_FAIL;
+
+ COMPtr<DOMNode> domNode(Query, node);
+ if (!domNode)
+ return E_FAIL;
+
+ *transitionWasRunning = controller->pauseTransitionAtTime(domNode->node()->renderer(), String(propertyName, SysStringLen(propertyName)), secondsFromNow);
+ return S_OK;
+}
+
+HRESULT WebFrame::numberOfActiveAnimations(UINT* number)
+{
+ if (!number)
+ return E_POINTER;
+
+ *number = 0;
+
+ Frame* frame = core(this);
+ if (!frame)
+ return E_FAIL;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return E_FAIL;
+
+ *number = controller->numberOfActiveAnimations();
+ return S_OK;
+}
+
+HRESULT WebFrame::isDisplayingStandaloneImage(BOOL* result)
+{
+ if (!result)
+ return E_POINTER;
+
+ *result = FALSE;
+
+ Frame* frame = core(this);
+ if (!frame)
+ return E_FAIL;
+
+ Document* document = frame->document();
+ *result = document && document->isImageDocument();
+ return S_OK;
+}
+
HRESULT WebFrame::controlsInForm(IDOMElement* form, IDOMElement** controls, int* cControls)
{
if (!form)
@@ -1288,8 +1371,6 @@ String WebFrame::generatedMIMETypeForURLScheme(const String& /*URLScheme*/) cons
void WebFrame::frameLoadCompleted()
{
- if (Frame* coreFrame = core(this))
- coreFrame->loader()->setPreviousHistoryItem(0);
}
void WebFrame::restoreViewState()
@@ -1523,7 +1604,7 @@ void WebFrame::startDownload(const ResourceRequest&)
notImplemented();
}
-Widget* WebFrame::createJavaAppletWidget(const IntSize& pluginSize, Element* element, const KURL& /*baseURL*/, const Vector<String>& paramNames, const Vector<String>& paramValues)
+Widget* WebFrame::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* element, const KURL& /*baseURL*/, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
PluginView* pluginView = PluginView::create(core(this), pluginSize, element, KURL(), paramNames, paramValues, "application/x-java-applet", false);
@@ -1595,6 +1676,10 @@ void WebFrame::windowObjectCleared()
}
}
+void WebFrame::documentElementAvailable()
+{
+}
+
void WebFrame::didPerformFirstNavigation() const
{
COMPtr<IWebPreferences> preferences;
@@ -1643,7 +1728,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::setInPrintingMode(
return S_OK;
Frame* coreFrame = core(this);
- if (!coreFrame)
+ if (!coreFrame || !coreFrame->document())
return E_FAIL;
m_inPrintingMode = !!value;
@@ -1652,7 +1737,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::setInPrintingMode(
// according to the paper size
float minLayoutWidth = 0.0f;
float maxLayoutWidth = 0.0f;
- if (m_inPrintingMode && !coreFrame->isFrameSet()) {
+ if (m_inPrintingMode && !coreFrame->document()->isFrameSet()) {
if (!printDC) {
ASSERT_NOT_REACHED();
return E_POINTER;
@@ -1868,10 +1953,10 @@ HRESULT STDMETHODCALLTYPE WebFrame::isFrameSet(
*result = FALSE;
Frame* coreFrame = core(this);
- if (!coreFrame)
+ if (!coreFrame || !coreFrame->document())
return E_FAIL;
- *result = coreFrame->isFrameSet() ? TRUE : FALSE;
+ *result = coreFrame->document()->isFrameSet() ? TRUE : FALSE;
return S_OK;
}
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index bf234d3..bca32d4 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -223,7 +223,13 @@ public:
virtual HRESULT STDMETHODCALLTYPE elementDoesAutoComplete(
/* [in] */ IDOMElement* element,
/* [retval][out] */ BOOL* result);
-
+
+ virtual HRESULT STDMETHODCALLTYPE pauseAnimation(BSTR animationName, IDOMNode*, double secondsFromNow, BOOL* animationWasRunning);
+ virtual HRESULT STDMETHODCALLTYPE pauseTransition(BSTR propertyName, IDOMNode*, double secondsFromNow, BOOL* transitionWasRunning);
+ virtual HRESULT STDMETHODCALLTYPE numberOfActiveAnimations(UINT*);
+
+ virtual HRESULT STDMETHODCALLTYPE isDisplayingStandaloneImage(BOOL*);
+
// IWebDocumentText
virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding(
/* [retval][out] */ BOOL* result);
@@ -280,12 +286,13 @@ public:
virtual void dispatchDidFailLoad(const WebCore::ResourceError&);
virtual void startDownload(const WebCore::ResourceRequest&);
- virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL& baseURL, const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues);
+ virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues);
virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType);
virtual WebCore::String overrideMediaType() const;
virtual void windowObjectCleared();
+ virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
virtual void registerForIconNotification(bool listen);
diff --git a/WebKit/win/WebHistory.cpp b/WebKit/win/WebHistory.cpp
index 5ee2e32..e647e01 100644
--- a/WebKit/win/WebHistory.cpp
+++ b/WebKit/win/WebHistory.cpp
@@ -41,6 +41,7 @@
#include <WebCore/PageGroup.h>
#include <WebCore/HistoryItem.h>
#pragma warning( pop )
+#include <wtf/StdLibExtras.h>
using namespace WebCore;
@@ -176,7 +177,7 @@ ULONG STDMETHODCALLTYPE WebHistory::Release(void)
static inline COMPtr<WebHistory>& sharedHistoryStorage()
{
- static COMPtr<WebHistory> sharedHistory;
+ DEFINE_STATIC_LOCAL(COMPtr<WebHistory>, sharedHistory, ());
return sharedHistory;
}
@@ -680,18 +681,11 @@ HRESULT WebHistory::addItem(IWebHistoryItem* entry, bool discardDuplicate, bool*
return hr;
}
-void WebHistory::visitedURL(const KURL& url, const String& title, const String& httpMethod, bool wasFailure, const KURL& serverRedirectURL, bool isClientRedirect)
+void WebHistory::visitedURL(const KURL& url, const String& title, const String& httpMethod, bool wasFailure)
{
- if (isClientRedirect) {
- ASSERT(serverRedirectURL.isEmpty());
- if (m_lastVisitedEntry)
- m_lastVisitedEntry->historyItem()->addRedirectURL(url.string());
- }
-
RetainPtr<CFStringRef> urlString(AdoptCF, url.string().createCFString());
IWebHistoryItem* entry = (IWebHistoryItem*) CFDictionaryGetValue(m_entriesByURL.get(), urlString.get());
-
if (entry) {
COMPtr<IWebHistoryItemPrivate> entryPrivate(Query, entry);
if (!entryPrivate)
@@ -724,21 +718,16 @@ void WebHistory::visitedURL(const KURL& url, const String& title, const String&
addItemToDateCaches(entry);
- m_lastVisitedEntry.query(entry);
-
COMPtr<IWebHistoryItemPrivate> entryPrivate(Query, entry);
if (!entryPrivate)
return;
entryPrivate->setLastVisitWasFailure(wasFailure);
if (!httpMethod.isEmpty())
- entryPrivate->setLastVisitWasHTTPNonGet(!equalIgnoringCase(httpMethod, "GET"));
+ entryPrivate->setLastVisitWasHTTPNonGet(!equalIgnoringCase(httpMethod, "GET") && (url.protocolIs("http") || url.protocolIs("https")));
- if (!serverRedirectURL.isEmpty()) {
- ASSERT(!isClientRedirect);
- COMPtr<WebHistoryItem> item(Query, entry);
- item->historyItem()->addRedirectURL(serverRedirectURL);
- }
+ COMPtr<WebHistoryItem> item(Query, entry);
+ item->historyItem()->setRedirectURLs(std::auto_ptr<Vector<String> >());
CFDictionaryPropertyBag* userInfo = createUserInfoFromHistoryItem(
getNotificationString(kWebHistoryItemsAddedNotification), entry);
@@ -746,15 +735,9 @@ void WebHistory::visitedURL(const KURL& url, const String& title, const String&
releaseUserInfo(userInfo);
}
-void WebHistory::visitedURLForRedirectWithoutHistoryItem(const KURL& url)
-{
- if (m_lastVisitedEntry)
- m_lastVisitedEntry->historyItem()->addRedirectURL(url.string());
-}
-
HRESULT WebHistory::itemForURLString(
/* [in] */ CFStringRef urlString,
- /* [retval][out] */ IWebHistoryItem** item)
+ /* [retval][out] */ IWebHistoryItem** item) const
{
if (!item)
return E_FAIL;
@@ -792,6 +775,17 @@ HRESULT WebHistory::removeItemForURLString(CFStringRef urlString)
return hr;
}
+COMPtr<IWebHistoryItem> WebHistory::itemForURLString(const String& urlString) const
+{
+ RetainPtr<CFStringRef> urlCFString(AdoptCF, urlString.createCFString());
+ if (!urlCFString)
+ return 0;
+ COMPtr<IWebHistoryItem> item;
+ if (FAILED(itemForURLString(urlCFString.get(), &item)))
+ return 0;
+ return item;
+}
+
HRESULT WebHistory::addItemToDateCaches(IWebHistoryItem* entry)
{
HRESULT hr = S_OK;
diff --git a/WebKit/win/WebHistory.h b/WebKit/win/WebHistory.h
index 111f6ae..b1031b7 100644
--- a/WebKit/win/WebHistory.h
+++ b/WebKit/win/WebHistory.h
@@ -115,10 +115,11 @@ public:
// WebHistory
static WebHistory* sharedHistory();
- void visitedURL(const WebCore::KURL&, const WebCore::String& title, const WebCore::String& httpMethod, bool wasFailure, const WebCore::KURL& serverRedirectURL, bool isClientRedirect);
- void visitedURLForRedirectWithoutHistoryItem(const WebCore::KURL&);
+ void visitedURL(const WebCore::KURL&, const WebCore::String& title, const WebCore::String& httpMethod, bool wasFailure);
void addVisitedLinksToPageGroup(WebCore::PageGroup&);
+ COMPtr<IWebHistoryItem> itemForURLString(const WebCore::String&) const;
+
private:
enum NotificationType
{
@@ -144,14 +145,13 @@ private:
bool findIndex(int* index, CFAbsoluteTime forDay);
static CFAbsoluteTime timeToDate(CFAbsoluteTime time);
BSTR getNotificationString(NotificationType notifyType);
- HRESULT itemForURLString(CFStringRef urlString, IWebHistoryItem** item);
+ HRESULT itemForURLString(CFStringRef urlString, IWebHistoryItem** item) const;
ULONG m_refCount;
RetainPtr<CFMutableDictionaryRef> m_entriesByURL;
RetainPtr<CFMutableArrayRef> m_datesWithEntries;
RetainPtr<CFMutableArrayRef> m_entriesByDate;
COMPtr<WebPreferences> m_preferences;
- COMPtr<WebHistoryItem> m_lastVisitedEntry;
};
#endif
diff --git a/WebKit/win/WebKit.vcproj/WebKit.def b/WebKit/win/WebKit.vcproj/WebKit.def
index fa3f2bc..cc49cd0 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.def
+++ b/WebKit/win/WebKit.vcproj/WebKit.def
@@ -12,9 +12,14 @@ EXPORTS
JSClassRelease
JSClassRetain
JSContextGetGlobalObject
+ JSContextGetGroup
+ JSContextGroupCreate
+ JSContextGroupRelease
+ JSContextGroupRetain
JSEvaluateScript
JSGarbageCollect
JSGlobalContextCreate
+ JSGlobalContextCreateInGroup
JSGlobalContextRelease
JSGlobalContextRetain
JSObjectCallAsConstructor
@@ -32,6 +37,7 @@ EXPORTS
JSObjectMakeArray
JSObjectMakeConstructor
JSObjectMakeDate
+ JSObjectMakeError
JSObjectMakeFunction
JSObjectMakeFunctionWithCallback
JSObjectMakeRegExp
@@ -121,6 +127,9 @@ EXPORTS
?lock@Mutex@WTF@@QAEXXZ
?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
?signal@ThreadCondition@WTF@@QAEXXZ
+ ?timedWait@ThreadCondition@WTF@@QAE_NAAVMutex@2@N@Z
+ ?tlsKeyCount@WTF@@YAAAJXZ
+ ?tlsKeys@WTF@@YAPAKXZ
?tryLock@Mutex@WTF@@QAE_NXZ
?unlock@Mutex@WTF@@QAEXXZ
?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj
index 0740e8a..b578aee 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.vcproj
+++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj
@@ -23,7 +23,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 0 set EnablePREfast=&quot;false&quot; else set EnablePREfast=&quot;true&quot;&#x0D;&#x0A;if ERRORLEVEL 0 set AnalyzeWithLargeStack=&quot;&quot; AnalyzeWithLargeStack=&quot;/analyze:65536&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -99,7 +99,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 0 set EnablePREfast=&quot;false&quot; else set EnablePREfast=&quot;true&quot;&#x0D;&#x0A;if ERRORLEVEL 0 set AnalyzeWithLargeStack=&quot;&quot; AnalyzeWithLargeStack=&quot;/analyze:65536&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -174,7 +174,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 0 set EnablePREfast=&quot;false&quot; else set EnablePREfast=&quot;true&quot;&#x0D;&#x0A;if ERRORLEVEL 0 set AnalyzeWithLargeStack=&quot;&quot; AnalyzeWithLargeStack=&quot;/analyze:65536&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -252,7 +252,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 0 set EnablePREfast=&quot;false&quot; else set EnablePREfast=&quot;true&quot;&#x0D;&#x0A;if ERRORLEVEL 0 set AnalyzeWithLargeStack=&quot;&quot; AnalyzeWithLargeStack=&quot;/analyze:65536&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -331,7 +331,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 0 set EnablePREfast=&quot;false&quot; else set EnablePREfast=&quot;true&quot;&#x0D;&#x0A;if ERRORLEVEL 0 set AnalyzeWithLargeStack=&quot;&quot; AnalyzeWithLargeStack=&quot;/analyze:65536&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -408,7 +408,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 0 set EnablePREfast=&quot;false&quot; else set EnablePREfast=&quot;true&quot;&#x0D;&#x0A;if ERRORLEVEL 0 set AnalyzeWithLargeStack=&quot;&quot; AnalyzeWithLargeStack=&quot;/analyze:65536&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -487,7 +487,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 0 set EnablePREfast=&quot;false&quot; else set EnablePREfast=&quot;true&quot;&#x0D;&#x0A;if ERRORLEVEL 0 set AnalyzeWithLargeStack=&quot;&quot; AnalyzeWithLargeStack=&quot;/analyze:65536&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\include\JavaScriptCore\JavaScriptCore\*&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;bash &quot;$(WebKitLibrariesDir)\tools\scripts\auto-version.sh&quot; &quot;$(IntDir)&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -1448,7 +1448,6 @@
>
<FileConfiguration
Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
diff --git a/WebKit/win/WebKit.vcproj/WebKit_Cairo.def b/WebKit/win/WebKit.vcproj/WebKit_Cairo.def
index 50b3675..bc1a3f2 100755
--- a/WebKit/win/WebKit.vcproj/WebKit_Cairo.def
+++ b/WebKit/win/WebKit.vcproj/WebKit_Cairo.def
@@ -12,9 +12,14 @@ EXPORTS
JSClassRelease
JSClassRetain
JSContextGetGlobalObject
+ JSContextGetGroup
+ JSContextGroupCreate
+ JSContextGroupRelease
+ JSContextGroupRetain
JSEvaluateScript
JSGarbageCollect
JSGlobalContextCreate
+ JSGlobalContextCreateInGroup
JSGlobalContextRelease
JSGlobalContextRetain
JSObjectCallAsConstructor
@@ -32,6 +37,7 @@ EXPORTS
JSObjectMakeArray
JSObjectMakeConstructor
JSObjectMakeDate
+ JSObjectMakeError
JSObjectMakeFunction
JSObjectMakeFunctionWithCallback
JSObjectMakeRegExp
diff --git a/WebKit/win/WebKit.vcproj/WebKit_debug.def b/WebKit/win/WebKit.vcproj/WebKit_debug.def
index 6ed6a90..9fecf25 100644
--- a/WebKit/win/WebKit.vcproj/WebKit_debug.def
+++ b/WebKit/win/WebKit.vcproj/WebKit_debug.def
@@ -12,9 +12,14 @@ EXPORTS
JSClassRelease
JSClassRetain
JSContextGetGlobalObject
+ JSContextGetGroup
+ JSContextGroupCreate
+ JSContextGroupRelease
+ JSContextGroupRetain
JSEvaluateScript
JSGarbageCollect
JSGlobalContextCreate
+ JSGlobalContextCreateInGroup
JSGlobalContextRelease
JSGlobalContextRetain
JSObjectCallAsConstructor
@@ -32,6 +37,7 @@ EXPORTS
JSObjectMakeArray
JSObjectMakeConstructor
JSObjectMakeDate
+ JSObjectMakeError
JSObjectMakeFunction
JSObjectMakeFunctionWithCallback
JSObjectMakeRegExp
@@ -121,6 +127,9 @@ EXPORTS
?lock@Mutex@WTF@@QAEXXZ
?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
?signal@ThreadCondition@WTF@@QAEXXZ
+ ?timedWait@ThreadCondition@WTF@@QAE_NAAVMutex@2@N@Z
+ ?tlsKeyCount@WTF@@YAAAJXZ
+ ?tlsKeys@WTF@@YAPAKXZ
?tryLock@Mutex@WTF@@QAE_NXZ
?unlock@Mutex@WTF@@QAEXXZ
?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
diff --git a/WebKit/win/WebMutableURLRequest.cpp b/WebKit/win/WebMutableURLRequest.cpp
index 63a060e..035fac3 100644
--- a/WebKit/win/WebMutableURLRequest.cpp
+++ b/WebKit/win/WebMutableURLRequest.cpp
@@ -33,6 +33,7 @@
#include <CFNetwork/CFURLRequestPriv.h>
#pragma warning(push, 0)
#include <WebCore/BString.h>
+#include <WebCore/COMPtr.h>
#include <WebCore/CString.h>
#include <WebCore/FormData.h>
#include <WebCore/NotImplemented.h>
@@ -240,6 +241,22 @@ HRESULT STDMETHODCALLTYPE WebMutableURLRequest::isEmpty(
return S_OK;
}
+HRESULT STDMETHODCALLTYPE WebMutableURLRequest::isEqual(
+ /* [in] */ IWebURLRequest* other,
+ /* [out, retval] */ BOOL* result)
+{
+ COMPtr<WebMutableURLRequest> requestImpl(Query, other);
+
+ if (!requestImpl) {
+ *result = FALSE;
+ return S_OK;
+ }
+
+ *result = m_request == requestImpl->resourceRequest();
+ return S_OK;
+}
+
+
// IWebMutableURLRequest --------------------------------------------------------
HRESULT STDMETHODCALLTYPE WebMutableURLRequest::addValue(
@@ -314,11 +331,13 @@ HRESULT STDMETHODCALLTYPE WebMutableURLRequest::setURL(
}
HRESULT STDMETHODCALLTYPE WebMutableURLRequest::setValue(
- /* [in] */ BSTR /*value*/,
- /* [in] */ BSTR /*field*/)
+ /* [in] */ BSTR value,
+ /* [in] */ BSTR field)
{
- ASSERT_NOT_REACHED();
- return E_NOTIMPL;
+ String valueString(value, SysStringLen(value));
+ String fieldString(field, SysStringLen(field));
+ m_request.setHTTPHeaderField(fieldString, valueString);
+ return S_OK;
}
HRESULT STDMETHODCALLTYPE WebMutableURLRequest::setAllowsAnyHTTPSCertificate(void)
diff --git a/WebKit/win/WebMutableURLRequest.h b/WebKit/win/WebMutableURLRequest.h
index 1007a02..77dc1a0 100644
--- a/WebKit/win/WebMutableURLRequest.h
+++ b/WebKit/win/WebMutableURLRequest.h
@@ -113,6 +113,10 @@ public:
virtual HRESULT STDMETHODCALLTYPE mutableCopy(
/* [out, retval] */ IWebMutableURLRequest** result);
+ virtual HRESULT STDMETHODCALLTYPE isEqual(
+ /* [in] */ IWebURLRequest* other,
+ /* [out, retval] */ BOOL* result);
+
// IWebMutableURLRequest
virtual HRESULT STDMETHODCALLTYPE addValue(
/* [in] */ BSTR value,
diff --git a/WebKit/win/WebPreferenceKeysPrivate.h b/WebKit/win/WebPreferenceKeysPrivate.h
index 758254e..8426271 100644
--- a/WebKit/win/WebPreferenceKeysPrivate.h
+++ b/WebKit/win/WebPreferenceKeysPrivate.h
@@ -47,6 +47,8 @@
#define WebKitTextAreasAreResizablePreferenceKey "WebKitTextAreasAreResizable"
#define WebKitJavaEnabledPreferenceKey "WebKitJavaEnabled"
#define WebKitJavaScriptEnabledPreferenceKey "WebKitJavaScriptEnabled"
+#define WebKitWebSecurityEnabledPreferenceKey "WebKitWebSecurityEnabled"
+#define WebKitAllowUniversalAccessFromFileURLsPreferenceKey "WebKitAllowUniversalAccessFromFileURLs"
#define WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey "WebKitJavaScriptCanOpenWindowsAutomatically"
#define WebKitPluginsEnabledPreferenceKey "WebKitPluginsEnabled"
#define WebKitDatabasesEnabledPreferenceKey "WebKitDatabasesEnabled"
diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp
index 5fcd319..ac77376 100644
--- a/WebKit/win/WebPreferences.cpp
+++ b/WebKit/win/WebPreferences.cpp
@@ -203,6 +203,8 @@ void WebPreferences::initializeDefaultSettings()
CFDictionaryAddValue(defaults, CFSTR(WebKitTextAreasAreResizablePreferenceKey), kCFBooleanFalse);
CFDictionaryAddValue(defaults, CFSTR(WebKitJavaEnabledPreferenceKey), kCFBooleanTrue);
CFDictionaryAddValue(defaults, CFSTR(WebKitJavaScriptEnabledPreferenceKey), kCFBooleanTrue);
+ CFDictionaryAddValue(defaults, CFSTR(WebKitWebSecurityEnabledPreferenceKey), kCFBooleanTrue);
+ CFDictionaryAddValue(defaults, CFSTR(WebKitAllowUniversalAccessFromFileURLsPreferenceKey), kCFBooleanTrue);
CFDictionaryAddValue(defaults, CFSTR(WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey), kCFBooleanTrue);
CFDictionaryAddValue(defaults, CFSTR(WebKitPluginsEnabledPreferenceKey), kCFBooleanTrue);
CFDictionaryAddValue(defaults, CFSTR(WebKitDatabasesEnabledPreferenceKey), kCFBooleanTrue);
@@ -751,6 +753,34 @@ HRESULT STDMETHODCALLTYPE WebPreferences::setJavaScriptEnabled(
return S_OK;
}
+HRESULT STDMETHODCALLTYPE WebPreferences::isWebSecurityEnabled(
+ /* [retval][out] */ BOOL* enabled)
+{
+ *enabled = boolValueForKey(CFSTR(WebKitWebSecurityEnabledPreferenceKey));
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::setWebSecurityEnabled(
+ /* [in] */ BOOL enabled)
+{
+ setBoolValue(CFSTR(WebKitWebSecurityEnabledPreferenceKey), enabled);
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::allowUniversalAccessFromFileURLs(
+ /* [retval][out] */ BOOL* allowAccess)
+{
+ *allowAccess = boolValueForKey(CFSTR(WebKitAllowUniversalAccessFromFileURLsPreferenceKey));
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::setAllowUniversalAccessFromFileURLs(
+ /* [in] */ BOOL allowAccess)
+{
+ setBoolValue(CFSTR(WebKitAllowUniversalAccessFromFileURLsPreferenceKey), allowAccess);
+ return S_OK;
+}
+
HRESULT STDMETHODCALLTYPE WebPreferences::javaScriptCanOpenWindowsAutomatically(
/* [retval][out] */ BOOL* enabled)
{
diff --git a/WebKit/win/WebPreferences.h b/WebKit/win/WebPreferences.h
index 6ab3dcb..b6bcf6d 100644
--- a/WebKit/win/WebPreferences.h
+++ b/WebKit/win/WebPreferences.h
@@ -344,6 +344,18 @@ public:
virtual HRESULT STDMETHODCALLTYPE setFontSmoothingContrast(
/* [in] */ float contrast);
+ virtual HRESULT STDMETHODCALLTYPE isWebSecurityEnabled(
+ /* [retval][out] */ BOOL* enabled);
+
+ virtual HRESULT STDMETHODCALLTYPE setWebSecurityEnabled(
+ /* [in] */ BOOL enabled);
+
+ virtual HRESULT STDMETHODCALLTYPE allowUniversalAccessFromFileURLs(
+ /* [retval][out] */ BOOL* allowAccess);
+
+ virtual HRESULT STDMETHODCALLTYPE setAllowUniversalAccessFromFileURLs(
+ /* [in] */ BOOL allowAccess);
+
// WebPreferences
// This method accesses a different preference key than developerExtrasEnabled.
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index eb176dc..20c43fd 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -50,7 +50,6 @@
#include "WebNotificationCenter.h"
#include "WebPreferences.h"
#pragma warning( push, 0 )
-#include <CoreGraphics/CGContext.h>
#include <WebCore/ApplicationCacheStorage.h>
#include <WebCore/AXObjectCache.h>
#include <WebCore/BString.h>
@@ -105,10 +104,21 @@
#include <JavaScriptCore/InitializeThreading.h>
#include <JavaScriptCore/JSLock.h>
#include <JavaScriptCore/JSValue.h>
+
+#if PLATFORM(CG)
+#include <CoreGraphics/CGContext.h>
+#endif
+
+#if PLATFORM(CF)
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
+#if USE(CFNETWORK)
#include <CFNetwork/CFURLCachePriv.h>
#include <CFNetwork/CFURLProtocolPriv.h>
-#include <CoreFoundation/CoreFoundation.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif
+
#include <wtf/HashSet.h>
#include <dimm.h>
#include <oleacc.h>
@@ -127,20 +137,6 @@ static HashSet<WebView*> pendingDeleteBackingStoreSet;
static String osVersion();
static String webKitVersion();
-typedef CFURLCacheRef (*CopySharedURLCacheFunction)();
-
-static HMODULE findCFNetworkModule()
-{
- if (HMODULE module = GetModuleHandleA("CFNetwork"))
- return module;
- return GetModuleHandleA("CFNetwork_debug");
-}
-
-static CopySharedURLCacheFunction findCopySharedURLCacheFunction()
-{
- return reinterpret_cast<CopySharedURLCacheFunction>(GetProcAddress(findCFNetworkModule(), "CFURLCacheCopySharedURLCache"));
-}
-
WebView* kit(Page* page)
{
return page ? static_cast<WebChromeClient*>(page->chrome()->client())->webView() : 0;
@@ -328,7 +324,7 @@ WebView::~WebView()
// <rdar://4958382> m_viewWindow will be destroyed when m_hostWindow is destroyed, but if
// setHostWindow was never called we will leak our HWND. If we still have a valid HWND at
// this point, we should just destroy it ourselves.
- if (::IsWindow(m_viewWindow))
+ if (!isBeingDestroyed() && ::IsWindow(m_viewWindow))
::DestroyWindow(m_viewWindow);
// the tooltip window needs to be explicitly destroyed since it isn't a WS_CHILD
@@ -380,18 +376,11 @@ void WebView::removeFromAllWebViewsSet()
void WebView::setCacheModel(WebCacheModel cacheModel)
{
+#if USE(CFNETWORK)
if (s_didSetCacheModel && cacheModel == s_cacheModel)
return;
- // Once we require a newer version of CFNetwork with the CFURLCacheCopySharedURLCache function,
- // we can call CFURLCacheCopySharedURLCache directly and eliminate copySharedURLCache.
- static CopySharedURLCacheFunction copySharedURLCache = findCopySharedURLCacheFunction();
- RetainPtr<CFURLCacheRef> cfurlCache;
- if (copySharedURLCache)
- cfurlCache.adoptCF(copySharedURLCache());
- else
- cfurlCache = CFURLCacheSharedURLCache();
-
+ RetainPtr<CFURLCacheRef> cfurlCache(AdoptCF, CFURLCacheCopySharedURLCache());
RetainPtr<CFStringRef> cfurlCacheDirectory(AdoptCF, wkCopyFoundationCacheDirectory());
if (!cfurlCacheDirectory)
cfurlCacheDirectory.adoptCF(WebCore::localUserSpecificStorageDirectory().createCFString());
@@ -563,6 +552,7 @@ void WebView::setCacheModel(WebCacheModel cacheModel)
s_didSetCacheModel = true;
s_cacheModel = cacheModel;
return;
+#endif
}
WebCacheModel WebView::cacheModel()
@@ -594,13 +584,19 @@ WebCacheModel WebView::maxCacheModelInAnyInstance()
return cacheModel;
}
-void WebView::close()
+HRESULT STDMETHODCALLTYPE WebView::close()
{
if (m_didClose)
- return;
+ return S_OK;
m_didClose = true;
+ if (m_uiDelegatePrivate) {
+ COMPtr<IWebUIDelegatePrivate5> uiDelegatePrivate5(Query, m_uiDelegatePrivate);
+ if (uiDelegatePrivate5)
+ uiDelegatePrivate5->webViewClosing(this);
+ }
+
removeFromAllWebViewsSet();
Frame* frame = m_page->mainFrame();
@@ -648,6 +644,7 @@ void WebView::close()
}
deleteBackingStore();
+ return S_OK;
}
void WebView::repaint(const WebCore::IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
@@ -1333,7 +1330,7 @@ bool WebView::handleMouseEvent(UINT message, WPARAM wParam, LPARAM lParam)
return handled;
}
-bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isHorizontal)
+bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isMouseHWheel)
{
// Ctrl+Mouse wheel doesn't ever go into WebCore. It is used to
// zoom instead (Mac zooms the whole Desktop, but Windows browsers trigger their
@@ -1347,7 +1344,7 @@ bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isHorizontal)
return true;
}
- PlatformWheelEvent wheelEvent(m_viewWindow, wParam, lParam, isHorizontal);
+ PlatformWheelEvent wheelEvent(m_viewWindow, wParam, lParam, isMouseHWheel);
Frame* coreFrame = core(m_mainFrame);
if (!coreFrame)
return false;
@@ -1682,11 +1679,13 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
{
LRESULT lResult = 0;
LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
- COMPtr<WebView> webView = reinterpret_cast<WebView*>(longPtr); // hold a ref, since the WebView could go away in an event handler.
+ WebView* webView = reinterpret_cast<WebView*>(longPtr);
WebFrame* mainFrameImpl = webView ? webView->topLevelFrame() : 0;
if (!mainFrameImpl || webView->isBeingDestroyed())
return DefWindowProc(hWnd, message, wParam, lParam);
+ // hold a ref, since the WebView could go away in an event handler.
+ COMPtr<WebView> protector(webView);
ASSERT(webView);
// Windows Media Player has a modal message loop that will deliver messages
@@ -1734,7 +1733,7 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
case WM_VISTA_MOUSEHWHEEL:
if (Frame* coreFrame = core(mainFrameImpl))
if (coreFrame->view()->didFirstLayout())
- handled = webView->mouseWheel(wParam, lParam, (wParam & MK_SHIFT) || message == WM_VISTA_MOUSEHWHEEL);
+ handled = webView->mouseWheel(wParam, lParam, message == WM_VISTA_MOUSEHWHEEL);
break;
case WM_SYSKEYDOWN:
handled = webView->keyDown(wParam, lParam, true);
@@ -1778,7 +1777,7 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
COMPtr<IWebUIDelegatePrivate> uiDelegatePrivate;
if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
- uiDelegatePrivate->webViewReceivedFocus(webView.get());
+ uiDelegatePrivate->webViewReceivedFocus(webView);
FocusController* focusController = webView->page()->focusController();
if (Frame* frame = focusController->focusedFrame()) {
@@ -1796,7 +1795,7 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
HWND newFocusWnd = reinterpret_cast<HWND>(wParam);
if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
- uiDelegatePrivate->webViewLostFocus(webView.get(), (OLE_HANDLE)(ULONG64)newFocusWnd);
+ uiDelegatePrivate->webViewLostFocus(webView, (OLE_HANDLE)(ULONG64)newFocusWnd);
FocusController* focusController = webView->page()->focusController();
Frame* frame = focusController->focusedOrMainFrame();
@@ -1872,7 +1871,7 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
}
if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate &&
- SUCCEEDED(uiDelegatePrivate->webViewGetDlgCode(webView.get(), keyCode, &dlgCode)))
+ SUCCEEDED(uiDelegatePrivate->webViewGetDlgCode(webView, keyCode, &dlgCode)))
return dlgCode;
handled = false;
break;
@@ -3129,7 +3128,7 @@ HRESULT STDMETHODCALLTYPE WebView::centerSelectionInVisibleArea(
if (!coreFrame)
return E_FAIL;
- coreFrame->revealSelection(RenderLayer::gAlignCenterAlways);
+ coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
return S_OK;
}
@@ -4204,6 +4203,16 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
return hr;
settings->setLocalStorageEnabled(enabled);
+ hr = prefsPrivate->isWebSecurityEnabled(&enabled);
+ if (FAILED(hr))
+ return hr;
+ settings->setWebSecurityEnabled(!!enabled);
+
+ hr = prefsPrivate->allowUniversalAccessFromFileURLs(&enabled);
+ if (FAILED(hr))
+ return hr;
+ settings->setAllowUniversalAccessFromFileURLs(!!enabled);
+
#if USE(SAFARI_THEME)
hr = prefsPrivate->shouldPaintNativeControls(&enabled);
if (FAILED(hr))
@@ -4231,9 +4240,11 @@ HRESULT updateSharedSettingsFromPreferencesIfNeeded(IWebPreferences* preferences
if (FAILED(hr))
return hr;
+#if USE(CFNETWORK)
// Set cookie storage accept policy
if (CFHTTPCookieStorageRef cookieStorage = currentCookieStorage())
CFHTTPCookieStorageSetCookieAcceptPolicy(cookieStorage, acceptPolicy);
+#endif
return S_OK;
}
@@ -4680,7 +4691,7 @@ void WebView::releaseIMMContext(HIMC hIMC)
void WebView::prepareCandidateWindow(Frame* targetFrame, HIMC hInputContext)
{
IntRect caret;
- if (RefPtr<Range> range = targetFrame->selection()->selection().toRange()) {
+ if (RefPtr<Range> range = targetFrame->selection()->selection().toNormalizedRange()) {
ExceptionCode ec = 0;
RefPtr<Range> tempRange = range->cloneRange(ec);
caret = targetFrame->firstRectForRange(tempRange.get());
@@ -4843,7 +4854,7 @@ bool WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* char
{
IntRect caret;
ASSERT(charPos->dwCharPos == 0 || targetFrame->editor()->hasComposition());
- if (RefPtr<Range> range = targetFrame->editor()->hasComposition() ? targetFrame->editor()->compositionRange() : targetFrame->selection()->selection().toRange()) {
+ if (RefPtr<Range> range = targetFrame->editor()->hasComposition() ? targetFrame->editor()->compositionRange() : targetFrame->selection()->selection().toNormalizedRange()) {
ExceptionCode ec = 0;
RefPtr<Range> tempRange = range->cloneRange(ec);
tempRange->setStart(tempRange->startContainer(ec), tempRange->startOffset(ec) + charPos->dwCharPos, ec);
@@ -4861,7 +4872,7 @@ bool WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* char
bool WebView::onIMERequestReconvertString(Frame* targetFrame, RECONVERTSTRING* reconvertString, LRESULT* result)
{
- RefPtr<Range> selectedRange = targetFrame->selection()->toRange();
+ RefPtr<Range> selectedRange = targetFrame->selection()->toNormalizedRange();
String text = selectedRange->text();
if (!reconvertString) {
*result = sizeof(RECONVERTSTRING) + text.length() * sizeof(UChar);
@@ -5160,6 +5171,12 @@ HRESULT WebView::setMemoryCacheDelegateCallsEnabled(BOOL enabled)
return S_OK;
}
+HRESULT WebView::setJavaScriptURLsAreAllowed(BOOL areAllowed)
+{
+ m_page->setJavaScriptURLsAreAllowed(areAllowed);
+ return S_OK;
+}
+
class EnumTextMatches : public IEnumTextMatches
{
long m_ref;
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index 281defd..23905b7 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -296,6 +296,8 @@ public:
virtual HRESULT STDMETHODCALLTYPE registerURLSchemeAsLocal(
/* [in] */ BSTR scheme);
+ virtual HRESULT STDMETHODCALLTYPE close();
+
// IWebIBActions
virtual HRESULT STDMETHODCALLTYPE takeStringURLFrom(
@@ -724,6 +726,9 @@ public:
virtual HRESULT STDMETHODCALLTYPE setMemoryCacheDelegateCallsEnabled(
/* [in] */ BOOL enabled);
+ virtual HRESULT STDMETHODCALLTYPE setJavaScriptURLsAreAllowed(
+ /* [in] */ BOOL areAllowed);
+
// WebView
bool shouldUseEmbeddedView(const WebCore::String& mimeType) const;
@@ -736,7 +741,7 @@ public:
bool onInitMenuPopup(WPARAM, LPARAM);
bool onUninitMenuPopup(WPARAM, LPARAM);
void performContextMenuAction(WPARAM, LPARAM, bool byPosition);
- bool mouseWheel(WPARAM, LPARAM, bool isHorizontal);
+ bool mouseWheel(WPARAM, LPARAM, bool isMouseHWheel);
bool execCommand(WPARAM wParam, LPARAM lParam);
bool keyDown(WPARAM, LPARAM, bool systemKeyDown = false);
bool keyUp(WPARAM, LPARAM, bool systemKeyDown = false);
@@ -753,7 +758,6 @@ public:
void frameRect(RECT* rect);
void closeWindow();
void closeWindowSoon();
- void close();
bool didClose() const { return m_didClose; }
bool transparent() const { return m_transparent; }
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index a7212f0..c82850a 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,93 @@
+2009-03-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ Build fixes for wxWidgets Mac trunk build.
+
+ * WebView.h:
+ * bindings/python/webview.i:
+ * bindings/python/wxwebkit-py.bkl:
+ * dependencies.bkl:
+ * presets/wxwebkit.bkl:
+
+2009-02-11 Dimitri Dupuis-latour <dupuislatour@apple.com>
+
+ Stub out InspectorClientWx::hiddenPanels.
+
+ Reviewed by Timothy Hatcher.
+
+ * WebKitSupport/InspectorClientWx.cpp:
+ (WebCore::InspectorClientWx::hiddenPanels):
+ * WebKitSupport/InspectorClientWx.h:
+
+2009-02-06 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::updateGlobalHistoryRedirectLinks):
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2009-02-05 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23708
+ Adds documentElementAvailable() callback to FrameLoaderClient.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::documentElementAvailable):
+ Stub out documentElementAvailable().
+ * WebKitSupport/FrameLoaderClientWx.h:
+ Ditto.
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::updateGlobalHistoryForRedirectWithoutHistoryItem):
+ (WebCore::FrameLoaderClientWx::createPlugin):
+ (WebCore::FrameLoaderClientWx::createJavaAppletWidget):
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2009-02-02 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * WebFrame.cpp:
+ (wxWebFrame::LoadURL):
+
+2009-01-31 Darin Adler <darin@apple.com>
+
+ Build fix.
+
+ * WebView.cpp:
+ (wxWebView::OnSize): call sendResizeEvent on EventHandler.
+
+2009-01-29 David Kilzer <ddkilzer@apple.com>
+
+ Build fix for Wx: Finish de-RefCount-ing FrameLoaderClientWx
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::ref): Removed.
+ (WebCore::FrameLoaderClientWx::deref): Removed.
+ * WebKitSupport/FrameLoaderClientWx.h: Ditto.
+
+2009-01-28 David Kilzer <ddkilzer@apple.com>
+
+ Bug 23490: Remove initialRefCount argument from RefCounted class
+
+ <https://bugs.webkit.org/show_bug.cgi?id=23490>
+
+ Reviewed by Darin Adler.
+
+ FrameLoaderClientWx is no longer a RefCounted class.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::FrameLoaderClientWx): Removed call
+ to the RefCounted<FrameLoaderClientWx>(0) super constructor.
+ * WebKitSupport/FrameLoaderClientWx.h: Don't include RefCounted.h
+ and stop inheriting from RefCounted<FrameLoaderClientWx>.
+
2009-01-27 Brady Eidson <beidson@apple.com>
Reviewed by Dan Bernstein
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index 7bfcc5d..b479a41 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -39,16 +39,17 @@
#include "RenderTreeAsText.h"
#include "RenderObject.h"
#include "RenderView.h"
-
-#include "EditorClientWx.h"
-#include "FrameLoaderClientWx.h"
-
#include "ScriptController.h"
#include "ScriptValue.h"
+#include "TextEncoding.h"
+
#include "JSDOMBinding.h"
#include <runtime/JSValue.h>
#include <runtime/UString.h>
+#include "EditorClientWx.h"
+#include "FrameLoaderClientWx.h"
+
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
@@ -141,7 +142,7 @@ void wxWebFrame::SetPageSource(const wxString& source, const wxString& baseUrl)
{
if (m_impl->frame && m_impl->frame->loader()) {
WebCore::FrameLoader* loader = m_impl->frame->loader();
- loader->begin(WebCore::KURL(static_cast<const char*>(baseUrl.mb_str(wxConvUTF8))));
+ loader->begin(WebCore::KURL(WebCore::KURL(), static_cast<const char*>(baseUrl.mb_str(wxConvUTF8)), WebCore::UTF8Encoding()));
loader->write(static_cast<const WebCore::String>(source));
loader->end();
}
@@ -194,7 +195,7 @@ bool wxWebFrame::FindString(const wxString& string, bool forward, bool caseSensi
void wxWebFrame::LoadURL(const wxString& url)
{
if (m_impl->frame && m_impl->frame->loader()) {
- WebCore::KURL kurl = WebCore::KURL(static_cast<const char*>(url.mb_str(wxConvUTF8)));
+ WebCore::KURL kurl = WebCore::KURL(WebCore::KURL(), static_cast<const char*>(url.mb_str(wxConvUTF8)), WebCore::UTF8Encoding());
// NB: This is an ugly fix, but CURL won't load sub-resources if the
// protocol is omitted; sadly, it will not emit an error, either, so
// there's no way for us to catch this problem the correct way yet.
@@ -209,7 +210,7 @@ void wxWebFrame::LoadURL(const wxString& url)
kurl.setPath("//" + kurl.path());
}
}
- m_impl->frame->loader()->load(kurl);
+ m_impl->frame->loader()->load(kurl, false);
}
}
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index a34576d..3cfd86e 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -70,8 +70,7 @@ inline int wxNavTypeFromWebNavType(NavigationType type){
}
FrameLoaderClientWx::FrameLoaderClientWx()
- : RefCounted<FrameLoaderClientWx>(0)
- , m_frame(0)
+ : m_frame(0)
{
}
@@ -95,16 +94,6 @@ void FrameLoaderClientWx::detachFrameLoader()
m_frame = 0;
}
-void FrameLoaderClientWx::ref()
-{
- RefCounted<FrameLoaderClientWx>::ref();
-}
-
-void FrameLoaderClientWx::deref()
-{
- RefCounted<FrameLoaderClientWx>::deref();
-}
-
bool FrameLoaderClientWx::hasWebView() const
{
notImplemented();
@@ -531,6 +520,11 @@ void FrameLoaderClientWx::updateGlobalHistory()
notImplemented();
}
+void FrameLoaderClientWx::updateGlobalHistoryRedirectLinks()
+{
+ notImplemented();
+}
+
bool FrameLoaderClientWx::shouldGoToHistoryItem(WebCore::HistoryItem*) const
{
notImplemented();
@@ -791,7 +785,7 @@ ObjectContentType FrameLoaderClientWx::objectContentType(const KURL& url, const
return ObjectContentType();
}
-Widget* FrameLoaderClientWx::createPlugin(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually)
+Widget* FrameLoaderClientWx::createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually)
{
notImplemented();
return 0;
@@ -809,7 +803,7 @@ ResourceError FrameLoaderClientWx::pluginWillHandleLoadError(const ResourceRespo
return ResourceError();
}
-Widget* FrameLoaderClientWx::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL,
+Widget* FrameLoaderClientWx::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
const Vector<String>& paramNames, const Vector<String>& paramValues)
{
notImplemented();
@@ -827,6 +821,10 @@ void FrameLoaderClientWx::windowObjectCleared()
notImplemented();
}
+void FrameLoaderClientWx::documentElementAvailable()
+{
+}
+
void FrameLoaderClientWx::didPerformFirstNavigation() const
{
notImplemented();
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
index 9ad4ddc..43b3a8f 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -31,7 +31,6 @@
#include "FrameLoaderClient.h"
#include "FrameLoader.h"
#include "KURL.h"
-#include "RefCounted.h"
#include "ResourceResponse.h"
class wxWebView;
@@ -48,7 +47,7 @@ namespace WebCore {
struct LoadErrorResetToken;
- class FrameLoaderClientWx : public FrameLoaderClient, public RefCounted<FrameLoaderClientWx> {
+ class FrameLoaderClientWx : public FrameLoaderClient {
public:
FrameLoaderClientWx();
~FrameLoaderClientWx();
@@ -56,9 +55,6 @@ namespace WebCore {
void setWebView(wxWebView *webview);
virtual void detachFrameLoader();
- virtual void ref();
- virtual void deref();
-
virtual bool hasWebView() const; // mainly for assertions
virtual bool hasBackForwardList() const;
@@ -149,6 +145,7 @@ namespace WebCore {
virtual void transitionToCommittedForNewPage();
virtual void updateGlobalHistory();
+ virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
virtual void saveScrollPositionAndViewStateToItem(HistoryItem*);
virtual bool canCachePage() const;
@@ -192,16 +189,17 @@ namespace WebCore {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual Widget* createPlugin(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) ;
+ virtual Widget* createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) ;
virtual void redirectDataToPlugin(Widget* pluginWidget);
virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&);
- virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues);
+ virtual Widget* createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues);
virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
virtual String overrideMediaType() const;
virtual void windowObjectCleared();
+ virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.cpp b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
index 9e87da6..75e4595 100644
--- a/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
@@ -59,6 +59,12 @@ String InspectorClientWx::localizedStringsURL()
return String();
}
+String InspectorClientWx::hiddenPanels()
+{
+ notImplemented();
+ return String();
+}
+
void InspectorClientWx::showWindow()
{
notImplemented();
diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.h b/WebKit/wx/WebKitSupport/InspectorClientWx.h
index 6dd05df..ad3ad5b 100644
--- a/WebKit/wx/WebKitSupport/InspectorClientWx.h
+++ b/WebKit/wx/WebKitSupport/InspectorClientWx.h
@@ -45,6 +45,8 @@ public:
virtual String localizedStringsURL();
+ virtual String hiddenPanels();
+
virtual void showWindow();
virtual void closeWindow();
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
index 6ed8aef..94c760b 100644
--- a/WebKit/wx/WebView.cpp
+++ b/WebKit/wx/WebView.cpp
@@ -481,7 +481,7 @@ void wxWebView::OnSize(wxSizeEvent& event)
{
if (m_isInitialized && m_mainFrame) {
WebCore::Frame* frame = m_mainFrame->GetFrame();
- frame->sendResizeEvent();
+ frame->eventHandler()->sendResizeEvent();
frame->view()->layout();
frame->view()->adjustScrollbars();
}
diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h
index 387d193..b041b08 100644
--- a/WebKit/wx/WebView.h
+++ b/WebKit/wx/WebView.h
@@ -58,7 +58,9 @@ namespace WebCore {
#define WXDLLIMPEXP_WEBKIT
#endif // SWIG
+#ifndef SWIG
extern WXDLLIMPEXP_WEBKIT const wxChar* wxWebViewNameStr;
+#endif
class WXDLLIMPEXP_WEBKIT wxWebView : public wxWindow
{
diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i
index e9926ad..44b38ab 100644
--- a/WebKit/wx/bindings/python/webview.i
+++ b/WebKit/wx/bindings/python/webview.i
@@ -31,12 +31,13 @@
#include "WebView.h"
#include "WebBrowserShell.h"
%}
-
//---------------------------------------------------------------------------
%import core.i
%import windows.i
+MAKE_CONST_WXSTRING(WebViewNameStr);
+
MustHaveApp(wxWebView);
MustHaveApp(wxWebBrowserShell);
diff --git a/WebKit/wx/bindings/python/wxwebkit-py.bkl b/WebKit/wx/bindings/python/wxwebkit-py.bkl
index d6c2f7a..8c49a67 100644
--- a/WebKit/wx/bindings/python/wxwebkit-py.bkl
+++ b/WebKit/wx/bindings/python/wxwebkit-py.bkl
@@ -81,9 +81,10 @@ Bakefile for wxWebKit Python bindings.
<if cond="FORMAT=='gnu'">
<sys-lib>png</sys-lib>
<set var="MAC_FLAGS">
- <if cond="WX_PORT=='mac'">-bundle -undefined dynamic_lookup</if>
+ <if cond="PLATFORM_OS=='mac'">-bundle -undefined dynamic_lookup</if>
</set>
+ <sys-lib>python2.5</sys-lib>
<ldflags>$(MAC_FLAGS)</ldflags>
</if>
<if cond="FORMAT in ['msvc','msvs2005prj']">
diff --git a/WebKit/wx/dependencies.bkl b/WebKit/wx/dependencies.bkl
index e9eedb4..cbdb7e3 100644
--- a/WebKit/wx/dependencies.bkl
+++ b/WebKit/wx/dependencies.bkl
@@ -139,11 +139,11 @@ and WebCore. Include this file to use these settings.
<if cond="FORMAT=='gnu'">
<!-- Mac includes ICU with the system, but doesn't include headers or
icu-config, so we have to hardcode settings there. -->
- <set var="ICU_INCLUDE"><if cond="WX_PORT=='mac'">$(WK_ROOT)/JavaScriptCore/icu</if></set>
- <set var="ICU_INCLUDE"><if cond="WX_PORT=='mac'">$(WK_ROOT)/WebCore/icu</if></set>
- <set var="ICU_LIB"><if cond="WX_PORT=='mac'">icucore</if></set>
- <set var="ICU_LDFLAGS"><if cond="WX_PORT=='gtk2'">$(DOLLAR)(shell icu-config --ldflags)</if></set>
- <set var="ICU_CFLAGS"><if cond="WX_PORT=='gtk2'">$(DOLLAR)(shell icu-config --cppflags)</if></set>
+ <set var="ICU_INCLUDE"><if cond="PLATFORM_OS=='mac'">$(WK_ROOT)/JavaScriptCore/icu</if></set>
+ <set var="ICU_INCLUDE"><if cond="PLATFORM_OS=='mac'">$(WK_ROOT)/WebCore/icu</if></set>
+ <set var="ICU_LIB"><if cond="PLATFORM_OS=='mac'">icucore</if></set>
+ <set var="ICU_LDFLAGS"><if cond="PLATFORM_OS=='linux'">$(DOLLAR)(shell icu-config --ldflags)</if></set>
+ <set var="ICU_CFLAGS"><if cond="PLATFORM_OS=='linux'">$(DOLLAR)(shell icu-config --cppflags)</if></set>
<include>$(ICU_INCLUDE)</include>
<sys-lib>$(ICU_LIB)</sys-lib>
diff --git a/WebKit/wx/presets/wxwebkit.bkl b/WebKit/wx/presets/wxwebkit.bkl
index df21c67..026ac55 100644
--- a/WebKit/wx/presets/wxwebkit.bkl
+++ b/WebKit/wx/presets/wxwebkit.bkl
@@ -71,6 +71,17 @@ and WebCore. Include this file to use these settings.
</option>
</if>
+ <if cond="not isdefined('PLATFORM_OS')">
+ <option name="PLATFORM_OS">
+ <values>linux,mac,win</values>
+ <default-value force="1">win</default-value>
+ <description>
+ Platform the wx library is being built on
+ </description>
+ </option>
+ </if>
+
+
<if cond="not isdefined('DEBUG')">
<option name="DEBUG">
<values>0,1</values>