summaryrefslogtreecommitdiffstats
path: root/WebKit/mac
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
commit1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch)
tree4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebKit/mac
parent9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff)
downloadexternal_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebKit/mac')
-rw-r--r--WebKit/mac/Carbon/CarbonUtils.h6
-rw-r--r--WebKit/mac/Carbon/CarbonWindowAdapter.m3
-rw-r--r--WebKit/mac/Carbon/HIViewAdapter.m2
-rw-r--r--WebKit/mac/Carbon/HIWebView.h32
-rw-r--r--WebKit/mac/Carbon/HIWebView.m32
-rw-r--r--WebKit/mac/ChangeLog7514
-rw-r--r--WebKit/mac/Configurations/Base.xcconfig20
-rw-r--r--WebKit/mac/Configurations/DebugRelease.xcconfig11
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig25
-rw-r--r--WebKit/mac/Configurations/WebKit.xcconfig8
-rw-r--r--WebKit/mac/DOM/WebDOMOperations.mm265
-rw-r--r--WebKit/mac/DOM/WebDOMOperationsPrivate.h10
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm5
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m18
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m5
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m19
-rw-r--r--WebKit/mac/DefaultDelegates/WebScriptDebugServer.h94
-rw-r--r--WebKit/mac/DefaultDelegates/WebScriptDebugServer.m381
-rw-r--r--WebKit/mac/DefaultDelegates/WebScriptDebugServerPrivate.h82
-rw-r--r--WebKit/mac/ForwardingHeaders/debugger/DebuggerCallFrame.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/kjs/function.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/kjs/internal.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/kjs/object.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/kjs/string_object.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/kjs/value.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/runtime/JSFunction.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/runtime/JSLock.h (renamed from WebKit/mac/ForwardingHeaders/kjs/JSLock.h)0
-rw-r--r--WebKit/mac/ForwardingHeaders/runtime/JSObject.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/runtime/JSString.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/runtime/JSValue.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/runtime/SymbolTable.h (renamed from WebKit/mac/ForwardingHeaders/kjs/SymbolTable.h)0
-rw-r--r--WebKit/mac/ForwardingHeaders/wtf/Deque.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/wtf/Locker.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/wtf/RefCountedLeakCounter.h2
-rw-r--r--WebKit/mac/ForwardingHeaders/wtf/Threading.h1
-rw-r--r--WebKit/mac/ForwardingHeaders/wtf/UnusedParam.h1
-rw-r--r--WebKit/mac/History/WebBackForwardList.mm9
-rw-r--r--WebKit/mac/History/WebHistory.mm485
-rw-r--r--WebKit/mac/History/WebHistoryInternal.h (renamed from WebKit/mac/Plugins/WebBaseNetscapePluginViewInternal.h)17
-rw-r--r--WebKit/mac/History/WebHistoryItem.mm27
-rw-r--r--WebKit/mac/History/WebHistoryItemInternal.h10
-rw-r--r--WebKit/mac/History/WebHistoryPrivate.h75
-rw-r--r--WebKit/mac/Info.plist2
-rw-r--r--WebKit/mac/MigrateHeaders.make15
-rw-r--r--WebKit/mac/Misc/EmptyProtocolDefinitions.h48
-rw-r--r--WebKit/mac/Misc/WebCache.mm20
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.h5
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.mm72
-rw-r--r--WebKit/mac/Misc/WebDownload.m11
-rw-r--r--WebKit/mac/Misc/WebElementDictionary.mm19
-rw-r--r--WebKit/mac/Misc/WebGraphicsExtras.c2
-rw-r--r--WebKit/mac/Misc/WebIconDatabase.mm7
-rw-r--r--WebKit/mac/Misc/WebIconFetcher.h36
-rw-r--r--WebKit/mac/Misc/WebIconFetcher.mm126
-rw-r--r--WebKit/mac/Misc/WebIconFetcherInternal.h42
-rw-r--r--WebKit/mac/Misc/WebKitErrors.m4
-rw-r--r--WebKit/mac/Misc/WebKitLogging.h2
-rw-r--r--WebKit/mac/Misc/WebKitNSStringExtras.h2
-rw-r--r--WebKit/mac/Misc/WebKitNSStringExtras.m27
-rw-r--r--WebKit/mac/Misc/WebKitStatistics.m4
-rw-r--r--WebKit/mac/Misc/WebKitStatisticsPrivate.h1
-rw-r--r--WebKit/mac/Misc/WebKitSystemBits.h2
-rw-r--r--WebKit/mac/Misc/WebKitSystemBits.m23
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h18
-rw-r--r--WebKit/mac/Misc/WebLocalizableStrings.m2
-rw-r--r--WebKit/mac/Misc/WebNSArrayExtras.m2
-rw-r--r--WebKit/mac/Misc/WebNSAttributedStringExtras.mm480
-rw-r--r--WebKit/mac/Misc/WebNSControlExtras.m7
-rw-r--r--WebKit/mac/Misc/WebNSDataExtras.m2
-rw-r--r--WebKit/mac/Misc/WebNSDictionaryExtras.m2
-rw-r--r--WebKit/mac/Misc/WebNSFileManagerExtras.h11
-rw-r--r--WebKit/mac/Misc/WebNSFileManagerExtras.m194
-rw-r--r--WebKit/mac/Misc/WebNSPasteboardExtras.mm3
-rw-r--r--WebKit/mac/Misc/WebNSURLExtras.mm170
-rw-r--r--WebKit/mac/Misc/WebNSUserDefaultsExtras.m7
-rw-r--r--WebKit/mac/Misc/WebNSViewExtras.m17
-rw-r--r--WebKit/mac/Misc/WebNSWindowExtras.m5
-rw-r--r--WebKit/mac/Misc/WebSearchableTextView.m261
-rw-r--r--WebKit/mac/Misc/WebTypesInternal.h9
-rw-r--r--WebKit/mac/Panels/WebAuthenticationPanel.m6
-rw-r--r--WebKit/mac/Panels/WebPanelAuthenticationHandler.m2
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginStream.h134
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm640
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.h81
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.mm1735
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginViewPrivate.h53
-rw-r--r--WebKit/mac/Plugins/WebBasePluginPackage.h3
-rw-r--r--WebKit/mac/Plugins/WebBasePluginPackage.m108
-rw-r--r--WebKit/mac/Plugins/WebKitPluginContainerView.h2
-rw-r--r--WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.c28
-rw-r--r--WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h28
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.h45
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.mm50
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandler.h82
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm50
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h81
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm411
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h65
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm205
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginPackage.h3
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginPackage.m31
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginStream.h57
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginStream.mm154
-rw-r--r--WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h2
-rw-r--r--WebKit/mac/Plugins/WebPlugin.h37
-rw-r--r--WebKit/mac/Plugins/WebPluginContainerCheck.mm15
-rw-r--r--WebKit/mac/Plugins/WebPluginController.h7
-rw-r--r--WebKit/mac/Plugins/WebPluginController.mm58
-rw-r--r--WebKit/mac/Plugins/WebPluginDatabase.h8
-rw-r--r--WebKit/mac/Plugins/WebPluginDatabase.mm (renamed from WebKit/mac/Plugins/WebPluginDatabase.m)100
-rw-r--r--WebKit/mac/Plugins/WebPluginPrivate.h44
-rw-r--r--WebKit/mac/Plugins/WebPluginViewFactory.h10
-rw-r--r--WebKit/mac/Plugins/WebPluginViewFactoryPrivate.h9
-rw-r--r--WebKit/mac/Plugins/npapi.mm (renamed from WebKit/mac/Plugins/npapi.m)52
-rw-r--r--WebKit/mac/Plugins/npfunctions.h161
-rw-r--r--WebKit/mac/Plugins/nptextinput.h108
-rw-r--r--WebKit/mac/Storage/WebDatabaseManager.mm1
-rw-r--r--WebKit/mac/Storage/WebDatabaseTrackerClient.mm1
-rw-r--r--WebKit/mac/Storage/WebSecurityOrigin.mm24
-rw-r--r--WebKit/mac/Storage/WebSecurityOriginInternal.h2
-rw-r--r--WebKit/mac/Storage/WebSecurityOriginPrivate.h5
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.h42
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.mm281
-rw-r--r--WebKit/mac/WebCoreSupport/WebContextMenuClient.mm4
-rw-r--r--WebKit/mac/WebCoreSupport/WebDragClient.mm10
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.h5
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.mm17
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameBridge.h83
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameBridge.mm746
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h33
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm790
-rw-r--r--WebKit/mac/WebCoreSupport/WebImageRendererFactory.m6
-rw-r--r--WebKit/mac/WebCoreSupport/WebInspectorClient.h11
-rw-r--r--WebKit/mac/WebCoreSupport/WebInspectorClient.mm293
-rw-r--r--WebKit/mac/WebCoreSupport/WebJavaScriptTextInputPanel.m2
-rw-r--r--WebKit/mac/WebCoreSupport/WebKeyGenerator.m2
-rw-r--r--WebKit/mac/WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm57
-rw-r--r--WebKit/mac/WebCoreSupport/WebSystemInterface.m38
-rw-r--r--WebKit/mac/WebCoreSupport/WebViewFactory.mm83
-rw-r--r--WebKit/mac/WebInspector/WebInspector.h14
-rw-r--r--WebKit/mac/WebInspector/WebInspector.mm101
-rw-r--r--WebKit/mac/WebInspector/WebNodeHighlight.h26
-rw-r--r--WebKit/mac/WebInspector/WebNodeHighlight.m124
-rw-r--r--WebKit/mac/WebInspector/WebNodeHighlightView.h8
-rw-r--r--WebKit/mac/WebInspector/WebNodeHighlightView.m116
-rw-r--r--WebKit/mac/WebKit.exp10
-rw-r--r--WebKit/mac/WebKit.order2702
-rw-r--r--WebKit/mac/WebKitPrefix.h24
-rw-r--r--WebKit/mac/WebView/WebArchive.m255
-rw-r--r--WebKit/mac/WebView/WebArchive.mm374
-rw-r--r--WebKit/mac/WebView/WebArchiveInternal.h (renamed from WebKit/mac/WebView/WebScriptDebugDelegatePrivate.h)24
-rw-r--r--WebKit/mac/WebView/WebArchiver.mm189
-rw-r--r--WebKit/mac/WebView/WebClipView.m4
-rw-r--r--WebKit/mac/WebView/WebDataSource.mm172
-rw-r--r--WebKit/mac/WebView/WebDataSourceInternal.h22
-rw-r--r--WebKit/mac/WebView/WebDataSourcePrivate.h6
-rw-r--r--WebKit/mac/WebView/WebDocumentInternal.h29
-rw-r--r--WebKit/mac/WebView/WebDocumentLoaderMac.h13
-rw-r--r--WebKit/mac/WebView/WebDocumentPrivate.h8
-rw-r--r--WebKit/mac/WebView/WebDynamicScrollBarsView.h45
-rw-r--r--WebKit/mac/WebView/WebDynamicScrollBarsView.m170
-rw-r--r--WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h (renamed from WebKit/mac/Plugins/WebPluginJava.h)38
-rw-r--r--WebKit/mac/WebView/WebFrame.mm1048
-rw-r--r--WebKit/mac/WebView/WebFrameInternal.h110
-rw-r--r--WebKit/mac/WebView/WebFrameLoadDelegate.h3
-rw-r--r--WebKit/mac/WebView/WebFramePrivate.h22
-rw-r--r--WebKit/mac/WebView/WebFrameView.mm206
-rw-r--r--WebKit/mac/WebView/WebFrameViewInternal.h5
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentation.mm162
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentationInternal.h (renamed from WebKit/mac/Misc/WebSearchableTextView.h)7
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentationPrivate.h2
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm794
-rw-r--r--WebKit/mac/WebView/WebHTMLViewInternal.h84
-rw-r--r--WebKit/mac/WebView/WebHTMLViewPrivate.h26
-rw-r--r--WebKit/mac/WebView/WebPDFRepresentation.m2
-rw-r--r--WebKit/mac/WebView/WebPDFView.h2
-rw-r--r--WebKit/mac/WebView/WebPDFView.mm53
-rw-r--r--WebKit/mac/WebView/WebPolicyDelegate.mm7
-rw-r--r--WebKit/mac/WebView/WebPolicyDelegatePrivate.h4
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h7
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm (renamed from WebKit/mac/WebView/WebPreferences.m)86
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h20
-rw-r--r--WebKit/mac/WebView/WebRenderNode.mm71
-rw-r--r--WebKit/mac/WebView/WebResource.h1
-rw-r--r--WebKit/mac/WebView/WebResource.mm306
-rw-r--r--WebKit/mac/WebView/WebResourceInternal.h (renamed from WebKit/mac/WebView/WebArchiver.h)28
-rw-r--r--WebKit/mac/WebView/WebResourcePrivate.h9
-rw-r--r--WebKit/mac/WebView/WebScriptDebugDelegate.h7
-rw-r--r--WebKit/mac/WebView/WebScriptDebugDelegate.mm190
-rw-r--r--WebKit/mac/WebView/WebScriptDebugger.h (renamed from WebKit/mac/WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h)55
-rw-r--r--WebKit/mac/WebView/WebScriptDebugger.mm193
-rw-r--r--WebKit/mac/WebView/WebTextIterator.h66
-rw-r--r--WebKit/mac/WebView/WebTextIterator.mm108
-rw-r--r--WebKit/mac/WebView/WebUIDelegate.h31
-rw-r--r--WebKit/mac/WebView/WebUIDelegatePrivate.h9
-rw-r--r--WebKit/mac/WebView/WebUnarchivingState.h45
-rw-r--r--WebKit/mac/WebView/WebUnarchivingState.m98
-rw-r--r--WebKit/mac/WebView/WebView.h16
-rw-r--r--WebKit/mac/WebView/WebView.mm1471
-rw-r--r--WebKit/mac/WebView/WebViewInternal.h33
-rw-r--r--WebKit/mac/WebView/WebViewPrivate.h61
-rw-r--r--WebKit/mac/icu/unicode/utf_old.h1
202 files changed, 17659 insertions, 10296 deletions
diff --git a/WebKit/mac/Carbon/CarbonUtils.h b/WebKit/mac/Carbon/CarbonUtils.h
index ee4f42e..f005286 100644
--- a/WebKit/mac/Carbon/CarbonUtils.h
+++ b/WebKit/mac/Carbon/CarbonUtils.h
@@ -33,6 +33,8 @@
// These functions are only available for 32-bit.
+#include <JavaScriptCore/WebKitAvailability.h>
+
#ifdef __OBJC__
#import <ApplicationServices/ApplicationServices.h>
@class NSImage;
@@ -43,12 +45,12 @@ extern "C" {
#endif
extern void
-WebInitForCarbon(void);
+WebInitForCarbon(void) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
#ifdef __OBJC__
extern CGImageRef
-WebConvertNSImageToCGImageRef(NSImage * inImage);
+WebConvertNSImageToCGImageRef(NSImage * inImage) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
#endif
diff --git a/WebKit/mac/Carbon/CarbonWindowAdapter.m b/WebKit/mac/Carbon/CarbonWindowAdapter.m
index e34cf7a..843fc59 100644
--- a/WebKit/mac/Carbon/CarbonWindowAdapter.m
+++ b/WebKit/mac/Carbon/CarbonWindowAdapter.m
@@ -281,6 +281,8 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
// Clean up.
- (void)dealloc {
+ if (WebCoreObjCScheduleDeallocateOnMainThread([CarbonWindowAdapter class], self))
+ return;
// Clean up, if necessary.
// if we didn't remove the event handler at dealloc time, we would risk getting sent events after the window has been deallocated. See 2702179. M.P. Notice - 6/1/01
@@ -288,7 +290,6 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
// Do the standard Cocoa thing.
[super dealloc];
-
}
- (void)finalize {
diff --git a/WebKit/mac/Carbon/HIViewAdapter.m b/WebKit/mac/Carbon/HIViewAdapter.m
index c0c46af..d11bea4 100644
--- a/WebKit/mac/Carbon/HIViewAdapter.m
+++ b/WebKit/mac/Carbon/HIViewAdapter.m
@@ -31,7 +31,7 @@
#import "HIViewAdapter.h"
#import "WebNSObjectExtras.h"
-#import <JavaScriptCore/Assertions.h>
+#import <wtf/Assertions.h>
static void SetViewNeedsDisplay(HIViewRef inView, RgnHandle inRegion, Boolean inNeedsDisplay);
diff --git a/WebKit/mac/Carbon/HIWebView.h b/WebKit/mac/Carbon/HIWebView.h
index 44d6d86..5483472 100644
--- a/WebKit/mac/Carbon/HIWebView.h
+++ b/WebKit/mac/Carbon/HIWebView.h
@@ -33,7 +33,7 @@
#include <Carbon/Carbon.h>
-#include <AvailabilityMacros.h>
+#include <JavaScriptCore/WebKitAvailability.h>
#if PRAGMA_ONCE
#pragma once
@@ -67,37 +67,11 @@ extern "C" {
* Non-Carbon CFM: not available
*/
extern OSStatus
-HIWebViewCreate(HIViewRef * outControl);
+HIWebViewCreate(HIViewRef * outControl) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
#ifdef __OBJC__
/*
- * HIWebViewCreateWithClass(HIViewRef * outControl, Class aClass)
- *
- * Summary:
- * Creates a new web view using the specified subclass of WebView.
- *
- * Parameters:
- *
- * aClass:
- * Either WebView, or a subclass, to be created and wrapped in an HIWebView.
- * outControl:
- * The new web view.
- *
- * Result:
- * An operating system status code.
- *
- * Availability:
- * Mac OS X: in version 10.4 and later [32-bit only]
- * CarbonLib: not available
- * Non-Carbon CFM: not available
- */
-extern OSStatus
-HIWebViewCreateWithClass(
- Class aClass,
- HIViewRef * outControl);
-
-/*
* HIWebViewGetWebView()
*
* Summary:
@@ -117,7 +91,7 @@ HIWebViewCreateWithClass(
* Non-Carbon CFM: not available
*/
extern WebView *
-HIWebViewGetWebView(HIViewRef inView);
+HIWebViewGetWebView(HIViewRef inView) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_3_1;
#endif
diff --git a/WebKit/mac/Carbon/HIWebView.m b/WebKit/mac/Carbon/HIWebView.m
index 2b9bda4..b461394 100644
--- a/WebKit/mac/Carbon/HIWebView.m
+++ b/WebKit/mac/Carbon/HIWebView.m
@@ -202,39 +202,15 @@ static inline void HIRectToQDRect( const HIRect* inRect, Rect* outRect )
outRect->right = (SInt16)CGRectGetMaxX( *inRect );
}
-static Class webViewClass;
-
//----------------------------------------------------------------------------------
// HIWebViewCreate
//----------------------------------------------------------------------------------
//
OSStatus
-HIWebViewCreate( HIViewRef* outControl )
+HIWebViewCreate(HIViewRef* outControl)
{
- OSStatus err;
-
- HIWebViewRegisterClass();
-
- webViewClass = [WebView class];
- err = HIObjectCreate( kHIWebViewClassID, NULL, (HIObjectRef*)outControl );
-
- return err;
-}
-
-//----------------------------------------------------------------------------------
-// HIWebViewCreateWithClass
-//----------------------------------------------------------------------------------
-//
-OSStatus HIWebViewCreateWithClass(Class aClass, HIViewRef * outControl)
-{
- OSStatus err;
-
- HIWebViewRegisterClass();
-
- webViewClass = aClass;
- err = HIObjectCreate( kHIWebViewClassID, NULL, (HIObjectRef*)outControl );
-
- return err;
+ HIWebViewRegisterClass();
+ return HIObjectCreate(kHIWebViewClassID, NULL, (HIObjectRef*)outControl);
}
//----------------------------------------------------------------------------------
@@ -269,7 +245,7 @@ HIWebViewConstructor( HIViewRef inView )
view->fViewRef = inView;
- WebView *webView = [[webViewClass alloc] initWithFrame: frame];
+ WebView *webView = [[WebView alloc] initWithFrame: frame];
CFRetain(webView);
[webView release];
view->fWebView = webView;
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 33780f7..78db0ab 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,7465 @@
+2008-11-01 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22030
+ Make EventNames usable from multiple threads
+
+ * WebView/WebHTMLView.mm:
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+ Access event names via eventNames() function.
+
+2008-11-04 Cameron Zwarich <zwarich@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Delete a forwarding header for a file that no longer exists.
+
+ * ForwardingHeaders/kjs/string_object.h: Removed.
+
+2008-11-03 Cameron Zwarich <zwarich@apple.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Move more files into the runtime subdirectory of JavaScriptCore.
+
+ * ForwardingHeaders/kjs/JSLock.h: Removed.
+ * ForwardingHeaders/kjs/SymbolTable.h: Removed.
+ * ForwardingHeaders/runtime/JSLock.h: Copied from ForwardingHeaders/kjs/JSLock.h.
+ * ForwardingHeaders/runtime/SymbolTable.h: Copied from ForwardingHeaders/kjs/SymbolTable.h.
+ * Misc/WebCoreStatistics.mm:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ * Plugins/WebPluginController.mm:
+ * WebView/WebFrame.mm:
+ * WebView/WebScriptDebugDelegate.mm:
+ * WebView/WebView.mm:
+
+2008-11-03 Mark Rowe <mrowe@apple.com>
+
+ Fix the 64-bit build.
+
+ Pull the frequently-made check for drawingModel == NPDrawingModelQuickDraw out into a
+ helper function to avoid #ifdef'ing all of the new places that this check is made.
+
+ A few other #ifdef's are moved inside functions to allow their call sites to remain #ifdef-free,
+ and we rely on the compiler to optimise out the check (which will always be false in 64-bit) instead.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (isDrawingModelQuickDraw):
+ (-[WebBaseNetscapePluginView fixWindowPort]):
+ (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]):
+ (-[WebBaseNetscapePluginView updateAndSetWindow]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView tellQuickTimeToChill]):
+ (-[WebBaseNetscapePluginView viewWillMoveToWindow:]):
+ (-[WebBaseNetscapePluginView _viewHasMoved]):
+
+2008-11-03 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ - fix release build (and unitialized variable for CG drawing model!)
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): initialize portState in all code paths
+
+2008-11-03 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22053
+
+ This patch adds initial support for the NPDrawingModelCoreAnimation drawing model.
+
+ * Plugins/WebBaseNetscapePluginView.h: Added _layer ivar.
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation.
+ (-[WebBaseNetscapePluginView restorePortState:]): Ditto.
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): Slightly refactored a small block of code which with the PortState.
+ Plug-ins using the NPDrawingModelCoreAnimation drawing model have no PortState.
+ (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation
+ (-[WebBaseNetscapePluginView updateAndSetWindow]): Ditto.
+ (-[WebBaseNetscapePluginView setWindowIfNecessary]): Ditto.
+ (-[WebBaseNetscapePluginView start]): If the plug-in is a plug-in using the Core Animation model, request a layer from it.
+ (-[WebBaseNetscapePluginView drawRect:]): Return early for NPDrawingModelCoreAnimation plug-ins.
+ (-[WebBaseNetscapePluginView getVariable:value:]): Tell plug-ins running on post-Tiger systems WebKit supports
+ NPDrawingModelCoreAnimation.
+ (-[WebBaseNetscapePluginView setVariable:value:]): Added the new NPDrawingModelCoreAnimation case, which initializes drawingMode.
+ (-[WebBaseNetscapePluginView _viewHasMoved]): Reworded the conditional call to updateAndSetWindow to be specific to
+ CoreGraphics and QuickDraw plug-ins.
+
+2008-10-31 Cameron Zwarich <zwarich@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 22019: Move JSC::Interpreter::shouldPrintExceptions() to WebCore::Console
+ <https://bugs.webkit.org/show_bug.cgi?id=22019>
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics shouldPrintExceptions]):
+ (+[WebCoreStatistics setShouldPrintExceptions:]):
+
+2008-10-31 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - WebKit/mac part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie
+
+ * WebView/WebView.mm:
+ (-[WebView _cookieEnabled]):
+ (-[WebView _setCookieEnabled:]):
+ * WebView/WebViewPrivate.h:
+
+2008-10-31 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler
+
+ [WebHistory setLastVisitedTimeInterval:forItem] was internal to WebHistory.mm and
+ completely unused. Nuke it!
+
+ * History/WebHistory.mm:
+
+2008-10-31 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/4361197> Screen Reader's Item Chooser shows scroll area for WebKit Application window
+
+ If a WebFrameView does not allow scrolling, its scrollbars should not appear in the accessibility hierarchy.
+
+ * WebView/WebDynamicScrollBarsView.m:
+ (-[WebDynamicScrollBarsView accessibilityIsIgnored]):
+
+2008-10-30 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Jon Homeycutt.
+
+ Explicitly default to building for only the native architecture in debug and release builds.
+
+ * Configurations/DebugRelease.xcconfig:
+
+2008-10-30 Cameron Zwarich <zwarich@apple.com>
+
+ Rubber-stamped by Sam Weinig.
+
+ Create a debugger directory in JavaScriptCore and move the relevant
+ files to it.
+
+ * ForwardingHeaders/debugger: Added.
+ * ForwardingHeaders/debugger/DebuggerCallFrame.h: Copied from ForwardingHeaders/kjs/DebuggerCallFrame.h.
+ * ForwardingHeaders/kjs/DebuggerCallFrame.h: Removed.
+ * WebView/WebScriptDebugDelegate.mm:
+ * WebView/WebScriptDebugger.h:
+ * WebView/WebScriptDebugger.mm:
+
+2008-10-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ (WebNetscapePluginStream::~WebNetscapePluginStream):
+ (WebNetscapePluginStream::start):
+
+2008-10-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove an unused forward class declaration.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+
+2008-10-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove WebBaseNetscapePluginViewInternal.h and WebBaseNetscapePluginViewPrivate.h.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginViewInternal.h: Removed.
+ * Plugins/WebBaseNetscapePluginViewPrivate.h: Removed.
+ * Plugins/WebNetscapePluginEventHandler.mm:
+ * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ * Plugins/npapi.mm:
+ * WebView/WebHTMLView.mm:
+
+2008-10-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove WebNetscapePluginEmbeddedView, it adds nothing extra now.
+
+ Remove WebNetscapePlugInStreamLoaderClient since WebNetscapePluginStream is the client now.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebKitPluginContainerView.h:
+ * Plugins/WebNetscapePluginEmbeddedView.h: Removed.
+ * Plugins/WebNetscapePluginEmbeddedView.mm: Removed.
+ * Plugins/WebNetscapePluginEventHandler.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (NetscapePluginWidget::NetscapePluginWidget):
+ (NetscapePluginWidget::handleEvent):
+ (WebFrameLoaderClient::createPlugin):
+ * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h: Removed.
+ * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm: Removed.
+ * WebView/WebHTMLView.mm:
+ (-[NSArray _web_makePluginViewsPerformSelector:withObject:]):
+
+2008-10-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove the WebBaseNetscapePluginStream Objective-C object.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::create):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView pluginView:receivedResponse:]):
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+
+2008-10-29 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ https://bugs.webkit.org/show_bug.cgi?id=21952
+
+ Address an outstanding FIXME by removing unused SPI
+
+ * History/WebHistory.mm:
+ (-[WebHistory _addItemForURL:title:]): Fold addItem: into this method
+
+ * History/WebHistoryPrivate.h: Removed unused/unneccessary SPI
+
+2008-10-28 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5188560> REGRESSION: Spell checker doesn't clear spelling/grammar marker after error is marked as Ignored
+
+ * WebView/WebHTMLView.mm: IgnoreSpelling is now a WebCore command. That command handles
+ calling back into WebKit to perform the cross platform work that was removed in this change.
+
+2008-10-28 Cameron Zwarich <zwarich@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Move ForwardingHeaders to their correct location after the creation of
+ the runtime directory in JavaScriptCore.
+
+ * ForwardingHeaders/kjs/JSFunction.h: Removed.
+ * ForwardingHeaders/kjs/JSObject.h: Removed.
+ * ForwardingHeaders/kjs/JSString.h: Removed.
+ * ForwardingHeaders/kjs/JSValue.h: Removed.
+ * ForwardingHeaders/runtime: Added.
+ * ForwardingHeaders/runtime/JSFunction.h: Copied from ForwardingHeaders/kjs/JSFunction.h.
+ * ForwardingHeaders/runtime/JSObject.h: Copied from ForwardingHeaders/kjs/JSObject.h.
+ * ForwardingHeaders/runtime/JSString.h: Copied from ForwardingHeaders/kjs/JSString.h.
+ * ForwardingHeaders/runtime/JSValue.h: Copied from ForwardingHeaders/kjs/JSValue.h.
+ * WebView/WebScriptDebugDelegate.mm:
+ * WebView/WebScriptDebugger.mm:
+ * WebView/WebView.mm:
+
+2008-10-28 Adele Peterson <adele@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
+ "files" string for multifile uploads needs to be localized
+
+ * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory multipleFileUploadTextForNumberOfFiles:]):
+ Added.
+
+2008-10-28 Timothy Hatcher <timothy@apple.com>
+
+ Add WebInspector methods to enable the profiler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21927
+
+ <rdar://problem/6211578> Make the JavaScript profiler opt-in, so it does
+ not slow down JavaScript all the time
+
+ Reviewed by Darin Adler and Kevin McCullough.
+
+ * WebInspector/WebInspector.h:
+ * WebInspector/WebInspector.mm:
+ (-[WebInspector isJavaScriptProfilingEnabled]): Added. Calls InspectorController::profilerEnabled.
+ (-[WebInspector setJavaScriptProfilingEnabled:]): Added. Call InspectorController's disableProfiler
+ or enableProfiler methods.
+
+2008-10-27 Timothy Hatcher <timothy@apple.com>
+
+ Rename a few methods related to attaching and detaching the debugger.
+
+ * Rename attachDebugger to enableDebugger.
+ * Rename detachDebugger to disableDebugger.
+ * Rename the debuggerAttached getter to debuggerEnabled.
+
+ Reviewed by Darin Adler.
+
+ * WebInspector/WebInspector.mm:
+ (-[WebInspector isDebuggingJavaScript]):
+ (-[WebInspector startDebuggingJavaScript:]):
+ (-[WebInspector stopDebuggingJavaScript:]):
+
+2008-10-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Use the C++ stream object for JS requests as well.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+ (-[WebBaseNetscapePluginView destroyStream:reason:]):
+
+2008-10-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Use the C++ stream object in WebBaseNetscapePluginView. Use a HashSet of RefPtrs to keep track of the streams.
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::~WebNetscapePluginStream):
+ (WebNetscapePluginStream::setPlugin):
+ (WebNetscapePluginStream::startStream):
+ (WebNetscapePluginStream::destroyStream):
+ (WebNetscapePluginStream::destroyStreamWithReason):
+ (WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError):
+ (WebNetscapePluginStream::deliverData):
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView stop]):
+ (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]):
+ (-[WebBaseNetscapePluginView disconnectStream:]):
+ (-[WebBaseNetscapePluginView dealloc]):
+ (-[WebBaseNetscapePluginView pluginView:receivedResponse:]):
+ (-[WebBaseNetscapePluginView pluginView:receivedData:]):
+ (-[WebBaseNetscapePluginView pluginView:receivedError:]):
+ (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]):
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+
+2008-10-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Move code from dealloc and finalize to the WebNetscapePluginStream destructor.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::~WebNetscapePluginStream):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream finalize]):
+
+2008-10-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Get rid of WebNetscapePlugInStreamLoaderClient, the plug-in stream is its own client.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream finalize]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView pluginView:receivedError:]):
+ (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]):
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+ (-[WebBaseNetscapePluginView destroyStream:reason:]):
+
+2008-10-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Change the Obj-C init methods to simply call WebNetscapePluginStream::create.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::create):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithFrameLoader:]):
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+
+2008-10-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ Convert more code over to C++.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::plugin):
+ (WebNetscapePluginStream::setRequestURL):
+ Convert to C++.
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::start):
+ (WebNetscapePluginStream::stop):
+ Ditto.
+
+ (WebNetscapePluginStream::startStreamWithResponse):
+ Ditto.
+
+ (-[WebBaseNetscapePluginStream startStreamWithResponse:]):
+ Call the C++ version.
+
+ (-[WebBaseNetscapePluginStream impl]):
+ New accessor for the C++ class.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView pluginView:receivedData:]):
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginView destroyStream:reason:]):
+ Call the C++ methods.
+
+2008-10-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Fix https://bugs.webkit.org/show_bug.cgi?id=21759
+ Layering violation: FileChooser should not depend on Document/Frame/Page
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::runOpenPanel):
+
+2008-10-24 Anders Carlsson <andersca@apple.com>
+
+ Fix Tiger build.
+
+ * WebView/WebUIDelegate.h:
+
+2008-10-24 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <rdar://problem/5440917> Support NPN_Construct
+
+ Set construct.
+
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage load]):
+
+2008-10-24 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Tim Hatcher.
+
+ <rdar://problem/6119711> Remove the dependency on Foundation's private __COCOA_FORMAL_PROTOCOLS__ define.
+
+ * Misc/EmptyProtocolDefinitions.h:
+
+2008-10-24 Adele Peterson <adele@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKit part of fix for <rdar://problem/5839256> FILE CONTROL: multi-file upload.
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::runOpenPanel):
+ (-[WebOpenPanelResultListener chooseFilenames:]):
+ * WebView/WebUIDelegate.h:
+
+2008-10-24 Timothy Hatcher <timothy@apple.com>
+
+ Implement new InspectorClient methods to work with Settings.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21856
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/WebInspectorClient.h: Add the new methods and
+ guard the ObjC parts of the header.
+
+2008-10-24 Darin Adler <darin@apple.com>
+
+ - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame _convertValueToObjcValue:]):
+ (-[WebScriptCallFrame exception]):
+ (-[WebScriptCallFrame evaluateWebScript:]):
+ * WebView/WebView.mm:
+ (aeDescFromJSValue):
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
+ Use JSValue* instead of JSValuePtr.
+
+2008-10-23 Mark Rowe <mrowe@apple.com>
+
+ Build fix.
+
+ * Misc/WebKitErrors.m:
+ (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]):
+
+2008-10-20 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Remove FrameLoaderClient::detachedFromParent4. It is no longer used by any port.
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+
+2008-10-20 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ <rdar://problem/6277777> REGRESSION (r36954): XMLHttpRequest not working when
+ certain WebView delegate actions are taken
+
+ * WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]): Don't accidentally create
+ a window shell if there is none yet.
+
+2008-10-19 Darin Adler <darin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
+ improve performance by eliminating JSValue as a base class for JSCell
+
+ Remove most uses of JSValue, which will be removed in a future patch.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ Use JSValuePtr instead of JSValue.
+ * WebView/WebScriptDebugger.h: Removed declaration of JSValue.
+
+2008-10-18 Darin Adler <darin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
+ improve performance by eliminating JSValue as a base class for JSCell
+
+ Tweak a little more to get closer to where we can make JSValuePtr a class.
+
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame _convertValueToObjcValue:]): Use JSValuePtr.
+ (-[WebScriptCallFrame exception]): Ditto.
+ (-[WebScriptCallFrame evaluateWebScript:]): Ditto. And noValue.
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::WebScriptDebugger): Use new DebuggerCallFrame
+ constructor that doesn't require explicitly passing an exception.
+ * WebView/WebView.mm:
+ (aeDescFromJSValue): Use JSValuePtr.
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto.
+
+2008-10-18 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - WebKit/mac part of https://bugs.webkit.org/show_bug.cgi?id=21736
+ Long-dead decoded image data make up for most of the object cache's memory use over time
+
+ * WebView/WebView.mm:
+ (+[WebView _setCacheModel:]): In the primary web browser model, set the
+ cache's dead decoded data deletion interval to 60 seconds.
+
+2008-10-15 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Jon Honeycutt.
+
+ Fix a leak of a CFStringRef reported by the build bot.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): Use a autoreleased
+ NSString rather than manually releasing a CFStringRef when we're done with it.
+
+2008-10-15 Kenneth Russell <kenneth.russell@sun.com>
+
+ Reviewed and landed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21572
+
+ Initialize pluginFunc.size to the correct size before calling NP_GetEntryPoints.
+
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage load]):
+
+2008-10-15 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/6272508> Crash occurs after loading flash content at http://www.macrumors.com/
+
+ Restore some code related to the CoreGraphics drawing model that was misplaced in r37131.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView invalidateRegion:]):
+ (-[WebBaseNetscapePluginView setVariable:value:]):
+
+2008-10-15 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
+ Start the debugger without reloading the inspected page
+
+ * WebInspector/WebInspector.mm:
+ (-[WebInspector startDebuggingJavaScript:]): Updated for rename.
+
+2008-10-14 Maxime Britto <britto@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Added SPI to use WebCore's TextIterator with WebKit.
+
+ * WebView/WebTextIterator.h: Added.
+ * WebView/WebTextIterator.mm: Added.
+ (-[WebTextIteratorPrivate dealloc]):
+ (-[WebTextIterator dealloc]):
+ (-[WebTextIterator initWithRange:]): Creates a TextIterator
+ instance
+ (-[WebTextIterator advance]): Asks the iterator to advance() .
+ (-[WebTextIterator currentNode]): Returns the current DOMNode from
+ the iterator
+ (-[WebTextIterator currentText]): Returns the current text from the
+ iterator
+ (-[WebTextIterator atEnd]): Indicated whether the iterator has
+ reached the end of the range.
+ * WebView/WebView.h:
+ * WebView/WebView.mm:
+ (-[WebView textIteratorForRect:]): Returns a WebTextIterator with
+ the DOMRange contained in the rectangle given as a parameter.
+
+2008-10-15 Timothy Hatcher <timothy@apple.com>
+
+ Clean up user agent generation to simplify the _standardUserAgentWithApplicationName:
+ class method to not require a WebKit version.
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebView.mm:
+ (+[WebView _standardUserAgentWithApplicationName:]): Create the WebKit version.
+ (-[WebView WebCore::_userAgentForURL:]): Use the simplified _standardUserAgentWithApplicationName:.
+ Remove code that created the WebKit version.
+ * WebView/WebViewPrivate.h: Change the method name of _standardUserAgentWithApplicationName:.
+
+2008-10-14 Timothy Hatcher <timothy@apple.com>
+
+ Make the user agent generation method a class method and cache the WebKit
+ version in a static to prevent generating it every time. This is needed
+ clean up to fix <rdar://problem/6292331>. Moved all code to WebPrivate so
+ the class method can be in the WebViewPrivate.h header.
+
+ Reviewed by John Sullivan.
+
+ * WebView/WebView.mm:
+ (callGestalt): Moved. Same code.
+ (createMacOSXVersionString): Moved. Same code.
+ (createUserVisibleWebKitVersionString): Moved from _userVisibleBundleVersionFromFullVersion:
+ and returns a copied string.
+ (+[WebView _standardUserAgentWithApplicationName:andWebKitVersion:]): Made into a class method.
+ (-[WebView WebCore::_userAgentForURL:]): Changed to cache the WebKit version.
+ * WebView/WebViewPrivate.h: Added +_standardUserAgentWithApplicationName:andWebKitVersion:.
+
+2008-10-13 Maciej Stachowiak <mjs@apple.com>
+
+ Rubber stamped by Mark Rowe.
+
+ - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
+
+ * Configurations/DebugRelease.xcconfig:
+
+2008-10-11 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - rename _setAlwaysUseATSU to _setAlwaysUsesComplexTextCodePath and
+ update it for the renamed WebCoreTextRenderer method; keep the old
+ method around for clients that use it
+
+ * WebView/WebView.mm:
+ (+[WebView _setAlwaysUseATSU:]):
+ (+[WebView _setAlwaysUsesComplexTextCodePath:]):
+ * WebView/WebViewPrivate.h:
+
+2008-10-09 Timothy Hatcher <timothy@apple.com>
+
+ Don't convert JavaScriptCore header include paths to WebKit paths. This was needed
+ back when NPAPI and WebScriptObject migrated from JavaScriptCore. Also remove
+ JavaScriptCore from the VPATH.
+
+ Reviewed by Sam Weinig.
+
+ * MigrateHeaders.make:
+
+2008-10-08 Darin Adler <darin@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ - https://bugs.webkit.org/show_bug.cgi?id=21403
+ Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::WebScriptDebugger): Update since DebuggerCallFrame is simpler now.
+
+2008-10-08 Timothy Hatcher <timothy@apple.com>
+
+ Roll out r37427 because it causes an infinite recursion loading about:blank.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21476
+
+2008-10-08 Darin Adler <darin@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ - https://bugs.webkit.org/show_bug.cgi?id=21403
+ Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::WebScriptDebugger): Update since DebuggerCallFrame is simpler now.
+
+2008-10-07 David Hyatt <hyatt@apple.com>
+
+ Move viewless WebKit methods that Safari needs from WebViewInternal to WebViewPrivate.
+
+ Reviewed by Tim Hatcher
+
+ * WebView/WebView.mm:
+ (WebKitInitializeApplicationCachePathIfNecessary):
+ (-[WebView _registerDraggedTypes]):
+ (-[WebView _usesDocumentViews]):
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+ (-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]):
+ (-[WebView isFlipped]):
+ (-[WebView viewWillDraw]):
+ * WebView/WebViewInternal.h:
+ * WebView/WebViewPrivate.h:
+
+2008-10-07 David Hyatt <hyatt@apple.com>
+
+ Fix crash in isFlipped. Null check _private since isFlipped can get called from within AppKit
+ machinery during teardown of the WebView.
+
+ Reviewed by Adam Roben
+
+ * WebView/WebView.mm:
+ (-[WebView isFlipped]):
+
+2008-10-07 David Hyatt <hyatt@apple.com>
+
+ Make viewless WebKit update focused and active state when the window becomes and loses key.
+ The focus controller has been patched to understand that in viewless mode it can recur down and
+ update all of the frames, which is why this code works now when placed just on the WebView.
+
+ Reviewed by Adam Roben
+
+ * WebView/WebView.mm:
+ (-[WebView addWindowObservers]):
+ (-[WebView removeWindowObservers]):
+ (-[WebView viewWillMoveToWindow:]):
+ (-[WebView viewDidMoveToWindow]):
+ (-[WebView _updateFocusedAndActiveState]):
+ (-[WebView _windowDidBecomeKey:]):
+ (-[WebView _windowDidResignKey:]):
+ (-[WebView _windowWillOrderOnScreen:]):
+
+2008-10-07 David Hyatt <hyatt@apple.com>
+
+ Make sure the parent visibility state is set up properly on the outermost ScrollView widget.
+ This fixes the repainting issues with viewless WebKit on Mac.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
+2008-10-07 David Hyatt <hyatt@apple.com>
+
+ Make sure viewless Mac WebKit does a layout if needed before drawing.
+
+ Reviewed by Sam Weinig
+
+ * WebView/WebView.mm:
+ (-[WebView viewWillDraw]):
+
+2008-10-07 David Hyatt <hyatt@apple.com>
+
+ Make sure observers get hooked up to watch for size changes in viewless WebKit mode.
+
+ Reviewed by Sam Weinig
+
+ * ChangeLog:
+ * WebView/WebFrame.mm:
+ (-[WebFrame _drawRect:contentsOnly:]):
+ * WebView/WebView.mm:
+ (-[WebView viewWillDraw]):
+ (-[WebView _boundsChanged]):
+ (-[WebView addSizeObservers]):
+ (-[WebView viewDidMoveToWindow]):
+ (-[WebView viewDidMoveToSuperview]):
+
+2008-10-07 David Hyatt <hyatt@apple.com>
+
+ Make sure WebView listens for size changes and resizes the frame view in viewless mode.
+
+ Reviewed by Sam Weinig
+
+ * WebView/WebView.mm:
+ (-[WebView addSizeObservers]):
+ (-[WebView viewDidMoveToWindow]):
+ (-[WebView viewDidMoveToSuperview]):
+
+2008-10-06 David Hyatt <hyatt@apple.com>
+
+ Enable viewless Mac WebKit to paint some basic pages.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::windowResizerRect):
+ (WebChromeClient::repaint):
+ (WebChromeClient::screenToWindow):
+ (WebChromeClient::windowToScreen):
+ (WebChromeClient::platformWindow):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::forceLayoutForNonHTML):
+ (WebFrameLoaderClient::dispatchDidCommitLoad):
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+ (WebFrameLoaderClient::createFrame):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _drawRect:contentsOnly:]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebFrameView.mm:
+ * WebView/WebFrameViewInternal.h:
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView drawSingleRect:]):
+ (-[WebHTMLView drawRect:]):
+ * WebView/WebView.mm:
+ (-[WebView isFlipped]):
+ (-[WebView _boundsChanged]):
+ (-[WebView _mustDrawUnionedRect:singleRects:count:]):
+ (-[WebView drawSingleRect:]):
+ (-[WebView drawRect:]):
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+ (-[WebView initWithFrame:frameName:groupName:]):
+ (-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]):
+ (-[WebView initWithCoder:]):
+ (-[WebView removeSizeObservers]):
+ (-[WebView viewWillMoveToWindow:]):
+ (-[WebView viewWillMoveToSuperview:]):
+ (-[WebView _usesDocumentViews]):
+ * WebView/WebViewInternal.h:
+
+2008-10-06 Kevin Decker <kdecker@apple.com>
+
+ Rubber-stamped by Anders Carlsson.
+
+ Rename _webkit_applicationCacheDirectoryWithBundleIdentifier to _webkit_localCacheDirectoryWithBundleIdentifier.
+
+ * Misc/WebKitNSStringExtras.h:
+ * Misc/WebKitNSStringExtras.m:
+ (+[NSString _webkit_localCacheDirectoryWithBundleIdentifier:]):
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource _transferApplicationCache:]):
+ * WebView/WebView.mm:
+ (WebKitInitializeApplicationCachePathIfNecessary):
+
+2008-10-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Make WebNetscapePluginStream a WebCore::NetscapePlugInStreamLoaderClient.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::~WebNetscapePluginStream):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::didReceiveResponse):
+ (-[WebBaseNetscapePluginStream startStreamWithResponse:]):
+ (WebNetscapePluginStream::wantsAllStreams):
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ (WebNetscapePluginStream::didFail):
+ (-[WebBaseNetscapePluginStream destroyStreamWithError:]):
+ (WebNetscapePluginStream::didFinishLoading):
+ (-[WebBaseNetscapePluginStream finishedLoading]):
+ (WebNetscapePluginStream::didReceiveData):
+ (-[WebBaseNetscapePluginStream receivedData:]):
+
+2008-10-06 Anders Carlsson <andersca@apple.com>
+
+ Bring back the stop method. It was called through performSelector, which
+ is why I couldn't find any references to it.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream stop]):
+
+2008-10-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ More conversion and cleanup.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::startStream):
+ (-[WebBaseNetscapePluginStream startStreamWithResponse:]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+
+2008-10-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fold initWithRequestURL into initWithRequest.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+
+2008-10-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change the init methods not to return nil on failures. (These failures never occur anyway)
+
+ Use initWithRequest as the initializer, initWithRequestURL is going to be merged with it.
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+
+2008-10-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Convert more methods over to C++.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::ownerForStream):
+ (WebNetscapePluginStream::pluginCancelledConnectionError):
+ (WebNetscapePluginStream::errorForReason):
+ (-[WebBaseNetscapePluginStream errorForReason:]):
+ (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]):
+ (WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError):
+ (-[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:]):
+ (WebNetscapePluginStream::deliverData):
+ (WebNetscapePluginStream::deliverDataTimerFired):
+ (WebNetscapePluginStream::deliverDataToFile):
+ (-[WebBaseNetscapePluginStream finishedLoading]):
+ (-[WebBaseNetscapePluginStream receivedData:]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView destroyStream:reason:]):
+
+2008-10-06 David Hyatt <hyatt@apple.com>
+
+ Add SPI for a new viewless WebKit mode. The idea is that when this flag is set there will be no
+ views created except for the outermost WebView.
+
+ Reviewed by Tim Hatcher
+
+ * WebView/WebView.mm:
+ * WebView/WebViewInternal.h:
+
+2008-10-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Convert more methods over to C++.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::reasonForError):
+ (WebNetscapePluginStream::destroyStreamWithReason):
+ (WebNetscapePluginStream::cancelLoadWithError):
+ (-[WebBaseNetscapePluginStream cancelLoadWithError:]):
+ (WebNetscapePluginStream::destroyStreamWithError):
+ (-[WebBaseNetscapePluginStream destroyStreamWithError:]):
+ (-[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:]):
+ (-[WebBaseNetscapePluginStream _deliverDataToFile:]):
+ (-[WebBaseNetscapePluginStream finishedLoading]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithError:]):
+
+2008-10-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ - https://bugs.webkit.org/show_bug.cgi?id=21295
+ Bug 21295: Replace ExecState with a call frame Register pointer
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::WebScriptDebugger): Remove 0 passed for ExecState.
+
+2008-10-03 John Sullivan <sullivan@apple.com>
+
+ Fixed Release build
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::destroyStream):
+ added !LOG_DISABLED guard around declaration of npErr used only in LOG
+
+2008-10-03 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Convert destroyStream over to C++.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::destroyStream):
+ (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]):
+ (-[WebBaseNetscapePluginStream _deliverData]):
+
+2008-10-03 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Use a Timer instead of -[NSObject performSelector:withObject:afterDelay];
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream _destroyStream]):
+ (-[WebBaseNetscapePluginStream _deliverData]):
+ (WebNetscapePluginStream::deliverDataTimerFired):
+
+2008-10-03 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by David Hyatt.
+
+ More plug-in stream cleanup.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::create):
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithFrameLoader:]):
+ (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream finalize]):
+ (-[WebBaseNetscapePluginStream setPlugin:]):
+ (WebNetscapePluginStream::setPlugin):
+ (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]):
+ (-[WebBaseNetscapePluginStream _destroyStream]):
+
+2008-10-03 David Hyatt <hyatt@apple.com>
+
+ Remove addToDirtyRegion.
+
+ Reviewed by Oliver Hunt
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+
+2008-10-02 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21328
+
+ Make widget invalidation more cross-platform.
+
+ (1) Make invalidateRect a pure virtual function on Widget. All leaf widgets must now implement this function.
+
+ (2) Scrollbars now send invalidations through the ScrollbarClient. windowClipRect on ScrollbarClient has been removed and replaced with this invalidation call.
+ This allows all scrollbar invalidations to go through the render tree so that transforms and reflections will be respected.
+
+ (3) Plugins now have the native window invalidation code for windowed plugins. Windowless plugins do a repaintRectangle on the plugin's renderer.
+
+ (4) FrameViews now do a repaintRectangle on their owner element's renderer.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (PluginWidget::PluginWidget):
+ (PluginWidget::invalidateRect):
+ (NetscapePluginWidget::NetscapePluginWidget):
+ (WebFrameLoaderClient::createPlugin):
+
+2008-10-02 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ - https://bugs.webkit.org/show_bug.cgi?id=21321
+ Bug 21321: speed up JavaScriptCore by inlining Heap in JSGlobalData
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]): Use heap. instead of heap-> to
+ work with the heap.
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]): Ditto.
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]): Ditto.
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): Ditto.
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): Ditto.
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]): Ditto.
+
+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
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::repaint):
+ (WebChromeClient::scroll):
+
+2008-10-01 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Darin Adler and Cameron Zwarich.
+
+ Updated for JavaScriptCore API changes: use a SourceCode instead of
+ broken out parameters; treat sourceId as intptr_t.
+
+ We still treat sourceId as int in some cases because of DashCode. See
+ <rdar://problem/6263293> WebScriptDebugDelegate should use intptr_t for
+ sourceId, not int.
+
+ * WebView/WebScriptDebugger.h:
+ * WebView/WebScriptDebugger.mm:
+ (toNSString):
+ (WebScriptDebugger::sourceParsed):
+ (WebScriptDebugger::callEvent):
+ (WebScriptDebugger::atStatement):
+ (WebScriptDebugger::returnEvent):
+ (WebScriptDebugger::exception):
+ (WebScriptDebugger::willExecuteProgram):
+ (WebScriptDebugger::didExecuteProgram):
+ (WebScriptDebugger::didReachBreakpoint):
+
+2008-10-01 David Hyatt <hyatt@apple.com>
+
+ Move prohibitsScrolling from the Frame to the ScrollView.
+
+ Reviewed by Sam Weinig
+
+ * WebView/WebView.mm:
+ (-[WebView setProhibitsMainFrameScrolling:]):
+
+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/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::repaint):
+ (WebChromeClient::screenToWindow):
+ (WebChromeClient::windowToScreen):
+
+2008-09-30 Dave Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21269
+
+ This patch makes the ScrollView::paint method cross-platform. The paint method calls the base class
+ Widget paint on platforms with native widgets (Mac and wx). Otherwise it calls a virtual function,
+ paintContents, to paint the ScrollView's contents, and then it paints each of the two scrollbars and
+ the scrollbar corner.
+
+ The scrollbar themes are now responsible for painting scrollbar corners. At the moment ScrollbarThemeWin still
+ paints white (which is incorrect), so a future patch will actually implement proper native scroll corner painting
+ for Windows.
+
+ paintContents is implemented by FrameView, and replaces Frame::paint. All of the FramePrivate member
+ variables used by Frame::paint have moved to FrameViewPrivate instead. All callers of Frame::paint have
+ been patched to use FrameView::paintContents instead.
+
+ Reviewed by Darin Adler
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _drawRect:]):
+
+2008-09-30 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Remove the NPDrawingModelOpenGL entirely. To my knowledge no shipping plug-in ever used it, and no other browser engine
+ ever supported it.
+
+ * Plugins/WebBaseNetscapePluginView.h: Removed AGL.h import and OpenGL related ivars.
+ * Plugins/WebBaseNetscapePluginView.mm: Removed soft linking for OpenGL and AGL frameworks.
+ Also removed many methods AGL/CGL support methods that are no longer necessary.
+ (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Removed NPDrawingModelOpenGL related code.
+ (-[WebBaseNetscapePluginView restorePortState:]): Ditto.
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): Ditto.
+ (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): Ditto.
+ (-[WebBaseNetscapePluginView setWindowIfNecessary]): Ditto.
+ (-[WebBaseNetscapePluginView stop]): Ditto.
+ (-[WebBaseNetscapePluginView dealloc]): Ditto.
+ (-[WebBaseNetscapePluginView drawRect:]):
+ (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): Ditto.
+ (-[WebBaseNetscapePluginView invalidateRegion:]): Ditto.
+ (-[WebBaseNetscapePluginView getVariable:value:]): Tell plug-ins WebKit does not support NPDrawingModelOpenGL.
+ (-[WebBaseNetscapePluginView setVariable:value:]): Removed NPDrawingModelOpenGL related code.
+ (-[WebBaseNetscapePluginView _viewHasMoved]): Ditto.
+
+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.
+
+ Reviewed by Darin Adler
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::repaint):
+
+2008-09-30 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark Rowe and Adam Roben.
+
+ No need to use pointers to store C++ objects as pointers in WebViewPrivate, we can just
+ store them directly.
+
+ * Configurations/Base.xcconfig:
+ Set GCC_OBJC_CALL_CXX_CDTORS to YES.
+
+ * WebView/WebView.mm:
+ (-[WebViewPrivate init]):
+ (-[WebViewPrivate dealloc]):
+ (-[WebViewPrivate finalize]):
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView setApplicationNameForUserAgent:]):
+ (-[WebView setCustomUserAgent:]):
+ (-[WebView customUserAgent]):
+ (-[WebView WebCore::_userAgentForURL:WebCore::]):
+ (-[WebView _addObject:forIdentifier:]):
+ (-[WebView _objectForIdentifier:]):
+ (-[WebView _removeObjectForIdentifier:]):
+
+2008-09-29 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Simon.
+
+ Changed copyright from Trolltech ASA to Nokia.
+
+ Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008.
+
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+
+2008-09-28 Timothy Hatcher <timothy@apple.com>
+
+ Improves the Web Inspector node highlight so it does not scroll
+ to reveal the node in the page. This makes the highlight less
+ invasive and causes less things to change on screen. Also makes
+ the highlight redraw when the WebView draws, so it stays current
+ if the node changes on the page for any reason.
+
+ <rdar://problem/6115804> Don't scroll when highlighting (21000)
+ https://bugs.webkit.org/show_bug.cgi?id=21000
+
+ Reviewed by Dan Bernstein.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController highlightNode:]): Call setNeedsDisplay:YES
+ if there is an existing highlight.
+ (-[WebInspectorWindowController didAttachWebNodeHighlight:]): Set the current
+ highlight node on the inspected WebView.
+ (-[WebInspectorWindowController willDetachWebNodeHighlight:]): Set the current
+ highlight node on the inspected WebView to nil.
+ * WebInspector/WebNodeHighlight.m:
+ (-[WebNodeHighlight setNeedsUpdateInTargetViewRect:]): Disable screen updates
+ until flush for the inspected window. Invalidate the whole highlight view since
+ we don't know the rect that needs updated since the highlight can be larger than
+ the highlighted element due to the margins and other factors.
+ * WebInspector/WebNodeHighlightView.m:
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView drawSingleRect:]): Call setNeedsUpdateInTargetViewRect: on the
+ current highlight node.
+ * WebView/WebView.mm:
+ (-[WebViewPrivate dealloc]): Release the current highlight node.
+ (-[WebView setCurrentNodeHighlight:]): Set the current highlight node.
+ (-[WebView currentNodeHighlight]): Return the current highlight node.
+ * WebView/WebViewInternal.h:
+
+2008-09-28 David Kilzer <ddkilzer@apple.com>
+
+ Fix build warning in WebDefaultUIDelegate.m
+
+ Reviewed by Dan Bernstein.
+
+ This fixes a warning noticed by the clang static analyzer:
+ .../WebDefaultUIDelegate.m: In function ‘-[WebDefaultUIDelegate webViewFirstResponder:]’:
+ .../WebDefaultUIDelegate.m:92: warning: initialization from distinct Objective-C type
+
+ Note that this doesn't actually cause any change in behavior since
+ the gcc compiler ignores the semi-colon anyway.
+
+ * DefaultDelegates/WebDefaultUIDelegate.m:
+ (-[WebDefaultUIDelegate webViewFirstResponder:]): Removed semi-colon
+ from method signature.
+
+2008-09-27 David Hyatt <hyatt@apple.com>
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=21182
+
+ Make sure Mac null checks the view like the other platforms do now that Mac goes through WebCore
+ to call setAllowsScrolling.
+
+ Reviewed by Mark Rowe
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createFrame):
+
+2008-09-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21178
+ <rdar://problem/6248651>
+
+ Check if the plug-in is allowed to load the resource. This matches Firefox.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+
+2008-09-26 Matt Lilek <webkit@mattlilek.com>
+
+ Reviewed by Tim Hatcher.
+
+ Update FEATURE_DEFINES after ENABLE_CROSS_DOCUMENT_MESSAGING was removed.
+
+ * Configurations/WebKit.xcconfig:
+
+2008-09-26 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21164
+
+ Rework concept of allowsScrolling/setAllowsScrolling to be cross-platform.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createFrame):
+ * WebView/WebDynamicScrollBarsView.h:
+ * WebView/WebDynamicScrollBarsView.m:
+ * WebView/WebDynamicScrollBarsViewInternal.h:
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView setAllowsScrolling:]):
+ (-[WebFrameView allowsScrolling]):
+
+2008-09-26 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21149
+
+ More refactoring to make scrollbar modes cross-platform. Reduce the protocol that
+ WebDynamicScrollBarsView has to implement for communicating with WebCore to just three methods.
+
+ Reviewed by Sam Weinig
+
+ * WebView/WebDynamicScrollBarsView.m:
+ (-[WebDynamicScrollBarsView scrollingModes:WebCore::vertical:WebCore::]):
+ (-[WebDynamicScrollBarsView setHorizontalScrollingMode:andLock:]):
+ (-[WebDynamicScrollBarsView setVerticalScrollingMode:andLock:]):
+ (-[WebDynamicScrollBarsView setScrollingModes:vertical:andLock:]):
+ * WebView/WebDynamicScrollBarsViewInternal.h:
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView setAllowsScrolling:]):
+ * WebView/WebView.mm:
+ (-[WebView setAlwaysShowVerticalScroller:]):
+ (-[WebView setAlwaysShowHorizontalScroller:]):
+
+2008-09-26 David Kilzer <ddkilzer@apple.com>
+
+ Fix Mac build with XSLT disabled
+
+ Reviewed by Alexey.
+
+ * Misc/WebCache.mm:
+ (+[WebCache statistics]): Populate xslStyleSheet statistics with
+ zeros if XSLT is disabled.
+
+2008-09-25 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21101
+
+ Fix the updating of the active state to not be dumb, so that viewless scrollbars repaint properly.
+
+ Reviewed by Tim Hatcher
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _updateFocusedAndActiveState]):
+
+2008-09-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ - https://bugs.webkit.org/show_bug.cgi?id=21079
+ <rdar://problem/6203938> Disallow embedding Safari-generated pages
+ (e.g bookmarks collection) in subframes
+
+ * DefaultDelegates/WebDefaultPolicyDelegate.m:
+ (-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
+ Use the new +[WebView _canHandleRequest:forMainFrame:] so we can give
+ a different answer for the main frame and subframes.
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::canHandleRequest): Ditto.
+
+ * WebView/WebView.mm:
+ (+[WebView _canHandleRequest:forMainFrame:]): Added forMainFrame. Only look
+ for scheme-specific representations for the main frame, not subframes.
+ (+[WebView _canHandleRequest:]): Give answer for main frame -- calls the
+ method above with YES for main frame.
+
+ * WebView/WebViewInternal.h: Added _canHandleRequest:forMainFrame:.
+
+2008-09-23 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21039
+
+ Teach the viewless Mac scrollbar how to avoid the NSWindow resizer.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::windowResizerRect):
+
+2008-09-23 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ - fix <rdar://problem/6233388> Crash beneath -[WebFrameView keyDown:]
+
+ Test: fast/events/keydown-remove-frame.html
+
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView keyDown:]): Added a null check.
+
+2008-09-21 Dirk Schulze <vbs85@gmx.de>
+
+ Reviewed and landed by Eric Seidel.
+
+ Moved CGFloat definition to WebKitPrefix so CGFloat can be used more
+ freely throughout WebCore without worrying about breaking Tiger.
+
+ * Misc/WebTypesInternal.h: Removed it from here.
+ * WebKitPrefix.h: Added it here.
+
+2008-09-20 Matt Lilek <webkit@mattlilek.com>
+
+ Reviewed by Tim Hatcher.
+
+ Revert r35688. We use a textured window on Leopard, which does not have the
+ square corners of the standard Aqua window on Tiger.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController window]): Add back the call to WKNSWindowMakeBottomCornersSquare.
+
+2008-09-19 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ - speculative fix for https://bugs.webkit.org/show_bug.cgi?id=20943
+ Assertion failure in RefCountedLeakCounter::cancelMessageSuppression() when closing a window
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Moved call to
+ RefCountedLeakCounter::suppressMessages in here.
+ (-[WebView initWithFrame:frameName:groupName:]): Moved it out of here.
+
+2008-09-18 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add SPI to WebView to allow DRT to clear the main frame's name between tests.
+
+ * WebView/WebView.mm:
+ (-[WebView _clearMainFrameName]):
+ * WebView/WebViewPrivate.h:
+
+2008-09-18 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - fix https://bugs.webkit.org/show_bug.cgi?id=20925
+ LEAK messages appear every time I quit
+
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences setFullDocumentTeardownEnabled:]): Removed unneeded call
+ to setLogLeakMessages.
+ * WebView/WebView.mm:
+ (-[WebView _closeWithFastTeardown]): Call RefCountedLeakCounter::suppressMessages,
+ telling it that we can't track leaks because at least one WebView was closed with
+ fast teardown.
+ (-[WebView _close]): Removed unneeded call to setLogLeakMessages. Added a call to
+ cancelMessageSuppression since the WebView is no longer open.
+ Added an explicit garbage collect to help with the case where we're closing during
+ the quit process -- the garbageCollectSoon() calls done inside WebCore won't help
+ us in that case.
+ (-[WebView initWithFrame:frameName:groupName:]): Call
+ RefCountedLeakCounter::suppressMessages telling it that we can't track leaks
+ because at least one WebView is currently open.
+
+2008-09-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Move the remainder of the stream ivars to the C++ object.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]):
+ (-[WebBaseNetscapePluginStream initWithFrameLoader:]):
+ (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream finalize]):
+ (-[WebBaseNetscapePluginStream setPlugin:]):
+ (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]):
+ (-[WebBaseNetscapePluginStream start]):
+ (-[WebBaseNetscapePluginStream stop]):
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ (-[WebBaseNetscapePluginStream _destroyStream]):
+ (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]):
+ (-[WebBaseNetscapePluginStream cancelLoadWithError:]):
+ (-[WebBaseNetscapePluginStream _deliverData]):
+
+2008-09-17 David Hyatt <hyatt@apple.com>
+
+ Make the notion of Widget having an underlying native widget cross-platform.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (NetscapePluginWidget::handleEvent):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _dragSourceMovedTo:]):
+ (-[WebFrame _dragSourceEndedAt:operation:]):
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView _install]):
+ * WebView/WebRenderNode.mm:
+ (copyRenderNode):
+
+2008-09-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ Move more instance variables down to the C++ class.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream finalize]):
+ (-[WebBaseNetscapePluginStream transferMode]):
+ (-[WebBaseNetscapePluginStream plugin]):
+ (-[WebBaseNetscapePluginStream setPlugin:]):
+ (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]):
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ (-[WebBaseNetscapePluginStream _destroyStream]):
+ (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]):
+ (-[WebBaseNetscapePluginStream _deliverData]):
+ (-[WebBaseNetscapePluginStream _deliverDataToFile:]):
+ (-[WebBaseNetscapePluginStream finishedLoading]):
+ (-[WebBaseNetscapePluginStream receivedData:]):
+
+2008-09-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Move a bunch of instance variables into the C++ class.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]):
+ (-[WebBaseNetscapePluginStream errorForReason:]):
+ (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream setRequestURL:]):
+ (-[WebBaseNetscapePluginStream setResponseURL:]):
+ (-[WebBaseNetscapePluginStream setMIMEType:]):
+ (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]):
+ (-[WebBaseNetscapePluginStream _destroyStream]):
+ (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]):
+ (-[WebBaseNetscapePluginStream _deliverData]):
+ (-[WebBaseNetscapePluginStream receivedData:]):
+
+2008-09-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Add a new WebNetscapePluginStream C++ class. The idea is that it is supposed to replace the Obj-C
+ WebBaseNetscapePluginStream class. The plan is to gradually move/rewrite code from the Obj-C class to the C++ class
+ until the C++ class can replace the Obj-C class.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ (WebNetscapePluginStream::create):
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithFrameLoader:]):
+ (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream finalize]):
+
+2008-09-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Instead of storing a pointer to NPP method individually, just store a pointer to the NPNetscapeFuncs vtable.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream setPlugin:]):
+ (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]):
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ (-[WebBaseNetscapePluginStream _destroyStream]):
+ (-[WebBaseNetscapePluginStream _deliverData]):
+ * Plugins/WebNetscapePluginPackage.h:
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage pluginFuncs]):
+
+2008-09-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Remove references to WebNetscapePluginStream.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebNetscapePluginEmbeddedView.h:
+
+2008-09-15 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ - fix https://bugs.webkit.org/show_bug.cgi?id=20860
+ REGRESSION: Crash in RenderLayer::hasVisibleContent() loading wavy.com
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _getVisibleRect:]): Changed to check if the RenderPart has
+ layout before accessing it, instead of checking if the frame inside it
+ has layout.
+
+2008-09-15 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler, Beth Dakin
+
+ Support strings for AXLists
+
+ * WebCoreSupport/WebViewFactory.mm:
+ (-[WebViewFactory AXDefinitionListTermText]):
+ (-[WebViewFactory AXDefinitionListDefinitionText]):
+
+2008-09-15 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mitz.
+
+ Merge WebNetscapePluginStream into WebBaseNetscapePluginStream.
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithFrameLoader:]):
+ (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream finalize]):
+ (-[WebBaseNetscapePluginStream start]):
+ (-[WebBaseNetscapePluginStream stop]):
+ (-[WebBaseNetscapePluginStream cancelLoadWithError:]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView pluginView:receivedResponse:]):
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+ * Plugins/WebNetscapePluginEmbeddedView.mm:
+ * Plugins/WebNetscapePluginStream.h: Removed.
+ * Plugins/WebNetscapePluginStream.mm: Removed.
+
+2008-09-12 John Sullivan <sullivan@apple.com>
+
+ Fixed <rdar://problem/6110941> Clicking the print button in PDF content does nothing
+
+ Reviewed by Darin Adler
+
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView PDFViewPerformPrint:]):
+ Implemented PDFKit delegate method that's called after a Print action in the PDF content
+
+2008-09-12 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - fix a crash in -visibleRect when it is called during WebFrameView deallocation
+
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView visibleRect]): Added an early return if _private is 0.
+
+2008-09-11 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - eliminate excessive repainting when a clipped iframe is moved (noticed in <rdar://problem/6204032>)
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _getVisibleRect:]): Added. If the frame is in a RenderPart
+ and has layout, gets the visible rect of the RenderPart and returns
+ YES. Returns NO otherwise.
+ * WebView/WebFrameInternal.h:
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView visibleRect]): Added. Overrides this NSView method to
+ take clipping in the render tree into account.
+
+2008-09-09 Dan Bernstein <mitz@apple.com>
+
+ - Tiger build fix
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface):
+
+2008-09-09 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - WebKit part of <rdar://problem/6206244> Use alternate character-to-glyph interface on Leopard
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface):
+
+2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+
+ Reviewed by Maciej Stachowiak.
+
+ Bug 20704: Replace the KJS namespace
+ <https://bugs.webkit.org/show_bug.cgi?id=20704>
+
+ Rename the KJS namespace to JSC.
+
+ * Misc/WebCoreStatistics.mm:
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]):
+ (-[WebBaseNetscapePluginView setWindowIfNecessary]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView createPluginScriptableObject]):
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+ (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]):
+ (-[WebBaseNetscapePluginView loadPluginRequest:]):
+ (-[WebBaseNetscapePluginView _printedPluginBitmap]):
+ * Plugins/WebPluginController.mm:
+ (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]):
+ (-[WebPluginController startAllPlugins]):
+ (-[WebPluginController stopAllPlugins]):
+ (-[WebPluginController addPlugin:]):
+ (-[WebPluginController destroyPlugin:]):
+ (-[WebPluginController destroyAllPlugins]):
+ * WebView/WebFrame.mm:
+ * WebView/WebScriptDebugDelegate.mm:
+ * WebView/WebScriptDebugger.h:
+ * WebView/WebScriptDebugger.mm:
+ * WebView/WebView.mm:
+ (-[WebViewPrivate init]):
+
+2008-09-05 Timothy Hatcher <timothy@apple.com>
+
+ Correct a typo in the setApplicationChromeModeEnabledEnabled:
+ method name, remove the extra "Enabled".
+
+ * WebView/WebPreferences.mm:
+ * WebView/WebPreferencesPrivate.h:
+
+2008-09-04 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ Fix https://bugs.webkit.org/show_bug.cgi?id=20639.
+ Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE
+
+ * Configurations/WebKit.xcconfig: Remove ENABLE_DASHBOARD_SUPPORT from FEATURE_DEFINES.
+
+2008-09-03 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Sam.
+
+ Clean up Platform.h and add PLATFORM(CHROMIUM), PLATFORM(SKIA) and USE(V8_BINDINGS)
+
+ * Configurations/WebKit.xcconfig:
+ * WebKitPrefix.h: add rules for V8_BINDINGS
+
+2008-09-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19760
+
+ Add a linked-on-or-after check to prevent substitute data from loading
+ local resources on newer users of WebKit.
+
+ * Misc/WebKitVersionChecks.h:
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+
+2008-08-29 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Anders
+
+ Fix regression I introducted in 35946
+ Already covered by media/video-click-dlbclick-standalone.html
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation receivedData:withDataSource:]): Cancel the load here after
+ calling [WebFrame _receivedData:] which more closely follows the path taken by PluginDocuments
+
+2008-08-28 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Geoff.
+
+ <rdar://problem/6095949> REGRESSION (5525.8-6527.1?): "this" is null
+ when you first hit a breakpoint in Dashcode
+ - We wanted to reset the callframe whenever eval() was called but
+ dashcode uses eval() when broken to evaluate the state of the current
+ call frame.
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::willExecuteProgram):
+ (WebScriptDebugger::didExecuteProgram):
+
+2008-08-27 Robert Kroeger <rjkroege@liqui.org>
+
+ Tweaked by Sam Weinig.
+
+ Reviewed by Eric Seidel.
+
+ Fix https://bugs.webkit.org/show_bug.cgi?id=6595
+ <rdar://problem/4432150>
+ Right-click does not fire mouseup event
+
+ Adds a rightMouseUp handler to the WebHTMLView.
+
+ The added method generates mouseup events for button 2. The result
+ is that webkit will deliver mousedown and mouseup events for button
+ 2 in a fashion identical to FireFox and will retain event ordering
+ identical to Internet Explorer.
+
+ Test: fast/events/mouseup-from-button2.html
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView rightMouseUp:]):
+
+2008-08-27 Timothy Hatcher <timothy@apple.com>
+
+ Add support for support for -webkit-appearance: default-button on the Mac platform.
+
+ <rdar://problem/6173530>
+
+ Reviewed by Dave Hyatt.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface): Init AdvanceDefaultButtonPulseAnimation.
+ * WebView/WebPreferenceKeysPrivate.h: Added WebKitApplicationChromeModeEnabledPreferenceKey.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]): Set WebKitApplicationChromeModeEnabledPreferenceKey to NO.
+ (-[WebPreferences applicationChromeModeEnabled]): Added.
+ (-[WebPreferences setApplicationChromeModeEnabledEnabled:]): Added.
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Call Settings::setApplicationChromeMode
+ with the value of -[WebPreferences applicationChromeModeEnabled].
+
+2008-08-27 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Anders
+
+ <rdar://problem/6134133> - Crash when loading large movie as a standalone document
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::pluginWillHandleLoadError):
+
+2008-08-20 Dan Bernstein <mitz@apple.com>
+
+ Rubber-stamped by John Sullivan.
+
+ - rename shouldUpdateWhileHidden to shouldUpdateWhileOffscreen,
+ rename related methods and variables accordingly, and make
+ -setShouldUpdateWhileOffscreen: and -shouldUpdateWhileOffscreen
+ WebView API.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView windowWillOrderOnScreen:]):
+ * WebView/WebView.h:
+ * WebView/WebView.mm:
+ (-[WebViewPrivate init]):
+ (-[WebView setBackgroundColor:]):
+ (-[WebView setDrawsBackground:]):
+ (-[WebView setShouldUpdateWhileOffscreen:]):
+ (-[WebView shouldUpdateWhileOffscreen]):
+ * WebView/WebViewPrivate.h:
+
+2008-08-18 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Switch to non-deprecated NSFileManager API.
+
+ In order to minimize #if's the new NSFileManager APIs have been implemented for
+ Tiger and call sites updated to use the new methods.
+
+ * Misc/WebIconDatabase.mm:
+ (importToWebCoreFormat):
+ * Misc/WebKitNSStringExtras.m:
+ (-[NSString _webkit_fixedCarbonPOSIXPath]):
+ * Misc/WebKitSystemBits.m:
+ * Misc/WebNSFileManagerExtras.h:
+ * Misc/WebNSFileManagerExtras.m: Remove implementations of methods that are not used.
+ (-[NSFileManager _webkit_backgroundRemoveFileAtPath:]):
+ (-[NSFileManager attributesOfFileSystemForPath:error:]): Implement new API for Tiger in terms of Tiger API.
+ (-[NSFileManager contentsOfDirectoryAtPath:error:]): Ditto.
+ (-[NSFileManager moveItemAtPath:toPath:error:]): Ditto.
+ (-[NSFileManager removeItemAtPath:error:]): Ditto.
+ * Plugins/WebPluginDatabase.mm:
+ (-[WebPluginDatabase _scanForNewPlugins]):
+
+2008-08-20 Josh Aas <joshmoz@gmail.com>
+
+ Reviewed and landed by Anders.
+
+ <rdar://problem/6163636>
+ rename NPCocoaEvent's "event" struct to "data" (20446)
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::drawRect):
+ (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
+ (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+ (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+ (WebNetscapePluginEventHandlerCocoa::windowFocusChanged):
+ (WebNetscapePluginEventHandlerCocoa::focusChanged):
+
+2008-08-20 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix for <rdar://problem/6145626>
+ Allows a WebKit client to mark a frame as not-text-searchable
+ through SPI.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _setExcludeFromTextSearch:]):
+ * WebView/WebFramePrivate.h:
+
+2008-08-19 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Geoff Garen.
+
+ Bring back shared JSGlobalData and implicit locking, because too many clients rely on it.
+
+ * ForwardingHeaders/runtime/JSLock.h: Added.
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
+ (+[WebCoreStatistics shouldPrintExceptions]):
+ (+[WebCoreStatistics setShouldPrintExceptions:]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]):
+ (-[WebBaseNetscapePluginView setWindowIfNecessary]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView createPluginScriptableObject]):
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+ (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]):
+ (-[WebBaseNetscapePluginView loadPluginRequest:]):
+ (-[WebBaseNetscapePluginView _printedPluginBitmap]):
+ * Plugins/WebPluginController.mm:
+ (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]):
+ (-[WebPluginController startAllPlugins]):
+ (-[WebPluginController stopAllPlugins]):
+ (-[WebPluginController addPlugin:]):
+ (-[WebPluginController destroyPlugin:]):
+ (-[WebPluginController destroyAllPlugins]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame evaluateWebScript:]):
+ * WebView/WebView.mm:
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
+
+2008-08-19 Timothy Hatcher <timothy@apple.com>
+
+ Fixes the Web Inspector flashing white while resizing after
+ highlighting a page element. Calling disableScreenUpdatesUntilFlush
+ when attaching and detaching the Inspector page highlight is bad,
+ since the browser window might not flush again for a while. So screen
+ updates could be disabled for long periods of time, causing backing store
+ flashing while resizing. There is no need to call disableScreenUpdatesUntilFlush
+ when attaching or detaching the child window.
+
+ Reviewed by John Sullivan and Kevin McCullough.
+
+ * WebInspector/WebNodeHighlight.m:
+ (-[WebNodeHighlight attach]): Remove the call to disableScreenUpdatesUntilFlush.
+ (-[WebNodeHighlight detach]): Ditto.
+
+2008-08-19 Timothy Hatcher <timothy@apple.com>
+
+ Correctly remembers the attached state of the Web Inspector so
+ it opens in that state for the next window, or next launch.
+
+ Reviewed by Kevin McCullough.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController attach]): Set WebKitInspectorAttachedKey
+ to YES in the user defaults.
+ (-[WebInspectorWindowController detach]): Set WebKitInspectorAttachedKey
+ to NO in the user defaults.
+
+2008-08-18 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19347
+ <rdar://problem/5977562> Input methods do not work after switching to a password field
+ and back.
+
+ Fix <rdar://problem/5522011> (The content of the password field of Safari is displayed by
+ reconversion) in a different way which doesn't conflict with context caching performed
+ by AppKit.
+
+ This original bug does not really occur in ToT or shipping Safari under Mac OS X 10.5.4,
+ because input methods are disabled in password fields. Attempting to reconvert text typed
+ with Romaji only yields a string of bullets. Still, it is probably better to match Cocoa
+ password field behavior and disable reconversion completely.
+
+ * WebView/WebHTMLView.mm:
+ (isInPasswordField): Factored out code to determine that the current selection is in
+ a password field.
+ (inputContext): Removed a hack that was breaking TSMGetActiveDocument().
+ (-[WebHTMLView attributedSubstringFromRange:]): Check for password fields.
+ (-[WebHTMLView textStorage]): Ditto.
+
+2008-08-12 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoff.
+
+ - eliminate JSValue::type()
+
+ * WebView/WebView.mm:
+ (aeDescFromJSValue): Rewrite to use the JSValue::is functions instead
+ of a switch on JSValue::type().
+
+2008-08-17 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ Made room for a free word in JSCell.
+
+ (Updated for JavaScriptCore changes.)
+
+2008-08-15 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Geoff Garen.
+
+ <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework
+
+ * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared
+ between the Debug configuration and debug Production variant.
+
+2008-08-14 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Geoffrey Garen and Timothy Hatcher.
+
+ Add WebView SPI to set HTMLTokenizer yielding parameters.
+
+ * WebView/WebView.mm:
+ (-[WebView _setCustomHTMLTokenizerTimeDelay:]):
+ (-[WebView _setCustomHTMLTokenizerChunkSize:]):
+ * WebView/WebViewPrivate.h:
+
+2008-08-13 Timothy Hatcher <timothy@apple.com>
+
+ Fixes a bug where Safari's find banner would be permanently hidden
+ when attaching or closing the Web Inspector while attached.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20376
+
+ Reviewed by Kevin McCullough.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController close]):
+ Carefully manipulate the WebFrameView's frame when closing to
+ not assume the WebFrameView's frame fills the inspected WebView.
+ (-[WebInspectorWindowController setAttachedWindowHeight:]):
+ Carefully manipulate the WebFrameView's frame when docking to
+ not assume the WebFrameView plus the Web Inspector WebViews fills
+ the full inspected WebView.
+
+2008-08-13 Stephanie Lewis <slewis@apple.com>
+
+ fix 64bit build
+
+ * WebCoreSupport/WebInspectorClient.mm:
+
+2008-08-13 Timothy Hatcher <timothy@apple.com>
+
+ Remember the docked state of the Web Inspector, so it can be
+ reopened docked if it was last docked.
+
+ https://bugs.webkit.org/show_bug.cgi?id=14271
+
+ Reviewed by Kevin McCullough.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController init]): Initialize _shouldAttach
+ to the value stored in the user defaults. If there has never
+ been a value stored, default to being attached.
+ (-[WebInspectorWindowController showWindow:]): Pass the attached
+ state to InspectorController::setWindowVisible.
+
+2008-08-12 Timothy Hatcher <timothy@apple.com>
+
+ Remove the Inspector's WebView for the view hierarchy when closed
+ while attached. This prevents it from showing in the background
+ while the page changes.
+
+ Reviewed by Kevin McCullough.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController close:]): Call removeFromSuperview
+ on the Inspector's WebView if it isn't attached, so it will not
+ be visible when navigating pages while closed.
+
+2008-08-12 Timothy Hatcher <timothy@apple.com>
+
+ Make the docked Web Inspector resizable.
+
+ https://bugs.webkit.org/show_bug.cgi?id=14282
+
+ Reviewed by Kevin McCullough.
+
+ * WebCoreSupport/WebInspectorClient.h:
+ * WebCoreSupport/WebInspectorClient.mm:
+ (WebInspectorClient::setAttachedWindowHeight): Call setAttachedWindowHeight:
+ on the WebInspectorWindowController.
+ (-[WebInspectorWindowController showWindow:]): Call setAttachedWindowHeight:.
+ (-[WebInspectorWindowController setAttachedWindowHeight:]): Moved code
+ from showWindow: and generalized to allow being called multiple times.
+ Remembers the last height passed, which is used by showWindow: the next
+ time the Inspector attaches.
+
+2008-08-12 Timothy Hatcher <timothy@apple.com>
+
+ Remove unneeded header imports from some Web Inspector files.
+
+ Reviewed by Adam Roben.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ * WebInspector/WebInspector.mm:
+ * WebInspector/WebNodeHighlightView.m:
+
+2008-08-12 Timothy Hatcher <timothy@apple.com>
+
+ Remove the call to WKNSWindowMakeBottomCornersSquare on the
+ Web Inspector's window. This isn't needed anymore since the
+ window style masks used always have square bottom corners.
+
+ Reviewed by Adam Roben.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController window]): Remove the call
+ to WKNSWindowMakeBottomCornersSquare.
+
+2008-08-12 Timothy Hatcher <timothy@apple.com>
+
+ Make attaching and detaching the Web Inspector instantaneous.
+ This also preserves the current view, other state, and keeps
+ the script debugger attached.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19301
+
+ Reviewed by Adam Roben.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController close]): Only call setWindowVisible(false)
+ when not moving windows.
+
+2008-08-12 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - replace -[WebPreferences updatesWhenOffscreen] with -[WebView shouldUpdateWhileHidden]
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _updateBackgroundAndUpdatesWhileHidden]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView windowWillOrderOnScreen:]):
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebViewPrivate init]):
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView setBackgroundColor:]):
+ (-[WebView setDrawsBackground:]):
+ (-[WebView shouldUpdateWhileHidden]):
+ (-[WebView setShouldUpdateWhileHidden:]):
+ * WebView/WebViewPrivate.h:
+
+2008-08-08 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - fix <rdar://problem/6130216> Exception "windowRegionBeingDrawn != nil" in NSView when caching image of a subframe
+
+ This change reintroduces <https://bugs.webkit.org/show_bug.cgi?id=5195> on Leopard.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): Removed an
+ unsuccessful workaround for <rdar://problem/5668489>, because invoking
+ layout may change the view hierarchy during the drawing operation,
+ which is not supported on Leopard.
+
+2008-08-08 Maxime Britto <britto@apple.com>
+
+ Reviewed by Adele.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _scrollDOMRangeToVisible:]):
+
+2008-08-08 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Fix for <rdar://problem/5865504>
+
+ This bug was actually *largely* fixed by http://trac.webkit.org/changeset/35538.
+ But with that same patch, it became possible for a WebResource to fail to initialize.
+ Therefore we were trying to add nil to an NSCFArray for certain situations, which is bad.
+ Lets fix that, shall we?
+
+ * WebView/WebArchive.mm:
+ (-[WebArchive subresources]):
+
+2008-08-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Cameron Zwarich.
+
+ Move more methods from Frame into ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=20294
+
+ The WebKit side of this move. Calls to frame() are now frame()->script()
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView getVariable:value:]):
+ (-[WebBaseNetscapePluginView _destroyPlugin]):
+ * Plugins/WebPluginController.mm:
+ (-[WebPluginController destroyPlugin:]):
+ (-[WebPluginController destroyAllPlugins]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ * WebView/WebFrame.mm:
+ (-[WebFrame windowObject]):
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::callEvent):
+ * WebView/WebView.mm:
+ (-[WebView windowScriptObject]):
+
+2008-08-06 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ - fix an assertion failure in Cache::setCapacities()
+
+ * Misc/WebKitSystemBits.h: Changed the return type of WebMemorySize()
+ to uint64_t.
+ * Misc/WebKitSystemBits.m:
+ (WebMemorySize):
+ * WebView/WebView.mm:
+ (+[WebView _setCacheModel:]):
+
+2008-08-05 Anders Carlsson <andersca@apple.com>
+
+ Pass in the correct class here.
+
+ * WebView/WebResource.mm:
+ (-[WebResourcePrivate dealloc]):
+
+2008-08-05 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/6037398>
+ ER: Deallocate WebKit objects on the main thread, even if released on secondary thread
+
+ Add calls to WebCoreObjCScheduleDeallocateOnMainThread in dealloc methods of objects we expose.
+
+ * Carbon/CarbonWindowAdapter.m:
+ (-[CarbonWindowAdapter dealloc]):
+ * History/WebBackForwardList.mm:
+ (-[WebBackForwardList dealloc]):
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem dealloc]):
+ * Misc/WebElementDictionary.mm:
+ (+[WebElementDictionary initialize]):
+ (-[WebElementDictionary dealloc]):
+ * WebCoreSupport/WebEditorClient.mm:
+ (-[WebEditCommand dealloc]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ * WebView/WebArchive.mm:
+ (-[WebArchivePrivate dealloc]):
+ * WebView/WebDataSource.mm:
+ (-[WebDataSourcePrivate dealloc]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLViewPrivate dealloc]):
+ (-[WebHTMLView dealloc]):
+ * WebView/WebResource.mm:
+ (-[WebResourcePrivate dealloc]):
+
+2008-08-05 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Remove MainThreadObjectDeallocator.{h|mm}.
+
+ * WebView/MainThreadObjectDeallocator.h: Removed.
+ * WebView/MainThreadObjectDeallocator.mm: Removed.
+
+ * WebView/WebView.mm:
+ (-[WebView dealloc]):
+ Call WebCoreObjCScheduleDeallocateOnMainThread instead.
+
+2008-08-05 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Make the main thread object deallocator work with subclasses.
+
+ * WebView/MainThreadObjectDeallocator.h:
+ * WebView/MainThreadObjectDeallocator.mm:
+ (deallocCallback):
+ Call the correct dealloc method.
+
+ (scheduleDeallocateOnMainThread):
+ Store both the class and the instance, so we know which dealloc method to call.
+
+ * WebView/WebView.mm:
+ (-[WebViewPrivate dealloc]):
+ Schedule deallocation on the main thread.
+
+2008-08-05 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Mark Rowe and Anders Carlsson.
+
+ - fix WebMemorySize() reporting a value capped at 2GB
+
+ * misc/WebKitSystemBits.m:
+ (WebMemorySize): Changed to return the max_mem field, which, unlike
+ memory_size, is not capped at 2GB.
+ * WebView/WebView.mm:
+ (+[WebView _setCacheModel:]): Made the cache sizes for over 2GB RAM the
+ same as for 2GB, so that behavior on machines that have more than 2GB
+ RAM is not affected by the fix to WebMemorySize().
+
+2008-08-04 Mark Rowe <mrowe@apple.com>
+
+ Build fix.
+
+ * WebView/WebHTMLView.mm:
+
+2008-08-04 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ Adopt the formal protocols where necessary.
+ Final part of fix for <rdar://problem/5853147>.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ * WebView/WebHTMLView.mm:
+ * WebView/WebView.mm:
+ (-[WebView _openFrameInNewWindowFromMenu:]):
+
+2008-08-04 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Declare empty protocols when using versions of AppKit that do not use formal protocols for delegates and data sources.
+ Part one of fix for <rdar://problem/5853147>.
+
+ * Misc/EmptyProtocolDefinitions.h:
+ * WebKitPrefix.h:
+
+2008-08-04 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Mitz Pettel
+
+ Fix <rdar://problem/5820157> - Saving WebArchives of Mail attachments broken.
+
+ This broke in r31355 when we stopped returning nil WebResources when there was nil
+ resource data.
+
+ * WebView/WebResource.mm:
+ (-[WebResource _initWithCoreResource:]): Restore previous behavior of returning nil
+ when the resource data is null.
+
+2008-08-02 Matt Lilek <webkit@mattlilek.com>
+
+ Reviewed by Tim Hatcher.
+
+ Update the window gradient offset to match the inspector toolbar's new height.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController window]):
+
+2008-08-01 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Jon.
+
+ <rdar://problem/6120206>
+ Crash when plug-in queries for NPPVpluginWantsAllNetworkStreams.
+
+ Pass in a pointer to a void* to make sure that plug-ins don't overwrite the stack.
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+
+2008-07-31 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5949410>
+ Add the ability to transfer a given application cache to a new database.
+
+ * Misc/WebKitNSStringExtras.h:
+ * Misc/WebKitNSStringExtras.m:
+ (+[NSString _webkit_applicationCacheDirectoryWithBundleIdentifier:]):
+ New method which returns the appopriate cache directory for a given bundle identifier.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource _transferApplicationCache:]):
+ Transfer the application cache.
+
+ * WebView/WebDataSourcePrivate.h:
+ * WebView/WebView.mm:
+ (WebKitInitializeApplicationCachePathIfNecessary):
+ Change this to use _webkit_applicationCacheDirectoryWithBundleIdentifier.
+
+2008-07-31 John Sullivan <sullivan@apple.com>
+
+ WebKit part of <rdar://problem/6116650> Text-only zoom setting should be stored in WebKit prefs
+
+ Reviewed by Hyatt
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ added WebKitZoomsTextOnlyPreferenceKey
+
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ default value of YES for WebKitZoomsTextOnlyPreferenceKey
+ (-[WebPreferences zoomsTextOnly]):
+ getter for WebKitZoomsTextOnlyPreferenceKey
+ (-[WebPreferences setZoomsTextOnly:]):
+ setter for WebKitZoomsTextOnlyPreferenceKey
+
+ * WebView/WebPreferencesPrivate.h:
+ declare zoomsTextOnly/setZoomsTextOnly:
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+ update WebCore::Settings value for zoomsTextOnly
+
+2008-07-31 David D. Kilzer <ddkilzer@webkit.org>
+
+ Fix layout test results for webarchive/test-xml-stylesheet.xml
+
+ Reviewed by Darin Adler.
+
+ Needed to expose -[WebHTMLRepresentation supportedNonImageMIMETypes]
+ for DumpRenderTree.
+
+ * WebView/WebHTMLRepresentationInternal.h: Added.
+
+2008-07-31 Alexey Proskuryakov <ap@webkit.org>
+
+ Release build fix.
+
+ * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView setWindowIfNecessary]):
+ Don't define to npErr in release builds, as it is only used for logging.
+
+2008-07-31 John Sullivan <sullivan@apple.com>
+
+ Fixed <https://bugs.webkit.org/show_bug.cgi?id=5195>
+ drawing with cacheDisplayInRect:toBitmapImageRep: doesn't trigger layout on Leopard
+
+ Reviewed by Dan
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]):
+ include Leopard in the #ifdef that forces a layout if needed
+
+2008-07-30 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam and Hyatt
+
+ Fix for <rdar://problem/6099748>
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Set the "don't enforce CSS mime type in strict mode"
+ quirk when running under iWeb 2
+
+2008-07-31 Alexey Proskuryakov <ap@webkit.org>
+
+ Rubber-stamped by Maciej.
+
+ Eliminate JSLock (it was already disabled, removing the stub implementaion and all
+ call sites now).
+
+ * ForwardingHeaders/runtime/JSLock.h: Removed.
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
+ (+[WebCoreStatistics shouldPrintExceptions]):
+ (+[WebCoreStatistics setShouldPrintExceptions:]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]):
+ (-[WebBaseNetscapePluginView setWindowIfNecessary]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView createPluginScriptableObject]):
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+ (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]):
+ (-[WebBaseNetscapePluginView loadPluginRequest:]):
+ (-[WebBaseNetscapePluginView _printedPluginBitmap]):
+ * Plugins/WebPluginController.mm:
+ (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]):
+ (-[WebPluginController startAllPlugins]):
+ (-[WebPluginController stopAllPlugins]):
+ (-[WebPluginController addPlugin:]):
+ (-[WebPluginController destroyPlugin:]):
+ (-[WebPluginController destroyAllPlugins]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame evaluateWebScript:]):
+ * WebView/WebView.mm:
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
+
+2008-07-30 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Fixes <rdar://problem/6041390>
+
+ Adds the ability to have a frame that is "disconnected" from the
+ main frame from the perspective of top and parent in
+ Javascript.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _setIsDisconnectedFrame]):
+ * WebView/WebFramePrivate.h:
+
+2008-07-29 Mark Rowe <mrowe@apple.com>
+
+ Tweak to the build fix to keep Dan happy.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ * WebView/WebHTMLView.mm:
+
+2008-07-29 Mark Rowe <mrowe@apple.com>
+
+ Build fix.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView inputContext]):
+ * WebView/WebHTMLView.mm:
+
+2008-07-28 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ Based on a patch by Dimcho Balev.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18676
+ <rdar://problem/6106578>
+ Plug-In API Proposal: Enable plugins to receive response body when an HTTP error occurs
+
+ * Plugins/WebBaseNetscapePluginStream.h:
+ Add NPP_GetValue pointer.
+
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream setPlugin:]):
+ Initialize NPP_GetValue.
+
+ (-[WebBaseNetscapePluginStream wantsAllStreams]):
+ Call NPP_GetValue.
+
+ * Plugins/WebPlugInStreamLoaderDelegate.h:
+ * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h:
+ * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm:
+ (WebNetscapePlugInStreamLoaderClient::wantsAllStreams):
+ Implement this and call down to the stream.
+
+2008-07-28 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam.
+
+ <rdar://problem/6105529>
+ https://bugs.webkit.org/show_bug.cgi?id=19659
+ Turning off plugins causes crash
+
+ When an active page has plug-ins, and plug-ins are disabled, they will be stopped and will
+ end up in a state where they don't have an event handler. Because of this, we need to
+ check that the plug-in has been started before calling the event handler.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView sendActivateEvent:]):
+ (-[WebBaseNetscapePluginView sendDrawRectEvent:]):
+ (-[WebBaseNetscapePluginView setHasFocus:]):
+ (-[WebBaseNetscapePluginView mouseDown:]):
+ (-[WebBaseNetscapePluginView mouseUp:]):
+ (-[WebBaseNetscapePluginView mouseEntered:]):
+ (-[WebBaseNetscapePluginView mouseExited:]):
+ (-[WebBaseNetscapePluginView handleMouseMoved:]):
+ (-[WebBaseNetscapePluginView mouseDragged:]):
+ (-[WebBaseNetscapePluginView scrollWheel:]):
+ (-[WebBaseNetscapePluginView keyUp:]):
+ (-[WebBaseNetscapePluginView keyDown:]):
+ (-[WebBaseNetscapePluginView flagsChanged:]):
+ (-[WebBaseNetscapePluginView cut:]):
+ (-[WebBaseNetscapePluginView copy:]):
+ (-[WebBaseNetscapePluginView paste:]):
+ (-[WebBaseNetscapePluginView selectAll:]):
+ (-[WebBaseNetscapePluginView drawRect:]):
+ (-[WebBaseNetscapePluginView inputContext]):
+
+2008-07-26 Daniel Jalkut <jalkut@red-sweater.com>
+
+ Reviewed by Geoff Garen.
+
+ Changes to accommodate newly named/signatured loading methods in WebCore.
+
+ * Plugins/WebNetscapePluginStream.mm:
+ (-[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
+ * Plugins/WebPluginContainerCheck.mm:
+ (-[WebPluginContainerCheck _isForbiddenFileLoad]):
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+
+2008-07-21 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number.
+
+ * Configurations/Version.xcconfig:
+ * Info.plist:
+
+2008-07-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Geoff.
+
+ <rdar://problem/5820667>
+ CrashTracer: [USER] 3759 crashes in Safari at FrameLoader::activeDocumentLoader const + 6 while canceling plug-in load
+
+ Don't allow URLs to be loaded in response to an NPP_DestroyStream that happens when tearing down the plug-in.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+
+2008-07-21 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Adam Roben.
+
+ <rdar://problem/5624143> WebView printing doesn't work correctly in x86_64
+
+ Fix the return type of an NSView method that we override so that the correct data type is used in 64-bit.
+ This prevents a garbage value being used for the scale factor that the NSView print machinery applies.
+
+ * WebView/WebHTMLView.mm:
+
+2008-07-21 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Fix CallDelegateReturningFloat for x86_64. The x86_64 Objective-C runtime
+ only uses objc_msgSend_fpret for long double return values. For float return
+ values the standard objc_msgSend is used, as on ppc and ppc64.
+
+ * WebView/WebView.mm: Use objc_msgSend_float_return as the name of our version of
+ objc_msgSend with the correct return type. We can no longer call it objc_msgSend_fpret
+ as that method is defined by the Objective-C runtime for x86_64.
+ (CallDelegateReturningFloat):
+
+2008-07-14 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - WebKit part of fixing <rdar://problem/6071850> Subviews not drawn correctly when using -cacheDisplayInRect:toBitmapImageRep:
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Changed
+ to account for the case of being drawn into a bitmap context that is not
+ a window's backing store. In that case, there are no valid "rects being
+ drawn" to clip to.
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]):
+ Added an override of this NSView method which is used in for
+ -cacheDisplayInRect:toBitmapImageRep:. Like two existing NSView drawing
+ machinery overrides, it sets subviews aside before invoking the
+ superclass implementation. On Tiger, it also updates the layout.
+
+2008-07-14 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Geoff Garen.
+
+ Eliminate per-thread JavaScript global data instance support and make arbitrary
+ global data/global object combinations possible.
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ Ask WebCore for its instance of JSGlobalData, now that it is not in per-thread storage.
+
+2008-07-11 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Disable WTF leak messages when using fast teardown. Use full document teardown while running in debug.
+
+ * WebView/WebPreferences.m: Removed.
+ * WebView/WebPreferences.mm: Copied from http:/svn.webkit.org/repository/webkit/trunk/WebKit/mac/WebView/WebPreferences.m.
+ (+[WebPreferences initialize]): if running in Default enable full document teardown
+ (-[WebPreferences editableLinkBehavior]):
+ (-[WebPreferences setFullDocumentTeardownEnabled:]):
+ * WebView/WebView.mm:
+ (-[WebView _close]): disable leak messages if using fast teardown
+
+2008-07-10 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute.
+
+ * Configurations/WebKit.xcconfig:
+
+2008-07-10 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC.
+
+ * Plugins/WebPlugin.h: Wrap annotations on methods declared in categories in the WEBKIT_CATEGORY_METHOD_ANNOTATION macro.
+ * WebView/WebFrameLoadDelegate.h: Ditto.
+ * WebView/WebUIDelegate.h: Ditto.
+
+2008-07-10 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark.
+
+ Add availability macros for the new WebPlugin methods.
+
+ * Plugins/WebPlugin.h:
+ * Plugins/WebPluginViewFactory.h:
+
+2008-07-09 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Don't warn about deprecated functions in production builds.
+
+ * Configurations/Base.xcconfig:
+ * Configurations/DebugRelease.xcconfig:
+
+2008-07-09 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ <rdar://problem/5823684> - Crash manipulating frame tree of a new frame before the new frame
+ has been installed in a frame tree.
+
+ The root of this problem was that calling init() on a new frame could end up calling arbitrary
+ javascript that might end up removing the frame from the tree. This opened up a small can of worms
+ such as the frame not having yet been installed in its frame tree, and other assumed behavior while
+ destroying the frame.
+
+ Note that each platforms WebKit API layer needs to make this new guarantee:
+ "The new Frame must be installed in its FrameTree before newCoreFrame->init() is called"
+ I am fixing Mac, and Windows and GTK already have this property. Wx currently has subframes disabled
+ but will need to add this guarantee when re-enabling, and Qt is currently vulnerable to this same bug.
+
+ Alternately, the way frames are created right now is roundabout and asinine, and this is a key
+ architectural improvement we can make in the future so the individual platform clients are no longer
+ vulnerable to this problem, which should really have been a WebCore issue.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createFrame): Don't bother null checking the newCoreFrame - can't be NULL.
+ Don't appendChild() the new frame here.
+ Null-check the new frame's page before loading the URL into it, as it might already have been
+ removed from the page.
+
+ * WebView/WebFrame.mm:
+ (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): If there is an ownerElement,
+ go ahead and install the new frame in the frame tree *before* calling init() on it.
+
+2008-07-09 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Make some WebPlugin and WebPluginFactory SPI public.
+
+ * Plugins/WebPlugin.h:
+ * Plugins/WebPluginPrivate.h:
+ * Plugins/WebPluginViewFactory.h:
+ * Plugins/WebPluginViewFactoryPrivate.h:
+
+2008-07-08 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Reviewed by Anders.
+
+ Port r34988 to Mac: don't call NPP_DestroyStream if NPP_NewStream was
+ unsuccessful.
+
+ * Plugins/WebBaseNetscapePluginStream.h: Added new member,
+ newStreamSuccessful.
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): Initialize new member.
+ (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): If NPP_NewStream is successful, set
+ newStreamSuccessful to YES.
+ (-[WebBaseNetscapePluginStream _destroyStream]): Only call
+ NPP_DestroyStream if newStreamSuccessful is true.
+
+2008-07-08 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - WebKit part of <rdar://problem/6008409> Need a way to disable updates in offscreen views
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView addWindowObservers]): Added code to observe when the
+ window goes onscreen.
+ (-[WebHTMLView removeWindowObservers]): Added.
+ (-[WebHTMLView windowWillOrderOnScreen:]): Added. If the view is set to
+ not update when offscreen, calls -setNeedsDisplay: just before it comes
+ onscreen.
+ * WebView/WebPreferenceKeysPrivate.h: Added preference key.
+ * WebView/WebPreferences.m:
+ (+[WebPreferences initialize]): Made updates when offscreen on by
+ default.
+ (-[WebPreferences updatesWhenOffscreen]): Added.
+ (-[WebPreferences setUpdatesWhenOffscreen:]): Added.
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Added code to update the
+ updatesWhenOffscreen setting in WebCore.
+
+2008-07-07 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Speculative fix for
+ <rdar://problem/5839800>
+ CrashTracer: [USER] 5802 crashes in Safari at com.apple.WebKit: -[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent] + 389
+
+ Set _private->closed to YES before calling -[WebPluginController destroyAllPlugins].
+
+ My theory is that the plug-in destruction callbacks could end up rescheduling timers or re-adding notifications.
+ This is usually protected by _private->closed, but in this case it might still be false.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView close]):
+
+2008-07-05 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Remove WebSearchableTextView as it has been unused for some time now.
+
+ * Misc/WebSearchableTextView.h: Removed.
+ * Misc/WebSearchableTextView.m: Removed.
+
+2008-07-05 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Don't leak the result of WKCopyCFLocalizationPreferredName when running under GC.
+
+ * Misc/WebNSUserDefaultsExtras.m:
+ (-[NSString _webkit_HTTPStyleLanguageCode]):
+
+2008-07-02 Alexey Proskuryakov <ap@webkit.org>
+
+ Inspired and reviewed by Mark Rowe.
+
+ Change non-API includes from JavaScriptCore/ to kjs/ and wtf/ to match prevalent style.
+
+ * Carbon/HIViewAdapter.m:
+ * DOM/WebDOMOperations.mm:
+ * DefaultDelegates/WebDefaultContextMenuDelegate.mm:
+ * DefaultDelegates/WebDefaultPolicyDelegate.m:
+ * History/WebBackForwardList.mm:
+ * History/WebHistory.mm:
+ * History/WebHistoryItem.mm:
+ * History/WebHistoryItemInternal.h:
+ * Misc/WebCoreStatistics.mm:
+ * Misc/WebDownload.m:
+ * Misc/WebGraphicsExtras.c:
+ * Misc/WebKitLogging.h:
+ * Misc/WebKitSystemBits.m:
+ * Misc/WebLocalizableStrings.m:
+ * Misc/WebNSArrayExtras.m:
+ * Misc/WebNSDataExtras.m:
+ * Misc/WebNSDictionaryExtras.m:
+ * Misc/WebNSFileManagerExtras.m:
+ * Misc/WebNSPasteboardExtras.mm:
+ * Misc/WebNSURLExtras.mm:
+ * Misc/WebNSUserDefaultsExtras.m:
+ * Panels/WebAuthenticationPanel.m:
+ * Panels/WebPanelAuthenticationHandler.m:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ * Plugins/WebBasePluginPackage.m:
+ * Plugins/WebNetscapePluginEmbeddedView.mm:
+ * Plugins/WebPluginContainerCheck.mm:
+ * Plugins/WebPluginController.mm:
+ * Plugins/WebPluginDatabase.mm:
+ * WebCoreSupport/WebJavaScriptTextInputPanel.m:
+ * WebCoreSupport/WebKeyGenerator.m:
+ * WebCoreSupport/WebViewFactory.mm:
+ * WebKitPrefix.h:
+ * WebView/WebHTMLRepresentation.mm:
+ * WebView/WebPDFRepresentation.m:
+ * WebView/WebPDFView.mm:
+ * WebView/WebScriptDebugger.mm:
+
+2008-07-01 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Disable JSLock for per-thread contexts.
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
+ (+[WebCoreStatistics shouldPrintExceptions]):
+ (+[WebCoreStatistics setShouldPrintExceptions:]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]):
+ (-[WebBaseNetscapePluginView setWindowIfNecessary]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView createPluginScriptableObject]):
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+ (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]):
+ (-[WebBaseNetscapePluginView loadPluginRequest:]):
+ (-[WebBaseNetscapePluginView _printedPluginBitmap]):
+ * Plugins/WebPluginController.mm:
+ (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]):
+ (-[WebPluginController startAllPlugins]):
+ (-[WebPluginController stopAllPlugins]):
+ (-[WebPluginController addPlugin:]):
+ (-[WebPluginController destroyPlugin:]):
+ (-[WebPluginController destroyAllPlugins]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame evaluateWebScript:]):
+ * WebView/WebView.mm:
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
+ Pass a parameter (always false) to JSLock and JSLock::DropAllLocks to indicate that WebKit
+ doesn't need locking. In the future, it may be possible to remove some of these if we
+ establish that this won't make JSC assertions fail (and that we don't want to add such
+ assertions either).
+ Added includes that are now needed.
+
+2008-07-01 Kevin McCullough <kmccullough@apple.com>
+
+ Build fix.
+
+ * WebView/WebView.mm:
+
+2008-07-01 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Use the PluginMainThreadScheduler, and implement NPN_PluginThreadAsyncCall.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView _createPlugin]):
+ Register the plug-in instance.
+
+ (-[WebBaseNetscapePluginView _destroyPlugin]):
+ Unegister the plug-in instance.
+
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage load]):
+ Set NPN_PluginThreadAsyncCall.
+
+ * Plugins/npapi.mm:
+ (NPN_PluginThreadAsyncCall):
+ Implement this.
+
+2008-07-01 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - WebKit part of moving the method to set the base writing direction from Frame to Editor
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView toggleBaseWritingDirection:]): Changed back to call the
+ Editor method.
+ (-[WebHTMLView changeBaseWritingDirection:]): Ditto.
+ (-[WebHTMLView _changeBaseWritingDirectionTo:]): Ditto.
+
+2008-07-01 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix: forgot to check in this file.
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::WebScriptDebugger):
+
+2008-06-30 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ - WebKit/mac part of <rdar://problem/3881497> Writing direction context menu item has no effect on text typed in Safari
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView toggleBaseWritingDirection:]): Changed to call
+ WebCore::Frame::setSelectionBaseWritingDirection() instead of
+ WebCore::Editor::setBaseWritingDirection().
+ (-[WebHTMLView changeBaseWritingDirection:]): Ditto.
+ (-[WebHTMLView _changeBaseWritingDirectionTo:]): Ditto.
+
+2008-06-28 Darin Adler <darin@apple.com>
+
+ - fix build
+
+ * WebView/WebView.mm:
+ (aeDescFromJSValue): Use get instead of getItem, which no longer exists.
+
+2008-06-26 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Add a new MainThreadObjectDeallocator which can schedule dealloc calls on the main thread
+ if necessary. Use this for the WebView class.
+
+ * WebView/MainThreadObjectDeallocator.h: Added.
+ * WebView/MainThreadObjectDeallocator.mm: Added.
+ (deallocCallback):
+ (scheduleDeallocateOnMainThread):
+ * WebView/WebView.mm:
+ (-[WebViewPrivate dealloc]):
+ (+[WebView initialize]):
+
+2008-06-25 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark.
+
+ <rdar://problem/5984270>
+ REGRESSION (Tiger only) : Mail crashes because message load is being processed on a secondary thread
+
+ * WebView/WebView.mm:
+ (tigerMailReleaseIMP):
+ New method that makes sure that the final release happens on the main thread.
+
+ (-[WebView release]):
+ New method that just calls [super release];
+
+ (+[WebView initialize]):
+ When running under Tiger mail, replace the release method with tigerMailReleaseIMP.
+
+2008-06-19 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Geoff.
+
+ Make Machine per-JSGlobalData.
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::WebScriptDebugger):
+
+2008-06-17 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Prepare JavaScript heap for being per-thread.
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ Use JSGlobalData::threadInstance()->heap instead of static Collector calls.
+
+2008-06-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Use create instead of new
+ to create a CSSMutableStyleDeclaration.
+
+2008-06-16 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5951874> WebHTMLHighlighter mistakenly gained two new methods, causing compile warnings
+
+ _pauseNullEventsForAllNetscapePlugins and _resumeNullEventsForAllNetscapePlugins ended up being declared both in
+ WebHTMLViewInternal.h and as members of the WebHTMLHighlighter protocol in WebHTMLViewPrivate.h. They don't belong
+ in the protocol, but they do need to be available outside of WebKit so they're being moved to the correct location
+ in WebHTMLViewPrivate.h and removed from WebHTMLViewInternal.h.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]):
+ (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]):
+ * WebView/WebHTMLViewInternal.h:
+ * WebView/WebHTMLViewPrivate.h:
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - give Frame object functions shorter names: scriptProxy() -> script(),
+ selectionController() -> selection(), animationController() -> animation()
+
+ * Plugins/WebPluginController.mm:
+ (-[WebPluginController webPlugInContainerSelectionColor]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _attachScriptDebugger]):
+ (-[WebFrame _hasSelection]):
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
+ (-[WebFrame _convertToNSRange:]):
+ (-[WebFrame _convertToDOMRange:]):
+ (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+ (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]):
+ (-[WebFrame _insertParagraphSeparatorInQuotedContent]):
+ (-[WebFrame _selectedNSRange]):
+ (-[WebFrame _selectNSRange:]):
+ (-[WebFrame globalContext]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _selectedRange]):
+ (-[WebHTMLView _hasSelection]):
+ (-[WebHTMLView _hasSelectionOrInsertionPoint]):
+ (-[WebHTMLView _hasInsertionPoint]):
+ (-[WebHTMLView _isEditable]):
+ (-[WebHTMLView _updateFocusedAndActiveState]):
+ (-[WebHTMLView readSelectionFromPasteboard:]):
+ (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
+ (-[WebHTMLView maintainsInactiveSelection]):
+ (-[WebHTMLView paste:]):
+ (isTextInput):
+ (-[WebHTMLView inputContext]):
+ (-[WebTextCompleteController doCompletion]):
+ (-[WebHTMLView selectAll]):
+ (-[WebHTMLView deselectAll]):
+ (-[WebHTMLView selectedAttributedString]):
+ * WebView/WebView.mm:
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
+ (-[WebView setSelectedDOMRange:affinity:]):
+ (-[WebView selectedDOMRange]):
+ (-[WebView selectionAffinity]):
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - rename KJS::List to KJS::ArgList
+
+ * WebView/WebScriptDebugger.h:
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - new names for more JavaScriptCore files
+
+ * WebView/WebView.mm:
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - new names for a few key JavaScriptCore files
+
+ * ForwardingHeaders/kjs/JSFunction.h: Copied from WebKit/mac/ForwardingHeaders/kjs/function.h.
+ * ForwardingHeaders/kjs/JSObject.h: Copied from WebKit/mac/ForwardingHeaders/kjs/object.h.
+ * ForwardingHeaders/kjs/JSString.h: Copied from WebKit/mac/ForwardingHeaders/kjs/internal.h.
+ * ForwardingHeaders/kjs/JSValue.h: Copied from WebKit/mac/ForwardingHeaders/kjs/value.h.
+ * ForwardingHeaders/kjs/function.h: Removed.
+ * ForwardingHeaders/kjs/internal.h: Removed.
+ * ForwardingHeaders/kjs/object.h: Removed.
+ * ForwardingHeaders/kjs/value.h: Removed.
+ * WebView/WebScriptDebugDelegate.mm:
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ Rubber stamped by Sam.
+
+ - use JS prefix and simpler names for basic JavaScriptCore types,
+ to complement JSValue and JSObject
+
+ * WebView/WebView.mm:
+ (aeDescFromJSValue):
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Rubber stamped by Sam.
+
+ - new names for kjs_binding.h and kjs_proxy.h
+
+ * WebView/WebFrame.mm:
+ * WebView/WebScriptDebugDelegate.mm:
+ * WebView/WebView.mm:
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Rubber stamped by Sam.
+
+ - renamed HTMLGenericFormElement to HTMLFormControlElement
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation elementWithName:inForm:]):
+ (-[WebHTMLRepresentation controlsInForm:]):
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - more of https://bugs.webkit.org/show_bug.cgi?id=17257
+ start ref counts at 1 instead of 0 for speed
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createDocumentLoader): Use create instead of new.
+ (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by
+ a ref call inside the Frame constructor. The lifetime rules for Frame are now the
+ conventional ones without a special case.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource _initWithDocumentLoader:]): Changed argument to be a PassRefPtr, since
+ this function takes ownership of the DocumentLoader.
+ (-[WebDataSource initWithRequest:]): Use create instead of new.
+ * WebView/WebDataSourceInternal.h: Changed _initWithDocumentLoader argument to be a
+ PassRefPtr and also cleaned up the header a bit.
+
+ * WebView/WebDocumentLoaderMac.h:
+ (WebDocumentLoaderMac::create): Added. Also made the constructor and a couple of virtual
+ functions private.
+
+ * WebView/WebFrame.mm:
+ (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Use create instead
+ of new.
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - more work on https://bugs.webkit.org/show_bug.cgi?id=17257
+ start ref counts at 1 instead of 0 for speed
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+
+2008-06-13 Darin Adler <darin@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - updated for addition of FormState argument to action policy functions
+ - added WebActionFormKey
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+ (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+ (WebFrameLoaderClient::actionDictionary):
+ * WebKit.exp:
+ * WebView/WebPolicyDelegate.mm:
+ * WebView/WebPolicyDelegatePrivate.h:
+
+2008-06-12 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Dan and Darin
+
+ Clear up the confusion about _close (older private method) vs -close (newer public method).
+
+ * WebView/WebView.mm:
+ (-[WebView _isClosed]):
+ simplified style
+ (-[WebView _close]):
+ added a comment about how clients and subclasses should use -close instead
+ (-[WebView dealloc]):
+ call -close instead of _close, so subclasses that override the public method will have the intended behavior
+ (-[WebView close]):
+ added a comment
+ (-[WebView _windowWillClose:]):
+ call -close instead of _close, so subclasses that override the public method will have the intended behavior
+
+ * WebView/WebViewPrivate.h:
+ added a comment about how clients and subclasses should use -close instead
+
+2008-06-07 Darin Adler <darin@apple.com>
+
+ Reviewed by Mitz.
+
+ - work on https://bugs.webkit.org/show_bug.cgi?id=17257
+ start ref counts at 1 instead of 0 for speed
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem init]):
+ (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
+ (-[WebHistoryItem initWithURL:target:parent:title:]):
+ (-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]):
+ * WebView/WebView.mm:
+ (+[WebView _decodeData:]):
+
+2008-06-03 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Tim.
+
+ Bug 12983: Web Inspector break on the debugger keyword
+ <https://bugs.webkit.org/show_bug.cgi?id=12983>
+
+ Add stubs to allow old webkit debugger interface to build.
+
+ * WebView/WebScriptDebugger.h:
+ * WebView/WebScriptDebugger.mm:
+
+2008-06-03 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5980961>
+
+ In 64-bit Web Kit, converting between float and double, can cause rounding errors which in turn causes
+ newBottom to be larger than oldBottom which is illegal.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]):
+
+2008-06-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mitz.
+
+ Speculative fix for <rdar://problem/5661112>
+ CrashTracer: [USER] 49 crashes in DashboardClient at com.apple.WebCore: WebCore::RenderPart::setWidget + 62
+
+ Defer loads while calling NPP_New. Some plug-ins start a run-loop inside NPP_New and finished loads could cause
+ layouts to be triggered.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView _createPlugin]):
+
+2008-05-29 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5949462> REGRESSION: Can't paste screen captures into Mail
+
+ AppKit started putting PNG instead of PICT onto the pasteboard for screen
+ captures. Added support for PNG with kUTTypePNG. Tiger doesn't support
+ setting and retrieving pasteboard types with UTIs, but we don't know of any
+ applications on Tiger that put only PNG on the pasteboard.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]):
+ (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
+
+2008-05-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Brady.
+
+ <rdar://problem/5970312>
+ icon file specified for stand alone web app causes crash if the icon can't be found
+
+ Handle the case where iconData is null.
+
+ * Misc/WebIconFetcher.mm:
+ (WebIconFetcherClient::finishedFetchingIcon):
+
+2008-05-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mitz.
+
+ <rdar://problem/5971845>
+ https://bugs.webkit.org/show_bug.cgi?id=19313
+ Add version member to NPCocoaEvent
+
+ Initialize the version member to 0 for all events.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (initializeEvent):
+ (WebNetscapePluginEventHandlerCocoa::drawRect):
+ (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
+ (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+ (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+ (WebNetscapePluginEventHandlerCocoa::windowFocusChanged):
+ (WebNetscapePluginEventHandlerCocoa::focusChanged):
+
+2008-05-29 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Jessica Kahn.
+
+ - fix <rdar://problem/5965013> Page 2 does not print correctly
+
+ When printing, _recursiveDisplayRectIfNeededIgnoringOpacity:... and
+ _recursiveDisplayAllDirtyWithLockFocus:... can be invoked without
+ -viewWillDraw being sent first, which could lead to painting without
+ valid layout. The fix is to ensure up-to-date layout in those methods
+ when printing.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
+ (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]):
+
+2008-05-28 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Jon.
+
+ Remove workaround, this is no longer a problem.
+
+ * WebView/WebView.mm:
+ (-[WebView _removeObjectForIdentifier:]):
+
+2008-05-27 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
+ REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
+ clicking button in returnEvent-crash.html
+
+ Added implementations for willExecuteProgram and didExecuteProgram, which
+ take care of making sure we're not hanging on to stale data.
+
+2008-05-27 Timothy Hatcher <timothy@apple.com>
+
+ Fixes a bug where unplugging the monitor from a video card and
+ moving it to another video card would no longer show OpenGL plugins
+ until you relaunched Safari.
+
+ <rdar://problem/5790983> Add AllowOfflineDisplays pixel format
+ attribute to OpenGL contexts
+
+ Reviewed by Kevin Decker.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView _createWindowedAGLContext]): Added
+ AGL_ALLOW_OFFLINE_RENDERERS for non-Tiger builds.
+ (-[WebBaseNetscapePluginView _createWindowlessAGLContext]): Ditto.
+
+2008-05-25 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5840884> _recursive_resumeNullEventsForAllNetscapePlugins and _pauseNullEvents not defined
+
+ Follow-up for r33052. _recursive_resumeNullEventsForAllNetscapePlugins and _recursive_pauseNullEventsForAllNetscapePlugins
+ need to be declared in WebFramePrivate.h rather than WebFrameInternal.h so they can be used from outside of WebKit.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
+ (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebFramePrivate.h:
+
+2008-05-23 Timothy Hatcher <timothy@apple.com>
+
+ Fix attaching and detaching the Web Inspector. This change removes
+ the clunky animation that never looked right and was causing issues
+ where the inspected WebView would get into a no useable state.
+
+ <rdar://problem/5958812> Attaching and Detaching the Web Inspector
+ can cause the inspected WebVIew to be unusable
+
+ Reviewed by Adam Roben.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController close]): Removes animation code.
+ Sets the frame directly and does a displayIfNeeded to prevent
+ showing the Inspector in the page and in the Inspector window.
+ (-[WebInspectorWindowController showWindow:]): Removes animation code.
+ Sets the frame directly.
+ (-[WebInspectorWindowController attach]): Simplified.
+ (-[WebInspectorWindowController detach]): Ditto.
+
+2008-05-22 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - fix broken documentation of
+ webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:
+
+ * WebView/WebUIDelegate.h: Fixed method name in HeaderDoc for
+ -webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:
+
+2008-05-22 Timothy Hatcher <timothy@apple.com>
+
+ <rdar://problem/5956403> Update the Develop menu to match the new Inspector items
+
+ Reviewed by Adam Roben.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController showWebInspector:]):
+ (-[WebInspectorWindowController showErrorConsole:]):
+ (-[WebInspectorWindowController toggleDebuggingJavaScript:]):
+ (-[WebInspectorWindowController toggleProfilingJavaScript:]):
+ (-[WebInspectorWindowController validateUserInterfaceItem:]):
+ * WebInspector/WebInspector.h:
+ * WebInspector/WebInspector.mm:
+ (-[WebInspector showConsole:]):
+ (-[WebInspector showTimeline:]):
+ (-[WebInspector isDebuggingJavaScript]):
+ (-[WebInspector toggleDebuggingJavaScript:]):
+ (-[WebInspector startDebuggingJavaScript:]):
+ (-[WebInspector stopDebuggingJavaScript:]):
+ (-[WebInspector isProfilingJavaScript]):
+ (-[WebInspector toggleProfilingJavaScript:]):
+ (-[WebInspector startProfilingJavaScript:]):
+ (-[WebInspector stopProfilingJavaScript:]):
+
+2008-05-22 Josh Aas <joshmoz@gmail.com>
+
+ Reviewed by Anders.
+
+ <rdar://problem/5956429>
+ https://bugs.webkit.org/show_bug.cgi?id=19192
+ remove NPNVpluginEventModel, fix example plugin
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView getVariable:value:]):
+
+2008-05-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Maciej.
+
+ Add WebIconFetcher.
+
+ * Misc/WebIconFetcher.h: Added.
+ * Misc/WebIconFetcher.mm: Added.
+ (WebIconFetcherClient::WebIconFetcherClient):
+ (WebIconFetcherClient::finishedFetchingIcon):
+ (WebIconFetcherClient::setFetcher):
+ (-[WebIconFetcher init]):
+ (-[WebIconFetcher dealloc]):
+ (-[WebIconFetcher finalize]):
+ (-[WebIconFetcher cancel]):
+ (-[WebIconFetcher _initWithIconFetcher:client:]):
+ (+[WebIconFetcher _fetchApplicationIconForFrame:target:selector:]):
+ * Misc/WebIconFetcherInternal.h: Added.
+ * WebView/WebFrame.mm:
+ (-[WebFrame fetchApplicationIcon:selector:]):
+ * WebView/WebFramePrivate.h:
+
+=== End merge of squirrelfish ===
+
+2008-05-21 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ Updated for API changes from merging with trunk WebCore's new debugger.
+
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame evaluateWebScript:]): Explicitly check for an
+ exception return, since the DebuggerCallFrame no longer automatically
+ substitutes the exception for the return value.
+
+ * WebView/WebScriptDebugger.mm: Use the dynamic global object, not the
+ lexical global object, since the debugger attaches based on dynamic
+ global object.
+
+2008-05-17 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Re-enabled previously disabled debugging functionality.
+
+ There are two major changes from how the WebKit debugger used to work:
+
+ (1) All the interesting bits are implemented down in JavaScriptCore. The
+ debugger just calls through to KJS::DebuggerCallFrame for everything.
+
+ (2) Instead of copyihng a pointer to an ExecState once, the debugger
+ copies the DebuggerCallFrame passed to it in each callback. This is
+ because the VM no longer maintains a fully transparent execution state
+ to which you can hold a pointer, and the DebuggerCallFrames it vends
+ are temporaries.
+
+ Also, we NULL out a WebScriptCallFrame's DebuggerCallFrame upon return
+ from its function. This is safer than the old method, which was to
+ hold a stale ExecState* and hope for the best.
+
+2008-05-13 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Updated for API changes in KJS::Debugger.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _attachScriptDebugger]): Changed the order of operations to
+ fix an ASSERT that can happen when re-entering _attachScriptDebugger.
+
+2008-05-13 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Updated WebScriptDebugger API to accept a SourceProvider instead
+ of a WebCore::String, to avoid copying.
+
+ (WebScriptDebugger::sourceParsed): Updated this function not to return
+ a value.
+
+2008-04-30 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix: #ifdef'd out some code that doesn't work anymore.
+
+2008-04-30 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ #ifdef'd out some debugger code that doesn't work anymore.
+
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame scopeChain]):
+
+2008-04-21 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix.
+
+ * ChangeLog:
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame scopeChain]):
+
+2008-03-30 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Build fix.
+
+=== Start merge of squirrelfish ===
+
+2008-05-21 Darin Adler <darin@apple.com>
+
+ - fix build
+
+ * WebView/WebViewPrivate.h: Remove declaration of closeWithFastTeardown. We can add it back later
+ if we want, but if we do, we should probably make some refinements like checking _private->closed
+ and applicationIsTerminating.
+
+2008-05-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders and Kevin Decker.
+
+ - fix <rdar://problem/5951130> REGRESSION: crash on quit after reopening windows from previous session
+
+ * WebView/WebView.mm:
+ (-[WebViewPrivate dealloc]): Fix assertions to not complain when fast teardown is used.
+ (-[WebView _closePluginDatabases]): Factored out some common code from both versions of close.
+ (-[WebView _closeWithFastTeardown]): Added an underscore to this method's name, since it's internal.
+ Streamlined the code a bit. Added a line of code to set _private->closed (this is the bug fix).
+ (-[WebView _close]): Changed for new method name and to use _closePluginDatabases.
+
+2008-05-19 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Darin Adler.
+
+ more fast teardown performance work
+
+ * Misc/WebDownload.m:
+ (-[WebDownloadInternal downloadDidBegin:]):
+ (-[WebDownloadInternal downloadDidFinish:]):
+ (-[WebDownloadInternal download:didFailWithError:]):
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::disableSuddenTermination):
+ (WebChromeClient::enableSuddenTermination):
+
+2008-05-18 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - fix <rdar://problem/5944596> IDNs are displayed as punycode in the authentication panel
+
+ * Panels/WebAuthenticationPanel.m:
+ (-[WebAuthenticationPanel setUpForChallenge:]):
+
+2008-05-16 Timothy Hatcher <timothy@apple.com>
+
+ Removes WebScriptDebugServer files and related calls. This removes
+ the hooks that Drosera uses for debugging. Now that the Web Inspector
+ has a better debugger, we don't need these anymore.
+
+ Reviewed by Sam Weinig.
+
+ * DefaultDelegates/WebScriptDebugServer.h: Removed.
+ * DefaultDelegates/WebScriptDebugServer.m: Removed.
+ * DefaultDelegates/WebScriptDebugServerPrivate.h: Removed.
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ * WebKit.exp:
+ * WebView/WebScriptDebugDelegate.mm:
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::sourceParsed):
+ (WebScriptDebugger::callEvent):
+ (WebScriptDebugger::atStatement):
+ (WebScriptDebugger::returnEvent):
+ (WebScriptDebugger::exception):
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+ * WebView/WebViewPrivate.h:
+
+2008-05-16 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Anders
+
+ <rdar://problem/5942616> - Need to standardize LocalStorage persistence path
+
+ Took the opportunity to touch up another pref that needs the same standardization.
+ That pref is currently not in use on Mac.
+
+ * WebView/WebPreferences.m:
+ (-[WebPreferences _setFTPDirectoryTemplatePath:]):
+ (-[WebPreferences _localStorageDatabasePath]):
+ (-[WebPreferences _setLocalStorageDatabasePath:]):
+ (-[WebPreferences _ftpDirectoryTemplatePath]):
+
+2008-05-16 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Alice Liu
+
+ <rdar://problem/5710317> REGRESSION:Selecting ranges of text should be possible using the keyboard (15310)
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _accessibilityTree]):
+
+2008-05-15 Stephanie Lewis <slewis@apple.com>
+
+ fix mac build
+
+ * WebView/WebView.mm:
+ (-[WebView closeWithFastTeardown]):
+
+2008-05-15 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Anders.
+
+ Turn on fast teardown. I added a preference for using full teardown because
+ the LEAKS output will be useless without a full teardown.
+
+ preference for fullteardown
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.m:
+ (-[WebPreferences setFullDocumentTeardownEnabled:]):
+ (-[WebPreferences fullDocumentTeardownEnabled]):
+ * WebView/WebPreferencesPrivate.h:
+
+ on application quit dispatch unload events and destroy plugins then exit
+ * WebView/WebView.mm:
+ (-[WebView closeWithFastTeardown]):
+ (-[WebView _close]):
+ * WebView/WebViewPrivate.h:
+
+2008-05-15 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Anders.
+
+ get the pending frame unload count from WebCore
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _pendingFrameUnloadEventCount]):
+ * WebView/WebFramePrivate.h:
+
+2008-05-15 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Kevin Decker
+
+ - fixed <rdar://problem/5940275> Inspector highlighting moves to bottom-left corner of
+ screen when new tab appears
+
+ The highlight should go away entirely, but this simple patch just makes it not jump away.
+ The issue with it not going away entirely is harder to fix and covered by <rdar://problem/5322306>
+
+ * WebInspector/WebNodeHighlight.m:
+ (-[WebNodeHighlight _repositionHighlightWindow]):
+ Bail out if target view isn't in a window
+
+2008-05-15 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Anders.
+
+ Track views that contain plugin instances so that they can be destroyed at application
+ quit without walking the entire document tree.
+
+ Add/Remove Netscape plugin views from instance list. Start/stop are when netscape
+ plugins are created and destroyed
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView stop]):
+
+ Add/remove WebKit plugin views from instance list
+ * Plugins/WebPluginController.mm:
+ (-[WebPluginController addPlugin:]):
+ (-[WebPluginController destroyPlugin:]):
+ (-[WebPluginController destroyAllPlugins]):
+
+ Add a set of views with plugin instances to the WebPluginDatabase
+ * Plugins/WebPluginDatabase.h:
+ * Plugins/WebPluginDatabase.mm:
+ (-[WebPluginDatabase init]):
+ (-[WebPluginDatabase dealloc]):
+ (-[WebPluginDatabase addPluginInstanceView:]):
+ (-[WebPluginDatabase removePluginInstanceView:]):
+ (-[WebPluginDatabase removePluginInstanceViewsFor:]):
+ (-[WebPluginDatabase destroyAllPluginInstanceViews]):
+
+ Handle cases where plugin views are detached before the plugin is destroyed.
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::detachedFromParent2):
+ (WebFrameLoaderClient::transitionToCommittedFromCachedPage):
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
+ Add plugin instances to the set in the WebPluginDatabase by way of the WebView
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _destroyAllWebPlugins]):
+ * WebView/WebHTMLViewInternal.h:
+ * WebView/WebView.mm:
+ (-[WebView addPluginInstanceView:]):
+ (-[WebView removePluginInstanceView:]):
+ (-[WebView removePluginInstanceViewsFor:]):
+ * WebView/WebViewInternal.h:
+
+2008-05-15 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Tim Hatcher
+
+ Until the settings/preferences equation can be reworked, we'll need to manually set the local storage path
+ before setting the page group of the new page.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Set the LocalStorage path
+ immediately after creating the page so it is in place for initializing the LocalStorageThread
+
+2008-05-15 Timothy Hatcher <timothy@apple.com>
+
+ Fixes the bug where the Web Inspector would flash white while resizing.
+ This was cause by deferring the window creation.
+
+ <rdar://problem/5873549> REGRESSION: Inspector flickers horribly while resizing (17979)
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController window]): Don't defer the window creation.
+
+2008-05-15 Alexey Proskuryakov <ap@webkit.org>
+
+ Tiger build fix.
+
+ * Misc/WebNSAttributedStringExtras.mm: Import WebTypesInternal.h for NSUInteger.
+
+2008-05-15 Adele Peterson <adele@apple.com>
+
+ Reviewed and landed by Alexey.
+
+ Use TextIterator in +[NSAttributedString _web_attributedStringFromRange:].
+
+ * Misc/WebNSAttributedStringExtras.mm:
+ (+[NSAttributedString _web_attributedStringFromRange:]):
+
+2008-05-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Oliver.
+
+ Add missing NULL check to match rest of file, this was found by the editing fuzzer.
+
+ * WebView/WebResource.mm:
+ (-[WebResource data]):
+
+2008-05-14 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ NPP_ValidAttributesForMarkedText should return NSArray*, not NSArray.
+
+ * Plugins/nptextinput.h:
+
+2008-05-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam.
+
+ Don't empty the application cache in _setCacheModel, since it will be called during initialization.
+ Instead, do it in [WebCache empty].
+
+ * Misc/WebCache.mm:
+ (+[WebCache empty]):
+ * WebView/WebView.mm:
+ (+[WebView _setCacheModel:]):
+
+2008-05-13 chris fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin
+
+ <rdar://problem/4780592> WebKit application has its window announced as HTML content
+
+ * WebCoreSupport/WebViewFactory.mm:
+ (-[WebViewFactory AXWebAreaText]):
+
+2008-05-13 Timothy Hatcher <timothy@apple.com>
+
+ Fixes a crash seen in Xcode where CallUIDelegateReturningBoolean
+ was referencing a nil WebView under validateUserInterfaceItem.
+ The validateUserInterfaceItem methods was being called at a time
+ when the WebHTMLView is being torndown.
+
+ <rdar://problem/5806229> A crash occurs at CallUIDelegateReturningBoolean()
+ while mousing down on menu bar after Xcode News window is opened
+
+ Reviewed by Ada Chan.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView validateUserInterfaceItem:]): NULL check the WebView and
+ return NO when it is nil. Adds a comment.
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView validateUserInterfaceItem:]): Ditto.
+
+2008-05-13 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/5926425> HIWebViewCreateWithClass declared as API in HIWebView.h but never exported from WebKit.framework
+
+ * Carbon/HIWebView.h: Remove HIWebViewCreateWithClass.
+ * Carbon/HIWebView.m: Ditto.
+ (HIWebViewCreate):
+ (HIWebViewConstructor):
+
+2008-05-12 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Ada Chan.
+
+ - WebKit/mac changes for https://bugs.webkit.org/show_bug.cgi?id=17097
+ <rdar://problem/5715471> CGFontRefs (and HFONTs on Windows) leak because FontCache grows without bound
+
+ Added font cache statistics and a function to purge inactive font data.
+
+ * Misc/WebCoreStatistics.h:
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics cachedFontDataCount]):
+ (+[WebCoreStatistics cachedFontDataInactiveCount]):
+ (+[WebCoreStatistics purgeInactiveFontData]):
+ (+[WebCoreStatistics glyphPageCount]):
+
+2008-05-12 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ Decorate some deprecated delegate methods with the availability macros.
+
+ The compiler doesn't appear to warn if a delegate implements these methods, but using the availability
+ macros is good for consistency and documentation.
+
+ * WebView/WebFrameLoadDelegate.h:
+ * WebView/WebUIDelegate.h:
+
+2008-05-12 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ <rdar://problem/5835604> Deprecate HIWebView
+
+ Use of HIWebView is deprecated in favor of embedding a WebView in a HICocoaView.
+
+ * Carbon/CarbonUtils.h: Include the availability macro header and decorate the functions appropriately.
+ * Carbon/HIWebView.h: Ditto.
+
+2008-05-12 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Anders.
+
+ Fixed: <rdar://problem/5840884>_recursive_resumeNullEventsForAllNetscapePlugins and _pauseNullEvents not defined
+
+ Re-added these SPI methods because they are needed by some clients. They were accidentally removed
+ in changeset <http://trac.webkit.org/changeset/31028>
+
+ * Plugins/WebBaseNetscapePluginView.h: Added stopTimers, restartTimers to the header.
+ * WebView/WebFrame.mm:
+ (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): Re-addd.
+ (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): Ditto.
+ * WebView/WebFrameInternal.h: Ditto.
+ * WebView/WebHTMLView.mm: Ditto.
+ (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): Ditto.
+ (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): Ditto.
+ * WebView/WebHTMLViewInternal.h: Ditto.
+ * WebView/WebHTMLViewPrivate.h: Ditto.
+
+2008-05-12 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Alexey.
+
+ Empty the application cache when changing the cache model.
+
+ * WebView/WebView.mm:
+ (+[WebView _setCacheModel:]):
+
+2008-05-12 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Oliver.
+
+ <rdar://problem/5774495> Make Unicode text input possible in Netscape-style plug-ins
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView start]):
+ Get the plug-in text input vtable pointer.
+
+ (-[WebBaseNetscapePluginView stop]):
+ Set the plug-in text input vtable pointer to 0.
+
+ (-[WebBaseNetscapePluginView inputContext]):
+ Return 0 for Carbon plug-ins since we don't want Cocoa to handle text input for them.
+
+ (-[WebBaseNetscapePluginView hasMarkedText]):
+ (-[WebBaseNetscapePluginView insertText:]):
+ (-[WebBaseNetscapePluginView markedRange]):
+ (-[WebBaseNetscapePluginView selectedRange]):
+ (-[WebBaseNetscapePluginView setMarkedText:selectedRange:]):
+ (-[WebBaseNetscapePluginView unmarkText]):
+ (-[WebBaseNetscapePluginView validAttributesForMarkedText]):
+ (-[WebBaseNetscapePluginView attributedSubstringFromRange:]):
+ (-[WebBaseNetscapePluginView characterIndexForPoint:]):
+ (-[WebBaseNetscapePluginView doCommandBySelector:]):
+ (-[WebBaseNetscapePluginView firstRectForCharacterRange:]):
+ (-[WebBaseNetscapePluginView conversationIdentifier]):
+ Implement NSTextInput and call into the plug-in text input vtable.
+
+ (browserTextInputFuncs):
+ New method which returns the browser input vtable.
+
+ (-[WebBaseNetscapePluginView getVariable:value:]):
+ Support getting the browser input vtable pointer.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.h:
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::keyDown):
+ (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+ If the plug-in returns 0 when a NPCocoaEventKeyDown is passed to NPP_HandleEvent,
+ it means that the event should be passed on to the input manager.
+
+ * Plugins/npapi.mm:
+ (NPN_MarkedTextAbandoned):
+ (NPN_MarkedTextSelectionChanged):
+ Add implementations of browser input method methods.
+
+ * Plugins/nptextinput.h: Added.
+ Add file with new text input API.
+
+2008-05-12 Alexey Proskuryakov <ap@webkit.org>
+
+ Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify
+ SquirrelFish merging.
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame evaluateWebScript:]):
+
+2008-05-07 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mitz.
+
+ REGRESSION (3.1.1-TOT): Arrow keys are sticky in Google Maps street view
+ https://bugs.webkit.org/show_bug.cgi?id=18880
+ <rdar://problem/5909513>
+
+ Stop suspending key up events before calling handleEvent.
+
+ * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
+ (WebNetscapePluginEventHandlerCarbon::sendEvent):
+
+2008-05-06 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Andersca.
+
+ prepare for plugin fast teardown work - make WebPluginDatabase a objective C++ file.
+
+ * Plugins/WebPluginDatabase.m: Removed.
+ * Plugins/WebPluginDatabase.mm: Copied from WebKit/mac/Plugins/WebPluginDatabase.m.
+ * Plugins/npapi.m: Removed.
+ * Plugins/npapi.mm: Copied from WebKit/mac/Plugins/npapi.m.
+
+2008-05-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Initialize numArchs to 0.
+
+ * Plugins/WebBasePluginPackage.m:
+ (-[WebBasePluginPackage isNativeLibraryData:]):
+
+2008-05-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Add implementation of NPN_PopUpContextMenu.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView popUpContextMenu:]):
+ * Plugins/WebBaseNetscapePluginViewPrivate.h:
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage load]):
+ * Plugins/npapi.m:
+ (NPN_PopUpContextMenu):
+
+2008-05-06 Anders Carlsson <andersca@apple.com>
+
+ Fix typo (don't read random memory).
+
+ * Plugins/WebBasePluginPackage.m:
+ (-[WebBasePluginPackage isNativeLibraryData:]):
+
+2008-05-05 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Change the isNativeLibraryData: method to handle universal binaries.
+
+ * Plugins/WebBasePluginPackage.m:
+ (swapIntsInHeader):
+ (-[WebBasePluginPackage isNativeLibraryData:]):
+
+2008-05-06 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler
+
+ Preparation for upcoming work making LocalStorage persistent.
+
+ When the application terminates, all LocalStorage areas must be sync'ed out to disk first.
+
+ * WebView/WebView.mm:
+ (+[WebView _applicationWillTerminate]): Close all LocalStorage areas before quitting.
+
+2008-05-05 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Fix for <rdar://problem/5884383>
+ Escape look-a-like characters from the the entire url.
+
+ * Misc/WebNSURLExtras.mm:
+ (escapeUnsafeCharacters):
+ (-[NSURL _web_userVisibleString]):
+
+2008-05-05 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5865171> REGRESSION: Creating a new quote places caret at beginning of quote instead of the end
+
+ * WebView/WebView.mm:
+ (-[WebView _updateSettingsFromPreferences:]): Disable Range mutation on changes to
+ the document for Tiger and Leopard Mail. There is code in Mail that does it, and
+ the two interfere.
+
+2008-05-05 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Tim Hatcher.
+
+ Make the Inspector's localizable strings file match the format used by Dashboard widgets.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (WebInspectorClient::localizedStringsURL):
+
+2008-05-05 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Jess.
+
+ Apparently preflighting can cause hangs for some reason. Revert this for now.
+
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage _initWithPath:]):
+ * Plugins/WebPluginPackage.m:
+ (-[WebPluginPackage initWithPath:]):
+
+2008-05-05 Darin Adler <darin@apple.com>
+
+ Reviewed by Mitz.
+
+ - https://bugs.webkit.org/show_bug.cgi?id=18789
+ fix some shouldCloseWithWindow edge cases
+
+ * WebView/WebView.mm:
+ (-[WebView viewWillMoveToWindow:]): Fix bug where we would stop observing the
+ NSWindowWillCloseNotification if the view was moved out of the window but still
+ had that window set as the host window. Also make sure this function doesn't do
+ anything if the WebView is already closed.
+ (-[WebView setHostWindow:]): Ditto.
+
+2008-05-04 David Kilzer <ddkilzer@apple.com>
+
+ Make parameters match for WebChromeClient::addMessageToConsole()
+
+ Reviewed by John.
+
+ * WebCoreSupport/WebChromeClient.h:
+ (WebChromeClient::addMessageToConsole): Renamed sourceID parameter
+ to sourceURL to match implementation in WebChromeClient.mm.
+
+2008-05-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark.
+
+ Various Cocoa event model and 64-bit plug-in fixes.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
+ Set click count.
+
+ (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+ (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+ Don't try to get the mouse location for keyboard events.
+
+ * Plugins/WebPluginPackage.m:
+ (-[WebPluginPackage initWithPath:]):
+ Preflight the bundle so we won't show 32-bit WebKit plug-ins when running as 64-bit.
+
+2008-05-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam.
+
+ The event union is now named.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::drawRect):
+ (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
+ (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+ (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+ (WebNetscapePluginEventHandlerCocoa::windowFocusChanged):
+ (WebNetscapePluginEventHandlerCocoa::focusChanged):
+
+2008-05-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark.
+
+ Make sure that 32-bit only plug-ins aren't shown when running as 64-bit.
+
+ Call preflightAndReturnError on the bundle, which will check if any of the architectures
+ in the bundle match the current architecture.
+
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage _initWithPath:]):
+
+2008-05-02 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Geoffrey Garen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18826
+ Make JavaScript heap per-thread
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
+ (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ Replaced static Collector calls with calls to a current thread's instance.
+
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame evaluateWebScript:]):
+ Pass ExecState to jsString().
+
+2008-05-01 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mark.
+
+ 64-bit NPAPI plugin build fixes.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
+ (-[WebBaseNetscapePluginView updateAndSetWindow]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView windowBecameKey:]):
+ * Plugins/WebNetscapeDeprecatedFunctions.c:
+ * Plugins/WebNetscapeDeprecatedFunctions.h:
+ * Plugins/WebNetscapePluginEventHandler.mm:
+ (WebNetscapePluginEventHandler::create):
+ * Plugins/WebNetscapePluginEventHandlerCarbon.h:
+ * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
+ * Plugins/WebPluginDatabase.m:
+ (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]):
+
+2008-05-01 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Tim.
+
+ Remove duplicate npfunctions.h header from WebKit.
+
+ * MigrateHeaders.make:
+ Migrate npfunctions.h
+
+ * Plugins/npfunctions.h: Removed.
+
+2008-05-01 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by John.
+
+ Add null checks for the event handler.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView stopTimers]):
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+
+2008-05-01 Anders Carlsson <andersca@apple.com>
+
+ Fix 64-bit build.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.h:
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+
+2008-05-01 Anders Carlsson <andersca@apple.com>
+
+ Fix build.
+
+ * Plugins/npfunctions.h:
+
+2008-05-01 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam.
+
+ Forward mouse move events to the Netscape plug-in view.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView handleMouseMoved:]):
+ New method that just calls the current event handler.
+
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+ (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+ NSFlagsChanged is not a regular keyboard event and some of the NSEvent accessors
+ don't work on it so don't call them.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (NetscapePluginWidget::NetscapePluginWidget):
+ New Widget subclass to be used for Netscape plug-ins.
+
+ (NetscapePluginWidget::handleEvent):
+ Forward NSMouseMoved events to the plug-in.
+
+ (WebFrameLoaderClient::createPlugin):
+ Wrap the plug-in view in a NetscapePluginWidget.
+
+2008-05-01 Alp Toker <alp@nuanti.com>
+
+ Rubber-stamped by Anders.
+
+ GTK+ build fix for changes in r32752. Use int32, not int32_t types in
+ npapi.h.
+
+ Additional fix to use same signedness in npapi.h and Mac for the
+ interval parameter.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (PluginTimer::PluginTimer):
+ (-[WebBaseNetscapePluginView stopTimers]):
+ (-[WebBaseNetscapePluginView restartTimers]):
+ (-[WebBaseNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]):
+ (-[WebBaseNetscapePluginView unscheduleTimer:]):
+ * Plugins/WebBaseNetscapePluginViewPrivate.h:
+ * Plugins/npapi.m:
+ (NPN_ScheduleTimer):
+ (NPN_UnscheduleTimer):
+ * Plugins/npfunctions.h:
+
+2008-04-30 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam.
+
+ Add new Cocoa event model and the NPN_ScheduleTimer/NPN_UnscheduleTimer methods.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (PluginTimer::PluginTimer):
+ (PluginTimer::start):
+ (PluginTimer::fired):
+ (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
+ (-[WebBaseNetscapePluginView stopTimers]):
+ (-[WebBaseNetscapePluginView restartTimers]):
+ (-[WebBaseNetscapePluginView scrollWheel:]):
+ (-[WebBaseNetscapePluginView flagsChanged:]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView eventModel]):
+ (-[WebBaseNetscapePluginView fini]):
+ (-[WebBaseNetscapePluginView getVariable:value:]):
+ (-[WebBaseNetscapePluginView setVariable:value:]):
+ (-[WebBaseNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]):
+ (-[WebBaseNetscapePluginView unscheduleTimer:]):
+ * Plugins/WebBaseNetscapePluginViewInternal.h:
+ * Plugins/WebBaseNetscapePluginViewPrivate.h:
+ * Plugins/WebNetscapePluginEventHandler.h:
+ * Plugins/WebNetscapePluginEventHandler.mm:
+ (WebNetscapePluginEventHandler::create):
+ * Plugins/WebNetscapePluginEventHandlerCarbon.h:
+ * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
+ (WebNetscapePluginEventHandlerCarbon::scrollWheel):
+ (WebNetscapePluginEventHandlerCarbon::flagsChanged):
+ (WebNetscapePluginEventHandlerCarbon::platformWindow):
+ * Plugins/WebNetscapePluginEventHandlerCocoa.h: Added.
+ (WebNetscapePluginEventHandlerCocoa::startTimers):
+ (WebNetscapePluginEventHandlerCocoa::stopTimers):
+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm: Added.
+ (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa):
+ (WebNetscapePluginEventHandlerCocoa::drawRect):
+ (WebNetscapePluginEventHandlerCocoa::mouseDown):
+ (WebNetscapePluginEventHandlerCocoa::mouseDragged):
+ (WebNetscapePluginEventHandlerCocoa::mouseEntered):
+ (WebNetscapePluginEventHandlerCocoa::mouseExited):
+ (WebNetscapePluginEventHandlerCocoa::mouseMoved):
+ (WebNetscapePluginEventHandlerCocoa::mouseUp):
+ (WebNetscapePluginEventHandlerCocoa::scrollWheel):
+ (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
+ (WebNetscapePluginEventHandlerCocoa::keyDown):
+ (WebNetscapePluginEventHandlerCocoa::keyUp):
+ (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+ (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+ (WebNetscapePluginEventHandlerCocoa::windowFocusChanged):
+ (WebNetscapePluginEventHandlerCocoa::focusChanged):
+ (WebNetscapePluginEventHandlerCocoa::platformWindow):
+ (WebNetscapePluginEventHandlerCocoa::sendEvent):
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage load]):
+ * Plugins/npapi.m:
+ (NPN_ScheduleTimer):
+ (NPN_UnscheduleTimer):
+ * Plugins/npfunctions.h:
+
+2008-04-30 Brady Eidson <beidson@apple.com>
+
+ Fix my WebPreferences revert check-in
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2008-04-30 Brady Eidson <beidson@apple.com>
+
+ Rubberstamped by John Sullivan
+
+ Revert the remainder of my original preferences changes from last week.
+ They caused a massive PLT regression (too many notifications being sent out
+ or listened to that weren't previously) and it's not in my schedule to refine
+ the preferences code instead of working on my feature!
+
+ * WebView/WebView.mm:
+ (-[WebView _updateSettingsFromPreferences:]):
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+
+2008-04-30 Anders Carlsson <andersca@apple.com>
+
+ Fix the 64-bit build.
+
+ * Plugins/WebNetscapePluginEventHandler.h:
+ * Plugins/WebNetscapePluginEventHandler.mm:
+ * Plugins/WebNetscapePluginEventHandlerCarbon.h:
+ * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
+
+2008-04-29 David D. Kilzer <ddkilzer@apple.com>
+
+ BUILD FIX for Release build.
+
+ * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
+ (WebNetscapePluginEventHandlerCarbon::drawRect): Declare acceptedEvent
+ separately so the compiler doesn't complain about an unused variable.
+ (WebNetscapePluginEventHandlerCarbon::TSMEventHandler): Ditto.
+
+2008-04-29 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam.
+
+ Refactor the Carbon event handling code out into a separate class in preparation for adding
+ the Cocoa event handling code.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]):
+ (-[WebBaseNetscapePluginView sendActivateEvent:]):
+ (-[WebBaseNetscapePluginView sendDrawRectEvent:]):
+ (-[WebBaseNetscapePluginView stopTimers]):
+ (-[WebBaseNetscapePluginView restartTimers]):
+ (-[WebBaseNetscapePluginView setHasFocus:]):
+ (-[WebBaseNetscapePluginView mouseDown:]):
+ (-[WebBaseNetscapePluginView mouseUp:]):
+ (-[WebBaseNetscapePluginView mouseEntered:]):
+ (-[WebBaseNetscapePluginView mouseExited:]):
+ (-[WebBaseNetscapePluginView mouseDragged:]):
+ (-[WebBaseNetscapePluginView keyUp:]):
+ (-[WebBaseNetscapePluginView keyDown:]):
+ (-[WebBaseNetscapePluginView cut:]):
+ (-[WebBaseNetscapePluginView copy:]):
+ (-[WebBaseNetscapePluginView paste:]):
+ (-[WebBaseNetscapePluginView selectAll:]):
+ (-[WebBaseNetscapePluginView start]):
+ (-[WebBaseNetscapePluginView stop]):
+ (-[WebBaseNetscapePluginView fini]):
+ (-[WebBaseNetscapePluginView drawRect:]):
+ (-[WebBaseNetscapePluginView viewWillMoveToWindow:]):
+ (-[WebBaseNetscapePluginView viewDidMoveToWindow]):
+ (-[WebBaseNetscapePluginView windowBecameKey:]):
+ (-[WebBaseNetscapePluginView windowResignedKey:]):
+ (-[WebBaseNetscapePluginView windowDidMiniaturize:]):
+ (-[WebBaseNetscapePluginView windowDidDeminiaturize:]):
+ (-[WebBaseNetscapePluginView loginWindowDidSwitchFromUser:]):
+ (-[WebBaseNetscapePluginView loginWindowDidSwitchToUser:]):
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+ (-[WebBaseNetscapePluginView _viewHasMoved]):
+ * Plugins/WebBaseNetscapePluginViewInternal.h:
+ * Plugins/WebNetscapePluginEmbeddedView.h:
+ * Plugins/WebNetscapePluginEventHandler.h: Added.
+ (WebNetscapePluginEventHandler::~WebNetscapePluginEventHandler):
+ (WebNetscapePluginEventHandler::currentEventIsUserGesture):
+ (WebNetscapePluginEventHandler::WebNetscapePluginEventHandler):
+ * Plugins/WebNetscapePluginEventHandler.mm: Added.
+ (WebNetscapePluginEventHandler::create):
+ * Plugins/WebNetscapePluginEventHandlerCarbon.h: Added.
+ * Plugins/WebNetscapePluginEventHandlerCarbon.mm: Added.
+ (WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon):
+ (getCarbonEvent):
+ (modifiersForEvent):
+ (WebNetscapePluginEventHandlerCarbon::sendNullEvent):
+ (WebNetscapePluginEventHandlerCarbon::drawRect):
+ (WebNetscapePluginEventHandlerCarbon::mouseDown):
+ (WebNetscapePluginEventHandlerCarbon::mouseUp):
+ (WebNetscapePluginEventHandlerCarbon::mouseEntered):
+ (WebNetscapePluginEventHandlerCarbon::mouseExited):
+ (WebNetscapePluginEventHandlerCarbon::mouseDragged):
+ (WebNetscapePluginEventHandlerCarbon::mouseMoved):
+ (WebNetscapePluginEventHandlerCarbon::keyDown):
+ (keyMessageForEvent):
+ (WebNetscapePluginEventHandlerCarbon::keyUp):
+ (WebNetscapePluginEventHandlerCarbon::focusChanged):
+ (WebNetscapePluginEventHandlerCarbon::windowFocusChanged):
+ (WebNetscapePluginEventHandlerCarbon::TSMEventHandler):
+ (WebNetscapePluginEventHandlerCarbon::installKeyEventHandler):
+ (WebNetscapePluginEventHandlerCarbon::removeKeyEventHandler):
+ (WebNetscapePluginEventHandlerCarbon::nullEventTimerFired):
+ (WebNetscapePluginEventHandlerCarbon::startTimers):
+ (WebNetscapePluginEventHandlerCarbon::stopTimers):
+ (WebNetscapePluginEventHandlerCarbon::sendEvent):
+
+2008-04-29 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by David Harrison.
+
+ Ensure that WebDynamicScrollBarsView defines WebCoreScrollbarAlwaysOn to keep Mail building.
+
+ * WebKit.exp:
+ * WebView/WebDynamicScrollBarsView.h:
+ * WebView/WebDynamicScrollBarsView.m:
+
+2008-04-29 Greg Bolsinga <bolsinga@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT)
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ * WebView/WebClipView.m:
+ (-[WebClipView scrollWheel:]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView addMouseMovedObserver]):
+ (-[WebHTMLView removeMouseMovedObserver]):
+ (-[WebHTMLView acceptsFirstMouse:]):
+ * WebView/WebUIDelegatePrivate.h:
+ * WebView/WebView.mm:
+ (-[WebViewPrivate init]):
+ * WebView/WebViewPrivate.h:
+
+2008-04-28 Rob Buis <buis@kde.org>
+
+ Reviewed by Maciej.
+
+ Build fix for Tiger.
+
+ * WebView/WebView.mm:
+ (WebKitInitializeApplicationCachePathIfNecessary):
+
+2008-04-28 Adele Peterson <adele@apple.com>
+
+ Reviewed by Dan Bernstein, Tim Hatcher, Anders Carlsson, and Darin Adler.
+
+ WebKit part of fix for <rdar://problem/3709505>
+ Safari should have a way to upload bundles from the file upload control (as zip)
+
+ Added UIDelegate methods to let the application handle generating replacement files for uploads.
+ In this case, Safari will create archived files for bundles so they can be uploaded properly.
+
+ * DefaultDelegates/WebDefaultUIDelegate.m:
+ (-[WebDefaultUIDelegate webView:shouldReplaceUploadFile:usingGeneratedFilename:]):
+ (-[WebDefaultUIDelegate webView:generateReplacementFile:]):
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::shouldReplaceWithGeneratedFileForUpload):
+ (WebChromeClient::generateReplacementFile):
+ * WebView/WebUIDelegatePrivate.h:
+
+2008-04-28 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam, Mark, Adele and Darin.
+
+ Initialize the application cache path.
+
+ * WebView/WebView.mm:
+ (WebKitInitializeApplicationCachePathIfNecessary):
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+
+2008-04-28 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix <rdar://problem/4911289> Add tabindex property to all children
+ of HTMLElement (7138)
+ http://bugs.webkit.org/show_bug.cgi?id=7138
+
+ * MigrateHeaders.make:
+ Removing DOMHTMLLabelElementPrivate.h and DOMHTMLLegendElementPrivate.h
+ because now that focus() has been moved to DOMHTMLElement.h, these
+ files are no longer needed.
+
+2008-04-25 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Fix run-webkit-tests --threading
+ and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
+ Proxy server issue in Sunday's Nightly
+
+ * WebView/WebView.mm: (-[WebViewPrivate init]): Initialize threading. Previously, this was
+ only done from icon database code, which is not robust enough.
+
+2008-04-20 Adam Barth <hk9565@gmail.com>
+
+ Reviewed by Adam Roben and Sam Weinig.
+
+ Updated WebSecurityOrigin to match new SecurityOrigin API.
+
+ Collin Jackson <collinj-webkit@collinjackson.com> also contributed to this patch.
+
+ * Storage/WebSecurityOrigin.mm:
+ (-[WebSecurityOrigin host]):
+ (-[WebSecurityOrigin domain]):
+ * Storage/WebSecurityOriginPrivate.h:
+
+2008-04-25 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Sam Weinig.
+
+ Add some content to an empty ICU header file to prevent verification errors.
+
+ * icu/unicode/utf_old.h:
+
+2008-04-25 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam.
+
+ Add offlineWebApplicationCacheEnabled preference.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.m:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences offlineWebApplicationCacheEnabled]):
+ (-[WebPreferences setOfflineWebApplicationCacheEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _updateSettingsFromPreferences:]):
+
+2008-04-24 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove code for calculating the glyph cache size.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface): Remove unused symbol.
+
+2008-04-24 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add a definition of BUILDING_ON_LEOPARD to complement BUILDING_ON_TIGER.
+
+ * WebKitPrefix.h:
+
+2008-04-24 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ Fix layout test regressions from my earlier preferences/settings tweak.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Even if we're not posting
+ the notification to update the settings, each WebView still needs to register for the
+ notification - restore that behavior.
+
+2008-04-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - preparation for https://bugs.webkit.org/show_bug.cgi?id=3729
+ <rdar://problem/4036353> REGRESSION: arrow keys move insertion bar backwards in RTL text
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _caretRectAtNode:offset:affinity:]): Changed to use
+ VisiblePosition::caretRect() instead of the RenderObject method which
+ was removed.
+
+2008-04-24 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ Rework the Settings population again.
+
+ * WebView/WebView.mm:
+ (-[WebView _updateSettingsFromPreferences:]): This method is called both from _preferencesChangedNotification
+ and directly from WebView's common init function.
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Call _updateSettingsFromPreferences immediately
+ after creating the new Page
+
+2008-04-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoff.
+
+ - fix crash in regression test where we'd ask a frame for a user agent string
+ after the WebView was already closed
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::userAgent): Assert that the WebView is not nil. Also
+ added some code to prevent the crash in release builds if this problem happens
+ again.
+
+2008-04-24 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam.
+
+ Change some String arguments to be const references instead.
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::shouldInsertText):
+
+2008-04-24 John Sullivan <sullivan@apple.com>
+
+ Mac build fix
+
+ * WebCoreSupport/WebViewFactory.mm:
+ (-[WebViewFactory AXButtonActionVerb]):
+ implement this method using the text in WebCoreLocalizedStrings.cpp
+ (-[WebViewFactory AXRadioButtonActionVerb]):
+ ditto
+ (-[WebViewFactory AXTextFieldActionVerb]):
+ ditto
+ (-[WebViewFactory AXCheckedCheckBoxActionVerb]):
+ ditto
+ (-[WebViewFactory AXUncheckedCheckBoxActionVerb]):
+ ditto
+ (-[WebViewFactory AXLinkActionVerb]):
+ ditto
+
+2008-04-23 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ In some current work I noticed that when a new Page is created, it is possible that it requires info from its Settings
+ object before the Settings object is initialized. It seems quite prudent to post the preferences changed notification,
+ thereby populating the Settings object, immediately after the Page is created.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Post the notification right after the Page is created
+
+2008-04-24 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Jess
+
+ - fixed <rdar://problem/5886655> JavaScript input panel automatic resizing doesn't work right with HiDPI
+
+ * Misc/WebNSControlExtras.m:
+ (-[NSControl sizeToFitAndAdjustWindowHeight]):
+ deploy userSpaceScaleFactor when using view distances on the window
+
+2008-04-22 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Add NPN_Construct and NPN_PluginThreadAsyncCall declarations.
+
+ * Plugins/npfunctions.h:
+
+2008-04-20 Matt Lilek <webkit@mattlilek.com>
+
+ Mysteriously reviewed by mitz|away.
+
+ Bug 18111: Closing a tab while dragging crashes Safari
+ https://bugs.webkit.org/show_bug.cgi?id=18111
+
+ Null check the page before handling drag events.
+
+ * WebView/WebView.mm:
+ (-[WebView draggingUpdated:]):
+ (-[WebView draggingExited:]):
+
+2008-04-19 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Tim Hatcher
+
+ Add a WebPreference for the path of the local storage persistent store.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+
+ * WebView/WebPreferences.m:
+ (-[WebPreferences _localStorageDatabasePath]):
+ (-[WebPreferences _setLocalStorageDatabasePath:]):
+ * WebView/WebPreferencesPrivate.h:
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2008-04-18 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Don't clear the PageGroup on _close, as the WebCore::Page destructor already does this.
+ No reason to do the work twice...
+
+ * WebView/WebView.mm:
+ (-[WebView _close]):
+
+2008-04-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by beth.
+
+ Rename Frame::renderer() to contentRenderer() and fix uses.
+
+ * Misc/WebCoreStatistics.mm:
+ * WebView/WebRenderNode.mm:
+ (-[WebRenderNode initWithWebFrameView:]):
+
+2008-04-17 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Reviewed by mrowe.
+
+ * WebView/WebFrame.mm: Remove temporary build fix.
+
+2008-04-17 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix <rdar://problem/5863552> REGRESSION (r30741): Attachments don't appear in the iChat message window after sending
+
+ The order of arguments to -[NSDictionary initWithObjects:andKeys:] had been transposed accidentally during refactoring.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin): Pass the arguments in the correct order.
+
+2008-04-17 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Dan Bernstein.
+
+ Fix the Mac build.
+
+ * WebView/WebFrame.mm: Define HAVE_ACCESSIBILITY before including AccessibilityObject.h and AXObjectCache.h to get things building
+ for now. This comes from config.h in WebCore but we don't have an equivalent in WebKit so we'll need to work out the correct place
+ for this to live going forward.
+
+2008-04-15 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Anders.
+
+ <rdar://problem/5412759> CrashTracer: [USER] 22 crashes in Safari at com.apple.quicktime.webplugin: NPN_SetValue + 15403
+
+ In certain situations, code in WebBasePluginPackage would load a plug-in only for the explicit reason of asking it to create a
+ preference file, but wouldn't actually unload the bundle. This created problems for the QuickTime WebKit plug-in by unloading
+ a bundle out from underneath itself.
+
+ * Plugins/WebBasePluginPackage.h: Added unload method.
+ * Plugins/WebBasePluginPackage.m:
+ (-[WebBasePluginPackage unload]): Added new method. Currently, only Netscape plug-ins support unload.
+ (-[WebBasePluginPackage pListForPath:createFile:]): Added a call to unload.
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage unload]): Added.
+
+2008-04-15 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam.
+
+ Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
+
+ * Configurations/WebKit.xcconfig:
+
+2008-04-15 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John Sullivan
+
+ Do a more complete job adding the "WebArchiveDebugMode" pref
+
+ * WebView/WebPreferences.m: Add both getter *and* setter
+ (-[WebPreferences webArchiveDebugModeEnabled]):
+ (-[WebPreferences setWebArchiveDebugModeEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Call the renamed getter
+
+2008-04-14 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Anders
+
+ Add a hidden pref to debug WebArchive loading. With this pref on, when loading a WebArchive,
+ if the resource isn't in the ArchiveResourceCollection, the loader will not fall back to the
+ network and will instead fail the load as "cancelled."
+
+ * WebView/WebPreferenceKeysPrivate.h:
+
+ * WebView/WebPreferences.m:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences _webArchiveDebugModeEnabled]):
+ * WebView/WebPreferencesPrivate.h:
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2008-04-11 David Hyatt <hyatt@apple.com>
+
+ Rename CachedResource ref/deref methods to addClient/removeClient.
+
+ Reviewed by olliej
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLViewPrivate dealloc]):
+ (-[WebHTMLViewPrivate finalize]):
+ (-[WebHTMLViewPrivate clear]):
+ (-[WebHTMLView setPromisedDragTIFFDataSource:WebCore::]):
+
+2008-04-07 Brady Eidson <beidson@apple.com>
+
+ Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
+
+ * Configurations/WebKit.xcconfig:
+
+2008-04-04 Adam Roben <aroben@apple.com>
+
+ Use WebCore's ICU headers instead of our own copy
+
+ Rubberstamped by Tim Hatcher.
+
+ * Configurations/WebKit.xcconfig: Pick up ICU headers from WebCore's
+ PrivateHeaders.
+
+2008-04-04 Adam Roben <aroben@apple.com>
+
+ Fix <rdar://problem/5804776> Would like to use WebCore's
+ ForwardingHeaders in WebKit without manually creating copies
+
+ Patch by Tim Hatcher, typed by me.
+
+ * Configurations/WebKit.xcconfig: Use the copy of ForwardingHeaders in
+ WebCore's PrivateHeaders instead of our own copy.
+
+2008-04-04 Ada Chan <adachan@apple.com>
+
+ Now we pass width and height directly as integers to format
+ the window title for a standalone image.
+
+ Reviewed by Dan.
+
+ * WebCoreSupport/WebViewFactory.mm:
+ (-[WebViewFactory imageTitleForFilename:width:height:]):
+
+2008-04-03 Nicholas Shanks <webkit@nickshanks.com>
+
+ Updated by Dan Bernstein. Reviewed by Dave Hyatt.
+
+ - WebKit part of fixing http://bugs.webkit.org/show_bug.cgi?id=6484
+ font-weight does not properly support graded weights
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _styleFromFontAttributes:]):
+ (-[WebHTMLView _originalFontB]):
+ (-[WebHTMLView _addToStyle:fontA:fontB:]):
+
+2008-04-02 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Ensure that debug symbols are generated for x86_64 and ppc64 builds.
+
+ * Configurations/Base.xcconfig:
+
+2008-03-31 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _accessibilityTree]):
+ The syntax for fetching an object from the AXObjectCache changed slightly
+
+2008-03-31 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Jon Honeycutt
+
+ Move a WebArchive loading check into WebCore
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation receivedData:withDataSource:]): Don't check "isDisplayingWebArchive" as WebCore is now
+ responsible for checking that state
+
+2008-03-31 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin and Mitz's rubber stamp
+
+ Remove dataForArchivedSelection(WebCore::Frame*) from the EditorClient - only usage is now directly in WebCore
+
+ * WebCoreSupport/WebEditorClient.mm:
+ * WebCoreSupport/WebEditorClient.h:
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Rubberstamped by Darin Adler
+
+ Remove WebArchiver.h/mm
+
+ * WebView/WebArchiver.h: Removed.
+ * WebView/WebArchiver.mm: Removed.
+
+ * DOM/WebDOMOperations.mm:
+ * WebCoreSupport/WebDragClient.mm:
+ * WebCoreSupport/WebEditorClient.mm:
+ * WebView/WebDataSource.mm:
+ * WebView/WebHTMLView.mm:
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler
+
+ Now that WebCore can create archives from a frame selection directly, we don't need it in WebArchiver anymore
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::dataForArchivedSelection):
+
+ * WebView/WebArchiver.h: Nuke archiveSelectionInFrame, as there are no remaining users
+ * WebView/WebArchiver.mm: Ditto
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]):
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler
+
+ More Kit->Core WebArchive changes.
+
+ Create an archive from the current selection in a frame
+
+ * WebView/WebArchiver.mm: Remove one more *undeclared* method, the last method will drop off
+ easily in a followup
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ WebArchive saga continues - Can now make archives from ranges in WebCore
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMRange webArchive]):
+ (-[DOMRange markupString]):
+
+ * WebView/WebArchiver.h: Remove newly obsolete [WebArchiver archiveRange:]
+ * WebView/WebArchiver.mm:
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ More Kit->Core webarchive code movement
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMNode markupString]): Call createFullMarkup() instead
+
+ * WebView/WebFrame.mm: Remove obsolete _markupStringFromNode
+ * WebView/WebFrameInternal.h: Ditto
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Fold [WebArchiver archiveFrame:] into WebDataSource - the last remaining caller
+
+ * WebView/WebArchiver.h:
+ * WebView/WebArchiver.mm:
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource webArchive]):
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Remove unused [WebArchiver archiveNode:], made obsolete in r31400
+
+ * WebView/WebArchiver.h:
+ * WebView/WebArchiver.mm:
+
+2008-03-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ "Yet another transitional step" to empty out WebKit-based code for archiving.
+
+ With this patch, the key operation of "Creating a WebArchive rooted at a single Node" takes place
+ entirely within WebCore, and opens the door to saving WebArchives on Windows.
+
+ * DOM/WebDOMOperations.mm:
+ * WebView/WebArchiver.mm:
+ (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]):
+
+2008-03-27 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam Roben
+
+ Move [WebDataSource mainResource] and [WebDataSource subresources] down into WebCore
+ as the push to core-ify WebArchives continues.
+
+ This patch also introduces a behavior change. WebCore allows ArchiveResources with null or empty data.
+ WebKit has had the inexplicable distinction of allowing empty Data in a WebResource, but not null.
+ Since WebResource is API, I decided to leave it be to avoid a behavior change. But internally created resources
+ (as in "while archiving a page") are accepting of null or empty data.
+
+ This actually fixes a bug where not all subframes are archived, and resulted in a layout test change.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource mainResource]): Call DocumentLoader implementation
+ (-[WebDataSource subresources]): Ditto
+ * WebView/WebFrame.mm: Remove [WebFrame _getAllResourceDatas:andResponses:] as its only caller is obsolete
+ * WebView/WebFrameInternal.h:
+
+2008-03-27 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam
+
+ Change the "init from WebCore resource" version of WebResource to take PassRefPtr
+ (more efficient)
+
+ * WebView/WebResource.mm:
+ (-[WebResource _initWithCoreResource:]):
+ * WebView/WebResourceInternal.h:
+
+2008-03-26 Brady Eidson <beidson@apple.com>
+
+ Build fix - accidentally checked in this change which was work in progress
+
+ * DOM/WebDOMOperations.mm:
+
+2008-03-26 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ When we create a WebArchive, we walk every node from some starting point, asking each node
+ along the way "What are your subresource URLs?"
+
+ That logic is currently in DOMNode in WebKitMac - this patch moves that ability down into
+ WebCore::Node
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMNode _subresourceURLs]): One generic DOMNode method can now handle all DOMNodes by
+ calling into individual WebCore::Node implementations
+ * DOM/WebDOMOperationsPrivate.h:
+
+2008-03-26 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Mark Rowe
+
+ Part of the continued push to move WebArchive-related code down to WebCore, this
+ moves [WebDataSource subresourceForURL:] down to DocumentLoader->subresource()
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource subresourceForURL:]): Call through to the DocumentLoader
+
+ * WebView/WebFrame.mm: Remove [WebFrame _getData:andResponse:forURL:], as its only use
+ has now been ported down to WebCore
+ * WebView/WebFrameInternal.h:
+
+2008-03-26 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Brady Eidson.
+
+ Update FEATURE_DEFINES to be consistent with the other locations in which it is defined.
+
+ * Configurations/WebKit.xcconfig:
+
+2008-03-26 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Make the Ahem font antialias correctly on Acid3 on Tiger.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface):
+
+2008-03-26 Mark Rowe <mrowe@apple.com>
+
+ Fix the Mac build.
+
+ * MigrateHeaders.make: Copy the newly generated header into the right place.
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Beth Dakin
+
+ Remove entirely unused internal method
+
+ * WebView/WebArchiver.h:
+ * WebView/WebArchiver.mm:
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam Roben
+
+ <rdar://problem/5819308> - View Source is empty when view webarchives
+
+ * WebCore.base.exp:
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::setParsedArchiveData):
+ (WebCore::DocumentLoader::parsedArchiveData):
+ * loader/DocumentLoader.h:
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::finishedLoadingDocument): Set the archive's MainResource data as the parsedArchiveData
+ in the DocumentLoader
+
+2008-03-25 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=17933
+ Reopen All Windows From Last Session causes crash
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Added null
+ check.
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Jon Honeycutt's rubberstamp
+
+ Fix a leak with the new WebArchive setup
+
+ * WebView/WebArchive.mm:
+ (-[WebArchivePrivate setCoreArchive:]): Deref() the old WebArchive
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ Removed the concept of "pending archive resources" and the "archive resources delivery timer"
+ from WebFrameLoaderClient, as those concepts have been pushed into WebCore
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::WebFrameLoaderClient):
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ Remove newly obsolete FrameLoaderClient methods
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Release build fix
+
+ * WebView/WebArchive.mm:
+ (-[WebArchive subresources]):
+ (-[WebArchive subframeArchives]):
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ <rdar://problem/4516169> - Support WebArchives on Windows
+ And paves the way for many future WebArchive bug fixes and enhancements
+
+ This change moves most of the real workhorse code about WebArchives into WebCore. It maintains
+ 1-to-1 relationships between a few objects in WebCore and WebKit. Such as:
+ * WebArchive <-> LegacyWebArchive
+ * WebResource <-> ArchiveResource
+ * WebUnarchivingState <-> ArchiveResourceCollection
+
+ The other biggest changes involve many FrameLoaderClient methods that existed soley for WebArchives
+ and now exist in WebCore
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::clearUnarchivingState): Emptied - to be removed in a followup patch
+ (WebFrameLoaderClient::finalSetupForReplace):
+ (WebFrameLoaderClient::setDefersLoading):
+ (WebFrameLoaderClient::willUseArchive):
+ (WebFrameLoaderClient::isArchiveLoadPending):
+ (WebFrameLoaderClient::cancelPendingArchiveLoad):
+ (WebFrameLoaderClient::clearArchivedResources):
+ (WebFrameLoaderClient::createFrame):
+
+ * WebView/WebArchive.mm:
+ (+[WebArchivePrivate initialize]):
+ (-[WebArchivePrivate init]):
+ (-[WebArchivePrivate initWithCoreArchive:]):
+ (-[WebArchivePrivate coreArchive]):
+ (-[WebArchivePrivate setCoreArchive:]):
+ (-[WebArchivePrivate dealloc]):
+ (-[WebArchivePrivate finalize]):
+ (-[WebArchive init]):
+ (-[WebArchive initWithMainResource:subresources:subframeArchives:]):
+ (-[WebArchive initWithData:]):
+ (-[WebArchive initWithCoder:]):
+ (-[WebArchive encodeWithCoder:]):
+ (-[WebArchive mainResource]):
+ (-[WebArchive subresources]):
+ (-[WebArchive subframeArchives]):
+ (-[WebArchive data]):
+ (-[WebArchive _initWithCoreLegacyWebArchive:WebCore::]):
+ (-[WebArchive WebCore::]):
+ * WebView/WebArchiveInternal.h: Added.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSourcePrivate dealloc]):
+ (-[WebDataSource _addSubframeArchives:]):
+ (-[WebDataSource _documentFragmentWithArchive:]):
+ (-[WebDataSource subresourceForURL:]):
+ (-[WebDataSource addSubresource:]):
+ * WebView/WebDataSourceInternal.h:
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame loadArchive:]):
+ * WebView/WebFrameInternal.h:
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
+
+ * WebView/WebResource.mm:
+ (+[WebResourcePrivate initialize]):
+ (-[WebResourcePrivate init]):
+ (-[WebResourcePrivate initWithCoreResource:]):
+ (-[WebResourcePrivate dealloc]):
+ (-[WebResourcePrivate finalize]):
+ (-[WebResource initWithCoder:]):
+ (-[WebResource encodeWithCoder:]):
+ (-[WebResource data]):
+ (-[WebResource URL]):
+ (-[WebResource MIMEType]):
+ (-[WebResource textEncodingName]):
+ (-[WebResource frameName]):
+ (-[WebResource _initWithCoreResource:WebCore::]):
+ (-[WebResource WebCore::]):
+ (-[WebResource _ignoreWhenUnarchiving]):
+ (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]):
+ (-[WebResource _fileWrapperRepresentation]):
+ (-[WebResource _response]):
+ (-[WebResource _stringValue]):
+ * WebView/WebResourceInternal.h: Added.
+ * WebView/WebResourcePrivate.h:
+
+ * WebView/WebUnarchivingState.h: Removed.
+ * WebView/WebUnarchivingState.m: Removed.
+
+2008-03-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 18030: REGRESSION(r31236): Space bar fails to scroll down page
+ <http://bugs.webkit.org/show_bug.cgi?id=18030>
+
+ Rollout keyDown changes from r31236 -- fix for keyDown behaviour is
+ tracked by Bug 18057: keyDown incorrectly propagates up the frame tree
+ <http://bugs.webkit.org/show_bug.cgi?id=18057>
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView keyDown:]):
+
+2008-03-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+
+ Reviewed by Maciej, landed by Brady
+
+ Bug 3580: iFrames Appear to be Cached
+ <http://bugs.webkit.org/show_bug.cgi?id=3580>
+
+ Bug 15486: REGRESSION: Reload causes WebKit to *forget* fragment URLs
+ <http://bugs.webkit.org/show_bug.cgi?id=15486>
+
+ Bug 15554: Reload causes <object> to use old data
+ <http://bugs.webkit.org/show_bug.cgi?id=15554>
+
+ If a page is reloaded, a child frame's URL can not be taken from a history item.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _loadURL:referrer:intoChild:]):
+
+2008-03-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Beth.
+
+ - fix <rdar://problem/5817067> -[WebDataSource unreachableURL] invokes KURL's copy constructor
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem URL]): Use a reference to avoid making a copy.
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource _URL]): Ditto.
+ (-[WebDataSource unreachableURL]): Ditto.
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.
+
+ * DefaultDelegates/WebDefaultContextMenuDelegate.mm:
+ * History/WebHistory.mm:
+ * Misc/WebElementDictionary.mm:
+ * Misc/WebNSAttributedStringExtras.mm:
+ Remove unneeded imports of KURL.h.
+
+2008-03-24 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin's rubberstamp
+
+ Rename this file for upcoming work.
+
+ * WebView/WebArchive.m: Removed.
+ * WebView/WebArchive.mm: Copied from WebKit/mac/WebView/WebArchive.m.
+
+2008-03-24 Alexey Proskuryakov <ap@webkit.org>
+
+ Build fix.
+
+ * MigrateHeaders.make: Added DOMSVGAltGlyphElement.h and DOMSVGAltGlyphElementInternal.h.
+
+2008-03-23 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Maciej.
+
+ Bug 17670: Key events may improperly propagate from iframe to parent frame
+ <http://bugs.webkit.org/show_bug.cgi?id=17670>
+ Bug 16381: REGRESSION: Shift, command, option, ctrl keys in Gmail Rich Text changes focus
+ <http://bugs.webkit.org/show_bug.cgi?id=16381>
+
+ Prevent the Cocoa event system from propagating key events to the parent WebHTMLView,
+ as that results in us dispatching the key events for each frame going up the frame
+ tree.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView keyDown:]):
+ (-[WebHTMLView keyUp:]):
+ (-[WebHTMLView flagsChanged:]):
+
+2008-03-21 Timothy Hatcher <timothy@apple.com>
+
+ Bug 17980: Regression: Inspector highlighting of webpage not cleared when going to new URL
+ http://bugs.webkit.org/show_bug.cgi?id=17980
+
+ Reviewed by Adam.
+
+ The new highlight drawing was not honoring the fade value, so it was
+ always drawing at full opacity. The animation code didn't match Windows
+ and the new highlight anyway, so it has been removed. The highlight
+ how just detaches when it is hidden.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController windowShouldClose:]): Call hideHighlight.
+ (-[WebInspectorWindowController close]): Ditto.
+ (-[WebInspectorWindowController highlightNode:]): Call attach.
+ (-[WebInspectorWindowController hideHighlight]): Call detach and release _currentHighlight.
+ * WebInspector/WebNodeHighlight.h:
+ * WebInspector/WebNodeHighlight.m:
+ (-[WebNodeHighlight initWithTargetView:inspectorController:]):
+ (-[WebNodeHighlight dealloc]): Assert we have no _highlightView.
+ (-[WebNodeHighlight attach]): Renamed from attachHighlight.
+ (-[WebNodeHighlight detach]): Renamed from detachHighlight.
+ (-[WebNodeHighlight setNeedsUpdateInTargetViewRect:]): Renamed from setHolesNeedUpdateInTargetViewRect:.
+ * WebInspector/WebNodeHighlightView.h:
+ * WebInspector/WebNodeHighlightView.m:
+ (-[WebNodeHighlightView setNeedsDisplayInRect:]): Renamed from setHolesNeedUpdateInRect:.
+
+2008-03-20 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
+ This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
+ command-line.
+
+ * Configurations/WebKit.xcconfig:
+
+2008-03-20 Adam Roben <aroben@apple.com>
+
+ Make WebNodeHighlightView use InspectorController to do its painting
+
+ Reviewed by Tim Hatcher.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController highlightNode:]): Pass the
+ InspectorController to the WebNodeHighlight, and don't call
+ setHighlightedNode: (which has been removed).
+ (-[WebInspectorWindowController hideHighlight]): Removed call to
+ setHighlightedNode:.
+ * WebInspector/WebNodeHighlight.h:
+ - Replaced _highlightNode with _inspectorController
+ - Removed _highlightedNode accessors
+ - Added -inspectorController method
+ * WebInspector/WebNodeHighlight.m:
+ (-[WebNodeHighlight initWithTargetView:inspectorController:]): Now
+ takes an InspectorController* and stores it in _inspectorController.
+ (-[WebNodeHighlight dealloc]): Removed code dealing with
+ _highlightedNode.
+ (-[WebNodeHighlight inspectorController]): Added.
+ * WebInspector/WebNodeHighlightView.m: Removed FileInternal category.
+ (-[WebNodeHighlightView isFlipped]): Added. WebCore expects all
+ GraphicsContexts to be based on a flipped CGContext, so we have to
+ specify that this view is flipped.
+ (-[WebNodeHighlightView drawRect:]): Changed to create a
+ GraphicsContext and pass it to InspectorController::drawNodeHighlight.
+
+2008-03-18 David Hyatt <hyatt@apple.com>
+
+ Add support for a preference in WebKit that can be used in nightly builds to test full page
+ zoom.
+
+ Reviewed by Antti
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView setTextSizeMultiplier:]):
+ (-[WebView canMakeTextSmaller]):
+ (-[WebView makeTextSmaller:]):
+ (-[WebView canMakeTextLarger]):
+ (-[WebView makeTextLarger:]):
+ (-[WebView canMakeTextStandardSize]):
+ (-[WebView makeTextStandardSize:]):
+
+2008-03-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by darin.
+
+ Export _NPN_IntFromIdentifier as part of our NPAPI interface
+
+ * Plugins/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage load]):
+
+2008-03-14 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Brian Dash's rubberstamp
+
+ Remove a class declaration for a class that has never existed
+
+ * WebView/WebResource.h:
+
+2008-03-14 David D. Kilzer <ddkilzer@apple.com>
+
+ Unify concept of enabling the Mac Java bridge.
+
+ Reviewed by Darin and Anders.
+
+ * Plugins/WebPluginJava.h: Removed unused file.
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ (WebFrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
+ * WebCoreSupport/WebFrameLoaderClient.mm: Ditto for #import and NSView SPI method.
+ (WebFrameLoaderClient::javaApplet): Ditto.
+
+2008-03-13 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Darin Adler.
+
+ * ForwardingHeaders/wtf/Deque.h: Added.
+
+2008-03-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam.
+
+ Call originalRequest, not initialRequest.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource initialRequest]):
+
+2008-03-12 Darin Adler <darin@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - cleanup after removing the bridge
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMDocument URLWithAttributeString:]): Call computeURL directly.
+
+ * Misc/WebCoreStatistics.mm:
+ (-[WebFrame renderTreeAsExternalRepresentation]): Call externalRepresentation directly.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView loadPluginRequest:]): Use core function instead of
+ _frameLoader method.
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+ Ditto.
+ * Plugins/WebPluginController.mm:
+ (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): Ditto.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::frameLoaderDestroyed): Added a call to the new _clearCoreFrame
+ method. Without this we could leave a stale frame pointer around.
+ (WebFrameLoaderClient::dispatchDidReceiveIcon): Rewrote assertion so it's not the single
+ caller of the _isMainFrame method.
+ (WebFrameLoaderClient::transitionToCommittedForNewPage): Use core function instead of
+ _frameLoader method.
+ (WebFrameLoaderClient::createFrame): Moved code here from _addChild.
+
+ * WebView/WebFrame.mm: Removed lots of methods. Some were moved elsewhere, others
+ turned out to be unused.
+ (core): Added overload for DocumentFragment.
+ (kit): Ditto.
+ (-[WebFrame _loadURL:referrer:intoChild:]): Get to Frame using _private->coreFrame and
+ to FrameLoader with _private->coreFrame->loader().
+ (-[WebFrame _attachScriptDebugger]): Ditto.
+ (-[WebFrame _clearCoreFrame]): Added.
+ (-[WebFrame _updateBackground]): More of the same.
+ (-[WebFrame _unmarkAllBadGrammar]): Ditto.
+ (-[WebFrame _unmarkAllMisspellings]): Ditto.
+ (-[WebFrame _hasSelection]): Ditto.
+ (-[WebFrame _atMostOneFrameHasSelection]): Ditto.
+ (-[WebFrame _findFrameWithSelection]): Ditto.
+ (-[WebFrame _dataSource]): Ditto.
+ (-[WebFrame _addData:]): Streamlined code a bit.
+ (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]): Ditto.
+ (-[WebFrame _receivedData:textEncodingName:]): Ditto.
+ (-[WebFrame _isDescendantOfFrame:]): Ditto.
+ (-[WebFrame _bodyBackgroundColor]): Ditto.
+ (-[WebFrame _isFrameSet]): Ditto.
+ (-[WebFrame _firstLayoutDone]): Ditto.
+ (-[WebFrame _loadType]): Ditto.
+ (-[WebFrame _isDisplayingStandaloneImage]): Ditto.
+ (-[WebFrame name]): Ditto.
+ (-[WebFrame DOMDocument]): Ditto.
+ (-[WebFrame frameElement]): Ditto.
+ (-[WebFrame provisionalDataSource]): Ditto.
+ (-[WebFrame dataSource]): Ditto.
+ (-[WebFrame loadRequest:]): Ditto.
+ (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): Ditto.
+ (-[WebFrame loadArchive:]): Ditto.
+ (-[WebFrame stopLoading]): Ditto.
+ (-[WebFrame reload]): Ditto.
+ (-[WebFrame findFrameNamed:]): Ditto.
+ (-[WebFrame parentFrame]): Ditto.
+ (-[WebFrame childFrames]): Ditto.
+ (-[WebFrame windowObject]): Ditto.
+ (-[WebFrame globalContext]): Ditto.
+
+ * WebView/WebFrameInternal.h: Added overloads of core and kit.
+ Removed method declarations.
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation documentSource]): Moved code here from WebFrame.
+ (formElementFromDOMElement): Ditto.
+ (-[WebHTMLRepresentation elementWithName:inForm:]): Ditto.
+ (inputElementFromDOMElement): Ditto.
+ (-[WebHTMLRepresentation elementDoesAutoComplete:]): Ditto.
+ (-[WebHTMLRepresentation elementIsPassword:]): Ditto.
+ (-[WebHTMLRepresentation formForElement:]): Ditto.
+ (-[WebHTMLRepresentation currentForm]): Ditto.
+ (-[WebHTMLRepresentation controlsInForm:]): Ditto.
+ (-[WebHTMLRepresentation searchForLabels:beforeElement:]): Ditto.
+ (-[WebHTMLRepresentation matchLabels:againstElement:]): Ditto.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _frameOrBoundsChanged]): Moved sendScrollEvent code here from WebFrame.
+ (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
+ Call createFragmentFromText directly instead of via WebFrame.
+ (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
+ Moved layout calls here from WebFrame.
+ (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto.
+ (-[WebHTMLView _updateFontPanel]): Ditto, but with fontForSelection.
+ (-[WebHTMLView _canSmartCopyOrDelete]): Ditto, but with selectionGranularity.
+ (-[WebHTMLView markedRange]): Moved code here from _markedTextNSRange.
+ (-[WebHTMLView attributedSubstringFromRange:]): Tweaked code a bit.
+ (-[WebHTMLView searchFor:direction:caseSensitive:wrap:startInSelection:]):
+ Moved code here from WebFrame.
+ (-[WebHTMLView elementAtPoint:allowShadowContent:]): Ditto.
+ (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]): Ditto.
+ (-[WebHTMLView setMarkedTextMatchesAreHighlighted:]): Ditto.
+ (-[WebHTMLView markedTextMatchesAreHighlighted]): Ditto.
+ (-[WebHTMLView unmarkAllTextMatches]): Ditto.
+ (-[WebHTMLView rectsForTextMatches]): Ditto.
+
+ * WebView/WebHTMLViewInternal.h: Removed unused method declarations.
+
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView PDFViewWillClickOnLink:withURL:]): Use core function instead of
+ _frameLoader method.
+
+ * WebView/WebRenderNode.mm:
+ (copyRenderNode): Moved code here from WebFrame.
+ (-[WebRenderNode initWithWebFrameView:]): Ditto.
+
+ * WebView/WebResource.mm:
+ (-[WebResource _stringValue]): Moved code here from WebFrame.
+
+ * WebView/WebView.mm:
+ (-[WebView _close]): Use core function intsead of _frameLoader method.
+ (-[WebView setCustomTextEncodingName:]): Ditto.
+ (-[WebView setHostWindow:]): Moved code here from WebFrame.
+ (aeDescFromJSValue): Moved this here from WebFrame.
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Moved code here from WebFrame.
+
+2008-03-12 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders.
+
+ - http://bugs.webkit.org/show_bug.cgi?id=17640
+ eliminate WebCoreFrameBridge
+
+ Moved all the code from the bridge into WebFrame. This need not be the final
+ home of these methods -- they can be moved closer to their callers and improved
+ further -- but it eliminates the bridge without requiring a rewrite of the code.
+ It's a fairly mechanical process (just adding underscores to method names really).
+
+ There's even a chance that some of the methods are unused. Those we can remove
+ after checking if that's so.
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMNode markupString]): Use WebFrame rather than bridge.
+ (-[DOMDocument webFrame]): Changed to use the core and kit functions
+ instead of using the bridge.
+ (-[DOMDocument URLWithAttributeString:]): Use WebFrame rather than bridge.
+ (-[DOMRange markupString]): Ditto.
+ * DOM/WebDOMOperationsPrivate.h: Removed _bridge methods.
+
+ * DefaultDelegates/WebDefaultContextMenuDelegate.mm: Removed unneeded import.
+ * History/WebHistoryItem.mm: Ditto.
+
+ * MigrateHeaders.make: Added DOMDocumentFragmentInternal.h.
+ * Misc/WebCoreStatistics.mm:
+ (-[WebFrame renderTreeAsExternalRepresentation]): Use WebFrame rather than bridge.
+
+ * Misc/WebElementDictionary.mm: Removed unneeded import.
+
+ * Misc/WebKitStatistics.m:
+ (+[WebKitStatistics bridgeCount]): Removed WebBridgeCount and just return 0.
+ * Misc/WebKitStatisticsPrivate.h: Ditto.
+
+ * Misc/WebNSAttributedStringExtras.mm: Removed unneeded import.
+ * Misc/WebNSPasteboardExtras.mm: Ditto.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Use WebFrame
+ rather than bridge.
+
+ * Plugins/WebNetscapePluginEmbeddedView.mm: Removed unneeded import.
+ * Plugins/WebNetscapePluginStream.mm: Ditto.
+
+ * Plugins/WebPluginContainerCheck.mm:
+ (-[WebPluginContainerCheck _isForbiddenFileLoad]): Use WebFrame rather than
+ bridge to get to the WebCore::Frame.
+
+ * Plugins/WebPluginController.h: Declare webFrame method and remove bridge method.
+ * Plugins/WebPluginController.mm:
+ (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): Use WebFrame
+ rather than bridge.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (selectorForKeyEvent): Tweaked comment.
+
+ * WebCoreSupport/WebFrameBridge.h: Removed.
+ * WebCoreSupport/WebFrameBridge.mm: Removed.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::frameLoaderDestroyed): Removed bridge assertion.
+ (WebFrameLoaderClient::detachedFromParent4): Removed bridge teardown code.
+ I could remove this function entirely, but it looks like the Qt port is using it.
+
+ * WebCoreSupport/WebViewFactory.mm: Removed unneeded import.
+
+ * WebView/WebArchiver.mm:
+ (+[WebArchiver archiveRange:]): Use WebFrame rather than bridge.
+ (+[WebArchiver archiveNode:]): Ditto.
+ (+[WebArchiver archiveSelectionInFrame:]): Ditto.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): Ditto.
+ (-[WebDataSource _documentFragmentWithArchive:]): Ditto.
+ (-[WebDataSource subresources]): Ditto.
+ (-[WebDataSource subresourceForURL:]): Ditto.
+
+ * WebView/WebDataSourceInternal.h: Removed _bridge method.
+
+ * WebView/WebFrame.mm:
+ (-[WebFramePrivate dealloc]): Removed code to release the bridge.
+ (core): Go directly to the core frame, not via the bridge.
+ (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]):
+ Remove the code to deal with the bridge.
+ (-[WebFrame _initWithWebFrameView:webView:]): Ditto. Also added code to set the
+ shouldCreateRenderers flag, formerly on the bridge.
+ (-[WebFrame _updateBackground]): Change to call mehods on self, not bridge.
+ (aeDescFromJSValue): Moved here from bridge.
+ (-[WebFrame _domain]): Ditto.
+ (-[WebFrame _addData:]): Ditto.
+ (-[WebFrame _stringWithDocumentTypeStringAndMarkupString:]): Ditto.
+ (-[WebFrame _nodesFromList:]): Ditto.
+ (-[WebFrame _markupStringFromNode:nodes:]): Ditto.
+ (-[WebFrame _markupStringFromRange:nodes:]): Ditto.
+ (-[WebFrame _selectedString]): Ditto.
+ (-[WebFrame _stringForRange:]): Ditto.
+ (-[WebFrame _forceLayoutAdjustingViewSize:]): Ditto.
+ (-[WebFrame _forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Ditto.
+ (-[WebFrame _sendScrollEvent]): Ditto.
+ (-[WebFrame _drawRect:]): Ditto.
+ (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]): Ditto.
+ (-[WebFrame _adjustPageHeightNew:top:bottom:limit:]): Ditto.
+ (-[WebFrame _copyRenderNode:copier:]): Ditto.
+ (-[WebFrame _copyRenderTree:]): Ditto.
+ (inputElementFromDOMElement): Ditto.
+ (formElementFromDOMElement): Ditto.
+ (-[WebFrame _elementWithName:inForm:]): Ditto.
+ (-[WebFrame _elementDoesAutoComplete:]): Ditto.
+ (-[WebFrame _elementIsPassword:]): Ditto.
+ (-[WebFrame _formForElement:]): Ditto.
+ (-[WebFrame _currentForm]): Ditto.
+ (-[WebFrame _controlsInForm:]): Ditto.
+ (-[WebFrame _searchForLabels:beforeElement:]): Ditto.
+ (-[WebFrame _matchLabels:againstElement:]): Ditto.
+ (-[WebFrame _URLWithAttributeString:]): Ditto.
+ (-[WebFrame _searchFor:direction:caseSensitive:wrap:startInSelection:]): Ditto.
+ (-[WebFrame _markAllMatchesForText:caseSensitive:limit:]): Ditto.
+ (-[WebFrame _markedTextMatchesAreHighlighted]): Ditto.
+ (-[WebFrame _setMarkedTextMatchesAreHighlighted:]): Ditto.
+ (-[WebFrame _unmarkAllTextMatches]): Ditto.
+ (-[WebFrame _rectsForTextMatches]): Ditto.
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:]): Ditto.
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Ditto.
+ (-[WebFrame _aeDescByEvaluatingJavaScriptFromString:]): Ditto.
+ (-[WebFrame _caretRectAtNode:offset:affinity:]): Ditto.
+ (-[WebFrame _firstRectForDOMRange:]): Ditto.
+ (-[WebFrame _scrollDOMRangeToVisible:]): Ditto.
+ (-[WebFrame _baseURL]): Ditto.
+ (-[WebFrame _stringWithData:]): Ditto.
+ (+[WebFrame _stringWithData:textEncodingName:]): Ditto.
+ (-[WebFrame _needsLayout]): Ditto.
+ (-[WebFrame _renderTreeAsExternalRepresentation]): Ditto.
+ (-[WebFrame _accessibilityTree]): Ditto.
+ (-[WebFrame _setBaseBackgroundColor:]): Ditto.
+ (-[WebFrame _setDrawsBackground:]): Ditto.
+ (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
+ Ditto.
+ (-[WebFrame _selectionGranularity]): Ditto.
+ (-[WebFrame _convertToNSRange:]): Ditto.
+ (-[WebFrame _convertToDOMRange:]): Ditto.
+ (-[WebFrame _convertNSRangeToDOMRange:]): Ditto.
+ (-[WebFrame _convertDOMRangeToNSRange:]): Ditto.
+ (-[WebFrame _markDOMRange]): Ditto.
+ (-[WebFrame _markedTextNSRange]): Ditto.
+ (-[WebFrame _smartDeleteRangeForProposedRange:]): Ditto.
+ (-[WebFrame _smartInsertForString:replacingRange:beforeString:afterString:]): Ditto.
+ (-[WebFrame _documentFragmentWithMarkupString:baseURLString:]): Ditto.
+ (-[WebFrame _documentFragmentWithText:inContext:]): Ditto.
+ (-[WebFrame _documentFragmentWithNodesAsParagraphs:]): Ditto.
+ (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): Ditto.
+ (-[WebFrame _replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]): Ditto.
+ (-[WebFrame _replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): Ditto.
+ (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]): Ditto.
+ (-[WebFrame _insertParagraphSeparatorInQuotedContent]): Ditto.
+ (-[WebFrame _visiblePositionForPoint:]): Ditto.
+ (-[WebFrame _characterRangeAtPoint:]): Ditto.
+ (-[WebFrame _typingStyle]): Ditto.
+ (-[WebFrame _setTypingStyle:withUndoAction:]): Ditto.
+ (-[WebFrame _fontForSelection:]): Ditto.
+ (-[WebFrame _dragSourceMovedTo:]): Ditto.
+ (-[WebFrame _dragSourceEndedAt:operation:]): Ditto.
+ (-[WebFrame _getData:andResponse:forURL:]): Ditto.
+ (-[WebFrame _getAllResourceDatas:andResponses:]): Ditto.
+ (-[WebFrame _canProvideDocumentSource]): Ditto.
+ (-[WebFrame _canSaveAsWebArchive]): Ditto.
+ (-[WebFrame _receivedData:textEncodingName:]): Ditto.
+ (-[WebFrame _setShouldCreateRenderers:]): Put the code from the bridge in this preexisting
+ function. Couldn't just keep the bridge method because this was already here with the same name.
+ (-[WebFrame _selectedNSRange]): Ditto.
+ (-[WebFrame _selectNSRange:]): Ditto.
+ (-[WebFrame dealloc]): Remove bridge-related code.
+ (-[WebFrame finalize]): Ditto.
+
+ * WebView/WebFrameInternal.h: Added all the method declarations from the bridge.
+ Removed the bridge parameter from the init method. Removed the #if blocks that
+ tried to make this header work in non-C++ ObjC files -- they were broken and unused.
+ Removed the _bridge method.
+
+ * WebView/WebFrameView.mm: Removed the _bridge method.
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation setDataSource:]): Removed the code to set up the bridge
+ field.
+ (-[WebHTMLRepresentation receivedData:withDataSource:]): Use WebFrame instead of bridge.
+ (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): Ditto.
+ (-[WebHTMLRepresentation canProvideDocumentSource]): Ditto.
+ (-[WebHTMLRepresentation canSaveAsWebArchive]): Ditto.
+ (-[WebHTMLRepresentation documentSource]): Ditto.
+ (-[WebHTMLRepresentation DOMDocument]): Ditto.
+ (-[WebHTMLRepresentation elementWithName:inForm:]): Ditto.
+ (-[WebHTMLRepresentation elementDoesAutoComplete:]): Ditto.
+ (-[WebHTMLRepresentation elementIsPassword:]): Ditto.
+ (-[WebHTMLRepresentation formForElement:]): Ditto.
+ (-[WebHTMLRepresentation currentForm]): Ditto.
+ (-[WebHTMLRepresentation controlsInForm:]): Ditto.
+ (-[WebHTMLRepresentation searchForLabels:beforeElement:]): Ditto.
+ (-[WebHTMLRepresentation matchLabels:againstElement:]): Ditto.
+
+ * WebView/WebHTMLRepresentationPrivate.h: Removed the _bridge method.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _documentFragmentWithPaths:]): Use WebFrame instead of bridge.
+ (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): Ditto.
+ (-[WebHTMLView _pasteAsPlainTextWithPasteboard:]): Ditto.
+ (-[WebHTMLView _updateTextSizeMultiplier]): Ditto.
+ (-[WebHTMLView _frameOrBoundsChanged]): Ditto.
+ (-[WebHTMLView _smartInsertForString:replacingRange:beforeString:afterString:]): Ditto.
+ (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): Ditto.
+ (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Ditto.
+ (-[WebHTMLView drawSingleRect:]): Ditto.
+ (-[WebHTMLView draggedImage:movedTo:]): Ditto.
+ (-[WebHTMLView draggedImage:endedAt:operation:]): Ditto.
+ (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto.
+ (-[WebHTMLView knowsPageRange:]): Ditto.
+ (-[WebHTMLView accessibilityAttributeValue:]): Ditto.
+ (-[WebHTMLView accessibilityFocusedUIElement]): Ditto.
+ (-[WebHTMLView accessibilityHitTest:]): Ditto.
+ (-[WebHTMLView _accessibilityParentForSubview:]): Ditto.
+ (-[WebHTMLView changeDocumentBackgroundColor:]): Ditto.
+ (-[WebHTMLView _changeWordCaseWithSelector:]): Ditto.
+ (-[WebHTMLView _changeSpellingToWord:]): Ditto.
+ (-[WebHTMLView startSpeaking:]): Ditto.
+ (-[WebHTMLView _updateFontPanel]): Ditto.
+ (-[WebHTMLView _canSmartCopyOrDelete]): Ditto.
+ (-[WebHTMLView _layoutIfNeeded]): Ditto.
+ (-[WebHTMLView characterIndexForPoint:]): Ditto.
+ (-[WebHTMLView firstRectForCharacterRange:]): Ditto.
+ (-[WebHTMLView selectedRange]): Ditto.
+ (-[WebHTMLView markedRange]): Ditto.
+ (-[WebHTMLView attributedSubstringFromRange:]): Ditto.
+ (-[WebHTMLView setMarkedText:selectedRange:]): Ditto.
+ (-[WebHTMLView insertText:]): Ditto.
+ (-[WebTextCompleteController _insertMatch:]): Ditto.
+ (-[WebTextCompleteController doCompletion]): Ditto.
+ (-[WebTextCompleteController endRevertingChange:moveLeft:]): Ditto.
+ (-[WebHTMLView string]): Ditto.
+ (-[WebHTMLView selectedString]): Ditto.
+ (-[WebHTMLView searchFor:direction:caseSensitive:wrap:startInSelection:]): Ditto.
+ (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]): Ditto.
+ (-[WebHTMLView setMarkedTextMatchesAreHighlighted:]): Ditto.
+ (-[WebHTMLView markedTextMatchesAreHighlighted]): Ditto.
+ (-[WebHTMLView unmarkAllTextMatches]): Ditto.
+ (-[WebHTMLView rectsForTextMatches]): Ditto.
+ * WebView/WebRenderNode.mm:
+ (-[WebRenderNode initWithWebFrameView:]): Ditto.
+ * WebView/WebResource.mm:
+ (-[WebResource _stringValue]): Ditto.
+
+ * WebView/WebScriptDebugDelegate.mm: Removed unneeded include.
+
+ * WebView/WebView.mm:
+ (-[WebView _dashboardRegions]): Use WebFrame instead of bridge.
+ (-[WebView setProhibitsMainFrameScrolling:]): Ditto.
+ (-[WebView _setInViewSourceMode:]): Ditto.
+ (-[WebView _inViewSourceMode]): Ditto.
+ (-[WebView _executeCoreCommandByName:value:]): Ditto.
+ (-[WebView stringByEvaluatingJavaScriptFromString:]): Ditto.
+ (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto.
+ (-[WebView scrollDOMRangeToVisible:]): Ditto.
+ (-[WebView setSelectedDOMRange:affinity:]): Ditto.
+ (-[WebView setEditable:]): Ditto.
+ (-[WebView setTypingStyle:]): Ditto.
+ (-[WebView typingStyle]): Ditto.
+ (-[WebView replaceSelectionWithNode:]): Ditto.
+ (-[WebView replaceSelectionWithText:]): Ditto.
+ (-[WebView replaceSelectionWithMarkupString:]): Ditto.
+ (-[WebView replaceSelectionWithArchive:]): Ditto.
+ (-[WebView _insertNewlineInQuotedContent]): Ditto.
+ (-[WebView _replaceSelectionWithNode:matchStyle:]): Ditto.
+
+2008-03-12 David Hyatt <hyatt@apple.com>
+
+ Make the zoom factor a float and not a percent.
+
+ Reviewed by antti
+
+ * WebView/WebView.mm:
+ (-[WebView _setZoomMultiplier:isTextOnly:]):
+
+2008-03-11 David Hyatt <hyatt@apple.com>
+
+ This patch prepares Mac WebKit to handle two different zooming modes (full page zoom and text only zoom).
+ New API is added that is parallel to the text zoom public API. You can get/set a pageSizeMultiplier and you
+ can zoom the page in, out or reset it to the standard size.
+
+ In the implementation only one zoom factor is stored, and setting one multiplier will shift you into that mode
+ and set the common zoom factor. In other words you can't combine text zoom and page zoom. One will always
+ win.
+
+ Reviewed by Tim H.
+
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge finishInitializingWithPage:frameName:WebCore::frameView:ownerElement:]):
+ * WebView/WebDocumentInternal.h:
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView viewDidMoveToSuperview]):
+ * WebView/WebPDFView.h:
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView _zoomOut:]):
+ (-[WebPDFView _zoomIn:]):
+ (-[WebPDFView _resetZoom:]):
+ (-[WebPDFView _canZoomOut]):
+ (-[WebPDFView _canZoomIn]):
+ (-[WebPDFView _canResetZoom]):
+ * WebView/WebView.mm:
+ (-[WebViewPrivate init]):
+ (-[WebView setTextSizeMultiplier:]):
+ (-[WebView textSizeMultiplier]):
+ (-[WebView _setZoomMultiplier:isTextOnly:]):
+ (-[WebView _zoomMultiplier:]):
+ (-[WebView _realZoomMultiplier]):
+ (-[WebView _realZoomMultiplierIsTextOnly]):
+ (-[WebView _canZoomOut:]):
+ (-[WebView _canZoomIn:]):
+ (-[WebView _zoomOut:isTextOnly:]):
+ (-[WebView _zoomIn:isTextOnly:]):
+ (-[WebView _canResetZoom:]):
+ (-[WebView _resetZoom:isTextOnly:]):
+ (-[WebView canMakeTextSmaller]):
+ (-[WebView makeTextSmaller:]):
+ (-[WebView canMakeTextLarger]):
+ (-[WebView makeTextLarger:]):
+ (-[WebView canMakeTextStandardSize]):
+ (-[WebView makeTextStandardSize:]):
+ (-[WebView setPageSizeMultiplier:]):
+ (-[WebView pageSizeMultiplier]):
+ (-[WebView canZoomPageIn]):
+ (-[WebView zoomPageIn:]):
+ (-[WebView canZoomPageOut]):
+ (-[WebView zoomPageOut:]):
+ (-[WebView canResetPageZoom]):
+ (-[WebView resetPageZoom:]):
+ (-[WebView _searchWithSpotlightFromMenu:]):
+ * WebView/WebViewInternal.h:
+ * WebView/WebViewPrivate.h:
+
+2008-03-12 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler and Sam Weinig.
+
+ - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface): Made WKGetCGFontFromNSFont and
+ WKGetNSFontATSUFontId Tiger-only.
+
+2008-03-12 Darin Adler <darin@apple.com>
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=17794
+ REGRESSION (r30980): 23 tests hanging on the Mac buildbot
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _initWithWebFrameView:webView:bridge:]): Added missing call to set
+ up pointer from the bridge to the frame. (My next check-in removes the bridge
+ entirely, but we need this until then.)
+
+2008-03-11 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - remove all bridge-related things from WebCore except the bridge itself
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMNode _bridge]): Reimplemented to not use the bridgeForDOMDocument: method.
+
+ * DefaultDelegates/WebDefaultContextMenuDelegate.mm: Removed unneeded include.
+
+ * Plugins/WebPluginController.mm: Ditto.
+
+ * WebCoreSupport/WebFrameBridge.h: Removed unneeded things, including the
+ init and close methods. Added a setWebFrame: method.
+
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge setWebFrame:]): Added.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::frameLoaderDestroyed): Added an assertion.
+ (WebFrameLoaderClient::detachedFromParent4): Moved the call to close on the
+ bridge here. Soon we will be able to remove this entirely!
+ (WebFrameLoaderClient::createFrame): Rewrote this to use the method moved
+ into WebFrame from the bridge.
+
+ * WebView/WebFrame.mm:
+ (-[WebFramePrivate dealloc]): Added code to release the bridge, because it's
+ now owned by the frame.
+ (-[WebFramePrivate finalize]): Added this missing method. We'd leak the script
+ debugger under GC without this!
+ (kit): Rewrote the function that maps from a WebCore::Frame to a WebFrame to
+ use WebFrameLoaderClient instead of the bridge.
+ (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Added.
+ This is code that used to live in the bridge's init function.
+ (+[WebFrame _createMainFrameWithPage:frameName:frameView:]): Ditto.
+ (+[WebFrame WebCore::_createSubframeWithOwnerElement:frameName:frameView:]): Ditto.
+ (-[WebFrame _initWithWebFrameView:webView:bridge:]): Retain the bridge, since
+ the WebView is now the bridge's owner.
+ (-[WebFrame _updateBackground]): Changed this one call site that was calling the
+ WebCore::Frame::bridge function directly to use the kit function instead.
+ (-[WebFrame dealloc]): Added code to clear the WebFrame pointer in the bridge.
+ This code won't last long -- we're eliminating the bridge soon.
+ (-[WebFrame finalize]): Ditto.
+
+ * WebView/WebFrameInternal.h: Added a coreFrame backpointer and two new methods
+ for creating frames.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Rewrote this to use
+ the method moved into WebFrame from the bridge. Gets rid of the unpleasant idiom
+ where we have to allocate a WebFrameBridge and then immediately release it.
+
+2008-03-11 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders.
+
+ - remove code depending on the bridge to get from an NSView to a WebCore::Frame
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage): Remove incorrect call
+ to setView. A couple lines later, there is a call to _install, which sets the
+ view to the scroll view.
+
+ * WebCoreSupport/WebViewFactory.mm: Removed bridgeForView method.
+
+ * WebView/WebDynamicScrollBarsView.h: Moved most of the declarations out of
+ this file, since it's used by Safari.
+ * WebView/WebDynamicScrollBarsViewInternal.h: Added.
+ * WebView/WebDynamicScrollBarsView.m:
+ (-[WebDynamicScrollBarsView updateScrollers]): Ditto.
+ (-[WebDynamicScrollBarsView setAllowsScrolling:]): Ditto.
+ (-[WebDynamicScrollBarsView allowsScrolling]): Ditto.
+ (-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]): Ditto.
+ (-[WebDynamicScrollBarsView setAllowsVerticalScrolling:]): Ditto.
+ (-[WebDynamicScrollBarsView allowsHorizontalScrolling]): Ditto.
+ (-[WebDynamicScrollBarsView allowsVerticalScrolling]): Ditto.
+ (-[WebDynamicScrollBarsView horizontalScrollingMode]): Ditto.
+ (-[WebDynamicScrollBarsView verticalScrollingMode]): Ditto.
+ (-[WebDynamicScrollBarsView setHorizontalScrollingMode:]): Ditto.
+ (-[WebDynamicScrollBarsView setHorizontalScrollingMode:andLock:]): Ditto.
+ (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): Ditto.
+ (-[WebDynamicScrollBarsView setVerticalScrollingMode:andLock:]): Ditto.
+ (-[WebDynamicScrollBarsView setScrollingMode:]): Ditto.
+ (-[WebDynamicScrollBarsView setScrollingMode:andLock:]): Ditto.
+
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView _web_frame]): Added. Replaces the webCoreBridge method.
+
+ * WebView/WebView.mm:
+ (-[WebView setAlwaysShowVerticalScroller:]): Updated for changes to WebCoreFrameView.h.
+ (-[WebView alwaysShowVerticalScroller]): Ditto.
+ (-[WebView setAlwaysShowHorizontalScroller:]): Ditto.
+ (-[WebView alwaysShowHorizontalScroller]): Ditto.
+
+2008-03-11 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore
+
+ * WebCoreSupport/WebChromeClient.h: Added new virtual functions that replace
+ bridge methods.
+ * WebCoreSupport/WebChromeClient.mm: Added lots of BEGIN_BLOCK_OBJC_EXCEPTIONS
+ to recently-created functions.
+ (WebChromeClient::firstResponder): Moved code here from the bridge.
+ (WebChromeClient::makeFirstResponder): Ditto.
+ (WebChromeClient::runOpenPanel): Ditto.
+ (WebChromeClient::willPopUpMenu): Ditto.
+
+ * WebCoreSupport/WebFrameBridge.h: Removed almost everything. What's left
+ is related to creating the bridge and connecting it to WebCore, which will
+ go next when I eliminate use of the bridge to get to/from the Frame*.
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge close]): Moved the code to track the bridge count here
+ instead of the dealloc and finalize methods.
+
+2008-03-11 Darin Adler <darin@apple.com>
+
+ Reviewed by Mitz.
+
+ - update code affected by Range changes
+
+ * Misc/WebNSAttributedStringExtras.mm:
+ (+[NSAttributedString _web_attributedStringFromRange:]): Update for name changes.
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]):
+ Use Range::create.
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView attributedString]): Ditto.
+
+2008-03-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - eliminate keyboard UI mode method from WebCoreFrameBridge
+
+ * WebCoreSupport/WebChromeClient.h: Added keyboardUIMode function.
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::keyboardUIMode): Ditto. Calls WebView.
+ * WebCoreSupport/WebFrameBridge.h: Removed unused things, including the
+ fields for keyboard UI mode.
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge dealloc]): Removed unneeded code; eliminated the fini
+ method.
+ (-[WebFrameBridge finalize]): Ditto.
+ * WebView/WebView.mm: Moved the keyboard mode code in here.
+ (-[WebView _close]): Remove observer from the distributed notification
+ center as well as the normal one.
+ (-[WebView _retrieveKeyboardUIModeFromPreferences:]): Added. Code moved
+ here from the bridge.
+ (-[WebView _keyboardUIMode]): Ditto.
+ * WebView/WebViewInternal.h: Added _keyboardUIMode method.
+
+2008-03-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - eliminate Java applet methods from WebCoreFrameBridge
+
+ * WebCoreSupport/WebChromeClient.mm: Removed unneeded headers and declarations.
+ * WebCoreSupport/WebFrameBridge.mm: Ditto. Also removed unneeded methods, including
+ the ones that load Java applets.
+ * WebCoreSupport/WebFrameLoaderClient.h: Added javaApplet function.
+ * WebCoreSupport/WebFrameLoaderClient.mm: Ditto.
+
+2008-03-07 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Done with Lars.
+
+ Simplified WebViewFactory's refreshPlugins method to only refresh the
+ plugins and not reload the frames anymore since that's now done in a
+ platform independent manner by WebCore::Page.
+
+ Also removed the now unused pluginNameForMIMEType and
+ pluginSupportsMIMEType methods.
+
+ * WebCoreSupport/WebViewFactory.mm:
+ * WebView/WebFrame.mm:
+ * WebView/WebFrameInternal.h:
+ * WebView/WebView.mm:
+
+2008-03-08 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix 64-bit build with GCC 4.2.
+
+ * DefaultDelegates/WebDefaultScriptDebugDelegate.m: Use NSUInteger in place of unsigned where required.
+ * DefaultDelegates/WebDefaultUIDelegate.m: Ditto.
+ * History/WebHistoryItem.mm: Ditto.
+ * Misc/WebElementDictionary.mm: Ditto.
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::objectContentType): Move variable declaration outside of if to avoid warning about the
+ variable being unused in 64-bit.
+ * WebCoreSupport/WebInspectorClient.mm: Use NSUInteger in place of unsigned where required.
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Use CGFloat in place of float where required.
+ (-[WebTextCompleteController numberOfRowsInTableView:]): Use NSInteger in place of int where required.
+
+2008-03-08 Darin Adler <darin@apple.com>
+
+ Reviewed by Adele.
+
+ - eliminate custom highlight methods from WebCoreFrameBridge
+
+ * WebCoreSupport/WebChromeClient.h: Added custom highlight functions.
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::customHighlightRect): Moved code here from bridge.
+ (WebChromeClient::paintCustomHighlight): Ditto.
+ * WebCoreSupport/WebFrameBridge.mm: Removed code here.
+
+2008-03-07 David D. Kilzer <ddkilzer@apple.com>
+
+ Unify concept of enabling Netscape Plug-in API (NPAPI).
+
+ Reviewed by Darin Adler.
+
+ * WebKit.exp: Removed unused class export for WebBaseNetscapePluginView.
+
+ * WebKitPrefix.h: Removed WTF_USE_NPOBJECT since we now use
+ ENABLE(NETSCAPE_PLUGIN_API) as defined in Platform.h.
+
+ * Plugins/WebBaseNetscapePluginStream.h: Replaced #ifndef __LP64__ with
+ #if ENABLE(NETSCAPE_PLUGIN_API).
+ * Plugins/WebBaseNetscapePluginStream.mm: Ditto.
+ * Plugins/WebBaseNetscapePluginView.h: Ditto.
+ * Plugins/WebBaseNetscapePluginView.mm: Ditto.
+ * Plugins/WebBaseNetscapePluginViewInternal.h: Ditto.
+ * Plugins/WebBaseNetscapePluginViewPrivate.h: Ditto.
+ * Plugins/WebBasePluginPackage.h: Ditto.
+ * Plugins/WebBasePluginPackage.m: Ditto.
+ (+[WebBasePluginPackage pluginWithPath:]):
+ * Plugins/WebNetscapeDeprecatedFunctions.c: Ditto.
+ * Plugins/WebNetscapeDeprecatedFunctions.h: Ditto.
+ * Plugins/WebNetscapePluginEmbeddedView.h: Ditto.
+ * Plugins/WebNetscapePluginEmbeddedView.mm: Ditto.
+ * Plugins/WebNetscapePluginPackage.h: Ditto.
+ * Plugins/WebNetscapePluginPackage.m: Ditto.
+ * Plugins/WebNetscapePluginStream.h: Ditto.
+ * Plugins/WebNetscapePluginStream.mm: Ditto.
+ * Plugins/WebPluginDatabase.m: Ditto.
+ (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]):
+ * Plugins/npapi.m: Ditto.
+ * WebCoreSupport/WebFrameLoaderClient.mm: Ditto.
+ (WebFrameLoaderClient::objectContentType):
+ (WebFrameLoaderClient::createPlugin):
+ * WebView/WebHTMLView.mm: Ditto.
+ (-[NSArray _web_makePluginViewsPerformSelector:withObject:]):
+ * WebView/WebHTMLViewInternal.h: Ditto.
+
+ * WebView/WebFrame.mm: Replaced #ifndef __LP64__ with
+ #if ENABLE(NETSCAPE_PLUGIN_API). Moved methods below from (WebPrivate)
+ category to (WebInternal) category so we don't expose the ENABLE() macro
+ from the private header.
+ (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
+ (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
+ * WebView/WebFrameInternal.h: Ditto.
+ * WebView/WebFramePrivate.h: Ditto.
+
+2008-03-07 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5579292> REGRESSION: (safari 2-3): "Default default" encoding for Korean
+ changed from Korean (Windows, DOS) to Korean (ISO 2022-KR), which breaks some sites
+
+ * WebView/WebPreferences.m:
+ (+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): Make encoding name match
+ the one used in Safari.
+
+2008-03-07 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Fix WebKit build with GCC 4.2.
+
+ * Plugins/WebBaseNetscapePluginView.mm: Use the correct return type in method signature.
+
+2008-03-07 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - eliminated WebCoreFrameBridge runOpenPanel
+
+ * WebCoreSupport/WebChromeClient.h: Added runOpenPanel.
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::runOpenPanel): Added.
+ (-[WebOpenPanelResultListener initWithChooser:]): Added. Used to wrap the
+ FileChooser so it can get a result from the UI delegate.
+ (-[WebOpenPanelResultListener dealloc]): Added.
+ (-[WebOpenPanelResultListener finalize]): Added.
+ (-[WebOpenPanelResultListener cancel]): Added.
+ (-[WebOpenPanelResultListener chooseFilename:]): Added.
+
+2008-03-06 Darin Adler <darin@apple.com>
+
+ Reviewed by Mitz.
+
+ - fix regression test failures from the visited-link change
+
+ * History/WebHistory.mm:
+ (+[WebHistory setOptionalSharedHistory:]): Call PageGroup::setShouldTrackVisitedLinks
+ to turn off visited links if there is no history object. Also call
+ removeAllVisitedLinks so we can start over from scratch with the new history.
+
+2008-03-06 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - fix a regression from r30741: a crash under
+ WebFrameLoaderClient::createPlugin() when showing a Mail message with
+ an attachment
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin):
+
+2008-03-06 Darin Adler <darin@apple.com>
+
+ - fix Tiger build
+
+ * History/WebHistory.mm: Added include of WebTypesInternal.h.
+
+2008-03-06 Darin Adler <darin@apple.com>
+
+ - fix Release build
+
+ * History/WebHistory.mm:
+ (-[WebHistoryPrivate setLastVisitedTimeInterval:forItem:]): Removed underscore.
+ (-[WebHistoryPrivate loadFromURL:collectDiscardedItemsInto:error:]): Added #if.
+ (-[WebHistoryPrivate saveToURL:error:]): Ditto.
+
+2008-03-06 Darin Adler <darin@apple.com>
+
+ Reviewed by Mitz.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=17526
+ REGRESSION: iframes are added to Safari's History menu
+ by separating the visited link machinery from global history
+
+ * History/WebHistory.mm: Moved WebHistoryPrivate inside this file.
+ (-[WebHistoryPrivate removeItemFromDateCaches:]): Removed the underscore from this
+ method name, since it's on a private object.
+ (-[WebHistoryPrivate removeItemForURLString:]): Added a call to the
+ PageGroup::removeAllVisitedLinks function if the last URL was removed.
+ (-[WebHistoryPrivate addItemToDateCaches:]): Removed the underscore from this
+ method name, since it's on a private object.
+ (-[WebHistoryPrivate removeAllItems]): Call PageGroup::removeAllVisitedLinks.
+ (-[WebHistoryPrivate ageLimitDate]): Removed the underscore from this
+ method name, since it's on a private object.
+ (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]):
+ Ditto.
+ (-[WebHistoryPrivate saveHistoryGuts:URL:error:]): Ditto. Also changed this
+ to correctly return the error by using the newer version of writeToURL: and
+ removed the FIXME about that.
+ (-[WebHistoryPrivate addVisitedLinksToPageGroup:]): Added. Calls addVisitedLink
+ for every link in the history.
+ (-[WebHistory saveToURL:error:]): Removed the FIXME, since we do get the error now.
+ (-[WebHistory addItem:]): Moved into the WebPrivate category.
+ (-[WebHistory addItemForURL:]): Ditto.
+ (-[WebHistory _addItemForURL:title:]): Added. Used for the normal case where we
+ create an item and already know its title.
+ (-[WebHistory ageLimitDate]): Moved into the WebPrivate category.
+ (-[WebHistory containsItemForURLString:]): Ditto.
+ (-[WebHistory removeItem:]): Ditto.
+ (-[WebHistory setLastVisitedTimeInterval:forItem:]): Ditto.
+ (-[WebHistory _itemForURLString:]): Ditto.
+ (-[WebHistory _addVisitedLinksToPageGroup:]): Added. For use only inside WebKit.
+
+ * History/WebHistoryInternal.h: Added.
+ * History/WebHistoryItemInternal.h: Tweaked formatting and includes.
+ * History/WebHistoryPrivate.h: Moved the WebHistoryPrivate class out of this header.
+ Also reorganized what was left behind.
+
+ * WebCoreSupport/WebChromeClient.h: Added populateVisitedLinks.
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::populateVisitedLinks): Added a call to the new
+ -[WebHistory _addVisitedLinksToPageGroup:] method.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::updateGlobalHistory): Changed code to use the new
+ -[WebHistory _addItemForURL:title:] method.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Rename WebCoreScriptDebuggerImp.{h,mm} to WebScriptDebugger.{h,mm}
+
+ Reviewed by Kevin M.
+
+ * WebView/WebFrame.mm:
+ * WebView/WebScriptDebugDelegate.mm:
+ * WebView/WebScriptDebugger.h: Renamed from WebKit/mac/WebView/WebCoreScriptDebuggerImp.h.
+ * WebView/WebScriptDebugger.mm: Renamed from WebKit/mac/WebView/WebCoreScriptDebuggerImp.mm.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Rename WebCoreScriptDebuggerImp to WebScriptDebugger
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebuggerImp.h:
+ * WebView/WebCoreScriptDebuggerImp.mm:
+ * WebView/WebFrame.mm:
+ (-[WebFrame _attachScriptDebugger]):
+ * WebView/WebFrameInternal.h:
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove WebScriptDebugger
+
+ Uses of WebScriptDebugger have been replaced with
+ WebCoreScriptDebuggerImp.
+
+ Reviewed by Kevin M.
+
+ * WebView/WebFrame.mm:
+ (-[WebFramePrivate dealloc]): Use delete instead of release since
+ WebCoreScriptDebuggerImp is a C++ class.
+ (-[WebFrame _attachScriptDebugger]): Updated to use early returns and
+ WebCoreScriptDebuggerImp.
+ (-[WebFrame _detachScriptDebugger]): Ditto.
+ * WebView/WebFrameInternal.h:
+ * WebView/WebScriptDebugDelegate.mm: Removed WebScriptDebugger
+ * WebView/WebScriptDebugDelegatePrivate.h: Removed.
+ * WebView/WebView.mm:
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove -webFrame and -globalObject from WebScriptDebugger
+
+ WebCoreScriptDebuggerImp is now unaware of WebScriptDebugger
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebuggerImp.h: Removed WebScriptDebugger*
+ parameter to the constructor.
+ * WebView/WebCoreScriptDebuggerImp.mm:
+ (toWebFrame): Added.
+ (WebCoreScriptDebuggerImp::sourceParsed): Call toWebFrame.
+ (WebCoreScriptDebuggerImp::callEvent): Ditto, and get the Frame's
+ WindowScriptObject ourselves instead of asking WebScriptDebugger for
+ it.
+ (WebCoreScriptDebuggerImp::atStatement): Call toWebFrame.
+ (WebCoreScriptDebuggerImp::returnEvent): Ditto.
+ (WebCoreScriptDebuggerImp::exception): Ditto.
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptDebugger initWithWebFrame:]): Updated for change to
+ WebScriptDebuggerImp's constructor.
+ * WebView/WebScriptDebugDelegatePrivate.h: Removed
+ -webFrame/-globalObject.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove -enterFrame: and -leaveFrame from WebScriptDebugger
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebuggerImp.h: Changed to store m_topCallFrame
+ in a RetainPtr, now that WebCoreScriptDebuggerImp is in charge of its
+ lifetime.
+ * WebView/WebCoreScriptDebuggerImp.mm:
+ - Added declaration of -[WebScriptCallFrame
+ _initWithGlobalObject:caller:state:].
+ - Changed most uses of m_topCallFrame to m_topCallFrame.get()
+ (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp): Removed
+ now-unnecessary initialization of m_topCallFrame.
+ (WebCoreScriptDebuggerImp::callEvent): Replaced call to enterFrame:
+ with its implementation. The one difference between this
+ implementation and the old enterFrame: method is that we don't hand
+ our reference to m_topCallFrame to _initWithGlobalObject: -- that
+ method must now retain the passed-in WebScriptCallFrame manually.
+ (WebCoreScriptDebuggerImp::atStatement):
+ (WebCoreScriptDebuggerImp::returnEvent): Replaced call to leaveFrame
+ with its implementation.
+ (WebCoreScriptDebuggerImp::exception):
+ * WebView/WebScriptDebugDelegate.mm: Removed declaration of
+ -[WebScriptCallFrame _initWithGlobalObject:caller:state:].
+ (-[WebScriptCallFrame _initWithGlobalObject:caller:state:]): Changed
+ to retain the passed-in caller.
+ * WebView/WebScriptDebugDelegatePrivate.h:
+ - Removed _current ivar
+ - Removed enterFrame:/leaveFrame declarations.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove -parsedSource: from WebScriptDebugger
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebuggerImp.mm:
+ (WebCoreScriptDebuggerImp::sourceParsed): Moved code here from
+ -[WebScriptDebugger parsedSource:fromURL:sourceId:startLine:errorLine:errorMessage:]
+ * WebView/WebScriptDebugDelegate.mm: Removed -parsedSource:.
+ * WebView/WebScriptDebugDelegatePrivate.h: Ditto.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove -enteredFrame:, -leavingFrame:, and -exceptionRaised: from WebScriptDebugger
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebuggerImp.mm:
+ (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp): Changed to call
+ trhough to callEvent instead of duplicating its code here.
+ (WebCoreScriptDebuggerImp::callEvent): Moved code from
+ -[WebScriptDebugger enteredFrame:sourceId:line:] here.
+ (WebCoreScriptDebuggerImp::returnEvent): Moved code from
+ -[WebScriptDebugger leavingFrame:sourceId:line:] here.
+ (WebCoreScriptDebuggerImp::exception): Moved code from
+ -[WebScriptDebugger exceptionRaised:sourceId:line:] here.
+ * WebView/WebScriptDebugDelegate.mm: Removed -enteredFrame:,
+ -leavingFrame:, and -exceptionRaised:.
+ * WebView/WebScriptDebugDelegatePrivate.h: Ditto.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove -[WebScriptDebugger hitStatement:sourceId:line:]
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebuggerImp.mm:
+ (WebCoreScriptDebuggerImp::atStatement): Moved code here from
+ -[WebScriptDebugger hitStatement:sourceId:line:].
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptDebugger webFrame]): Added.
+ * WebView/WebScriptDebugDelegatePrivate.h:
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove WebCoreScriptDebugger
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebugger.h: Removed.
+ * WebView/WebCoreScriptDebugger.mm: Removed.
+ * WebView/WebCoreScriptDebuggerImp.h: Replaced WebCoreScriptDebugger
+ with WebScriptDebugger.
+ * WebView/WebCoreScriptDebuggerImp.mm: Ditto, and replaced [m_debugger
+ delegate] with just m_debugger.
+ (toNSString): Moved here from WebCoreScriptDebugger.mm.
+ (toNSURL): Ditto.
+ (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp):
+ (WebCoreScriptDebuggerImp::sourceParsed):
+ (WebCoreScriptDebuggerImp::callEvent):
+ (WebCoreScriptDebuggerImp::atStatement):
+ (WebCoreScriptDebuggerImp::returnEvent):
+ (WebCoreScriptDebuggerImp::exception):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptDebugger initWithWebFrame:]): _debugger now holds a
+ WebCoreScriptDebuggerImp, so initialize it properly.
+ * WebView/WebScriptDebugDelegatePrivate.h: Changed _debugger to hold a
+ WebCoreScriptDebuggerImp.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Move WebCoreScriptDebuggerImp to its own source files
+
+ Also changed WebCoreScriptDebuggerImp coding style to match our style
+ guidelines.
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebugger.h: Added declaration of toNSURL
+ function.
+ * WebView/WebCoreScriptDebugger.mm: Removed WebCoreScriptDebuggerImp
+ implementation.
+ (toNSURL): Made no longer static.
+ * WebView/WebCoreScriptDebuggerImp.h: Added.
+ * WebView/WebCoreScriptDebuggerImp.mm: Added. Code was moved here from
+ WebCoreScriptDebugger.mm and cleaned up.
+ (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp):
+ (WebCoreScriptDebuggerImp::sourceParsed):
+ (WebCoreScriptDebuggerImp::callEvent):
+ (WebCoreScriptDebuggerImp::atStatement):
+ (WebCoreScriptDebuggerImp::returnEvent):
+ (WebCoreScriptDebuggerImp::exception):
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Move -_enterFrame and -_leaveFrame from WebCoreScriptDebugger to WebScriptDebugger
+
+ Reviewed by Kevin M.
+
+ * WebView/WebCoreScriptDebugger.h:
+ - Removed newFrameWithGlobalObject:caller:state: from
+ WebScriptDebugger protocol
+ - Added enterFrame: and leaveFrame: to WebScriptDebugger protocol
+ - Removed _current ivar from WebCoreScriptDebugger
+ * WebView/WebCoreScriptDebugger.mm:
+ (WebCoreScriptDebuggerImp::callEvent): Changed to call enterFrame on
+ the delegate.
+ (WebCoreScriptDebuggerImp::returnEvent): Ditto for leaveFrame.
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptDebugger dealloc]): Added code to release _current.
+ (-[WebScriptDebugger enterFrame:]): Added. Code came from
+ WebCoreScriptDebugger.
+ (-[WebScriptDebugger leaveFrame]): Ditto.
+ * WebView/WebScriptDebugDelegatePrivate.h: Added _current ivar.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Remove WebCoreScriptCallFrame
+
+ Reviewed by Tim.
+
+ * WebView/WebCoreScriptDebugger.h:
+ - Replaced WebCoreScriptCallFrame with WebScriptCallFrame
+ - Replaced -newWrapperForFrame: with
+ -newFrameWithGlobalObject:caller:state:
+ - Removed WebCoreScriptCallFrame interface.
+ * WebView/WebCoreScriptDebugger.mm: Replaced WebCoreScriptCallFrame
+ with WebScriptCallFrame.
+ (-[WebCoreScriptDebugger _enterFrame:]): Changed to call
+ -newFrameWithGlobalObject:caller:state.
+ (-[WebCoreScriptDebugger _leaveFrame]):
+ * WebView/WebScriptDebugDelegate.h: Changed WebScriptCallFrame's
+ _private ivar to be of type WebScriptCallFramePrivate*.
+ * WebView/WebScriptDebugDelegate.mm:
+ - Replaced WebCoreScriptCallFrame with WebScriptCallFrame
+ - Added WebScriptCallFramePrivate
+ (-[WebScriptDebugger enteredFrame:sourceId:line:]):
+ (-[WebScriptDebugger hitStatement:sourceId:line:]):
+ (-[WebScriptDebugger leavingFrame:sourceId:line:]):
+ (-[WebScriptDebugger exceptionRaised:sourceId:line:]):
+ (-[WebScriptCallFramePrivate dealloc]): Added.
+ (-[WebScriptCallFrame _initWithGlobalObject:caller:state:]): Added.
+ Code came from WebCoreScriptCallFrame.
+ (-[WebScriptCallFrame dealloc]): Added a call to release the _private
+ ivar.
+ (-[WebScriptCallFrame _convertValueToObjcValue:]): Replaced calls to
+ _private with direct access of _private's ivars.
+ (-[WebScriptCallFrame caller]): Ditto.
+ (-[WebScriptCallFrame scopeChain]): Ditto.
+ (-[WebScriptCallFrame evaluateWebScript:]): Ditto.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Move -_convertValueToObjcValue to WebScriptCallFrame
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebCoreScriptDebugger.h: Removed declaration of
+ -_convertValueToObjcValue.
+ * WebView/WebCoreScriptDebugger.mm: Removed -_convertValueToObjcValue.
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame _convertValueToObjcValue:]): Added. Code came
+ from -[WebCoreScriptCallFrame _convertValueToObjcValue].
+ (-[WebScriptCallFrame scopeChain]): Changed to call
+ -_convertValueToObjcValue on self instead of _private.
+ (-[WebScriptCallFrame exception]): Ditto.
+ (-[WebScriptCallFrame evaluateWebScript:]): Ditto.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Move -exception and -evaluateWebScript: to WebScriptCallFrame
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebCoreScriptDebugger.h: Removed declarations of -exception
+ and -evaluateWebScript:.
+ * WebView/WebCoreScriptDebugger.mm: Removed -exception and
+ -evaluateWebScript:.
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame exception]): Added. Code came from
+ -[WebCoreScriptCallFrame exception].
+ (-[WebScriptCallFrame evaluateWebScript:]): Added. Code came from
+ -[WebCoreScriptCallFrame evaluateWebScript:].
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Move -scopeChain to WebScriptCallFrame
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebCoreScriptDebugger.h:
+ - Added declarations of -globalObject and -_convertValueToObjcValue:
+ to WebCoreScriptCallFrame
+ - Removed declaration of -scopeChain.
+ * WebView/WebCoreScriptDebugger.mm: Moved -_convertValueToObjcValue
+ within the main WebCoreScriptCallFrame implementation.
+ (-[WebCoreScriptCallFrame globalObject]): Added.
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame scopeChain]): Added. Code came from
+ -[WebCoreScriptCallFrame scopeChain].
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Move -functionName from WebCoreScriptCallFrame to WebScriptCallFrame
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebCoreScriptDebugger.h:
+ - Removed #else case of #ifdef __cplusplus since this file is only
+ ever used by C++ Objective-C files
+ - Removed 'using KJS::ExecState' statement since we prefer not to
+ have using statements in header files
+ - Consequently prefixed uses of ExecState with KJS::
+ - Added declaration of toNSString method that takes a const
+ UString&
+ - Added declaration of -[WebCoreScriptCallFrame state]
+ - Removed declaration of -[WebCoreScriptCallFrame functionName]
+ * WebView/WebCoreScriptDebugger.mm:
+ (toNSString): Made this no longer static.
+ (-[WebCoreScriptCallFrame state]): Added.
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame functionName]): Added. Code came from
+ -[WebCoreScriptCallFrame functionName], though I changed some nested
+ ifs into early returns.
+
+2008-03-05 Adam Roben <aroben@apple.com>
+
+ Move WebCoreScriptDebugger to WebKit
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebCoreScriptDebugger.h: Renamed from WebCore/page/mac/WebCoreScriptDebugger.h.
+ * WebView/WebCoreScriptDebugger.mm: Renamed from WebCore/page/mac/WebCoreScriptDebugger.mm.
+ (toNSString):
+ (toNSURL):
+ (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp):
+ (WebCoreScriptDebuggerImp::sourceParsed):
+ (WebCoreScriptDebuggerImp::callEvent):
+ (WebCoreScriptDebuggerImp::atStatement):
+ (WebCoreScriptDebuggerImp::returnEvent):
+ (WebCoreScriptDebuggerImp::exception):
+ (+[WebCoreScriptDebugger initialize]):
+ (-[WebCoreScriptDebugger initWithDelegate:]):
+ (-[WebCoreScriptDebugger dealloc]):
+ (-[WebCoreScriptDebugger finalize]):
+ (-[WebCoreScriptDebugger delegate]):
+ (-[WebCoreScriptDebugger _enterFrame:]):
+ (-[WebCoreScriptDebugger _leaveFrame]):
+ (-[WebCoreScriptCallFrame _initWithGlobalObject:caller:state:]):
+ (-[WebCoreScriptCallFrame _setWrapper:]):
+ (-[WebCoreScriptCallFrame _convertValueToObjcValue:]):
+ (-[WebCoreScriptCallFrame dealloc]):
+ (-[WebCoreScriptCallFrame wrapper]):
+ (-[WebCoreScriptCallFrame caller]):
+ (-[WebCoreScriptCallFrame scopeChain]):
+ (-[WebCoreScriptCallFrame functionName]):
+ (-[WebCoreScriptCallFrame exception]):
+ (-[WebCoreScriptCallFrame evaluateWebScript:]):
+ * WebView/WebScriptDebugDelegate.mm: Updated header path.
+ * WebView/WebScriptDebugDelegatePrivate.h: Ditto.
+
+2008-03-05 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Geoff.
+
+ Include file changes.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ * Plugins/WebNetscapePluginPackage.m:
+
+2008-03-04 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5720160> Browser windows "do nothing" while modal
+ dialog or menu is up due to run loop modes (or while scrolling)
+
+ Add new API that lets a WebView be scheduled with multiple runloops and modes.
+ This lets loading continue when in a nested runloop or in a different mode.
+
+ * Misc/WebKitVersionChecks.h: Add a new version define:
+ WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES.
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Schedule in the main runloop and with
+ the default runloop mode if we are linked on an earlier WebKit version, use common modes otherwise.
+ (-[WebView scheduleInRunLoop:forMode:]): New API, that calls through to Page.
+ (-[WebView unscheduleFromRunLoop:forMode:]): Ditto.
+ * WebView/WebViewPrivate.h: Add the new pending API methods.
+
+2008-03-04 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix crash that happens when trying to load a page with a Java applet.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ Don't release the names and values array - the kit method returns an autoreleased array.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - fix 200+ failing regression tests
+ - fix http://bugs.webkit.org/show_bug.cgi?id=17668
+ Vertical scrollbar at slashdot.org is randomly not shown
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage): Changed the refcounting
+ code here to exactly match the way it was before it was moved from WebCore. I had
+ introduced a storage leak and that was causing problems with scroll bars!
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - remove WebCoreFrameBridge reapplyStyles method
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView reapplyStyles]): Moved code to reapply styles here from the bridge.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - eliminate WebCoreFrameBridge createFrameViewWithNSView
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+ Moved code here from createFrameViewWithNSView.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - removed WebCoreFrameBridge scrollOverflowInDirection
+
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView _scrollOverflowInDirection:granularity:]): Changed to call
+ EventHandler directly instead of using the bridge.
+ (-[WebFrameView scrollToBeginningOfDocument:]): Updated to use WebCore enums instead
+ of the ones from the bridge.
+ (-[WebFrameView scrollToEndOfDocument:]): Ditto.
+ (-[WebFrameView _pageVertically:]): Ditto.
+ (-[WebFrameView _pageHorizontally:]): Ditto.
+ (-[WebFrameView _scrollLineVertically:]): Ditto.
+ (-[WebFrameView _scrollLineHorizontally:]): Ditto.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - remove WebCoreFrameBridge installInFrame: method
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage): Call
+ -[WebFrameView _install] instead of -[WebCoreFrameBridge installInFrame:].
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView _install]): Added. Has code from -[WebCoreFrameBridge installInFrame:].
+ (-[WebFrameView _setCustomScrollViewClass:]): Used early return idiom so the entire
+ method isn't nested inside an if statement. Call
+ -[WebFrameView _install] instead of -[WebCoreFrameBridge installInFrame:].
+ * WebView/WebFrameViewInternal.h: Added declaration of _install method so it can be
+ used in WebFrameLoaderClient.mm.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - remove WebCoreFrameBridge window method
+
+ * WebCoreSupport/WebFrameBridge.mm: Removed window method.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - move code from WebFrameBridge into WebFrameLoaderClient
+
+ * WebCoreSupport/WebFrameBridge.h: Removed unused fields, changed frame name parameters
+ to use WebCore::String instead of NSString, add initSubframeWithOwnerElement declaration,
+ removed viewForPluginWithFrame, viewForJavaAppletWithFrame, createChildFrameNamed,
+ redirectDataToPlugin, determineObjectFromMIMEType, and windowObjectCleared methods.
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge finishInitializingWithPage:frameName:WebCore::frameView:ownerElement:]):
+ Changed to use WebCore::String.
+ (-[WebFrameBridge initMainFrameWithPage:frameName:WebCore::frameView:]): Ditto.
+ (-[WebFrameBridge initSubframeWithOwnerElement:frameName:WebCore::frameView:]): Ditto.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::setOriginalURLForDownload): Removed some dead code I found here
+ and added a FIXME.
+ (WebFrameLoaderClient::createFrame): Moved the code from WebFrameBridge here.
+ (WebFrameLoaderClient::objectContentType): Ditto.
+ (parameterValue): Added. Helper function, based on code originally in WebFrameBridge.
+ (pluginView): Ditto.
+ (WebFrameLoaderClient::createPlugin): Moved the code from WebFrameBridge here.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - remove -[WebCoreFrameBridge dashboardRegionsChanged:]
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::dashboardRegionsChanged): Moved code here from the bridge.
+ The WebCore side now calls this only when there's an actual change.
+ * WebCoreSupport/WebFrameBridge.h: Removed lastDashboardRegions.
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge dealloc]): Removed code to release lastDashboardRegions.
+ Removed _compareDashboardRegions: and dashboardRegionsChanged: methods.
+
+2008-03-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - remove WebCoreFrameBridge issuePasteComand method
+
+ * WebCoreSupport/WebFrameBridge.mm: Removed issuePasteCommand method.
+ * WebView/WebHTMLViewInternal.h: Removed declaration of paste: method.
+
+2008-03-03 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ - some "cleanup" on the path to removing WebCoreFrameBridge
+
+ * Storage/WebDatabaseManager.mm: Tweak includes.
+ * Storage/WebDatabaseTrackerClient.mm: Ditto.
+ * Storage/WebSecurityOrigin.mm: Ditto.
+ * Storage/WebSecurityOriginInternal.h: Ditto.
+
+ * WebView/WebFrame.mm:
+ (core): Changed to get rid of the requirement that WebKitEditableLinkBehavior exactly
+ match WebCore::EditableLinkBehavior.
+ * WebView/WebFrameInternal.h: Removed unused kit function.
+
+ * WebView/WebHTMLView.mm: Moved WebHTMLViewPrivate class in here.
+ * WebView/WebHTMLViewInternal.h: Moved WebHTMLVewPrivate class out of here.
+ * WebView/WebHTMLViewPrivate.h: Tweaked formatting and removed some unneeded declarations.
+
+ * WebView/WebPreferencesPrivate.h: Removed a no-longer-needed comment.
+
+2008-03-01 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ Update Xcode configuration to support building debug and release from the mysterious future.
+
+ * Configurations/DebugRelease.xcconfig:
+
+2008-02-29 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Replace use of WKPathFromFont with implementation in terms of public API.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface): Remove unused symbol.
+
+2008-02-29 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Fix spelling of "request" in name of WKNSURLProtocolClassForRequest.
+
+ * Misc/WebNSURLExtras.mm:
+ (-[NSURL _webkit_canonicalize]):
+ * WebKit.order:
+
+2008-02-29 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Don't use WKSupportsMultipartXMixedReplace on Leopard as multipart/x-mixed-replace is always handled by NSURLRequest.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface):
+
+2008-02-29 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Remove obsolete code that had been left intact to support users running WebKit with older versions of Safari.
+
+ * Misc/WebNSViewExtras.m: Remove _web_superviewOfClass:stoppingAtClass:.
+ * Misc/WebNSWindowExtras.m: Remove _webkit_displayThrottledWindows.
+ * Misc/WebSearchableTextView.m: Remove selectionImageForcingWhiteText:.
+ * WebCoreSupport/WebImageRendererFactory.m: Update comment to mention the last version of Safari that
+ requires this class.
+ * WebInspector/WebInspector.mm: Remove sharedWebInspector and update comments to mention the last version
+ of Safari that calls other obsolete methods.
+ * WebView/WebDocumentPrivate.h: Remove selectionImageForcingWhiteText:.
+ * WebView/WebHTMLView.mm: Ditto.
+ * WebView/WebPDFView.mm: Ditto.
+ * WebView/WebView.mm: Update comment to mentoin the last version of Safari that requires the obsolete method.
+
+2008-02-29 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Eric Seidel.
+
+ Remove unneeded includes of WebKitSystemInterface.h.
+
+ * History/WebHistoryItem.mm:
+ * Misc/WebNSViewExtras.m:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ * WebView/WebDataSource.mm:
+ * WebView/WebPDFView.mm:
+
+2008-02-29 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt and Oliver Hunt.
+
+ <rdar://problem/4753845> WebKit should use CGEventSourceSecondsSinceLastEventType in place of WKSecondsSinceLastInputEvent SPI.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface): Remove unused symbol.
+ * WebKit.order: Ditto.
+
+2008-02-28 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Make use of new CGFont APIs on Leopard rather than making a WebKitSystemInterface call.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface): Only initialize wkGetFontMetrics on Tiger.
+
+2008-02-27 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Mark Rowe (code) and Darin (concept)
+
+ Much better fix for <rdar://problem/4930688> (see r19549)
+ Original fix for <rdar://problem/3947312> (and 14 dupes)
+
+ Let me tell you a story:
+ A long time ago, in a cvs repository far, far away, loader code was almost all up in WebKit.
+ WebArchive code was intertwined with that code in bizarre and complex ways.
+ During the months long loader re-factoring where we pushed much loader code down into WebCore,
+ many portions of the WebKit loader were thinned out until they ceased to exist. Others remained
+ with a sole purpose.
+
+ One such section of code whose lineage traces back from WebFrameLoaderClient to WebFrameLoader
+ to WebLoader was originally rooted in the method [WebLoader loadRequest:]. This method was the
+ single entry point for almost all loading (network or web archives)
+
+ This method would check various headers and other fields on the NSURLRequest and NSURLResponse
+ to make decisions about the load. If the cache control fields were expired or other conditions
+ in the headers were met, the load would be forced to go out to the network.
+
+ As the loader was moved and tweaked repeatedly, most of this code was pruned or re-factored.
+ At some point, all that remained was the special cases for loading WebArchives.
+
+ Somewhere in the r16,000s, this remaining responsibility was noticed and related methods we renamed
+ to be WebArchive specific, further cementing the assumed design.
+
+ Problem is, the design was bad. A WebArchive is meant to be a static snapshot of a WebPage at a
+ specific point in time. Referring to the request to see if the resource should be reloaded seems
+ nonsensical, as does referring to the response headers to see if the resource is "expired". In the
+ context of loading a WebArchive, available data should *always* be loaded from the WebArchive, at least
+ during the initial load!
+
+ After discovering the secret to reproducing all of these bugs is both emptying our your Foundation
+ cache and disconnecting your network, it was easy to reproduce the 16 individually reported cases
+ that were all symptoms of this bug, and easy to verify that they are fixed with this patch.
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::willUseArchive): Do not call either form of "canUseArchivedResource()" that
+ inspect the request or response objects - We are loading from a WebArchive, and we should never
+ make the decision to go out to the network when we actually have the resource available.
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface): Remove two methods that are no longer used anywhere in WebKit
+
+2008-02-27 Matt Lilek <webkit@mattlilek.com>
+
+ Reviewed by Adam Roben.
+
+ Bug 14348: Messing up the inspector by dragging an URL into it
+ http://bugs.webkit.org/show_bug.cgi?id=14348
+ <rdar://problem/5283620> and <rdar://problem/5712808>
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController init]): Remove duplicate preference setting.
+ (-[WebInspectorWindowController webView:dragDestinationActionMaskForDraggingInfo:]):
+
+2008-02-25 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam.
+
+ * WebView/WebArchiver.mm:
+ (+[WebArchiver archiveSelectionInFrame:]): Use blankURL.
+ * WebView/WebFrame.mm:
+ (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): Avoid the
+ variable name URL to avoid clashing with the renamed KURL in the future. Also use
+ blankURL.
+ (-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]): Ditto.
+ (-[WebFrame _loadHTMLString:baseURL:unreachableURL:]): Ditto.
+ (-[WebFrame loadHTMLString:baseURL:]): Ditto.
+ (-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]): Ditto.
+
+2008-02-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - remove separate client calls for "standard" and "reload' history
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::updateGlobalHistory):
+
+2008-02-23 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Move basic threading support from WebCore to WTF.
+
+ * ForwardingHeaders/wtf/Threading.h: Added.
+ * ForwardingHeaders/wtf/Locker.h: Added.
+
+2008-02-23 David Kilzer <ddkilzer@apple.com>
+
+ Please clarify licensing for some files
+ <http://bugs.webkit.org/show_bug.cgi?id=14970>
+
+ Reviewed by Darin Adler.
+
+ * Plugins/WebNetscapeDeprecatedFunctions.c: Updated copyright statement
+ and added Apple BSD-style license.
+ * Plugins/WebNetscapeDeprecatedFunctions.h: Ditto.
+
+2008-02-22 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Adam Roben
+
+ Reverted the changed from yesterday to add pasteAndMatchStyle:, as the existing
+ pasteAsPlainText: has the same behavior.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]):
+ (-[WebHTMLView readSelectionFromPasteboard:]):
+ (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
+ (-[WebHTMLView pasteAsRichText:]):
+ (-[WebHTMLView paste:]):
+ * WebView/WebView.mm:
+ * WebView/WebViewPrivate.h:
+
+2008-02-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam.
+
+ Use BackForwardList::create instead.
+
+ * History/WebBackForwardList.mm:
+ (-[WebBackForwardList init]):
+
+2008-02-21 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Jessica Kahn
+
+ support for pasteAndMatchStyle: command (see <rdar://problem/5723952>)
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _pasteWithPasteboard:allowPlainText:matchStyle:]):
+ added matchStyle parameter, passed along to bridge (formerly always passed NO to bridge)
+ (-[WebHTMLView readSelectionFromPasteboard:]):
+ pass NO for new matchStyle parameter to match old behavior
+ (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
+ validate pasteAndMatchStyle the same way as pasteAsRichText
+ (-[WebHTMLView pasteAndMatchStyle:]):
+ just like pasteAsRichText but passes YES for matchStyle
+ (-[WebHTMLView pasteAsRichText:]):
+ pass NO for new matchStyle parameter to match old behavior
+ (-[WebHTMLView paste:]):
+ ditto
+
+ * WebView/WebView.mm:
+ added macro(pasteAndMatchStyle)
+
+ * WebView/WebViewPrivate.h:
+ added pasteAndMatchStyle: to WebViewEditingActionsPendingPublic category
+
+2008-02-20 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin and Geoff.
+
+ - WebKit part of <rdar://problem/5754378> work around missing video on YouTube front page with a site-specific hack
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Added a call to Settings::setNeedsSiteSpecificQuirks.
+ There are currently no site-specific quirks on Mac, but we will propagate the state
+ to WebCore to avoid possible mistakes later.
+
+2008-02-19 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Move back WebKit methods that were unused in WebCore.
+
+ * Misc/WebNSURLExtras.mm:
+ (+[NSURL _web_URLWithData:]):
+ (+[NSURL _web_URLWithData:relativeToURL:]):
+ (-[NSURL _web_originalData]):
+ (-[NSURL _web_originalDataAsString]):
+ (-[NSURL _web_isEmpty]):
+ (-[NSURL _webkit_canonicalize]):
+ (-[NSURL _webkit_URLByRemovingComponent:]):
+ (-[NSURL _webkit_URLByRemovingFragment]):
+ (-[NSURL _webkit_URLByRemovingResourceSpecifier]):
+ (-[NSURL _webkit_isFileURL]):
+ (-[NSString _webkit_isFileURL]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::setTitle):
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface):
+
+2008-02-18 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ * Misc/WebNSAttributedStringExtras.mm:
+ (+[NSAttributedString _web_attributedStringFromRange:]): Eliminate use of
+ DeprecatedString.
+
+2008-02-17 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for http://bugs.webkit.org/show_bug.cgi?id=17365
+ document.createEvent("MessageEvent") throws NOT_SUPPORTED_ERR
+
+ * MigrateHeaders.make: Migrate DOMProgressEvent.h and DOMTextPrivate.h which were
+ mistakenly not migrated.
+
+2008-02-15 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ - WebKit part of fixing http://bugs.webkit.org/show_bug.cgi?id=17360
+ <rdar://problem/5743131> REGRESSION: mp4 file downloaded from server is downloaded as html
+
+ * WebView/WebDataSource.mm:
+ (+[WebDataSource _representationClassForMIMEType:]):
+ (-[WebDataSource _responseMIMEType]):
+ (-[WebDataSource subresources]):
+ (-[WebDataSource subresourceForURL:]):
+ * WebView/WebResource.mm:
+ (-[WebResource _initWithData:URL:response:]):
+ * WebView/WebResourcePrivate.h:
+
+2008-02-15 Adam Roben <aroben@apple.com>
+
+ Make WebKit's FEATURE_DEFINES match WebCore's
+
+ Reviewed by Mark.
+
+ * Configurations/WebKit.xcconfig:
+
+2008-02-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ - updated for WebCore KURL changes
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem URL]): Removed getNSURL call.
+ * Misc/WebElementDictionary.mm:
+ (-[WebElementDictionary _absoluteImageURL]): Ditto.
+ (-[WebElementDictionary _absoluteLinkURL]): Ditto.
+ * Misc/WebNSAttributedStringExtras.mm:
+ (fileWrapperForElement): Ditto.
+ (+[NSAttributedString _web_attributedStringFromRange:]): Ditto.
+ * Misc/WebNSURLExtras.mm:
+ (-[NSString _webkit_stringByReplacingValidPercentEscapes]): Updated
+ for function name change.
+ * WebCoreSupport/WebContextMenuClient.mm:
+ (WebContextMenuClient::downloadURL): Removed getNSURL call.
+ * WebCoreSupport/WebDragClient.mm:
+ (WebDragClient::createDragImageForLink): Ditto.
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::dispatchWillPerformClientRedirect): Ditto.
+ (WebFrameLoaderClient::startDownload): Ditto.
+ (WebFrameLoaderClient::updateGlobalHistoryForStandardLoad): Ditto.
+ (WebFrameLoaderClient::updateGlobalHistoryForReload): Ditto.
+ (WebFrameLoaderClient::cancelledError): Ditto.
+ (WebFrameLoaderClient::blockedError): Ditto.
+ (WebFrameLoaderClient::cannotShowURLError): Ditto.
+ (WebFrameLoaderClient::interruptForPolicyChangeError): Ditto.
+ (WebFrameLoaderClient::cannotShowMIMETypeError): Ditto.
+ (WebFrameLoaderClient::fileDoesNotExistError): Ditto.
+ (WebFrameLoaderClient::willUseArchive): Ditto.
+ (WebFrameLoaderClient::setTitle): Ditto.
+ (WebFrameLoaderClient::actionDictionary): Ditto.
+ (WebFrameLoaderClient::createFrame): Ditto.
+ (WebFrameLoaderClient::objectContentType): Ditto.
+ (WebFrameLoaderClient::createPlugin): Ditto.
+ (WebFrameLoaderClient::createJavaAppletWidget): Ditto.
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource _URL]): Ditto.
+ (-[WebDataSource _initWithDocumentLoader:]): Ditto.
+ (-[WebDataSource unreachableURL]): Ditto.
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.
+
+2008-02-14 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Geoff.
+
+ Update order files.
+
+ * WebKit.order:
+
+2008-02-14 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ http://bugs.webkit.org/show_bug.cgi?id=17207
+ Database example doesn't work (requires not-yet-released Safari)
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::exceededDatabaseQuota): Check Safari version, and allow 5 megabytes of storage
+ if it's too old.
+
+2008-02-11 Darin Adler <darin@apple.com>
+
+ - roll out fix for <rdar://problem/5726016> REGRESSION: Xcode News window renders
+ incorrectly due to visibility fix
+
+ Removed the Xcode-specific quirk at the request of some folks on the Xcode team.
+
+ * Misc/WebKitVersionChecks.h: Removed the constant.
+
+ * WebView/WebView.mm:
+ (-[WebView _needsXcodeVisibilityQuirk]): Removed.
+ (-[WebView _preferencesChangedNotification:]): Removed call to
+ setNeedsXcodeVisibilityQuirk.
+
+2008-02-12 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Mitz.
+
+ * WebCoreSupport/WebFrameBridge.mm:
+ * WebCoreSupport/WebViewFactory.mm:
+ (-[WebViewFactory imageTitleForFilename:size:]):
+ Move implementation from WebFrameBridge to WebViewFactory.
+
+2008-02-11 Darin Adler <darin@apple.com>
+
+ Reviewed by Mitz.
+
+ - fix <rdar://problem/5726016> REGRESSION: Xcode News window renders
+ incorrectly due to visibility fix
+
+ Added an Xcode-specific quirk.
+
+ * Misc/WebKitVersionChecks.h: Added a constant for the "linked on or after"
+ part of the check.
+
+ * WebView/WebView.mm:
+ (-[WebView _needsXcodeVisibilityQuirk]): Added.
+ (-[WebView _preferencesChangedNotification:]): Added a call to
+ setNeedsXcodeVisibilityQuirk based on _needsXcodeVisibilityQuirk.
+
+2008-02-10 Darin Adler <darin@apple.com>
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=17274
+ REGRESSION: User Agent string broken in r30119
+
+ * WebView/WebView.mm:
+ (-[WebView _userAgentWithApplicationName:andWebKitVersion:]):
+ Fix wrong variable name. Doh!
+
+2008-02-09 Darin Adler <darin@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ - fix <rdar://problem/5725996> crash every time you open the Xcode documentation window
+
+ * WebView/WebView.mm:
+ (-[WebView _userAgentWithApplicationName:andWebKitVersion:]): Work around a bug in the
+ garbage collector's Objective C++ support by not initializing a static to an object
+ that needs to be marked when running under GC.
+
2008-02-05 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
@@ -74,7 +7536,7 @@
<rdar://problem/5708388> WebDashboardRegion.h duplicated between WebCore / WebKit
- Reviewed by Darin.
+ Reviewed by Darin Adler.
* WebCoreSupport/WebDashboardRegion.h: Removed.
* WebView/WebView.mm: Updated #import to use copy of WebDashboardRegion.h from WebCore.
@@ -181,7 +7643,7 @@
Updated for renames/removal of WebCore methods.
- Reviewed by Darin.
+ Reviewed by Darin Adler.
* Plugins/WebPluginController.mm:
(-[WebPluginController webPlugInContainerSelectionColor]): Changed to
@@ -335,7 +7797,7 @@
2008-01-03 Alexey Proskuryakov <ap@webkit.org>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
<rdar://problem/5463489> A number of layout tests should be using execCommand instead of textInputController
@@ -346,7 +7808,7 @@
2008-01-03 Kevin Decker <kdecker@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Fixed: <rdar://problem/4106190> Include "Where from" metadata in drag-and-dropped images
@@ -359,7 +7821,7 @@
2008-01-03 Alice Liu <alice.liu@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
This fixes pageup/down in iframes. test for this is fast/frames/iframe-scroll-page-up-down.html
@@ -370,7 +7832,7 @@
2008-01-02 Kevin Decker <kdecker@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Fixed: <rdar://problem/5660603> QuickDraw plug-ins can cause a 100% reproducible assertion failure in AppKit (breaks Safari UI)
@@ -464,7 +7926,7 @@
2007-12-16 Alexey Proskuryakov <ap@webkit.org>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
http://bugs.webkit.org/show_bug.cgi?id=14140
<rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly
@@ -480,7 +7942,7 @@
<rdar://problem/5647272> Remove user agent string hack for flickr.com
- Reviewed by Darin.
+ Reviewed by Darin Adler.
* WebView/WebView.mm:
(-[WebView _userAgentForURL:]): Removed hack.
@@ -489,7 +7951,7 @@
<rdar://problem/5647261> Remove user agent string hack for yahoo.com
- Reviewed by Darin.
+ Reviewed by Darin Adler.
* WebView/WebView.mm:
(-[WebView _userAgentForURL:]): Removed hack.
@@ -549,7 +8011,7 @@
2007-12-13 Alexey Proskuryakov <ap@webkit.org>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Turn on keyboard event processing quirks for feed views and old applications on Mac OS X.
@@ -631,7 +8093,7 @@
2007-12-07 Alexey Proskuryakov <ap@webkit.org>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
<rdar://problem/5535636>
Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard.
@@ -685,7 +8147,7 @@
2007-12-10 Kevin Decker <kdecker@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Fixed: <rdar://problem/4290098> Right-mouse click on element doesn't call onmousedown handler
@@ -791,7 +8253,7 @@
2007-12-04 Kevin McCullough <kmccullough@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
- <rdar://5621435>
- Security Fix. Instead of having it off by default, WebKit now must
@@ -874,7 +8336,7 @@
2007-12-04 Kevin Decker <kdecker@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Revised fix for: <rdar://problem/5586978> REGRESSION (Safari 2-3): WebKit sometimes doesn't invoke Flash's NPP_SetWindow function and causes a hang
@@ -915,7 +8377,7 @@
2007-12-03 Timothy Hatcher <timothy@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Change WebViewGetResourceLoadDelegateImplementations and WebViewGetFrameLoadDelegateImplementations
to return a pointer to the implementation struct instead of a copy of the struct. This changes
@@ -1090,7 +8552,7 @@
2007-11-28 Adele Peterson <adele@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Fix for <rdar://problem/5524216> CrashTracer: [USER] 496 crashes in Safari at com.apple.WebCore: WebCore::Frame::eventHandler const + 6
@@ -1373,7 +8835,7 @@
2007-11-17 Alexey Proskuryakov <ap@webkit.org>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
http://bugs.webkit.org/show_bug.cgi?id=15969
Eliminate Editor::deleteRange()
@@ -1513,7 +8975,7 @@
2007-11-13 John Sullivan <sullivan@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
removed recently-added PreferredType concept; we found a better way to do what
ths was accomplishing
@@ -1536,7 +8998,7 @@
2007-11-12 Josh Aas <joshmoz@gmail.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
- http://bugs.webkit.org/show_bug.cgi?id=15946
add NPPValue NPPVpluginDrawingModel (Mozilla bug 403418 compat)
@@ -1546,7 +9008,7 @@
2007-11-12 Alexey Proskuryakov <ap@webkit.org>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
http://bugs.webkit.org/show_bug.cgi?id=15954
Move DOM Selection operations out of SelectionController
@@ -1673,7 +9135,7 @@
2007-11-06 Alexey Proskuryakov <ap@webkit.org>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
http://bugs.webkit.org/show_bug.cgi?id=15847
Some editing cleanup
@@ -1740,13 +9202,13 @@
Sort files(...); sections of Xcode project files.
- Rubber-stamped by Darin.
+ Rubber-stamped by Darin Adler.
* WebKit.xcodeproj/project.pbxproj:
2007-11-02 Antti Koivisto <antti@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Add method to enable video composition.
@@ -1842,7 +9304,7 @@
Generated files missing from WebCore's Xcode project file
<http://bugs.webkit.org/show_bug.cgi?id=15406>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Added the following private header files to MigrateHeaders.make:
@@ -1917,7 +9379,7 @@
2007-10-30 Adele Peterson <adele@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=10577
<rdar://problem/5103625> REGRESSION: Caps lock icon should show in password fields
@@ -1929,7 +9391,7 @@
2007-10-27 Mark Ambachtsheer <mark.a@apple.com>
- Reviewed by Darin.
+ Reviewed by Darin Adler.
Fix for bug 15710, When QD plugins draw to an offscreen bitmap and the plugin is not at
(0, 0) the clipping rectangle is not correct.
diff --git a/WebKit/mac/Configurations/Base.xcconfig b/WebKit/mac/Configurations/Base.xcconfig
index ad1ad95..52c224b 100644
--- a/WebKit/mac/Configurations/Base.xcconfig
+++ b/WebKit/mac/Configurations/Base.xcconfig
@@ -10,10 +10,11 @@ GCC_ENABLE_OBJC_GC = supported;
GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_OBJC_DISPATCH = YES;
GCC_MODEL_TUNING = G5;
-GCC_OPTIMIZATION_LEVEL = 2;
+GCC_OBJC_CALL_CXX_CDTORS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_THREADSAFE_STATICS = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
@@ -24,10 +25,27 @@ VALID_ARCHS = i386 ppc x86_64 ppc64;
WARNING_CFLAGS = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wundef;
+// DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL and STRIP_INSTALLED_PRODUCT 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;
+DEBUG_DEFINES_normal = NDEBUG;
+DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT));
+
+GCC_OPTIMIZATION_LEVEL = $(GCC_OPTIMIZATION_LEVEL_$(CURRENT_VARIANT));
+GCC_OPTIMIZATION_LEVEL_normal = 2;
+GCC_OPTIMIZATION_LEVEL_debug = 0;
+
+STRIP_INSTALLED_PRODUCT = $(STRIP_INSTALLED_PRODUCT_$(CURRENT_VARIANT));
+STRIP_INSTALLED_PRODUCT_normal = YES;
+STRIP_INSTALLED_PRODUCT_debug = NO;
+
+
// <rdar://problem/5488678>: Production builds on 10.4 PowerPC need to have debugging symbols disabled to prevent a huge STABS section being generated.
// Xcode on 10.4 does not define MAC_OS_X_VERSION_MAJOR, so the default Mac OS X version is treated as 10.4.
GCC_GENERATE_DEBUGGING_SYMBOLS = $(GCC_GENERATE_DEBUGGING_SYMBOLS_$(CURRENT_ARCH));
GCC_GENERATE_DEBUGGING_SYMBOLS_i386 = YES;
+GCC_GENERATE_DEBUGGING_SYMBOLS_x86_64 = YES;
+GCC_GENERATE_DEBUGGING_SYMBOLS_ppc64 = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS_ppc = $(GCC_GENERATE_DEBUGGING_SYMBOLS_$(CURRENT_ARCH)_$(CONFIGURATION));
GCC_GENERATE_DEBUGGING_SYMBOLS_ppc_Debug = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS_ppc_Release = YES;
diff --git a/WebKit/mac/Configurations/DebugRelease.xcconfig b/WebKit/mac/Configurations/DebugRelease.xcconfig
index 96ba3a2..55b489f 100644
--- a/WebKit/mac/Configurations/DebugRelease.xcconfig
+++ b/WebKit/mac/Configurations/DebugRelease.xcconfig
@@ -1,9 +1,20 @@
#include "Base.xcconfig"
+ARCHS = $(NATIVE_ARCH);
+
MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR));
MACOSX_DEPLOYMENT_TARGET_ = 10.4;
MACOSX_DEPLOYMENT_TARGET_1040 = 10.4;
MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
+MACOSX_DEPLOYMENT_TARGET_1060 = 10.6;
+
+GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
+
+GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL));
+GCC_VERSION_0310 = 4.2;
+GCC_VERSION_0311 = 4.2;
+
WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(MAC_OS_X_VERSION_MAJOR));
WEBKIT_SYSTEM_INTERFACE_LIBRARY_ = WebKitSystemInterfaceTiger;
WEBKIT_SYSTEM_INTERFACE_LIBRARY_1040 = WebKitSystemInterfaceTiger;
WEBKIT_SYSTEM_INTERFACE_LIBRARY_1050 = WebKitSystemInterfaceLeopard;
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_1060 = WebKitSystemInterfaceLeopard;
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index 639116d..16698b9 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -1,14 +1,11 @@
-MAJOR_VERSION = 525;
-MINOR_VERSION = 10;
+MAJOR_VERSION = 528;
+MINOR_VERSION = 5;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
-// The bundle version is set based on the current build configuration, see below.
+// The bundle version and short version string are set based on the current build configuration, see below.
BUNDLE_VERSION = $(BUNDLE_VERSION_$(CONFIGURATION));
-
-// The local builds are always just the major version with a Plus suffix.
-BUNDLE_VERSION_Release = $(FULL_VERSION)+;
-BUNDLE_VERSION_Debug = $(BUNDLE_VERSION_Release);
+SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION))
// The system version prefix is based on the current system version.
SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR));
@@ -19,9 +16,19 @@ SYSTEM_VERSION_PREFIX_1060 = 6;
// The production build always uses the full version with a system version prefix.
BUNDLE_VERSION_Production = $(SYSTEM_VERSION_PREFIX)$(FULL_VERSION);
-
-// If $(CONFIGURATION) is undefined, use the Production version.
BUNDLE_VERSION_ = $(BUNDLE_VERSION_Production);
+// The production build always uses the major version with a system version prefix
+SHORT_VERSION_STRING_Production = $(SYSTEM_VERSION_PREFIX)$(MAJOR_VERSION);
+SHORT_VERSION_STRING_ = $(SHORT_VERSION_STRING_Production);
+
+// Local builds are the full version with a plus suffix.
+BUNDLE_VERSION_Release = $(FULL_VERSION)+;
+BUNDLE_VERSION_Debug = $(BUNDLE_VERSION_Release);
+
+// Local builds use the major version with a plus suffix
+SHORT_VERSION_STRING_Release = $(MAJOR_VERSION)+;
+SHORT_VERSION_STRING_Debug = $(SHORT_VERSION_STRING_Release);
+
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = $(FULL_VERSION);
diff --git a/WebKit/mac/Configurations/WebKit.xcconfig b/WebKit/mac/Configurations/WebKit.xcconfig
index 1f26dae..8deb186 100644
--- a/WebKit/mac/Configurations/WebKit.xcconfig
+++ b/WebKit/mac/Configurations/WebKit.xcconfig
@@ -5,11 +5,10 @@ EXPORTED_SYMBOLS_FILE_i386 = mac/WebKit.exp;
EXPORTED_SYMBOLS_FILE_ppc = mac/WebKit.exp;
EXPORTED_SYMBOLS_FILE_ppc64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/WebKit.LP64.exp;
EXPORTED_SYMBOLS_FILE_x86_64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/WebKit.LP64.exp;
-FEATURE_DEFINES = ENABLE_DATABASE ENABLE_ICONDATABASE ENABLE_SVG ENABLE_SVG_FONTS ENABLE_SVG_AS_IMAGE ENABLE_SVG_USE ENABLE_XPATH ENABLE_XSLT;
FRAMEWORK_SEARCH_PATHS = $(UMBRELLA_FRAMEWORKS_DIR) $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(FRAMEWORK_SEARCH_PATHS);
GCC_PREFIX_HEADER = mac/WebKitPrefix.h;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) FRAMEWORK_NAME=WebKit $(GCC_PREPROCESSOR_DEFINITIONS);
-HEADER_SEARCH_PATHS = mac/ForwardingHeaders mac/icu "${BUILT_PRODUCTS_DIR}/usr/local/include" "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit" $(HEADER_SEARCH_PATHS);
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) FRAMEWORK_NAME=WebKit WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST $(GCC_PREPROCESSOR_DEFINITIONS);
+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;
@@ -17,3 +16,6 @@ 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_WORKER_THREADS ENABLE_XPATH ENABLE_XSLT;
diff --git a/WebKit/mac/DOM/WebDOMOperations.mm b/WebKit/mac/DOM/WebDOMOperations.mm
index ace21c3..5ef92f1 100644
--- a/WebKit/mac/DOM/WebDOMOperations.mm
+++ b/WebKit/mac/DOM/WebDOMOperations.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,69 +26,57 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebDOMOperationsPrivate.h>
-
+#import "WebDOMOperationsPrivate.h"
+
+#import "DOMNodeInternal.h"
+#import "DOMRangeInternal.h"
+#import "WebArchiveInternal.h"
+#import "WebDataSourcePrivate.h"
+#import "WebFrameInternal.h"
+#import "WebFramePrivate.h"
+#import "WebKitNSStringExtras.h"
+#import <WebCore/CSSHelper.h>
+#import <WebCore/Document.h>
+#import <WebCore/LegacyWebArchive.h>
+#import <WebCore/markup.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMHTML.h>
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebDataSourcePrivate.h>
-#import <WebKit/WebFramePrivate.h>
-#import <WebKit/WebKitNSStringExtras.h>
-#import <WebKit/WebArchiver.h>
+#import <wtf/Assertions.h>
#if ENABLE(SVG)
#import <WebKit/DOMSVG.h>
#endif
-@implementation DOMNode (WebDOMNodeOperations)
+using namespace WebCore;
-- (WebFrameBridge *)_bridge
-{
- return (WebFrameBridge *)[WebFrameBridge bridgeForDOMDocument:[self ownerDocument]];
-}
+@implementation DOMNode (WebDOMNodeOperations)
- (WebArchive *)webArchive
{
- return [WebArchiver archiveNode:self];
+ return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create([self _node])] autorelease];
}
- (NSString *)markupString
{
- return [[self _bridge] markupStringFromNode:self nodes:nil];
+ return createFullMarkup([self _node]);
}
-- (NSArray *)_URLsFromSelectors:(SEL)firstSel, ...
-{
- NSMutableArray *URLs = [NSMutableArray array];
-
- va_list args;
- va_start(args, firstSel);
-
- SEL selector = firstSel;
- do {
-#if ENABLE(SVG)
- NSString *string;
- id attributeValue = [self performSelector:selector];
- if ([attributeValue isKindOfClass:[DOMSVGAnimatedString class]])
- string = [(DOMSVGAnimatedString*)attributeValue animVal];
- else
- string = attributeValue;
-#else
- NSString *string = [self performSelector:selector];
-#endif
- if ([string length] > 0)
- [URLs addObject:[[self ownerDocument] URLWithAttributeString:string]];
- } while ((selector = va_arg(args, SEL)) != nil);
-
- va_end(args);
-
- return URLs;
-}
+@end
+
+@implementation DOMNode (WebDOMNodeOperationsPrivate)
- (NSArray *)_subresourceURLs
{
- return nil;
+ Vector<KURL> urls;
+ [self _node]->getSubresourceURLs(urls);
+ if (!urls.size())
+ return nil;
+
+ NSMutableArray *array = [NSMutableArray arrayWithCapacity:urls.size()];
+ for (unsigned i = 0; i < urls.size(); ++i)
+ [array addObject:(NSURL *)urls[i]];
+
+ return array;
}
@end
@@ -97,12 +85,17 @@
- (WebFrame *)webFrame
{
- return [[self _bridge] webFrame];
+ Document* document = core(self);
+ Frame* frame = document->frame();
+ if (!frame)
+ return nil;
+ return kit(frame);
}
- (NSURL *)URLWithAttributeString:(NSString *)string
{
- return [[self _bridge] URLWithAttributeString:string];
+ // FIXME: Is parseURL appropriate here?
+ return core(self)->completeURL(parseURL(string));
}
@end
@@ -125,190 +118,14 @@
@implementation DOMRange (WebDOMRangeOperations)
-- (WebFrameBridge *)_bridge
-{
- return [[self startContainer] _bridge];
-}
-
- (WebArchive *)webArchive
{
- return [WebArchiver archiveRange:self];
+ return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create([self _range])] autorelease];
}
- (NSString *)markupString
{
- return [[self _bridge] markupStringFromRange:self nodes:nil];
-}
-
-@end
-
-@implementation DOMHTMLBodyElement (WebDOMHTMLBodyElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(background), nil];
-}
-
-@end
-
-@implementation DOMHTMLInputElement (WebDOMHTMLInputElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(src), nil];
-}
-
-@end
-
-@implementation DOMHTMLLinkElement (WebDOMHTMLLinkElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- NSString *relName = [self rel];
- if ([relName _webkit_isCaseInsensitiveEqualToString:@"stylesheet"] || [relName _webkit_isCaseInsensitiveEqualToString:@"icon"]) {
- return [self _URLsFromSelectors:@selector(href), nil];
- }
- return nil;
-}
-
-@end
-
-@implementation DOMHTMLScriptElement (WebDOMHTMLScriptElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(src), nil];
-}
-
-@end
-
-@implementation DOMHTMLImageElement (WebDOMHTMLImageElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- SEL useMapSelector = [[self useMap] hasPrefix:@"#"] ? nil : @selector(useMap);
- return [self _URLsFromSelectors:@selector(src), useMapSelector, nil];
-}
-
-@end
-
-#if ENABLE(SVG)
-
-@implementation DOMSVGImageElement (WebDOMSVGImageElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(href), nil];
-}
-
-@end
-
-@implementation DOMSVGScriptElement (WebDOMSVGScriptElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(href), nil];
-}
-
-@end
-
-@implementation DOMSVGCursorElement (WebDOMSVGCursorElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(href), nil];
-}
-
-@end
-
-#if ENABLE(SVG_FILTERS)
-@implementation DOMSVGFEImageElement (WebDOMSVGFEImageElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(href), nil];
-}
-
-@end
-#endif
-
-#endif
-
-@implementation DOMProcessingInstruction (WebDOMProcessingInstructionOperationsPrivate)
-
-- (NSString *)_stylesheetURL
-{
- DOMStyleSheet *styleSheet = [self sheet];
- if (styleSheet)
- return [styleSheet href];
- return nil;
-}
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(_stylesheetURL), nil];
-}
-
-@end
-
-@implementation DOMHTMLEmbedElement (WebDOMHTMLEmbedElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(src), nil];
-}
-
-@end
-
-@implementation DOMHTMLObjectElement (WebDOMHTMLObjectElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- SEL useMapSelector = [[self useMap] hasPrefix:@"#"] ? nil : @selector(useMap);
- return [self _URLsFromSelectors:@selector(data), useMapSelector, nil];
-}
-
-@end
-
-@implementation DOMHTMLParamElement (WebDOMHTMLParamElementOperationsPrivate)
-
-- (NSArray *)_subresourceURLs
-{
- NSString *paramName = [self name];
- if ([paramName _webkit_isCaseInsensitiveEqualToString:@"data"] ||
- [paramName _webkit_isCaseInsensitiveEqualToString:@"movie"] ||
- [paramName _webkit_isCaseInsensitiveEqualToString:@"src"]) {
- return [self _URLsFromSelectors:@selector(value), nil];
- }
- return nil;
-}
-
-@end
-
-@implementation DOMHTMLTableElement (WebDOMHTMLTableElementOperationsPrivate)
-
-- (NSString *)_web_background
-{
- return [self getAttribute:@"background"];
-}
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(_web_background), nil];
-}
-
-@end
-
-@implementation DOMHTMLTableCellElement (WebDOMHTMLTableCellElementOperationsPrivate)
-
-- (NSString *)_web_background
-{
- return [self getAttribute:@"background"];
-}
-
-- (NSArray *)_subresourceURLs
-{
- return [self _URLsFromSelectors:@selector(_web_background), nil];
+ return createFullMarkup([self _range]);
}
@end
diff --git a/WebKit/mac/DOM/WebDOMOperationsPrivate.h b/WebKit/mac/DOM/WebDOMOperationsPrivate.h
index a16eee8..19b8a7d 100644
--- a/WebKit/mac/DOM/WebDOMOperationsPrivate.h
+++ b/WebKit/mac/DOM/WebDOMOperationsPrivate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,20 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-@class WebFrameBridge;
-
#import <WebKit/WebDOMOperations.h>
@interface DOMNode (WebDOMNodeOperationsPrivate)
-- (WebFrameBridge *)_bridge;
-- (NSArray *)_URLsFromSelectors:(SEL)firstSel, ...;
- (NSArray *)_subresourceURLs;
@end
-@interface DOMRange (WebDOMRangeOperationsPrivate)
-- (WebFrameBridge *)_bridge;
-@end
-
@interface DOMDocument (WebDOMDocumentOperationsPrivate)
- (DOMRange *)_createRangeWithNode:(DOMNode *)node;
- (DOMRange *)_documentRange;
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm b/WebKit/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
index 1624856..2ee7d8b 100644
--- a/WebKit/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
+++ b/WebKit/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
@@ -31,7 +31,6 @@
#import "WebDOMOperations.h"
#import "WebDataSourcePrivate.h"
#import "WebDefaultUIDelegate.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebFrameView.h"
#import "WebHTMLViewPrivate.h"
@@ -44,14 +43,12 @@
#import "WebViewInternal.h"
#import <Foundation/NSURLConnection.h>
#import <Foundation/NSURLRequest.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebCore/Editor.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
-#import <WebCore/KURL.h>
-#import <WebCore/WebCoreFrameBridge.h>
#import <WebKit/DOM.h>
#import <WebKit/DOMPrivate.h>
+#import <wtf/Assertions.h>
@implementation WebDefaultUIDelegate (WebContextMenu)
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m
index 95502da..c832993 100644
--- a/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m
+++ b/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,18 +26,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebDataSource.h>
-#import <WebKit/WebDefaultPolicyDelegate.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebPolicyDelegatePrivate.h>
-#import <WebKit/WebView.h>
-#import <WebKit/WebViewPrivate.h>
+#import "WebDefaultPolicyDelegate.h"
+#import "WebDataSource.h"
+#import "WebFrame.h"
+#import "WebPolicyDelegatePrivate.h"
+#import "WebViewInternal.h"
#import <Foundation/NSURLConnection.h>
#import <Foundation/NSURLRequest.h>
#import <Foundation/NSURLResponse.h>
-#import <JavaScriptCore/Assertions.h>
-
+#import <wtf/Assertions.h>
@implementation WebDefaultPolicyDelegate
@@ -85,7 +83,7 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
{
WebNavigationType navType = [[actionInformation objectForKey:WebActionNavigationTypeKey] intValue];
- if ([WebView _canHandleRequest:request]) {
+ if ([WebView _canHandleRequest:request forMainFrame:frame == [wv mainFrame]]) {
[listener use];
} else if (navType == WebNavigationTypePlugInRequest) {
[listener use];
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m
index 972f013..2ba9291 100644
--- a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m
+++ b/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m
@@ -29,6 +29,7 @@
#import <WebKit/WebScriptDebugDelegate.h>
#import "WebDefaultScriptDebugDelegate.h"
+#import "WebTypesInternal.h"
@implementation WebDefaultScriptDebugDelegate
@@ -50,7 +51,7 @@ static WebDefaultScriptDebugDelegate *sharedDelegate = nil;
}
- (void)webView:(WebView *)webView didParseSource:(NSString *)source
- baseLineNumber:(unsigned)lineNumber
+ baseLineNumber:(NSUInteger)lineNumber
fromURL:(NSURL *)url
sourceId:(int)sid
forWebFrame:(WebFrame *)webFrame
@@ -58,7 +59,7 @@ static WebDefaultScriptDebugDelegate *sharedDelegate = nil;
}
- (void)webView:(WebView *)webView failedToParseSource:(NSString *)source
- baseLineNumber:(unsigned)lineNumber
+ baseLineNumber:(NSUInteger)lineNumber
fromURL:(NSURL *)url
withError:(NSError *)error
forWebFrame:(WebFrame *)webFrame
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m
index 8cc8445..aa5df4a 100644
--- a/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m
+++ b/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m
@@ -35,6 +35,7 @@
#import <WebKit/WebView.h>
#import <WebKit/WebUIDelegatePrivate.h>
#import <WebKit/DOM.h>
+#import "WebTypesInternal.h"
@interface NSApplication (DeclarationStolenFromAppKit)
- (void)_cycleWindowsReversed:(BOOL)reversed;
@@ -87,7 +88,7 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
}
}
-- (NSResponder *)webViewFirstResponder: (WebView *)wv;
+- (NSResponder *)webViewFirstResponder: (WebView *)wv
{
return [[wv window] firstResponder];
}
@@ -106,7 +107,7 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
return nil;
}
-- (void)webView: (WebView *)wv mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(unsigned int)modifierFlags
+- (void)webView: (WebView *)wv mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(NSUInteger)modifierFlags
{
}
@@ -192,7 +193,7 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
return YES;
}
-- (unsigned)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
+- (NSUInteger)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
{
return WebDragDestinationActionAny;
}
@@ -201,7 +202,7 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
{
}
-- (unsigned)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point;
+- (NSUInteger)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point;
{
return WebDragSourceActionAny;
}
@@ -226,4 +227,14 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
{
}
+- (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename
+{
+ return NO;
+}
+
+- (NSString *)webView:(WebView *)sender generateReplacementFile:(NSString *)path
+{
+ return nil;
+}
+
@end
diff --git a/WebKit/mac/DefaultDelegates/WebScriptDebugServer.h b/WebKit/mac/DefaultDelegates/WebScriptDebugServer.h
deleted file mode 100644
index ae93b7b..0000000
--- a/WebKit/mac/DefaultDelegates/WebScriptDebugServer.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2006 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 "WebScriptDebugDelegate.h"
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
-#define WebNSUInteger unsigned int
-#else
-#define WebNSUInteger NSUInteger
-#endif
-
-extern NSString *WebScriptDebugServerProcessNameKey;
-extern NSString *WebScriptDebugServerProcessBundleIdentifierKey;
-extern NSString *WebScriptDebugServerProcessIdentifierKey;
-
-extern NSString *WebScriptDebugServerQueryNotification;
-extern NSString *WebScriptDebugServerQueryReplyNotification;
-
-extern NSString *WebScriptDebugServerDidLoadNotification;
-extern NSString *WebScriptDebugServerWillUnloadNotification;
-
-@class WebDataSource;
-
-@protocol WebScriptDebugListener <NSObject>
-- (void)webView:(WebView *)webView didLoadMainResourceForDataSource:(WebDataSource *)dataSource;
-
-- (void)webView:(WebView *)webView didParseSource:(NSString *)source
- baseLineNumber:(WebNSUInteger)lineNumber
- fromURL:(NSURL *)url
- sourceId:(int)sid
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView failedToParseSource:(NSString *)source
- baseLineNumber:(WebNSUInteger)lineNumber
- fromURL:(NSURL *)url
- withError:(NSError *)error
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView didEnterCallFrame:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView willExecuteStatement:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView willLeaveCallFrame:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame;
-@end
-
-@protocol WebScriptDebugServer <NSObject>
-- (oneway void)addListener:(id<WebScriptDebugListener>)listener;
-- (oneway void)removeListener:(id<WebScriptDebugListener>)listener;
-- (oneway void)step;
-- (oneway void)pause;
-- (oneway void)resume;
-- (oneway BOOL)isPaused;
-@end
-
-#undef WebNSUInteger
diff --git a/WebKit/mac/DefaultDelegates/WebScriptDebugServer.m b/WebKit/mac/DefaultDelegates/WebScriptDebugServer.m
deleted file mode 100644
index 2cd0e8f..0000000
--- a/WebKit/mac/DefaultDelegates/WebScriptDebugServer.m
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (C) 2006, 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 "WebScriptDebugServer.h"
-#import "WebScriptDebugServerPrivate.h"
-#import "WebViewInternal.h"
-
-#import <JavaScriptCore/Assertions.h>
-
-NSString *WebScriptDebugServerProcessNameKey = @"WebScriptDebugServerProcessNameKey";
-NSString *WebScriptDebugServerProcessBundleIdentifierKey = @"WebScriptDebugServerProcessBundleIdentifierKey";
-NSString *WebScriptDebugServerProcessIdentifierKey = @"WebScriptDebugServerProcessIdentifierKey";
-
-NSString *WebScriptDebugServerQueryNotification = @"WebScriptDebugServerQueryNotification";
-NSString *WebScriptDebugServerQueryReplyNotification = @"WebScriptDebugServerQueryReplyNotification";
-
-NSString *WebScriptDebugServerDidLoadNotification = @"WebScriptDebugServerDidLoadNotification";
-NSString *WebScriptDebugServerWillUnloadNotification = @"WebScriptDebugServerWillUnloadNotification";
-
-@implementation WebScriptDebugServer
-
-static WebScriptDebugServer *sharedServer = nil;
-static unsigned listenerCount = 0;
-
-+ (WebScriptDebugServer *)sharedScriptDebugServer
-{
- if (!sharedServer)
- sharedServer = [[WebScriptDebugServer alloc] init];
- return sharedServer;
-}
-
-+ (unsigned)listenerCount
-{
- return listenerCount;
-}
-
-- (id)init
-{
- self = [super init];
-
- NSProcessInfo *processInfo = [NSProcessInfo processInfo];
- serverName = [[NSString alloc] initWithFormat:@"WebScriptDebugServer-%@-%d", [processInfo processName], [processInfo processIdentifier]];
-
- serverConnection = [[NSConnection alloc] init];
- if ([serverConnection registerName:serverName]) {
- [serverConnection setRootObject:self];
- NSProcessInfo *processInfo = [NSProcessInfo processInfo];
- NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:[processInfo processName], WebScriptDebugServerProcessNameKey,
- [[NSBundle mainBundle] bundleIdentifier], WebScriptDebugServerProcessBundleIdentifierKey,
- [NSNumber numberWithInt:[processInfo processIdentifier]], WebScriptDebugServerProcessIdentifierKey, nil];
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:WebScriptDebugServerDidLoadNotification object:serverName userInfo:info];
- [info release];
- } else {
- [serverConnection release];
- serverConnection = nil;
- }
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationTerminating:) name:NSApplicationWillTerminateNotification object:nil];
- [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(serverQuery:) name:WebScriptDebugServerQueryNotification object:nil];
-
- listeners = [[NSMutableSet alloc] init];
-
- return self;
-}
-
-- (void)dealloc
-{
- // FIXME: Bad to do all this work in dealloc. What about under GC?
-
- ASSERT(listenerCount >= [listeners count]);
- listenerCount -= [listeners count];
- if (!listenerCount)
- [self detachScriptDebuggerFromAllWebViews];
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillTerminateNotification object:nil];
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:WebScriptDebugServerQueryNotification object:nil];
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:WebScriptDebugServerWillUnloadNotification object:serverName];
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSConnectionDidDieNotification object:nil];
- [serverConnection invalidate];
- [serverConnection release];
- [serverName release];
- [listeners release];
- [super dealloc];
-}
-
-- (void)applicationTerminating:(NSNotification *)notifiction
-{
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:WebScriptDebugServerWillUnloadNotification object:serverName];
-}
-
-- (void)attachScriptDebuggerToAllWebViews
-{
- [WebView _makeAllWebViewsPerformSelector:@selector(_attachScriptDebuggerToAllFrames)];
-}
-
-- (void)detachScriptDebuggerFromAllWebViews
-{
- [WebView _makeAllWebViewsPerformSelector:@selector(_detachScriptDebuggerFromAllFrames)];
-}
-
-- (void)serverQuery:(NSNotification *)notification
-{
- NSProcessInfo *processInfo = [NSProcessInfo processInfo];
- NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:[processInfo processName], WebScriptDebugServerProcessNameKey,
- [[NSBundle mainBundle] bundleIdentifier], WebScriptDebugServerProcessBundleIdentifierKey,
- [NSNumber numberWithInt:[processInfo processIdentifier]], WebScriptDebugServerProcessIdentifierKey, nil];
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:WebScriptDebugServerQueryReplyNotification object:serverName userInfo:info];
- [info release];
-}
-
-- (void)listenerConnectionDidDie:(NSNotification *)notification
-{
- NSConnection *connection = [notification object];
- NSMutableSet *listenersToRemove = [[NSMutableSet alloc] initWithCapacity:[listeners count]];
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject *listener = nil;
-
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSConnectionDidDieNotification object:connection];
-
- while ((listener = [enumerator nextObject]))
- if ([[listener connectionForProxy] isEqualTo:connection])
- [listenersToRemove addObject:listener];
-
- ASSERT(listenerCount >= [listenersToRemove count]);
- listenerCount -= [listenersToRemove count];
- [listeners minusSet:listenersToRemove];
- [listenersToRemove release];
-
- if (!listenerCount)
- [self detachScriptDebuggerFromAllWebViews];
-}
-
-- (oneway void)addListener:(id<WebScriptDebugListener>)listener
-{
- // can't use isKindOfClass: here because that will send over the wire and not check the proxy object
- if (!listener || [listener class] != [NSDistantObject class] || ![listener conformsToProtocol:@protocol(WebScriptDebugListener)])
- return;
- listenerCount++;
- [listeners addObject:listener];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(listenerConnectionDidDie:) name:NSConnectionDidDieNotification object:[(NSDistantObject *)listener connectionForProxy]];
- if (listenerCount == 1)
- [self attachScriptDebuggerToAllWebViews];
-}
-
-- (oneway void)removeListener:(id<WebScriptDebugListener>)listener
-{
- if (!listener || ![listeners containsObject:listener])
- return;
- ASSERT(listenerCount >= 1);
- listenerCount--;
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSConnectionDidDieNotification object:[(NSDistantObject *)listener connectionForProxy]];
- [listeners removeObject:listener];
- if (!listenerCount)
- [self detachScriptDebuggerFromAllWebViews];
-}
-
-- (oneway void)step
-{
- step = YES;
- paused = NO;
-}
-
-- (oneway void)pause
-{
- paused = YES;
- step = NO;
-}
-
-- (oneway void)resume
-{
- paused = NO;
- step = NO;
-}
-
-- (oneway BOOL)isPaused
-{
- return paused;
-}
-
-- (void)suspendProcessIfPaused
-{
- static BOOL alreadyHere = NO;
-
- if (alreadyHere)
- return;
-
- alreadyHere = YES;
-
- // this method will suspend this process when called during the dubugging callbacks
- // we need to do this to implement breakpoints and pausing of JavaScript
-
- while (paused)
- [[NSRunLoop currentRunLoop] runMode:NSConnectionReplyMode beforeDate:[NSDate distantFuture]];
-
- if (step) {
- step = NO;
- paused = YES;
- }
-
- alreadyHere = NO;
-}
-
-- (void)webView:(WebView *)webView didLoadMainResourceForDataSource:(WebDataSource *)dataSource
-{
- if (![listeners count] || inCallback)
- return;
-
- inCallback = YES;
-
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject <WebScriptDebugListener> *listener = nil;
-
- while ((listener = [enumerator nextObject])) {
- if ([[listener connectionForProxy] isValid])
- [listener webView:webView didLoadMainResourceForDataSource:dataSource];
- }
-
- inCallback = NO;
-}
-
-- (void)webView:(WebView *)webView didParseSource:(NSString *)source
- baseLineNumber:(NSUInteger)lineNumber
- fromURL:(NSURL *)url
- sourceId:(int)sid
- forWebFrame:(WebFrame *)webFrame
-{
- if (![listeners count] || inCallback)
- return;
-
- inCallback = YES;
-
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject <WebScriptDebugListener> *listener = nil;
-
- while ((listener = [enumerator nextObject])) {
- if ([[listener connectionForProxy] isValid])
- [listener webView:webView didParseSource:source baseLineNumber:lineNumber fromURL:url sourceId:sid forWebFrame:webFrame];
- }
-
- inCallback = NO;
-}
-
-- (void)webView:(WebView *)webView failedToParseSource:(NSString *)source
- baseLineNumber:(NSUInteger)lineNumber
- fromURL:(NSURL *)url
- withError:(NSError *)error
- forWebFrame:(WebFrame *)webFrame
-{
- if (![listeners count] || inCallback)
- return;
-
- inCallback = YES;
-
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject <WebScriptDebugListener> *listener = nil;
-
- while ((listener = [enumerator nextObject])) {
- if ([[listener connectionForProxy] isValid])
- [listener webView:webView failedToParseSource:source baseLineNumber:lineNumber fromURL:url withError:error forWebFrame:webFrame];
- }
-
- inCallback = NO;
-}
-
-- (void)webView:(WebView *)webView didEnterCallFrame:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
- if (![listeners count] || inCallback)
- return;
-
- inCallback = YES;
-
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject <WebScriptDebugListener> *listener = nil;
-
- while ((listener = [enumerator nextObject])) {
- if ([[listener connectionForProxy] isValid])
- [listener webView:webView didEnterCallFrame:frame sourceId:sid line:lineno forWebFrame:webFrame];
- }
-
- [self suspendProcessIfPaused];
-
- inCallback = NO;
-}
-
-- (void)webView:(WebView *)webView willExecuteStatement:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
- if (![listeners count] || inCallback)
- return;
-
- inCallback = YES;
-
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject <WebScriptDebugListener> *listener = nil;
-
- while ((listener = [enumerator nextObject])) {
- if ([[listener connectionForProxy] isValid])
- [listener webView:webView willExecuteStatement:frame sourceId:sid line:lineno forWebFrame:webFrame];
- }
-
- [self suspendProcessIfPaused];
-
- inCallback = NO;
-}
-
-- (void)webView:(WebView *)webView willLeaveCallFrame:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
- if (![listeners count] || inCallback)
- return;
-
- inCallback = YES;
-
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject <WebScriptDebugListener> *listener = nil;
-
- while ((listener = [enumerator nextObject])) {
- if ([[listener connectionForProxy] isValid])
- [listener webView:webView willLeaveCallFrame:frame sourceId:sid line:lineno forWebFrame:webFrame];
- }
-
- [self suspendProcessIfPaused];
-
- inCallback = NO;
-}
-
-- (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame
-{
- if (![listeners count] || inCallback)
- return;
-
- inCallback = YES;
-
- NSEnumerator *enumerator = [listeners objectEnumerator];
- NSDistantObject <WebScriptDebugListener> *listener = nil;
-
- while ((listener = [enumerator nextObject])) {
- if ([[listener connectionForProxy] isValid])
- [listener webView:webView exceptionWasRaised:frame sourceId:sid line:lineno forWebFrame:webFrame];
- }
-
- [self suspendProcessIfPaused];
-
- inCallback = NO;
-}
-
-@end
diff --git a/WebKit/mac/DefaultDelegates/WebScriptDebugServerPrivate.h b/WebKit/mac/DefaultDelegates/WebScriptDebugServerPrivate.h
deleted file mode 100644
index 081d3a9..0000000
--- a/WebKit/mac/DefaultDelegates/WebScriptDebugServerPrivate.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2006 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 "WebScriptDebugServer.h"
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
-#define WebNSUInteger unsigned int
-#else
-#define WebNSUInteger NSUInteger
-#endif
-
-@interface WebScriptDebugServer : NSObject <WebScriptDebugServer> {
-@private
- NSConnection *serverConnection;
- NSString *serverName;
- NSMutableSet *listeners;
- BOOL inCallback;
- BOOL paused;
- BOOL step;
-}
-+ (WebScriptDebugServer *)sharedScriptDebugServer;
-+ (unsigned)listenerCount;
-
-- (void)attachScriptDebuggerToAllWebViews;
-- (void)detachScriptDebuggerFromAllWebViews;
-
-- (void)webView:(WebView *)webView didLoadMainResourceForDataSource:(WebDataSource *)dataSource;
-
-- (void)webView:(WebView *)webView didParseSource:(NSString *)source
- baseLineNumber:(WebNSUInteger)lineNumber
- fromURL:(NSURL *)url
- sourceId:(int)sid
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView failedToParseSource:(NSString *)source
- baseLineNumber:(WebNSUInteger)lineNumber
- fromURL:(NSURL *)url
- withError:(NSError *)error
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView didEnterCallFrame:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView willExecuteStatement:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame;
-
-- (void)webView:(WebView *)webView willLeaveCallFrame:(WebScriptCallFrame *)frame
- sourceId:(int)sid
- line:(int)lineno
- forWebFrame:(WebFrame *)webFrame;
-@end
-
-#undef WebNSUInteger
diff --git a/WebKit/mac/ForwardingHeaders/debugger/DebuggerCallFrame.h b/WebKit/mac/ForwardingHeaders/debugger/DebuggerCallFrame.h
new file mode 100644
index 0000000..fc658e5
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/debugger/DebuggerCallFrame.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/DebuggerCallFrame.h>
diff --git a/WebKit/mac/ForwardingHeaders/kjs/function.h b/WebKit/mac/ForwardingHeaders/kjs/function.h
deleted file mode 100644
index 3e08e6d..0000000
--- a/WebKit/mac/ForwardingHeaders/kjs/function.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <JavaScriptCore/function.h>
diff --git a/WebKit/mac/ForwardingHeaders/kjs/internal.h b/WebKit/mac/ForwardingHeaders/kjs/internal.h
deleted file mode 100644
index a20f3f3..0000000
--- a/WebKit/mac/ForwardingHeaders/kjs/internal.h
+++ /dev/null
@@ -1 +0,0 @@
-#import <JavaScriptCore/internal.h>
diff --git a/WebKit/mac/ForwardingHeaders/kjs/object.h b/WebKit/mac/ForwardingHeaders/kjs/object.h
deleted file mode 100644
index 3309cc1..0000000
--- a/WebKit/mac/ForwardingHeaders/kjs/object.h
+++ /dev/null
@@ -1 +0,0 @@
-#import <JavaScriptCore/object.h>
diff --git a/WebKit/mac/ForwardingHeaders/kjs/string_object.h b/WebKit/mac/ForwardingHeaders/kjs/string_object.h
deleted file mode 100644
index 26f026a..0000000
--- a/WebKit/mac/ForwardingHeaders/kjs/string_object.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <JavaScriptCore/string_object.h>
diff --git a/WebKit/mac/ForwardingHeaders/kjs/value.h b/WebKit/mac/ForwardingHeaders/kjs/value.h
deleted file mode 100644
index cf0b9c8..0000000
--- a/WebKit/mac/ForwardingHeaders/kjs/value.h
+++ /dev/null
@@ -1 +0,0 @@
-#import <JavaScriptCore/value.h>
diff --git a/WebKit/mac/ForwardingHeaders/runtime/JSFunction.h b/WebKit/mac/ForwardingHeaders/runtime/JSFunction.h
new file mode 100644
index 0000000..396407d
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/runtime/JSFunction.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/JSFunction.h>
diff --git a/WebKit/mac/ForwardingHeaders/kjs/JSLock.h b/WebKit/mac/ForwardingHeaders/runtime/JSLock.h
index 9f0a0be..9f0a0be 100644
--- a/WebKit/mac/ForwardingHeaders/kjs/JSLock.h
+++ b/WebKit/mac/ForwardingHeaders/runtime/JSLock.h
diff --git a/WebKit/mac/ForwardingHeaders/runtime/JSObject.h b/WebKit/mac/ForwardingHeaders/runtime/JSObject.h
new file mode 100644
index 0000000..5d4c157
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/runtime/JSObject.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/JSObject.h>
diff --git a/WebKit/mac/ForwardingHeaders/runtime/JSString.h b/WebKit/mac/ForwardingHeaders/runtime/JSString.h
new file mode 100644
index 0000000..3469129
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/runtime/JSString.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/JSString.h>
diff --git a/WebKit/mac/ForwardingHeaders/runtime/JSValue.h b/WebKit/mac/ForwardingHeaders/runtime/JSValue.h
new file mode 100644
index 0000000..4f49f83
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/runtime/JSValue.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/JSValue.h>
diff --git a/WebKit/mac/ForwardingHeaders/kjs/SymbolTable.h b/WebKit/mac/ForwardingHeaders/runtime/SymbolTable.h
index 0868c02..0868c02 100644
--- a/WebKit/mac/ForwardingHeaders/kjs/SymbolTable.h
+++ b/WebKit/mac/ForwardingHeaders/runtime/SymbolTable.h
diff --git a/WebKit/mac/ForwardingHeaders/wtf/Deque.h b/WebKit/mac/ForwardingHeaders/wtf/Deque.h
new file mode 100644
index 0000000..f1721ca
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/wtf/Deque.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/Deque.h>
diff --git a/WebKit/mac/ForwardingHeaders/wtf/Locker.h b/WebKit/mac/ForwardingHeaders/wtf/Locker.h
new file mode 100644
index 0000000..7718305
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/wtf/Locker.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/Locker.h>
diff --git a/WebKit/mac/ForwardingHeaders/wtf/RefCountedLeakCounter.h b/WebKit/mac/ForwardingHeaders/wtf/RefCountedLeakCounter.h
new file mode 100644
index 0000000..3f229d1
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/wtf/RefCountedLeakCounter.h
@@ -0,0 +1,2 @@
+#include <JavaScriptCore/RefCountedLeakCounter.h>
+
diff --git a/WebKit/mac/ForwardingHeaders/wtf/Threading.h b/WebKit/mac/ForwardingHeaders/wtf/Threading.h
new file mode 100644
index 0000000..771edd1
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/wtf/Threading.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/Threading.h>
diff --git a/WebKit/mac/ForwardingHeaders/wtf/UnusedParam.h b/WebKit/mac/ForwardingHeaders/wtf/UnusedParam.h
new file mode 100644
index 0000000..f1a6600
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/wtf/UnusedParam.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/UnusedParam.h>
diff --git a/WebKit/mac/History/WebBackForwardList.mm b/WebKit/mac/History/WebBackForwardList.mm
index f38d828..30767c3 100644
--- a/WebKit/mac/History/WebBackForwardList.mm
+++ b/WebKit/mac/History/WebBackForwardList.mm
@@ -37,7 +37,6 @@
#import "WebPreferencesPrivate.h"
#import "WebTypesInternal.h"
#import "WebViewPrivate.h"
-#import <JavaScriptCore/Assertions.h>
#import <WebCore/BackForwardList.h>
#import <WebCore/HistoryItem.h>
#import <WebCore/Page.h>
@@ -45,6 +44,7 @@
#import <WebCore/Settings.h>
#import <WebCore/ThreadCheck.h>
#import <WebCore/WebCoreObjCExtras.h>
+#import <wtf/Assertions.h>
#import <wtf/RetainPtr.h>
using namespace WebCore;
@@ -101,13 +101,14 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
- (id)init
{
- RefPtr<BackForwardList> coreList(new BackForwardList(0));
- return [self initWithBackForwardList:coreList.release()];
+ return [self initWithBackForwardList:BackForwardList::create(0)];
}
- (void)dealloc
{
- WebCoreThreadViolationCheck();
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebBackForwardList class], self))
+ return;
+
BackForwardList* backForwardList = core(self);
ASSERT(backForwardList->closed());
backForwardLists().remove(backForwardList);
diff --git a/WebKit/mac/History/WebHistory.mm b/WebKit/mac/History/WebHistory.mm
index 6d00758..1eedd8e 100644
--- a/WebKit/mac/History/WebHistory.mm
+++ b/WebKit/mac/History/WebHistory.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,19 +26,25 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebHistory.h"
-#import "WebHistoryPrivate.h"
+#import "WebHistoryInternal.h"
-#import "WebHistoryItem.h"
#import "WebHistoryItemInternal.h"
-#import "WebHistoryItemPrivate.h"
#import "WebKitLogging.h"
#import "WebNSURLExtras.h"
+#import "WebTypesInternal.h"
#import <Foundation/NSError.h>
-#import <JavaScriptCore/Assertions.h>
-#import <WebCore/WebCoreHistory.h>
+#import <WebCore/Page.h>
+#import <WebCore/PageGroup.h>
+#import <wtf/Assertions.h>
+#import <wtf/HashMap.h>
+#import <wtf/RetainPtr.h>
#import <wtf/Vector.h>
+using namespace WebCore;
+
+typedef int64_t WebHistoryDateKey;
+typedef HashMap<WebHistoryDateKey, RetainPtr<NSMutableArray> > DateToEntriesMap;
+
NSString *WebHistoryItemsAddedNotification = @"WebHistoryItemsAddedNotification";
NSString *WebHistoryItemsRemovedNotification = @"WebHistoryItemsRemovedNotification";
NSString *WebHistoryAllItemsRemovedNotification = @"WebHistoryAllItemsRemovedNotification";
@@ -54,6 +60,43 @@ NSString *DatesArrayKey = @"WebHistoryDates";
#define currentFileVersion 1
+@interface WebHistoryPrivate : NSObject {
+@private
+ NSMutableDictionary *_entriesByURL;
+ DateToEntriesMap* _entriesByDate;
+ NSMutableArray *_orderedLastVisitedDays;
+ BOOL itemLimitSet;
+ int itemLimit;
+ BOOL ageInDaysLimitSet;
+ int ageInDaysLimit;
+}
+
+- (void)addItem:(WebHistoryItem *)entry;
+- (void)addItems:(NSArray *)newEntries;
+- (BOOL)removeItem:(WebHistoryItem *)entry;
+- (BOOL)removeItems:(NSArray *)entries;
+- (BOOL)removeAllItems;
+
+- (NSArray *)orderedLastVisitedDays;
+- (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)calendarDate;
+- (BOOL)containsURL:(NSURL *)URL;
+- (WebHistoryItem *)itemForURL:(NSURL *)URL;
+- (WebHistoryItem *)itemForURLString:(NSString *)URLString;
+
+- (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error;
+- (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error;
+
+- (NSCalendarDate *)ageLimitDate;
+
+- (void)setHistoryItemLimit:(int)limit;
+- (int)historyItemLimit;
+- (void)setHistoryAgeInDaysLimit:(int)limit;
+- (int)historyAgeInDaysLimit;
+
+- (void)addVisitedLinksToPageGroup:(PageGroup&)group;
+
+@end
+
@implementation WebHistoryPrivate
#pragma mark OBJECT FRAMEWORK
@@ -69,9 +112,8 @@ NSString *DatesArrayKey = @"WebHistoryDates";
- (id)init
{
- if (![super init]) {
+ if (![super init])
return nil;
- }
_entriesByURL = [[NSMutableDictionary alloc] init];
_entriesByDate = new DateToEntriesMap;
@@ -84,7 +126,6 @@ NSString *DatesArrayKey = @"WebHistoryDates";
[_entriesByURL release];
[_orderedLastVisitedDays release];
delete _entriesByDate;
-
[super dealloc];
}
@@ -156,7 +197,7 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
[entriesForDate insertObject:entry atIndex:low];
}
-- (BOOL)_removeItemFromDateCaches:(WebHistoryItem *)entry
+- (BOOL)removeItemFromDateCaches:(WebHistoryItem *)entry
{
WebHistoryDateKey dateKey;
BOOL foundDate = [self findKey:&dateKey forDay:[entry lastVisitedTimeInterval]];
@@ -179,26 +220,28 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
return YES;
}
-- (BOOL)removeItemForURLString: (NSString *)URLString
+- (BOOL)removeItemForURLString:(NSString *)URLString
{
- WebHistoryItem *entry = [_entriesByURL objectForKey: URLString];
- if (entry == nil) {
+ WebHistoryItem *entry = [_entriesByURL objectForKey:URLString];
+ if (!entry)
return NO;
- }
- [_entriesByURL removeObjectForKey: URLString];
+ [_entriesByURL removeObjectForKey:URLString];
#if ASSERT_DISABLED
- [self _removeItemFromDateCaches:entry];
+ [self removeItemFromDateCaches:entry];
#else
- BOOL itemWasInDateCaches = [self _removeItemFromDateCaches:entry];
+ BOOL itemWasInDateCaches = [self removeItemFromDateCaches:entry];
ASSERT(itemWasInDateCaches);
#endif
+ if (![_entriesByURL count])
+ PageGroup::removeAllVisitedLinks();
+
return YES;
}
-- (void)_addItemToDateCaches:(WebHistoryItem *)entry
+- (void)addItemToDateCaches:(WebHistoryItem *)entry
{
WebHistoryDateKey dateKey;
if ([self findKey:&dateKey forDay:[entry lastVisitedTimeInterval]])
@@ -235,69 +278,42 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
[oldEntry release];
}
- [self _addItemToDateCaches:entry];
+ [self addItemToDateCaches:entry];
[_entriesByURL setObject:entry forKey:URLString];
}
-- (void)setLastVisitedTimeInterval:(NSTimeInterval)time forItem:(WebHistoryItem *)entry
+- (BOOL)removeItem:(WebHistoryItem *)entry
{
-#if ASSERT_DISABLED
- [self _removeItemFromDateCaches:entry];
-#else
- BOOL entryWasPresent = [self _removeItemFromDateCaches:entry];
- ASSERT(entryWasPresent);
-#endif
-
- [entry _setLastVisitedTimeInterval:time];
- [self _addItemToDateCaches:entry];
-
- // Don't send notification until entry is back in the right place in the date caches,
- // since observers might fetch history by date when they receive the notification.
- [[NSNotificationCenter defaultCenter]
- postNotificationName:WebHistoryItemChangedNotification object:entry userInfo:nil];
-}
-
-- (BOOL)removeItem: (WebHistoryItem *)entry
-{
- WebHistoryItem *matchingEntry;
- NSString *URLString;
-
- URLString = [entry URLString];
+ NSString *URLString = [entry URLString];
// If this exact object isn't stored, then make no change.
// FIXME: Is this the right behavior if this entry isn't present, but another entry for the same URL is?
// Maybe need to change the API to make something like removeEntryForURLString public instead.
- matchingEntry = [_entriesByURL objectForKey: URLString];
- if (matchingEntry != entry) {
+ WebHistoryItem *matchingEntry = [_entriesByURL objectForKey:URLString];
+ if (matchingEntry != entry)
return NO;
- }
- [self removeItemForURLString: URLString];
+ [self removeItemForURLString:URLString];
return YES;
}
-- (BOOL)removeItems: (NSArray *)entries
+- (BOOL)removeItems:(NSArray *)entries
{
- int index, count;
-
- count = [entries count];
- if (count == 0) {
+ NSUInteger count = [entries count];
+ if (!count)
return NO;
- }
- for (index = 0; index < count; ++index) {
+ for (NSUInteger index = 0; index < count; ++index)
[self removeItem:[entries objectAtIndex:index]];
- }
return YES;
}
- (BOOL)removeAllItems
{
- if ([_entriesByURL count] == 0) {
+ if (_entriesByDate->isEmpty())
return NO;
- }
_entriesByDate->clear();
[_entriesByURL removeAllObjects];
@@ -306,23 +322,21 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
[_orderedLastVisitedDays release];
_orderedLastVisitedDays = nil;
+ PageGroup::removeAllVisitedLinks();
+
return YES;
}
- (void)addItems:(NSArray *)newEntries
{
- NSEnumerator *enumerator;
- WebHistoryItem *entry;
-
// There is no guarantee that the incoming entries are in any particular
// order, but if this is called with a set of entries that were created by
// iterating through the results of orderedLastVisitedDays and orderedItemsLastVisitedOnDayy
// then they will be ordered chronologically from newest to oldest. We can make adding them
// faster (fewer compares) by inserting them from oldest to newest.
- enumerator = [newEntries reverseObjectEnumerator];
- while ((entry = [enumerator nextObject]) != nil) {
+ NSEnumerator *enumerator = [newEntries reverseObjectEnumerator];
+ while (WebHistoryItem *entry = [enumerator nextObject])
[self addItem:entry];
- }
}
#pragma mark DATE-BASED RETRIEVAL
@@ -349,28 +363,22 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
return _orderedLastVisitedDays;
}
-- (NSArray *)orderedItemsLastVisitedOnDay: (NSCalendarDate *)date
+- (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)date
{
WebHistoryDateKey dateKey;
- if ([self findKey:&dateKey forDay:[date timeIntervalSinceReferenceDate]])
- return _entriesByDate->get(dateKey).get();
-
- return nil;
+ if (![self findKey:&dateKey forDay:[date timeIntervalSinceReferenceDate]])
+ return nil;
+ return _entriesByDate->get(dateKey).get();
}
#pragma mark URL MATCHING
- (WebHistoryItem *)itemForURLString:(NSString *)URLString
{
- return [_entriesByURL objectForKey: URLString];
+ return [_entriesByURL objectForKey:URLString];
}
-- (BOOL)containsItemForURLString: (NSString *)URLString
-{
- return [self itemForURLString:URLString] != nil;
-}
-
-- (BOOL)containsURL: (NSURL *)URL
+- (BOOL)containsURL:(NSURL *)URL
{
return [self itemForURLString:[URL _web_originalDataAsString]] != nil;
}
@@ -392,7 +400,7 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
{
if (ageInDaysLimitSet)
return ageInDaysLimit;
- return [[NSUserDefaults standardUserDefaults] integerForKey: @"WebKitHistoryAgeInDaysLimit"];
+ return [[NSUserDefaults standardUserDefaults] integerForKey:@"WebKitHistoryAgeInDaysLimit"];
}
- (void)setHistoryItemLimit:(int)limit
@@ -405,12 +413,12 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
{
if (itemLimitSet)
return itemLimit;
- return [[NSUserDefaults standardUserDefaults] integerForKey: @"WebKitHistoryItemLimit"];
+ return [[NSUserDefaults standardUserDefaults] integerForKey:@"WebKitHistoryItemLimit"];
}
// Return a date that marks the age limit for history entries saved to or
// loaded from disk. Any entry older than this item should be rejected.
-- (NSCalendarDate *)_ageLimitDate
+- (NSCalendarDate *)ageLimitDate
{
return [[NSCalendarDate calendarDate] dateByAddingYears:0 months:0 days:-[self historyAgeInDaysLimit]
hours:0 minutes:0 seconds:0];
@@ -440,7 +448,7 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
return arrayRep;
}
-- (BOOL)_loadHistoryGutsFromURL:(NSURL *)URL savedItemsCount:(int *)numberOfItemsLoaded collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error
+- (BOOL)loadHistoryGutsFromURL:(NSURL *)URL savedItemsCount:(int *)numberOfItemsLoaded collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error
{
*numberOfItemsLoaded = 0;
NSDictionary *dictionary = nil;
@@ -474,12 +482,11 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
NSNumber *fileVersionObject = [dictionary objectForKey:FileVersionKey];
int fileVersion;
// we don't trust data obtained from elsewhere, so double-check
- if (fileVersionObject != nil && [fileVersionObject isKindOfClass:[NSNumber class]]) {
- fileVersion = [fileVersionObject intValue];
- } else {
+ if (!fileVersionObject || ![fileVersionObject isKindOfClass:[NSNumber class]]) {
LOG_ERROR("history file version can't be determined, therefore not loading");
return NO;
}
+ fileVersion = [fileVersionObject intValue];
if (fileVersion > currentFileVersion) {
LOG_ERROR("history file version is %d, newer than newest known version %d, therefore not loading", fileVersion, currentFileVersion);
return NO;
@@ -488,7 +495,7 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
NSArray *array = [dictionary objectForKey:DatesArrayKey];
int itemCountLimit = [self historyItemLimit];
- NSTimeInterval ageLimitDate = [[self _ageLimitDate] timeIntervalSinceReferenceDate];
+ NSTimeInterval ageLimitDate = [[self ageLimitDate] timeIntervalSinceReferenceDate];
NSEnumerator *enumerator = [array objectEnumerator];
BOOL ageLimitPassed = NO;
BOOL itemLimitPassed = NO;
@@ -530,150 +537,73 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval)
- (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error
{
- int numberOfItems;
- double start, duration;
- BOOL result;
+#if !LOG_DISABLED
+ double start = CFAbsoluteTimeGetCurrent();
+#endif
- start = CFAbsoluteTimeGetCurrent();
- result = [self _loadHistoryGutsFromURL:URL savedItemsCount:&numberOfItems collectDiscardedItemsInto:discardedItems error:error];
+ int numberOfItems;
+ if (![self loadHistoryGutsFromURL:URL savedItemsCount:&numberOfItems collectDiscardedItemsInto:discardedItems error:error])
+ return NO;
- if (result) {
- duration = CFAbsoluteTimeGetCurrent() - start;
- LOG(Timing, "loading %d history entries from %@ took %f seconds",
- numberOfItems, URL, duration);
- }
+#if !LOG_DISABLED
+ double duration = CFAbsoluteTimeGetCurrent() - start;
+ LOG(Timing, "loading %d history entries from %@ took %f seconds", numberOfItems, URL, duration);
+#endif
- return result;
+ return YES;
}
-- (BOOL)_saveHistoryGuts: (int *)numberOfItemsSaved URL:(NSURL *)URL error:(NSError **)error
+- (BOOL)saveHistoryGuts:(int *)numberOfItemsSaved URL:(NSURL *)URL error:(NSError **)error
{
*numberOfItemsSaved = 0;
- // FIXME: Correctly report error when new API is ready.
- if (error)
- *error = nil;
-
NSArray *array = [self arrayRepresentation];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
array, DatesArrayKey,
[NSNumber numberWithInt:currentFileVersion], FileVersionKey,
nil];
NSData *data = [NSPropertyListSerialization dataFromPropertyList:dictionary format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil];
- if (![data writeToURL:URL atomically:YES]) {
+ if (![data writeToURL:URL options:0 error:error]) {
LOG_ERROR("attempt to save %@ to %@ failed", dictionary, URL);
return NO;
}
-
+
*numberOfItemsSaved = [array count];
return YES;
}
- (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error
{
- int numberOfItems;
- double start, duration;
- BOOL result;
-
- start = CFAbsoluteTimeGetCurrent();
- result = [self _saveHistoryGuts: &numberOfItems URL:URL error:error];
-
- if (result) {
- duration = CFAbsoluteTimeGetCurrent() - start;
- LOG(Timing, "saving %d history entries to %@ took %f seconds",
- numberOfItems, URL, duration);
- }
-
- return result;
-}
-
-@end
-
-@interface _WebCoreHistoryProvider : NSObject <WebCoreHistoryProvider>
-{
- WebHistory *history;
-}
-- initWithHistory: (WebHistory *)h;
-@end
+#if !LOG_DISABLED
+ double start = CFAbsoluteTimeGetCurrent();
+#endif
-@implementation _WebCoreHistoryProvider
-- initWithHistory: (WebHistory *)h
-{
- history = [h retain];
- return self;
-}
+ int numberOfItems;
+ if (![self saveHistoryGuts:&numberOfItems URL:URL error:error])
+ return NO;
-static inline bool matchLetter(char c, char lowercaseLetter)
-{
- return (c | 0x20) == lowercaseLetter;
-}
+#if !LOG_DISABLED
+ double duration = CFAbsoluteTimeGetCurrent() - start;
+ LOG(Timing, "saving %d history entries to %@ took %f seconds", numberOfItems, URL, duration);
+#endif
-static inline bool matchUnicodeLetter(UniChar c, UniChar lowercaseLetter)
-{
- return (c | 0x20) == lowercaseLetter;
+ return YES;
}
-#define UNICODE_BUFFER_SIZE 1024
-
-- (BOOL)containsURL:(const UniChar *)unicode length:(unsigned)length
+- (void)addVisitedLinksToPageGroup:(PageGroup&)group
{
- const UniChar *unicodeStr = unicode;
- UniChar staticStrBuffer[UNICODE_BUFFER_SIZE];
- UniChar *strBuffer = NULL;
- BOOL needToAddSlash = FALSE;
-
- if (length >= 6 &&
- matchUnicodeLetter(unicode[0], 'h') &&
- matchUnicodeLetter(unicode[1], 't') &&
- matchUnicodeLetter(unicode[2], 't') &&
- matchUnicodeLetter(unicode[3], 'p') &&
- (unicode[4] == ':'
- || (matchUnicodeLetter(unicode[4], 's') && unicode[5] == ':'))) {
-
- unsigned pos = unicode[4] == ':' ? 5 : 6;
-
- // skip possible initial two slashes
- if (pos + 1 < length && unicode[pos] == '/' && unicode[pos + 1] == '/') {
- pos += 2;
- }
-
- while (pos < length && unicode[pos] != '/') {
- pos++;
- }
-
- if (pos == length) {
- needToAddSlash = TRUE;
+ NSEnumerator *enumerator = [_entriesByURL keyEnumerator];
+ while (NSString *url = [enumerator nextObject]) {
+ size_t length = [url length];
+ const UChar* characters = CFStringGetCharactersPtr(reinterpret_cast<CFStringRef>(url));
+ if (characters)
+ group.addVisitedLink(characters, length);
+ else {
+ Vector<UChar, 512> buffer(length);
+ [url getCharacters:buffer.data()];
+ group.addVisitedLink(buffer.data(), length);
}
}
-
- if (needToAddSlash) {
- if (length + 1 <= UNICODE_BUFFER_SIZE) {
- strBuffer = staticStrBuffer;
- } else {
- strBuffer = (UniChar*)malloc(sizeof(UniChar) * (length + 1));
- }
- memcpy(strBuffer, unicode, 2 * length);
- strBuffer[length] = '/';
- length++;
-
- unicodeStr = strBuffer;
- }
-
- CFStringRef str = CFStringCreateWithCharactersNoCopy(NULL, unicodeStr, length, kCFAllocatorNull);
- BOOL result = [history containsItemForURLString:(id)str];
- CFRelease(str);
-
- if (strBuffer != staticStrBuffer) {
- free(strBuffer);
- }
-
- return result;
-}
-
-- (void)dealloc
-{
- [history release];
- [super dealloc];
}
@end
@@ -685,24 +615,24 @@ static inline bool matchUnicodeLetter(UniChar c, UniChar lowercaseLetter)
return _sharedHistory;
}
-
-+ (void)setOptionalSharedHistory: (WebHistory *)history
++ (void)setOptionalSharedHistory:(WebHistory *)history
{
- // FIXME. Need to think about multiple instances of WebHistory per application
+ if (_sharedHistory == history)
+ return;
+ // FIXME: Need to think about multiple instances of WebHistory per application
// and correct synchronization of history file between applications.
- [WebCoreHistory setHistoryProvider: [[[_WebCoreHistoryProvider alloc] initWithHistory: history] autorelease]];
- if (_sharedHistory != history){
- [_sharedHistory release];
- _sharedHistory = [history retain];
- }
+ [_sharedHistory release];
+ _sharedHistory = [history retain];
+ PageGroup::setShouldTrackVisitedLinks(history);
+ PageGroup::removeAllVisitedLinks();
}
- (id)init
{
- if ((self = [super init]) != nil) {
- _historyPrivate = [[WebHistoryPrivate alloc] init];
- }
-
+ self = [super init];
+ if (!self)
+ return nil;
+ _historyPrivate = [[WebHistoryPrivate alloc] init];
return self;
}
@@ -718,40 +648,14 @@ static inline bool matchUnicodeLetter(UniChar c, UniChar lowercaseLetter)
{
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:entries, WebHistoryItemsKey, nil];
[[NSNotificationCenter defaultCenter]
- postNotificationName: name object: self userInfo: userInfo];
-}
-
-- (WebHistoryItem *)addItemForURL: (NSURL *)URL
-{
- WebHistoryItem *entry = [[WebHistoryItem alloc] initWithURL:URL title:nil];
- [entry _setLastVisitedTimeInterval: [NSDate timeIntervalSinceReferenceDate]];
- [self addItem: entry];
- [entry release];
- return entry;
-}
-
-
-- (void)addItem: (WebHistoryItem *)entry
-{
- LOG (History, "adding %@", entry);
- [_historyPrivate addItem: entry];
- [self _sendNotification: WebHistoryItemsAddedNotification
- entries: [NSArray arrayWithObject:entry]];
-}
-
-- (void)removeItem: (WebHistoryItem *)entry
-{
- if ([_historyPrivate removeItem: entry]) {
- [self _sendNotification: WebHistoryItemsRemovedNotification
- entries: [NSArray arrayWithObject:entry]];
- }
+ postNotificationName:name object:self userInfo:userInfo];
}
-- (void)removeItems: (NSArray *)entries
+- (void)removeItems:(NSArray *)entries
{
if ([_historyPrivate removeItems:entries]) {
- [self _sendNotification: WebHistoryItemsRemovedNotification
- entries: entries];
+ [self _sendNotification:WebHistoryItemsRemovedNotification
+ entries:entries];
}
}
@@ -759,21 +663,16 @@ static inline bool matchUnicodeLetter(UniChar c, UniChar lowercaseLetter)
{
if ([_historyPrivate removeAllItems]) {
[[NSNotificationCenter defaultCenter]
- postNotificationName: WebHistoryAllItemsRemovedNotification
- object: self];
+ postNotificationName:WebHistoryAllItemsRemovedNotification
+ object:self];
}
}
- (void)addItems:(NSArray *)newEntries
{
[_historyPrivate addItems:newEntries];
- [self _sendNotification: WebHistoryItemsAddedNotification
- entries: newEntries];
-}
-
-- (void)setLastVisitedTimeInterval:(NSTimeInterval)time forItem:(WebHistoryItem *)entry
-{
- [_historyPrivate setLastVisitedTimeInterval:time forItem:entry];
+ [self _sendNotification:WebHistoryItemsAddedNotification
+ entries:newEntries];
}
#pragma mark DATE-BASED RETRIEVAL
@@ -783,21 +682,16 @@ static inline bool matchUnicodeLetter(UniChar c, UniChar lowercaseLetter)
return [_historyPrivate orderedLastVisitedDays];
}
-- (NSArray *)orderedItemsLastVisitedOnDay: (NSCalendarDate *)date
+- (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)date
{
- return [_historyPrivate orderedItemsLastVisitedOnDay: date];
+ return [_historyPrivate orderedItemsLastVisitedOnDay:date];
}
#pragma mark URL MATCHING
-- (BOOL)containsItemForURLString: (NSString *)URLString
+- (BOOL)containsURL:(NSURL *)URL
{
- return [_historyPrivate containsItemForURLString: URLString];
-}
-
-- (BOOL)containsURL: (NSURL *)URL
-{
- return [_historyPrivate containsURL: URL];
+ return [_historyPrivate containsURL:URL];
}
- (WebHistoryItem *)itemForURL:(NSURL *)URL
@@ -809,41 +703,31 @@ static inline bool matchUnicodeLetter(UniChar c, UniChar lowercaseLetter)
- (BOOL)loadFromURL:(NSURL *)URL error:(NSError **)error
{
- NSMutableArray *discardedItems = [NSMutableArray array];
-
- if ([_historyPrivate loadFromURL:URL collectDiscardedItemsInto:discardedItems error:error]) {
- [[NSNotificationCenter defaultCenter]
- postNotificationName:WebHistoryLoadedNotification
- object:self];
-
- if ([discardedItems count] > 0)
- [self _sendNotification:WebHistoryItemsDiscardedWhileLoadingNotification entries:discardedItems];
-
- return YES;
+ NSMutableArray *discardedItems = [[NSMutableArray alloc] init];
+ if (![_historyPrivate loadFromURL:URL collectDiscardedItemsInto:discardedItems error:error]) {
+ [discardedItems release];
+ return NO;
}
- return NO;
-}
-- (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error
-{
- // FIXME: Use new foundation API to get error when ready.
- if([_historyPrivate saveToURL:URL error:error]){
- [[NSNotificationCenter defaultCenter]
- postNotificationName: WebHistorySavedNotification
- object: self];
- return YES;
- }
- return NO;
-}
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:WebHistoryLoadedNotification
+ object:self];
-- (WebHistoryItem *)_itemForURLString:(NSString *)URLString
-{
- return [_historyPrivate itemForURLString: URLString];
+ if ([discardedItems count])
+ [self _sendNotification:WebHistoryItemsDiscardedWhileLoadingNotification entries:discardedItems];
+
+ [discardedItems release];
+ return YES;
}
-- (NSCalendarDate*)ageLimitDate
+- (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error
{
- return [_historyPrivate _ageLimitDate];
+ if (![_historyPrivate saveToURL:URL error:error])
+ return NO;
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:WebHistorySavedNotification
+ object:self];
+ return YES;
}
- (void)setHistoryItemLimit:(int)limit
@@ -867,3 +751,34 @@ static inline bool matchUnicodeLetter(UniChar c, UniChar lowercaseLetter)
}
@end
+
+@implementation WebHistory (WebPrivate)
+
+- (WebHistoryItem *)_itemForURLString:(NSString *)URLString
+{
+ return [_historyPrivate itemForURLString:URLString];
+}
+
+@end
+
+@implementation WebHistory (WebInternal)
+
+- (void)_addItemForURL:(NSURL *)URL title:(NSString *)title
+{
+ WebHistoryItem *entry = [[WebHistoryItem alloc] initWithURL:URL title:title];
+ [entry _setLastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate]];
+
+ LOG(History, "adding %@", entry);
+ [_historyPrivate addItem:entry];
+ [self _sendNotification:WebHistoryItemsAddedNotification
+ entries:[NSArray arrayWithObject:entry]];
+
+ [entry release];
+}
+
+- (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group
+{
+ [_historyPrivate addVisitedLinksToPageGroup:group];
+}
+
+@end
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginViewInternal.h b/WebKit/mac/History/WebHistoryInternal.h
index 1285052..fa8fc7c 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginViewInternal.h
+++ b/WebKit/mac/History/WebHistoryInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,12 +26,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __LP64__
-#import <WebKit/WebBaseNetscapePluginView.h>
+#import "WebHistoryPrivate.h"
-@interface WebBaseNetscapePluginView (WebInternal)
-- (void)restartNullEvents;
-- (void)stopNullEvents;
-@end
-#endif
+namespace WebCore {
+ class PageGroup;
+}
+@interface WebHistory (WebInternal)
+- (void)_addItemForURL:(NSURL *)URL title:(NSString *)title;
+- (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group;
+@end
diff --git a/WebKit/mac/History/WebHistoryItem.mm b/WebKit/mac/History/WebHistoryItem.mm
index 291498a..4d4f924 100644
--- a/WebKit/mac/History/WebHistoryItem.mm
+++ b/WebKit/mac/History/WebHistoryItem.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,7 +29,6 @@
#import "WebHistoryItemInternal.h"
#import "WebHistoryItemPrivate.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebFrameView.h"
#import "WebHTMLViewInternal.h"
@@ -42,7 +41,7 @@
#import "WebNSURLRequestExtras.h"
#import "WebNSViewExtras.h"
#import "WebPluginController.h"
-#import <JavaScriptCore/Assertions.h>
+#import "WebTypesInternal.h"
#import <WebCore/CachedPage.h>
#import <WebCore/HistoryItem.h>
#import <WebCore/Image.h>
@@ -51,7 +50,7 @@
#import <WebCore/PlatformString.h>
#import <WebCore/ThreadCheck.h>
#import <WebCore/WebCoreObjCExtras.h>
-#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
// Private keys used in the WebHistoryItem's dictionary representation.
// see 3245793 for explanation of "lastVisitedDate"
@@ -92,18 +91,20 @@ void WKNotifyHistoryItemChanged()
- (id)init
{
- return [self initWithWebCoreHistoryItem:(new HistoryItem)];
+ return [self initWithWebCoreHistoryItem:HistoryItem::create()];
}
- (id)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time
{
WebCoreThreadViolationCheck();
- return [self initWithWebCoreHistoryItem:(new HistoryItem(URLString, title, time))];
+ return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, time)];
}
- (void)dealloc
{
- WebCoreThreadViolationCheck();
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebHistoryItem class], self))
+ return;
+
if (_private) {
HistoryItem* coreItem = core(_private);
coreItem->deref();
@@ -185,7 +186,7 @@ void WKNotifyHistoryItemChanged()
return core(_private)->lastVisitedTime();
}
-- (unsigned)hash
+- (NSUInteger)hash
{
return [(NSString*)core(_private)->urlString() hash];
}
@@ -277,12 +278,12 @@ static WebWindowWatcher *_windowWatcher = nil;
- (id)initWithURL:(NSURL *)URL target:(NSString *)target parent:(NSString *)parent title:(NSString *)title
{
- return [self initWithWebCoreHistoryItem:(new HistoryItem(URL, target, parent, title))];
+ return [self initWithWebCoreHistoryItem:HistoryItem::create(URL, target, parent, title)];
}
- (id)initWithURLString:(NSString *)URLString title:(NSString *)title displayTitle:(NSString *)displayTitle lastVisitedTimeInterval:(NSTimeInterval)time
{
- return [self initWithWebCoreHistoryItem:(new HistoryItem(URLString, title, displayTitle, time))];
+ return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, displayTitle, time)];
}
- (id)initWithWebCoreHistoryItem:(PassRefPtr<HistoryItem>)item
@@ -463,8 +464,10 @@ static WebWindowWatcher *_windowWatcher = nil;
- (NSURL *)URL
{
ASSERT_MAIN_THREAD();
- KURL url = core(_private)->url();
- return url.isEmpty() ? nil : url.getNSURL();
+ const KURL& url = core(_private)->url();
+ if (url.isEmpty())
+ return nil;
+ return url;
}
// This should not be called directly for WebHistoryItems that are already included
diff --git a/WebKit/mac/History/WebHistoryItemInternal.h b/WebKit/mac/History/WebHistoryItemInternal.h
index b2658ff..2592ff8 100644
--- a/WebKit/mac/History/WebHistoryItemInternal.h
+++ b/WebKit/mac/History/WebHistoryItemInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,10 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Cocoa/Cocoa.h>
+#import "WebHistoryItemPrivate.h"
-#import <WebKit/WebBackForwardList.h>
-#import <WebKit/WebHistoryItem.h>
#import <wtf/PassRefPtr.h>
namespace WebCore {
@@ -56,8 +54,6 @@ extern void WKNotifyHistoryItemChanged();
@end
-@interface WebBackForwardList (WebPrivate)
+@interface WebBackForwardList (WebInternal)
- (void)_close;
@end
-
-
diff --git a/WebKit/mac/History/WebHistoryPrivate.h b/WebKit/mac/History/WebHistoryPrivate.h
index 724c4e5..587783c 100644
--- a/WebKit/mac/History/WebHistoryPrivate.h
+++ b/WebKit/mac/History/WebHistoryPrivate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,88 +26,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Foundation/Foundation.h>
-
#import <WebKit/WebHistory.h>
-@class WebHistoryItem;
-@class NSError;
-
-#ifdef __cplusplus
-#include <wtf/HashMap.h>
-#include <wtf/RetainPtr.h>
-
-typedef int64_t WebHistoryDateKey;
-typedef HashMap<WebHistoryDateKey, RetainPtr<NSMutableArray> > DateToEntriesMap;
-#else
-typedef struct DateToEntriesMap DateToEntriesMap;
-#endif
-
/*
@constant WebHistoryItemsDiscardedWhileLoadingNotification Posted from loadFromURL:error:.
This notification comes with a userInfo dictionary that contains the array of
- items discarded due to the date limit or item limit. The key for the array is WebHistoryItemsKey.
+ items discarded due to the date limit or item limit. The key for the array is WebHistoryItemsKey.
*/
-// FIXME: This notification should become API in WebHistory.h
+// FIXME: This notification should become public API.
extern NSString *WebHistoryItemsDiscardedWhileLoadingNotification;
-// FIXME: The WebHistoryPrivate interface should be in WebHistoryInternal.h or inside WebHistory.m
-@interface WebHistoryPrivate : NSObject {
-@private
- NSMutableDictionary *_entriesByURL;
- DateToEntriesMap* _entriesByDate;
- NSMutableArray *_orderedLastVisitedDays;
- BOOL itemLimitSet;
- int itemLimit;
- BOOL ageInDaysLimitSet;
- int ageInDaysLimit;
-}
-
-- (void)addItem:(WebHistoryItem *)entry;
-- (void)addItems:(NSArray *)newEntries;
-- (BOOL)removeItem:(WebHistoryItem *)entry;
-- (BOOL)removeItems:(NSArray *)entries;
-- (BOOL)removeAllItems;
-- (void)setLastVisitedTimeInterval:(NSTimeInterval)time forItem:(WebHistoryItem *)item;
-
-- (NSArray *)orderedLastVisitedDays;
-- (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)calendarDate;
-- (BOOL)containsItemForURLString:(NSString *)URLString;
-- (BOOL)containsURL:(NSURL *)URL;
-- (WebHistoryItem *)itemForURL:(NSURL *)URL;
-- (WebHistoryItem *)itemForURLString:(NSString *)URLString;
-
-- (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error;
-- (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error;
-
-- (NSCalendarDate*)_ageLimitDate;
-
-- (void)setHistoryItemLimit:(int)limit;
-- (int)historyItemLimit;
-- (void)setHistoryAgeInDaysLimit:(int)limit;
-- (int)historyAgeInDaysLimit;
-
-@end
-
@interface WebHistory (WebPrivate)
// FIXME: The following SPI is used by Safari. Should it be made into public API?
- (WebHistoryItem *)_itemForURLString:(NSString *)URLString;
-// FIXME: Safari doesn't use the following SPI, and it's used in WebKit only inside WebHistory.m.
-// Should we move it into a FileInternal category inside WebHistory.m, or do we need it for other
-// clients?
-- (void)removeItem:(WebHistoryItem *)entry;
-- (void)addItem:(WebHistoryItem *)entry;
-- (BOOL)containsItemForURLString:(NSString *)URLString;
-
-// FIXME: Safari doesn't use the following SPI, but other WebKit classes do. Should we move it into
-// a WebHistoryInternal.h, or do we need it for other clients?
-- (WebHistoryItem *)addItemForURL:(NSURL *)URL;
-// Change date on existing item
-- (void)setLastVisitedTimeInterval:(NSTimeInterval)time forItem:(WebHistoryItem *)item;
-
-// FIXME: neither Safari nor WebKit use the following SPI -- do we still need it?
-- (NSCalendarDate*)ageLimitDate;
-
@end
diff --git a/WebKit/mac/Info.plist b/WebKit/mac/Info.plist
index 635fbe5..e72ea0d 100644
--- a/WebKit/mac/Info.plist
+++ b/WebKit/mac/Info.plist
@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>${BUNDLE_VERSION}</string>
+ <string>${SHORT_VERSION_STRING}</string>
<key>CFBundleVersion</key>
<string>${BUNDLE_VERSION}</string>
</dict>
diff --git a/WebKit/mac/MigrateHeaders.make b/WebKit/mac/MigrateHeaders.make
index f447332..6d96623 100644
--- a/WebKit/mac/MigrateHeaders.make
+++ b/WebKit/mac/MigrateHeaders.make
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
# Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VPATH = $(WEBCORE_PRIVATE_HEADERS_DIR) $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR)
+VPATH = $(WEBCORE_PRIVATE_HEADERS_DIR)
INTERNAL_HEADERS_DIR = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit
PUBLIC_HEADERS_DIR = $(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)
@@ -62,11 +62,13 @@ all : \
$(PUBLIC_HEADERS_DIR)/DOMDocument.h \
$(INTERNAL_HEADERS_DIR)/DOMDocumentInternal.h \
$(PUBLIC_HEADERS_DIR)/DOMDocumentFragment.h \
+ $(INTERNAL_HEADERS_DIR)/DOMDocumentFragmentInternal.h \
$(PRIVATE_HEADERS_DIR)/DOMDocumentPrivate.h \
$(PUBLIC_HEADERS_DIR)/DOMDocumentType.h \
$(PUBLIC_HEADERS_DIR)/DOMElement.h \
$(INTERNAL_HEADERS_DIR)/DOMElementInternal.h \
$(PRIVATE_HEADERS_DIR)/DOMElementPrivate.h \
+ $(PRIVATE_HEADERS_DIR)/DOMElementTimeControl.h \
$(PUBLIC_HEADERS_DIR)/DOMEntity.h \
$(PUBLIC_HEADERS_DIR)/DOMEntityReference.h \
$(PUBLIC_HEADERS_DIR)/DOMEvent.h \
@@ -122,9 +124,7 @@ all : \
$(PUBLIC_HEADERS_DIR)/DOMHTMLIsIndexElement.h \
$(PUBLIC_HEADERS_DIR)/DOMHTMLLIElement.h \
$(PUBLIC_HEADERS_DIR)/DOMHTMLLabelElement.h \
- $(PRIVATE_HEADERS_DIR)/DOMHTMLLabelElementPrivate.h \
$(PUBLIC_HEADERS_DIR)/DOMHTMLLegendElement.h \
- $(PRIVATE_HEADERS_DIR)/DOMHTMLLegendElementPrivate.h \
$(PUBLIC_HEADERS_DIR)/DOMHTMLLinkElement.h \
$(PRIVATE_HEADERS_DIR)/DOMHTMLLinkElementPrivate.h \
$(PUBLIC_HEADERS_DIR)/DOMHTMLMapElement.h \
@@ -180,6 +180,7 @@ all : \
$(PRIVATE_HEADERS_DIR)/DOMPrivate.h \
$(PUBLIC_HEADERS_DIR)/DOMProcessingInstruction.h \
$(PRIVATE_HEADERS_DIR)/DOMProcessingInstructionPrivate.h \
+ $(PUBLIC_HEADERS_DIR)/DOMProgressEvent.h \
$(PUBLIC_HEADERS_DIR)/DOMRGBColor.h \
$(PUBLIC_HEADERS_DIR)/DOMRange.h \
$(INTERNAL_HEADERS_DIR)/DOMRangeInternal.h \
@@ -191,6 +192,7 @@ all : \
$(PUBLIC_HEADERS_DIR)/DOMStyleSheetList.h \
$(PUBLIC_HEADERS_DIR)/DOMStylesheets.h \
$(PUBLIC_HEADERS_DIR)/DOMText.h \
+ $(PRIVATE_HEADERS_DIR)/DOMTextPrivate.h \
$(PUBLIC_HEADERS_DIR)/DOMTraversal.h \
$(PUBLIC_HEADERS_DIR)/DOMTreeWalker.h \
$(PUBLIC_HEADERS_DIR)/DOMUIEvent.h \
@@ -206,6 +208,7 @@ all : \
$(PRIVATE_HEADERS_DIR)/WebDashboardRegion.h \
$(PUBLIC_HEADERS_DIR)/WebScriptObject.h \
$(PUBLIC_HEADERS_DIR)/npapi.h \
+ $(PUBLIC_HEADERS_DIR)/npfunctions.h \
$(PUBLIC_HEADERS_DIR)/npruntime.h \
#
@@ -215,6 +218,8 @@ all : \
$(PRIVATE_HEADERS_DIR)/DOMSVG.h \
$(PRIVATE_HEADERS_DIR)/DOMSVGAElement.h \
$(INTERNAL_HEADERS_DIR)/DOMSVGAElementInternal.h \
+ $(PRIVATE_HEADERS_DIR)/DOMSVGAltGlyphElement.h \
+ $(INTERNAL_HEADERS_DIR)/DOMSVGAltGlyphElementInternal.h \
$(PRIVATE_HEADERS_DIR)/DOMSVGAngle.h \
$(INTERNAL_HEADERS_DIR)/DOMSVGAngleInternal.h \
$(PRIVATE_HEADERS_DIR)/DOMSVGAnimateColorElement.h \
@@ -476,7 +481,7 @@ all : \
endif
-REPLACE_RULES = -e s/\<WebCore/\<WebKit/ -e s/\<JavaScriptCore/\<WebKit/ -e s/DOMDOMImplementation/DOMImplementation/ -e 's/\<WebKit\/JSBase.h/\<JavaScriptCore\/JSBase.h/'
+REPLACE_RULES = -e s/\<WebCore/\<WebKit/ -e s/DOMDOMImplementation/DOMImplementation/
HEADER_MIGRATE_CMD = sed $(REPLACE_RULES) $< $(PROCESS_HEADER_FOR_MACOSX_TARGET_CMD) > $@
ifeq ($(MACOSX_DEPLOYMENT_TARGET),10.4)
diff --git a/WebKit/mac/Misc/EmptyProtocolDefinitions.h b/WebKit/mac/Misc/EmptyProtocolDefinitions.h
new file mode 100644
index 0000000..c52d8ce
--- /dev/null
+++ b/WebKit/mac/Misc/EmptyProtocolDefinitions.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 defined(__OBJC__)
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#define DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS 0
+#else
+#define DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS 1
+#endif
+
+#if !DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS
+
+#define EMPTY_PROTOCOL(NAME) \
+@protocol NAME <NSObject> \
+@end
+
+EMPTY_PROTOCOL(NSTableViewDataSource)
+EMPTY_PROTOCOL(NSTableViewDelegate)
+EMPTY_PROTOCOL(NSWindowDelegate)
+
+#undef EMPTY_PROTOCOL
+
+#endif /* !DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS */
+
+#endif /* defined(__OBJC__) */
diff --git a/WebKit/mac/Misc/WebCache.mm b/WebKit/mac/Misc/WebCache.mm
index 1c1850b..d3dfbdb 100644
--- a/WebKit/mac/Misc/WebCache.mm
+++ b/WebKit/mac/Misc/WebCache.mm
@@ -28,6 +28,7 @@
#import "WebPreferences.h"
#import "WebView.h"
#import "WebViewInternal.h"
+#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/Cache.h>
@implementation WebCache
@@ -40,25 +41,41 @@
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:s.images.count], @"Images",
[NSNumber numberWithInt:s.cssStyleSheets.count], @"CSS",
+#if ENABLE(XSLT)
[NSNumber numberWithInt:s.xslStyleSheets.count], @"XSL",
+#else
+ [NSNumber numberWithInt:0], @"XSL",
+#endif
[NSNumber numberWithInt:s.scripts.count], @"JavaScript",
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:s.images.size], @"Images",
[NSNumber numberWithInt:s.cssStyleSheets.size] ,@"CSS",
+#if ENABLE(XSLT)
[NSNumber numberWithInt:s.xslStyleSheets.size], @"XSL",
+#else
+ [NSNumber numberWithInt:0], @"XSL",
+#endif
[NSNumber numberWithInt:s.scripts.size], @"JavaScript",
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:s.images.liveSize], @"Images",
[NSNumber numberWithInt:s.cssStyleSheets.liveSize] ,@"CSS",
+#if ENABLE(XSLT)
[NSNumber numberWithInt:s.xslStyleSheets.liveSize], @"XSL",
+#else
+ [NSNumber numberWithInt:0], @"XSL",
+#endif
[NSNumber numberWithInt:s.scripts.liveSize], @"JavaScript",
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:s.images.decodedSize], @"Images",
[NSNumber numberWithInt:s.cssStyleSheets.decodedSize] ,@"CSS",
+#if ENABLE(XSLT)
[NSNumber numberWithInt:s.xslStyleSheets.decodedSize], @"XSL",
+#else
+ [NSNumber numberWithInt:0], @"XSL",
+#endif
[NSNumber numberWithInt:s.scripts.decodedSize], @"JavaScript",
nil],
nil];
@@ -70,6 +87,9 @@
WebCacheModel cacheModel = [WebView _cacheModel];
[WebView _setCacheModel:WebCacheModelDocumentViewer];
[WebView _setCacheModel:cacheModel];
+
+ // Empty the application cache.
+ WebCore::cacheStorage().empty();
}
+ (void)setDisabled:(BOOL)disabled
diff --git a/WebKit/mac/Misc/WebCoreStatistics.h b/WebKit/mac/Misc/WebCoreStatistics.h
index 7585ec0..392f31b 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.h
+++ b/WebKit/mac/Misc/WebCoreStatistics.h
@@ -50,6 +50,11 @@
+ (size_t)iconRecordCount;
+ (size_t)iconsWithDataCount;
++ (size_t)cachedFontDataCount;
++ (size_t)cachedFontDataInactiveCount;
++ (void)purgeInactiveFontData;
++ (size_t)glyphPageCount;
+
+ (BOOL)shouldPrintExceptions;
+ (void)setShouldPrintExceptions:(BOOL)print;
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm
index 1dc553f..ecbfe9d 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,15 +29,19 @@
#import "WebCoreStatistics.h"
#import "WebCache.h"
-#import <JavaScriptCore/collector.h>
-#import <JavaScriptCore/interpreter.h>
+#import "WebFrameInternal.h"
+#import <runtime/JSLock.h>
+#import <WebCore/Console.h>
+#import <WebCore/FontCache.h>
+#import <WebCore/Frame.h>
#import <WebCore/GCController.h>
+#import <WebCore/GlyphPageTreeNode.h>
#import <WebCore/IconDatabase.h>
-#import <WebCore/Node.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebFrameInternal.h>
+#import <WebCore/JSDOMWindow.h>
+#import <WebCore/RenderTreeAsText.h>
+#import <WebCore/RenderView.h>
-using namespace KJS;
+using namespace JSC;
using namespace WebCore;
@implementation WebCoreStatistics
@@ -49,35 +53,35 @@ using namespace WebCore;
+ (size_t)javaScriptObjectsCount
{
- JSLock lock;
- return Collector::size();
+ JSLock lock(false);
+ return JSDOMWindow::commonJSGlobalData()->heap.size();
}
+ (size_t)javaScriptGlobalObjectsCount
{
- JSLock lock;
- return Collector::globalObjectCount();
+ JSLock lock(false);
+ return JSDOMWindow::commonJSGlobalData()->heap.globalObjectCount();
}
+ (size_t)javaScriptProtectedObjectsCount
{
- JSLock lock;
- return Collector::protectedObjectCount();
+ JSLock lock(false);
+ return JSDOMWindow::commonJSGlobalData()->heap.protectedObjectCount();
}
+ (size_t)javaScriptProtectedGlobalObjectsCount
{
- JSLock lock;
- return Collector::protectedGlobalObjectCount();
+ JSLock lock(false);
+ return JSDOMWindow::commonJSGlobalData()->heap.protectedGlobalObjectCount();
}
+ (NSCountedSet *)javaScriptProtectedObjectTypeCounts
{
- JSLock lock;
+ JSLock lock(false);
NSCountedSet *result = [NSCountedSet set];
- OwnPtr<HashCountedSet<const char*> > counts(Collector::protectedObjectTypeCounts());
+ OwnPtr<HashCountedSet<const char*> > counts(JSDOMWindow::commonJSGlobalData()->heap.protectedObjectTypeCounts());
HashCountedSet<const char*>::iterator end = counts->end();
for (HashCountedSet<const char*>::iterator it = counts->begin(); it != end; ++it)
for (unsigned i = 0; i < it->second; ++i)
@@ -116,16 +120,36 @@ using namespace WebCore;
return iconDatabase()->iconRecordCountWithData();
}
++ (size_t)cachedFontDataCount
+{
+ return FontCache::fontDataCount();
+}
+
++ (size_t)cachedFontDataInactiveCount
+{
+ return FontCache::inactiveFontDataCount();
+}
+
++ (void)purgeInactiveFontData
+{
+ FontCache::purgeInactiveFontData();
+}
+
++ (size_t)glyphPageCount
+{
+ return GlyphPageTreeNode::treeGlyphPageCount();
+}
+
+ (BOOL)shouldPrintExceptions
{
- JSLock lock;
- return Interpreter::shouldPrintExceptions();
+ JSLock lock(false);
+ return Console::shouldPrintExceptions();
}
+ (void)setShouldPrintExceptions:(BOOL)print
{
- JSLock lock;
- Interpreter::setShouldPrintExceptions(print);
+ JSLock lock(false);
+ Console::setShouldPrintExceptions(print);
}
+ (void)emptyCache
@@ -156,8 +180,8 @@ using namespace WebCore;
+ (size_t)javaScriptReferencedObjectsCount
{
- JSLock lock;
- return Collector::protectedObjectCount();
+ JSLock lock(false);
+ return JSDOMWindow::commonJSGlobalData()->heap.protectedObjectCount();
}
+ (NSSet *)javaScriptRootObjectClasses
@@ -181,7 +205,7 @@ using namespace WebCore;
- (NSString *)renderTreeAsExternalRepresentation
{
- return [[self _bridge] renderTreeAsExternalRepresentation];
+ return externalRepresentation(_private->coreFrame->contentRenderer());
}
@end
diff --git a/WebKit/mac/Misc/WebDownload.m b/WebKit/mac/Misc/WebDownload.m
index 50a5777..2c53c1b 100644
--- a/WebKit/mac/Misc/WebDownload.m
+++ b/WebKit/mac/Misc/WebDownload.m
@@ -30,8 +30,8 @@
#import <Foundation/NSURLAuthenticationChallenge.h>
#import <Foundation/NSURLDownload.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebPanelAuthenticationHandler.h>
+#import <wtf/Assertions.h>
#import "WebTypesInternal.h"
@@ -96,6 +96,9 @@
- (void)downloadDidBegin:(NSURLDownload *)download
{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ [[NSProcessInfo processInfo] disableSuddenTermination];
+#endif
[realDelegate downloadDidBegin:download];
}
@@ -154,11 +157,17 @@
- (void)downloadDidFinish:(NSURLDownload *)download
{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ [[NSProcessInfo processInfo] enableSuddenTermination];
+#endif
[realDelegate downloadDidFinish:download];
}
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ [[NSProcessInfo processInfo] enableSuddenTermination];
+#endif
[realDelegate download:download didFailWithError:error];
}
diff --git a/WebKit/mac/Misc/WebElementDictionary.mm b/WebKit/mac/Misc/WebElementDictionary.mm
index 25b0b99..b987525 100644
--- a/WebKit/mac/Misc/WebElementDictionary.mm
+++ b/WebKit/mac/Misc/WebElementDictionary.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,19 +30,17 @@
#import "WebDOMOperations.h"
#import "WebFrame.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebKitLogging.h"
+#import "WebTypesInternal.h"
#import "WebView.h"
#import "WebViewPrivate.h"
-
-#import <WebKit/DOMCore.h>
-#import <WebKit/DOMExtensions.h>
#import <WebCore/Frame.h>
#import <WebCore/HitTestResult.h>
#import <WebCore/Image.h>
-#import <WebCore/KURL.h>
#import <WebCore/WebCoreObjCExtras.h>
+#import <WebKit/DOMCore.h>
+#import <WebKit/DOMExtensions.h>
using namespace WebCore;
@@ -102,6 +100,9 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebElementDictionary class], self))
+ return;
+
delete _result;
[_cache release];
[_nilValues release];
@@ -121,7 +122,7 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
_cacheComplete = YES;
}
-- (unsigned)count
+- (NSUInteger)count
{
if (!_cacheComplete)
[self _fillCache];
@@ -205,7 +206,7 @@ static NSString* NSStringOrNil(String coreString)
- (NSURL *)_absoluteImageURL
{
- return _result->absoluteImageURL().getNSURL();
+ return _result->absoluteImageURL();
}
- (NSNumber *)_isSelected
@@ -220,7 +221,7 @@ static NSString* NSStringOrNil(String coreString)
- (NSURL *)_absoluteLinkURL
{
- return _result->absoluteLinkURL().getNSURL();
+ return _result->absoluteLinkURL();
}
- (WebFrame *)_targetWebFrame
diff --git a/WebKit/mac/Misc/WebGraphicsExtras.c b/WebKit/mac/Misc/WebGraphicsExtras.c
index 0832c6c..4d36b58 100644
--- a/WebKit/mac/Misc/WebGraphicsExtras.c
+++ b/WebKit/mac/Misc/WebGraphicsExtras.c
@@ -29,8 +29,8 @@
#import "WebGraphicsExtras.h"
#import <Accelerate/Accelerate.h>
-#import <JavaScriptCore/Assertions.h>
#import <dlfcn.h>
+#import <wtf/Assertions.h>
unsigned WebConvertBGRAToARGB(unsigned char *offscreenBuffer, int rowBytes, int x, int y, int width, int height)
{
diff --git a/WebKit/mac/Misc/WebIconDatabase.mm b/WebKit/mac/Misc/WebIconDatabase.mm
index 39dbcac..d911f0c 100644
--- a/WebKit/mac/Misc/WebIconDatabase.mm
+++ b/WebKit/mac/Misc/WebIconDatabase.mm
@@ -32,6 +32,7 @@
#import "WebIconDatabaseDelegate.h"
#import "WebKitLogging.h"
#import "WebKitNSStringExtras.h"
+#import "WebNSFileManagerExtras.h"
#import "WebNSNotificationCenterExtras.h"
#import "WebNSURLExtras.h"
#import "WebPreferences.h"
@@ -624,8 +625,8 @@ bool importToWebCoreFormat()
// After we're done importing old style icons over to webcore icons, we delete the entire directory hierarchy
// for the old icon DB (skipping the new iconDB if it is in the same directory)
NSFileManager *fileManager = [NSFileManager defaultManager];
- enumerator = [[fileManager directoryContentsAtPath:databaseDirectory] objectEnumerator];
-
+ enumerator = [[fileManager contentsOfDirectoryAtPath:databaseDirectory error:NULL] objectEnumerator];
+
NSString *databaseFilename = iconDatabase()->defaultDatabaseFilename();
BOOL foundIconDB = NO;
@@ -636,7 +637,7 @@ bool importToWebCoreFormat()
continue;
}
NSString *filePath = [databaseDirectory stringByAppendingPathComponent:file];
- if (![fileManager removeFileAtPath:filePath handler:nil])
+ if (![fileManager removeItemAtPath:filePath error:NULL])
LOG_ERROR("Failed to delete %@ from old icon directory", filePath);
}
diff --git a/WebKit/mac/Misc/WebIconFetcher.h b/WebKit/mac/Misc/WebIconFetcher.h
new file mode 100644
index 0000000..d27ad94
--- /dev/null
+++ b/WebKit/mac/Misc/WebIconFetcher.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 <Cocoa/Cocoa.h>
+
+@class WebIconFetcherPrivate;
+
+@interface WebIconFetcher : NSObject {
+ WebIconFetcherPrivate *_private;
+}
+
+- (void)cancel;
+
+@end
diff --git a/WebKit/mac/Misc/WebIconFetcher.mm b/WebKit/mac/Misc/WebIconFetcher.mm
new file mode 100644
index 0000000..bec7c12
--- /dev/null
+++ b/WebKit/mac/Misc/WebIconFetcher.mm
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 "WebIconFetcher.h"
+
+#import "WebFrameInternal.h"
+#import "WebIconFetcherInternal.h"
+
+#import <WebCore/Frame.h>
+#import <WebCore/IconFetcher.h>
+#import <WebCore/SharedBuffer.h>
+#import <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+class WebIconFetcherClient : public IconFetcherClient {
+public:
+ WebIconFetcherClient(id target, SEL selector)
+ : m_target(target)
+ , m_selector(selector)
+ {
+ }
+
+ virtual void finishedFetchingIcon(PassRefPtr<SharedBuffer> iconData)
+ {
+ RetainPtr<NSData> data;
+ if (iconData)
+ data = iconData->createNSData();
+
+ [m_target performSelector:m_selector withObject:m_fetcher.get() withObject:data.get()];
+
+ delete this;
+ }
+
+ void setFetcher(WebIconFetcher *fetcher) { m_fetcher = fetcher; }
+
+private:
+ RetainPtr<WebIconFetcher> m_fetcher;
+ id m_target;
+ SEL m_selector;
+};
+
+@implementation WebIconFetcher
+
+- (id)init
+{
+ return nil;
+}
+
+- (void)dealloc
+{
+ reinterpret_cast<IconFetcher*>(_private)->deref();
+
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ reinterpret_cast<IconFetcher*>(_private)->deref();
+
+ [super finalize];
+}
+
+- (void)cancel
+{
+ reinterpret_cast<IconFetcher*>(_private)->cancel();
+}
+
+@end
+
+@implementation WebIconFetcher (WebInternal)
+
+- (id)_initWithIconFetcher:(PassRefPtr<IconFetcher>)iconFetcher client:(WebIconFetcherClient *)client
+{
+ ASSERT(iconFetcher);
+
+ self = [super init];
+ if (!self)
+ return nil;
+
+ client->setFetcher(self);
+ _private = reinterpret_cast<WebIconFetcherPrivate*>(iconFetcher.releaseRef());
+
+ return self;
+}
+
++ (WebIconFetcher *)_fetchApplicationIconForFrame:(WebFrame *)webFrame
+ target:(id)target
+ selector:(SEL)selector
+{
+ Frame* frame = core(webFrame);
+
+ WebIconFetcherClient* client = new WebIconFetcherClient(target, selector);
+
+ RefPtr<IconFetcher> fetcher = IconFetcher::create(frame, client);
+
+ if (!fetcher)
+ return nil;
+
+ return [[[WebIconFetcher alloc] _initWithIconFetcher:fetcher.release() client:client] autorelease];
+}
+
+@end
+
diff --git a/WebKit/mac/Misc/WebIconFetcherInternal.h b/WebKit/mac/Misc/WebIconFetcherInternal.h
new file mode 100644
index 0000000..5951ef9
--- /dev/null
+++ b/WebKit/mac/Misc/WebIconFetcherInternal.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 <WebKit/WebIconFetcher.h>
+#import <wtf/Forward.h>
+
+namespace WebCore {
+ class IconFetcher;
+}
+
+@class WebFrame;
+
+@interface WebIconFetcher (WebInternal)
+
++ (WebIconFetcher *)_fetchApplicationIconForFrame:(WebFrame *)webFrame
+ target:(id)target
+ selector:(SEL)selector;
+
+@end
+
diff --git a/WebKit/mac/Misc/WebKitErrors.m b/WebKit/mac/Misc/WebKitErrors.m
index 59561f3..fc739ba 100644
--- a/WebKit/mac/Misc/WebKitErrors.m
+++ b/WebKit/mac/Misc/WebKitErrors.m
@@ -108,7 +108,11 @@ static NSMutableDictionary *descriptions = nil;
NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
if (contentURL) {
[userInfo setObject:contentURL forKey:@"NSErrorFailingURLKey"];
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
[userInfo setObject:[contentURL _web_userVisibleString] forKey:NSErrorFailingURLStringKey];
+#else
+ [userInfo setObject:[contentURL _web_userVisibleString] forKey:NSURLErrorFailingURLStringErrorKey];
+#endif
}
if (pluginPageURL) {
[userInfo setObject:[pluginPageURL _web_userVisibleString] forKey:WebKitErrorPlugInPageURLStringKey];
diff --git a/WebKit/mac/Misc/WebKitLogging.h b/WebKit/mac/Misc/WebKitLogging.h
index 0bf791c..dc37dbf 100644
--- a/WebKit/mac/Misc/WebKitLogging.h
+++ b/WebKit/mac/Misc/WebKitLogging.h
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <JavaScriptCore/Assertions.h>
+#import <wtf/Assertions.h>
#ifndef LOG_CHANNEL_PREFIX
#define LOG_CHANNEL_PREFIX WebKitLog
diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.h b/WebKit/mac/Misc/WebKitNSStringExtras.h
index d7fe47c..47056c6 100644
--- a/WebKit/mac/Misc/WebKitNSStringExtras.h
+++ b/WebKit/mac/Misc/WebKitNSStringExtras.h
@@ -54,4 +54,6 @@
- (NSString *)_webkit_stringByCollapsingWhitespaceCharacters;
- (NSString *)_webkit_fixedCarbonPOSIXPath;
++ (NSString *)_webkit_localCacheDirectoryWithBundleIdentifier:(NSString*)bundleIdentifier;
+
@end
diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.m b/WebKit/mac/Misc/WebKitNSStringExtras.m
index 940e63c..157069a 100644
--- a/WebKit/mac/Misc/WebKitNSStringExtras.m
+++ b/WebKit/mac/Misc/WebKitNSStringExtras.m
@@ -35,6 +35,7 @@
#import <WebCore/WebCoreTextRenderer.h>
#import <unicode/uchar.h>
+#import <sys/param.h>
@implementation NSString (WebKitExtras)
@@ -322,22 +323,38 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
if ([[fileManager _webkit_startupVolumeName] isEqualToString:volumeName]) {
// Startup volume name is included in path, remove it.
[pathComponents removeObjectAtIndex:1];
- } else if ([[fileManager directoryContentsAtPath:@"/Volumes"] containsObject:volumeName]) {
+ } else if ([[fileManager contentsOfDirectoryAtPath:@"/Volumes" error:NULL] containsObject:volumeName]) {
// Path starts with other volume name, prepend "/Volumes".
[pathComponents insertObject:@"Volumes" atIndex:1];
- } else {
+ } else
// It's valid.
return self;
- }
NSString *path = [NSString pathWithComponents:pathComponents];
- if (![fileManager fileExistsAtPath:path]) {
+ if (![fileManager fileExistsAtPath:path])
// File at canonicalized path doesn't exist, return original.
return self;
- }
return path;
}
++ (NSString *)_webkit_localCacheDirectoryWithBundleIdentifier:(NSString*)bundleIdentifier
+{
+ NSString* cacheDir = nil;
+
+#ifdef BUILDING_ON_TIGER
+ cacheDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
+#else
+ char cacheDirectory[MAXPATHLEN];
+ size_t cacheDirectoryLen = confstr(_CS_DARWIN_USER_CACHE_DIR, cacheDirectory, MAXPATHLEN);
+
+ if (cacheDirectoryLen)
+ cacheDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:cacheDirectory length:cacheDirectoryLen - 1];
+#endif
+
+ return [cacheDir stringByAppendingPathComponent:bundleIdentifier];
+}
+
+
@end
diff --git a/WebKit/mac/Misc/WebKitStatistics.m b/WebKit/mac/Misc/WebKitStatistics.m
index 9b4cd4f..3e40324 100644
--- a/WebKit/mac/Misc/WebKitStatistics.m
+++ b/WebKit/mac/Misc/WebKitStatistics.m
@@ -30,7 +30,6 @@
#import "WebKitStatisticsPrivate.h"
-int WebBridgeCount;
int WebViewCount;
int WebDataSourceCount;
int WebFrameCount;
@@ -61,7 +60,8 @@ int WebFrameViewCount;
+ (int)bridgeCount
{
- return WebBridgeCount;
+ // No such thing as a bridge any more. Just return 0.
+ return 0;
}
+ (int)HTMLRepresentationCount
diff --git a/WebKit/mac/Misc/WebKitStatisticsPrivate.h b/WebKit/mac/Misc/WebKitStatisticsPrivate.h
index ed8ce6a..e69bc51 100644
--- a/WebKit/mac/Misc/WebKitStatisticsPrivate.h
+++ b/WebKit/mac/Misc/WebKitStatisticsPrivate.h
@@ -26,7 +26,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-extern int WebBridgeCount;
extern int WebViewCount;
extern int WebDataSourceCount;
extern int WebFrameCount;
diff --git a/WebKit/mac/Misc/WebKitSystemBits.h b/WebKit/mac/Misc/WebKitSystemBits.h
index 99370e0..fe627ee 100644
--- a/WebKit/mac/Misc/WebKitSystemBits.h
+++ b/WebKit/mac/Misc/WebKitSystemBits.h
@@ -32,7 +32,7 @@
extern "C" {
#endif
-vm_size_t WebMemorySize(void);
+uint64_t WebMemorySize(void);
unsigned long long WebVolumeFreeSize(NSString *path);
int WebNumberOfCPUs(void);
diff --git a/WebKit/mac/Misc/WebKitSystemBits.m b/WebKit/mac/Misc/WebKitSystemBits.m
index afa54f2..d64f2de 100644
--- a/WebKit/mac/Misc/WebKitSystemBits.m
+++ b/WebKit/mac/Misc/WebKitSystemBits.m
@@ -26,16 +26,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebKitSystemBits.h>
+#import "WebKitSystemBits.h"
-#import <JavaScriptCore/Assertions.h>
-
-#include <mach/mach.h>
-#include <mach/host_info.h>
-#include <mach/mach_error.h>
-
-#include <sys/types.h>
-#include <sys/sysctl.h>
+#import "WebNSFileManagerExtras.h"
+#import <mach/host_info.h>
+#import <mach/mach.h>
+#import <mach/mach_error.h>
+#import <sys/sysctl.h>
+#import <sys/types.h>
+#import <wtf/Assertions.h>
static host_basic_info_data_t gHostBasicInfo;
static pthread_once_t initControl = PTHREAD_ONCE_INIT;
@@ -56,10 +55,10 @@ static void initCapabilities(void)
}
}
-vm_size_t WebMemorySize(void)
+uint64_t WebMemorySize(void)
{
pthread_once(&initControl, initCapabilities);
- return gHostBasicInfo.memory_size;
+ return gHostBasicInfo.max_mem;
}
int WebNumberOfCPUs(void)
@@ -80,6 +79,6 @@ int WebNumberOfCPUs(void)
unsigned long long WebVolumeFreeSize(NSString *path)
{
- NSDictionary *fileSystemAttributesDictionary = [[NSFileManager defaultManager] fileSystemAttributesAtPath:path];
+ NSDictionary *fileSystemAttributesDictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:path error:NULL];
return [[fileSystemAttributesDictionary objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];
}
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h
index 793dc73..33dc38b 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.h
+++ b/WebKit/mac/Misc/WebKitVersionChecks.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,13 +26,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* Version numbers are based on the 'current library version' specified in the WebKit build rules.
- All of these methods return or take version numbers with each part shifted to the left 2 bytes.
- For example the version 1.2.3 is returned as 0x00010203 and version 200.3.5 is returned as 0x00C80305
- A version of -1 is returned if the main executable did not link against WebKit (should never happen). */
+/*
+ Version numbers are based on the 'current library version' specified in the WebKit build rules.
+ All of these methods return or take version numbers with each part shifted to the left 2 bytes.
+ For example the version 1.2.3 is returned as 0x00010203 and version 200.3.5 is returned as 0x00C80305
+ A version of -1 is returned if the main executable did not link against WebKit (should never happen).
-/* Please use the current WebKit version number, available in WebKit/Configurations/Version.xcconfig,
- when adding a new version constant. */
+ Please use the current WebKit version number, available in WebKit/Configurations/Version.xcconfig,
+ when adding a new version constant.
+*/
#define WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS 0x020A0000 // 522.0.0
#define WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION 0x020A0000 // 522.0.0
@@ -44,6 +46,8 @@
#define WEBKIT_FIRST_VERSION_WITH_CACHE_MODEL_API 0x020B0500 // 523.5.0
#define WEBKIT_FIRST_VERSION_WITHOUT_JAVASCRIPT_RETURN_QUIRK 0x020D0100 // 525.1.0
#define WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH 0x020D0100 // 525.1.0
+#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
#ifdef __cplusplus
extern "C" {
diff --git a/WebKit/mac/Misc/WebLocalizableStrings.m b/WebKit/mac/Misc/WebLocalizableStrings.m
index 6e95be1..0babfbc 100644
--- a/WebKit/mac/Misc/WebLocalizableStrings.m
+++ b/WebKit/mac/Misc/WebLocalizableStrings.m
@@ -28,7 +28,7 @@
#import <WebKit/WebLocalizableStrings.h>
-#import <JavaScriptCore/Assertions.h>
+#import <wtf/Assertions.h>
WebLocalizableStringsBundle WebKitLocalizableStringsBundle = { "com.apple.WebKit", 0 };
diff --git a/WebKit/mac/Misc/WebNSArrayExtras.m b/WebKit/mac/Misc/WebNSArrayExtras.m
index efc655e..b8b9af3 100644
--- a/WebKit/mac/Misc/WebNSArrayExtras.m
+++ b/WebKit/mac/Misc/WebNSArrayExtras.m
@@ -28,7 +28,7 @@
#import "WebNSArrayExtras.h"
-#import <JavaScriptCore/Assertions.h>
+#import <wtf/Assertions.h>
@implementation NSMutableArray (WebExtras)
diff --git a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm
index 04d9075..ef472aa 100644
--- a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm
+++ b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,8 +31,8 @@
#import "DOMRangeInternal.h"
#import "WebDataSourcePrivate.h"
#import "WebFrame.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
+#import "WebTypesInternal.h"
#import <WebCore/BlockExceptions.h>
#import <WebCore/ColorMac.h>
#import <WebCore/CSSHelper.h>
@@ -43,7 +43,6 @@
#import <WebCore/HTMLNames.h>
#import <WebCore/Image.h>
#import <WebCore/InlineTextBox.h>
-#import <WebCore/KURL.h>
#import <WebCore/Range.h>
#import <WebCore/RenderImage.h>
#import <WebCore/RenderListItem.h>
@@ -52,6 +51,7 @@
#import <WebCore/RenderText.h>
#import <WebCore/SimpleFontData.h>
#import <WebCore/Text.h>
+#import <WebCore/TextIterator.h>
using namespace WebCore;
using namespace HTMLNames;
@@ -61,32 +61,6 @@ struct ListItemInfo {
unsigned end;
};
-static Element* listParent(Element* item)
-{
- while (!item->hasTagName(ulTag) && !item->hasTagName(olTag)) {
- item = static_cast<Element*>(item->parentNode());
- if (!item)
- break;
- }
- return item;
-}
-
-static Node* isTextFirstInListItem(Node* e)
-{
- if (!e->isTextNode())
- return 0;
- Node* par = e->parentNode();
- while (par) {
- if (par->firstChild() != e)
- return 0;
- if (par->hasTagName(liTag))
- return par;
- e = par;
- par = par->parentNode();
- }
- return 0;
-}
-
static NSFileWrapper *fileWrapperForElement(Element* e)
{
NSFileWrapper *wrapper = nil;
@@ -94,7 +68,7 @@ static NSFileWrapper *fileWrapperForElement(Element* e)
const AtomicString& attr = e->getAttribute(srcAttr);
if (!attr.isEmpty()) {
- NSURL *URL = KURL(e->document()->completeURL(attr.deprecatedString())).getNSURL();
+ NSURL *URL = e->document()->completeURL(attr);
wrapper = [[kit(e->document()->frame()) _dataSource] _fileWrapperForURL:URL];
}
if (!wrapper) {
@@ -145,417 +119,57 @@ static NSFileWrapper *fileWrapperForElement(Element* e)
return self;
}
-// FIXME: Use WebCore::TextIterator to iterate text runs.
-
+ (NSAttributedString *)_web_attributedStringFromRange:(Range*)range
{
- ListItemInfo info;
- ExceptionCode ec = 0; // dummy variable -- we ignore DOM exceptions
- NSMutableAttributedString *result;
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
- if (!range || !range->boundaryPointsValid())
- return nil;
-
- Node* firstNode = range->startNode();
- if (!firstNode)
- return nil;
- Node* pastEndNode = range->pastEndNode();
-
- int startOffset = range->startOffset(ec);
- int endOffset = range->endOffset(ec);
- Node* endNode = range->endContainer(ec);
-
- result = [[[NSMutableAttributedString alloc] init] autorelease];
-
- bool hasNewLine = true;
- bool addedSpace = true;
- NSAttributedString *pendingStyledSpace = nil;
- bool hasParagraphBreak = true;
- const Element *linkStartNode = 0;
- unsigned linkStartLocation = 0;
- Vector<Element*> listItems;
- Vector<ListItemInfo> listItemLocations;
- float maxMarkerWidth = 0;
-
- Node *currentNode = firstNode;
-
- // If the first item is the entire text of a list item, use the list item node as the start of the
- // selection, not the text node. The user's intent was probably to select the list.
- if (currentNode->isTextNode() && startOffset == 0) {
- Node *startListNode = isTextFirstInListItem(firstNode);
- if (startListNode){
- firstNode = startListNode;
- currentNode = firstNode;
- }
- }
-
- while (currentNode && currentNode != pastEndNode) {
- RenderObject *renderer = currentNode->renderer();
- if (renderer) {
- RenderStyle *style = renderer->style();
- NSFont *font = style->font().primaryFont()->getNSFont();
- bool needSpace = pendingStyledSpace != nil;
- if (currentNode->isTextNode()) {
- if (hasNewLine) {
- addedSpace = true;
- needSpace = false;
- [pendingStyledSpace release];
- pendingStyledSpace = nil;
- hasNewLine = false;
- }
- DeprecatedString text;
- DeprecatedString str = currentNode->nodeValue().deprecatedString();
- int start = (currentNode == firstNode) ? startOffset : -1;
- int end = (currentNode == endNode) ? endOffset : -1;
- if (renderer->isText()) {
- if (!style->collapseWhiteSpace()) {
- if (needSpace && !addedSpace) {
- if (text.isEmpty() && linkStartLocation == [result length])
- ++linkStartLocation;
- [result appendAttributedString:pendingStyledSpace];
- }
- int runStart = (start == -1) ? 0 : start;
- int runEnd = (end == -1) ? str.length() : end;
- text += str.mid(runStart, runEnd-runStart);
- [pendingStyledSpace release];
- pendingStyledSpace = nil;
- addedSpace = u_charDirection(str[runEnd - 1].unicode()) == U_WHITE_SPACE_NEUTRAL;
- }
- else {
- RenderText* textObj = static_cast<RenderText*>(renderer);
- if (!textObj->firstTextBox() && str.length() > 0 && !addedSpace) {
- // We have no runs, but we do have a length. This means we must be
- // whitespace that collapsed away at the end of a line.
- text += ' ';
- addedSpace = true;
- }
- else {
- addedSpace = false;
- for (InlineTextBox* box = textObj->firstTextBox(); box; box = box->nextTextBox()) {
- int runStart = (start == -1) ? box->m_start : start;
- int runEnd = (end == -1) ? box->m_start + box->m_len : end;
- if (runEnd > box->m_start + box->m_len)
- runEnd = box->m_start + box->m_len;
- if (runStart >= box->m_start &&
- runStart < box->m_start + box->m_len) {
- if (box == textObj->firstTextBox() && box->m_start == runStart && runStart > 0)
- needSpace = true; // collapsed space at the start
- if (needSpace && !addedSpace) {
- if (pendingStyledSpace != nil) {
- if (text.isEmpty() && linkStartLocation == [result length])
- ++linkStartLocation;
- [result appendAttributedString:pendingStyledSpace];
- } else
- text += ' ';
- }
- DeprecatedString runText = str.mid(runStart, runEnd - runStart);
- runText.replace('\n', ' ');
- text += runText;
- int nextRunStart = box->nextTextBox() ? box->nextTextBox()->m_start : str.length(); // collapsed space between runs or at the end
- needSpace = nextRunStart > runEnd;
- [pendingStyledSpace release];
- pendingStyledSpace = nil;
- addedSpace = u_charDirection(str[runEnd - 1].unicode()) == U_WHITE_SPACE_NEUTRAL;
- start = -1;
- }
- if (end != -1 && runEnd >= end)
- break;
- }
- }
- }
- }
-
- text.replace('\\', renderer->backslashAsCurrencySymbol());
-
- if (text.length() > 0 || needSpace) {
- NSMutableDictionary *attrs = [[NSMutableDictionary alloc] init];
- [attrs setObject:font forKey:NSFontAttributeName];
- if (style && style->color().isValid() && style->color().alpha() != 0)
- [attrs setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
- if (style && style->backgroundColor().isValid() && style->backgroundColor().alpha() != 0)
- [attrs setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName];
-
- if (text.length() > 0) {
- hasParagraphBreak = false;
- NSAttributedString *partialString = [[NSAttributedString alloc] initWithString:text.getNSString() attributes:attrs];
- [result appendAttributedString: partialString];
- [partialString release];
- }
-
- if (needSpace) {
- [pendingStyledSpace release];
- pendingStyledSpace = [[NSAttributedString alloc] initWithString:@" " attributes:attrs];
- }
-
- [attrs release];
- }
- } else {
- // This is our simple HTML -> ASCII transformation:
- DeprecatedString text;
- if (currentNode->hasTagName(aTag)) {
- // Note the start of the <a> element. We will add the NSLinkAttributeName
- // attribute to the attributed string when navigating to the next sibling
- // of this node.
- linkStartLocation = [result length];
- linkStartNode = static_cast<Element*>(currentNode);
- } else if (currentNode->hasTagName(brTag)) {
- text += "\n";
- hasNewLine = true;
- } else if (currentNode->hasTagName(liTag)) {
- DeprecatedString listText;
- Element *itemParent = listParent(static_cast<Element*>(currentNode));
-
- if (!hasNewLine)
- listText += '\n';
- hasNewLine = true;
-
- listItems.append(static_cast<Element*>(currentNode));
- info.start = [result length];
- info.end = 0;
- listItemLocations.append (info);
-
- listText += '\t';
- if (itemParent && renderer->isListItem()) {
- RenderListItem* listRenderer = static_cast<RenderListItem*>(renderer);
-
- maxMarkerWidth = MAX([font pointSize], maxMarkerWidth);
-
- String marker = listRenderer->markerText();
- if (!marker.isEmpty()) {
- listText += marker.deprecatedString();
- // Use AppKit metrics, since this will be rendered by AppKit.
- NSString *markerNSString = marker;
- float markerWidth = [markerNSString sizeWithAttributes:[NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName]].width;
- maxMarkerWidth = MAX(markerWidth, maxMarkerWidth);
- }
-
- listText += ' ';
- listText += '\t';
-
- NSMutableDictionary *attrs = [[NSMutableDictionary alloc] init];
- [attrs setObject:font forKey:NSFontAttributeName];
- if (style && style->color().isValid())
- [attrs setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
- if (style && style->backgroundColor().isValid())
- [attrs setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName];
-
- NSAttributedString *partialString = [[NSAttributedString alloc] initWithString:listText.getNSString() attributes:attrs];
- [attrs release];
- [result appendAttributedString: partialString];
- [partialString release];
- }
- } else if (currentNode->hasTagName(olTag) || currentNode->hasTagName(ulTag)) {
- if (!hasNewLine)
- text += "\n";
- hasNewLine = true;
- } else if (currentNode->hasTagName(blockquoteTag)
- || currentNode->hasTagName(ddTag)
- || currentNode->hasTagName(divTag)
- || currentNode->hasTagName(dlTag)
- || currentNode->hasTagName(dtTag)
- || currentNode->hasTagName(hrTag)
- || currentNode->hasTagName(listingTag)
- || currentNode->hasTagName(preTag)
- || currentNode->hasTagName(tdTag)
- || currentNode->hasTagName(thTag)) {
- if (!hasNewLine)
- text += '\n';
- hasNewLine = true;
- } else if (currentNode->hasTagName(h1Tag)
- || currentNode->hasTagName(h2Tag)
- || currentNode->hasTagName(h3Tag)
- || currentNode->hasTagName(h4Tag)
- || currentNode->hasTagName(h5Tag)
- || currentNode->hasTagName(h6Tag)
- || currentNode->hasTagName(pTag)
- || currentNode->hasTagName(trTag)) {
- if (!hasNewLine)
- text += '\n';
-
- // In certain cases, emit a paragraph break.
- int bottomMargin = renderer->collapsedMarginBottom();
- int fontSize = style->fontDescription().computedPixelSize();
- if (bottomMargin * 2 >= fontSize) {
- if (!hasParagraphBreak) {
- text += '\n';
- hasParagraphBreak = true;
- }
- }
-
- hasNewLine = true;
- }
- else if (currentNode->hasTagName(imgTag)) {
- if (pendingStyledSpace != nil) {
- if (linkStartLocation == [result length])
- ++linkStartLocation;
- [result appendAttributedString:pendingStyledSpace];
- [pendingStyledSpace release];
- pendingStyledSpace = nil;
- }
- NSFileWrapper *fileWrapper = fileWrapperForElement(static_cast<Element*>(currentNode));
- NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper];
- NSAttributedString *iString = [NSAttributedString attributedStringWithAttachment:attachment];
- [result appendAttributedString: iString];
- [attachment release];
- }
-
- NSAttributedString *partialString = [[NSAttributedString alloc] initWithString:text.getNSString()];
- [result appendAttributedString: partialString];
- [partialString release];
- }
- }
-
- Node *nextNode = currentNode->firstChild();
- if (!nextNode)
- nextNode = currentNode->nextSibling();
-
- while (!nextNode && currentNode->parentNode()) {
- DeprecatedString text;
- currentNode = currentNode->parentNode();
- if (currentNode == pastEndNode)
- break;
- nextNode = currentNode->nextSibling();
-
- if (currentNode->hasTagName(aTag)) {
- // End of a <a> element. Create an attributed string NSLinkAttributeName attribute
- // for the range of the link. Note that we create the attributed string from the DOM, which
- // will have corrected any illegally nested <a> elements.
- if (linkStartNode && currentNode == linkStartNode) {
- String href = parseURL(linkStartNode->getAttribute(hrefAttr));
- KURL kURL = linkStartNode->document()->frame()->loader()->completeURL(href.deprecatedString());
-
- NSURL *URL = kURL.getNSURL();
- NSRange tempRange = { linkStartLocation, [result length]-linkStartLocation }; // workaround for 4213314
- [result addAttribute:NSLinkAttributeName value:URL range:tempRange];
- linkStartNode = 0;
- }
- }
- else if (currentNode->hasTagName(olTag) || currentNode->hasTagName(ulTag)) {
- if (!hasNewLine)
- text += '\n';
- hasNewLine = true;
- } else if (currentNode->hasTagName(liTag)) {
-
- int i, count = listItems.size();
- for (i = 0; i < count; i++){
- if (listItems[i] == currentNode){
- listItemLocations[i].end = [result length];
- break;
- }
- }
- if (!hasNewLine)
- text += '\n';
- hasNewLine = true;
- } else if (currentNode->hasTagName(blockquoteTag) ||
- currentNode->hasTagName(ddTag) ||
- currentNode->hasTagName(divTag) ||
- currentNode->hasTagName(dlTag) ||
- currentNode->hasTagName(dtTag) ||
- currentNode->hasTagName(hrTag) ||
- currentNode->hasTagName(listingTag) ||
- currentNode->hasTagName(preTag) ||
- currentNode->hasTagName(tdTag) ||
- currentNode->hasTagName(thTag)) {
- if (!hasNewLine)
- text += '\n';
- hasNewLine = true;
- } else if (currentNode->hasTagName(pTag) ||
- currentNode->hasTagName(trTag) ||
- currentNode->hasTagName(h1Tag) ||
- currentNode->hasTagName(h2Tag) ||
- currentNode->hasTagName(h3Tag) ||
- currentNode->hasTagName(h4Tag) ||
- currentNode->hasTagName(h5Tag) ||
- currentNode->hasTagName(h6Tag)) {
- if (!hasNewLine)
- text += '\n';
- // An extra newline is needed at the start, not the end, of these types of tags,
- // so don't add another here.
- hasNewLine = true;
- }
-
- NSAttributedString *partialString = [[NSAttributedString alloc] initWithString:text.getNSString()];
- [result appendAttributedString:partialString];
- [partialString release];
- }
-
- currentNode = nextNode;
- }
-
- [pendingStyledSpace release];
-
- // Apply paragraph styles from outside in. This ensures that nested lists correctly
- // override their parent's paragraph style.
- {
- unsigned i, count = listItems.size();
- Element *e;
-
-#ifdef POSITION_LIST
- Node *containingBlock;
- int containingBlockX, containingBlockY;
+ NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init];
+ NSUInteger stringLength = 0;
+ RetainPtr<NSMutableDictionary> attrs(AdoptNS, [[NSMutableDictionary alloc] init]);
+
+ for (TextIterator it(range); !it.atEnd(); it.advance()) {
+ RefPtr<Range> currentTextRange = it.range();
+ ExceptionCode ec = 0;
+ Node* startContainer = currentTextRange->startContainer(ec);
+ Node* endContainer = currentTextRange->endContainer(ec);
+ int startOffset = currentTextRange->startOffset(ec);
+ int endOffset = currentTextRange->endOffset(ec);
- // Determine the position of the outermost containing block. All paragraph
- // styles and tabs should be relative to this position. So, the horizontal position of
- // each item in the list (in the resulting attributed string) will be relative to position
- // of the outermost containing block.
- if (count > 0){
- containingBlock = firstNode;
- while (containingBlock->renderer()->isInline()){
- containingBlock = containingBlock->parentNode();
+ if (startContainer == endContainer && (startOffset == endOffset - 1)) {
+ Node* node = startContainer->childNode(startOffset);
+ if (node && node->hasTagName(imgTag)) {
+ NSFileWrapper *fileWrapper = fileWrapperForElement(static_cast<Element*>(node));
+ NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper];
+ [string appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];
+ [attachment release];
}
- containingBlock->renderer()->absolutePosition(containingBlockX, containingBlockY);
}
-#endif
-
- for (i = 0; i < count; i++){
- e = listItems[i];
- info = listItemLocations[i];
-
- if (info.end < info.start)
- info.end = [result length];
-
- RenderObject *r = e->renderer();
- RenderStyle *style = r->style();
-
- int rx;
- NSFont *font = style->font().primaryFont()->getNSFont();
- float pointSize = [font pointSize];
-#ifdef POSITION_LIST
- int ry;
- r->absolutePosition(rx, ry);
- rx -= containingBlockX;
-
- // Ensure that the text is indented at least enough to allow for the markers.
- rx = MAX(rx, (int)maxMarkerWidth);
-#else
- rx = (int)MAX(maxMarkerWidth, pointSize);
-#endif
-
- // The bullet text will be right aligned at the first tab marker, followed
- // by a space, followed by the list item text. The space is arbitrarily
- // picked as pointSize*2/3. The space on the first line of the text item
- // is established by a left aligned tab, on subsequent lines it's established
- // by the head indent.
- NSMutableParagraphStyle *mps = [[NSMutableParagraphStyle alloc] init];
- [mps setFirstLineHeadIndent: 0];
- [mps setHeadIndent: rx];
- [mps setTabStops:[NSArray arrayWithObjects:
- [[[NSTextTab alloc] initWithType:NSRightTabStopType location:rx-(pointSize*2/3)] autorelease],
- [[[NSTextTab alloc] initWithType:NSLeftTabStopType location:rx] autorelease],
- nil]];
- NSRange tempRange = { info.start, info.end-info.start }; // workaround for 4213314
- [result addAttribute:NSParagraphStyleAttributeName value:mps range:tempRange];
- [mps release];
- }
+ int currentTextLength = it.length();
+ if (!currentTextLength)
+ continue;
+
+ RenderObject* renderer = startContainer->renderer();
+ ASSERT(renderer);
+ if (!renderer)
+ continue;
+ RenderStyle* style = renderer->style();
+ NSFont *font = style->font().primaryFont()->getNSFont();
+ [attrs.get() setObject:font forKey:NSFontAttributeName];
+ if (style->color().isValid())
+ [attrs.get() setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
+ else
+ [attrs.get() removeObjectForKey:NSForegroundColorAttributeName];
+ if (style->backgroundColor().isValid())
+ [attrs.get() setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName];
+ else
+ [attrs.get() removeObjectForKey:NSBackgroundColorAttributeName];
+
+ RetainPtr<NSString> substring(AdoptNS, [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(it.characters()) length:currentTextLength freeWhenDone:NO]);
+ [string replaceCharactersInRange:NSMakeRange(stringLength, 0) withString:substring.get()];
+ [string setAttributes:attrs.get() range:NSMakeRange(stringLength, currentTextLength)];
+ stringLength += currentTextLength;
}
- return result;
-
- END_BLOCK_OBJC_EXCEPTIONS;
-
- return nil;
+ return [string autorelease];
}
@end
diff --git a/WebKit/mac/Misc/WebNSControlExtras.m b/WebKit/mac/Misc/WebNSControlExtras.m
index 733269b..b666131 100644
--- a/WebKit/mac/Misc/WebNSControlExtras.m
+++ b/WebKit/mac/Misc/WebNSControlExtras.m
@@ -42,9 +42,10 @@
frame.origin.y -= heightDelta;
[self setFrame:frame];
- NSRect windowFrame = [[self window] frame];
- windowFrame.size.height += heightDelta;
- [[self window] setFrame:windowFrame display:NO];
+ NSWindow *window = [self window];
+ NSRect windowFrame = [window frame];
+ windowFrame.size.height += heightDelta * [window userSpaceScaleFactor];
+ [window setFrame:windowFrame display:NO];
}
@end
diff --git a/WebKit/mac/Misc/WebNSDataExtras.m b/WebKit/mac/Misc/WebNSDataExtras.m
index a10efcd..0bd4555 100644
--- a/WebKit/mac/Misc/WebNSDataExtras.m
+++ b/WebKit/mac/Misc/WebNSDataExtras.m
@@ -29,7 +29,7 @@
#import <WebKit/WebNSDataExtras.h>
#import <WebKit/WebNSDataExtrasPrivate.h>
-#import <JavaScriptCore/Assertions.h>
+#import <wtf/Assertions.h>
@interface NSString (WebNSDataExtrasInternal)
- (NSString *)_web_capitalizeRFC822HeaderFieldName;
diff --git a/WebKit/mac/Misc/WebNSDictionaryExtras.m b/WebKit/mac/Misc/WebNSDictionaryExtras.m
index 86df63a..665db22 100644
--- a/WebKit/mac/Misc/WebNSDictionaryExtras.m
+++ b/WebKit/mac/Misc/WebNSDictionaryExtras.m
@@ -28,7 +28,7 @@
#import <WebKit/WebNSDataExtras.h>
-#import <JavaScriptCore/Assertions.h>
+#import <wtf/Assertions.h>
@implementation NSDictionary (WebNSDictionaryExtras)
-(NSNumber *)_webkit_numberForKey:(id)key
diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.h b/WebKit/mac/Misc/WebNSFileManagerExtras.h
index aaaf0a7..d6e26ee 100644
--- a/WebKit/mac/Misc/WebNSFileManagerExtras.h
+++ b/WebKit/mac/Misc/WebNSFileManagerExtras.h
@@ -34,8 +34,6 @@
@interface NSFileManager (WebNSFileManagerExtras)
-- (BOOL)_webkit_createDirectoryAtPathWithIntermediateDirectories:(NSString *)path attributes:(NSDictionary *)attributes;
-- (BOOL)_webkit_createFileAtPathWithIntermediateDirectories:(NSString *)path contents:(NSData *)contents attributes:(NSDictionary *)attributes directoryAttributes:(NSDictionary *)directoryAttributes;
- (void)_webkit_backgroundRemoveFileAtPath:(NSString *)path;
- (void)_webkit_backgroundRemoveLeftoverFiles:(NSString *)path;
- (BOOL)_webkit_removeFileOnlyAtPath:(NSString *)path;
@@ -45,3 +43,12 @@
@end
+
+#ifdef BUILDING_ON_TIGER
+@interface NSFileManager (WebNSFileManagerTigerForwardCompatibility)
+- (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error;
+- (BOOL)moveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error;
+- (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error;
+- (NSDictionary *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error;
+@end
+#endif
diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.m b/WebKit/mac/Misc/WebNSFileManagerExtras.m
index ae45afe..0c10725 100644
--- a/WebKit/mac/Misc/WebNSFileManagerExtras.m
+++ b/WebKit/mac/Misc/WebNSFileManagerExtras.m
@@ -28,161 +28,14 @@
#import <WebKit/WebNSFileManagerExtras.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebKitNSStringExtras.h>
#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
#import <sys/mount.h>
@implementation NSFileManager (WebNSFileManagerExtras)
-- (BOOL)_webkit_fileExistsAtPath:(NSString *)path isDirectory:(BOOL *)isDirectory traverseLink:(BOOL)flag
-{
- BOOL result;
- NSDictionary *attributes;
-
- result = NO;
- if (isDirectory) {
- *isDirectory = NO;
- }
-
- attributes = [self fileAttributesAtPath:path traverseLink:flag];
-
- if (attributes) {
- result = YES;
- if ([[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory]) {
- if (isDirectory) {
- *isDirectory = YES;
- }
- }
- }
-
- return result;
-}
-
-- (BOOL)_webkit_createIntermediateDirectoriesForPath:(NSString *)path attributes:(NSDictionary *)attributes
-{
- BOOL result;
- NSArray *pathComponents;
- BOOL isDir;
- unsigned count;
- unsigned i;
- NSString *checkPath;
- NSMutableString *subpath;
-
- if (!path || [path length] == 0 || ![path isAbsolutePath]) {
- return NO;
- }
-
- result = NO;
-
- // check to see if the path to the file already exists
- if ([self _webkit_fileExistsAtPath:[path stringByDeletingLastPathComponent] isDirectory:&isDir traverseLink:YES]) {
- if (isDir) {
- result = YES;
- }
- else {
- result = NO;
- }
- }
- else {
- // create the path to the file
- result = YES;
-
- // assume that most of the path exists, look backwards until we find an existing subpath
- checkPath = path;
- while (![checkPath isEqualToString:@"/"]) {
- checkPath = [checkPath stringByDeletingLastPathComponent];
- if ([self _webkit_fileExistsAtPath:checkPath isDirectory:&isDir traverseLink:YES]) {
- if (isDir) {
- break;
- }
- else {
- // found a leaf node, can't continue
- result = NO;
- break;
- }
- }
- }
-
- if (result) {
- // now build up the path to the point where we found existing paths
- subpath = [[NSMutableString alloc] initWithCapacity:[path length]];
- pathComponents = [path componentsSeparatedByString:@"/"];
- count = [pathComponents count];
- i = 0;
- while (i < count - 1 && ![subpath isEqualToString:checkPath]) {
- if (i > 0) {
- [subpath appendString:@"/"];
- }
- [subpath appendString:[pathComponents objectAtIndex:i]];
- i++;
- }
-
- // now create the parts of the path that did not yet exist
- while (i < count - 1) {
- if ([(NSString *)[pathComponents objectAtIndex:i] length] == 0) {
- continue;
- }
- if (i > 0) {
- [subpath appendString:@"/"];
- }
- [subpath appendString:[pathComponents objectAtIndex:i]];
-
- // does this directory exist?
- if ([self _webkit_fileExistsAtPath:subpath isDirectory:&isDir traverseLink:YES]) {
- if (!isDir) {
- // ran into a leaf node of some sort
- result = NO;
- break;
- }
- }
- else {
- // subpath does not exist - create it
- if (![self createDirectoryAtPath:subpath attributes:attributes]) {
- // failed to create subpath
- result = NO;
- break;
- }
- }
- i++;
- }
-
- [subpath release];
- }
-
- }
-
- return result;
-}
-
-- (BOOL)_webkit_createDirectoryAtPathWithIntermediateDirectories:(NSString *)path attributes:(NSDictionary *)attributes
-{
- // Be really optimistic - assume that in the common case, the directory exists.
- BOOL isDirectory;
- if ([self fileExistsAtPath:path isDirectory:&isDirectory] && isDirectory) {
- return YES;
- }
-
- // Assume the next most common case is that the parent directory already exists
- if ([self createDirectoryAtPath:path attributes:attributes]) {
- return YES;
- }
-
- // Do it the hard way
- return [self _webkit_createIntermediateDirectoriesForPath:path attributes:attributes] && [self createDirectoryAtPath:path attributes:attributes];
-}
-
-- (BOOL)_webkit_createFileAtPathWithIntermediateDirectories:(NSString *)path contents:(NSData *)contents attributes:(NSDictionary *)attributes directoryAttributes:(NSDictionary *)directoryAttributes
-{
- // Be optimistic - try just creating the file first, assuming intermediate directories exist.
- if ([self createFileAtPath:path contents:contents attributes:attributes]) {
- return YES;
- }
-
- return ([self _webkit_createIntermediateDirectoriesForPath:path attributes:directoryAttributes] && [self createFileAtPath:path contents:contents attributes:attributes]);
-}
-
- (BOOL)_webkit_removeFileOnlyAtPath:(NSString *)path
{
struct statfs buf;
@@ -218,10 +71,8 @@
i++;
} while ([manager fileExistsAtPath:moveToPath]);
- if ([manager movePath:path toPath:moveToPath handler:nil]) {
+ if ([manager moveItemAtPath:path toPath:moveToPath error:NULL])
[NSThread detachNewThreadSelector:@selector(_performRemoveFileAtPath:) toTarget:self withObject:moveToPath];
- }
-
}
- (void)_webkit_backgroundRemoveLeftoverFiles:(NSString *)path
@@ -344,3 +195,44 @@
}
@end
+
+
+#ifdef BUILDING_ON_TIGER
+@implementation NSFileManager (WebNSFileManagerTigerForwardCompatibility)
+
+- (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error
+{
+ // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so.
+ ASSERT_ARG(error, !error);
+
+ return [self directoryContentsAtPath:path];
+}
+
+- (NSDictionary *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error
+{
+ // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so.
+ ASSERT_ARG(error, !error);
+
+ return [self fileSystemAttributesAtPath:path];
+}
+
+- (BOOL)moveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error
+{
+ // The implementation of moveItemAtPath:toPath:error: interacts with the NSFileManager's delegate.
+ // We are not matching that behaviour at the moment, but it should not be a problem as any client
+ // expecting that would need to call setDelegate: first which will generate a compile-time warning,
+ // as that method is not available on Tiger.
+ return [self movePath:srcPath toPath:dstPath handler:nil];
+}
+
+- (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error
+{
+ // The implementation of removeItemAtPath:error: interacts with the NSFileManager's delegate.
+ // We are not matching that behaviour at the moment, but it should not be a problem as any client
+ // expecting that would need to call setDelegate: first which will generate a compile-time warning,
+ // as that method is not available on Tiger.
+ return [self removeFileAtPath:path handler:nil];
+}
+
+@end
+#endif
diff --git a/WebKit/mac/Misc/WebNSPasteboardExtras.mm b/WebKit/mac/Misc/WebNSPasteboardExtras.mm
index cdf47cc..b84542a 100644
--- a/WebKit/mac/Misc/WebNSPasteboardExtras.mm
+++ b/WebKit/mac/Misc/WebNSPasteboardExtras.mm
@@ -29,19 +29,18 @@
#import "WebNSPasteboardExtras.h"
#import "WebArchive.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebHTMLViewInternal.h"
#import "WebNSURLExtras.h"
#import "WebResourcePrivate.h"
#import "WebURLsWithTitles.h"
#import "WebViewPrivate.h"
-#import <JavaScriptCore/Assertions.h>
#import <WebCore/Element.h>
#import <WebCore/MIMETypeRegistry.h>
#import <WebCore/RenderImage.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMPrivate.h>
+#import <wtf/Assertions.h>
#import <wtf/RetainPtr.h>
#import <WebKitSystemInterface.h>
diff --git a/WebKit/mac/Misc/WebNSURLExtras.mm b/WebKit/mac/Misc/WebNSURLExtras.mm
index c9efe1d..b388c22 100644
--- a/WebKit/mac/Misc/WebNSURLExtras.mm
+++ b/WebKit/mac/Misc/WebNSURLExtras.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
*
* Redistribution and use in source and binary forms, with or without
@@ -35,10 +35,10 @@
#import "WebNSObjectExtras.h"
#import "WebSystemInterface.h"
#import <Foundation/NSURLRequest.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebCore/KURL.h>
#import <WebCore/LoaderNSURLExtras.h>
#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
#import <unicode/uchar.h>
#import <unicode/uidna.h>
#import <unicode/uscript.h>
@@ -411,22 +411,96 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
+ (NSURL *)_web_URLWithData:(NSData *)data
{
- return urlWithData(data);
+ return [NSURL _web_URLWithData:data relativeToURL:nil];
}
+ (NSURL *)_web_URLWithData:(NSData *)data relativeToURL:(NSURL *)baseURL
{
- return urlWithDataRelativeToURL(data, baseURL);
+ if (data == nil)
+ return nil;
+
+ NSURL *result = nil;
+ size_t length = [data length];
+ if (length > 0) {
+ // work around <rdar://4470771>: CFURLCreateAbsoluteURLWithBytes(.., TRUE) doesn't remove non-path components.
+ baseURL = [baseURL _webkit_URLByRemovingResourceSpecifier];
+
+ const UInt8 *bytes = static_cast<const UInt8*>([data bytes]);
+ // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components
+ // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which
+ // could either be a malformed string or bytes in a different encoding, like shift-jis, so we fall back
+ // onto using ISO Latin 1 in those cases.
+ result = WebCFAutorelease(CFURLCreateAbsoluteURLWithBytes(NULL, bytes, length, kCFStringEncodingUTF8, (CFURLRef)baseURL, YES));
+ if (!result)
+ result = WebCFAutorelease(CFURLCreateAbsoluteURLWithBytes(NULL, bytes, length, kCFStringEncodingISOLatin1, (CFURLRef)baseURL, YES));
+ } else
+ result = [NSURL URLWithString:@""];
+
+ return result;
}
- (NSData *)_web_originalData
{
- return urlOriginalData(self);
+ UInt8 *buffer = (UInt8 *)malloc(URL_BYTES_BUFFER_LENGTH);
+ CFIndex bytesFilled = CFURLGetBytes((CFURLRef)self, buffer, URL_BYTES_BUFFER_LENGTH);
+ if (bytesFilled == -1) {
+ CFIndex bytesToAllocate = CFURLGetBytes((CFURLRef)self, NULL, 0);
+ buffer = (UInt8 *)realloc(buffer, bytesToAllocate);
+ bytesFilled = CFURLGetBytes((CFURLRef)self, buffer, bytesToAllocate);
+ ASSERT(bytesFilled == bytesToAllocate);
+ }
+
+ // buffer is adopted by the NSData
+ NSData *data = [NSData dataWithBytesNoCopy:buffer length:bytesFilled freeWhenDone:YES];
+
+ NSURL *baseURL = (NSURL *)CFURLGetBaseURL((CFURLRef)self);
+ if (baseURL)
+ return [[NSURL _web_URLWithData:data relativeToURL:baseURL] _web_originalData];
+ return data;
}
- (NSString *)_web_originalDataAsString
{
- return urlOriginalDataAsString(self);
+ return [[[NSString alloc] initWithData:[self _web_originalData] encoding:NSISOLatin1StringEncoding] autorelease];
+}
+
+static CFStringRef createStringWithEscapedUnsafeCharacters(CFStringRef string)
+{
+ CFIndex length = CFStringGetLength(string);
+ Vector<UChar, 2048> sourceBuffer(length);
+ CFStringGetCharacters(string, CFRangeMake(0, length), sourceBuffer.data());
+
+ Vector<UChar, 2048> outBuffer;
+
+ CFIndex i = 0;
+ while (i < length) {
+ UChar32 c;
+ U16_NEXT(sourceBuffer, i, length, c)
+
+ if (isLookalikeCharacter(c)) {
+ uint8_t utf8Buffer[4];
+ CFIndex offset = 0;
+ UBool failure = false;
+ U8_APPEND(utf8Buffer, offset, 4, c, failure)
+ ASSERT(!failure);
+
+ for (CFIndex j = 0; j < offset; ++j) {
+ outBuffer.append('%');
+ outBuffer.append(hexDigit(utf8Buffer[j] >> 4));
+ outBuffer.append(hexDigit(utf8Buffer[j] & 0xf));
+ }
+ } else {
+ UChar utf16Buffer[2];
+ CFIndex offset = 0;
+ UBool failure = false;
+ U16_APPEND(utf16Buffer, offset, 2, c, failure)
+ ASSERT(!failure);
+ for (CFIndex j = 0; j < offset; ++j)
+ outBuffer.append(utf16Buffer[j]);
+ }
+ }
+
+ return CFStringCreateWithCharacters(NULL, outBuffer.data(), outBuffer.size());
}
- (NSString *)_web_userVisibleString
@@ -444,28 +518,20 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
int i;
for (i = 0; i < length; i++) {
unsigned char c = p[i];
- // escape control characters, space, and delete
- if (c <= 0x20 || c == 0x7f) {
- *q++ = '%';
- *q++ = hexDigit(c >> 4);
- *q++ = hexDigit(c & 0xf);
- }
// unescape escape sequences that indicate bytes greater than 0x7f
- else if (c == '%' && (i + 1 < length && isHexDigit(p[i + 1])) && i + 2 < length && isHexDigit(p[i + 2])) {
+ if (c == '%' && (i + 1 < length && isHexDigit(p[i + 1])) && i + 2 < length && isHexDigit(p[i + 2])) {
unsigned char u = (hexDigitValue(p[i + 1]) << 4) | hexDigitValue(p[i + 2]);
if (u > 0x7f) {
// unescape
*q++ = u;
- }
- else {
+ } else {
// do not unescape
*q++ = p[i];
*q++ = p[i + 1];
*q++ = p[i + 2];
}
i += 2;
- }
- else {
+ } else {
*q++ = c;
// Check for "xn--" in an efficient, non-case-sensitive, way.
@@ -493,8 +559,7 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
*q++ = '%';
*q++ = hexDigit(c >> 4);
*q++ = hexDigit(c & 0xf);
- }
- else {
+ } else {
*q++ = *p;
}
p++;
@@ -504,14 +569,16 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
}
free(after);
-
- // As an optimization, only do host name decoding if we have "xn--" somewhere.
- return needsHostNameDecoding ? mapHostNames(result, NO) : result;
+
+ result = mapHostNames(result, !needsHostNameDecoding);
+ return WebCFAutorelease(createStringWithEscapedUnsafeCharacters((CFStringRef)result));
}
- (BOOL)_web_isEmpty
{
- return urlIsEmpty(self);
+ if (!CFURLGetBaseURL((CFURLRef)self))
+ return CFURLGetBytes((CFURLRef)self, NULL, 0) == 0;
+ return [[self _web_originalData] length] == 0;
}
- (const char *)_web_URLCString
@@ -523,9 +590,24 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
}
- (NSURL *)_webkit_canonicalize
-{
- InitWebCoreSystemInterface();
- return canonicalURL(self);
+{
+ NSURLRequest *request = [[NSURLRequest alloc] initWithURL:self];
+ Class concreteClass = WKNSURLProtocolClassForRequest(request);
+ if (!concreteClass) {
+ [request release];
+ return self;
+ }
+
+ // This applies NSURL's concept of canonicalization, but not KURL's concept. It would
+ // make sense to apply both, but when we tried that it caused a performance degradation
+ // (see 5315926). It might make sense to apply only the KURL concept and not the NSURL
+ // concept, but it's too risky to make that change for WebKit 3.0.
+ NSURLRequest *newRequest = [concreteClass canonicalRequestForRequest:request];
+ NSURL *newURL = [newRequest URL];
+ NSURL *result = [[newURL retain] autorelease];
+ [request release];
+
+ return result;
}
typedef struct {
@@ -539,21 +621,38 @@ typedef struct {
NSString *fragment;
} WebKitURLComponents;
-
-
- (NSURL *)_webkit_URLByRemovingComponent:(CFURLComponentType)component
{
- return urlByRemovingComponent(self, component);
+ CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)self, component, NULL);
+ // Check to see if a fragment exists before decomposing the URL.
+ if (fragRg.location == kCFNotFound)
+ return self;
+
+ UInt8 *urlBytes, buffer[2048];
+ CFIndex numBytes = CFURLGetBytes((CFURLRef)self, buffer, 2048);
+ if (numBytes == -1) {
+ numBytes = CFURLGetBytes((CFURLRef)self, NULL, 0);
+ urlBytes = static_cast<UInt8*>(malloc(numBytes));
+ CFURLGetBytes((CFURLRef)self, urlBytes, numBytes);
+ } else
+ urlBytes = buffer;
+
+ NSURL *result = (NSURL *)CFMakeCollectable(CFURLCreateWithBytes(NULL, urlBytes, fragRg.location - 1, kCFStringEncodingUTF8, NULL));
+ if (!result)
+ result = (NSURL *)CFMakeCollectable(CFURLCreateWithBytes(NULL, urlBytes, fragRg.location - 1, kCFStringEncodingISOLatin1, NULL));
+
+ if (urlBytes != buffer) free(urlBytes);
+ return result ? [result autorelease] : self;
}
- (NSURL *)_webkit_URLByRemovingFragment
{
- return urlByRemovingFragment(self);
+ return [self _webkit_URLByRemovingComponent:kCFURLComponentFragment];
}
- (NSURL *)_webkit_URLByRemovingResourceSpecifier
{
- return urlByRemovingResourceSpecifier(self);
+ return [self _webkit_URLByRemovingComponent:kCFURLComponentResourceSpecifier];
}
- (BOOL)_webkit_isJavaScriptURL
@@ -567,8 +666,8 @@ typedef struct {
}
- (BOOL)_webkit_isFileURL
-{
- return urlIsFileURL(self);
+{
+ return [[self _web_originalDataAsString] _webkit_isFileURL];
}
- (BOOL)_webkit_isFTPDirectoryURL
@@ -797,13 +896,12 @@ typedef struct {
- (BOOL)_webkit_isFileURL
{
- return stringIsFileURL(self);
+ return [self rangeOfString:@"file:" options:(NSCaseInsensitiveSearch | NSAnchoredSearch)].location != NSNotFound;
}
- (NSString *)_webkit_stringByReplacingValidPercentEscapes
{
- DeprecatedString s = KURL::decode_string(DeprecatedString::fromNSString(self));
- return s.getNSString();
+ return decodeURLEscapeSequences(self);
}
- (NSString *)_webkit_scriptIfJavaScriptURL
diff --git a/WebKit/mac/Misc/WebNSUserDefaultsExtras.m b/WebKit/mac/Misc/WebNSUserDefaultsExtras.m
index b7d297a..383d202 100644
--- a/WebKit/mac/Misc/WebNSUserDefaultsExtras.m
+++ b/WebKit/mac/Misc/WebNSUserDefaultsExtras.m
@@ -26,10 +26,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebNSUserDefaultsExtras.h>
+#import "WebNSUserDefaultsExtras.h"
-#import <JavaScriptCore/Assertions.h>
+#import "WebNSObjectExtras.h"
#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
@implementation NSString (WebNSUserDefaultsPrivate)
@@ -37,7 +38,7 @@
{
// Look up the language code using CFBundle.
NSString *languageCode = self;
- NSString *preferredLanguageCode = [(id)WKCopyCFLocalizationPreferredName((CFStringRef)self) autorelease];
+ NSString *preferredLanguageCode = WebCFAutorelease(WKCopyCFLocalizationPreferredName((CFStringRef)self));
if (preferredLanguageCode)
languageCode = preferredLanguageCode;
diff --git a/WebKit/mac/Misc/WebNSViewExtras.m b/WebKit/mac/Misc/WebNSViewExtras.m
index 189a3bc..70ff68a 100644
--- a/WebKit/mac/Misc/WebNSViewExtras.m
+++ b/WebKit/mac/Misc/WebNSViewExtras.m
@@ -36,7 +36,6 @@
#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebNSURLExtras.h>
#import <WebKit/WebView.h>
-#import <WebKitSystemInterface.h>
#define WebDragStartHysteresisX 5.0f
#define WebDragStartHysteresisY 5.0f
@@ -47,22 +46,6 @@
@implementation NSView (WebExtras)
-// FIXME: Safari 2.0 is the only client of _web_superviewOfClass:stoppingAtClass:
-// remove this method once Open Source users have a new version to use with TOT WebKit.
-- (NSView *)_web_superviewOfClass:(Class)class stoppingAtClass:(Class)limitClass
-{
- NSView *view = self;
- while ((view = [view superview]) != nil) {
- if ([view isKindOfClass:class]) {
- return view;
- } else if (limitClass && [view isKindOfClass:limitClass]) {
- break;
- }
- }
-
- return nil;
-}
-
- (NSView *)_web_superviewOfClass:(Class)class
{
NSView *view = [self superview];
diff --git a/WebKit/mac/Misc/WebNSWindowExtras.m b/WebKit/mac/Misc/WebNSWindowExtras.m
index 49bf006..ef27b13 100644
--- a/WebKit/mac/Misc/WebNSWindowExtras.m
+++ b/WebKit/mac/Misc/WebNSWindowExtras.m
@@ -49,9 +49,4 @@
[self setFrameOrigin:origin];
}
-+ (void)_webkit_displayThrottledWindows
-{
- // this is needed only to keep PLT working on Safari 2.0.4
-}
-
@end
diff --git a/WebKit/mac/Misc/WebSearchableTextView.m b/WebKit/mac/Misc/WebSearchableTextView.m
deleted file mode 100644
index 5f80b46..0000000
--- a/WebKit/mac/Misc/WebSearchableTextView.m
+++ /dev/null
@@ -1,261 +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 "WebSearchableTextView.h"
-#import "WebDocumentPrivate.h"
-#import "WebTypesInternal.h"
-
-@interface NSString (_Web_StringTextFinding)
-- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)mask wrap:(BOOL)wrapFlag;
-@end
-
-@implementation WebSearchableTextView
-
-- (BOOL)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag wrap: (BOOL)wrapFlag;
-{
- if (![string length])
- return NO;
-
- BOOL lastFindWasSuccessful = NO;
- NSString *textContents = [self string];
- unsigned textLength;
-
- if (textContents && (textLength = [textContents length])) {
- NSRange range;
- unsigned options = 0;
-
- if (!forward)
- options |= NSBackwardsSearch;
-
- if (!caseFlag)
- options |= NSCaseInsensitiveSearch;
-
- range = [textContents findString:string selectedRange:[self selectedRange] options:options wrap:wrapFlag];
- if (range.length) {
- [self setSelectedRange:range];
- [self scrollRangeToVisible:range];
- lastFindWasSuccessful = YES;
- }
- }
-
- return lastFindWasSuccessful;
-}
-
-- (void)copy:(id)sender
-{
- if ([self isRichText]) {
- [super copy:sender];
- }else{
- //Convert CRLF to LF to workaround: 3105538 - Carbon doesn't convert text with CRLF to LF
- NSMutableString *string = [[[self string] substringWithRange:[self selectedRange]] mutableCopy];
- [string replaceOccurrencesOfString:@"\r\n" withString:@"\n" options:0 range:NSMakeRange(0, [string length])];
-
- NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
- [pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
- [pasteboard setString:string forType:NSStringPboardType];
- }
-}
-
-- (NSRect)selectionRect
-{
- // Note that this method would work for any NSTextView; some day we might want to use it
- // for an NSTextView that isn't a WebTextView.
- NSRect result = NSZeroRect;
-
- // iterate over multiple selected ranges
- NSEnumerator *rangeEnumerator = [[self selectedRanges] objectEnumerator];
- NSValue *rangeAsValue;
- while ((rangeAsValue = [rangeEnumerator nextObject]) != nil) {
- NSRange range = [rangeAsValue rangeValue];
- NSUInteger rectCount;
- NSRectArray rectArray = [[self layoutManager] rectArrayForCharacterRange:range
- withinSelectedCharacterRange:range
- inTextContainer:[self textContainer]
- rectCount:&rectCount];
- unsigned i;
- // iterate over multiple rects in each selected range
- for (i = 0; i < rectCount; ++i) {
- NSRect rect = rectArray[i];
- if (NSEqualRects(result, NSZeroRect)) {
- result = rect;
- } else {
- result = NSUnionRect(result, rect);
- }
- }
- }
-
- return result;
-}
-
-- (NSImage *)selectionImageForcingBlackText:(BOOL)forceBlackText
-{
- // This is here to complete the <WebDocumentSelection> protocol, but it was introduced after this
- // class was deprecated so there's no implementation.
- return nil;
-}
-
-- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText
-{
- // This is here to complete the <WebDocumentSelection> protocol, but it was introduced after this
- // class was deprecated so there's no implementation.
- return nil;
-}
-
-- (NSRect)selectionImageRect
-{
- // This is here to complete the <WebDocumentSelection> protocol, but it was introduced after this
- // class was deprecated so there's no implementation.
- return NSZeroRect;
-}
-
-- (NSArray *)selectionTextRects
-{
- // This is here to complete the <WebDocumentSelection> protocol, but it was introduced after this
- // class was deprecated so there's no implementation.
- return nil;
-}
-
-- (NSView *)selectionView
-{
- return self;
-}
-
-- (NSArray *)pasteboardTypesForSelection
-{
- return [self writablePasteboardTypes];
-}
-
-- (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard
-{
- [self writeSelectionToPasteboard:pasteboard types:types];
-}
-
-- (BOOL)supportsTextEncoding
-{
- return YES;
-}
-
-- (NSString *)string
-{
- return [super string];
-}
-
-- (NSAttributedString *)attributedString
-{
- return [self attributedSubstringFromRange:NSMakeRange(0, [[self string] length])];
-}
-
-- (NSString *)selectedString
-{
- return [[self string] substringWithRange:[self selectedRange]];
-}
-
-- (NSAttributedString *)selectedAttributedString
-{
- return [self attributedSubstringFromRange:[self selectedRange]];
-}
-
-- (void)selectAll
-{
- [self setSelectedRange:NSMakeRange(0, [[self string] length])];
-}
-
-- (void)deselectAll
-{
- [self setSelectedRange:NSMakeRange(0,0)];
-}
-
-@end
-
-@implementation NSString (_Web_StringTextFinding)
-
-- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)options wrap:(BOOL)wrap
-{
- BOOL forwards = (options & NSBackwardsSearch) == 0;
- unsigned length = [self length];
- NSRange searchRange, range;
-
- // Our search algorithm, used in WebCore also, is to search in the selection first. If the found text is the
- // entire selection, then we search again from just past the selection.
-
- if (forwards) {
- // FIXME: If selectedRange has length of 0, we ignore it, which is appropriate for non-editable text (since
- // a zero-length selection in non-editable is invisible). We might want to change this someday to only ignore the
- // selection if its location is NSNotFound when the text is editable (and similarly for the backwards case).
- searchRange.location = selectedRange.length > 0 ? selectedRange.location : 0;
- searchRange.length = length - searchRange.location;
- range = [self rangeOfString:string options:options range:searchRange];
-
- // If found range matches (non-empty) selection, search again from just past selection
- if (range.location != NSNotFound && NSEqualRanges(range, selectedRange)) {
- searchRange.location = NSMaxRange(selectedRange);
- searchRange.length = length - searchRange.location;
- range = [self rangeOfString:string options:options range:searchRange];
- }
-
- // If not found, search again from the beginning. Make search range large enough that
- // we'll find a match even if it partially overlapped the existing selection (including the
- // case where it exactly matches the existing selection).
- if ((range.length == 0) && wrap) {
- searchRange.location = 0;
- searchRange.length = selectedRange.location + selectedRange.length + [string length];
- if (searchRange.length > length) {
- searchRange.length = length;
- }
- range = [self rangeOfString:string options:options range:searchRange];
- }
- } else {
- searchRange.location = 0;
- searchRange.length = selectedRange.length > 0 ? NSMaxRange(selectedRange) : length;
- range = [self rangeOfString:string options:options range:searchRange];
-
- // If found range matches (non-empty) selection, search again from just before selection
- if (range.location != NSNotFound && NSEqualRanges(range, selectedRange)) {
- searchRange.location = 0;
- searchRange.length = selectedRange.location;
- range = [self rangeOfString:string options:options range:searchRange];
- }
-
- // If not found, search again from the end. Make search range large enough that
- // we'll find a match even if it partially overlapped the existing selection (including the
- // case where it exactly matches the existing selection).
- if ((range.length == 0) && wrap) {
- unsigned stringLength = [string length];
- if (selectedRange.location > stringLength) {
- searchRange.location = selectedRange.location - stringLength;
- } else {
- searchRange.location = 0;
- }
- searchRange.length = length - searchRange.location;
- range = [self rangeOfString:string options:options range:searchRange];
- }
-}
-return range;
-}
-
-@end
diff --git a/WebKit/mac/Misc/WebTypesInternal.h b/WebKit/mac/Misc/WebTypesInternal.h
index 33bdf81..4b97ab3 100644
--- a/WebKit/mac/Misc/WebTypesInternal.h
+++ b/WebKit/mac/Misc/WebTypesInternal.h
@@ -31,11 +31,4 @@ typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
-#ifndef CGFLOAT_DEFINED
-#ifdef __LP64__
-typedef double CGFloat;
-#else
-typedef float CGFloat;
-#endif
-#define CGFLOAT_DEFINED 1
-#endif
+
diff --git a/WebKit/mac/Panels/WebAuthenticationPanel.m b/WebKit/mac/Panels/WebAuthenticationPanel.m
index b6904a1..4e17536 100644
--- a/WebKit/mac/Panels/WebAuthenticationPanel.m
+++ b/WebKit/mac/Panels/WebAuthenticationPanel.m
@@ -31,9 +31,9 @@
#import <Foundation/NSURLAuthenticationChallenge.h>
#import <Foundation/NSURLProtectionSpace.h>
#import <Foundation/NSURLCredential.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebLocalizableStrings.h>
#import <WebKit/WebNSURLExtras.h>
+#import <wtf/Assertions.h>
#import <WebKit/WebNSControlExtras.h>
@@ -122,9 +122,9 @@
NSString *host;
if ([space port] == 0) {
- host = [space host];
+ host = [[space host] _web_decodeHostName];
} else {
- host = [NSString stringWithFormat:@"%@:%u", [space host], [space port]];
+ host = [NSString stringWithFormat:@"%@:%u", [[space host] _web_decodeHostName], [space port]];
}
NSString *realm = [space realm];
diff --git a/WebKit/mac/Panels/WebPanelAuthenticationHandler.m b/WebKit/mac/Panels/WebPanelAuthenticationHandler.m
index f21b9c7..c4c6e5b 100644
--- a/WebKit/mac/Panels/WebPanelAuthenticationHandler.m
+++ b/WebKit/mac/Panels/WebPanelAuthenticationHandler.m
@@ -30,8 +30,8 @@
#import <Foundation/NSURLAuthenticationChallenge.h>
#import <WebKit/WebAuthenticationPanel.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebNSDictionaryExtras.h>
+#import <wtf/Assertions.h>
static NSString *WebModalDialogPretendWindow = @"WebModalDialogPretendWindow";
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h
index 77cf609..c2e8a21 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h
@@ -25,69 +25,109 @@
* (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 __LP64__
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import <Foundation/Foundation.h>
+#import <WebCore/Timer.h>
+#import <WebCore/NetscapePlugInStreamLoader.h>
#import <WebKit/npfunctions.h>
#import <WebKit/WebPlugInStreamLoaderDelegate.h>
+#import <wtf/PassRefPtr.h>
+#import <wtf/RefCounted.h>
+#import <wtf/RefPtr.h>
+#import <wtf/RetainPtr.h>
+
+#import "WebBaseNetscapePluginView.h"
+
+namespace WebCore {
+ class FrameLoader;
+ class NetscapePlugInStreamLoader;
+}
@class WebBaseNetscapePluginView;
@class NSURLResponse;
-@interface WebBaseNetscapePluginStream : NSObject<WebPlugInStreamLoaderDelegate>
+class WebNetscapePluginStream : public RefCounted<WebNetscapePluginStream>
+ , private WebCore::NetscapePlugInStreamLoaderClient
{
- NSMutableData *deliveryData;
- NSURL *requestURL;
- NSURL *responseURL;
- NSString *MIMEType;
+public:
+ static PassRefPtr<WebNetscapePluginStream> create(NSURLRequest *request, NPP plugin, bool sendNotification, void* notifyData)
+ {
+ return adoptRef(new WebNetscapePluginStream(request, plugin, sendNotification, notifyData));
+ }
+ static PassRefPtr<WebNetscapePluginStream> create(WebCore::FrameLoader* frameLoader)
+ {
+ return adoptRef(new WebNetscapePluginStream(frameLoader));
+ }
+ virtual ~WebNetscapePluginStream();
+
+ NPP plugin() const { return m_plugin; }
+ void setPlugin(NPP);
- NPP plugin;
- uint16 transferMode;
- int32 offset;
- NPStream stream;
- NSString *path;
- int fileDescriptor;
- BOOL sendNotification;
- void *notifyData;
- char *headers;
- WebBaseNetscapePluginView *pluginView;
- NPReason reason;
- BOOL isTerminated;
-
- NPP_NewStreamProcPtr NPP_NewStream;
- NPP_DestroyStreamProcPtr NPP_DestroyStream;
- NPP_StreamAsFileProcPtr NPP_StreamAsFile;
- NPP_WriteReadyProcPtr NPP_WriteReady;
- NPP_WriteProcPtr NPP_Write;
- NPP_URLNotifyProcPtr NPP_URLNotify;
-}
+ static NPP ownerForStream(NPStream *);
+
+ static NPReason reasonForError(NSError *);
+ NSError *errorForReason(NPReason) const;
-+ (NPP)ownerForStream:(NPStream *)stream;
-+ (NPReason)reasonForError:(NSError *)error;
+ void cancelLoadAndDestroyStreamWithError(NSError *);
-- (NSError *)errorForReason:(NPReason)theReason;
+ void setRequestURL(NSURL *requestURL) { m_requestURL = requestURL; }
-- (id)initWithRequestURL:(NSURL *)theRequestURL
- plugin:(NPP)thePlugin
- notifyData:(void *)theNotifyData
- sendNotification:(BOOL)flag;
+ void start();
+ void stop();
+
+ void startStreamWithResponse(NSURLResponse *response);
+
+ void didReceiveData(WebCore::NetscapePlugInStreamLoader*, const char* bytes, int length);
+ void destroyStreamWithError(NSError *);
+ void didFinishLoading(WebCore::NetscapePlugInStreamLoader*);
-- (void)setRequestURL:(NSURL *)theRequestURL;
-- (void)setResponseURL:(NSURL *)theResponseURL;
-- (void)setPlugin:(NPP)thePlugin;
+private:
+ void destroyStream();
+ void cancelLoadWithError(NSError *);
+ void destroyStreamWithReason(NPReason);
+ void deliverDataToFile(NSData *data);
+ void deliverData();
+
+ void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, NSString *mimeType, NSData *headers);
+
+ NSError *pluginCancelledConnectionError() const;
-- (uint16)transferMode;
-- (NPP)plugin;
+ // NetscapePlugInStreamLoaderClient methods.
+ void didReceiveResponse(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceResponse&);
+ void didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError&);
+ bool wantsAllStreams() const;
-- (void)startStreamResponseURL:(NSURL *)theResponseURL
- expectedContentLength:(long long)expectedContentLength
- lastModifiedDate:(NSDate *)lastModifiedDate
- MIMEType:(NSString *)MIMEType
- headers:(NSData *)theHeaders;
+ RetainPtr<NSMutableData> m_deliveryData;
+ RetainPtr<NSURL> m_requestURL;
+ RetainPtr<NSURL> m_responseURL;
+ RetainPtr<NSString> m_mimeType;
-// cancelLoadWithError cancels the NSURLConnection and informs WebKit of the load error.
-// This method is overriden by subclasses.
-- (void)cancelLoadWithError:(NSError *)error;
+ NPP m_plugin;
+ uint16 m_transferMode;
+ int32 m_offset;
+ NPStream m_stream;
+ RetainPtr<NSString> m_path;
+ int m_fileDescriptor;
+ BOOL m_sendNotification;
+ void *m_notifyData;
+ char *m_headers;
+ RetainPtr<WebBaseNetscapePluginView> m_pluginView;
+ NPReason m_reason;
+ bool m_isTerminated;
+ bool m_newStreamSuccessful;
+
+ WebCore::FrameLoader* m_frameLoader;
+ RefPtr<WebCore::NetscapePlugInStreamLoader> m_loader;
+ RetainPtr<NSMutableURLRequest> m_request;
+ NPPluginFuncs *m_pluginFuncs;
+
+ void deliverDataTimerFired(WebCore::Timer<WebNetscapePluginStream>* timer);
+ WebCore::Timer<WebNetscapePluginStream> m_deliverDataTimer;
+
+ WebNetscapePluginStream(WebCore::FrameLoader*);
+ WebNetscapePluginStream(NSURLRequest *, NPP, bool sendNotification, void* notifyData);
+};
-@end
#endif
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
index 407c6d0..246a3ca 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
@@ -26,20 +26,28 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebBaseNetscapePluginStream.h"
#import "WebBaseNetscapePluginView.h"
+#import "WebFrameInternal.h"
#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
#import "WebNSObjectExtras.h"
#import "WebNSURLExtras.h"
+#import "WebNSURLRequestExtras.h"
#import "WebNetscapePluginPackage.h"
#import <Foundation/NSURLResponse.h>
+#import <runtime/JSLock.h>
+#import <WebCore/DocumentLoader.h>
+#import <WebCore/Frame.h>
+#import <WebCore/FrameLoader.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebKitSystemInterface.h>
#import <wtf/HashMap.h>
+using namespace WebCore;
+
#define WEB_REASON_NONE -1
static NSString *CarbonPathFromPOSIXPath(NSString *posixPath);
@@ -51,234 +59,181 @@ static StreamMap& streams()
return staticStreams;
}
-@implementation WebBaseNetscapePluginStream
-
-#ifndef BUILDING_ON_TIGER
-+ (void)initialize
-{
- WebCoreObjCFinalizeOnMainThread(self);
-}
-#endif
-
-+ (NPP)ownerForStream:(NPStream *)stream
+NPP WebNetscapePluginStream::ownerForStream(NPStream *stream)
{
return streams().get(stream);
}
-+ (NPReason)reasonForError:(NSError *)error
+NPReason WebNetscapePluginStream::reasonForError(NSError *error)
{
- if (error == nil) {
+ if (!error)
return NPRES_DONE;
- }
- if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled) {
+
+ if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled)
return NPRES_USER_BREAK;
- }
+
return NPRES_NETWORK_ERR;
}
-- (NSError *)_pluginCancelledConnectionError
+NSError *WebNetscapePluginStream::pluginCancelledConnectionError() const
{
return [[[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection
- contentURL:responseURL != nil ? responseURL : requestURL
+ contentURL:m_responseURL ? m_responseURL.get() : m_requestURL.get()
pluginPageURL:nil
- pluginName:[[pluginView pluginPackage] name]
- MIMEType:MIMEType] autorelease];
+ pluginName:[[m_pluginView.get() pluginPackage] name]
+ MIMEType:m_mimeType.get()] autorelease];
}
-- (NSError *)errorForReason:(NPReason)theReason
+NSError *WebNetscapePluginStream::errorForReason(NPReason reason) const
{
- if (theReason == NPRES_DONE) {
+ if (reason == NPRES_DONE)
return nil;
- }
- if (theReason == NPRES_USER_BREAK) {
+
+ if (reason == NPRES_USER_BREAK)
return [NSError _webKitErrorWithDomain:NSURLErrorDomain
code:NSURLErrorCancelled
- URL:responseURL != nil ? responseURL : requestURL];
- }
- return [self _pluginCancelledConnectionError];
+ URL:m_responseURL ? m_responseURL.get() : m_requestURL.get()];
+
+ return pluginCancelledConnectionError();
}
-- (id)initWithRequestURL:(NSURL *)theRequestURL
- plugin:(NPP)thePlugin
- notifyData:(void *)theNotifyData
- sendNotification:(BOOL)flag
+WebNetscapePluginStream::WebNetscapePluginStream(FrameLoader* frameLoader)
+ : m_plugin(0)
+ , m_transferMode(0)
+ , m_offset(0)
+ , m_fileDescriptor(-1)
+ , m_sendNotification(false)
+ , m_notifyData(0)
+ , m_headers(0)
+ , m_reason(NPRES_BASE)
+ , m_isTerminated(false)
+ , m_newStreamSuccessful(false)
+ , m_frameLoader(frameLoader)
+ , m_pluginFuncs(0)
+ , m_deliverDataTimer(this, &WebNetscapePluginStream::deliverDataTimerFired)
{
- [super init];
-
- // Temporarily set isTerminated to YES to avoid assertion failure in dealloc in case we are released in this method.
- isTerminated = YES;
-
- if (theRequestURL == nil || thePlugin == NULL) {
- [self release];
- return nil;
- }
-
- [self setRequestURL:theRequestURL];
- [self setPlugin:thePlugin];
- notifyData = theNotifyData;
- sendNotification = flag;
- fileDescriptor = -1;
-
- streams().add(&stream, thePlugin);
-
- isTerminated = NO;
-
- return self;
+ memset(&m_stream, 0, sizeof(NPStream));
}
-- (void)dealloc
+WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plugin, bool sendNotification, void* notifyData)
+ : m_requestURL([request URL])
+ , m_plugin(0)
+ , m_transferMode(0)
+ , m_offset(0)
+ , m_fileDescriptor(-1)
+ , m_sendNotification(sendNotification)
+ , m_notifyData(notifyData)
+ , m_headers(0)
+ , m_reason(NPRES_BASE)
+ , m_isTerminated(false)
+ , m_newStreamSuccessful(false)
+ , m_frameLoader(0)
+ , m_request(AdoptNS, [request mutableCopy])
+ , m_pluginFuncs(0)
+ , m_deliverDataTimer(this, &WebNetscapePluginStream::deliverDataTimerFired)
{
- ASSERT(!plugin);
- ASSERT(isTerminated);
- ASSERT(stream.ndata == nil);
+ memset(&m_stream, 0, sizeof(NPStream));
- // The stream file should have been deleted, and the path freed, in -_destroyStream
- ASSERT(!path);
- ASSERT(fileDescriptor == -1);
-
- [requestURL release];
- [responseURL release];
- [MIMEType release];
- [pluginView release];
- [deliveryData release];
+ WebBaseNetscapePluginView *view = (WebBaseNetscapePluginView *)plugin->ndata;
- free((void *)stream.url);
- free(path);
- free(headers);
-
- streams().remove(&stream);
-
- [super dealloc];
+ // This check has already been done by the plug-in view.
+ ASSERT(FrameLoader::canLoad([request URL], String(), core([view webFrame])->document()));
+
+ ASSERT([request URL]);
+ ASSERT(plugin);
+
+ setPlugin(plugin);
+
+ streams().add(&m_stream, plugin);
+
+ if (core([view webFrame])->loader()->shouldHideReferrer([request URL], core([view webFrame])->loader()->outgoingReferrer()))
+ [m_request.get() _web_setHTTPReferrer:nil];
+
+ m_loader = NetscapePlugInStreamLoader::create(core([view webFrame]), this);
+ m_loader->setShouldBufferData(false);
}
-- (void)finalize
+WebNetscapePluginStream::~WebNetscapePluginStream()
{
- ASSERT_MAIN_THREAD();
- ASSERT(isTerminated);
- ASSERT(stream.ndata == nil);
-
+ ASSERT(!m_plugin);
+ ASSERT(m_isTerminated);
+ ASSERT(!m_stream.ndata);
+
// The stream file should have been deleted, and the path freed, in -_destroyStream
- ASSERT(!path);
- ASSERT(fileDescriptor == -1);
-
- free((void *)stream.url);
- free(path);
- free(headers);
-
- streams().remove(&stream);
-
- [super finalize];
-}
-
-- (uint16)transferMode
-{
- return transferMode;
-}
-
-- (NPP)plugin
-{
- return plugin;
-}
-
-- (void)setRequestURL:(NSURL *)theRequestURL
-{
- [theRequestURL retain];
- [requestURL release];
- requestURL = theRequestURL;
+ ASSERT(!m_path);
+ ASSERT(m_fileDescriptor == -1);
+
+ free((void *)m_stream.url);
+ free(m_headers);
+
+ streams().remove(&m_stream);
}
-- (void)setResponseURL:(NSURL *)theResponseURL
+void WebNetscapePluginStream::setPlugin(NPP plugin)
{
- [theResponseURL retain];
- [responseURL release];
- responseURL = theResponseURL;
-}
+ if (plugin) {
+ m_plugin = plugin;
+ m_pluginView = static_cast<WebBaseNetscapePluginView *>(m_plugin->ndata);
-- (void)setPlugin:(NPP)thePlugin
-{
- if (thePlugin) {
- plugin = thePlugin;
- pluginView = [(WebBaseNetscapePluginView *)plugin->ndata retain];
- WebNetscapePluginPackage *pluginPackage = [pluginView pluginPackage];
- NPP_NewStream = [pluginPackage NPP_NewStream];
- NPP_WriteReady = [pluginPackage NPP_WriteReady];
- NPP_Write = [pluginPackage NPP_Write];
- NPP_StreamAsFile = [pluginPackage NPP_StreamAsFile];
- NPP_DestroyStream = [pluginPackage NPP_DestroyStream];
- NPP_URLNotify = [pluginPackage NPP_URLNotify];
+ WebNetscapePluginPackage *pluginPackage = [m_pluginView.get() pluginPackage];
+
+ m_pluginFuncs = [pluginPackage pluginFuncs];
} else {
- WebBaseNetscapePluginView *view = pluginView;
-
- plugin = NULL;
- NPP_NewStream = NULL;
- NPP_WriteReady = NULL;
- NPP_Write = NULL;
- NPP_StreamAsFile = NULL;
- NPP_DestroyStream = NULL;
- NPP_URLNotify = NULL;
- pluginView = nil;
-
- [view disconnectStream:self];
- [view release];
- }
-}
-
-- (void)setMIMEType:(NSString *)theMIMEType
-{
- [theMIMEType retain];
- [MIMEType release];
- MIMEType = theMIMEType;
+ WebBaseNetscapePluginView *view = m_pluginView.get();
+ m_plugin = 0;
+ m_pluginFuncs = 0;
+
+ [view disconnectStream:this];
+ m_pluginView = 0;
+ }
}
-- (void)startStreamResponseURL:(NSURL *)URL
- expectedContentLength:(long long)expectedContentLength
- lastModifiedDate:(NSDate *)lastModifiedDate
- MIMEType:(NSString *)theMIMEType
- headers:(NSData *)theHeaders
+void WebNetscapePluginStream::startStream(NSURL *url, long long expectedContentLength, NSDate *lastModifiedDate, NSString *mimeType, NSData *headers)
{
- ASSERT(!isTerminated);
+ ASSERT(!m_isTerminated);
- [self setResponseURL:URL];
- [self setMIMEType:theMIMEType];
+ m_responseURL = url;
+ m_mimeType = mimeType;
- free((void *)stream.url);
- stream.url = strdup([responseURL _web_URLCString]);
-
- stream.ndata = self;
- stream.end = expectedContentLength > 0 ? (uint32)expectedContentLength : 0;
- stream.lastmodified = (uint32)[lastModifiedDate timeIntervalSince1970];
- stream.notifyData = notifyData;
-
- if (theHeaders) {
- unsigned len = [theHeaders length];
- headers = (char*) malloc(len + 1);
- [theHeaders getBytes:headers];
- headers[len] = 0;
- stream.headers = headers;
+ free((void *)m_stream.url);
+ m_stream.url = strdup([m_responseURL.get() _web_URLCString]);
+
+ m_stream.ndata = this;
+ m_stream.end = expectedContentLength > 0 ? (uint32)expectedContentLength : 0;
+ m_stream.lastmodified = (uint32)[lastModifiedDate timeIntervalSince1970];
+ m_stream.notifyData = m_notifyData;
+
+ if (headers) {
+ unsigned len = [headers length];
+ m_headers = (char*) malloc(len + 1);
+ [headers getBytes:m_headers];
+ m_headers[len] = 0;
+ m_stream.headers = m_headers;
}
- transferMode = NP_NORMAL;
- offset = 0;
- reason = WEB_REASON_NONE;
+ m_transferMode = NP_NORMAL;
+ m_offset = 0;
+ m_reason = WEB_REASON_NONE;
// FIXME: If WebNetscapePluginStream called our initializer we wouldn't have to do this here.
- fileDescriptor = -1;
+ m_fileDescriptor = -1;
// FIXME: Need a way to check if stream is seekable
- WebBaseNetscapePluginView *pv = pluginView;
- [pv willCallPlugInFunction];
- NPError npErr = NPP_NewStream(plugin, (char *)[MIMEType UTF8String], &stream, NO, &transferMode);
- [pv didCallPlugInFunction];
- LOG(Plugins, "NPP_NewStream URL=%@ MIME=%@ error=%d", responseURL, MIMEType, npErr);
+ [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];
+ LOG(Plugins, "NPP_NewStream URL=%@ MIME=%@ error=%d", m_responseURL.get(), m_mimeType.get(), npErr);
if (npErr != NPERR_NO_ERROR) {
- LOG_ERROR("NPP_NewStream failed with error: %d responseURL: %@", npErr, responseURL);
+ LOG_ERROR("NPP_NewStream failed with error: %d responseURL: %@", npErr, m_responseURL.get());
// Calling cancelLoadWithError: cancels the load, but doesn't call NPP_DestroyStream.
- [self cancelLoadWithError:[self _pluginCancelledConnectionError]];
+ cancelLoadWithError(pluginCancelledConnectionError());
return;
}
- switch (transferMode) {
+ m_newStreamSuccessful = true;
+
+ switch (m_transferMode) {
case NP_NORMAL:
LOG(Plugins, "Stream type: NP_NORMAL");
break;
@@ -290,18 +245,37 @@ static StreamMap& streams()
break;
case NP_SEEK:
LOG_ERROR("Stream type: NP_SEEK not yet supported");
- [self cancelLoadAndDestroyStreamWithError:[self _pluginCancelledConnectionError]];
+ cancelLoadAndDestroyStreamWithError(pluginCancelledConnectionError());
break;
default:
LOG_ERROR("unknown stream type");
}
}
-- (void)startStreamWithResponse:(NSURLResponse *)r
+void WebNetscapePluginStream::start()
{
+ ASSERT(m_request);
+ ASSERT(!m_frameLoader);
+
+ m_loader->documentLoader()->addPlugInStreamLoader(m_loader.get());
+ m_loader->load(m_request.get());
+}
+
+void WebNetscapePluginStream::stop()
+{
+ ASSERT(!m_frameLoader);
+
+ if (!m_loader->isDone())
+ cancelLoadAndDestroyStreamWithError(m_loader->cancelledError());
+}
+
+void WebNetscapePluginStream::didReceiveResponse(NetscapePlugInStreamLoader*, const ResourceResponse& response)
+{
+ NSURLResponse *r = response.nsURLResponse();
+
NSMutableData *theHeaders = nil;
long long expectedContentLength = [r expectedContentLength];
-
+
if ([r isKindOfClass:[NSHTTPURLResponse class]]) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)r;
theHeaders = [NSMutableData dataWithCapacity:1024];
@@ -318,14 +292,14 @@ static StreamMap& streams()
snprintf(statusStr, sizeof(statusStr), "%ld", statusCode);
[theHeaders appendBytes:statusStr length:strlen(statusStr)];
[theHeaders appendBytes:" OK\n" length:4];
-
+
// HACK: pass the headers through as UTF-8.
// This is not the intended behavior; we're supposed to pass original bytes verbatim.
// But we don't have the original bytes, we have NSStrings built by the URL loading system.
// It hopefully shouldn't matter, since RFC2616/RFC822 require ASCII-only headers,
// but surely someone out there is using non-ASCII characters, and hopefully UTF-8 is adequate here.
// It seems better than NSASCIIStringEncoding, which will lose information if non-ASCII is used.
-
+
NSDictionary *headerDict = [httpResponse allHeaderFields];
NSArray *keys = [[headerDict allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
NSEnumerator *i = [keys objectEnumerator];
@@ -337,212 +311,245 @@ static StreamMap& streams()
[theHeaders appendData:[v dataUsingEncoding:NSUTF8StringEncoding]];
[theHeaders appendBytes:"\n" length:1];
}
-
+
// If the content is encoded (most likely compressed), then don't send its length to the plugin,
// which is only interested in the decoded length, not yet known at the moment.
// <rdar://problem/4470599> tracks a request for -[NSURLResponse expectedContentLength] to incorporate this logic.
NSString *contentEncoding = (NSString *)[[(NSHTTPURLResponse *)r allHeaderFields] objectForKey:@"Content-Encoding"];
if (contentEncoding && ![contentEncoding isEqualToString:@"identity"])
expectedContentLength = -1;
-
+
// startStreamResponseURL:... will null-terminate.
}
+
+ startStream([r URL], expectedContentLength, WKGetNSURLResponseLastModifiedDate(r), [r MIMEType], theHeaders);
+}
- [self startStreamResponseURL:[r URL]
- expectedContentLength:expectedContentLength
- lastModifiedDate:WKGetNSURLResponseLastModifiedDate(r)
- MIMEType:[r MIMEType]
- headers:theHeaders];
+void WebNetscapePluginStream::startStreamWithResponse(NSURLResponse *response)
+{
+ didReceiveResponse(0, response);
}
-- (void)_destroyStream
+bool WebNetscapePluginStream::wantsAllStreams() const
{
- if (isTerminated)
+ if (!m_pluginFuncs->getvalue)
+ return false;
+
+ void *value = 0;
+ NPError error;
+ [m_pluginView.get() willCallPlugInFunction];
+ {
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
+ error = m_pluginFuncs->getvalue(m_plugin, NPPVpluginWantsAllNetworkStreams, &value);
+ }
+ [m_pluginView.get() didCallPlugInFunction];
+ if (error != NPERR_NO_ERROR)
+ return false;
+
+ return value;
+}
+
+void WebNetscapePluginStream::destroyStream()
+{
+ if (m_isTerminated)
return;
- [self retain];
+ RefPtr<WebNetscapePluginStream> protect(this);
- ASSERT(reason != WEB_REASON_NONE);
- ASSERT([deliveryData length] == 0);
+ ASSERT(m_reason != WEB_REASON_NONE);
+ ASSERT([m_deliveryData.get() length] == 0);
- [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_deliverData) object:nil];
+ m_deliverDataTimer.stop();
- if (stream.ndata != nil) {
- if (reason == NPRES_DONE && (transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY)) {
- ASSERT(fileDescriptor == -1);
- ASSERT(path != NULL);
- NSString *carbonPath = CarbonPathFromPOSIXPath(path);
+ if (m_stream.ndata) {
+ if (m_reason == NPRES_DONE && (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)) {
+ ASSERT(m_fileDescriptor == -1);
+ ASSERT(m_path);
+ NSString *carbonPath = CarbonPathFromPOSIXPath(m_path.get());
ASSERT(carbonPath != NULL);
- WebBaseNetscapePluginView *pv = pluginView;
- [pv willCallPlugInFunction];
- NPP_StreamAsFile(plugin, &stream, [carbonPath fileSystemRepresentation]);
- [pv didCallPlugInFunction];
- LOG(Plugins, "NPP_StreamAsFile responseURL=%@ path=%s", responseURL, carbonPath);
+ [m_pluginView.get() willCallPlugInFunction];
+ m_pluginFuncs->asfile(m_plugin, &m_stream, [carbonPath fileSystemRepresentation]);
+ [m_pluginView.get() didCallPlugInFunction];
+ LOG(Plugins, "NPP_StreamAsFile responseURL=%@ path=%s", m_responseURL.get(), carbonPath);
}
- if (path) {
+ if (m_path) {
// Delete the file after calling NPP_StreamAsFile(), instead of in -dealloc/-finalize. It should be OK
// to delete the file here -- NPP_StreamAsFile() is always called immediately before NPP_DestroyStream()
// (the stream destruction function), so there can be no expectation that a plugin will read the stream
// file asynchronously after NPP_StreamAsFile() is called.
- unlink([path fileSystemRepresentation]);
- [path release];
- path = nil;
+ unlink([m_path.get() fileSystemRepresentation]);
+ m_path = 0;
- if (isTerminated)
- goto exit;
+ if (m_isTerminated)
+ return;
}
- if (fileDescriptor != -1) {
+ if (m_fileDescriptor != -1) {
// The file may still be open if we are destroying the stream before it completed loading.
- close(fileDescriptor);
- fileDescriptor = -1;
+ close(m_fileDescriptor);
+ m_fileDescriptor = -1;
}
- NPError npErr;
- WebBaseNetscapePluginView *pv = pluginView;
- [pv willCallPlugInFunction];
- npErr = NPP_DestroyStream(plugin, &stream, reason);
- [pv didCallPlugInFunction];
- LOG(Plugins, "NPP_DestroyStream responseURL=%@ error=%d", responseURL, npErr);
+ if (m_newStreamSuccessful) {
+ [m_pluginView.get() willCallPlugInFunction];
+#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);
+ }
- free(headers);
- headers = NULL;
- stream.headers = NULL;
+ free(m_headers);
+ m_headers = NULL;
+ m_stream.headers = NULL;
- stream.ndata = nil;
+ m_stream.ndata = 0;
- if (isTerminated)
- goto exit;
+ if (m_isTerminated)
+ return;
}
- if (sendNotification) {
+ if (m_sendNotification) {
// NPP_URLNotify expects the request URL, not the response URL.
- WebBaseNetscapePluginView *pv = pluginView;
- [pv willCallPlugInFunction];
- NPP_URLNotify(plugin, [requestURL _web_URLCString], reason, notifyData);
- [pv didCallPlugInFunction];
- LOG(Plugins, "NPP_URLNotify requestURL=%@ reason=%d", requestURL, reason);
+ [m_pluginView.get() willCallPlugInFunction];
+ 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);
}
- isTerminated = YES;
-
- [self setPlugin:NULL];
+ m_isTerminated = true;
-exit:
- [self release];
+ setPlugin(0);
}
-- (void)_destroyStreamWithReason:(NPReason)theReason
+void WebNetscapePluginStream::destroyStreamWithReason(NPReason reason)
{
- reason = theReason;
- if (reason != NPRES_DONE) {
+ m_reason = reason;
+ if (m_reason != NPRES_DONE) {
// Stop any pending data from being streamed.
- [deliveryData setLength:0];
- } else if ([deliveryData length] > 0) {
+ [m_deliveryData.get() setLength:0];
+ } else if ([m_deliveryData.get() length] > 0) {
// There is more data to be streamed, don't destroy the stream now.
return;
}
- [self _destroyStream];
- ASSERT(stream.ndata == nil);
+ destroyStream();
+ ASSERT(!m_stream.ndata);
}
-- (void)cancelLoadWithError:(NSError *)error
+void WebNetscapePluginStream::cancelLoadWithError(NSError *error)
{
- // Overridden by subclasses.
- ASSERT_NOT_REACHED();
+ if (m_frameLoader) {
+ ASSERT(!m_loader);
+
+ DocumentLoader* documentLoader = m_frameLoader->activeDocumentLoader();
+ ASSERT(documentLoader);
+
+ if (documentLoader->isLoadingMainResource())
+ documentLoader->cancelMainResourceLoad(error);
+ return;
+ }
+
+ if (!m_loader->isDone())
+ m_loader->cancel(error);
}
-- (void)destroyStreamWithError:(NSError *)error
+void WebNetscapePluginStream::destroyStreamWithError(NSError *error)
{
- [self _destroyStreamWithReason:[[self class] reasonForError:error]];
+ destroyStreamWithReason(reasonForError(error));
}
-- (void)cancelLoadAndDestroyStreamWithError:(NSError *)error
+void WebNetscapePluginStream::didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError& error)
{
- [self retain];
- [self cancelLoadWithError:error];
- [self destroyStreamWithError:error];
- [self setPlugin:NULL];
- [self release];
+ destroyStreamWithError(error);
}
-- (void)_deliverData
+void WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError(NSError *error)
+{
+ RefPtr<WebNetscapePluginStream> protect(this);
+ cancelLoadWithError(error);
+ destroyStreamWithError(error);
+ setPlugin(0);
+}
+
+void WebNetscapePluginStream::deliverData()
{
- if (!stream.ndata || [deliveryData length] == 0)
+ if (!m_stream.ndata || [m_deliveryData.get() length] == 0)
return;
- [self retain];
+ RefPtr<WebNetscapePluginStream> protect(this);
- int32 totalBytes = [deliveryData length];
+ int32 totalBytes = [m_deliveryData.get() length];
int32 totalBytesDelivered = 0;
while (totalBytesDelivered < totalBytes) {
- WebBaseNetscapePluginView *pv = pluginView;
- [pv willCallPlugInFunction];
- int32 deliveryBytes = NPP_WriteReady(plugin, &stream);
- [pv didCallPlugInFunction];
- LOG(Plugins, "NPP_WriteReady responseURL=%@ bytes=%d", responseURL, deliveryBytes);
+ [m_pluginView.get() willCallPlugInFunction];
+ 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 (isTerminated)
- goto exit;
+ if (m_isTerminated)
+ return;
if (deliveryBytes <= 0) {
// Plug-in can't receive anymore data right now. Send it later.
- [self performSelector:@selector(_deliverData) withObject:nil afterDelay:0];
+ if (!m_deliverDataTimer.isActive())
+ m_deliverDataTimer.startOneShot(0);
break;
} else {
deliveryBytes = MIN(deliveryBytes, totalBytes - totalBytesDelivered);
- NSData *subdata = [deliveryData subdataWithRange:NSMakeRange(totalBytesDelivered, deliveryBytes)];
- pv = pluginView;
- [pv willCallPlugInFunction];
- deliveryBytes = NPP_Write(plugin, &stream, offset, [subdata length], (void *)[subdata bytes]);
- [pv didCallPlugInFunction];
+ NSData *subdata = [m_deliveryData.get() subdataWithRange:NSMakeRange(totalBytesDelivered, deliveryBytes)];
+ [m_pluginView.get() willCallPlugInFunction];
+ 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.
- [self cancelLoadAndDestroyStreamWithError:[self _pluginCancelledConnectionError]];
+ cancelLoadAndDestroyStreamWithError(pluginCancelledConnectionError());
return;
}
deliveryBytes = MIN((unsigned)deliveryBytes, [subdata length]);
- offset += deliveryBytes;
+ m_offset += deliveryBytes;
totalBytesDelivered += deliveryBytes;
- LOG(Plugins, "NPP_Write responseURL=%@ bytes=%d total-delivered=%d/%d", responseURL, deliveryBytes, offset, stream.end);
+ LOG(Plugins, "NPP_Write responseURL=%@ bytes=%d total-delivered=%d/%d", m_responseURL.get(), deliveryBytes, m_offset, m_stream.end);
}
}
if (totalBytesDelivered > 0) {
if (totalBytesDelivered < totalBytes) {
NSMutableData *newDeliveryData = [[NSMutableData alloc] initWithCapacity:totalBytes - totalBytesDelivered];
- [newDeliveryData appendBytes:(char *)[deliveryData bytes] + totalBytesDelivered length:totalBytes - totalBytesDelivered];
- [deliveryData release];
- deliveryData = newDeliveryData;
+ [newDeliveryData appendBytes:(char *)[m_deliveryData.get() bytes] + totalBytesDelivered length:totalBytes - totalBytesDelivered];
+ [m_deliveryData.get() release];
+ m_deliveryData = newDeliveryData;
+ [newDeliveryData release];
} else {
- [deliveryData setLength:0];
- if (reason != WEB_REASON_NONE) {
- [self _destroyStream];
- }
+ [m_deliveryData.get() setLength:0];
+ if (m_reason != WEB_REASON_NONE)
+ destroyStream();
}
}
+}
-exit:
- [self release];
+void WebNetscapePluginStream::deliverDataTimerFired(WebCore::Timer<WebNetscapePluginStream>* timer)
+{
+ deliverData();
}
-- (void)_deliverDataToFile:(NSData *)data
+void WebNetscapePluginStream::deliverDataToFile(NSData *data)
{
- if (fileDescriptor == -1 && !path) {
+ if (m_fileDescriptor == -1 && !m_path) {
NSString *temporaryFileMask = [NSTemporaryDirectory() stringByAppendingPathComponent:@"WebKitPlugInStreamXXXXXX"];
char *temporaryFileName = strdup([temporaryFileMask fileSystemRepresentation]);
- fileDescriptor = mkstemp(temporaryFileName);
- if (fileDescriptor == -1) {
+ m_fileDescriptor = mkstemp(temporaryFileName);
+ if (m_fileDescriptor == -1) {
LOG_ERROR("Can't create a temporary file.");
// This is not a network error, but the only error codes are "network error" and "user break".
- [self _destroyStreamWithReason:NPRES_NETWORK_ERR];
+ destroyStreamWithReason(NPRES_NETWORK_ERR);
free(temporaryFileName);
return;
}
- path = [[NSString stringWithUTF8String:temporaryFileName] retain];
+ m_path.adoptNS([[NSString stringWithUTF8String:temporaryFileName] retain]);
free(temporaryFileName);
}
@@ -550,54 +557,53 @@ exit:
if (!dataLength)
return;
- int byteCount = write(fileDescriptor, [data bytes], dataLength);
+ int byteCount = write(m_fileDescriptor, [data bytes], dataLength);
if (byteCount != dataLength) {
// This happens only rarely, when we are out of disk space or have a disk I/O error.
LOG_ERROR("error writing to temporary file, errno %d", errno);
- close(fileDescriptor);
- fileDescriptor = -1;
+ close(m_fileDescriptor);
+ m_fileDescriptor = -1;
// This is not a network error, but the only error codes are "network error" and "user break".
- [self _destroyStreamWithReason:NPRES_NETWORK_ERR];
- [path release];
- path = nil;
+ destroyStreamWithReason(NPRES_NETWORK_ERR);
+ m_path = 0;
}
}
-- (void)finishedLoading
+void WebNetscapePluginStream::didFinishLoading(NetscapePlugInStreamLoader*)
{
- if (!stream.ndata)
+ if (!m_stream.ndata)
return;
-
- if (transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY) {
+
+ if (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY) {
// Fake the delivery of an empty data to ensure that the file has been created
- [self _deliverDataToFile:[NSData data]];
- if (fileDescriptor != -1)
- close(fileDescriptor);
- fileDescriptor = -1;
+ deliverDataToFile([NSData data]);
+ if (m_fileDescriptor != -1)
+ close(m_fileDescriptor);
+ m_fileDescriptor = -1;
}
-
- [self _destroyStreamWithReason:NPRES_DONE];
+
+ destroyStreamWithReason(NPRES_DONE);
}
-- (void)receivedData:(NSData *)data
+void WebNetscapePluginStream::didReceiveData(NetscapePlugInStreamLoader*, const char* bytes, int length)
{
+ NSData *data = [[NSData alloc] initWithBytesNoCopy:(void*)bytes length:length freeWhenDone:NO];
+
ASSERT([data length] > 0);
- if (transferMode != NP_ASFILEONLY) {
- if (!deliveryData) {
- deliveryData = [[NSMutableData alloc] initWithCapacity:[data length]];
- }
- [deliveryData appendData:data];
- [self _deliverData];
+ if (m_transferMode != NP_ASFILEONLY) {
+ if (!m_deliveryData)
+ m_deliveryData.adoptNS([[NSMutableData alloc] initWithCapacity:[data length]]);
+ [m_deliveryData.get() appendData:data];
+ deliverData();
}
- if (transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY)
- [self _deliverDataToFile:data];
-
+ if (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)
+ deliverDataToFile(data);
+
+ [data release];
}
-@end
-
static NSString *CarbonPathFromPOSIXPath(NSString *posixPath)
{
// Doesn't add a trailing colon for directories; this is a problem for paths to a volume,
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
index cf039ea..909196b 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
@@ -26,32 +26,40 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import <Cocoa/Cocoa.h>
-#import <AGL/agl.h>
#import <WebKit/npfunctions.h>
#import <WebKit/npapi.h>
#import <WebKit/WebBasePluginPackage.h>
+#import <wtf/HashMap.h>
+#import <wtf/HashSet.h>
@class DOMElement;
@class WebDataSource;
@class WebFrame;
@class WebNetscapePluginPackage;
-@class WebNetscapePluginNullEventSender;
-@class WebBaseNetscapePluginStream;
-@class WebNetscapePluginStream;
@class WebView;
+class PluginTimer;
+class WebNetscapePluginStream;
+class WebNetscapePluginEventHandler;
+
typedef union PluginPort {
#ifndef NP_NO_QUICKDRAW
NP_Port qdPort;
#endif
NP_CGContext cgPort;
- NP_GLContext aglPort;
} PluginPort;
-@interface WebBaseNetscapePluginView : NSView <WebPluginManualLoader>
+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 WebBaseNetscapePluginView WebNetscapePluginDocumentView
+
+@interface WebBaseNetscapePluginView : NSView <WebPluginManualLoader, NSTextInput>
{
WebNetscapePluginPackage *pluginPackage;
@@ -59,7 +67,10 @@ typedef union PluginPort {
WebFrame *_webFrame;
BOOL _loadManually;
- WebNetscapePluginStream *_manualStream;
+ RefPtr<WebNetscapePluginStream> _manualStream;
+#ifndef BUILDING_ON_TIGER
+ CALayer *_layer;
+#endif
unsigned _dataLengthReceived;
NSError *_error;
@@ -75,25 +86,27 @@ typedef union PluginPort {
PluginPort nPort;
PluginPort lastSetPort;
NPDrawingModel drawingModel;
+ NPEventModel eventModel;
- // These are only valid when drawingModel is NPDrawingModelOpenGL
- AGLContext aglContext;
- NSWindow *aglWindow;
#ifndef NP_NO_QUICKDRAW
// This is only valid when drawingModel is NPDrawingModelQuickDraw
GWorldPtr offscreenGWorld;
#endif
+ WebNetscapePluginEventHandler *eventHandler;
+
BOOL isStarted;
BOOL inSetWindow;
- BOOL suspendKeyUpEvents;
BOOL hasFocus;
- BOOL currentEventIsUserGesture;
BOOL isTransparent;
BOOL isCompletelyObscured;
BOOL shouldStopSoon;
+ BOOL shouldFireTimers;
+ uint32 currentTimerID;
+ HashMap<uint32, PluginTimer*>* timers;
+
unsigned pluginFunctionCallDepth;
DOMElement *element;
@@ -104,9 +117,11 @@ typedef union PluginPort {
NSString *MIMEType;
NSURL *baseURL;
NSTrackingRectTag trackingTag;
- NSMutableArray *streams;
+
+ HashSet<RefPtr<WebNetscapePluginStream> > streams;
NSMutableDictionary *pendingFrameLoads;
- NSTimer *nullEventTimer;
+
+ NPPluginTextInputFuncs *textInputFuncs;
NPP_NewProcPtr NPP_New;
NPP_DestroyProcPtr NPP_Destroy;
@@ -120,9 +135,7 @@ typedef union PluginPort {
NPP_HandleEventProcPtr NPP_HandleEvent;
NPP_URLNotifyProcPtr NPP_URLNotify;
NPP_GetValueProcPtr NPP_GetValue;
- NPP_SetValueProcPtr NPP_SetValue;
-
- EventHandlerRef keyEventHandler;
+ NPP_SetValueProcPtr NPP_SetValue;
}
+ (WebBaseNetscapePluginView *)currentPluginView;
@@ -142,6 +155,8 @@ typedef union PluginPort {
- (BOOL)start;
- (BOOL)isStarted;
- (void)stop;
+- (void)stopTimers;
+- (void)restartTimers;
- (WebFrame *)webFrame;
- (WebDataSource *)dataSource;
@@ -158,7 +173,7 @@ typedef union PluginPort {
- (void)setMode:(int)theMode;
- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow;
- (void)viewDidMoveToHostWindow;
-- (void)disconnectStream:(WebBaseNetscapePluginStream*)stream;
+- (void)disconnectStream:(WebNetscapePluginStream*)stream;
// Returns the NPObject that represents the plugin interface.
// The return value is expected to be retained.
@@ -177,6 +192,34 @@ typedef union PluginPort {
// See <rdar://problem/4480737>.
- (void)didCallPlugInFunction;
+- (void)handleMouseMoved:(NSEvent *)event;
+
@end
+
+@interface WebBaseNetscapePluginView (WebInternal)
+- (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect;
+- (NPEventModel)eventModel;
+
+- (NPError)loadRequest:(NSURLRequest *)request inTarget:(NSString *)target withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification;
+- (NPError)getURLNotify:(const char *)URL target:(const char *)target notifyData:(void *)notifyData;
+- (NPError)getURL:(const char *)URL target:(const char *)target;
+- (NPError)postURLNotify:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file notifyData:(void *)notifyData;
+- (NPError)postURL:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file;
+- (NPError)newStream:(NPMIMEType)type target:(const char *)target stream:(NPStream**)stream;
+- (NPError)write:(NPStream*)stream len:(SInt32)len buffer:(void *)buffer;
+- (NPError)destroyStream:(NPStream*)stream reason:(NPReason)reason;
+- (void)status:(const char *)message;
+- (const char *)userAgent;
+- (void)invalidateRect:(NPRect *)invalidRect;
+- (void)invalidateRegion:(NPRegion)invalidateRegion;
+- (void)forceRedraw;
+- (NPError)getVariable:(NPNVariable)variable value:(void *)value;
+- (NPError)setVariable:(NPPVariable)variable value:(void *)value;
+- (uint32)scheduleTimerWithInterval:(uint32)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32 timerID))timerFunc;
+- (void)unscheduleTimer:(uint32)timerID;
+- (NPError)popUpContextMenu:(NPMenu *)menu;
+
+@end
+
#endif
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index 00a7b7d..2097673 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -26,13 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebBaseNetscapePluginView.h"
#import "WebDataSourceInternal.h"
#import "WebDefaultUIDelegate.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebFrameView.h"
#import "WebGraphicsExtras.h"
@@ -46,73 +45,51 @@
#import "WebNSURLRequestExtras.h"
#import "WebNSViewExtras.h"
#import "WebNetscapePluginPackage.h"
-#import "WebNetscapePluginStream.h"
+#import "WebBaseNetscapePluginStream.h"
+#import "WebNetscapePluginEventHandler.h"
#import "WebNullPluginView.h"
#import "WebPreferences.h"
#import "WebViewInternal.h"
#import "WebUIDelegatePrivate.h"
#import <Carbon/Carbon.h>
-#import <JavaScriptCore/Assertions.h>
-#import <JavaScriptCore/JSLock.h>
-#import <JavaScriptCore/npruntime_impl.h>
+#import <runtime/JSLock.h>
+#import <WebCore/npruntime_impl.h>
#import <WebCore/Document.h>
+#import <WebCore/DocumentLoader.h>
#import <WebCore/Element.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameTree.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 <WebKit/DOMPrivate.h>
#import <WebKit/WebUIDelegate.h>
+#import <wtf/Assertions.h>
#import <objc/objc-runtime.h>
using namespace WebCore;
-// Send null events 50 times a second when active, so plug-ins like Flash get high frame rates.
-#define NullEventIntervalActive 0.02
-#define NullEventIntervalNotActive 0.25
-
#define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification"
#define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification"
-SOFT_LINK_FRAMEWORK(OpenGL)
-SOFT_LINK_FRAMEWORK(AGL)
-
-SOFT_LINK(OpenGL, CGLGetOffScreen, CGLError, (CGLContextObj ctx, GLsizei *width, GLsizei *height, GLint *rowbytes, void **baseaddr), (ctx, width, height, rowbytes, baseaddr))
-SOFT_LINK(OpenGL, CGLSetOffScreen, CGLError, (CGLContextObj ctx, GLsizei width, GLsizei height, GLint rowbytes, void *baseaddr), (ctx, width, height, rowbytes, baseaddr))
-SOFT_LINK(OpenGL, glViewport, void, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height))
-SOFT_LINK(AGL, aglCreateContext, AGLContext, (AGLPixelFormat pix, AGLContext share), (pix, share))
-SOFT_LINK(AGL, aglSetWindowRef, GLboolean, (AGLContext ctx, WindowRef window), (ctx, window))
-SOFT_LINK(AGL, aglSetDrawable, GLboolean, (AGLContext ctx, AGLDrawable draw), (ctx, draw))
-#ifndef BUILDING_ON_TIGER
-SOFT_LINK(AGL, aglChoosePixelFormat, AGLPixelFormat, (const void *gdevs, GLint ndev, const GLint *attribs), (gdevs, ndev, attribs))
+static inline bool isDrawingModelQuickDraw(NPDrawingModel drawingModel)
+{
+#ifndef NP_NO_QUICKDRAW
+ return drawingModel == NPDrawingModelQuickDraw;
#else
-SOFT_LINK(AGL, aglChoosePixelFormat, AGLPixelFormat, (const AGLDevice *gdevs, GLint ndev, const GLint *attribs), (gdevs, ndev, attribs))
+ return false;
#endif
-SOFT_LINK(AGL, aglDestroyPixelFormat, void, (AGLPixelFormat pix), (pix))
-SOFT_LINK(AGL, aglDestroyContext, GLboolean, (AGLContext ctx), (ctx))
-SOFT_LINK(AGL, aglGetCGLContext, GLboolean, (AGLContext ctx, void **cgl_ctx), (ctx, cgl_ctx))
-SOFT_LINK(AGL, aglGetCurrentContext, AGLContext, (void), ())
-SOFT_LINK(AGL, aglSetCurrentContext, GLboolean, (AGLContext ctx), (ctx))
-SOFT_LINK(AGL, aglGetError, GLenum, (void), ())
-SOFT_LINK(AGL, aglUpdateContext, GLboolean, (AGLContext ctx), (ctx))
-SOFT_LINK(AGL, aglErrorString, const GLubyte *, (GLenum code), (code))
+};
@interface WebBaseNetscapePluginView (Internal)
- (void)_viewHasMoved;
- (NPError)_createPlugin;
- (void)_destroyPlugin;
- (NSBitmapImageRep *)_printedPluginBitmap;
-- (BOOL)_createAGLContextIfNeeded;
-- (BOOL)_createWindowedAGLContext;
-- (BOOL)_createWindowlessAGLContext;
-- (CGLContextObj)_cglContext;
-- (BOOL)_getAGLOffscreenBuffer:(GLvoid **)outBuffer width:(GLsizei *)outWidth height:(GLsizei *)outHeight;
-- (void)_destroyAGLContext;
-- (void)_reshapeAGLWindow;
-- (void)_hideAGLWindow;
-- (NSImage *)_aglOffscreenImageForDrawingInRect:(NSRect)drawingInRect;
- (void)_redeliverStream;
@end
@@ -120,6 +97,47 @@ static WebBaseNetscapePluginView *currentPluginView = nil;
typedef struct OpaquePortState* PortState;
+static const double ThrottledTimerInterval = 0.25;
+
+class PluginTimer : public TimerBase {
+public:
+ typedef void (*TimerFunc)(NPP npp, uint32 timerID);
+
+ PluginTimer(NPP npp, uint32 timerID, uint32 interval, NPBool repeat, TimerFunc timerFunc)
+ : m_npp(npp)
+ , m_timerID(timerID)
+ , m_interval(interval)
+ , m_repeat(repeat)
+ , m_timerFunc(timerFunc)
+ {
+ }
+
+ void start(bool throttle)
+ {
+ ASSERT(!isActive());
+
+ double timeInterval = throttle ? ThrottledTimerInterval : m_interval / 1000.0;
+ if (m_repeat)
+ startRepeating(timeInterval);
+ else
+ startOneShot(timeInterval);
+ }
+
+private:
+ virtual void fired()
+ {
+ m_timerFunc(m_npp, m_timerID);
+ if (!m_repeat)
+ delete this;
+ }
+
+ NPP m_npp;
+ uint32 m_timerID;
+ uint32 m_interval;
+ NPBool m_repeat;
+ TimerFunc m_timerFunc;
+};
+
#ifndef NP_NO_QUICKDRAW
// QuickDraw is not available in 64-bit
@@ -140,9 +158,10 @@ typedef struct {
CGContextRef context;
} PortState_CG;
-typedef struct {
- AGLContext oldContext;
-} PortState_GL;
+@class NSTextInputContext;
+@interface NSResponder (AppKitDetails)
+- (NSTextInputContext *)inputContext;
+@end
@interface WebPluginRequest : NSObject
{
@@ -168,8 +187,6 @@ typedef struct {
- (NSInteger)_web_locationAfterFirstBlankLine;
@end
-static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *pluginView);
-
@interface WebBaseNetscapePluginView (ForwardDeclarations)
- (void)setWindowIfNecessary;
- (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification;
@@ -187,72 +204,6 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
#pragma mark EVENTS
-+ (void)getCarbonEvent:(EventRecord *)carbonEvent
-{
- carbonEvent->what = nullEvent;
- carbonEvent->message = 0;
- carbonEvent->when = TickCount();
-
- GetGlobalMouse(&carbonEvent->where);
- carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor());
- carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor());
- carbonEvent->modifiers = GetCurrentKeyModifiers();
- if (!Button())
- carbonEvent->modifiers |= btnState;
-}
-
-- (void)getCarbonEvent:(EventRecord *)carbonEvent
-{
- [[self class] getCarbonEvent:carbonEvent];
-}
-
-- (EventModifiers)modifiersForEvent:(NSEvent *)event
-{
- EventModifiers modifiers;
- unsigned int modifierFlags = [event modifierFlags];
- NSEventType eventType = [event type];
-
- modifiers = 0;
-
- if (eventType != NSLeftMouseDown && eventType != NSRightMouseDown)
- modifiers |= btnState;
-
- if (modifierFlags & NSCommandKeyMask)
- modifiers |= cmdKey;
-
- if (modifierFlags & NSShiftKeyMask)
- modifiers |= shiftKey;
-
- if (modifierFlags & NSAlphaShiftKeyMask)
- modifiers |= alphaLock;
-
- if (modifierFlags & NSAlternateKeyMask)
- modifiers |= optionKey;
-
- if (modifierFlags & NSControlKeyMask || eventType == NSRightMouseDown)
- modifiers |= controlKey;
-
- return modifiers;
-}
-
-- (void)getCarbonEvent:(EventRecord *)carbonEvent withEvent:(NSEvent *)cocoaEvent
-{
- if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) {
- carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor());
- carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor());
- return;
- }
-
- NSPoint where = [[cocoaEvent window] convertBaseToScreen:[cocoaEvent locationInWindow]];
-
- carbonEvent->what = nullEvent;
- carbonEvent->message = 0;
- carbonEvent->when = (UInt32)([cocoaEvent timestamp] * 60); // seconds to ticks
- carbonEvent->where.h = (short)where.x;
- carbonEvent->where.v = (short)(NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - where.y);
- carbonEvent->modifiers = [self modifiersForEvent:cocoaEvent];
-}
-
- (BOOL)superviewsHaveSuperviews
{
NSView *contentView = [[self window] contentView];
@@ -265,14 +216,14 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
return NO;
}
-#ifndef NP_NO_QUICKDRAW
// The WindowRef created by -[NSWindow windowRef] has a QuickDraw GrafPort that covers
// the entire window frame (or structure region to use the Carbon term) rather then just the window content.
// We can remove this when <rdar://problem/4201099> is fixed.
- (void)fixWindowPort
{
- ASSERT(drawingModel == NPDrawingModelQuickDraw);
+#ifndef NP_NO_QUICKDRAW
+ ASSERT(isDrawingModelQuickDraw(drawingModel));
NSWindow *currentWindow = [self currentWindow];
if ([currentWindow isKindOfClass:objc_getClass("NSCarbonWindow")])
@@ -290,8 +241,10 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
PortSize(static_cast<short>(contentRect.size.width), static_cast<short>(contentRect.size.height));
SetPort(oldPort);
+#endif
}
+#ifndef NP_NO_QUICKDRAW
static UInt32 getQDPixelFormatForBitmapContext(CGContextRef context)
{
UInt32 byteOrder = CGBitmapContextGetBitmapInfo(context) & kCGBitmapByteOrderMask;
@@ -345,18 +298,14 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
- (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate
{
+ ASSERT(drawingModel != NPDrawingModelCoreAnimation);
ASSERT([self currentWindow] != nil);
-#ifndef NP_NO_QUICKDRAW
// If drawing with QuickDraw, fix the window port so that it has the same bounds as the NSWindow's
// content view. This makes it easier to convert between AppKit view and QuickDraw port coordinates.
- if (drawingModel == NPDrawingModelQuickDraw)
+ if (isDrawingModelQuickDraw(drawingModel))
[self fixWindowPort];
-#endif
- WindowRef windowRef = (WindowRef)[[self currentWindow] windowRef];
- ASSERT(windowRef);
-
// Use AppKit to convert view coordinates to NSWindow coordinates.
NSRect boundsInWindow = [self convertRect:[self bounds] toView:nil];
NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
@@ -367,8 +316,11 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
visibleRectInWindow.origin.y = borderViewHeight - NSMaxY(visibleRectInWindow);
#ifndef NP_NO_QUICKDRAW
+ WindowRef windowRef = (WindowRef)[[self currentWindow] windowRef];
+ ASSERT(windowRef);
+
// Look at the Carbon port to convert top-left-based window coordinates into top-left-based content coordinates.
- if (drawingModel == NPDrawingModelQuickDraw) {
+ if (isDrawingModelQuickDraw(drawingModel)) {
::Rect portBounds;
CGrafPtr port = GetWindowPort(windowRef);
GetPortBounds(port, &portBounds);
@@ -508,35 +460,38 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
window.clipRect.left + nPort.qdPort.portx, window.clipRect.top + nPort.qdPort.porty,
window.clipRect.right + nPort.qdPort.portx, window.clipRect.bottom + nPort.qdPort.porty);
- // Clip to dirty region so plug-in does not draw over already-drawn regions of the window that are
- // not going to be redrawn this update. This forces plug-ins to play nice with z-index ordering.
- if (forUpdate) {
- RgnHandle viewClipRegion = NewRgn();
-
- // Get list of dirty rects from the opaque ancestor -- WebKit does some tricks with invalidation and
- // display to enable z-ordering for NSViews; a side-effect of this is that only the WebHTMLView
- // knows about the true set of dirty rects.
- NSView *opaqueAncestor = [self opaqueAncestor];
- const NSRect *dirtyRects;
- NSInteger dirtyRectCount, dirtyRectIndex;
- [opaqueAncestor getRectsBeingDrawn:&dirtyRects count:&dirtyRectCount];
-
- for (dirtyRectIndex = 0; dirtyRectIndex < dirtyRectCount; dirtyRectIndex++) {
- NSRect dirtyRect = [self convertRect:dirtyRects[dirtyRectIndex] fromView:opaqueAncestor];
- if (!NSEqualSizes(dirtyRect.size, NSZeroSize)) {
- // Create a region for this dirty rect
- RgnHandle dirtyRectRegion = NewRgn();
- SetRectRgn(dirtyRectRegion, static_cast<short>(NSMinX(dirtyRect)), static_cast<short>(NSMinY(dirtyRect)), static_cast<short>(NSMaxX(dirtyRect)), static_cast<short>(NSMaxY(dirtyRect)));
-
- // Union this dirty rect with the rest of the dirty rects
- UnionRgn(viewClipRegion, dirtyRectRegion, viewClipRegion);
- DisposeRgn(dirtyRectRegion);
+ // Clip to the dirty region if drawing to a window. When drawing to another bitmap context, do not clip.
+ if ([NSGraphicsContext currentContext] == [[self currentWindow] graphicsContext]) {
+ // Clip to dirty region so plug-in does not draw over already-drawn regions of the window that are
+ // not going to be redrawn this update. This forces plug-ins to play nice with z-index ordering.
+ if (forUpdate) {
+ RgnHandle viewClipRegion = NewRgn();
+
+ // Get list of dirty rects from the opaque ancestor -- WebKit does some tricks with invalidation and
+ // display to enable z-ordering for NSViews; a side-effect of this is that only the WebHTMLView
+ // knows about the true set of dirty rects.
+ NSView *opaqueAncestor = [self opaqueAncestor];
+ const NSRect *dirtyRects;
+ NSInteger dirtyRectCount, dirtyRectIndex;
+ [opaqueAncestor getRectsBeingDrawn:&dirtyRects count:&dirtyRectCount];
+
+ for (dirtyRectIndex = 0; dirtyRectIndex < dirtyRectCount; dirtyRectIndex++) {
+ NSRect dirtyRect = [self convertRect:dirtyRects[dirtyRectIndex] fromView:opaqueAncestor];
+ if (!NSEqualSizes(dirtyRect.size, NSZeroSize)) {
+ // Create a region for this dirty rect
+ RgnHandle dirtyRectRegion = NewRgn();
+ SetRectRgn(dirtyRectRegion, static_cast<short>(NSMinX(dirtyRect)), static_cast<short>(NSMinY(dirtyRect)), static_cast<short>(NSMaxX(dirtyRect)), static_cast<short>(NSMaxY(dirtyRect)));
+
+ // Union this dirty rect with the rest of the dirty rects
+ UnionRgn(viewClipRegion, dirtyRectRegion, viewClipRegion);
+ DisposeRgn(dirtyRectRegion);
+ }
}
+
+ // Intersect the dirty region with the clip region, so that we only draw over dirty parts
+ SectRgn(clipRegion, viewClipRegion, clipRegion);
+ DisposeRgn(viewClipRegion);
}
-
- // Intersect the dirty region with the clip region, so that we only draw over dirty parts
- SectRgn(clipRegion, viewClipRegion, clipRegion);
- DisposeRgn(viewClipRegion);
}
// Switch to the port and set it up.
@@ -570,72 +525,33 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
cgPortState->context = context;
// Update the plugin's window/context
- nPort.cgPort.window = windowRef;
+#ifdef NP_NO_CARBON
+ nPort.cgPort.window = (NPNSWindow *)[self currentWindow];
+#else
+ nPort.cgPort.window = eventHandler->platformWindow([self currentWindow]);
+#endif /* NP_NO_CARBON */
nPort.cgPort.context = context;
window.window = &nPort.cgPort;
// Save current graphics context's state; will be restored by -restorePortState:
CGContextSaveGState(context);
-
- // Get list of dirty rects from the opaque ancestor -- WebKit does some tricks with invalidation and
- // display to enable z-ordering for NSViews; a side-effect of this is that only the WebHTMLView
- // knows about the true set of dirty rects.
- NSView *opaqueAncestor = [self opaqueAncestor];
- const NSRect *dirtyRects;
- NSInteger count;
- [opaqueAncestor getRectsBeingDrawn:&dirtyRects count:&count];
- Vector<CGRect, 16> convertedDirtyRects;
- convertedDirtyRects.resize(count);
- for (int i = 0; i < count; ++i)
- reinterpret_cast<NSRect&>(convertedDirtyRects[i]) = [self convertRect:dirtyRects[i] fromView:opaqueAncestor];
- CGContextClipToRects(context, convertedDirtyRects.data(), count);
- break;
- }
-
- case NPDrawingModelOpenGL: {
- ASSERT([NSView focusView] == self);
-
- // Clear the "current" window and context -- they will be assigned below (if all goes well)
- nPort.aglPort.window = NULL;
- nPort.aglPort.context = NULL;
-
- // Create AGL context if needed
- if (![self _createAGLContextIfNeeded]) {
- LOG_ERROR("Could not create AGL context");
- return NULL;
- }
-
- // Update the plugin's window/context
- nPort.aglPort.window = windowRef;
- nPort.aglPort.context = [self _cglContext];
- window.window = &nPort.aglPort;
-
- // Save/set current AGL context
- PortState_GL *glPortState = (PortState_GL *)malloc(sizeof(PortState_GL));
- portState = (PortState)glPortState;
- glPortState->oldContext = aglGetCurrentContext();
- aglSetCurrentContext(aglContext);
-
- // Adjust viewport according to clip
- switch (window.type) {
- case NPWindowTypeWindow:
- glViewport(static_cast<GLint>(NSMinX(boundsInWindow) - NSMinX(visibleRectInWindow)),
- static_cast<GLint>(NSMaxY(visibleRectInWindow) - NSMaxY(boundsInWindow)),
- window.width, window.height);
- break;
-
- case NPWindowTypeDrawable: {
- GLsizei width, height;
- if ([self _getAGLOffscreenBuffer:NULL width:&width height:&height])
- glViewport(0, 0, width, height);
- break;
- }
-
- default:
- ASSERT_NOT_REACHED();
- break;
+ // Clip to the dirty region if drawing to a window. When drawing to another bitmap context, do not clip.
+ if ([NSGraphicsContext currentContext] == [[self currentWindow] graphicsContext]) {
+ // Get list of dirty rects from the opaque ancestor -- WebKit does some tricks with invalidation and
+ // display to enable z-ordering for NSViews; a side-effect of this is that only the WebHTMLView
+ // knows about the true set of dirty rects.
+ NSView *opaqueAncestor = [self opaqueAncestor];
+ const NSRect *dirtyRects;
+ NSInteger count;
+ [opaqueAncestor getRectsBeingDrawn:&dirtyRects count:&count];
+ Vector<CGRect, 16> convertedDirtyRects;
+ convertedDirtyRects.resize(count);
+ for (int i = 0; i < count; ++i)
+ reinterpret_cast<NSRect&>(convertedDirtyRects[i]) = [self convertRect:dirtyRects[i] fromView:opaqueAncestor];
+ CGContextClipToRects(context, convertedDirtyRects.data(), count);
}
+
break;
}
@@ -655,6 +571,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
- (void)restorePortState:(PortState)portState
{
+ if (drawingModel == NPDrawingModelCoreAnimation)
+ return;
+
ASSERT([self currentWindow]);
ASSERT(portState);
@@ -690,31 +609,19 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
ASSERT(((PortState_CG *)portState)->context == nPort.cgPort.context);
CGContextRestoreGState(nPort.cgPort.context);
break;
-
- case NPDrawingModelOpenGL:
- aglSetCurrentContext(((PortState_GL *)portState)->oldContext);
- break;
-
+
default:
ASSERT_NOT_REACHED();
break;
}
}
-- (BOOL)sendEvent:(EventRecord *)event
+- (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect
{
if (![self window])
return NO;
ASSERT(event);
-
- // If at any point the user clicks or presses a key from within a plugin, set the
- // currentEventIsUserGesture flag to true. This is important to differentiate legitimate
- // window.open() calls; we still want to allow those. See rdar://problem/4010765
- if (event->what == mouseDown || event->what == keyDown || event->what == mouseUp || event->what == autoKey)
- currentEventIsUserGesture = YES;
-
- suspendKeyUpEvents = NO;
-
+
if (!isStarted)
return NO;
@@ -738,26 +645,24 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
if (!wasDeferring)
page->setDefersLoading(true);
- // Can only send updateEvt to CoreGraphics and OpenGL plugins when actually drawing
- ASSERT((drawingModel != NPDrawingModelCoreGraphics && drawingModel != NPDrawingModelOpenGL) || event->what != updateEvt || [NSView focusView] == self);
+ // Can only send drawRect (updateEvt) to CoreGraphics plugins when actually drawing
+ ASSERT((drawingModel != NPDrawingModelCoreGraphics) || !eventIsDrawRect || [NSView focusView] == self);
- BOOL updating = event->what == updateEvt;
- PortState portState;
- if ((drawingModel != NPDrawingModelCoreGraphics && drawingModel != NPDrawingModelOpenGL) || event->what == updateEvt) {
- // In CoreGraphics or OpenGL mode, the port state only needs to be saved/set when redrawing the plug-in view. The plug-in is not
- // allowed to draw at any other time.
- portState = [self saveAndSetNewPortStateForUpdate:updating];
-
+ PortState portState = NULL;
+
+ if (isDrawingModelQuickDraw(drawingModel) || (drawingModel != NPDrawingModelCoreAnimation && eventIsDrawRect)) {
+ // In CoreGraphics mode, the port state only needs to be saved/set when redrawing the plug-in view.
+ // The plug-in is not allowed to draw at any other time.
+ portState = [self saveAndSetNewPortStateForUpdate:eventIsDrawRect];
// We may have changed the window, so inform the plug-in.
[self setWindowIfNecessary];
- } else
- portState = NULL;
+ }
#if !defined(NDEBUG) && !defined(NP_NO_QUICKDRAW)
// Draw green to help debug.
// If we see any green we know something's wrong.
// Note that PaintRect() only works for QuickDraw plugins; otherwise the current QD port is undefined.
- if (drawingModel == NPDrawingModelQuickDraw && !isTransparent && event->what == updateEvt) {
+ if (isDrawingModelQuickDraw(drawingModel) && !isTransparent && eventIsDrawRect) {
ForeColor(greenColor);
const ::Rect bigRect = { -10000, -10000, 10000, 10000 };
PaintRect(&bigRect);
@@ -771,13 +676,11 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
BOOL acceptedEvent;
[self willCallPlugInFunction];
{
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
acceptedEvent = NPP_HandleEvent(plugin, event);
}
[self didCallPlugInFunction];
-
- currentEventIsUserGesture = NO;
-
+
if (portState) {
if ([self currentWindow])
[self restorePortState:portState];
@@ -792,85 +695,61 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
- (void)sendActivateEvent:(BOOL)activate
{
- EventRecord event;
-
- [self getCarbonEvent:&event];
- event.what = activateEvt;
- WindowRef windowRef = (WindowRef)[[self window] windowRef];
- event.message = (unsigned long)windowRef;
- if (activate) {
- event.modifiers |= activeFlag;
- }
-
- BOOL acceptedEvent;
- acceptedEvent = [self sendEvent:&event];
-
- LOG(PluginEvents, "NPP_HandleEvent(activateEvent): %d isActive: %d", acceptedEvent, activate);
+ if (!isStarted)
+ return;
+
+ eventHandler->windowFocusChanged(activate);
}
-- (BOOL)sendUpdateEvent
+- (void)sendDrawRectEvent:(NSRect)rect
{
- EventRecord event;
+ ASSERT(eventHandler);
- [self getCarbonEvent:&event];
- event.what = updateEvt;
- WindowRef windowRef = (WindowRef)[[self window] windowRef];
- event.message = (unsigned long)windowRef;
-
- BOOL acceptedEvent = [self sendEvent:&event];
-
- LOG(PluginEvents, "NPP_HandleEvent(updateEvt): %d", acceptedEvent);
-
- return acceptedEvent;
+ eventHandler->drawRect(rect);
}
--(void)sendNullEvent
+- (void)stopTimers
{
- EventRecord event;
-
- [self getCarbonEvent:&event];
-
- // Plug-in should not react to cursor position when not active or when a menu is down.
- MenuTrackingData trackingData;
- OSStatus error = GetMenuTrackingData(NULL, &trackingData);
-
- // Plug-in should not react to cursor position when the actual window is not key.
- if (![[self window] isKeyWindow] || (error == noErr && trackingData.menu)) {
- // FIXME: Does passing a v and h of -1 really prevent it from reacting to the cursor position?
- event.where.v = -1;
- event.where.h = -1;
- }
+ if (eventHandler)
+ eventHandler->stopTimers();
- [self sendEvent:&event];
-}
+ shouldFireTimers = NO;
+
+ if (!timers)
+ return;
-- (void)stopNullEvents
-{
- [nullEventTimer invalidate];
- [nullEventTimer release];
- nullEventTimer = nil;
+ HashMap<uint32, PluginTimer*>::const_iterator end = timers->end();
+ for (HashMap<uint32, PluginTimer*>::const_iterator it = timers->begin(); it != end; ++it) {
+ PluginTimer* timer = it->second;
+ timer->stop();
+ }
}
-- (void)restartNullEvents
+- (void)restartTimers
{
ASSERT([self window]);
- if (nullEventTimer)
- [self stopNullEvents];
+ if (shouldFireTimers)
+ [self stopTimers];
if (!isStarted || [[self window] isMiniaturized])
return;
- NSTimeInterval interval;
-
+ shouldFireTimers = YES;
+
// If the plugin is completely obscured (scrolled out of view, for example), then we will
// send null events at a reduced rate.
- interval = !isCompletelyObscured ? NullEventIntervalActive : NullEventIntervalNotActive;
- nullEventTimer = [[NSTimer scheduledTimerWithTimeInterval:interval
- target:self
- selector:@selector(sendNullEvent)
- userInfo:nil
- repeats:YES] retain];
+ eventHandler->startTimers(isCompletelyObscured);
+
+ if (!timers)
+ return;
+
+ HashMap<uint32, PluginTimer*>::const_iterator end = timers->end();
+ for (HashMap<uint32, PluginTimer*>::const_iterator it = timers->begin(); it != end; ++it) {
+ PluginTimer* timer = it->second;
+ ASSERT(!timer->isActive());
+ timer->start(isCompletelyObscured);
+ }
}
- (BOOL)acceptsFirstResponder
@@ -878,50 +757,21 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
return YES;
}
-- (void)installKeyEventHandler
-{
- static const EventTypeSpec sTSMEvents[] =
- {
- { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }
- };
-
- if (!keyEventHandler) {
- InstallEventHandler(GetWindowEventTarget((WindowRef)[[self window] windowRef]),
- NewEventHandlerUPP(TSMEventHandler),
- GetEventTypeCount(sTSMEvents),
- sTSMEvents,
- self,
- &keyEventHandler);
- }
-}
-
-- (void)removeKeyEventHandler
-{
- if (keyEventHandler) {
- RemoveEventHandler(keyEventHandler);
- keyEventHandler = NULL;
- }
-}
-
- (void)setHasFocus:(BOOL)flag
{
- if (hasFocus != flag) {
- hasFocus = flag;
- EventRecord event;
- [self getCarbonEvent:&event];
- BOOL acceptedEvent;
- if (hasFocus) {
- event.what = getFocusEvent;
- acceptedEvent = [self sendEvent:&event];
- LOG(PluginEvents, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent);
- [self installKeyEventHandler];
- } else {
- event.what = loseFocusEvent;
- acceptedEvent = [self sendEvent:&event];
- LOG(PluginEvents, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent);
- [self removeKeyEventHandler];
- }
- }
+ if (!isStarted)
+ return;
+
+ if (hasFocus == flag)
+ return;
+
+ hasFocus = flag;
+
+ // We need to null check the event handler here because
+ // the plug-in view can resign focus after it's been stopped
+ // and the event handler has been deleted.
+ if (eventHandler)
+ eventHandler->focusChanged(hasFocus);
}
- (BOOL)becomeFirstResponder
@@ -950,193 +800,131 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
- (void)mouseDown:(NSEvent *)theEvent
{
- EventRecord event;
-
- [self getCarbonEvent:&event withEvent:theEvent];
- event.what = mouseDown;
+ if (!isStarted)
+ return;
- BOOL acceptedEvent;
- acceptedEvent = [self sendEvent:&event];
-
- LOG(PluginEvents, "NPP_HandleEvent(mouseDown): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
+ eventHandler->mouseDown(theEvent);
}
- (void)mouseUp:(NSEvent *)theEvent
{
- EventRecord event;
-
- [self getCarbonEvent:&event withEvent:theEvent];
- event.what = mouseUp;
+ if (!isStarted)
+ return;
- BOOL acceptedEvent;
- acceptedEvent = [self sendEvent:&event];
-
- LOG(PluginEvents, "NPP_HandleEvent(mouseUp): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
+ eventHandler->mouseUp(theEvent);
}
- (void)mouseEntered:(NSEvent *)theEvent
{
- EventRecord event;
-
- [self getCarbonEvent:&event withEvent:theEvent];
- event.what = adjustCursorEvent;
-
- BOOL acceptedEvent;
- acceptedEvent = [self sendEvent:&event];
+ if (!isStarted)
+ return;
- LOG(PluginEvents, "NPP_HandleEvent(mouseEntered): %d", acceptedEvent);
+ eventHandler->mouseEntered(theEvent);
}
- (void)mouseExited:(NSEvent *)theEvent
{
- EventRecord event;
-
- [self getCarbonEvent:&event withEvent:theEvent];
- event.what = adjustCursorEvent;
-
- BOOL acceptedEvent;
- acceptedEvent = [self sendEvent:&event];
+ if (!isStarted)
+ return;
+ eventHandler->mouseExited(theEvent);
+
// Set cursor back to arrow cursor. Because NSCursor doesn't know about changes that the plugin made, we could get confused about what we think the
// current cursor is otherwise. Therefore we have no choice but to unconditionally reset the cursor when the mouse exits the plugin.
[[NSCursor arrowCursor] set];
-
- LOG(PluginEvents, "NPP_HandleEvent(mouseExited): %d", acceptedEvent);
}
+// We can't name this method mouseMoved because we don't want to override
+// the NSView mouseMoved implementation.
+- (void)handleMouseMoved:(NSEvent *)theEvent
+{
+ if (!isStarted)
+ return;
+
+ eventHandler->mouseMoved(theEvent);
+}
+
- (void)mouseDragged:(NSEvent *)theEvent
{
- // Do nothing so that other responders don't respond to the drag that initiated in this view.
+ if (!isStarted)
+ return;
+
+ eventHandler->mouseDragged(theEvent);
}
-- (UInt32)keyMessageForEvent:(NSEvent *)event
+- (void)scrollWheel:(NSEvent *)theEvent
{
- NSData *data = [[event characters] dataUsingEncoding:CFStringConvertEncodingToNSStringEncoding(CFStringGetSystemEncoding())];
- if (!data) {
- return 0;
+ if (!isStarted) {
+ [super scrollWheel:theEvent];
+ return;
}
- UInt8 characterCode;
- [data getBytes:&characterCode length:1];
- UInt16 keyCode = [event keyCode];
- return keyCode << 8 | characterCode;
+
+ if (!eventHandler->scrollWheel(theEvent))
+ [super scrollWheel:theEvent];
}
- (void)keyUp:(NSEvent *)theEvent
{
- WKSendKeyEventToTSM(theEvent);
-
- // TSM won't send keyUp events so we have to send them ourselves.
- // Only send keyUp events after we receive the TSM callback because this is what plug-in expect from OS 9.
- if (!suspendKeyUpEvents) {
- EventRecord event;
-
- [self getCarbonEvent:&event withEvent:theEvent];
- event.what = keyUp;
-
- if (event.message == 0) {
- event.message = [self keyMessageForEvent:theEvent];
- }
-
- [self sendEvent:&event];
- }
+ if (!isStarted)
+ return;
+
+ eventHandler->keyUp(theEvent);
}
- (void)keyDown:(NSEvent *)theEvent
{
- suspendKeyUpEvents = YES;
- WKSendKeyEventToTSM(theEvent);
-}
-
-static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *pluginView)
-{
- EventRef rawKeyEventRef;
- OSStatus status = GetEventParameter(inEvent, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL, sizeof(EventRef), NULL, &rawKeyEventRef);
- if (status != noErr) {
- LOG_ERROR("GetEventParameter failed with error: %d", status);
- return noErr;
- }
-
- // Two-pass read to allocate/extract Mac charCodes
- ByteCount numBytes;
- status = GetEventParameter(rawKeyEventRef, kEventParamKeyMacCharCodes, typeChar, NULL, 0, &numBytes, NULL);
- if (status != noErr) {
- LOG_ERROR("GetEventParameter failed with error: %d", status);
- return noErr;
- }
- char *buffer = (char *)malloc(numBytes);
- status = GetEventParameter(rawKeyEventRef, kEventParamKeyMacCharCodes, typeChar, NULL, numBytes, NULL, buffer);
- if (status != noErr) {
- LOG_ERROR("GetEventParameter failed with error: %d", status);
- free(buffer);
- return noErr;
- }
-
- EventRef cloneEvent = CopyEvent(rawKeyEventRef);
- unsigned i;
- for (i = 0; i < numBytes; i++) {
- status = SetEventParameter(cloneEvent, kEventParamKeyMacCharCodes, typeChar, 1 /* one char code */, &buffer[i]);
- if (status != noErr) {
- LOG_ERROR("SetEventParameter failed with error: %d", status);
- free(buffer);
- return noErr;
- }
-
- EventRecord eventRec;
- if (ConvertEventRefToEventRecord(cloneEvent, &eventRec)) {
- BOOL acceptedEvent;
- acceptedEvent = [(WebBaseNetscapePluginView *)pluginView sendEvent:&eventRec];
-
- LOG(PluginEvents, "NPP_HandleEvent(keyDown): %d charCode:%c keyCode:%lu",
- acceptedEvent, (char) (eventRec.message & charCodeMask), (eventRec.message & keyCodeMask));
-
- // We originally thought that if the plug-in didn't accept this event,
- // we should pass it along so that keyboard scrolling, for example, will work.
- // In practice, this is not a good idea, because plug-ins tend to eat the event but return false.
- // MacIE handles each key event twice because of this, but we will emulate the other browsers instead.
- }
- }
- ReleaseEvent(cloneEvent);
-
- free(buffer);
+ if (!isStarted)
+ return;
- return noErr;
+ eventHandler->keyDown(theEvent);
}
-// Fake up command-modified events so cut, copy, paste and select all menus work.
-- (void)sendModifierEventWithKeyCode:(int)keyCode character:(char)character
+- (void)flagsChanged:(NSEvent *)theEvent
{
- EventRecord event;
- [self getCarbonEvent:&event];
- event.what = keyDown;
- event.modifiers |= cmdKey;
- event.message = keyCode << 8 | character;
- [self sendEvent:&event];
+ if (!isStarted)
+ return;
+
+ eventHandler->flagsChanged(theEvent);
}
- (void)cut:(id)sender
{
- [self sendModifierEventWithKeyCode:7 character:'x'];
+ if (!isStarted)
+ return;
+
+ eventHandler->keyDown([NSApp currentEvent]);
}
- (void)copy:(id)sender
{
- [self sendModifierEventWithKeyCode:8 character:'c'];
+ if (!isStarted)
+ return;
+
+ eventHandler->keyDown([NSApp currentEvent]);
}
- (void)paste:(id)sender
{
- [self sendModifierEventWithKeyCode:9 character:'v'];
+ if (!isStarted)
+ return;
+
+ eventHandler->keyDown([NSApp currentEvent]);
}
- (void)selectAll:(id)sender
{
- [self sendModifierEventWithKeyCode:0 character:'a'];
+ if (!isStarted)
+ return;
+
+ eventHandler->keyDown([NSApp currentEvent]);
}
#pragma mark WEB_NETSCAPE_PLUGIN
- (BOOL)isNewWindowEqualToOldWindow
{
+ ASSERT(drawingModel != NPDrawingModelCoreAnimation);
+
if (window.x != lastSetWindow.x)
return NO;
if (window.y != lastSetWindow.y)
@@ -1174,14 +962,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if (nPort.cgPort.context != lastSetPort.cgPort.context)
return NO;
break;
-
- case NPDrawingModelOpenGL:
- if (nPort.aglPort.window != lastSetPort.aglPort.window)
- return NO;
- if (nPort.aglPort.context != lastSetPort.aglPort.context)
- return NO;
- break;
-
+
default:
ASSERT_NOT_REACHED();
break;
@@ -1192,6 +973,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
- (void)updateAndSetWindow
{
+ ASSERT(drawingModel != NPDrawingModelCoreAnimation);
+
// 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
@@ -1200,10 +983,24 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// NPP_SetWindow() with an empty NPWindow struct.
if (!isStarted)
return;
+#ifdef NP_NO_QUICKDRAW
+ if (![self canDraw])
+ return;
+#else
if (drawingModel != NPDrawingModelQuickDraw && ![self canDraw])
return;
+#endif // NP_NO_QUICKDRAW
BOOL didLockFocus = [NSView focusView] != self && [self lockFocusIfCanDraw];
+
+ if (drawingModel == NPDrawingModelCoreGraphics || isDrawingModelQuickDraw(drawingModel)) {
+ [self setWindowIfNecessary];
+ if (didLockFocus)
+ [self unlockFocus];
+
+ return;
+ }
+
PortState portState = [self saveAndSetNewPortState];
if (portState) {
[self setWindowIfNecessary];
@@ -1216,6 +1013,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
- (void)setWindowIfNecessary
{
+ ASSERT(drawingModel != NPDrawingModelCoreAnimation);
+
if (!isStarted) {
return;
}
@@ -1230,12 +1029,12 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
inSetWindow = YES;
- // A CoreGraphics or OpenGL plugin's window may only be set while the plugin is being updated
- ASSERT((drawingModel != NPDrawingModelCoreGraphics && drawingModel != NPDrawingModelOpenGL) || [NSView focusView] == self);
+ // A CoreGraphics plugin's window may only be set while the plugin is being updated
+ ASSERT((drawingModel != NPDrawingModelCoreGraphics) || [NSView focusView] == self);
[self willCallPlugInFunction];
{
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
npErr = NPP_SetWindow(plugin, &window);
}
[self didCallPlugInFunction];
@@ -1254,12 +1053,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
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);
break;
-
- case NPDrawingModelOpenGL:
- LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d",
- npErr, nPort.aglPort.window, nPort.aglPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height);
- break;
-
+
default:
ASSERT_NOT_REACHED();
break;
@@ -1383,6 +1177,9 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// Initialize drawingModel to an invalid value so that we can detect when the plugin does not specify a drawingModel
drawingModel = (NPDrawingModel)-1;
+ // Initialize eventModel to an invalid value so that we can detect when the plugin does not specify an event model.
+ eventModel = (NPEventModel)-1;
+
// Plug-ins are "windowed" by default. On MacOS, windowed plug-ins share the same window and graphics port as the main
// browser window. Windowless plug-ins are rendered off-screen, then copied into the main browser window.
window.type = NPWindowTypeWindow;
@@ -1400,26 +1197,71 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// Default to QuickDraw if the plugin did not specify a drawing model.
drawingModel = NPDrawingModelQuickDraw;
#else
- // QuickDraw is not available, so we can't default to it. We could default to CoreGraphics instead, but
- // if the plugin did not specify the CoreGraphics drawing model then it must be one of the old QuickDraw
- // plugins. Thus, the plugin is unsupported and should not be started. Destroy it here and bail out.
- LOG(Plugins, "Plugin only supports QuickDraw, but QuickDraw is unavailable: %@", pluginPackage);
+ // QuickDraw is not available, so we can't default to it. Instead, default to CoreGraphics.
+ drawingModel = NPDrawingModelCoreGraphics;
+#endif
+ }
+
+ if (eventModel == (NPEventModel)-1) {
+ // If the plug-in did not specify a drawing model we default to Carbon when it is available.
+#ifndef NP_NO_CARBON
+ eventModel = NPEventModelCarbon;
+#else
+ eventModel = NPEventModelCocoa;
+#endif // NP_NO_CARBON
+ }
+
+#ifndef NP_NO_CARBON
+ if (eventModel == NPEventModelCocoa && isDrawingModelQuickDraw(drawingModel)) {
+ LOG(Plugins, "Plugin can't use use Cocoa event model with QuickDraw drawing model: %@", pluginPackage);
[self _destroyPlugin];
[pluginPackage close];
+
return NO;
+ }
+#endif // NP_NO_CARBON
+
+#ifndef BUILDING_ON_TIGER
+ if (drawingModel == NPDrawingModelCoreAnimation) {
+ void *value = 0;
+ if (NPP_GetValue(plugin, NPPVpluginCoreAnimationLayer, &value) == NPERR_NO_ERROR && value) {
+ _layer = (CALayer *)value;
+ [self setWantsLayer:YES];
+ [self setLayer:_layer];
+ LOG(Plugins, "%@ is using Core Animation drawing model with layer %@", pluginPackage, _layer);
+ }
+
+ ASSERT(_layer);
+ }
#endif
+
+ // Create the event handler
+ eventHandler = WebNetscapePluginEventHandler::create(self);
+
+ // Get the text input vtable
+ if (eventModel == NPEventModelCocoa) {
+ [self willCallPlugInFunction];
+ {
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
+ NPPluginTextInputFuncs *value;
+ if (NPP_GetValue(plugin, NPPVpluginTextInputFuncs, &value) == NPERR_NO_ERROR && value)
+ textInputFuncs = value;
+ }
+ [self didCallPlugInFunction];
}
-
+
isStarted = YES;
-
- [self updateAndSetWindow];
+ [[self webView] addPluginInstanceView:self];
+
+ if (drawingModel == NPDrawingModelCoreGraphics || isDrawingModelQuickDraw(drawingModel))
+ [self updateAndSetWindow];
if ([self window]) {
[self addWindowObservers];
if ([[self window] isKeyWindow]) {
[self sendActivateEvent:YES];
}
- [self restartNullEvents];
+ [self restartTimers];
}
[self resetTrackingRect];
@@ -1446,15 +1288,20 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
return;
isStarted = NO;
- // To stop active streams it's necessary to invoke makeObjectsPerformSelector on a copy
- // of streams. This is because calling -[WebNetscapePluginStream stop] also has the side effect
- // of removing a stream from this collection.
- NSArray *streamsCopy = [streams copy];
- [streamsCopy makeObjectsPerformSelector:@selector(stop)];
- [streamsCopy release];
+
+ [[self webView] removePluginInstanceView:self];
+
+ // To stop active streams it's necessary to invoke stop() on a copy
+ // of streams. This is because calling WebNetscapePluginStream::stop() also has the side effect
+ // of removing a stream from this hash set.
+ Vector<RefPtr<WebNetscapePluginStream> > streamsCopy;
+ copyToVector(streams, streamsCopy);
+ for (size_t i = 0; i < streamsCopy.size(); i++)
+ streamsCopy[i]->stop();
+
- // Stop the null events
- [self stopNullEvents];
+ // Stop the timers
+ [self stopTimers];
// Stop notifications and callbacks.
[self removeWindowObservers];
@@ -1467,12 +1314,10 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
[self _destroyPlugin];
[pluginPackage close];
- // We usually remove the key event handler in resignFirstResponder but it is possible that resignFirstResponder
- // may never get called so we can't completely rely on it.
- [self removeKeyEventHandler];
+ delete eventHandler;
+ eventHandler = 0;
- if (drawingModel == NPDrawingModelOpenGL)
- [self _destroyAGLContext];
+ textInputFuncs = 0;
}
- (BOOL)isStarted
@@ -1480,6 +1325,11 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
return isStarted;
}
+- (NPEventModel)eventModel
+{
+ return eventModel;
+}
+
- (WebDataSource *)dataSource
{
WebFrame *webFrame = kit(core(element)->document()->frame());
@@ -1608,7 +1458,6 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
{
[super initWithFrame:frame];
- streams = [[NSMutableArray alloc] init];
pendingFrameLoads = [[NSMutableDictionary alloc] init];
// load the plug-in if it is not already loaded
@@ -1630,7 +1479,6 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
[self setMode:NP_EMBED];
_loadManually = loadManually;
-
return self;
}
@@ -1654,11 +1502,18 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
}
free(cAttributes);
free(cValues);
+
+ ASSERT(!eventHandler);
+
+ if (timers) {
+ deleteAllValues(*timers);
+ delete timers;
+ }
}
-- (void)disconnectStream:(WebBaseNetscapePluginStream*)stream
+- (void)disconnectStream:(WebNetscapePluginStream*)stream
{
- [streams removeObjectIdenticalTo:stream];
+ streams.remove(stream);
}
- (void)dealloc
@@ -1666,19 +1521,15 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
ASSERT(!isStarted);
[sourceURL release];
- [_manualStream release];
[_error release];
[pluginPackage release];
- [streams release];
[MIMEType release];
[baseURL release];
[pendingFrameLoads release];
[element release];
ASSERT(!plugin);
- ASSERT(!aglWindow);
- ASSERT(!aglContext);
[self fini];
@@ -1697,12 +1548,14 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
- (void)drawRect:(NSRect)rect
{
- if (!isStarted) {
+ if (drawingModel == NPDrawingModelCoreAnimation)
+ return;
+
+ if (!isStarted)
return;
- }
if ([NSGraphicsContext currentContextDrawingToScreen])
- [self sendUpdateEvent];
+ [self sendDrawRectEvent:rect];
else {
NSBitmapImageRep *printedPluginBitmap = [self _printedPluginBitmap];
if (printedPluginBitmap) {
@@ -1717,25 +1570,6 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
CGContextRestoreGState(cgContext);
}
}
-
- // If this is a windowless OpenGL plugin, blit its contents back into this view. The plug-in just drew into the offscreen context.
- if (drawingModel == NPDrawingModelOpenGL && window.type == NPWindowTypeDrawable) {
- NSImage *aglOffscreenImage = [self _aglOffscreenImageForDrawingInRect:rect];
- if (aglOffscreenImage) {
- // Flip the context before drawing because the CGL context is flipped relative to this view.
- CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
- CGContextSaveGState(cgContext);
- NSRect bounds = [self bounds];
- CGContextTranslateCTM(cgContext, 0.0f, NSHeight(bounds));
- CGContextScaleCTM(cgContext, 1.0f, -1.0f);
-
- // Copy 'rect' from the offscreen buffer to this view (the flip above makes this sort of tricky)
- NSRect flippedRect = rect;
- flippedRect.origin.y = NSMaxY(bounds) - NSMaxY(flippedRect);
- [aglOffscreenImage drawInRect:flippedRect fromRect:flippedRect operation:NSCompositeSourceOver fraction:1.0f];
- CGContextRestoreGState(cgContext);
- }
- }
}
- (BOOL)isFlipped
@@ -1754,10 +1588,10 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
[self _viewHasMoved];
}
-#ifndef NP_NO_QUICKDRAW
-(void)tellQuickTimeToChill
{
- ASSERT(drawingModel == NPDrawingModelQuickDraw);
+#ifndef NP_NO_QUICKDRAW
+ ASSERT(isDrawingModelQuickDraw(drawingModel));
// Make a call to the secret QuickDraw API that makes QuickTime calm down.
WindowRef windowRef = (WindowRef)[[self window] windowRef];
@@ -1768,15 +1602,13 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
::Rect bounds;
GetPortBounds(port, &bounds);
WKCallDrawingNotification(port, &bounds);
-}
#endif /* NP_NO_QUICKDRAW */
+}
- (void)viewWillMoveToWindow:(NSWindow *)newWindow
{
-#ifndef NP_NO_QUICKDRAW
- if (drawingModel == NPDrawingModelQuickDraw)
+ if (isDrawingModelQuickDraw(drawingModel))
[self tellQuickTimeToChill];
-#endif
// We must remove the tracking rect before we move to the new window.
// Once we move to the new window, it will be too late.
@@ -1787,13 +1619,9 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
[self setHasFocus:NO];
if (!newWindow) {
- // Hide the AGL child window
- if (drawingModel == NPDrawingModelOpenGL)
- [self _hideAGLWindow];
-
if ([[self webView] hostWindow]) {
// View will be moved out of the actual window but it still has a host window.
- [self stopNullEvents];
+ [self stopTimers];
} else {
// View will have no associated windows.
[self stop];
@@ -1833,7 +1661,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// View moved to an actual window. Start it if not already started.
[self start];
- [self restartNullEvents];
+ [self restartTimers];
[self addWindowObservers];
} else if ([[self webView] hostWindow]) {
// View moved out of an actual window, but still has a host window.
@@ -1873,35 +1701,37 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
{
[self sendActivateEvent:YES];
[self setNeedsDisplay:YES];
- [self restartNullEvents];
+ [self restartTimers];
+#ifndef NP_NO_CARBON
SetUserFocusWindow((WindowRef)[[self window] windowRef]);
+#endif // NP_NO_CARBON
}
- (void)windowResignedKey:(NSNotification *)notification
{
[self sendActivateEvent:NO];
[self setNeedsDisplay:YES];
- [self restartNullEvents];
+ [self restartTimers];
}
- (void)windowDidMiniaturize:(NSNotification *)notification
{
- [self stopNullEvents];
+ [self stopTimers];
}
- (void)windowDidDeminiaturize:(NSNotification *)notification
{
- [self restartNullEvents];
+ [self stopTimers];
}
- (void)loginWindowDidSwitchFromUser:(NSNotification *)notification
{
- [self stopNullEvents];
+ [self stopTimers];
}
-(void)loginWindowDidSwitchToUser:(NSNotification *)notification
{
- [self restartNullEvents];
+ [self restartTimers];
}
- (void)preferencesHaveChanged:(NSNotification *)notification
@@ -1930,7 +1760,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
NPError error;
[self willCallPlugInFunction];
{
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
error = NPP_GetValue(plugin, NPPVpluginScriptableNPObject, &value);
}
[self didCallPlugInFunction];
@@ -1965,8 +1795,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
{
ASSERT(_loadManually);
ASSERT(!_manualStream);
-
- _manualStream = [[WebNetscapePluginStream alloc] initWithFrameLoader:core([self webFrame])->loader()];
+
+ _manualStream = WebNetscapePluginStream::create(core([self webFrame])->loader());
}
- (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data
@@ -1978,16 +1808,18 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if (![self isStarted])
return;
-
- if ([_manualStream plugin] == NULL) {
- [_manualStream setRequestURL:[[[self dataSource] request] URL]];
- [_manualStream setPlugin:[self plugin]];
- ASSERT([_manualStream plugin]);
- [_manualStream startStreamWithResponse:[[self dataSource] response]];
+
+ if (!_manualStream->plugin()) {
+
+ _manualStream->setRequestURL([[[self dataSource] request] URL]);
+ _manualStream->setPlugin([self plugin]);
+ ASSERT(_manualStream->plugin());
+
+ _manualStream->startStreamWithResponse([[self dataSource] response]);
}
-
- if ([_manualStream plugin])
- [_manualStream receivedData:data];
+
+ if (_manualStream->plugin())
+ _manualStream->didReceiveData(0, static_cast<const char *>([data bytes]), [data length]);
}
- (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error
@@ -2001,8 +1833,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if (![self isStarted]) {
return;
}
-
- [_manualStream destroyStreamWithError:error];
+
+ _manualStream->destroyStreamWithError(error);
}
- (void)pluginViewFinishedLoading:(NSView *)pluginView
@@ -2011,9 +1843,163 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
ASSERT(_manualStream);
if ([self isStarted])
- [_manualStream finishedLoading];
+ _manualStream->didFinishLoading(0);
+}
+
+#pragma mark NSTextInput implementation
+
+- (NSTextInputContext *)inputContext
+{
+#ifndef NP_NO_CARBON
+ if (![self isStarted] || eventModel == NPEventModelCarbon)
+ return nil;
+#endif
+
+ return [super inputContext];
+}
+
+- (BOOL)hasMarkedText
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->hasMarkedText)
+ return textInputFuncs->hasMarkedText(plugin);
+
+ return NO;
}
+- (void)insertText:(id)aString
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->insertText)
+ textInputFuncs->insertText(plugin, aString);
+}
+
+- (NSRange)markedRange
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->markedRange)
+ return textInputFuncs->markedRange(plugin);
+
+ return NSMakeRange(NSNotFound, 0);
+}
+
+- (NSRange)selectedRange
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->selectedRange)
+ return textInputFuncs->selectedRange(plugin);
+
+ return NSMakeRange(NSNotFound, 0);
+}
+
+- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->setMarkedText)
+ textInputFuncs->setMarkedText(plugin, aString, selRange);
+}
+
+- (void)unmarkText
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->unmarkText)
+ textInputFuncs->unmarkText(plugin);
+}
+
+- (NSArray *)validAttributesForMarkedText
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->validAttributesForMarkedText)
+ return textInputFuncs->validAttributesForMarkedText(plugin);
+
+ return [NSArray array];
+}
+
+- (NSAttributedString *)attributedSubstringFromRange:(NSRange)theRange
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->attributedSubstringFromRange)
+ return textInputFuncs->attributedSubstringFromRange(plugin, theRange);
+
+ return nil;
+}
+
+- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self 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([self isStarted]);
+
+ if (textInputFuncs && textInputFuncs->doCommandBySelector)
+ textInputFuncs->doCommandBySelector(plugin, aSelector);
+}
+
+- (NSRect)firstRectForCharacterRange:(NSRange)theRange
+{
+ ASSERT(eventModel == NPEventModelCocoa);
+ ASSERT([self 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 WebBaseNetscapePluginView (WebNPPCallbacks)
@@ -2053,7 +2039,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
NSString *JSString = [URL _webkit_scriptIfJavaScriptURL];
ASSERT(JSString);
- NSString *result = [[[self webFrame] _bridge] stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:[JSPluginRequest isCurrentEventUserGesture]];
+ NSString *result = [[self webFrame] _stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:[JSPluginRequest isCurrentEventUserGesture]];
// Don't continue if stringByEvaluatingJavaScriptFromString caused the plug-in to stop.
if (!isStarted) {
@@ -2065,7 +2051,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if ([JSPluginRequest sendNotification]) {
[self willCallPlugInFunction];
{
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
NPP_URLNotify(plugin, [URL _web_URLCString], NPRES_DONE, [JSPluginRequest notifyData]);
}
[self didCallPlugInFunction];
@@ -2073,18 +2059,17 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
} else if ([result length] > 0) {
// Don't call NPP_NewStream and other stream methods if there is no JS result to deliver. This is what Mozilla does.
NSData *JSData = [result dataUsingEncoding:NSUTF8StringEncoding];
- WebBaseNetscapePluginStream *stream = [[WebBaseNetscapePluginStream alloc] initWithRequestURL:URL
- plugin:plugin
- notifyData:[JSPluginRequest notifyData]
- sendNotification:[JSPluginRequest sendNotification]];
- [stream startStreamResponseURL:URL
- expectedContentLength:[JSData length]
- lastModifiedDate:nil
- MIMEType:@"text/plain"
- headers:nil];
- [stream receivedData:JSData];
- [stream finishedLoading];
- [stream release];
+
+ RefPtr<WebNetscapePluginStream> stream = WebNetscapePluginStream::create([NSURLRequest requestWithURL:URL], plugin, [JSPluginRequest sendNotification], [JSPluginRequest notifyData]);
+
+ RetainPtr<NSURLResponse> response(AdoptNS, [[NSURLResponse alloc] initWithURL:URL
+ MIMEType:@"text/plain"
+ expectedContentLength:[JSData length]
+ textEncodingName:nil]);
+
+ stream->startStreamWithResponse(response.get());
+ stream->didReceiveData(0, static_cast<const char*>([JSData bytes]), [JSData length]);
+ stream->didFinishLoading(0);
}
}
@@ -2098,7 +2083,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
[self willCallPlugInFunction];
{
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
NPP_URLNotify(plugin, [[[pluginRequest request] URL] _web_URLCString], reason, [pluginRequest notifyData]);
}
[self didCallPlugInFunction];
@@ -2110,9 +2095,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
- (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error
{
NPReason reason = NPRES_DONE;
- if (error != nil) {
- reason = [WebBaseNetscapePluginStream reasonForError:error];
- }
+ if (error != nil)
+ reason = WebNetscapePluginStream::reasonForError(error);
[self webFrame:webFrame didFinishLoadWithReason:reason];
}
@@ -2130,7 +2114,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if (frameName) {
// FIXME - need to get rid of this window creation which
// bypasses normal targeted link handling
- frame = kit([[self webFrame] _frameLoader]->findFrameForNavigation(frameName));
+ frame = kit(core([self webFrame])->loader()->findFrameForNavigation(frameName));
if (frame == nil) {
WebView *currentWebView = [self webView];
NSDictionary *features = [[NSDictionary alloc] init];
@@ -2143,7 +2127,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if ([pluginRequest sendNotification]) {
[self willCallPlugInFunction];
{
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
NPP_URLNotify(plugin, [[[pluginRequest request] URL] _web_URLCString], NPERR_GENERIC_ERROR, [pluginRequest notifyData]);
}
[self didCallPlugInFunction];
@@ -2183,19 +2167,21 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if (!URL)
return NPERR_INVALID_URL;
+ // Don't allow requests to be loaded when the document loader is stopping all loaders.
+ if ([[self dataSource] _documentLoader]->isStopping())
+ return NPERR_GENERIC_ERROR;
+
NSString *target = nil;
if (cTarget) {
// Find the frame given the target string.
- target = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, cTarget, kCFStringEncodingWindowsLatin1);
+ target = [NSString stringWithCString:cTarget encoding:NSISOLatin1StringEncoding];
}
WebFrame *frame = [self webFrame];
// don't let a plugin start any loads if it is no longer part of a document that is being
// displayed unless the loads are in the same frame as the plugin.
- if ([[self dataSource] _documentLoader] != [[self webFrame] _frameLoader]->activeDocumentLoader() &&
+ if ([[self dataSource] _documentLoader] != core([self webFrame])->loader()->activeDocumentLoader() &&
(!cTarget || [frame findFrameNamed:target] != frame)) {
- if (target)
- CFRelease(target);
return NPERR_GENERIC_ERROR;
}
@@ -2209,34 +2195,36 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// because this can cause the user to be redirected to a blank page (3424039).
return NPERR_INVALID_PARAM;
}
+ } else {
+ if (!FrameLoader::canLoad(URL, String(), core([self webFrame])->document()))
+ return NPERR_GENERIC_ERROR;
}
if (cTarget || JSString) {
// Make when targetting a frame or evaluating a JS string, perform the request after a delay because we don't
// want to potentially kill the plug-in inside of its URL request.
- if (JSString != nil && target != nil && [frame findFrameNamed:target] != frame) {
+ if (JSString && target && [frame findFrameNamed:target] != frame) {
// For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
- CFRelease(target);
return NPERR_INVALID_PARAM;
}
- WebPluginRequest *pluginRequest = [[WebPluginRequest alloc] initWithRequest:request frameName:target notifyData:notifyData sendNotification:sendNotification didStartFromUserGesture:currentEventIsUserGesture];
+ bool currentEventIsUserGesture = false;
+ if (eventHandler)
+ currentEventIsUserGesture = eventHandler->currentEventIsUserGesture();
+
+ WebPluginRequest *pluginRequest = [[WebPluginRequest alloc] initWithRequest:request
+ frameName:target
+ notifyData:notifyData
+ sendNotification:sendNotification
+ didStartFromUserGesture:currentEventIsUserGesture];
[self performSelector:@selector(loadPluginRequest:) withObject:pluginRequest afterDelay:0];
[pluginRequest release];
- if (target)
- CFRelease(target);
} else {
- WebNetscapePluginStream *stream = [[WebNetscapePluginStream alloc] initWithRequest:request
- plugin:plugin
- notifyData:notifyData
- sendNotification:sendNotification];
- if (!stream)
- return NPERR_INVALID_URL;
+ RefPtr<WebNetscapePluginStream> stream = WebNetscapePluginStream::create(request, plugin, sendNotification, notifyData);
- [streams addObject:stream];
- [stream start];
- [stream release];
+ streams.add(stream.get());
+ stream->start();
}
return NPERR_NO_ERROR;
@@ -2382,13 +2370,13 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// This function does a sanity check to ensure that the NPStream provided actually
// belongs to the plug-in that provided it, which fixes a crash in the DivX
// plug-in: <rdar://problem/5093862> | http://bugs.webkit.org/show_bug.cgi?id=13203
- if (!stream || [WebBaseNetscapePluginStream ownerForStream:stream] != plugin) {
+ if (!stream || WebNetscapePluginStream::ownerForStream(stream) != plugin) {
LOG(Plugins, "Invalid NPStream passed to NPN_DestroyStream: %p", stream);
return NPERR_INVALID_INSTANCE_ERROR;
}
- WebBaseNetscapePluginStream *browserStream = static_cast<WebBaseNetscapePluginStream *>(stream->ndata);
- [browserStream cancelLoadAndDestroyStreamWithError:[browserStream errorForReason:reason]];
+ WebNetscapePluginStream* browserStream = static_cast<WebNetscapePluginStream*>(stream->ndata);
+ browserStream->cancelLoadAndDestroyStreamWithError(browserStream->errorForReason(reason));
return NPERR_NO_ERROR;
}
@@ -2424,7 +2412,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
(float)invalidRect->right - invalidRect->left, (float)invalidRect->bottom - invalidRect->top)];
}
--(bool)isOpaque
+-(BOOL)isOpaque
{
return YES;
}
@@ -2445,13 +2433,11 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
#endif /* NP_NO_QUICKDRAW */
case NPDrawingModelCoreGraphics:
- case NPDrawingModelOpenGL:
{
CGRect cgRect = CGPathGetBoundingBox((NPCGRegion)invalidRegion);
- invalidRect = *(NSRect *)&cgRect;
+ invalidRect = *(NSRect*)&cgRect;
+ break;
}
- break;
-
default:
ASSERT_NOT_REACHED();
break;
@@ -2467,13 +2453,25 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
[[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) {
case NPNVWindowNPObject:
{
Frame* frame = core([self webFrame]);
- NPObject* windowScriptObject = frame ? frame->windowScriptNPObject() : 0;
+ NPObject* windowScriptObject = frame ? frame->script()->windowScriptNPObject() : 0;
// Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess>
if (windowScriptObject)
@@ -2524,10 +2522,41 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
case NPNVsupportsOpenGLBool:
{
- *(NPBool *)value = TRUE;
+ *(NPBool *)value = FALSE;
return NPERR_NO_ERROR;
}
+ case NPNVsupportsCoreAnimationBool:
+ {
+#ifdef BUILDING_ON_TIGER
+ *(NPBool *)value = FALSE;
+#else
+ *(NPBool *)value = TRUE;
+#endif
+ return NPERR_NO_ERROR;
+ }
+
+#ifndef NP_NO_CARBON
+ case NPNVsupportsCarbonBool:
+ {
+ *(NPBool *)value = TRUE;
+ return NPERR_NO_ERROR;
+ }
+#endif /* NP_NO_CARBON */
+
+ case NPNVsupportsCocoaBool:
+ {
+ *(NPBool *)value = TRUE;
+ return NPERR_NO_ERROR;
+ }
+
+ case NPNVbrowserTextInputFuncs:
+ {
+ if (eventModel == NPEventModelCocoa) {
+ *(NPBrowserTextInputFuncs **)value = browserTextInputFuncs();
+ return NPERR_NO_ERROR;
+ }
+ }
default:
break;
}
@@ -2576,10 +2605,14 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
case NPDrawingModelQuickDraw:
#endif
case NPDrawingModelCoreGraphics:
- case NPDrawingModelOpenGL:
drawingModel = newDrawingModel;
return NPERR_NO_ERROR;
-
+
+ case NPDrawingModelCoreAnimation:
+ drawingModel = newDrawingModel;
+ return NPERR_NO_ERROR;
+
+
// Unsupported (or unknown) drawing models:
default:
LOG(Plugins, "Plugin %@ uses unsupported drawing model: %d", pluginPackage, drawingModel);
@@ -2587,11 +2620,75 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
}
}
+ case NPPVpluginEventModel:
+ {
+ // Can only set event model inside NPP_New()
+ if (self != [[self class] currentPluginView])
+ return NPERR_GENERIC_ERROR;
+
+ // Check for valid, supported event model
+ NPEventModel newEventModel = (NPEventModel)(uintptr_t)value;
+ switch (newEventModel) {
+ // Supported event models:
+#ifndef NP_NO_CARBON
+ case NPEventModelCarbon:
+#endif
+ case NPEventModelCocoa:
+ eventModel = newEventModel;
+ return NPERR_NO_ERROR;
+
+ // Unsupported (or unknown) event models:
+ default:
+ LOG(Plugins, "Plugin %@ uses unsupported event model: %d", pluginPackage, eventModel);
+ return NPERR_GENERIC_ERROR;
+ }
+ }
+
default:
return NPERR_GENERIC_ERROR;
}
}
+- (uint32)scheduleTimerWithInterval:(uint32)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32 timerID))timerFunc
+{
+ if (!timerFunc)
+ return 0;
+
+ if (!timers)
+ timers = new HashMap<uint32, PluginTimer*>;
+
+ uint32 timerID = ++currentTimerID;
+
+ PluginTimer* timer = new PluginTimer(plugin, timerID, interval, repeat, timerFunc);
+ timers->set(timerID, timer);
+
+ if (shouldFireTimers)
+ timer->start(isCompletelyObscured);
+
+ return 0;
+}
+
+- (void)unscheduleTimer:(uint32)timerID
+{
+ if (!timers)
+ return;
+
+ if (PluginTimer* timer = timers->take(timerID))
+ delete timer;
+}
+
+- (NPError)popUpContextMenu:(NPMenu *)menu
+{
+ NSEvent *currentEvent = [NSApp currentEvent];
+
+ // NPN_PopUpContextMenu must be called from within the plug-in's NPP_HandleEvent.
+ if (!currentEvent)
+ return NPERR_GENERIC_ERROR;
+
+ [NSMenu popUpContextMenu:(NSMenu *)menu withEvent:currentEvent forView:self];
+ return NPERR_NO_ERROR;
+}
+
@end
@implementation WebPluginRequest
@@ -2653,22 +2750,40 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// NPN_New(), which creates the plug-in instance, should never be called while calling a plug-in function for that instance.
ASSERT(pluginFunctionCallDepth == 0);
+ Frame* frame = core([self webFrame]);
+ if (!frame)
+ return NPERR_GENERIC_ERROR;
+ Page* page = frame->page();
+ if (!page)
+ return NPERR_GENERIC_ERROR;
+
+ bool wasDeferring = page->defersLoading();
+ if (!wasDeferring)
+ page->setDefersLoading(true);
+
+ PluginMainThreadScheduler::scheduler().registerPlugin(plugin);
+
[[self class] setCurrentPluginView:self];
NPError npErr = NPP_New((char *)[MIMEType cString], plugin, mode, argsCount, cAttributes, cValues, NULL);
[[self class] setCurrentPluginView:nil];
+ if (!wasDeferring)
+ page->setDefersLoading(false);
+
LOG(Plugins, "NPP_New: %d", npErr);
return npErr;
}
- (void)_destroyPlugin
{
+ PluginMainThreadScheduler::scheduler().unregisterPlugin(plugin);
+
NPError npErr;
npErr = NPP_Destroy(plugin, NULL);
LOG(Plugins, "NPP_Destroy: %d", npErr);
if (Frame* frame = core([self webFrame]))
- frame->cleanupScriptObjectsForPlugin(self);
+ frame->script()->cleanupScriptObjectsForPlugin(self);
free(plugin);
plugin = NULL;
@@ -2680,15 +2795,13 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// is moved back into a window, everything should be set up correctly.
if (![self window])
return;
-
- if (drawingModel == NPDrawingModelOpenGL)
- [self _reshapeAGLWindow];
-#ifndef NP_NO_QUICKDRAW
- if (drawingModel == NPDrawingModelQuickDraw)
+ if (isDrawingModelQuickDraw(drawingModel))
[self tellQuickTimeToChill];
-#endif
- [self updateAndSetWindow];
+
+ if (drawingModel == NPDrawingModelCoreGraphics || isDrawingModelQuickDraw(drawingModel))
+ [self updateAndSetWindow];
+
[self resetTrackingRect];
// Check to see if the plugin view is completely obscured (scrolled out of view, for example).
@@ -2696,7 +2809,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL oldIsObscured = isCompletelyObscured;
isCompletelyObscured = NSIsEmptyRect([self visibleRect]);
if (isCompletelyObscured != oldIsObscured)
- [self restartNullEvents];
+ [self restartTimers];
}
- (NSBitmapImageRep *)_printedPluginBitmap
@@ -2761,7 +2874,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
// Tell the plugin to print into the GWorld
[self willCallPlugInFunction];
{
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
NPP_Print(plugin, &npPrint);
}
[self didCallPlugInFunction];
@@ -2773,380 +2886,6 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
#endif
}
-- (BOOL)_createAGLContextIfNeeded
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
-
- // Do nothing (but indicate success) if the AGL context already exists
- if (aglContext)
- return YES;
-
- switch (window.type) {
- case NPWindowTypeWindow:
- return [self _createWindowedAGLContext];
-
- case NPWindowTypeDrawable:
- return [self _createWindowlessAGLContext];
-
- default:
- ASSERT_NOT_REACHED();
- return NO;
- }
-}
-
-- (BOOL)_createWindowedAGLContext
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
- ASSERT(!aglContext);
- ASSERT(!aglWindow);
- ASSERT([self window]);
-
- GLint pixelFormatAttributes[] = {
- AGL_RGBA,
- AGL_RED_SIZE, 8,
- AGL_GREEN_SIZE, 8,
- AGL_BLUE_SIZE, 8,
- AGL_ALPHA_SIZE, 8,
- AGL_DEPTH_SIZE, 32,
- AGL_WINDOW,
- AGL_ACCELERATED,
- 0
- };
-
- // Choose AGL pixel format
- AGLPixelFormat pixelFormat = aglChoosePixelFormat(NULL, 0, pixelFormatAttributes);
- if (!pixelFormat) {
- LOG_ERROR("Could not find suitable AGL pixel format: %s", aglErrorString(aglGetError()));
- return NO;
- }
-
- // Create AGL context
- aglContext = aglCreateContext(pixelFormat, NULL);
- aglDestroyPixelFormat(pixelFormat);
- if (!aglContext) {
- LOG_ERROR("Could not create AGL context: %s", aglErrorString(aglGetError()));
- return NO;
- }
-
- // Create AGL window
- aglWindow = [[NSWindow alloc] initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
- if (!aglWindow) {
- LOG_ERROR("Could not create window for AGL drawable.");
- return NO;
- }
-
- // AGL window should allow clicks to go through -- mouse events are tracked by WebCore
- [aglWindow setIgnoresMouseEvents:YES];
-
- // Make sure the window is not opaque -- windowed plug-ins cannot layer with other page elements
- [aglWindow setOpaque:YES];
-
- // Position and order in the AGL window
- [self _reshapeAGLWindow];
-
- // Attach the AGL context to its window
- GLboolean success;
-#ifdef AGL_VERSION_3_0
- success = aglSetWindowRef(aglContext, (WindowRef)[aglWindow windowRef]);
-#else
- success = aglSetDrawable(aglContext, (AGLDrawable)GetWindowPort((WindowRef)[aglWindow windowRef]));
-#endif
- if (!success) {
- LOG_ERROR("Could not set AGL drawable: %s", aglErrorString(aglGetError()));
- aglDestroyContext(aglContext);
- aglContext = NULL;
- return NO;
- }
-
- return YES;
-}
-
-- (BOOL)_createWindowlessAGLContext
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
- ASSERT(!aglContext);
- ASSERT(!aglWindow);
-
- GLint pixelFormatAttributes[] = {
- AGL_RGBA,
- AGL_RED_SIZE, 8,
- AGL_GREEN_SIZE, 8,
- AGL_BLUE_SIZE, 8,
- AGL_ALPHA_SIZE, 8,
- AGL_DEPTH_SIZE, 32,
- AGL_OFFSCREEN,
- 0
- };
-
- // Choose AGL pixel format
- AGLPixelFormat pixelFormat = aglChoosePixelFormat(NULL, 0, pixelFormatAttributes);
- if (!pixelFormat) {
- LOG_ERROR("Could not find suitable AGL pixel format: %s", aglErrorString(aglGetError()));
- return NO;
- }
-
- // Create AGL context
- aglContext = aglCreateContext(pixelFormat, NULL);
- aglDestroyPixelFormat(pixelFormat);
- if (!aglContext) {
- LOG_ERROR("Could not create AGL context: %s", aglErrorString(aglGetError()));
- return NO;
- }
-
- // Create offscreen buffer for AGL context
- NSSize boundsSize = [self bounds].size;
- GLvoid *offscreenBuffer = (GLvoid *)malloc(static_cast<size_t>(boundsSize.width * boundsSize.height * 4));
- if (!offscreenBuffer) {
- LOG_ERROR("Could not allocate offscreen buffer for AGL context");
- aglDestroyContext(aglContext);
- aglContext = NULL;
- return NO;
- }
-
- // Attach AGL context to offscreen buffer
- CGLContextObj cglContext = [self _cglContext];
- CGLError error = CGLSetOffScreen(cglContext, static_cast<long>(boundsSize.width), static_cast<long>(boundsSize.height), static_cast<long>(boundsSize.width * 4), offscreenBuffer);
- if (error) {
- LOG_ERROR("Could not set offscreen buffer for AGL context: %d", error);
- aglDestroyContext(aglContext);
- aglContext = NULL;
- return NO;
- }
-
- return YES;
-}
-
-- (CGLContextObj)_cglContext
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
-
- CGLContextObj cglContext = NULL;
- if (!aglGetCGLContext(aglContext, (void **)&cglContext) || !cglContext)
- LOG_ERROR("Could not get CGL context for AGL context: %s", aglErrorString(aglGetError()));
-
- return cglContext;
-}
-
-- (BOOL)_getAGLOffscreenBuffer:(GLvoid **)outBuffer width:(GLsizei *)outWidth height:(GLsizei *)outHeight
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
-
- if (outBuffer)
- *outBuffer = NULL;
- if (outWidth)
- *outWidth = 0;
- if (outHeight)
- *outHeight = 0;
-
- // Only windowless plug-ins have offscreen buffers
- if (window.type != NPWindowTypeDrawable)
- return NO;
-
- CGLContextObj cglContext = [self _cglContext];
- if (!cglContext)
- return NO;
-
- GLsizei width, height;
- GLint rowBytes;
- void *offscreenBuffer = NULL;
- CGLError error = CGLGetOffScreen(cglContext, &width, &height, &rowBytes, &offscreenBuffer);
- if (error || !offscreenBuffer) {
- LOG_ERROR("Could not get offscreen buffer for AGL context: %d", error);
- return NO;
- }
-
- if (outBuffer)
- *outBuffer = offscreenBuffer;
- if (outWidth)
- *outWidth = width;
- if (outHeight)
- *outHeight = height;
-
- return YES;
-}
-
-- (void)_destroyAGLContext
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
-
- if (!aglContext)
- return;
-
- if (aglContext) {
- // If this is a windowless plug-in, free its offscreen buffer
- GLvoid *offscreenBuffer;
- if ([self _getAGLOffscreenBuffer:&offscreenBuffer width:NULL height:NULL])
- free(offscreenBuffer);
-
- // Detach context from the AGL window
-#ifdef AGL_VERSION_3_0
- aglSetWindowRef(aglContext, NULL);
-#else
- aglSetDrawable(aglContext, NULL);
-#endif
-
- // Destroy the context
- aglDestroyContext(aglContext);
- aglContext = NULL;
- }
-
- // Destroy the AGL window
- if (aglWindow) {
- [self _hideAGLWindow];
- aglWindow = nil;
- }
-}
-
-- (void)_reshapeAGLWindow
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
-
- if (!aglContext)
- return;
-
- switch (window.type) {
- case NPWindowTypeWindow:
- {
- if (!aglWindow)
- break;
-
- // The AGL window is being reshaped because the plugin view has moved. Since the view has moved, it will soon redraw.
- // We want the AGL window to update at the same time as its underlying view. So, we disable screen updates until the
- // plugin view's window flushes.
- NSWindow *browserWindow = [self window];
- ASSERT(browserWindow);
- [browserWindow disableScreenUpdatesUntilFlush];
-
- // Add the AGL window as a child of the main window if necessary
- if ([aglWindow parentWindow] != browserWindow)
- [browserWindow addChildWindow:aglWindow ordered:NSWindowAbove];
-
- // Update the AGL window frame
- NSRect aglWindowFrame = [self convertRect:[self visibleRect] toView:nil];
- aglWindowFrame.origin = [browserWindow convertBaseToScreen:aglWindowFrame.origin];
- [aglWindow setFrame:aglWindowFrame display:NO];
-
- // Update the AGL context
- aglUpdateContext(aglContext);
- }
- break;
-
- case NPWindowTypeDrawable:
- {
- // Get offscreen buffer; we can skip this step if we don't have one yet
- GLvoid *offscreenBuffer;
- GLsizei width, height;
- if (![self _getAGLOffscreenBuffer:&offscreenBuffer width:&width height:&height] || !offscreenBuffer)
- break;
-
- // Don't resize the offscreen buffer if it's already the same size as the view bounds
- NSSize boundsSize = [self bounds].size;
- if (boundsSize.width == width && boundsSize.height == height)
- break;
-
- // Resize the offscreen buffer
- offscreenBuffer = realloc(offscreenBuffer, static_cast<size_t>(boundsSize.width * boundsSize.height * 4));
- if (!offscreenBuffer) {
- LOG_ERROR("Could not allocate offscreen buffer for AGL context");
- break;
- }
-
- // Update the offscreen
- CGLContextObj cglContext = [self _cglContext];
- CGLError error = CGLSetOffScreen(cglContext, static_cast<long>(boundsSize.width), static_cast<long>(boundsSize.height), static_cast<long>(boundsSize.width * 4), offscreenBuffer);
- if (error) {
- LOG_ERROR("Could not set offscreen buffer for AGL context: %d", error);
- break;
- }
-
- // Update the AGL context
- aglUpdateContext(aglContext);
- }
- break;
-
- default:
- ASSERT_NOT_REACHED();
- break;
- }
-}
-
-- (void)_hideAGLWindow
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
-
- if (!aglWindow)
- return;
-
- // aglWindow should only be set for a windowed OpenGL plug-in
- ASSERT(window.type == NPWindowTypeWindow);
-
- NSWindow *parentWindow = [aglWindow parentWindow];
- if (parentWindow) {
- // Disable screen updates so that this AGL window orders out atomically with other plugins' AGL windows
- [parentWindow disableScreenUpdatesUntilFlush];
- ASSERT(parentWindow == [self window]);
- [parentWindow removeChildWindow:aglWindow];
- }
- [aglWindow orderOut:nil];
-}
-
-- (NSImage *)_aglOffscreenImageForDrawingInRect:(NSRect)drawingInRect
-{
- ASSERT(drawingModel == NPDrawingModelOpenGL);
-
- CGLContextObj cglContext = [self _cglContext];
- if (!cglContext)
- return nil;
-
- // Get the offscreen buffer
- GLvoid *offscreenBuffer;
- GLsizei width, height;
- if (![self _getAGLOffscreenBuffer:&offscreenBuffer width:&width height:&height])
- return nil;
-
- unsigned char *plane = (unsigned char *)offscreenBuffer;
-
-#if defined(__i386__) || defined(__x86_64__)
- // Make rect inside the offscreen buffer because we're about to directly modify the bits inside drawingInRect
- NSRect rect = NSIntegralRect(NSIntersectionRect(drawingInRect, NSMakeRect(0, 0, width, height)));
-
- // The offscreen buffer, being an OpenGL framebuffer, is in BGRA format on x86. We need to swap the blue and red channels before
- // wrapping the buffer in an NSBitmapImageRep, which only supports RGBA and ARGB.
- // On PowerPC, the OpenGL framebuffer is in ARGB format. Since that is a format that NSBitmapImageRep supports, all that is
- // needed on PowerPC is to pass the NSAlphaFirstBitmapFormat flag when creating the NSBitmapImageRep. On x86, we need to swap the
- // framebuffer color components such that they are in ARGB order, as they are on PowerPC.
- // If only a small region of the plug-in is being redrawn, then it would be a waste to convert the entire image from BGRA to ARGB.
- // Since we know what region of the image will ultimately be drawn to screen (drawingInRect), we restrict the channel swapping to
- // just that region within the offscreen buffer.
- if (!WebConvertBGRAToARGB(plane, width * 4, (int)rect.origin.x, (int)rect.origin.y, (int)rect.size.width, (int)rect.size.height))
- return nil;
-#endif /* defined(__i386__) || defined(__x86_64__) */
-
- NSBitmapImageRep *aglBitmap = [[NSBitmapImageRep alloc]
- initWithBitmapDataPlanes:&plane
- pixelsWide:width
- pixelsHigh:height
- bitsPerSample:8
- samplesPerPixel:4
- hasAlpha:YES
- isPlanar:NO
- colorSpaceName:NSDeviceRGBColorSpace
- bitmapFormat:NSAlphaFirstBitmapFormat
- bytesPerRow:width * 4
- bitsPerPixel:32];
- if (!aglBitmap) {
- LOG_ERROR("Could not create bitmap for AGL offscreen buffer");
- return nil;
- }
-
- // Wrap the bitmap in an NSImage. This allocation isn't very expensive -- the actual image data is already in the bitmap rep
- NSImage *aglImage = [[[NSImage alloc] initWithSize:[aglBitmap size]] autorelease];
- [aglImage addRepresentation:aglBitmap];
- [aglBitmap release];
-
- return aglImage;
-}
-
- (void)_redeliverStream
{
if ([self dataSource] && [self isStarted]) {
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginViewPrivate.h b/WebKit/mac/Plugins/WebBaseNetscapePluginViewPrivate.h
deleted file mode 100644
index 7be24b0..0000000
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginViewPrivate.h
+++ /dev/null
@@ -1,53 +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.
- */
-
-#ifndef __LP64__
-#import <WebBaseNetscapePluginView.h>
-
-@class NSURLRequest;
-
-@interface WebBaseNetscapePluginView (WebNPPCallbacks)
-
-- (NPError)loadRequest:(NSURLRequest *)request inTarget:(NSString *)target withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification;
-- (NPError)getURLNotify:(const char *)URL target:(const char *)target notifyData:(void *)notifyData;
-- (NPError)getURL:(const char *)URL target:(const char *)target;
-- (NPError)postURLNotify:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file notifyData:(void *)notifyData;
-- (NPError)postURL:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file;
-- (NPError)newStream:(NPMIMEType)type target:(const char *)target stream:(NPStream**)stream;
-- (NPError)write:(NPStream*)stream len:(SInt32)len buffer:(void *)buffer;
-- (NPError)destroyStream:(NPStream*)stream reason:(NPReason)reason;
-- (void)status:(const char *)message;
-- (const char *)userAgent;
-- (void)invalidateRect:(NPRect *)invalidRect;
-- (void)invalidateRegion:(NPRegion)invalidateRegion;
-- (void)forceRedraw;
-- (NPError)getVariable:(NPNVariable)variable value:(void *)value;
-- (NPError)setVariable:(NPPVariable)variable value:(void *)value;
-
-@end
-#endif
diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.h b/WebKit/mac/Plugins/WebBasePluginPackage.h
index 7a884b8..1082551 100644
--- a/WebKit/mac/Plugins/WebBasePluginPackage.h
+++ b/WebKit/mac/Plugins/WebBasePluginPackage.h
@@ -28,7 +28,7 @@
#import <WebCore/WebCoreViewFactory.h>
-#if USE(NPOBJECT)
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import <WebKit/npfunctions.h>
#else
typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
@@ -76,6 +76,7 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
- (BOOL)getPluginInfoFromPLists;
- (BOOL)load;
+- (void)unload;
- (NSString *)name;
- (NSString *)path;
diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.m b/WebKit/mac/Plugins/WebBasePluginPackage.m
index 99d4e74..03d438b 100644
--- a/WebKit/mac/Plugins/WebBasePluginPackage.m
+++ b/WebKit/mac/Plugins/WebBasePluginPackage.m
@@ -28,12 +28,13 @@
#import <WebKit/WebBasePluginPackage.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebKitNSStringExtras.h>
#import <WebKit/WebNetscapePluginPackage.h>
#import <WebKit/WebNSObjectExtras.h>
#import <WebKit/WebPluginPackage.h>
#import <WebCore/WebCoreObjCExtras.h>
+#import <wtf/Assertions.h>
+#import <wtf/Vector.h>
#import <WebKitSystemInterface.h>
@@ -41,8 +42,10 @@
#import "WebTypesInternal.h"
#import <mach-o/arch.h>
+#import <mach-o/fat.h>
#import <mach-o/loader.h>
+
#define JavaCocoaPluginIdentifier @"com.apple.JavaPluginCocoa"
#define JavaCarbonPluginIdentifier @"com.apple.JavaAppletPlugin"
#define JavaCFMPluginFilename @"Java Applet Plugin Enabler"
@@ -69,10 +72,10 @@
WebBasePluginPackage *pluginPackage = [[WebPluginPackage alloc] initWithPath:pluginPath];
if (!pluginPackage) {
-#ifdef __LP64__
- return nil;
-#else
+#if ENABLE(NETSCAPE_PLUGIN_API)
pluginPackage = [[WebNetscapePluginPackage alloc] initWithPath:pluginPath];
+#else
+ return nil;
#endif
}
@@ -189,10 +192,16 @@
return YES;
}
+- (void)unload
+{
+}
+
- (NSDictionary *)pListForPath:(NSString *)pListPath createFile:(BOOL)createFile
{
- if (createFile && [self load] && BP_CreatePluginMIMETypesPreferences)
+ if (createFile && [self load] && BP_CreatePluginMIMETypesPreferences) {
BP_CreatePluginMIMETypesPreferences();
+ [self unload];
+ }
NSDictionary *pList = nil;
NSData *data = [NSData dataWithContentsOfFile:pListPath];
@@ -391,22 +400,83 @@
[[path lastPathComponent] _webkit_isCaseInsensitiveEqualToString:JavaCFMPluginFilename];
}
+static inline void swapIntsInHeader(uint8_t* bytes, unsigned length)
+{
+ for (unsigned i = 0; i < length; i += 4)
+ *(uint32_t*)(bytes + i) = OSSwapInt32(*(uint32_t *)(bytes + i));
+}
+
- (BOOL)isNativeLibraryData:(NSData *)data
-{
- // If we have a 32-bit thin Mach-O file, see if we have an i386 binary. If not, don't load it.
- // This is designed to be the safest possible test for now. We'll only reject files that we
- // can easily tell are wrong.
- if ([data length] >= sizeof(struct mach_header)) {
- const NXArchInfo *localArch = NXGetLocalArchInfo();
- if (localArch != NULL) {
- struct mach_header *header = (struct mach_header *)[data bytes];
- if (header->magic == MH_MAGIC)
- return (header->cputype == localArch->cputype);
- if (header->magic == MH_CIGAM)
- return ((cpu_type_t) OSSwapInt32(header->cputype) == localArch->cputype);
- }
+{
+ Vector<uint8_t, 512> bytes([data length]);
+ memcpy(bytes.data(), [data bytes], bytes.size());
+
+ unsigned numArchs = 0;
+ struct fat_arch singleArch = { 0, 0, 0, 0, 0 };
+ struct fat_arch* archs = 0;
+
+ if (bytes.size() >= sizeof(struct mach_header_64)) {
+ uint32_t magic = *reinterpret_cast<uint32_t*>(bytes.data());
+
+ if (magic == MH_MAGIC || magic == MH_CIGAM) {
+ // We have a 32-bit thin binary
+ struct mach_header* header = (struct mach_header*)bytes.data();
+
+ // Check if we need to swap the bytes
+ if (magic == MH_CIGAM)
+ swapIntsInHeader(bytes.data(), bytes.size());
+
+ singleArch.cputype = header->cputype;
+ singleArch.cpusubtype = header->cpusubtype;
+
+ archs = &singleArch;
+ numArchs = 1;
+ } else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) {
+ // We have a 64-bit thin binary
+ struct mach_header_64* header = (struct mach_header_64*)bytes.data();
+
+ // Check if we need to swap the bytes
+ if (magic == MH_CIGAM_64)
+ swapIntsInHeader(bytes.data(), bytes.size());
+
+ singleArch.cputype = header->cputype;
+ singleArch.cpusubtype = header->cpusubtype;
+
+ archs = &singleArch;
+ numArchs = 1;
+ } else if (magic == FAT_MAGIC || magic == FAT_CIGAM) {
+ // We have a fat (universal) binary
+
+ // Check if we need to swap the bytes
+ if (magic == FAT_CIGAM)
+ swapIntsInHeader(bytes.data(), bytes.size());
+
+ archs = (struct fat_arch*)(bytes.data() + sizeof(struct fat_header));
+ numArchs = ((struct fat_header *)bytes.data())->nfat_arch;
+
+ unsigned maxArchs = (bytes.size() - sizeof(struct fat_header)) / sizeof(struct fat_arch);
+ if (numArchs > maxArchs)
+ numArchs = maxArchs;
+ }
}
- return YES;
+
+ if (!archs || !numArchs)
+ return NO;
+
+ const NXArchInfo* localArch = NXGetLocalArchInfo();
+ if (!localArch)
+ return NO;
+
+ cpu_type_t cputype = localArch->cputype;
+ cpu_subtype_t cpusubtype = localArch->cpusubtype;
+
+#ifdef __x86_64__
+ // NXGetLocalArchInfo returns CPU_TYPE_X86 even when running in 64-bit.
+ // See <rdar://problem/4996965> for more information.
+ cputype = CPU_TYPE_X86_64;
+#endif
+
+ return NXFindBestFatArch(cputype, cpusubtype, archs, numArchs) != 0;
}
- (UInt32)versionNumber
diff --git a/WebKit/mac/Plugins/WebKitPluginContainerView.h b/WebKit/mac/Plugins/WebKitPluginContainerView.h
index c1b93c7..a67c105 100644
--- a/WebKit/mac/Plugins/WebKitPluginContainerView.h
+++ b/WebKit/mac/Plugins/WebKitPluginContainerView.h
@@ -31,7 +31,7 @@
@class DOMElement;
@interface WebKitPluginContainerView : NSView
-{
+{
DOMElement *_element;
}
diff --git a/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.c b/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.c
index a370728..797e824 100644
--- a/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.c
+++ b/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.c
@@ -1,15 +1,31 @@
/*
- * WebNetscapeDeprecatedFunctions.c
- * WebKit
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
- * Created by Tim Omernick on 3/21/06.
- * Copyright 2006 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.
*
+ * 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.
*/
#include "WebNetscapeDeprecatedFunctions.h"
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
OSErr WebGetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions options, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
{
@@ -31,4 +47,4 @@ extern void WebLMSetCurApRefNum(SInt16 value)
LMSetCurApRefNum(value);
}
-#endif /* !__LP64__ */
+#endif /* ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) */
diff --git a/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h b/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h
index f1390a4..93c3194 100644
--- a/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h
+++ b/WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h
@@ -1,13 +1,29 @@
/*
- * WebNetscapeDeprecatedFunctions.h
- * WebKit
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
- * Created by Tim Omernick on 3/21/06.
- * Copyright 2006 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.
*
+ * 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.
*/
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
#import <CoreServices/CoreServices.h>
@@ -16,4 +32,4 @@ extern OSErr WebCloseConnection(CFragConnectionID *connID);
extern SInt16 WebLMGetCurApRefNum(void);
extern void WebLMSetCurApRefNum(SInt16 value);
-#endif /* !__LP64__ */
+#endif /* ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) */
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.h b/WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.h
deleted file mode 100644
index 9dca60d..0000000
--- a/WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.h
+++ /dev/null
@@ -1,45 +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.
- */
-#ifndef __LP64__
-#import <AppKit/AppKit.h>
-
-#import <WebKit/WebBaseNetscapePluginView.h>
-
-@class WebFrame;
-@class WebNetscapePluginStream;
-
-// 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 WebNetscapePluginEmbeddedView WebNetscapePluginDocumentView
-
-@interface WebNetscapePluginEmbeddedView : WebBaseNetscapePluginView
-{
-}
-@end
-#endif
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.mm b/WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.mm
deleted file mode 100644
index e9f9d94..0000000
--- a/WebKit/mac/Plugins/WebNetscapePluginEmbeddedView.mm
+++ /dev/null
@@ -1,50 +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.
- */
-#ifndef __LP64__
-#import "WebNetscapePluginEmbeddedView.h"
-
-#import "WebBaseNetscapePluginViewPrivate.h"
-#import "WebDataSource.h"
-#import "WebFrame.h"
-#import "WebFrameBridge.h"
-#import "WebFrameInternal.h"
-#import "WebFrameView.h"
-#import "WebNSURLExtras.h"
-#import "WebNSURLRequestExtras.h"
-#import "WebNSViewExtras.h"
-#import "WebNetscapePluginPackage.h"
-#import "WebNetscapePluginStream.h"
-#import "WebView.h"
-#import <JavaScriptCore/Assertions.h>
-#import <WebCore/Frame.h>
-#import <WebCore/FrameLoader.h>
-
-@implementation WebNetscapePluginEmbeddedView
-
-@end
-#endif
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h
new file mode 100644
index 0000000..54402bb
--- /dev/null
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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.
+ */
+
+#ifndef WebNetscapePluginEventHandler_h
+#define WebNetscapePluginEventHandler_h
+
+#import "WebBaseNetscapePluginView.h"
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
+@class NSEvent;
+@class WebBaseNetscapePluginView;
+
+struct CGRect;
+
+class WebNetscapePluginEventHandler {
+public:
+ static WebNetscapePluginEventHandler* create(WebBaseNetscapePluginView*);
+ virtual ~WebNetscapePluginEventHandler() { }
+
+ virtual void drawRect(const NSRect&) = 0;
+
+ virtual void mouseDown(NSEvent*) = 0;
+ virtual void mouseDragged(NSEvent*) = 0;
+ virtual void mouseEntered(NSEvent*) = 0;
+ virtual void mouseExited(NSEvent*) = 0;
+ virtual void mouseMoved(NSEvent*) = 0;
+ virtual void mouseUp(NSEvent*) = 0;
+ virtual bool scrollWheel(NSEvent*) = 0;
+
+ virtual void keyDown(NSEvent*) = 0;
+ virtual void keyUp(NSEvent*) = 0;
+ virtual void flagsChanged(NSEvent*) = 0;
+
+ virtual void focusChanged(bool hasFocus) = 0;
+ virtual void windowFocusChanged(bool hasFocus) = 0;
+
+ virtual void startTimers(bool throttleTimers) { }
+ virtual void stopTimers() { }
+
+ // Returns the platform specific window used in NPP_SetWindow
+ virtual void* platformWindow(NSWindow*) = 0;
+
+ bool currentEventIsUserGesture() const { return m_currentEventIsUserGesture; }
+protected:
+ WebNetscapePluginEventHandler(WebBaseNetscapePluginView* pluginView)
+ : m_pluginView(pluginView)
+ , m_currentEventIsUserGesture(false)
+ {
+ }
+
+ WebBaseNetscapePluginView* m_pluginView;
+ bool m_currentEventIsUserGesture;
+};
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
+#endif // WebNetscapePluginEventHandler_h
+
+
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm
new file mode 100644
index 0000000..e8e6d8a
--- /dev/null
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 ENABLE(NETSCAPE_PLUGIN_API)
+
+#import "WebNetscapePluginEventHandler.h"
+
+#import <wtf/Assertions.h>
+#import "WebBaseNetscapePluginView.h"
+#import "WebNetscapePluginEventHandlerCarbon.h"
+#import "WebNetscapePluginEventHandlerCocoa.h"
+
+WebNetscapePluginEventHandler* WebNetscapePluginEventHandler::create(WebBaseNetscapePluginView* pluginView)
+{
+ switch ([pluginView eventModel]) {
+#ifndef NP_NO_CARBON
+ case NPEventModelCarbon:
+ return new WebNetscapePluginEventHandlerCarbon(pluginView);
+#endif // NP_NO_CARBON
+ case NPEventModelCocoa:
+ return new WebNetscapePluginEventHandlerCocoa(pluginView);
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+}
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h
new file mode 100644
index 0000000..cf26276
--- /dev/null
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
+
+#ifndef WebNetscapePluginEventHandlerCarbon_h
+#define WebNetscapePluginEventHandlerCarbon_h
+
+#include "WebNetscapePluginEventHandler.h"
+
+#import <Carbon/Carbon.h>
+#import <wtf/RetainPtr.h>
+
+class WebNetscapePluginEventHandlerCarbon : public WebNetscapePluginEventHandler {
+public:
+ WebNetscapePluginEventHandlerCarbon(WebBaseNetscapePluginView*);
+
+ virtual void drawRect(const NSRect&);
+
+ virtual void mouseDown(NSEvent*);
+ virtual void mouseDragged(NSEvent*);
+ virtual void mouseEntered(NSEvent*);
+ virtual void mouseExited(NSEvent*);
+ virtual void mouseMoved(NSEvent*);
+ virtual void mouseUp(NSEvent*);
+ virtual bool scrollWheel(NSEvent*);
+
+ virtual void keyDown(NSEvent*);
+ virtual void keyUp(NSEvent*);
+ virtual void flagsChanged(NSEvent*);
+
+ virtual void windowFocusChanged(bool hasFocus);
+ virtual void focusChanged(bool hasFocus);
+
+ virtual void startTimers(bool throttleTimers);
+ virtual void stopTimers();
+
+ virtual void* platformWindow(NSWindow*);
+
+private:
+ void sendNullEvent();
+
+ void installKeyEventHandler();
+ void removeKeyEventHandler();
+
+ static OSStatus TSMEventHandler(EventHandlerCallRef, EventRef, void *eventHandler);
+ static void nullEventTimerFired(CFRunLoopTimerRef, void *context);
+
+ bool sendEvent(EventRecord*);
+
+ EventHandlerRef m_keyEventHandler;
+ bool m_suspendKeyUpEvents;
+ RetainPtr<CFRunLoopTimerRef> m_nullEventTimer;
+};
+
+#endif // WebNetscapePluginEventHandlerCarbon_h
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
+
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
new file mode 100644
index 0000000..bfdd91c
--- /dev/null
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
@@ -0,0 +1,411 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
+
+#import "WebNetscapePluginEventHandlerCarbon.h"
+
+#import "WebBaseNetscapePluginView.h"
+#import "WebKitLogging.h"
+#import "WebKitSystemInterface.h"
+
+// Send null events 50 times a second when active, so plug-ins like Flash get high frame rates.
+#define NullEventIntervalActive 0.02
+#define NullEventIntervalNotActive 0.25
+
+WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon(WebBaseNetscapePluginView* pluginView)
+ : WebNetscapePluginEventHandler(pluginView)
+ , m_keyEventHandler(0)
+ , m_suspendKeyUpEvents(false)
+{
+}
+
+static void getCarbonEvent(EventRecord* carbonEvent)
+{
+ carbonEvent->what = nullEvent;
+ carbonEvent->message = 0;
+ carbonEvent->when = TickCount();
+
+ GetGlobalMouse(&carbonEvent->where);
+ carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor());
+ carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor());
+ carbonEvent->modifiers = GetCurrentKeyModifiers();
+ if (!Button())
+ carbonEvent->modifiers |= btnState;
+}
+
+static EventModifiers modifiersForEvent(NSEvent *event)
+{
+ EventModifiers modifiers;
+ unsigned int modifierFlags = [event modifierFlags];
+ NSEventType eventType = [event type];
+
+ modifiers = 0;
+
+ if (eventType != NSLeftMouseDown && eventType != NSRightMouseDown)
+ modifiers |= btnState;
+
+ if (modifierFlags & NSCommandKeyMask)
+ modifiers |= cmdKey;
+
+ if (modifierFlags & NSShiftKeyMask)
+ modifiers |= shiftKey;
+
+ if (modifierFlags & NSAlphaShiftKeyMask)
+ modifiers |= alphaLock;
+
+ if (modifierFlags & NSAlternateKeyMask)
+ modifiers |= optionKey;
+
+ if (modifierFlags & NSControlKeyMask || eventType == NSRightMouseDown)
+ modifiers |= controlKey;
+
+ return modifiers;
+}
+
+static void getCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent)
+{
+ if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) {
+ carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor());
+ carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor());
+ return;
+ }
+
+ NSPoint where = [[cocoaEvent window] convertBaseToScreen:[cocoaEvent locationInWindow]];
+
+ carbonEvent->what = nullEvent;
+ carbonEvent->message = 0;
+ carbonEvent->when = (UInt32)([cocoaEvent timestamp] * 60); // seconds to ticks
+ carbonEvent->where.h = (short)where.x;
+ carbonEvent->where.v = (short)(NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - where.y);
+ carbonEvent->modifiers = modifiersForEvent(cocoaEvent);
+}
+
+void WebNetscapePluginEventHandlerCarbon::sendNullEvent()
+{
+ EventRecord event;
+
+ getCarbonEvent(&event);
+
+ // Plug-in should not react to cursor position when not active or when a menu is down.
+ MenuTrackingData trackingData;
+ OSStatus error = GetMenuTrackingData(NULL, &trackingData);
+
+ // Plug-in should not react to cursor position when the actual window is not key.
+ if (![[m_pluginView window] isKeyWindow] || (error == noErr && trackingData.menu)) {
+ // FIXME: Does passing a v and h of -1 really prevent it from reacting to the cursor position?
+ event.where.v = -1;
+ event.where.h = -1;
+ }
+
+ sendEvent(&event);
+}
+
+void WebNetscapePluginEventHandlerCarbon::drawRect(const NSRect&)
+{
+ EventRecord event;
+
+ getCarbonEvent(&event);
+ event.what = updateEvt;
+ WindowRef windowRef = (WindowRef)[[m_pluginView window] windowRef];
+ event.message = (unsigned long)windowRef;
+
+ BOOL acceptedEvent;
+ acceptedEvent = sendEvent(&event);
+
+ LOG(PluginEvents, "NPP_HandleEvent(updateEvt): %d", acceptedEvent);
+}
+
+void WebNetscapePluginEventHandlerCarbon::mouseDown(NSEvent* theEvent)
+{
+ EventRecord event;
+
+ getCarbonEvent(&event, theEvent);
+ event.what = ::mouseDown;
+
+ BOOL acceptedEvent;
+ acceptedEvent = sendEvent(&event);
+
+ LOG(PluginEvents, "NPP_HandleEvent(mouseDown): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
+}
+
+void WebNetscapePluginEventHandlerCarbon::mouseUp(NSEvent* theEvent)
+{
+ EventRecord event;
+
+ getCarbonEvent(&event, theEvent);
+ event.what = ::mouseUp;
+
+ BOOL acceptedEvent;
+ acceptedEvent = sendEvent(&event);
+
+ LOG(PluginEvents, "NPP_HandleEvent(mouseUp): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
+}
+
+bool WebNetscapePluginEventHandlerCarbon::scrollWheel(NSEvent* theEvent)
+{
+ return false;
+}
+
+void WebNetscapePluginEventHandlerCarbon::mouseEntered(NSEvent* theEvent)
+{
+ EventRecord event;
+
+ getCarbonEvent(&event, theEvent);
+ event.what = adjustCursorEvent;
+
+ BOOL acceptedEvent;
+ acceptedEvent = sendEvent(&event);
+
+ LOG(PluginEvents, "NPP_HandleEvent(mouseEntered): %d", acceptedEvent);
+}
+
+void WebNetscapePluginEventHandlerCarbon::mouseExited(NSEvent* theEvent)
+{
+ EventRecord event;
+
+ getCarbonEvent(&event, theEvent);
+ event.what = adjustCursorEvent;
+
+ BOOL acceptedEvent;
+ acceptedEvent = sendEvent(&event);
+
+ LOG(PluginEvents, "NPP_HandleEvent(mouseExited): %d", acceptedEvent);
+}
+
+void WebNetscapePluginEventHandlerCarbon::mouseDragged(NSEvent*)
+{
+}
+
+void WebNetscapePluginEventHandlerCarbon::mouseMoved(NSEvent*)
+{
+}
+
+void WebNetscapePluginEventHandlerCarbon::keyDown(NSEvent *theEvent)
+{
+ m_suspendKeyUpEvents = true;
+ WKSendKeyEventToTSM(theEvent);
+}
+
+static UInt32 keyMessageForEvent(NSEvent *event)
+{
+ NSData *data = [[event characters] dataUsingEncoding:CFStringConvertEncodingToNSStringEncoding(CFStringGetSystemEncoding())];
+ if (!data)
+ return 0;
+
+ UInt8 characterCode;
+ [data getBytes:&characterCode length:1];
+ UInt16 keyCode = [event keyCode];
+ return keyCode << 8 | characterCode;
+}
+
+void WebNetscapePluginEventHandlerCarbon::keyUp(NSEvent* theEvent)
+{
+ WKSendKeyEventToTSM(theEvent);
+
+ // TSM won't send keyUp events so we have to send them ourselves.
+ // Only send keyUp events after we receive the TSM callback because this is what plug-in expect from OS 9.
+ if (!m_suspendKeyUpEvents) {
+ EventRecord event;
+
+ getCarbonEvent(&event, theEvent);
+ event.what = ::keyUp;
+
+ if (event.message == 0)
+ event.message = keyMessageForEvent(theEvent);
+
+ sendEvent(&event);
+ }
+}
+
+void WebNetscapePluginEventHandlerCarbon::flagsChanged(NSEvent*)
+{
+}
+
+void WebNetscapePluginEventHandlerCarbon::focusChanged(bool hasFocus)
+{
+ EventRecord event;
+
+ getCarbonEvent(&event);
+ bool acceptedEvent;
+ if (hasFocus) {
+ event.what = getFocusEvent;
+ acceptedEvent = sendEvent(&event);
+ LOG(PluginEvents, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent);
+ installKeyEventHandler();
+ } else {
+ event.what = loseFocusEvent;
+ acceptedEvent = sendEvent(&event);
+ LOG(PluginEvents, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent);
+ removeKeyEventHandler();
+ }
+}
+
+void WebNetscapePluginEventHandlerCarbon::windowFocusChanged(bool hasFocus)
+{
+ EventRecord event;
+
+ getCarbonEvent(&event);
+ event.what = activateEvt;
+ WindowRef windowRef = (WindowRef)[[m_pluginView window] windowRef];
+ event.message = (unsigned long)windowRef;
+ if (hasFocus)
+ event.modifiers |= activeFlag;
+
+ BOOL acceptedEvent;
+ acceptedEvent = sendEvent(&event);
+
+ LOG(PluginEvents, "NPP_HandleEvent(activateEvent): %d isActive: %d", acceptedEvent, hasFocus);
+}
+
+OSStatus WebNetscapePluginEventHandlerCarbon::TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *eventHandler)
+{
+ EventRef rawKeyEventRef;
+ OSStatus status = GetEventParameter(inEvent, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL, sizeof(EventRef), NULL, &rawKeyEventRef);
+ if (status != noErr) {
+ LOG_ERROR("GetEventParameter failed with error: %d", status);
+ return noErr;
+ }
+
+ // Two-pass read to allocate/extract Mac charCodes
+ ByteCount numBytes;
+ status = GetEventParameter(rawKeyEventRef, kEventParamKeyMacCharCodes, typeChar, NULL, 0, &numBytes, NULL);
+ if (status != noErr) {
+ LOG_ERROR("GetEventParameter failed with error: %d", status);
+ return noErr;
+ }
+ char *buffer = (char *)malloc(numBytes);
+ status = GetEventParameter(rawKeyEventRef, kEventParamKeyMacCharCodes, typeChar, NULL, numBytes, NULL, buffer);
+ if (status != noErr) {
+ LOG_ERROR("GetEventParameter failed with error: %d", status);
+ free(buffer);
+ return noErr;
+ }
+
+ EventRef cloneEvent = CopyEvent(rawKeyEventRef);
+ unsigned i;
+ for (i = 0; i < numBytes; i++) {
+ status = SetEventParameter(cloneEvent, kEventParamKeyMacCharCodes, typeChar, 1 /* one char code */, &buffer[i]);
+ if (status != noErr) {
+ LOG_ERROR("SetEventParameter failed with error: %d", status);
+ free(buffer);
+ return noErr;
+ }
+
+ EventRecord eventRec;
+ if (ConvertEventRefToEventRecord(cloneEvent, &eventRec)) {
+ BOOL acceptedEvent;
+ acceptedEvent = static_cast<WebNetscapePluginEventHandlerCarbon*>(eventHandler)->sendEvent(&eventRec);
+
+ LOG(PluginEvents, "NPP_HandleEvent(keyDown): %d charCode:%c keyCode:%lu",
+ acceptedEvent, (char) (eventRec.message & charCodeMask), (eventRec.message & keyCodeMask));
+
+ // We originally thought that if the plug-in didn't accept this event,
+ // we should pass it along so that keyboard scrolling, for example, will work.
+ // In practice, this is not a good idea, because plug-ins tend to eat the event but return false.
+ // MacIE handles each key event twice because of this, but we will emulate the other browsers instead.
+ }
+ }
+ ReleaseEvent(cloneEvent);
+
+ free(buffer);
+
+ return noErr;
+}
+
+void WebNetscapePluginEventHandlerCarbon::installKeyEventHandler()
+{
+ static const EventTypeSpec sTSMEvents[] =
+ {
+ { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }
+ };
+
+ if (!m_keyEventHandler) {
+ InstallEventHandler(GetWindowEventTarget((WindowRef)[[m_pluginView window] windowRef]),
+ NewEventHandlerUPP(TSMEventHandler),
+ GetEventTypeCount(sTSMEvents),
+ sTSMEvents,
+ this,
+ &m_keyEventHandler);
+ }
+}
+
+void WebNetscapePluginEventHandlerCarbon::removeKeyEventHandler()
+{
+ if (m_keyEventHandler) {
+ RemoveEventHandler(m_keyEventHandler);
+ m_keyEventHandler = 0;
+ }
+}
+
+void WebNetscapePluginEventHandlerCarbon::nullEventTimerFired(CFRunLoopTimerRef timerRef, void *context)
+{
+ static_cast<WebNetscapePluginEventHandlerCarbon*>(context)->sendNullEvent();
+}
+
+void WebNetscapePluginEventHandlerCarbon::startTimers(bool throttleTimers)
+{
+ ASSERT(!m_nullEventTimer);
+
+ CFTimeInterval interval = !throttleTimers ? NullEventIntervalActive : NullEventIntervalNotActive;
+
+ CFRunLoopTimerContext context = { 0, this, NULL, NULL, NULL };
+ m_nullEventTimer.adoptCF(CFRunLoopTimerCreate(0, CFAbsoluteTimeGetCurrent() + interval, interval,
+ 0, 0, nullEventTimerFired, &context));
+ CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_nullEventTimer.get(), kCFRunLoopDefaultMode);
+}
+
+void WebNetscapePluginEventHandlerCarbon::stopTimers()
+{
+ if (!m_nullEventTimer)
+ return;
+
+ CFRunLoopTimerInvalidate(m_nullEventTimer.get());
+ m_nullEventTimer = 0;
+}
+
+void* WebNetscapePluginEventHandlerCarbon::platformWindow(NSWindow* window)
+{
+ return [window windowRef];
+}
+
+bool WebNetscapePluginEventHandlerCarbon::sendEvent(EventRecord* event)
+{
+ // If at any point the user clicks or presses a key from within a plugin, set the
+ // currentEventIsUserGesture flag to true. This is important to differentiate legitimate
+ // window.open() calls; we still want to allow those. See rdar://problem/4010765
+ if (event->what == ::mouseDown || event->what == ::keyDown || event->what == ::mouseUp || event->what == ::autoKey)
+ m_currentEventIsUserGesture = true;
+
+ m_suspendKeyUpEvents = false;
+
+ bool result = [m_pluginView sendEvent:event isDrawRect:event->what == updateEvt];
+
+ m_currentEventIsUserGesture = false;
+
+ return result;
+}
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h
new file mode 100644
index 0000000..e22ff3d
--- /dev/null
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 ENABLE(NETSCAPE_PLUGIN_API)
+
+#ifndef WebNetscapePluginEventHandlerCocoa_h
+#define WebNetscapePluginEventHandlerCocoa_h
+
+#include <WebKit/npapi.h>
+#include "WebNetscapePluginEventHandler.h"
+
+class WebNetscapePluginEventHandlerCocoa : public WebNetscapePluginEventHandler {
+public:
+ WebNetscapePluginEventHandlerCocoa(WebBaseNetscapePluginView*);
+
+ virtual void drawRect(const NSRect&);
+
+ virtual void mouseDown(NSEvent*);
+ virtual void mouseDragged(NSEvent*);
+ virtual void mouseEntered(NSEvent*);
+ virtual void mouseExited(NSEvent*);
+ virtual void mouseMoved(NSEvent*);
+ virtual void mouseUp(NSEvent*);
+ virtual bool scrollWheel(NSEvent*);
+
+ virtual void keyDown(NSEvent*);
+ virtual void keyUp(NSEvent*);
+ virtual void flagsChanged(NSEvent*);
+
+ virtual void windowFocusChanged(bool hasFocus);
+ virtual void focusChanged(bool hasFocus);
+
+ virtual void* platformWindow(NSWindow*);
+private:
+ bool sendMouseEvent(NSEvent*, NPCocoaEventType);
+ bool sendKeyEvent(NSEvent*, NPCocoaEventType);
+ bool sendEvent(NPCocoaEvent*);
+};
+
+#endif //WebNetscapePluginEventHandlerCocoa_h
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
new file mode 100644
index 0000000..fb13a12
--- /dev/null
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 ENABLE(NETSCAPE_PLUGIN_API)
+
+#import "WebNetscapePluginEventHandlerCocoa.h"
+
+#import "WebBaseNetscapePluginView.h"
+
+WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa(WebBaseNetscapePluginView* pluginView)
+ : WebNetscapePluginEventHandler(pluginView)
+{
+}
+
+static inline void initializeEvent(NPCocoaEvent* event, NPCocoaEventType type)
+{
+ event->type = type;
+ event->version = 0;
+}
+
+void WebNetscapePluginEventHandlerCocoa::drawRect(const NSRect& rect)
+{
+ NPCocoaEvent event;
+
+ initializeEvent(&event, NPCocoaEventDrawRect);
+ event.data.draw.x = rect.origin.x;
+ event.data.draw.y = rect.origin.y;
+ event.data.draw.width = rect.size.width;
+ event.data.draw.height = rect.size.height;
+
+ sendEvent(&event);
+}
+
+void WebNetscapePluginEventHandlerCocoa::mouseDown(NSEvent *event)
+{
+ sendMouseEvent(event, NPCocoaEventMouseDown);
+}
+
+void WebNetscapePluginEventHandlerCocoa::mouseDragged(NSEvent *event)
+{
+ sendMouseEvent(event, NPCocoaEventMouseDragged);
+}
+
+void WebNetscapePluginEventHandlerCocoa::mouseEntered(NSEvent *event)
+{
+ sendMouseEvent(event, NPCocoaEventMouseEntered);
+}
+
+void WebNetscapePluginEventHandlerCocoa::mouseExited(NSEvent *event)
+{
+ sendMouseEvent(event, NPCocoaEventMouseExited);
+}
+
+void WebNetscapePluginEventHandlerCocoa::mouseMoved(NSEvent *event)
+{
+ sendMouseEvent(event, NPCocoaEventMouseMoved);
+}
+
+void WebNetscapePluginEventHandlerCocoa::mouseUp(NSEvent *event)
+{
+ sendMouseEvent(event, NPCocoaEventMouseUp);
+}
+
+bool WebNetscapePluginEventHandlerCocoa::scrollWheel(NSEvent* event)
+{
+ return sendMouseEvent(event, NPCocoaEventScrollWheel);
+}
+
+bool WebNetscapePluginEventHandlerCocoa::sendMouseEvent(NSEvent *nsEvent, NPCocoaEventType type)
+{
+ NPCocoaEvent event;
+
+ NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil];
+
+ int clickCount;
+ if (type == NPCocoaEventMouseEntered || type == NPCocoaEventMouseExited || type == NPCocoaEventScrollWheel)
+ clickCount = 0;
+ else
+ clickCount = [nsEvent clickCount];
+
+ initializeEvent(&event, type);
+ event.data.mouse.modifierFlags = [nsEvent modifierFlags];
+ event.data.mouse.buttonNumber = [nsEvent buttonNumber];
+ event.data.mouse.clickCount = clickCount;
+ event.data.mouse.pluginX = point.x;
+ event.data.mouse.pluginY = point.y;
+ event.data.mouse.deltaX = [nsEvent deltaX];
+ event.data.mouse.deltaY = [nsEvent deltaY];
+ event.data.mouse.deltaZ = [nsEvent deltaZ];
+
+ return sendEvent(&event);
+}
+
+void WebNetscapePluginEventHandlerCocoa::keyDown(NSEvent *event)
+{
+ bool retval = sendKeyEvent(event, NPCocoaEventKeyDown);
+
+ // If the plug-in did not handle the event, pass it on to the Input Manager.
+ if (!retval)
+ [m_pluginView interpretKeyEvents:[NSArray arrayWithObject:event]];
+}
+
+void WebNetscapePluginEventHandlerCocoa::keyUp(NSEvent *event)
+{
+ sendKeyEvent(event, NPCocoaEventKeyUp);
+}
+
+void WebNetscapePluginEventHandlerCocoa::flagsChanged(NSEvent *nsEvent)
+{
+ NPCocoaEvent event;
+
+ initializeEvent(&event, NPCocoaEventFlagsChanged);
+ event.data.key.modifierFlags = [nsEvent modifierFlags];
+ event.data.key.keyCode = [nsEvent keyCode];
+ event.data.key.isARepeat = false;
+ event.data.key.characters = 0;
+ event.data.key.charactersIgnoringModifiers = 0;
+
+ sendEvent(&event);
+}
+
+bool WebNetscapePluginEventHandlerCocoa::sendKeyEvent(NSEvent* nsEvent, NPCocoaEventType type)
+{
+ NPCocoaEvent event;
+
+ initializeEvent(&event, type);
+ event.data.key.modifierFlags = [nsEvent modifierFlags];
+ event.data.key.keyCode = [nsEvent keyCode];
+ event.data.key.isARepeat = [nsEvent isARepeat];
+ event.data.key.characters = (NPNSString *)[nsEvent characters];
+ event.data.key.charactersIgnoringModifiers = (NPNSString *)[nsEvent charactersIgnoringModifiers];
+
+ return sendEvent(&event);
+}
+
+void WebNetscapePluginEventHandlerCocoa::windowFocusChanged(bool hasFocus)
+{
+ NPCocoaEvent event;
+
+ initializeEvent(&event, NPCocoaEventWindowFocusChanged);
+ event.data.focus.hasFocus = hasFocus;
+
+ sendEvent(&event);
+}
+
+void WebNetscapePluginEventHandlerCocoa::focusChanged(bool hasFocus)
+{
+ NPCocoaEvent event;
+
+ initializeEvent(&event, NPCocoaEventFocusChanged);
+ event.data.focus.hasFocus = hasFocus;
+
+ sendEvent(&event);
+}
+
+void* WebNetscapePluginEventHandlerCocoa::platformWindow(NSWindow* window)
+{
+ return window;
+}
+
+bool WebNetscapePluginEventHandlerCocoa::sendEvent(NPCocoaEvent* event)
+{
+ switch (event->type) {
+ case NPCocoaEventMouseDown:
+ case NPCocoaEventMouseUp:
+ case NPCocoaEventMouseDragged:
+ case NPCocoaEventKeyDown:
+ case NPCocoaEventKeyUp:
+ case NPCocoaEventFlagsChanged:
+ case NPCocoaEventScrollWheel:
+ m_currentEventIsUserGesture = true;
+ break;
+ default:
+ m_currentEventIsUserGesture = false;
+ }
+
+ bool result = [m_pluginView sendEvent:event isDrawRect:event->type == NPCocoaEventDrawRect];
+
+ m_currentEventIsUserGesture = false;
+ return result;
+}
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.h b/WebKit/mac/Plugins/WebNetscapePluginPackage.h
index 75404d8..6ccbfdb 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginPackage.h
+++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.h
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebBasePluginPackage.h"
#ifdef BUILDING_ON_TIGER
@@ -99,6 +99,7 @@ typedef enum {
- (NPP_GetValueProcPtr)NPP_GetValue;
- (NPP_SetValueProcPtr)NPP_SetValue;
- (NPP_PrintProcPtr)NPP_Print;
+- (NPPluginFuncs *)pluginFuncs;
@end
#endif
diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.m b/WebKit/mac/Plugins/WebNetscapePluginPackage.m
index 297ff11..0767c1d 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginPackage.m
+++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.m
@@ -26,14 +26,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebNetscapePluginPackage.h"
#import "WebKitLogging.h"
#import "WebKitNSStringExtras.h"
#import "WebNSObjectExtras.h"
#import "WebNetscapeDeprecatedFunctions.h"
-#import <JavaScriptCore/npruntime_impl.h>
+#import <WebCore/npruntime_impl.h>
#ifdef SUPPORT_CFM
typedef void (* FunctionPointer)(void);
@@ -236,6 +236,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
if (hasCFMHeader)
return NO;
#endif
+
if (![self isNativeLibraryData:data])
return NO;
}
@@ -299,6 +300,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
}
+- (void)unload
+{
+ [self _unloadWithShutdown:YES];
+}
+
- (BOOL)load
{
NP_GetEntryPointsFuncPtr NP_GetEntryPoints = NULL;
@@ -418,6 +424,10 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
browserFuncs.getJavaPeer = (NPN_GetJavaPeerProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetJavaPeer);
browserFuncs.pushpopupsenabledstate = (NPN_PushPopupsEnabledStateProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PushPopupsEnabledState);
browserFuncs.poppopupsenabledstate = (NPN_PopPopupsEnabledStateProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PopPopupsEnabledState);
+ browserFuncs.pluginthreadasynccall = (NPN_PluginThreadAsyncCallProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PluginThreadAsyncCall);
+ browserFuncs.scheduletimer = (NPN_ScheduleTimerProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_ScheduleTimer);
+ browserFuncs.unscheduletimer = (NPN_UnscheduleTimerProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_UnscheduleTimer);
+ browserFuncs.popupcontextmenu = (NPN_PopUpContextMenuProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PopUpContextMenu);
browserFuncs.releasevariantvalue = (NPN_ReleaseVariantValueProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_ReleaseVariantValue);
browserFuncs.getstringidentifier = (NPN_GetStringIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetStringIdentifier);
@@ -425,6 +435,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
browserFuncs.getintidentifier = (NPN_GetIntIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetIntIdentifier);
browserFuncs.identifierisstring = (NPN_IdentifierIsStringProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_IdentifierIsString);
browserFuncs.utf8fromidentifier = (NPN_UTF8FromIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_UTF8FromIdentifier);
+ browserFuncs.intfromidentifier = (NPN_IntFromIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_IntFromIdentifier);
browserFuncs.createobject = (NPN_CreateObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_CreateObject);
browserFuncs.retainobject = (NPN_RetainObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_RetainObject);
browserFuncs.releaseobject = (NPN_ReleaseObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_ReleaseObject);
@@ -436,6 +447,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
browserFuncs.removeproperty = (NPN_RemovePropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_RemoveProperty);
browserFuncs.setexception = (NPN_SetExceptionProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_SetException);
browserFuncs.enumerate = (NPN_EnumerateProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Enumerate);
+ browserFuncs.construct = (NPN_ConstructProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Construct);
[self _applyDjVuWorkaround];
@@ -519,6 +531,10 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
browserFuncs.getJavaPeer = NPN_GetJavaPeer;
browserFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState;
browserFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState;
+ browserFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall;
+ browserFuncs.scheduletimer = NPN_ScheduleTimer;
+ browserFuncs.unscheduletimer = NPN_UnscheduleTimer;
+ browserFuncs.popupcontextmenu = NPN_PopUpContextMenu;
browserFuncs.releasevariantvalue = _NPN_ReleaseVariantValue;
browserFuncs.getstringidentifier = _NPN_GetStringIdentifier;
@@ -526,6 +542,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
browserFuncs.getintidentifier = _NPN_GetIntIdentifier;
browserFuncs.identifierisstring = _NPN_IdentifierIsString;
browserFuncs.utf8fromidentifier = _NPN_UTF8FromIdentifier;
+ browserFuncs.intfromidentifier = _NPN_IntFromIdentifier;
browserFuncs.createobject = _NPN_CreateObject;
browserFuncs.retainobject = _NPN_RetainObject;
browserFuncs.releaseobject = _NPN_ReleaseObject;
@@ -537,7 +554,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
browserFuncs.removeproperty = _NPN_RemoveProperty;
browserFuncs.setexception = _NPN_SetException;
browserFuncs.enumerate = _NPN_Enumerate;
-
+ browserFuncs.construct = _NPN_Construct;
+
[self _applyDjVuWorkaround];
#if !LOG_DISABLED
@@ -553,6 +571,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
#endif
LOG(Plugins, "%f NP_Initialize took %f seconds", currentTime, duration);
+ pluginFuncs.size = sizeof(NPPluginFuncs);
+
npErr = NP_GetEntryPoints(&pluginFuncs);
if (npErr != NPERR_NO_ERROR)
goto abort;
@@ -662,6 +682,11 @@ abort:
return NPP_Print;
}
+- (NPPluginFuncs *)pluginFuncs
+{
+ return &pluginFuncs;
+}
+
- (void)wasRemovedFromPluginDatabase:(WebPluginDatabase *)database
{
[super wasRemovedFromPluginDatabase:database];
diff --git a/WebKit/mac/Plugins/WebNetscapePluginStream.h b/WebKit/mac/Plugins/WebNetscapePluginStream.h
deleted file mode 100644
index e9e48f0..0000000
--- a/WebKit/mac/Plugins/WebNetscapePluginStream.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 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.
- */
-#ifndef __LP64__
-#import <WebKit/WebBaseNetscapePluginStream.h>
-#import <WebKit/npapi.h>
-
-namespace WebCore {
- class FrameLoader;
- class NetscapePlugInStreamLoader;
-}
-@class NSURLRequest;
-
-class WebNetscapePlugInStreamLoaderClient;
-
-@interface WebNetscapePluginStream : WebBaseNetscapePluginStream
-{
- WebCore::FrameLoader* _frameLoader;
- WebCore::NetscapePlugInStreamLoader* _loader;
- WebNetscapePlugInStreamLoaderClient* _client;
- NSURLRequest *request;
-}
-
-- (id)initWithFrameLoader:(WebCore::FrameLoader *)frameLoader;
-- (id)initWithRequest:(NSURLRequest *)theRequest
- plugin:(NPP)thePlugin
- notifyData:(void *)theNotifyData
- sendNotification:(BOOL)sendNotification;
-- (void)start;
-- (void)stop;
-
-@end
-#endif
diff --git a/WebKit/mac/Plugins/WebNetscapePluginStream.mm b/WebKit/mac/Plugins/WebNetscapePluginStream.mm
deleted file mode 100644
index 8b03e01..0000000
--- a/WebKit/mac/Plugins/WebNetscapePluginStream.mm
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2005, 2006 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.
- */
-#ifndef __LP64__
-#import <WebKit/WebNetscapePluginStream.h>
-
-#import <Foundation/NSURLConnection.h>
-#import <WebCore/DocumentLoader.h>
-#import <WebCore/Frame.h>
-#import <WebCore/FrameLoader.h>
-#import <WebCore/NetscapePlugInStreamLoader.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebKitErrorsPrivate.h>
-#import <WebKit/WebKitLogging.h>
-#import <WebKit/WebNSURLRequestExtras.h>
-#import <WebKit/WebNetscapePluginEmbeddedView.h>
-#import <WebKit/WebNetscapePluginPackage.h>
-#import <WebKit/WebNetscapePlugInStreamLoaderClient.h>
-#import <WebKit/WebViewInternal.h>
-#import <WebCore/ResourceError.h>
-#import <WebCore/WebCoreObjCExtras.h>
-#import <wtf/PassRefPtr.h>
-
-using namespace WebCore;
-
-@implementation WebNetscapePluginStream
-
-#ifndef BUILDING_ON_TIGER
-+ (void)initialize
-{
- WebCoreObjCFinalizeOnMainThread(self);
-}
-#endif
-
-- (id)initWithFrameLoader:(FrameLoader *)frameLoader
-{
- _frameLoader = frameLoader;
-
- return self;
-}
-
-- (id)initWithRequest:(NSURLRequest *)theRequest
- plugin:(NPP)thePlugin
- notifyData:(void *)theNotifyData
- sendNotification:(BOOL)flag
-{
- WebBaseNetscapePluginView *view = (WebBaseNetscapePluginView *)thePlugin->ndata;
-
- if (!core([view webFrame])->loader()->canLoad([theRequest URL], core([view webFrame])->document()))
- return nil;
-
- if ([self initWithRequestURL:[theRequest URL]
- plugin:thePlugin
- notifyData:theNotifyData
- sendNotification:flag] == nil) {
- return nil;
- }
-
- // Temporarily set isTerminated to YES to avoid assertion failure in dealloc in case we are released in this method.
- isTerminated = YES;
-
- request = [theRequest mutableCopy];
- if (core([view webFrame])->loader()->shouldHideReferrer([theRequest URL], core([view webFrame])->loader()->outgoingReferrer()))
- [(NSMutableURLRequest *)request _web_setHTTPReferrer:nil];
-
- _client = new WebNetscapePlugInStreamLoaderClient(self);
- _loader = NetscapePlugInStreamLoader::create(core([view webFrame]), _client).releaseRef();
- _loader->setShouldBufferData(false);
-
- isTerminated = NO;
-
- return self;
-}
-
-- (void)dealloc
-{
- if (_loader)
- _loader->deref();
- delete _client;
- [request release];
- [super dealloc];
-}
-
-- (void)finalize
-{
- ASSERT_MAIN_THREAD();
- if (_loader)
- _loader->deref();
- delete _client;
- [super finalize];
-}
-
-- (void)start
-{
- ASSERT(request);
- ASSERT(!_frameLoader);
-
- _loader->documentLoader()->addPlugInStreamLoader(_loader);
- _loader->load(request);
-}
-
-- (void)cancelLoadWithError:(NSError *)error
-{
- if (_frameLoader) {
- ASSERT(!_loader);
-
- DocumentLoader* documentLoader = _frameLoader->activeDocumentLoader();
- ASSERT(documentLoader);
-
- if (documentLoader->isLoadingMainResource())
- documentLoader->cancelMainResourceLoad(error);
- return;
- }
-
- if (!_loader->isDone())
- _loader->cancel(error);
-}
-
-- (void)stop
-{
- ASSERT(!_frameLoader);
-
- if (!_loader->isDone())
- [self cancelLoadAndDestroyStreamWithError:_loader->cancelledError()];
-}
-
-@end
-#endif
diff --git a/WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h b/WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h
index b4d6ed8..c21fe4c 100644
--- a/WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h
+++ b/WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h
@@ -43,4 +43,6 @@
- (void)receivedData:(NSData *)data;
- (void)finishedLoading;
+- (BOOL)wantsAllStreams;
+
@end
diff --git a/WebKit/mac/Plugins/WebPlugin.h b/WebKit/mac/Plugins/WebPlugin.h
index 3163c06..bd0600e 100644
--- a/WebKit/mac/Plugins/WebPlugin.h
+++ b/WebKit/mac/Plugins/WebPlugin.h
@@ -27,6 +27,7 @@
*/
#import <Cocoa/Cocoa.h>
+#import <JavaScriptCore/WebKitAvailability.h>
/*!
WebPlugIn is an informal protocol that enables interaction between an application
@@ -92,4 +93,40 @@
*/
- (id)objectForWebScript;
+/*!
+ @method webPlugInMainResourceDidReceiveResponse:
+ @abstract Called on the plug-in when WebKit receives -connection:didReceiveResponse:
+ for the plug-in's main resource.
+ @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);
+
+/*!
+ @method webPlugInMainResourceDidReceiveData:
+ @abstract Called on the plug-in when WebKit recieves -connection:didReceiveData:
+ for the plug-in's main resource.
+ @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);
+
+/*!
+ @method webPlugInMainResourceDidFailWithError:
+ @abstract Called on the plug-in when WebKit receives -connection:didFailWithError:
+ for the plug-in's main resource.
+ @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);
+
+/*!
+ @method webPlugInMainResourceDidFinishLoading
+ @abstract Called on the plug-in when WebKit receives -connectionDidFinishLoading:
+ for the plug-in's main resource.
+ @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);
+
@end
diff --git a/WebKit/mac/Plugins/WebPluginContainerCheck.mm b/WebKit/mac/Plugins/WebPluginContainerCheck.mm
index e784224..5c9ecd7 100644
--- a/WebKit/mac/Plugins/WebPluginContainerCheck.mm
+++ b/WebKit/mac/Plugins/WebPluginContainerCheck.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,22 +28,19 @@
#import "WebPluginContainerCheck.h"
-#import "WebFrame.h"
-#import "WebFrameBridge.h"
-#import "WebPluginContainer.h"
+#import "WebFrameInternal.h"
#import "WebPluginContainerPrivate.h"
#import "WebPluginController.h"
-#import "WebPolicyDelegate.h"
#import "WebPolicyDelegatePrivate.h"
#import "WebView.h"
#import "WebViewInternal.h"
#import <Foundation/NSDictionary.h>
#import <Foundation/NSURL.h>
#import <Foundation/NSURLRequest.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameLoaderTypes.h>
+#import <wtf/Assertions.h>
#import <objc/objc-runtime.h>
using namespace WebCore;
@@ -95,9 +92,9 @@ using namespace WebCore;
- (BOOL)_isForbiddenFileLoad
{
- WebFrameBridge *bridge = [_controller bridge];
- ASSERT(bridge);
- if (![bridge _frame]->loader()->canLoad([_request URL], [bridge _frame]->document())) {
+ Frame* coreFrame = core([_controller webFrame]);
+ ASSERT(coreFrame);
+ if (!coreFrame->loader()->canLoad([_request URL], String(), coreFrame->document())) {
[self _continueWithPolicy:PolicyIgnore];
return YES;
}
diff --git a/WebKit/mac/Plugins/WebPluginController.h b/WebKit/mac/Plugins/WebPluginController.h
index 4f25326..58217c3 100644
--- a/WebKit/mac/Plugins/WebPluginController.h
+++ b/WebKit/mac/Plugins/WebPluginController.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,12 +26,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Foundation/Foundation.h>
#import <WebKit/WebBasePluginPackage.h>
+@class WebFrame;
@class WebHTMLView;
@class WebPluginPackage;
-@class WebFrameBridge;
@class WebView;
@class WebDataSource;
@@ -58,7 +57,7 @@
- (void)stopAllPlugins;
- (void)destroyAllPlugins;
-- (WebFrameBridge *)bridge;
+- (WebFrame *)webFrame;
- (WebView *)webView;
- (NSString *)URLPolicyCheckReferrer;
diff --git a/WebKit/mac/Plugins/WebPluginController.mm b/WebKit/mac/Plugins/WebPluginController.mm
index 9e9ec19..d892d4a 100644
--- a/WebKit/mac/Plugins/WebPluginController.mm
+++ b/WebKit/mac/Plugins/WebPluginController.mm
@@ -30,14 +30,14 @@
#import <WebKit/WebPluginController.h>
#import <Foundation/NSURLRequest.h>
+#import <runtime/JSLock.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/ResourceRequest.h>
#import <WebCore/PlatformString.h>
-#import <WebCore/WebCoreFrameBridge.h>
#import <WebCore/DocumentLoader.h>
+#import <WebCore/ScriptController.h>
#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebFrameBridge.h>
#import <WebKit/WebFrameInternal.h>
#import <WebKit/WebFrameView.h>
#import <WebKit/WebHTMLViewPrivate.h>
@@ -84,10 +84,10 @@ static NSMutableSet *pluginViews = nil;
NSView *view = nil;
if ([viewFactory respondsToSelector:@selector(plugInViewWithArguments:)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
view = [viewFactory plugInViewWithArguments:arguments];
} else if ([viewFactory respondsToSelector:@selector(pluginViewWithArguments:)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
view = [viewFactory pluginViewWithArguments:arguments];
}
@@ -141,10 +141,10 @@ static NSMutableSet *pluginViews = nil;
for (i = 0; i < count; i++) {
id aView = [_views objectAtIndex:i];
if ([aView respondsToSelector:@selector(webPlugInStart)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[aView webPlugInStart];
} else if ([aView respondsToSelector:@selector(pluginStart)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[aView pluginStart];
}
}
@@ -164,10 +164,10 @@ static NSMutableSet *pluginViews = nil;
for (i = 0; i < count; i++) {
id aView = [_views objectAtIndex:i];
if ([aView respondsToSelector:@selector(webPlugInStop)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[aView webPlugInStop];
} else if ([aView respondsToSelector:@selector(pluginStop)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[aView pluginStop];
}
}
@@ -183,28 +183,29 @@ static NSMutableSet *pluginViews = nil;
if (![_views containsObject:view]) {
[_views addObject:view];
-
+ [[_documentView _webView] addPluginInstanceView:view];
+
LOG(Plugins, "initializing plug-in %@", view);
if ([view respondsToSelector:@selector(webPlugInInitialize)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view webPlugInInitialize];
} else if ([view respondsToSelector:@selector(pluginInitialize)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view pluginInitialize];
}
if (_started) {
LOG(Plugins, "starting plug-in %@", view);
if ([view respondsToSelector:@selector(webPlugInStart)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view webPlugInStart];
} else if ([view respondsToSelector:@selector(pluginStart)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view pluginStart];
}
if ([view respondsToSelector:@selector(setContainingWindow:)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view setContainingWindow:[_documentView window]];
}
}
@@ -216,26 +217,27 @@ static NSMutableSet *pluginViews = nil;
if ([_views containsObject:view]) {
if (_started) {
if ([view respondsToSelector:@selector(webPlugInStop)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view webPlugInStop];
} else if ([view respondsToSelector:@selector(pluginStop)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view pluginStop];
}
}
if ([view respondsToSelector:@selector(webPlugInDestroy)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view webPlugInDestroy];
} else if ([view respondsToSelector:@selector(pluginDestroy)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[view pluginDestroy];
}
if (Frame* frame = core([self webFrame]))
- frame->cleanupScriptObjectsForPlugin(self);
+ frame->script()->cleanupScriptObjectsForPlugin(self);
[pluginViews removeObject:view];
+ [[_documentView _webView] removePluginInstanceView:view];
[_views removeObject:view];
}
}
@@ -274,17 +276,18 @@ static void cancelOutstandingCheck(const void *item, void *context)
for (i = 0; i < count; i++) {
id aView = [_views objectAtIndex:i];
if ([aView respondsToSelector:@selector(webPlugInDestroy)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[aView webPlugInDestroy];
} else if ([aView respondsToSelector:@selector(pluginDestroy)]) {
- KJS::JSLock::DropAllLocks dropAllLocks;
+ JSC::JSLock::DropAllLocks dropAllLocks(false);
[aView pluginDestroy];
}
if (Frame* frame = core([self webFrame]))
- frame->cleanupScriptObjectsForPlugin(self);
+ frame->script()->cleanupScriptObjectsForPlugin(self);
[pluginViews removeObject:aView];
+ [[_documentView _webView] removePluginInstanceView:aView];
}
[_views makeObjectsPerformSelector:@selector(removeFromSuperviewWithoutNeedingDisplay)];
[_views release];
@@ -326,13 +329,13 @@ static void cancelOutstandingCheck(const void *item, void *context)
LOG_ERROR("JavaScript requests can only be made on the frame that contains the plug-in");
return;
}
- [[frame _bridge] stringByEvaluatingJavaScriptFromString:JSString];
+ [frame _stringByEvaluatingJavaScriptFromString:JSString];
} else {
if (!request) {
LOG_ERROR("could not load URL %@", [request URL]);
return;
}
- [frame _frameLoader]->load(request, target);
+ core(frame)->loader()->load(request, target);
}
}
@@ -365,7 +368,7 @@ static void cancelOutstandingCheck(const void *item, void *context)
{
bool primary = true;
if (Frame* frame = core([self webFrame]))
- primary = frame->selectionController()->isFocusedAndActive();
+ primary = frame->selection()->isFocusedAndActive();
return primary ? [NSColor selectedTextBackgroundColor] : [NSColor secondarySelectedControlColor];
}
@@ -380,11 +383,6 @@ static void cancelOutstandingCheck(const void *item, void *context)
return [_dataSource webFrame];
}
-- (WebFrameBridge *)bridge
-{
- return [[self webFrame] _bridge];
-}
-
- (WebView *)webView
{
return [[self webFrame] webView];
diff --git a/WebKit/mac/Plugins/WebPluginDatabase.h b/WebKit/mac/Plugins/WebPluginDatabase.h
index edc6a46..350f0a7 100644
--- a/WebKit/mac/Plugins/WebPluginDatabase.h
+++ b/WebKit/mac/Plugins/WebPluginDatabase.h
@@ -29,12 +29,16 @@
#import <Foundation/Foundation.h>
@class WebBasePluginPackage;
+@class WebFrame;
@interface WebPluginDatabase : NSObject
{
NSMutableDictionary *plugins;
NSMutableSet *registeredMIMETypes;
NSArray *plugInPaths;
+
+ // Set of views with plugins attached
+ NSMutableSet *pluginInstanceViews;
}
+ (WebPluginDatabase *)sharedDatabase;
@@ -54,6 +58,10 @@
- (void)close;
+- (void)addPluginInstanceView:(NSView *)view;
+- (void)removePluginInstanceView:(NSView *)view;
+- (void)removePluginInstanceViewsFor:(WebFrame *)webFrame;
+- (void)destroyAllPluginInstanceViews;
@end
@interface NSObject (WebPlugInDatabase)
diff --git a/WebKit/mac/Plugins/WebPluginDatabase.m b/WebKit/mac/Plugins/WebPluginDatabase.mm
index e799443..531214e 100644
--- a/WebKit/mac/Plugins/WebPluginDatabase.m
+++ b/WebKit/mac/Plugins/WebPluginDatabase.mm
@@ -26,20 +26,24 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebPluginDatabase.h>
-
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebBasePluginPackage.h>
-#import <WebKit/WebDataSourcePrivate.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFrameViewInternal.h>
-#import <WebKit/WebHTMLRepresentation.h>
-#import <WebKit/WebHTMLView.h>
-#import <WebKit/WebKitLogging.h>
-#import <WebKit/WebNetscapePluginPackage.h>
-#import <WebKit/WebPluginPackage.h>
-#import <WebKit/WebViewPrivate.h>
+#import "WebPluginDatabase.h"
+
+#import "WebBasePluginPackage.h"
+#import "WebDataSourcePrivate.h"
+#import "WebFrame.h"
+#import "WebFrameViewInternal.h"
+#import "WebHTMLRepresentation.h"
+#import "WebHTMLView.h"
+#import "WebKitLogging.h"
+#import "WebNetscapePluginPackage.h"
+#import "WebNSFileManagerExtras.h"
+#import "WebPluginController.h"
+#import "WebBaseNetscapePluginView.h"
+#import "WebPluginPackage.h"
+#import "WebViewPrivate.h"
+#import "WebHTMLView.h"
#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin);
@@ -86,10 +90,10 @@ static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPa
{
WebBasePluginPackage *plugin = nil;
WebBasePluginPackage *webPlugin = nil;
-#ifndef __LP64__
+#ifdef SUPPORT_CFM
WebBasePluginPackage *CFMPlugin = nil;
- WebBasePluginPackage *machoPlugin = nil;
#endif
+ WebBasePluginPackage *machoPlugin = nil;
NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
key = [key lowercaseString];
@@ -98,12 +102,15 @@ static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPa
if ([[[plugin performSelector:enumeratorSelector] allObjects] containsObject:key]) {
if ([plugin isKindOfClass:[WebPluginPackage class]])
checkCandidate(&webPlugin, &plugin);
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API)
else if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) {
WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType];
+#ifdef SUPPORT_CFM
if (executableType == WebCFMExecutableType) {
checkCandidate(&CFMPlugin, &plugin);
- } else if (executableType == WebMachOExecutableType) {
+ } else
+#endif // SUPPORT_CFM
+ if (executableType == WebMachOExecutableType) {
checkCandidate(&machoPlugin, &plugin);
} else {
ASSERT_NOT_REACHED();
@@ -120,17 +127,17 @@ static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPa
if (webPlugin && ![webPlugin isQuickTimePlugIn])
return webPlugin;
-#ifndef __LP64__
else if (machoPlugin && ![machoPlugin isQuickTimePlugIn])
return machoPlugin;
+#ifdef SUPPORT_CFM
else if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn])
return CFMPlugin;
-#endif
+#endif // SUPPORT_CFM
else if (webPlugin)
return webPlugin;
-#ifndef __LP64__
else if (machoPlugin)
return machoPlugin;
+#ifdef SUPPORT_CFM
else if (CFMPlugin)
return CFMPlugin;
#endif
@@ -205,6 +212,7 @@ static NSArray *additionalWebPlugInPaths;
return nil;
registeredMIMETypes = [[NSMutableSet alloc] init];
+ pluginInstanceViews = [[NSMutableSet alloc] init];
return self;
}
@@ -214,6 +222,7 @@ static NSArray *additionalWebPlugInPaths;
[plugInPaths release];
[plugins release];
[registeredMIMETypes release];
+ [pluginInstanceViews release];
[super dealloc];
}
@@ -299,6 +308,55 @@ static NSArray *additionalWebPlugInPaths;
return [registeredMIMETypes containsObject:MIMEType];
}
+- (void)addPluginInstanceView:(NSView *)view
+{
+ [pluginInstanceViews addObject:view];
+}
+
+- (void)removePluginInstanceView:(NSView *)view
+{
+ [pluginInstanceViews removeObject:view];
+}
+
+- (void)removePluginInstanceViewsFor:(WebFrame*)webFrame
+{
+ // This handles handles the case where a frame or view is being destroyed and the plugin needs to be removed from the list first
+
+ if( [pluginInstanceViews count] == 0 )
+ return;
+
+ NSView <WebDocumentView> *documentView = [[webFrame frameView] documentView];
+ if ([documentView isKindOfClass:[WebHTMLView class]]) {
+ NSArray *subviews = [documentView subviews];
+ unsigned int subviewCount = [subviews count];
+ unsigned int subviewIndex;
+
+ for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) {
+ NSView *subview = [subviews objectAtIndex:subviewIndex];
+ if ([subview isKindOfClass:[WebBaseNetscapePluginView class]] || [WebPluginController isPlugInView:subview])
+ [pluginInstanceViews removeObject:subview];
+ }
+ }
+}
+
+- (void)destroyAllPluginInstanceViews
+{
+ NSView *view;
+ NSArray *pli = [pluginInstanceViews allObjects];
+ NSEnumerator *enumerator = [pli objectEnumerator];
+ while ((view = [enumerator nextObject]) != nil) {
+ if ([view isKindOfClass:[WebBaseNetscapePluginView class]]) {
+ ASSERT([view respondsToSelector:@selector(stop)]);
+ [view performSelector:@selector(stop)];
+ } else if ([WebPluginController isPlugInView:view]) {
+ ASSERT([[view superview] isKindOfClass:[WebHTMLView class]]);
+ ASSERT([[view superview] respondsToSelector:@selector(_destroyAllWebPlugins)]);
+ // this will actually destroy all plugin instances for a webHTMLView and remove them from this list
+ [[view superview] performSelector:@selector(_destroyAllWebPlugins)];
+ }
+ }
+}
+
@end
@implementation WebPluginDatabase (Internal)
@@ -373,7 +431,7 @@ static NSArray *additionalWebPlugInPaths;
NSString *pluginDirectory;
while ((pluginDirectory = [directoryEnumerator nextObject]) != nil) {
// Get contents of each plug-in directory
- NSEnumerator *filenameEnumerator = [[fileManager directoryContentsAtPath:pluginDirectory] objectEnumerator];
+ NSEnumerator *filenameEnumerator = [[fileManager contentsOfDirectoryAtPath:pluginDirectory error:NULL] objectEnumerator];
NSString *filename;
while ((filename = [filenameEnumerator nextObject]) != nil) {
// Unique plug-ins by filename
diff --git a/WebKit/mac/Plugins/WebPluginPrivate.h b/WebKit/mac/Plugins/WebPluginPrivate.h
index e79efc2..56e4a3a 100644
--- a/WebKit/mac/Plugins/WebPluginPrivate.h
+++ b/WebKit/mac/Plugins/WebPluginPrivate.h
@@ -26,50 +26,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- Private extensions to the WebPlugin interface. A plugin may implement these methods
- to receive loading callbacks for its main resource. Plug-ins that implement this SPI
- show better loading progress in the browser, can be saved to disk, and are
- more efficient by avoiding making duplicate GET or POST requests for the plug-in's main
- resource.
-*/
-
@interface NSObject (WebPlugInPrivate)
-/*!
- @method webPlugInMainResourceDidReceiveResponse:
- @abstract Called on the plug-in when WebKit receives -connection:didReceiveResponse:
- for the plug-in's main resource.
- @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;
-
-/*!
- @method webPlugInMainResourceDidReceiveData:
- @abstract Called on the plug-in when WebKit recieves -connection:didReceiveData:
- for the plug-in's main resource.
- @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;
-
-/*!
- @method webPlugInMainResourceDidFailWithError:
- @abstract Called on the plug-in when WebKit receives -connection:didFailWithError:
- for the plug-in's main resource.
- @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;
-
-/*!
- @method webPlugInMainResourceDidFinishLoading
- @abstract Called on the plug-in when WebKit receives -connectionDidFinishLoading:
- for the plug-in's main resource.
- @discussion This method is only sent to the plug-in if the
- WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
-*/
-- (void)webPlugInMainResourceDidFinishLoading;
-
@end
diff --git a/WebKit/mac/Plugins/WebPluginViewFactory.h b/WebKit/mac/Plugins/WebPluginViewFactory.h
index 565168c..583a73d 100644
--- a/WebKit/mac/Plugins/WebPluginViewFactory.h
+++ b/WebKit/mac/Plugins/WebPluginViewFactory.h
@@ -27,6 +27,7 @@
*/
#import <Cocoa/Cocoa.h>
+#import <JavaScriptCore/WebKitAvailability.h>
/*!
@constant WebPlugInBaseURLKey REQUIRED. The base URL of the document containing
@@ -59,6 +60,15 @@ extern NSString *WebPlugInContainerKey;
extern NSString *WebPlugInContainingElementKey;
/*!
+ @constant WebPlugInShouldLoadMainResourceKey REQUIRED. NSNumber (BOOL) indicating whether the plug-in should load its
+ own main resource (the "src" URL, in most cases). If YES, the plug-in should load its own main resource. If NO, the
+ plug-in should use the data provided by WebKit. See -webPlugInMainResourceReceivedData: in WebPluginPrivate.h.
+ 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;
+
+/*!
@protocol WebPlugInViewFactory
@discussion WebPlugInViewFactory are used to create the NSView for a plug-in.
The principal class of the plug-in bundle must implement this protocol.
diff --git a/WebKit/mac/Plugins/WebPluginViewFactoryPrivate.h b/WebKit/mac/Plugins/WebPluginViewFactoryPrivate.h
index b7b7302..51d4283 100644
--- a/WebKit/mac/Plugins/WebPluginViewFactoryPrivate.h
+++ b/WebKit/mac/Plugins/WebPluginViewFactoryPrivate.h
@@ -37,12 +37,3 @@ typedef enum {
@constant WebPlugInModeKey REQUIRED. Number with one of the values from the WebPlugInMode enum.
*/
extern NSString *WebPlugInModeKey;
-
-/*!
- @constant WebPlugInShouldLoadMainResourceKey REQUIRED. NSNumber (BOOL) indicating whether the plug-in should load its
- own main resource (the "src" URL, in most cases). If YES, the plug-in should load its own main resource. If NO, the
- plug-in should use the data provided by WebKit. See -webPlugInMainResourceReceivedData: in WebPluginPrivate.h.
- 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;
diff --git a/WebKit/mac/Plugins/npapi.m b/WebKit/mac/Plugins/npapi.mm
index 0a630a6..f85ec9f 100644
--- a/WebKit/mac/Plugins/npapi.m
+++ b/WebKit/mac/Plugins/npapi.mm
@@ -25,11 +25,16 @@
* (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 __LP64__
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
#import <WebKit/npapi.h>
+#import <WebKit/nptextinput.h>
+
+#import "WebBaseNetscapePluginView.h"
+#import "WebKitLogging.h"
+#import <WebCore/PluginMainThreadScheduler.h>
-#import <WebKit/WebBaseNetscapePluginViewPrivate.h>
-#import <WebKit/WebKitLogging.h>
+using namespace WebCore;
WebBaseNetscapePluginView *pluginViewForInstance(NPP instance);
@@ -159,13 +164,46 @@ void* NPN_GetJavaPeer(NPP instance)
return NULL;
}
-void
-NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
+void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
+{
+}
+
+void NPN_PopPopupsEnabledState(NPP instance)
+{
+}
+
+void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData)
+{
+ PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData);
+}
+
+uint32 NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID))
{
+ return [pluginViewForInstance(instance) scheduleTimerWithInterval:interval repeat:repeat timerFunc:timerFunc];
}
-void
-NPN_PopPopupsEnabledState(NPP instance)
+void NPN_UnscheduleTimer(NPP instance, uint32 timerID)
{
+ [pluginViewForInstance(instance) unscheduleTimer:timerID];
}
+
+NPError NPN_PopUpContextMenu(NPP instance, NPMenu *menu)
+{
+ return [pluginViewForInstance(instance) popUpContextMenu:menu];
+}
+
+void NPN_MarkedTextAbandoned(NPP instance)
+{
+ WebBaseNetscapePluginView *pluginView = pluginViewForInstance(instance);
+
+ [[NSInputManager currentInputManager] markedTextAbandoned:pluginView];
+}
+
+void NPN_MarkedTextSelectionChanged(NPP instance, NSRange newSel)
+{
+ WebBaseNetscapePluginView *pluginView = pluginViewForInstance(instance);
+
+ [[NSInputManager currentInputManager] markedTextSelectionChanged:newSel client:pluginView];
+}
+
#endif
diff --git a/WebKit/mac/Plugins/npfunctions.h b/WebKit/mac/Plugins/npfunctions.h
deleted file mode 100644
index 60d6cad..0000000
--- a/WebKit/mac/Plugins/npfunctions.h
+++ /dev/null
@@ -1,161 +0,0 @@
-#ifndef NPFUNCTIONS_H
-#define NPFUNCTIONS_H
-
-#include <WebKit/npruntime.h>
-#include <WebKit/npapi.h>
-
-#if defined(XP_MACOSX) && defined(__LP64__)
-#error 64-bit Netscape plug-ins are not supported on Mac OS X
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, void* notifyData);
-typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
-typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
-typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
-typedef int32 (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32 len, void* buffer);
-typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
-typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message);
-typedef const char*(*NPN_UserAgentProcPtr)(NPP instance);
-typedef void* (*NPN_MemAllocProcPtr)(uint32 size);
-typedef void (*NPN_MemFreeProcPtr)(void* ptr);
-typedef uint32 (*NPN_MemFlushProcPtr)(uint32 size);
-typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
-typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
-typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
-typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
-typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region);
-typedef void (*NPN_ForceRedrawProcPtr)(NPP instance);
-typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* URL, const char* window);
-typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file);
-typedef void* (*NPN_GetJavaEnvProcPtr)(void);
-typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance);
-typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP instance, NPBool enabled);
-typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP instance);
-
-
-typedef void (*NPN_ReleaseVariantValueProcPtr) (NPVariant *variant);
-
-typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr) (const NPUTF8 *name);
-typedef void (*NPN_GetStringIdentifiersProcPtr) (const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers);
-typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr) (int32_t intid);
-typedef int32_t (*NPN_IntFromIdentifierProcPtr) (NPIdentifier identifier);
-typedef bool (*NPN_IdentifierIsStringProcPtr) (NPIdentifier identifier);
-typedef NPUTF8 *(*NPN_UTF8FromIdentifierProcPtr) (NPIdentifier identifier);
-
-typedef NPObject* (*NPN_CreateObjectProcPtr) (NPP, NPClass *aClass);
-typedef NPObject* (*NPN_RetainObjectProcPtr) (NPObject *obj);
-typedef void (*NPN_ReleaseObjectProcPtr) (NPObject *obj);
-typedef bool (*NPN_InvokeProcPtr) (NPP npp, NPObject *obj, NPIdentifier methodName, const NPVariant *args, unsigned argCount, NPVariant *result);
-typedef bool (*NPN_InvokeDefaultProcPtr) (NPP npp, NPObject *obj, const NPVariant *args, unsigned argCount, NPVariant *result);
-typedef bool (*NPN_EvaluateProcPtr) (NPP npp, NPObject *obj, NPString *script, NPVariant *result);
-typedef bool (*NPN_GetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
-typedef bool (*NPN_SetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
-typedef bool (*NPN_HasPropertyProcPtr) (NPP, NPObject *npobj, NPIdentifier propertyName);
-typedef bool (*NPN_HasMethodProcPtr) (NPP npp, NPObject *npobj, NPIdentifier methodName);
-typedef bool (*NPN_RemovePropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName);
-typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, const NPUTF8 *message);
-typedef bool (*NPN_EnumerateProcPtr) (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count);
-
-typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
-typedef NPError (*NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
-typedef NPError (*NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
-typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
-typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
-typedef void (*NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
-typedef int32 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
-typedef int32 (*NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
-typedef void (*NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint);
-typedef int16 (*NPP_HandleEventProcPtr)(NPP instance, void* event);
-typedef void (*NPP_URLNotifyProcPtr)(NPP instance, const char* URL, NPReason reason, void* notifyData);
-typedef NPError (*NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
-typedef NPError (*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
-typedef void (*NPP_ShutdownProcPtr)(void);
-
-typedef void *(*NPP_GetJavaClassProcPtr)(void);
-typedef void* JRIGlobalRef; //not using this right now
-
-typedef struct _NPNetscapeFuncs {
- uint16 size;
- uint16 version;
-
- NPN_GetURLProcPtr geturl;
- NPN_PostURLProcPtr posturl;
- NPN_RequestReadProcPtr requestread;
- NPN_NewStreamProcPtr newstream;
- NPN_WriteProcPtr write;
- NPN_DestroyStreamProcPtr destroystream;
- NPN_StatusProcPtr status;
- NPN_UserAgentProcPtr uagent;
- NPN_MemAllocProcPtr memalloc;
- NPN_MemFreeProcPtr memfree;
- NPN_MemFlushProcPtr memflush;
- NPN_ReloadPluginsProcPtr reloadplugins;
- NPN_GetJavaEnvProcPtr getJavaEnv;
- NPN_GetJavaPeerProcPtr getJavaPeer;
- NPN_GetURLNotifyProcPtr geturlnotify;
- NPN_PostURLNotifyProcPtr posturlnotify;
- NPN_GetValueProcPtr getvalue;
- NPN_SetValueProcPtr setvalue;
- NPN_InvalidateRectProcPtr invalidaterect;
- NPN_InvalidateRegionProcPtr invalidateregion;
- NPN_ForceRedrawProcPtr forceredraw;
-
- NPN_GetStringIdentifierProcPtr getstringidentifier;
- NPN_GetStringIdentifiersProcPtr getstringidentifiers;
- NPN_GetIntIdentifierProcPtr getintidentifier;
- NPN_IdentifierIsStringProcPtr identifierisstring;
- NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
- NPN_IntFromIdentifierProcPtr intfromidentifier;
- NPN_CreateObjectProcPtr createobject;
- NPN_RetainObjectProcPtr retainobject;
- NPN_ReleaseObjectProcPtr releaseobject;
- NPN_InvokeProcPtr invoke;
- NPN_InvokeDefaultProcPtr invokeDefault;
- NPN_EvaluateProcPtr evaluate;
- NPN_GetPropertyProcPtr getproperty;
- NPN_SetPropertyProcPtr setproperty;
- NPN_RemovePropertyProcPtr removeproperty;
- NPN_HasPropertyProcPtr hasproperty;
- NPN_HasMethodProcPtr hasmethod;
- NPN_ReleaseVariantValueProcPtr releasevariantvalue;
- NPN_SetExceptionProcPtr setexception;
- NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
- NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
- NPN_EnumerateProcPtr enumerate;
-} NPNetscapeFuncs;
-
-typedef struct _NPPluginFuncs {
- uint16 size;
- uint16 version;
- NPP_NewProcPtr newp;
- NPP_DestroyProcPtr destroy;
- NPP_SetWindowProcPtr setwindow;
- NPP_NewStreamProcPtr newstream;
- NPP_DestroyStreamProcPtr destroystream;
- NPP_StreamAsFileProcPtr asfile;
- NPP_WriteReadyProcPtr writeready;
- NPP_WriteProcPtr write;
- NPP_PrintProcPtr print;
- NPP_HandleEventProcPtr event;
- NPP_URLNotifyProcPtr urlnotify;
- JRIGlobalRef javaClass;
- NPP_GetValueProcPtr getvalue;
- NPP_SetValueProcPtr setvalue;
-} NPPluginFuncs;
-
-#if defined(XP_MACOSX)
-typedef NPError (*NP_InitializeFuncPtr)(NPNetscapeFuncs*);
-typedef NPError (*NP_GetEntryPointsFuncPtr)(NPPluginFuncs*);
-typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
-typedef NPError (*MainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/WebKit/mac/Plugins/nptextinput.h b/WebKit/mac/Plugins/nptextinput.h
new file mode 100644
index 0000000..2ed3146
--- /dev/null
+++ b/WebKit/mac/Plugins/nptextinput.h
@@ -0,0 +1,108 @@
+/*
+ * 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/Storage/WebDatabaseManager.mm b/WebKit/mac/Storage/WebDatabaseManager.mm
index c975007..fa9eea6 100644
--- a/WebKit/mac/Storage/WebDatabaseManager.mm
+++ b/WebKit/mac/Storage/WebDatabaseManager.mm
@@ -30,7 +30,6 @@
#import "WebDatabaseManagerInternal.h"
#import "WebDatabaseTrackerClient.h"
-#import "WebSecurityOriginPrivate.h"
#import "WebSecurityOriginInternal.h"
#import <WebCore/DatabaseTracker.h>
diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm
index 7a2c809..48530d6 100644
--- a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm
+++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm
@@ -29,7 +29,6 @@
#import "WebDatabaseTrackerClient.h"
#import "WebDatabaseManagerPrivate.h"
-#import "WebSecurityOriginPrivate.h"
#import "WebSecurityOriginInternal.h"
#import <wtf/RetainPtr.h>
#import <WebCore/SecurityOrigin.h>
diff --git a/WebKit/mac/Storage/WebSecurityOrigin.mm b/WebKit/mac/Storage/WebSecurityOrigin.mm
index c980744..85313d0 100644
--- a/WebKit/mac/Storage/WebSecurityOrigin.mm
+++ b/WebKit/mac/Storage/WebSecurityOrigin.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * 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
@@ -25,29 +25,23 @@
* (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 "WebSecurityOriginPrivate.h"
#import "WebSecurityOriginInternal.h"
#import <WebCore/DatabaseTracker.h>
+#import <WebCore/KURL.h>
#import <WebCore/SecurityOrigin.h>
using namespace WebCore;
@implementation WebSecurityOrigin
-
-- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain
-{
- return [self initWithProtocol:protocol domain:domain port:0];
-}
-
-- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain port:(unsigned short)port
+- (id)initWithURL:(NSURL *)url
{
self = [super init];
if (!self)
return nil;
-
- RefPtr<SecurityOrigin> origin = SecurityOrigin::create(protocol, domain, port, 0);
+
+ RefPtr<SecurityOrigin> origin = SecurityOrigin::create(KURL([url absoluteURL]));
origin->ref();
_private = reinterpret_cast<WebSecurityOriginPrivate*>(origin.get());
@@ -59,11 +53,17 @@ using namespace WebCore;
return reinterpret_cast<SecurityOrigin*>(_private)->protocol();
}
-- (NSString*)domain
+- (NSString*)host
{
return reinterpret_cast<SecurityOrigin*>(_private)->host();
}
+// Deprecated. Use host instead. This needs to stay here until we ship a new Safari.
+- (NSString*)domain
+{
+ return [self host];
+}
+
- (unsigned short)port
{
return reinterpret_cast<SecurityOrigin*>(_private)->port();
diff --git a/WebKit/mac/Storage/WebSecurityOriginInternal.h b/WebKit/mac/Storage/WebSecurityOriginInternal.h
index d60f52b..7bd6817 100644
--- a/WebKit/mac/Storage/WebSecurityOriginInternal.h
+++ b/WebKit/mac/Storage/WebSecurityOriginInternal.h
@@ -26,6 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "WebSecurityOriginPrivate.h"
+
namespace WebCore {
class SecurityOrigin;
}
diff --git a/WebKit/mac/Storage/WebSecurityOriginPrivate.h b/WebKit/mac/Storage/WebSecurityOriginPrivate.h
index 1e66f42..0796c6e 100644
--- a/WebKit/mac/Storage/WebSecurityOriginPrivate.h
+++ b/WebKit/mac/Storage/WebSecurityOriginPrivate.h
@@ -32,11 +32,10 @@
WebSecurityOriginPrivate *_private;
}
-- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain;
-- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain port:(unsigned short)port;
+- (id)initWithURL:(NSURL *)url;
- (NSString*)protocol;
-- (NSString*)domain;
+- (NSString*)host;
// Returns zero if the port is the default port for the protocol, non-zero otherwise
- (unsigned short)port;
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 603ef96..f6a6efb 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Trolltech ASA
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -73,7 +73,7 @@ public:
virtual void setResizable(bool);
- virtual void addMessageToConsole(const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceID);
+ virtual void addMessageToConsole(const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceURL);
virtual bool canRunBeforeUnloadConfirmPanel();
virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame);
@@ -88,10 +88,13 @@ public:
virtual bool tabsToLinks() const;
virtual WebCore::IntRect windowResizerRect() const;
- virtual void addToDirtyRegion(const WebCore::IntRect&);
- virtual void scrollBackingStore(int dx, int dy, const WebCore::IntRect& scrollViewRect, const WebCore::IntRect& clipRect);
- virtual void updateBackingStore();
-
+
+ virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+ virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
+ virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
+ virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
+ virtual PlatformWidget platformWindow() const;
+
virtual void setStatusbarText(const WebCore::String&);
virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
@@ -102,6 +105,33 @@ public:
virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String& databaseName);
+ virtual void populateVisitedLinks();
+
+#if ENABLE(DASHBOARD_SUPPORT)
+ virtual void dashboardRegionsChanged();
+#endif
+
+ virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
+
+ virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WebCore::AtomicString& type,
+ const WebCore::FloatRect& lineRect);
+ virtual void paintCustomHighlight(WebCore::Node*, const WebCore::AtomicString& type,
+ const WebCore::FloatRect& boxRect, const WebCore::FloatRect& lineRect,
+ bool behindText, bool entireLine);
+
+ virtual WebCore::KeyboardUIMode keyboardUIMode();
+
+ virtual NSResponder *firstResponder();
+ virtual void makeFirstResponder(NSResponder *);
+
+ virtual void willPopUpMenu(NSMenu *);
+
+ virtual bool shouldReplaceWithGeneratedFileForUpload(const WebCore::String& path, WebCore::String &generatedFilename);
+ virtual WebCore::String generateReplacementFile(const WebCore::String& path);
+
+ virtual void enableSuddenTermination();
+ virtual void disableSuddenTermination();
+
private:
WebView *m_webView;
};
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 48354c1..f864367 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Trolltech ASA
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,37 +29,58 @@
#import "WebChromeClient.h"
+#import <Foundation/Foundation.h>
#import "WebDefaultUIDelegate.h"
#import "WebElementDictionary.h"
#import "WebFrameInternal.h"
#import "WebFrameView.h"
-#import "WebHTMLView.h"
-#import "WebHTMLViewPrivate.h"
+#import "WebHTMLViewInternal.h"
+#import "WebHistoryInternal.h"
+#import "WebKitSystemInterface.h"
+#import "WebKitPrefix.h"
#import "WebNSURLRequestExtras.h"
-#import "WebSecurityOriginPrivate.h"
+#import "WebPlugin.h"
#import "WebSecurityOriginInternal.h"
-#import "WebUIDelegate.h"
#import "WebUIDelegatePrivate.h"
#import "WebView.h"
#import "WebViewInternal.h"
#import <WebCore/BlockExceptions.h>
+#import <WebCore/FileChooser.h>
#import <WebCore/FloatRect.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoadRequest.h>
#import <WebCore/HitTestResult.h>
#import <WebCore/IntRect.h>
+#import <WebCore/Page.h>
#import <WebCore/PlatformScreen.h>
#import <WebCore/PlatformString.h>
#import <WebCore/ResourceRequest.h>
+#import <WebCore/Widget.h>
#import <WebCore/WindowFeatures.h>
#import <wtf/PassRefPtr.h>
+#import <wtf/Vector.h>
-@interface NSView (AppKitSecretsWebBridgeKnowsAbout)
+@interface NSView (WebNSViewDetails)
- (NSView *)_findLastViewInKeyViewLoop;
@end
+// For compatibility with old SPI.
+@interface NSView (WebOldWebKitPlugInDetails)
+- (void)setIsSelected:(BOOL)isSelected;
+@end
+
+@interface NSWindow (AppKitSecretsIKnowAbout)
+- (NSRect)_growBoxRect;
+@end
+
using namespace WebCore;
+@interface WebOpenPanelResultListener : NSObject <WebOpenPanelResultListener> {
+ FileChooser* _chooser;
+}
+- (id)initWithChooser:(PassRefPtr<FileChooser>)chooser;
+@end
+
WebChromeClient::WebChromeClient(WebView *webView)
: m_webView(webView)
{
@@ -380,20 +401,55 @@ bool WebChromeClient::tabsToLinks() const
IntRect WebChromeClient::windowResizerRect() const
{
- return IntRect();
+ NSRect rect = [[m_webView window] _growBoxRect];
+ if ([m_webView _usesDocumentViews])
+ return enclosingIntRect(rect);
+ return enclosingIntRect([m_webView convertRect:rect fromView:nil]);
+}
+
+void WebChromeClient::repaint(const IntRect& rect, bool contentChanged, bool immediate, bool repaintContentOnly)
+{
+ if ([m_webView _usesDocumentViews])
+ return;
+
+ if (contentChanged)
+ [m_webView setNeedsDisplayInRect:rect];
+
+ if (immediate) {
+ [[m_webView window] displayIfNeeded];
+ [[m_webView window] flushWindowIfNeeded];
+ }
+}
+
+void WebChromeClient::scroll(const IntSize&, const IntRect&, const IntRect&)
+{
}
-void WebChromeClient::addToDirtyRegion(const IntRect&)
+IntPoint WebChromeClient::screenToWindow(const IntPoint& p) const
{
+ if ([m_webView _usesDocumentViews])
+ return p;
+ NSPoint windowCoord = [[m_webView window] convertScreenToBase:p];
+ return IntPoint([m_webView convertPoint:windowCoord fromView:nil]);
}
-void WebChromeClient::scrollBackingStore(int, int, const IntRect&, const IntRect&)
+IntRect WebChromeClient::windowToScreen(const IntRect& r) const
{
+ if ([m_webView _usesDocumentViews])
+ return r;
+ NSRect tempRect = r;
+ tempRect = [m_webView convertRect:tempRect toView:nil];
+ tempRect.origin = [[m_webView window] convertBaseToScreen:tempRect.origin];
+ return enclosingIntRect(tempRect);
}
-void WebChromeClient::updateBackingStore()
+PlatformWidget WebChromeClient::platformWindow() const
{
+ if ([m_webView _usesDocumentViews])
+ return 0;
+ return m_webView;
}
+// End host window methods.
void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
{
@@ -415,8 +471,211 @@ void WebChromeClient::print(Frame* frame)
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()];
- CallUIDelegate(m_webView, @selector(webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:), kit(frame), webOrigin, (NSString *)databaseName);
+ // FIXME: remove this workaround once shipping Safari has the necessary delegate implemented.
+ if (WKAppVersionCheckLessThan(@"com.apple.Safari", -1, 3.1)) {
+ const unsigned long long defaultQuota = 5 * 1024 * 1024; // 5 megabytes should hopefully be enough to test storage support.
+ [webOrigin setQuota:defaultQuota];
+ } else
+ CallUIDelegate(m_webView, @selector(webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:), kit(frame), webOrigin, (NSString *)databaseName);
[webOrigin release];
+
+ END_BLOCK_OBJC_EXCEPTIONS;
}
+void WebChromeClient::populateVisitedLinks()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ [[WebHistory optionalSharedHistory] _addVisitedLinksToPageGroup:[m_webView page]->group()];
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+#if ENABLE(DASHBOARD_SUPPORT)
+void WebChromeClient::dashboardRegionsChanged()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ NSMutableDictionary *regions = core([m_webView mainFrame])->dashboardRegionsDictionary();
+ [m_webView _addScrollerDashboardRegions:regions];
+
+ CallUIDelegate(m_webView, @selector(webView:dashboardRegionsChanged:), regions);
+
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+#endif
+
+FloatRect WebChromeClient::customHighlightRect(Node* node, const AtomicString& type, const FloatRect& lineRect)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ NSView *documentView = [[kit(node->document()->frame()) frameView] documentView];
+ if (![documentView isKindOfClass:[WebHTMLView class]])
+ return NSZeroRect;
+
+ WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
+ id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type];
+ if ([(NSObject *)highlighter respondsToSelector:@selector(highlightRectForLine:representedNode:)])
+ return [highlighter highlightRectForLine:lineRect representedNode:kit(node)];
+ return [highlighter highlightRectForLine:lineRect];
+
+ END_BLOCK_OBJC_EXCEPTIONS;
+
+ return NSZeroRect;
+}
+
+void WebChromeClient::paintCustomHighlight(Node* node, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect,
+ bool behindText, bool entireLine)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ NSView *documentView = [[kit(node->document()->frame()) frameView] documentView];
+ if (![documentView isKindOfClass:[WebHTMLView class]])
+ return;
+
+ WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
+ id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type];
+ if ([(NSObject *)highlighter respondsToSelector:@selector(paintHighlightForBox:onLine:behindText:entireLine:representedNode:)])
+ [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:behindText entireLine:entireLine representedNode:kit(node)];
+ else
+ [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:behindText entireLine:entireLine];
+
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void WebChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> chooser)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ BOOL allowMultipleFiles = chooser->allowsMultipleFiles();
+ WebOpenPanelResultListener *listener = [[WebOpenPanelResultListener alloc] initWithChooser:chooser];
+ id delegate = [m_webView UIDelegate];
+ if ([delegate respondsToSelector:@selector(webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:)])
+ CallUIDelegate(m_webView, @selector(webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:), listener, allowMultipleFiles);
+ else
+ CallUIDelegate(m_webView, @selector(webView:runOpenPanelForFileButtonWithResultListener:), listener);
+ [listener release];
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+KeyboardUIMode WebChromeClient::keyboardUIMode()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [m_webView _keyboardUIMode];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return KeyboardAccessDefault;
+}
+
+NSResponder *WebChromeClient::firstResponder()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[m_webView _UIDelegateForwarder] webViewFirstResponder:m_webView];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return nil;
+}
+
+void WebChromeClient::makeFirstResponder(NSResponder *responder)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ [m_webView _pushPerformingProgrammaticFocus];
+ [[m_webView _UIDelegateForwarder] webView:m_webView makeFirstResponder:responder];
+ [m_webView _popPerformingProgrammaticFocus];
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void WebChromeClient::willPopUpMenu(NSMenu *menu)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ CallUIDelegate(m_webView, @selector(webView:willPopupMenu:), menu);
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+bool WebChromeClient::shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename)
+{
+ NSString* filename;
+ if (![[m_webView _UIDelegateForwarder] webView:m_webView shouldReplaceUploadFile:path usingGeneratedFilename:&filename])
+ return false;
+ generatedFilename = filename;
+ return true;
+}
+
+String WebChromeClient::generateReplacementFile(const String& path)
+{
+ return [[m_webView _UIDelegateForwarder] webView:m_webView generateReplacementFile:path];
+}
+
+void WebChromeClient::disableSuddenTermination()
+{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ [[NSProcessInfo processInfo] disableSuddenTermination];
+#endif
+}
+
+void WebChromeClient::enableSuddenTermination()
+{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ [[NSProcessInfo processInfo] enableSuddenTermination];
+#endif
+}
+
+@implementation WebOpenPanelResultListener
+
+- (id)initWithChooser:(PassRefPtr<FileChooser>)chooser
+{
+ self = [super init];
+ if (!self)
+ return nil;
+ _chooser = chooser.releaseRef();
+ return self;
+}
+
+#ifndef NDEBUG
+
+- (void)dealloc
+{
+ ASSERT(!_chooser);
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ ASSERT(!_chooser);
+ [super finalize];
+}
+
+#endif
+
+- (void)cancel
+{
+ ASSERT(_chooser);
+ if (!_chooser)
+ return;
+ _chooser->deref();
+ _chooser = 0;
+}
+
+- (void)chooseFilename:(NSString *)filename
+{
+ ASSERT(_chooser);
+ if (!_chooser)
+ return;
+ _chooser->chooseFile(filename);
+ _chooser->deref();
+ _chooser = 0;
+}
+
+- (void)chooseFilenames:(NSArray *)filenames
+{
+ ASSERT(_chooser);
+ if (!_chooser)
+ return;
+ int count = [filenames count];
+ Vector<String> names(count);
+ for (int i = 0; i < count; i++)
+ names[i] = [filenames objectAtIndex:i];
+ _chooser->chooseFiles(names);
+ _chooser->deref();
+ _chooser = 0;
+}
+
+@end
diff --git a/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm b/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
index 8924348..6b5ad14 100644
--- a/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -295,7 +295,7 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const
void WebContextMenuClient::downloadURL(const KURL& url)
{
- [m_webView _downloadURL:url.getNSURL()];
+ [m_webView _downloadURL:url];
}
void WebContextMenuClient::searchWithSpotlight()
diff --git a/WebKit/mac/WebCoreSupport/WebDragClient.mm b/WebKit/mac/WebCoreSupport/WebDragClient.mm
index 7022ad6..42c3d33 100644
--- a/WebKit/mac/WebCoreSupport/WebDragClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebDragClient.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,6 @@
#import "WebDragClient.h"
#import "WebArchive.h"
-#import "WebArchiver.h"
#import "WebDOMOperations.h"
#import "WebFrame.h"
#import "WebFrameInternal.h"
@@ -121,11 +120,12 @@ DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& titl
{
if (!frame)
return nil;
- WebHTMLView* htmlView = (WebHTMLView*)[[kit(frame) frameView] documentView];
+ WebHTMLView *htmlView = (WebHTMLView *)[[kit(frame) frameView] documentView];
NSString *label = 0;
if (!title.isEmpty())
- label = (NSString*)title;
- return [htmlView _dragImageForURL:[url.getNSURL() _web_userVisibleString] withLabel:label];
+ label = title;
+ NSURL *cocoaURL = url;
+ return [htmlView _dragImageForURL:[cocoaURL _web_userVisibleString] withLabel:label];
}
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h
index ef54d2a..245e575 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
- * Copyright (C) 2007 Trolltech ASA
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -56,7 +56,7 @@ public:
virtual bool shouldBeginEditing(WebCore::Range*);
virtual bool shouldEndEditing(WebCore::Range*);
virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction);
- virtual bool shouldInsertText(WebCore::String, WebCore::Range*, WebCore::EditorInsertAction);
+ virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction);
virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting);
virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*);
@@ -68,7 +68,6 @@ public:
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
- virtual NSData* dataForArchivedSelection(WebCore::Frame*);
virtual NSString* userVisibleString(NSURL*);
#ifdef BUILDING_ON_TIGER
virtual NSArray* pasteboardTypesForSelection(WebCore::Frame*);
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index 62a6675..f2ed480 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
- * Copyright (C) 2007 Trolltech ASA
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -33,7 +33,6 @@
#import "DOMHTMLTextAreaElementInternal.h"
#import "DOMRangeInternal.h"
#import "WebArchive.h"
-#import "WebArchiver.h"
#import "WebDataSourceInternal.h"
#import "WebDocument.h"
#import "WebEditingDelegatePrivate.h"
@@ -50,6 +49,7 @@
#import <WebCore/EditAction.h>
#import <WebCore/EditCommand.h>
#import <WebCore/KeyboardEvent.h>
+#import <WebCore/LegacyWebArchive.h>
#import <WebCore/PlatformKeyboardEvent.h>
#import <WebCore/PlatformString.h>
#import <WebCore/WebCoreObjCExtras.h>
@@ -106,6 +106,9 @@ WebViewInsertAction kit(EditorInsertAction coreAction)
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebEditCommand class], self))
+ return;
+
m_command->deref();
[super dealloc];
}
@@ -245,7 +248,7 @@ bool WebEditorClient::shouldEndEditing(Range* range)
shouldEndEditingInDOMRange:kit(range)];
}
-bool WebEditorClient::shouldInsertText(String text, Range* range, EditorInsertAction action)
+bool WebEditorClient::shouldInsertText(const String& text, Range* range, EditorInsertAction action)
{
WebView* webView = m_webView;
return [[webView _editingDelegateForwarder] webView:webView shouldInsertText:text replacingDOMRange:kit(range) givenAction:kit(action)];
@@ -297,12 +300,6 @@ void WebEditorClient::didSetSelectionTypesForPasteboard()
[[m_webView _editingDelegateForwarder] webView:m_webView didSetSelectionTypesForPasteboard:[NSPasteboard generalPasteboard]];
}
-NSData* WebEditorClient::dataForArchivedSelection(Frame* frame)
-{
- WebArchive *archive = [WebArchiver archiveSelectionInFrame:kit(frame)];
- return [archive data];
-}
-
NSString* WebEditorClient::userVisibleString(NSURL *URL)
{
return [URL _web_userVisibleString];
@@ -471,7 +468,7 @@ void WebEditorClient::textDidChangeInTextField(Element* element)
static SEL selectorForKeyEvent(KeyboardEvent* event)
{
- // FIXME: This helper function is for the auto-fill code so the bridge can pass a selector to the form delegate.
+ // FIXME: This helper function is for the auto-fill code so we can pass a selector to the form delegate.
// Eventually, we should move all of the auto-fill code down to WebKit and remove the need for this function by
// not relying on the selector in the new implementation.
// The key identifiers are from <http://www.w3.org/TR/DOM-Level-3-Events/keyset.html#KeySet-Set>
diff --git a/WebKit/mac/WebCoreSupport/WebFrameBridge.h b/WebKit/mac/WebCoreSupport/WebFrameBridge.h
deleted file mode 100644
index 05d5bc0..0000000
--- a/WebKit/mac/WebCoreSupport/WebFrameBridge.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2005, 2006 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 <WebCore/WebCoreFrameBridge.h>
-
-namespace WebCore {
- class Page;
-}
-
-@class WebFrame;
-@class WebFrameView;
-
-@protocol WebOpenPanelResultListener;
-
-@interface WebFrameBridge : WebCoreFrameBridge <WebCoreFrameBridge>
-{
-@public
- WebFrame *_frame;
-
-@private
- WebCore::KeyboardUIMode _keyboardUIMode;
- BOOL _keyboardUIModeAccessed;
- BOOL _doingClientRedirect;
- BOOL _haveUndoRedoOperations;
-
- NSDictionary *lastDashboardRegions;
-}
-
-- (id)initMainFrameWithPage:(WebCore::Page*)page frameName:(NSString *)name frameView:(WebFrameView *)frameView;
-- (void)close;
-
-- (WebFrame *)webFrame;
-
-// The following methods can all move off the bridge; they're used on the WebKit side only.
-
-- (NSView *)viewForPluginWithFrame:(NSRect)frame
- URL:(NSURL *)URL
- attributeNames:(NSArray *)attributeNames
- attributeValues:(NSArray *)attributeValues
- MIMEType:(NSString *)MIMEType
- DOMElement:(DOMElement *)element
- loadManually:(BOOL)loadManually;
-- (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
- attributeNames:(NSArray *)attributeNames
- attributeValues:(NSArray *)attributeValues
- baseURL:(NSURL *)baseURL
- DOMElement:(DOMElement *)element;
-
-- (WebCore::Frame*)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL referrer:(const WebCore::String&)referrer
- ownerElement:(WebCore::HTMLFrameOwnerElement *)ownerElement allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
-
-- (void)redirectDataToPlugin:(NSView *)pluginView;
-
-- (WebCore::ObjectContentType)determineObjectFromMIMEType:(NSString*)MIMEType URL:(NSURL*)URL;
-
-- (void)windowObjectCleared;
-
-@end
diff --git a/WebKit/mac/WebCoreSupport/WebFrameBridge.mm b/WebKit/mac/WebCoreSupport/WebFrameBridge.mm
deleted file mode 100644
index 9440f2d..0000000
--- a/WebKit/mac/WebCoreSupport/WebFrameBridge.mm
+++ /dev/null
@@ -1,746 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 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 "WebFrameBridge.h"
-
-#import "WebBackForwardList.h"
-#import "WebBaseNetscapePluginView.h"
-#import "WebBasePluginPackage.h"
-#import "WebDataSourceInternal.h"
-#import "WebDefaultUIDelegate.h"
-#import "WebEditingDelegate.h"
-#import "WebFormDelegate.h"
-#import "WebFrameInternal.h"
-#import "WebFrameLoadDelegate.h"
-#import "WebFrameLoaderClient.h"
-#import "WebFrameViewInternal.h"
-#import "WebHTMLRepresentationPrivate.h"
-#import "WebHTMLViewInternal.h"
-#import "WebHistoryItemInternal.h"
-#import "WebHistoryItemPrivate.h"
-#import "WebJavaPlugIn.h"
-#import "WebJavaScriptTextInputPanel.h"
-#import "WebKitErrorsPrivate.h"
-#import "WebKitLogging.h"
-#import "WebKitNSStringExtras.h"
-#import "WebKitPluginContainerView.h"
-#import "WebKitStatisticsPrivate.h"
-#import "WebKitSystemBits.h"
-#import "WebLocalizableStrings.h"
-#import "WebNSObjectExtras.h"
-#import "WebNSURLExtras.h"
-#import "WebNSURLRequestExtras.h"
-#import "WebNSViewExtras.h"
-#import "WebNetscapePluginEmbeddedView.h"
-#import "WebNetscapePluginPackage.h"
-#import "WebNullPluginView.h"
-#import "WebPlugin.h"
-#import "WebPluginController.h"
-#import "WebPluginDatabase.h"
-#import "WebPluginPackage.h"
-#import "WebPluginViewFactoryPrivate.h"
-#import "WebPreferencesPrivate.h"
-#import "WebResourcePrivate.h"
-#import "WebScriptDebugServerPrivate.h"
-#import "WebUIDelegatePrivate.h"
-#import "WebViewInternal.h"
-#import <Foundation/NSURLConnection.h>
-#import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLResponse.h>
-#import <JavaScriptCore/Assertions.h>
-#import <JavaScriptCore/JSLock.h>
-#import <JavaScriptCore/object.h>
-#import <JavaVM/jni.h>
-#import <WebCore/Cache.h>
-#import <WebCore/Document.h>
-#import <WebCore/DocumentLoader.h>
-#import <WebCore/DragController.h>
-#import <WebCore/Element.h>
-#import <WebCore/FoundationExtras.h>
-#import <WebCore/Frame.h>
-#import <WebCore/FrameLoader.h>
-#import <WebCore/FrameLoaderClient.h>
-#import <WebCore/FrameTree.h>
-#import <WebCore/HTMLFrameOwnerElement.h>
-#import <WebCore/Page.h>
-#import <WebCore/ResourceLoader.h>
-#import <WebCore/SubresourceLoader.h>
-#import <WebCore/WebCoreObjCExtras.h>
-#import <WebKitSystemInterface.h>
-#import <wtf/RefPtr.h>
-#import <WebCore/MIMETypeRegistry.h>
-
-// For compatibility with old SPI.
-@interface NSView (OldWebPlugin)
-- (void)setIsSelected:(BOOL)f;
-@end
-
-@interface NSView (JavaPluginSecrets)
-- (jobject)pollForAppletInWindow:(NSWindow *)window;
-@end
-
-using namespace WebCore;
-
-NSString *WebPluginBaseURLKey = @"WebPluginBaseURL";
-NSString *WebPluginAttributesKey = @"WebPluginAttributes";
-NSString *WebPluginContainerKey = @"WebPluginContainer";
-
-#define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange"
-#define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode")
-#define UniversalAccessDomain CFSTR("com.apple.universalaccess")
-
-@implementation WebFrameBridge
-
-#ifndef BUILDING_ON_TIGER
-+ (void)initialize
-{
- WebCoreObjCFinalizeOnMainThread(self);
-}
-#endif
-
-- (WebView *)webView
-{
- if (!m_frame)
- return nil;
-
- return kit(m_frame->page());
-}
-
-- (void)finishInitializingWithPage:(Page*)page frameName:(NSString *)name frameView:(WebFrameView *)frameView ownerElement:(HTMLFrameOwnerElement*)ownerElement
-{
- ++WebBridgeCount;
-
- WebView *webView = kit(page);
-
- _frame = [[WebFrame alloc] _initWithWebFrameView:frameView webView:webView bridge:self];
-
- m_frame = new Frame(page, ownerElement, new WebFrameLoaderClient(_frame));
- m_frame->setBridge(self);
- m_frame->tree()->setName(name);
- m_frame->init();
-
- [self setTextSizeMultiplier:[webView textSizeMultiplier]];
-}
-
-- (id)initMainFrameWithPage:(Page*)page frameName:(NSString *)name frameView:(WebFrameView *)frameView
-{
- self = [super init];
- [self finishInitializingWithPage:page frameName:name frameView:frameView ownerElement:0];
- return self;
-}
-
-- (id)initSubframeWithOwnerElement:(HTMLFrameOwnerElement*)ownerElement frameName:(NSString *)name frameView:(WebFrameView *)frameView
-{
- self = [super init];
- [self finishInitializingWithPage:ownerElement->document()->frame()->page() frameName:name frameView:frameView ownerElement:ownerElement];
- return self;
-}
-
-- (void)fini
-{
- if (_keyboardUIModeAccessed) {
- [[NSDistributedNotificationCenter defaultCenter]
- removeObserver:self name:KeyboardUIModeDidChangeNotification object:nil];
- [[NSNotificationCenter defaultCenter]
- removeObserver:self name:WebPreferencesChangedNotification object:nil];
- }
-
- ASSERT(_frame == nil);
- --WebBridgeCount;
-}
-
-- (void)dealloc
-{
- [lastDashboardRegions release];
- [_frame release];
-
- [self fini];
- [super dealloc];
-}
-
-- (void)finalize
-{
- ASSERT_MAIN_THREAD();
- [self fini];
- [super finalize];
-}
-
-- (WebPreferences *)_preferences
-{
- return [[self webView] preferences];
-}
-
-- (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification
-{
- CFPreferencesAppSynchronize(UniversalAccessDomain);
-
- Boolean keyExistsAndHasValidFormat;
- int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat);
-
- // The keyboard access mode is reported by two bits:
- // Bit 0 is set if feature is on
- // Bit 1 is set if full keyboard access works for any control, not just text boxes and lists
- // We require both bits to be on.
- // I do not know that we would ever get one bit on and the other off since
- // checking the checkbox in system preferences which is marked as "Turn on full keyboard access"
- // turns on both bits.
- _keyboardUIMode = (mode & 0x2) ? KeyboardAccessFull : KeyboardAccessDefault;
-
- // check for tabbing to links
- if ([[self _preferences] tabsToLinks])
- _keyboardUIMode = (KeyboardUIMode)(_keyboardUIMode | KeyboardAccessTabsToLinks);
-}
-
-- (KeyboardUIMode)keyboardUIMode
-{
- if (!_keyboardUIModeAccessed) {
- _keyboardUIModeAccessed = YES;
- [self _retrieveKeyboardUIModeFromPreferences:nil];
-
- [[NSDistributedNotificationCenter defaultCenter]
- addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
- name:KeyboardUIModeDidChangeNotification object:nil];
-
- [[NSNotificationCenter defaultCenter]
- addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
- name:WebPreferencesChangedNotification object:nil];
- }
- return _keyboardUIMode;
-}
-
-- (WebFrame *)webFrame
-{
- return _frame;
-}
-
-- (WebCoreFrameBridge *)mainFrame
-{
- ASSERT(_frame != nil);
- return [[[self webView] mainFrame] _bridge];
-}
-
-- (NSResponder *)firstResponder
-{
- ASSERT(_frame != nil);
- WebView *webView = [self webView];
- return [[webView _UIDelegateForwarder] webViewFirstResponder:webView];
-}
-
-- (void)makeFirstResponder:(NSResponder *)view
-{
- ASSERT(_frame != nil);
- WebView *webView = [self webView];
- ASSERT([view isKindOfClass:[NSView class]]);
- ASSERT([(NSView *)view window]);
- ASSERT([(NSView *)view window] == [webView window]);
- [webView _pushPerformingProgrammaticFocus];
- [[webView _UIDelegateForwarder] webView:webView makeFirstResponder:view];
- [webView _popPerformingProgrammaticFocus];
-}
-
-- (NSWindow *)window
-{
- ASSERT(_frame != nil);
- return [[_frame frameView] window];
-}
-
-- (void)runOpenPanelForFileButtonWithResultListener:(id<WebCoreOpenPanelResultListener>)resultListener
-{
- WebView *wv = [self webView];
- [[wv _UIDelegateForwarder] webView:wv runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener];
-}
-
-- (WebDataSource *)dataSource
-{
- ASSERT(_frame != nil);
- WebDataSource *dataSource = [_frame _dataSource];
-
- ASSERT(dataSource != nil);
-
- return dataSource;
-}
-
-- (void)close
-{
- [super close];
- [_frame release];
- _frame = nil;
-}
-
-- (Frame*)createChildFrameNamed:(NSString *)frameName
- withURL:(NSURL *)URL
- referrer:(const String&)referrer
- ownerElement:(HTMLFrameOwnerElement*)ownerElement
- allowsScrolling:(BOOL)allowsScrolling
- marginWidth:(int)width
- marginHeight:(int)height
-{
- ASSERT(_frame);
-
- WebFrameView *childView = [[WebFrameView alloc] initWithFrame:NSMakeRect(0,0,0,0)];
- [childView setAllowsScrolling:allowsScrolling];
- [childView _setMarginWidth:width];
- [childView _setMarginHeight:height];
-
- WebFrameBridge *newBridge = [[WebFrameBridge alloc] initSubframeWithOwnerElement:ownerElement frameName:frameName frameView:childView];
- [childView release];
-
- if (!newBridge)
- return 0;
-
- [_frame _addChild:[newBridge webFrame]];
- [newBridge release];
-
- RefPtr<Frame> newFrame = [newBridge _frame];
-
- [_frame _loadURL:URL referrer:referrer intoChild:kit(newFrame.get())];
-
- // The frame's onload handler may have removed it from the document.
- if (!newFrame->tree()->parent())
- return 0;
-
- return newFrame.get();
-}
-
-- (NSView *)pluginViewWithPackage:(WebPluginPackage *)pluginPackage
- attributeNames:(NSArray *)attributeNames
- attributeValues:(NSArray *)attributeValues
- baseURL:(NSURL *)baseURL
- DOMElement:(DOMElement *)element
- loadManually:(BOOL)loadManually
-{
- WebHTMLView *docView = (WebHTMLView *)[[_frame frameView] documentView];
- ASSERT([docView isKindOfClass:[WebHTMLView class]]);
-
- WebPluginController *pluginController = [docView _pluginController];
-
- // Store attributes in a dictionary so they can be passed to WebPlugins.
- NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:attributeValues forKeys:attributeNames];
-
- [pluginPackage load];
- Class viewFactory = [pluginPackage viewFactory];
-
- NSView *view = nil;
- NSDictionary *arguments = nil;
-
- if ([viewFactory respondsToSelector:@selector(plugInViewWithArguments:)]) {
- arguments = [NSDictionary dictionaryWithObjectsAndKeys:
- baseURL, WebPlugInBaseURLKey,
- attributes, WebPlugInAttributesKey,
- pluginController, WebPlugInContainerKey,
- [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey,
- [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey,
- element, WebPlugInContainingElementKey,
- nil];
- LOG(Plugins, "arguments:\n%@", arguments);
- } else if ([viewFactory respondsToSelector:@selector(pluginViewWithArguments:)]) {
- arguments = [NSDictionary dictionaryWithObjectsAndKeys:
- baseURL, WebPluginBaseURLKey,
- attributes, WebPluginAttributesKey,
- pluginController, WebPluginContainerKey,
- element, WebPlugInContainingElementKey,
- nil];
- LOG(Plugins, "arguments:\n%@", arguments);
- }
-
- view = [WebPluginController plugInViewWithArguments:arguments fromPluginPackage:pluginPackage];
- [attributes release];
- return view;
-}
-
-- (NSString *)valueForKey:(NSString *)key keys:(NSArray *)keys values:(NSArray *)values
-{
- unsigned count = [keys count];
- unsigned i;
- for (i = 0; i < count; i++)
- if ([[keys objectAtIndex:i] _webkit_isCaseInsensitiveEqualToString:key])
- return [values objectAtIndex:i];
- return nil;
-}
-
-- (NSView *)viewForPluginWithFrame:(NSRect)frame
- URL:(NSURL *)URL
- attributeNames:(NSArray *)attributeNames
- attributeValues:(NSArray *)attributeValues
- MIMEType:(NSString *)MIMEType
- DOMElement:(DOMElement *)element
- loadManually:(BOOL)loadManually
-{
- ASSERT([attributeNames count] == [attributeValues count]);
-
- WebBasePluginPackage *pluginPackage = nil;
- NSView *view = nil;
- int errorCode = 0;
-
- WebView *webView = [self webView];
- SEL selector = @selector(webView:plugInViewWithArguments:);
-
- if ([[webView UIDelegate] respondsToSelector:selector]) {
- NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:attributeValues forKeys:attributeNames];
- NSDictionary *arguments = [[NSDictionary alloc] initWithObjectsAndKeys:
- attributes, WebPlugInAttributesKey,
- [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey,
- [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey,
- element, WebPlugInContainingElementKey,
- URL, WebPlugInBaseURLKey, // URL might be nil, so add it last
- nil];
-
- view = CallUIDelegate(webView, selector, arguments);
-
- [attributes release];
- [arguments release];
-
- if (view)
- return view;
- }
-
- if ([MIMEType length] != 0)
- pluginPackage = [[self webView] _pluginForMIMEType:MIMEType];
- else
- MIMEType = nil;
-
- NSString *extension = [[URL path] pathExtension];
- if (!pluginPackage && [extension length] != 0) {
- pluginPackage = [[self webView] _pluginForExtension:extension];
- if (pluginPackage) {
- NSString *newMIMEType = [pluginPackage MIMETypeForExtension:extension];
- if ([newMIMEType length] != 0)
- MIMEType = newMIMEType;
- }
- }
-
- NSURL *baseURL = [self baseURL];
- if (pluginPackage) {
- if ([pluginPackage isKindOfClass:[WebPluginPackage class]]) {
- view = [self pluginViewWithPackage:(WebPluginPackage *)pluginPackage
- attributeNames:attributeNames
- attributeValues:attributeValues
- baseURL:baseURL
- DOMElement:element
- loadManually:loadManually];
-
- }
-#ifndef __LP64__
- else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
- WebNetscapePluginEmbeddedView *embeddedView = [[[WebNetscapePluginEmbeddedView alloc] initWithFrame:frame
- pluginPackage:(WebNetscapePluginPackage *)pluginPackage
- URL:URL
- baseURL:baseURL
- MIMEType:MIMEType
- attributeKeys:attributeNames
- attributeValues:attributeValues
- loadManually:loadManually
- DOMElement:element] autorelease];
- view = embeddedView;
- }
-#endif
- } else
- errorCode = WebKitErrorCannotFindPlugIn;
-
- if (!errorCode && !view)
- errorCode = WebKitErrorCannotLoadPlugIn;
-
- if (errorCode) {
- NSString *pluginPage = [self valueForKey:@"pluginspage" keys:attributeNames values:attributeValues];
- NSURL *pluginPageURL = pluginPage != nil ? [self URLWithAttributeString:pluginPage] : nil;
- NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode
- contentURL:URL
- pluginPageURL:pluginPageURL
- pluginName:[pluginPackage name]
- MIMEType:MIMEType];
- WebNullPluginView *nullView = [[[WebNullPluginView alloc] initWithFrame:frame error:error DOMElement:element] autorelease];
- view = nullView;
- [error release];
- }
-
- ASSERT(view);
- return view;
-}
-
-- (void)redirectDataToPlugin:(NSView *)pluginView
-{
- WebHTMLRepresentation *representation = (WebHTMLRepresentation *)[[_frame _dataSource] representation];
-
-#ifndef __LP64__
- if ([pluginView isKindOfClass:[WebNetscapePluginEmbeddedView class]])
- [representation _redirectDataToManualLoader:(WebNetscapePluginEmbeddedView *)pluginView forPluginView:pluginView];
- else {
-#else
- {
-#endif
- WebHTMLView *docView = (WebHTMLView *)[[_frame frameView] documentView];
- ASSERT([docView isKindOfClass:[WebHTMLView class]]);
-
- WebPluginController *pluginController = [docView _pluginController];
- [representation _redirectDataToManualLoader:pluginController forPluginView:pluginView];
- }
-
-}
-
-- (NSView *)viewForJavaAppletWithFrame:(NSRect)theFrame
- attributeNames:(NSArray *)attributeNames
- attributeValues:(NSArray *)attributeValues
- baseURL:(NSURL *)baseURL
- DOMElement:(DOMElement *)element
-{
- NSString *MIMEType = @"application/x-java-applet";
- WebBasePluginPackage *pluginPackage;
- NSView *view = nil;
-
- pluginPackage = [[self webView] _pluginForMIMEType:MIMEType];
-
- if (pluginPackage) {
- if ([pluginPackage isKindOfClass:[WebPluginPackage class]]) {
- // For some reason, the Java plug-in requires that we pass the dimension of the plug-in as attributes.
- NSMutableArray *names = [attributeNames mutableCopy];
- NSMutableArray *values = [attributeValues mutableCopy];
- if ([self valueForKey:@"width" keys:attributeNames values:attributeValues] == nil) {
- [names addObject:@"width"];
- [values addObject:[NSString stringWithFormat:@"%d", (int)theFrame.size.width]];
- }
- if ([self valueForKey:@"height" keys:attributeNames values:attributeValues] == nil) {
- [names addObject:@"height"];
- [values addObject:[NSString stringWithFormat:@"%d", (int)theFrame.size.height]];
- }
- view = [self pluginViewWithPackage:(WebPluginPackage *)pluginPackage
- attributeNames:names
- attributeValues:values
- baseURL:baseURL
- DOMElement:element
- loadManually:NO];
- [names release];
- [values release];
-
- }
-#ifndef __LP64__
- else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
- view = [[[WebNetscapePluginEmbeddedView alloc] initWithFrame:theFrame
- pluginPackage:(WebNetscapePluginPackage *)pluginPackage
- URL:nil
- baseURL:baseURL
- MIMEType:MIMEType
- attributeKeys:attributeNames
- attributeValues:attributeValues
- loadManually:NO
- DOMElement:element] autorelease];
- } else {
- ASSERT_NOT_REACHED();
- }
-#endif
- }
-
- if (!view) {
- NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable
- contentURL:nil
- pluginPageURL:nil
- pluginName:[pluginPackage name]
- MIMEType:MIMEType];
- view = [[[WebNullPluginView alloc] initWithFrame:theFrame error:error DOMElement:element] autorelease];
- [error release];
- }
-
- ASSERT(view);
-
- return view;
-}
-
-- (ObjectContentType)determineObjectFromMIMEType:(NSString*)MIMEType URL:(NSURL*)URL
-{
- // This is a quirk that ensures Tiger Mail's WebKit plug-in will load during layout
- // and not attach time. (5520541)
- static BOOL isTigerMail = WKAppVersionCheckLessThan(@"com.apple.mail", -1, 3.0);
- if (isTigerMail && [MIMEType isEqualToString:@"application/x-apple-msg-attachment"])
- return ObjectContentNetscapePlugin;
-
- if ([MIMEType length] == 0) {
- // Try to guess the MIME type based off the extension.
- NSString *extension = [[URL path] pathExtension];
- if ([extension length] > 0) {
- MIMEType = WKGetMIMETypeForExtension(extension);
- if ([MIMEType length] == 0) {
- // If no MIME type is specified, use a plug-in if we have one that can handle the extension.
- if (WebBasePluginPackage *package = [[self webView] _pluginForExtension:extension]) {
- if ([package isKindOfClass:[WebPluginPackage class]])
- return ObjectContentOtherPlugin;
-#ifndef __LP64__
- else {
- ASSERT([package isKindOfClass:[WebNetscapePluginPackage class]]);
- return ObjectContentNetscapePlugin;
- }
-#endif
- }
- }
- }
- }
-
- if ([MIMEType length] == 0)
- return ObjectContentFrame; // Go ahead and hope that we can display the content.
-
- if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType))
- return ObjectContentImage;
-
- if (WebBasePluginPackage *package = [[self webView] _pluginForMIMEType:MIMEType]) {
- if ([package isKindOfClass:[WebPluginPackage class]])
- return ObjectContentOtherPlugin;
-#ifndef __LP64__
- else {
- ASSERT([package isKindOfClass:[WebNetscapePluginPackage class]]);
- return ObjectContentNetscapePlugin;
- }
-#endif
- }
-
- if ([WebFrameView _viewClassForMIMEType:MIMEType])
- return ObjectContentFrame;
-
- return ObjectContentNone;
-}
-
-- (jobject)getAppletInView:(NSView *)view
-{
- if ([view respondsToSelector:@selector(webPlugInGetApplet)])
- return [view webPlugInGetApplet];
- return [self pollForAppletInView:view];
-}
-
-// NOTE: pollForAppletInView: will block until the block is ready to use, or
-// until a timeout is exceeded. It will return nil if the timeout is
-// exceeded.
-// Deprecated, use getAppletInView:.
-- (jobject)pollForAppletInView:(NSView *)view
-{
- if ([view respondsToSelector:@selector(pollForAppletInWindow:)])
- // The Java VM needs the containing window of the view to
- // initialize. The view may not yet be in the window's view
- // hierarchy, so we have to pass the window when requesting
- // the applet.
- return [view pollForAppletInWindow:[[self webView] window]];
- return 0;
-}
-
-- (void)respondToChangedContents
-{
- NSView <WebDocumentView> *view = [[_frame frameView] documentView];
- if ([view isKindOfClass:[WebHTMLView class]])
- [(WebHTMLView *)view _updateFontPanel];
- [[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidChangeNotification object:[self webView]];
-}
-
-- (NSUndoManager *)undoManager
-{
- return [[self webView] undoManager];
-}
-
-- (void)issuePasteCommand
-{
- NSView* documentView = [[_frame frameView] documentView];
- if ([documentView isKindOfClass:[WebHTMLView class]])
- [(WebHTMLView*)documentView paste:nil];
-}
-
-- (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view
-{
- if ([view respondsToSelector:@selector(webPlugInSetIsSelected:)])
- [view webPlugInSetIsSelected:isSelected];
- else if ([view respondsToSelector:@selector(setIsSelected:)])
- [view setIsSelected:isSelected];
-}
-
-- (void)windowObjectCleared
-{
- WebView *webView = getWebView(_frame);
- WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView);
- if (implementations->didClearWindowObjectForFrameFunc)
- CallFrameLoadDelegate(implementations->didClearWindowObjectForFrameFunc, webView, @selector(webView:didClearWindowObject:forFrame:), m_frame->windowScriptObject(), _frame);
- else if (implementations->windowScriptObjectAvailableFunc)
- CallFrameLoadDelegate(implementations->windowScriptObjectAvailableFunc, webView, @selector(webView:windowScriptObjectAvailable:), m_frame->windowScriptObject());
-
- if ([webView scriptDebugDelegate] || [WebScriptDebugServer listenerCount]) {
- [_frame _detachScriptDebugger];
- [_frame _attachScriptDebugger];
- }
-}
-
-- (BOOL)_compareDashboardRegions:(NSDictionary *)regions
-{
- return [lastDashboardRegions isEqualToDictionary:regions];
-}
-
-- (void)dashboardRegionsChanged:(NSMutableDictionary *)regions
-{
- WebView *webView = [self webView];
- [webView _addScrollerDashboardRegions:regions];
-
- if (![self _compareDashboardRegions:regions]) {
- CallUIDelegate(webView, @selector(webView:dashboardRegionsChanged:), regions);
-
- [lastDashboardRegions release];
- lastDashboardRegions = [regions retain];
- }
-}
-
-- (void)willPopupMenu:(NSMenu *)menu
-{
- CallUIDelegate([self webView], @selector(webView:willPopupMenu:), menu);
-}
-
-- (NSRect)customHighlightRect:(NSString*)type forLine:(NSRect)lineRect representedNode:(WebCore::Node *)node
-{
- ASSERT(_frame != nil);
- NSView *documentView = [[_frame frameView] documentView];
- if (![documentView isKindOfClass:[WebHTMLView class]])
- return NSZeroRect;
-
- WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
- id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type];
- if ([(NSObject *)highlighter respondsToSelector:@selector(highlightRectForLine:representedNode:)])
- return [highlighter highlightRectForLine:lineRect representedNode:kit(node)];
- return [highlighter highlightRectForLine:lineRect];
-}
-
-- (void)paintCustomHighlight:(NSString*)type forBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line representedNode:(WebCore::Node *)node
-{
- ASSERT(_frame != nil);
- NSView *documentView = [[_frame frameView] documentView];
- if (![documentView isKindOfClass:[WebHTMLView class]])
- return;
-
- WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
- id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type];
- if ([(NSObject *)highlighter respondsToSelector:@selector(paintHighlightForBox:onLine:behindText:entireLine:representedNode:)])
- [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:text entireLine:line representedNode:kit(node)];
- else
- [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:text entireLine:line];
-}
-
-- (NSString*)imageTitleForFilename:(NSString*)filename size:(NSSize)size
-{
- return [NSString stringWithFormat:UI_STRING("%@ %.0f×%.0f pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename, size.width, size.height];
-}
-
-@end
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 88788ee..2730765 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -60,7 +60,6 @@ public:
private:
virtual bool hasWebView() const; // mainly for assertions
- virtual bool hasFrameView() const; // ditto
virtual void makeRepresentation(WebCore::DocumentLoader*);
virtual bool hasHTMLView() const;
@@ -71,7 +70,6 @@ private:
virtual void detachedFromParent2();
virtual void detachedFromParent3();
- virtual void detachedFromParent4();
virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
@@ -109,9 +107,9 @@ private:
virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction,
const WebCore::String& MIMEType, const WebCore::ResourceRequest&);
virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction,
- const WebCore::NavigationAction&, const WebCore::ResourceRequest&, const WebCore::String& frameName);
+ const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WebCore::String& frameName);
virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction,
- const WebCore::NavigationAction&, const WebCore::ResourceRequest&);
+ const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>);
virtual void cancelPolicyCheck();
virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&);
@@ -121,7 +119,6 @@ private:
virtual void dispatchDidLoadMainResource(WebCore::DocumentLoader*);
virtual void revertToProvisionalState(WebCore::DocumentLoader*);
virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&);
- virtual void clearUnarchivingState(WebCore::DocumentLoader*);
virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length);
virtual void willChangeEstimatedProgress();
@@ -139,9 +136,7 @@ private:
virtual void committedLoad(WebCore::DocumentLoader*, const char*, int);
virtual void finishedLoading(WebCore::DocumentLoader*);
- virtual void finalSetupForReplace(WebCore::DocumentLoader*);
- virtual void updateGlobalHistoryForStandardLoad(const WebCore::KURL&);
- virtual void updateGlobalHistoryForReload(const WebCore::KURL&);
+ virtual void updateGlobalHistory(const WebCore::KURL&);
virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const;
virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&);
@@ -151,22 +146,16 @@ private:
virtual WebCore::ResourceError cannotShowMIMETypeError(const WebCore::ResourceResponse&);
virtual WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&);
+ virtual WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&);
virtual bool shouldFallBack(const WebCore::ResourceError&);
- virtual void setDefersLoading(bool);
-
virtual WebCore::String userAgent(const WebCore::KURL&);
virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
virtual void transitionToCommittedForNewPage();
- virtual bool willUseArchive(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, const WebCore::KURL& originalURL) const;
- virtual bool isArchiveLoadPending(WebCore::ResourceLoader*) const;
- virtual void cancelPendingArchiveLoad(WebCore::ResourceLoader*);
- virtual void clearArchivedResources();
-
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WebCore::String& MIMEType) const;
virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const;
@@ -199,16 +188,15 @@ private:
virtual void registerForIconNotification(bool listen);
- void deliverArchivedResourcesAfterDelay() const;
- bool canUseArchivedResource(NSURLRequest *) const;
- bool canUseArchivedResource(NSURLResponse *) const;
- void deliverArchivedResources(WebCore::Timer<WebFrameLoaderClient>*);
+#if ENABLE(MAC_JAVA_BRIDGE)
+ virtual jobject javaApplet(NSView*);
+#endif
void setOriginalURLForDownload(WebDownload *, const WebCore::ResourceRequest&) const;
RetainPtr<WebFramePolicyListener> setUpPolicyListener(WebCore::FramePolicyFunction);
- NSDictionary *actionDictionary(const WebCore::NavigationAction&) const;
+ NSDictionary *actionDictionary(const WebCore::NavigationAction&, PassRefPtr<WebCore::FormState>) const;
virtual bool canCachePage() const;
@@ -216,7 +204,4 @@ private:
RetainPtr<WebFramePolicyListener> m_policyListener;
WebCore::FramePolicyFunction m_policyFunction;
-
- mutable ResourceMap m_pendingArchivedResources;
- mutable WebCore::Timer<WebFrameLoaderClient> m_archivedResourcesDeliveryTimer;
};
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index bde1c5a..eb538e0 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -38,36 +38,40 @@
#import "WebCachedPagePlatformData.h"
#import "WebChromeClient.h"
#import "WebDataSourceInternal.h"
-#import "WebPolicyDelegatePrivate.h"
#import "WebDocumentInternal.h"
#import "WebDocumentLoaderMac.h"
#import "WebDownloadInternal.h"
-#import "WebDynamicScrollBarsView.h"
+#import "WebDynamicScrollBarsViewInternal.h"
#import "WebElementDictionary.h"
#import "WebFormDelegate.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebFrameLoadDelegate.h"
#import "WebFrameViewInternal.h"
-#import "WebHTMLRepresentation.h"
-#import "WebHTMLView.h"
+#import "WebHTMLRepresentationPrivate.h"
+#import "WebHTMLViewInternal.h"
#import "WebHistoryItemInternal.h"
-#import "WebHistoryItemPrivate.h"
-#import "WebHistoryPrivate.h"
+#import "WebHistoryInternal.h"
#import "WebIconDatabaseInternal.h"
#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
#import "WebKitNSStringExtras.h"
#import "WebNSURLExtras.h"
+#import "WebBaseNetscapePluginView.h"
+#import "WebNetscapePluginPackage.h"
+#import "WebNullPluginView.h"
#import "WebPanelAuthenticationHandler.h"
+#import "WebPluginController.h"
+#import "WebPluginPackage.h"
+#import "WebPluginViewFactoryPrivate.h"
#import "WebPolicyDelegate.h"
+#import "WebPolicyDelegatePrivate.h"
#import "WebPreferences.h"
#import "WebResourceLoadDelegate.h"
#import "WebResourcePrivate.h"
-#import "WebScriptDebugServerPrivate.h"
#import "WebUIDelegate.h"
#import "WebUIDelegatePrivate.h"
#import "WebViewInternal.h"
+#import <WebKitSystemInterface.h>
#import <WebCore/AuthenticationMac.h>
#import <WebCore/BlockExceptions.h>
#import <WebCore/CachedPage.h>
@@ -76,15 +80,20 @@
#import <WebCore/DocumentLoader.h>
#import <WebCore/EventHandler.h>
#import <WebCore/FormState.h>
+#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameLoaderTypes.h>
-#import <WebCore/Frame.h>
#import <WebCore/FrameTree.h>
+#import <WebCore/FrameView.h>
+#import <WebCore/HTMLFormElement.h>
+#import <WebCore/HTMLFrameElement.h>
+#import <WebCore/HTMLFrameOwnerElement.h>
+#import <WebCore/HTMLNames.h>
#import <WebCore/HistoryItem.h>
#import <WebCore/HitTestResult.h>
-#import <WebCore/HTMLFormElement.h>
#import <WebCore/IconDatabase.h>
#import <WebCore/LoaderNSURLExtras.h>
+#import <WebCore/MIMETypeRegistry.h>
#import <WebCore/MouseEvent.h>
#import <WebCore/Page.h>
#import <WebCore/PlatformString.h>
@@ -92,29 +101,37 @@
#import <WebCore/ResourceHandle.h>
#import <WebCore/ResourceLoader.h>
#import <WebCore/ResourceRequest.h>
-#import <WebCore/WebCoreFrameBridge.h>
-#import <WebCore/WebCoreObjCExtras.h>
+#import <WebCore/ScriptController.h>
#import <WebCore/SharedBuffer.h>
+#import <WebCore/WebCoreObjCExtras.h>
#import <WebCore/Widget.h>
#import <WebKit/DOMElement.h>
#import <WebKit/DOMHTMLFormElement.h>
-#import <WebKitSystemInterface.h>
#import <wtf/PassRefPtr.h>
+#if ENABLE(MAC_JAVA_BRIDGE)
+#import "WebJavaPlugIn.h"
+#endif
+
using namespace WebCore;
+using namespace HTMLNames;
-// SPI for NSURLDownload
-// Needed for <rdar://problem/5121850>
-@interface NSURLDownload (NSURLDownloadPrivate)
-- (void)_setOriginatingURL:(NSURL *)originatingURL;
+#if ENABLE(MAC_JAVA_BRIDGE)
+@interface NSView (WebJavaPluginDetails)
+- (jobject)pollForAppletInWindow:(NSWindow *)window;
@end
+#endif
-@interface WebHistoryItem (WebHistoryItemPrivate)
-- (BOOL)_wasUserGesture;
+@interface NSURLDownload (WebNSURLDownloadDetails)
+- (void)_setOriginatingURL:(NSURL *)originatingURL;
@end
-@interface WebFramePolicyListener : NSObject <WebPolicyDecisionListener, WebFormSubmissionListener>
-{
+// For backwards compatibility with older WebKit plug-ins.
+NSString *WebPluginBaseURLKey = @"WebPluginBaseURL";
+NSString *WebPluginAttributesKey = @"WebPluginAttributes";
+NSString *WebPluginContainerKey = @"WebPluginContainer";
+
+@interface WebFramePolicyListener : NSObject <WebPolicyDecisionListener, WebFormSubmissionListener> {
Frame* m_frame;
}
- (id)initWithWebCoreFrame:(Frame*)frame;
@@ -129,12 +146,12 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame)
: m_webFrame(webFrame)
, m_policyFunction(0)
- , m_archivedResourcesDeliveryTimer(this, &WebFrameLoaderClient::deliverArchivedResources)
{
}
void WebFrameLoaderClient::frameLoaderDestroyed()
{
+ [m_webFrame.get() _clearCoreFrame];
delete this;
}
@@ -143,12 +160,6 @@ bool WebFrameLoaderClient::hasWebView() const
return [m_webFrame.get() webView] != nil;
}
-bool WebFrameLoaderClient::hasFrameView() const
-{
- return m_webFrame->_private->webFrameView != nil;
-}
-
-
void WebFrameLoaderClient::makeRepresentation(DocumentLoader* loader)
{
[dataSource(loader) _makeRepresentation];
@@ -172,6 +183,8 @@ void WebFrameLoaderClient::forceLayout()
void WebFrameLoaderClient::forceLayoutForNonHTML()
{
WebFrameView *thisView = m_webFrame->_private->webFrameView;
+ if (!thisView) // Viewless mode.
+ return;
NSView <WebDocumentView> *thisDocumentView = [thisView documentView];
ASSERT(thisDocumentView != nil);
@@ -191,6 +204,9 @@ void WebFrameLoaderClient::setCopiesOnScroll()
void WebFrameLoaderClient::detachedFromParent2()
{
+ //remove any NetScape plugins that are children of this frame because they are about to be detached
+ WebView *webView = getWebView(m_webFrame.get());
+ [webView removePluginInstanceViewsFor:(m_webFrame.get())];
[m_webFrame->_private->webFrameView _setWebFrame:nil]; // needed for now to be compatible w/ old behavior
}
@@ -200,11 +216,6 @@ void WebFrameLoaderClient::detachedFromParent3()
m_webFrame->_private->webFrameView = nil;
}
-void WebFrameLoaderClient::detachedFromParent4()
-{
- m_webFrame->_private->bridge = nil;
-}
-
void WebFrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest& initialRequest, const ResourceResponse& response)
{
id proxy = handle->releaseProxy();
@@ -233,9 +244,9 @@ void WebFrameLoaderClient::setOriginalURLForDownload(WebDownload *download, cons
WebBackForwardList *history = [webView backForwardList];
int backListCount = [history backListCount];
for (int backIndex = 0; backIndex <= backListCount && !originalURL; backIndex++) {
- WebHistoryItem *currentItem = [history itemAtIndex:-backIndex];
- if (![currentItem respondsToSelector:@selector(_wasUserGesture)] || [currentItem _wasUserGesture])
- originalURL = [currentItem URL];
+ // FIXME: At one point we had code here to check a "was user gesture" flag.
+ // Do we need to restore that logic?
+ originalURL = [[history itemAtIndex:-backIndex] URL];
}
}
@@ -426,12 +437,14 @@ void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
CallFrameLoadDelegate(implementations->didCancelClientRedirectForFrameFunc, webView, @selector(webView:didCancelClientRedirectForFrame:), m_webFrame.get());
}
-void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const KURL& URL, double delay, double fireDate)
+void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const KURL& url, double delay, double fireDate)
{
WebView *webView = getWebView(m_webFrame.get());
WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView);
- if (implementations->willPerformClientRedirectToURLDelayFireDateForFrameFunc)
- CallFrameLoadDelegate(implementations->willPerformClientRedirectToURLDelayFireDateForFrameFunc, webView, @selector(webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:), URL.getNSURL(), delay, [NSDate dateWithTimeIntervalSince1970:fireDate], m_webFrame.get());
+ if (implementations->willPerformClientRedirectToURLDelayFireDateForFrameFunc) {
+ NSURL *cocoaURL = url;
+ CallFrameLoadDelegate(implementations->willPerformClientRedirectToURLDelayFireDateForFrameFunc, webView, @selector(webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:), cocoaURL, delay, [NSDate dateWithTimeIntervalSince1970:fireDate], m_webFrame.get());
+ }
}
void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage()
@@ -452,9 +465,8 @@ void WebFrameLoaderClient::dispatchWillClose()
void WebFrameLoaderClient::dispatchDidReceiveIcon()
{
- ASSERT([m_webFrame.get() _isMainFrame]);
WebView *webView = getWebView(m_webFrame.get());
-
+ ASSERT(m_webFrame == [webView mainFrame]);
[webView _dispatchDidReceiveIconFromWebFrame:m_webFrame.get()];
}
@@ -479,7 +491,7 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title)
void WebFrameLoaderClient::dispatchDidCommitLoad()
{
// Tell the client we've committed this URL.
- ASSERT([m_webFrame->_private->webFrameView documentView] != nil);
+ ASSERT([m_webFrame->_private->webFrameView documentView] != nil || ![getWebView(m_webFrame.get()) _usesDocumentViews]);
WebView *webView = getWebView(m_webFrame.get());
[webView _didCommitLoadForFrame:m_webFrame.get()];
@@ -571,22 +583,22 @@ void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction f
}
void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function,
- const NavigationAction& action, const ResourceRequest& request, const String& frameName)
+ const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName)
{
WebView *webView = getWebView(m_webFrame.get());
[[webView _policyDelegateForwarder] webView:webView
- decidePolicyForNewWindowAction:actionDictionary(action)
+ decidePolicyForNewWindowAction:actionDictionary(action, formState)
request:request.nsURLRequest()
newFrameName:frameName
decisionListener:setUpPolicyListener(function).get()];
}
void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function,
- const NavigationAction& action, const ResourceRequest& request)
+ const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState)
{
WebView *webView = getWebView(m_webFrame.get());
[[webView _policyDelegateForwarder] webView:webView
- decidePolicyForNavigationAction:actionDictionary(action)
+ decidePolicyForNavigationAction:actionDictionary(action, formState)
request:request.nsURLRequest()
frame:m_webFrame.get()
decisionListener:setUpPolicyListener(function).get()];
@@ -625,8 +637,6 @@ void WebFrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction function,
void WebFrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader* loader)
{
- if ([WebScriptDebugServer listenerCount])
- [[WebScriptDebugServer sharedScriptDebugServer] webView:getWebView(m_webFrame.get()) didLoadMainResourceForDataSource:dataSource(loader)];
}
void WebFrameLoaderClient::revertToProvisionalState(DocumentLoader* loader)
@@ -639,11 +649,6 @@ void WebFrameLoaderClient::setMainDocumentError(DocumentLoader* loader, const Re
[dataSource(loader) _setMainDocumentError:error];
}
-void WebFrameLoaderClient::clearUnarchivingState(DocumentLoader* loader)
-{
- [dataSource(loader) _clearUnarchivingState];
-}
-
void WebFrameLoaderClient::willChangeEstimatedProgress()
{
[getWebView(m_webFrame.get()) _willChangeValueForKey:_WebEstimatedProgressKey];
@@ -677,7 +682,7 @@ void WebFrameLoaderClient::setMainFrameDocumentReady(bool ready)
void WebFrameLoaderClient::startDownload(const ResourceRequest& request)
{
// FIXME: Should download full request.
- WebDownload *download = [getWebView(m_webFrame.get()) _downloadURL:request.url().getNSURL()];
+ WebDownload *download = [getWebView(m_webFrame.get()) _downloadURL:request.url()];
setOriginalURLForDownload(download, request);
}
@@ -706,32 +711,13 @@ void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
[dataSource(loader) _finishedLoading];
}
-void WebFrameLoaderClient::finalSetupForReplace(DocumentLoader* loader)
-{
- [dataSource(loader) _clearUnarchivingState];
-}
-
-// FIXME: <rdar://problem/4880065> - Push Global History into WebCore
-// Once that task is complete, this will go away
-void WebFrameLoaderClient::updateGlobalHistoryForStandardLoad(const KURL& url)
+void WebFrameLoaderClient::updateGlobalHistory(const KURL& url)
{
- NSURL *nsurl = url.getNSURL();
- WebHistoryItem *entry = [[WebHistory optionalSharedHistory] addItemForURL:nsurl];
- String pageTitle = core(m_webFrame.get())->loader()->documentLoader()->title();
- if (pageTitle.length())
- [entry setTitle:pageTitle];
+ NSURL *cocoaURL = url;
+ const String& pageTitle = core(m_webFrame.get())->loader()->documentLoader()->title();
+ [[WebHistory optionalSharedHistory] _addItemForURL:cocoaURL title:pageTitle];
}
-// FIXME: <rdar://problem/4880065> - Push Global History into WebCore
-// Once that task is complete, this will go away
-void WebFrameLoaderClient::updateGlobalHistoryForReload(const KURL& url)
-{
- WebHistory *sharedHistory = [WebHistory optionalSharedHistory];
- WebHistoryItem *item = [sharedHistory itemForURL:url.getNSURL()];
- if (item)
- [sharedHistory setLastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate] forItem:item];
-}
-
bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const
{
WebView* view = getWebView(m_webFrame.get());
@@ -742,32 +728,42 @@ bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const
ResourceError WebFrameLoaderClient::cancelledError(const ResourceRequest& request)
{
- return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled URL:request.url().getNSURL()];
+ return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled URL:request.url()];
}
ResourceError WebFrameLoaderClient::blockedError(const ResourceRequest& request)
{
- return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorCannotUseRestrictedPort URL:request.url().getNSURL()];
+ return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorCannotUseRestrictedPort URL:request.url()];
}
ResourceError WebFrameLoaderClient::cannotShowURLError(const ResourceRequest& request)
{
- return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorCannotShowURL URL:request.url().getNSURL()];
+ return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorCannotShowURL URL:request.url()];
}
ResourceError WebFrameLoaderClient::interruptForPolicyChangeError(const ResourceRequest& request)
{
- return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorFrameLoadInterruptedByPolicyChange URL:request.url().getNSURL()];
+ return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorFrameLoadInterruptedByPolicyChange URL:request.url()];
}
ResourceError WebFrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse& response)
{
- return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:WebKitErrorCannotShowMIMEType URL:response.url().getNSURL()];
+ return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:WebKitErrorCannotShowMIMEType URL:response.url()];
}
ResourceError WebFrameLoaderClient::fileDoesNotExistError(const ResourceResponse& response)
{
- return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist URL:response.url().getNSURL()];
+ return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist URL:response.url()];
+}
+
+ResourceError WebFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse& response)
+{
+ NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInWillHandleLoad
+ contentURL:response.url()
+ pluginPageURL:nil
+ pluginName:nil
+ MIMEType:response.mimeType()];
+ return [error autorelease];
}
bool WebFrameLoaderClient::shouldFallBack(const ResourceError& error)
@@ -778,52 +774,12 @@ bool WebFrameLoaderClient::shouldFallBack(const ResourceError& error)
return error.errorCode() != NSURLErrorCancelled && error.errorCode() != WebKitErrorPlugInWillHandleLoad;
}
-void WebFrameLoaderClient::setDefersLoading(bool defers)
-{
- if (!defers)
- deliverArchivedResourcesAfterDelay();
-}
-
-bool WebFrameLoaderClient::willUseArchive(ResourceLoader* loader, const ResourceRequest& request, const KURL& originalURL) const
-{
- if (request.url() != originalURL)
- return false;
- if (!canUseArchivedResource(request.nsURLRequest()))
- return false;
- WebResource *resource = [dataSource(core(m_webFrame.get())->loader()->activeDocumentLoader()) _archivedSubresourceForURL:originalURL.getNSURL()];
- if (!resource)
- return false;
- if (!canUseArchivedResource([resource _response]))
- return false;
- m_pendingArchivedResources.set(loader, resource);
- // Deliver the resource after a delay because callers don't expect to receive callbacks while calling this method.
- deliverArchivedResourcesAfterDelay();
- return true;
-}
-
-bool WebFrameLoaderClient::isArchiveLoadPending(ResourceLoader* loader) const
-{
- return m_pendingArchivedResources.contains(loader);
-}
-
-void WebFrameLoaderClient::cancelPendingArchiveLoad(ResourceLoader* loader)
-{
- if (m_pendingArchivedResources.isEmpty())
- return;
- m_pendingArchivedResources.remove(loader);
- if (m_pendingArchivedResources.isEmpty())
- m_archivedResourcesDeliveryTimer.stop();
-}
-
-void WebFrameLoaderClient::clearArchivedResources()
-{
- m_pendingArchivedResources.clear();
- m_archivedResourcesDeliveryTimer.stop();
-}
-
bool WebFrameLoaderClient::canHandleRequest(const ResourceRequest& request) const
{
- return [WebView _canHandleRequest:request.nsURLRequest()];
+ Frame* frame = core(m_webFrame.get());
+ Page* page = frame->page();
+ BOOL forMainFrame = page && page->mainFrame() == frame;
+ return [WebView _canHandleRequest:request.nsURLRequest() forMainFrame:forMainFrame];
}
bool WebFrameLoaderClient::canShowMIMEType(const String& MIMEType) const
@@ -910,8 +866,8 @@ void WebFrameLoaderClient::prepareForDataSourceReplacement()
// Make sure that any work that is triggered by resigning first reponder can get done.
// The main example where this came up is the textDidEndEditing that is sent to the
- // FormsDelegate (3223413). We need to do this before _detachChildren, since that will
- // remove the views as a side-effect of freeing the bridge, at which point we can't
+ // FormsDelegate (3223413). We need to do this before _detachChildren, since that will
+ // remove the views as a side-effect of freeing the frame, at which point we can't
// post the FormDelegate messages.
//
// Note that this can also take FirstResponder away from a child of our frameView that
@@ -929,7 +885,7 @@ void WebFrameLoaderClient::prepareForDataSourceReplacement()
PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
{
- RefPtr<WebDocumentLoaderMac> loader = new WebDocumentLoaderMac(request, substituteData);
+ RefPtr<WebDocumentLoaderMac> loader = WebDocumentLoaderMac::create(request, substituteData);
WebDataSource *dataSource = [[WebDataSource alloc] _initWithDocumentLoader:loader.get()];
loader->setDataSource(dataSource, getWebView(m_webFrame.get()));
@@ -942,76 +898,14 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const Reso
// Once that task is complete, this will go away
void WebFrameLoaderClient::setTitle(const String& title, const KURL& URL)
{
- NSURL* nsURL = canonicalURL(URL.getNSURL());
+ NSURL* nsURL = URL;
+ nsURL = [nsURL _webkit_canonicalize];
if(!nsURL)
return;
NSString *titleNSString = title;
[[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:titleNSString];
}
-// The following 2 functions are copied from [NSHTTPURLProtocol _cachedResponsePassesValidityChecks] and modified for our needs.
-// FIXME: It would be nice to eventually to share this logic somehow.
-bool WebFrameLoaderClient::canUseArchivedResource(NSURLRequest *request) const
-{
- NSURLRequestCachePolicy policy = [request cachePolicy];
- if (policy == NSURLRequestReturnCacheDataElseLoad)
- return true;
- if (policy == NSURLRequestReturnCacheDataDontLoad)
- return true;
- if ([request valueForHTTPHeaderField:@"must-revalidate"] != nil)
- return false;
- if ([request valueForHTTPHeaderField:@"proxy-revalidate"] != nil)
- return false;
- if ([request valueForHTTPHeaderField:@"If-Modified-Since"] != nil)
- return false;
- if ([request valueForHTTPHeaderField:@"Cache-Control"] != nil)
- return false;
- if ([@"POST" _webkit_isCaseInsensitiveEqualToString:[request HTTPMethod]])
- return false;
- return true;
-}
-
-bool WebFrameLoaderClient::canUseArchivedResource(NSURLResponse *response) const
-{
- if (WKGetNSURLResponseMustRevalidate(response))
- return false;
- if (WKGetNSURLResponseCalculatedExpiration(response) - CFAbsoluteTimeGetCurrent() < 1)
- return false;
- return true;
-}
-
-void WebFrameLoaderClient::deliverArchivedResourcesAfterDelay() const
-{
- if (m_pendingArchivedResources.isEmpty())
- return;
- if (core(m_webFrame.get())->page()->defersLoading())
- return;
- if (!m_archivedResourcesDeliveryTimer.isActive())
- m_archivedResourcesDeliveryTimer.startOneShot(0);
-}
-
-void WebFrameLoaderClient::deliverArchivedResources(Timer<WebFrameLoaderClient>*)
-{
- if (m_pendingArchivedResources.isEmpty())
- return;
- if (core(m_webFrame.get())->page()->defersLoading())
- return;
-
- const ResourceMap copy = m_pendingArchivedResources;
- m_pendingArchivedResources.clear();
-
- ResourceMap::const_iterator end = copy.end();
- for (ResourceMap::const_iterator it = copy.begin(); it != end; ++it) {
- RefPtr<ResourceLoader> loader = it->first;
- WebResource *resource = it->second.get();
- NSData *data = [[resource data] retain];
- loader->didReceiveResponse([resource _response]);
- loader->didReceiveData((const char*)[data bytes], [data length], [data length], true);
- [data release];
- loader->didFinishLoading();
- }
-}
-
void WebFrameLoaderClient::savePlatformDataToCachedPage(CachedPage* cachedPage)
{
WebCachedPagePlatformData* webPlatformData = new WebCachedPagePlatformData([m_webFrame->_private->webFrameView documentView]);
@@ -1025,6 +919,11 @@ void WebFrameLoaderClient::transitionToCommittedFromCachedPage(CachedPage* cache
ASSERT(cachedView != nil);
ASSERT(cachedPage->documentLoader());
[cachedView setDataSource:dataSource(cachedPage->documentLoader())];
+
+ // clean up webkit plugin instances before WebHTMLView gets freed.
+ WebView *webView = getWebView(m_webFrame.get());
+ [webView removePluginInstanceViewsFor:(m_webFrame.get())];
+
[m_webFrame->_private->webFrameView _setDocumentView:cachedView];
}
@@ -1034,7 +933,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
WebDataSource *ds = [m_webFrame.get() _dataSource];
bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[ds _responseMIMEType]] == [WebHTMLView class];
- bool canSkipCreation = [m_webFrame.get() _frameLoader]->committingFirstRealLoad() && willProduceHTMLView;
+ bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView;
if (canSkipCreation) {
[[v documentView] setDataSource:ds];
return;
@@ -1044,20 +943,49 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
if (!willProduceHTMLView)
[[v _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
- NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds];
- if (!documentView)
- return;
+ // clean up webkit plugin instances before WebHTMLView gets freed.
+ WebView *webView = getWebView(m_webFrame.get());
+ [webView removePluginInstanceViewsFor:(m_webFrame.get())];
+
+ BOOL useDocumentViews = [webView _usesDocumentViews];
+ NSView <WebDocumentView> *documentView = nil;
+ if (useDocumentViews) {
+ documentView = [v _makeDocumentViewForDataSource:ds];
+ if (!documentView)
+ return;
+ }
+
+ // FIXME: Could we skip some of this work for a top-level view that is not a WebHTMLView?
- WebFrameBridge *bridge = m_webFrame->_private->bridge;
+ // If we own the view, delete the old one - otherwise the render m_frame will take care of deleting the view.
+ Frame* coreFrame = core(m_webFrame.get());
+ Page* page = coreFrame->page();
+ bool isMainFrame = coreFrame == page->mainFrame();
+ if (isMainFrame && coreFrame->view())
+ coreFrame->view()->setParentVisible(false);
+ coreFrame->setView(0);
+ FrameView* coreView;
+ if (useDocumentViews)
+ coreView = new FrameView(coreFrame);
+ else
+ coreView = new FrameView(coreFrame, IntSize([webView bounds].size));
+ coreFrame->setView(coreView);
+ coreView->deref(); // FIXME: Eliminate this crazy refcounting!
- // FIXME: We could save work and not do this for a top-level view that is not a WebHTMLView.
- [bridge createFrameViewWithNSView:documentView marginWidth:[v _marginWidth] marginHeight:[v _marginHeight]];
- [m_webFrame.get() _updateBackground];
- [bridge installInFrame:[v _scrollView]];
+ [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen];
+
+ [v _install];
+
+ if (isMainFrame)
+ coreView->setParentVisible(true);
// Call setDataSource on the document view after it has been placed in the view hierarchy.
// This what we for the top-level view, so should do this for views in subframes as well.
[documentView setDataSource:ds];
+
+ if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement())
+ coreFrame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
+
}
RetainPtr<WebFramePolicyListener> WebFrameLoaderClient::setUpPolicyListener(FramePolicyFunction function)
@@ -1089,7 +1017,17 @@ void WebFrameLoaderClient::receivedPolicyDecison(PolicyAction action)
String WebFrameLoaderClient::userAgent(const KURL& url)
{
- return [getWebView(m_webFrame.get()) _userAgentForURL:url];
+ WebView *webView = getWebView(m_webFrame.get());
+ ASSERT(webView);
+
+ // We should never get here with nil for the WebView unless there is a bug somewhere else.
+ // But if we do, it's better to return the empty string than just crashing on the spot.
+ // Most other call sites are tolerant of nil because of Objective-C behavior, but this one
+ // is not because the return value of _userAgentForURL is a const KURL&.
+ if (!webView)
+ return String("");
+
+ return [webView _userAgentForURL:url];
}
static const MouseEvent* findMouseEvent(const Event* event)
@@ -1100,7 +1038,7 @@ static const MouseEvent* findMouseEvent(const Event* event)
return 0;
}
-NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& action) const
+NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& action, PassRefPtr<FormState> formState) const
{
unsigned modifierFlags = 0;
const Event* event = action.event();
@@ -1114,25 +1052,31 @@ NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& act
if (keyStateEvent->metaKey())
modifierFlags |= NSCommandKeyMask;
}
+
+ NSURL *originalURL = action.url();
+
+ NSMutableDictionary *result = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:action.type()], WebActionNavigationTypeKey,
+ [NSNumber numberWithInt:modifierFlags], WebActionModifierFlagsKey,
+ originalURL, WebActionOriginalURLKey,
+ nil];
+
if (const MouseEvent* mouseEvent = findMouseEvent(event)) {
IntPoint point(mouseEvent->pageX(), mouseEvent->pageY());
WebElementDictionary *element = [[WebElementDictionary alloc]
initWithHitTestResult:core(m_webFrame.get())->eventHandler()->hitTestResultAtPoint(point, false)];
- NSDictionary *result = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:action.type()], WebActionNavigationTypeKey,
- element, WebActionElementKey,
- [NSNumber numberWithInt:mouseEvent->button()], WebActionButtonKey,
- [NSNumber numberWithInt:modifierFlags], WebActionModifierFlagsKey,
- action.url().getNSURL(), WebActionOriginalURLKey,
- nil];
+ [result setObject:element forKey:WebActionElementKey];
[element release];
- return result;
+
+ [result setObject:[NSNumber numberWithInt:mouseEvent->button()] forKey:WebActionButtonKey];
}
- return [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:action.type()], WebActionNavigationTypeKey,
- [NSNumber numberWithInt:modifierFlags], WebActionModifierFlagsKey,
- action.url().getNSURL(), WebActionOriginalURLKey,
- nil];
+
+ if (formState) {
+ ASSERT(formState->form());
+ [result setObject:kit(formState->form()) forKey:WebActionFormKey];
+ }
+
+ return result;
}
bool WebFrameLoaderClient::canCachePage() const
@@ -1142,33 +1086,100 @@ bool WebFrameLoaderClient::canCachePage() const
}
PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
- const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
+ const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
{
- WebFrameBridge* bridge = m_webFrame->_private->bridge;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [bridge createChildFrameNamed:name
- withURL:url.getNSURL()
- referrer:referrer
- ownerElement:ownerElement
- allowsScrolling:allowsScrolling
- marginWidth:marginWidth
- marginHeight:marginHeight];
+ ASSERT(m_webFrame);
+
+ WebFrameView *childView = [getWebView(m_webFrame.get()) _usesDocumentViews] ? [[WebFrameView alloc] init] : nil;
+
+ RefPtr<Frame> result = [WebFrame _createSubframeWithOwnerElement:ownerElement frameName:name frameView:childView];
+ [childView release];
+
+ WebFrame *newFrame = kit(result.get());
+
+ if ([newFrame _dataSource])
+ [[newFrame _dataSource] _documentLoader]->setOverrideEncoding([[m_webFrame.get() _dataSource] _documentLoader]->overrideEncoding());
+
+ // The creation of the frame may have run arbitrary JavaScript that removed it from the page already.
+ if (!result->page())
+ return 0;
+
+ core(m_webFrame.get())->loader()->loadURLIntoChildFrame(url, referrer, result.get());
+
+ // The frame's onload handler may have removed it from the document.
+ if (!result->tree()->parent())
+ return 0;
+
+ return result.release();
END_BLOCK_OBJC_EXCEPTIONS;
+
return 0;
}
ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeType)
{
- WebFrameBridge* bridge = m_webFrame->_private->bridge;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [bridge determineObjectFromMIMEType:mimeType URL:url.getNSURL()];
+
+ // This is a quirk that ensures Tiger Mail's WebKit plug-in will load during layout
+ // and not attach time. (5520541)
+ static BOOL isTigerMail = WKAppVersionCheckLessThan(@"com.apple.mail", -1, 3.0);
+ if (isTigerMail && mimeType == "application/x-apple-msg-attachment")
+ return ObjectContentNetscapePlugin;
+
+ String type = mimeType;
+
+ if (type.isEmpty()) {
+ // Try to guess the MIME type based off the extension.
+ NSURL *URL = url;
+ NSString *extension = [[URL path] pathExtension];
+ if ([extension length] > 0) {
+ type = WKGetMIMETypeForExtension(extension);
+ if (type.isEmpty()) {
+ // If no MIME type is specified, use a plug-in if we have one that can handle the extension.
+ if (WebBasePluginPackage *package = [getWebView(m_webFrame.get()) _pluginForExtension:extension]) {
+ if ([package isKindOfClass:[WebPluginPackage class]])
+ return ObjectContentOtherPlugin;
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ else {
+ ASSERT([package isKindOfClass:[WebNetscapePluginPackage class]]);
+ return ObjectContentNetscapePlugin;
+ }
+#endif
+ }
+ }
+ }
+ }
+
+ if (type.isEmpty())
+ return ObjectContentFrame; // Go ahead and hope that we can display the content.
+
+ if (MIMETypeRegistry::isSupportedImageMIMEType(type))
+ return ObjectContentImage;
+
+ WebBasePluginPackage *package = [getWebView(m_webFrame.get()) _pluginForMIMEType:type];
+ if (package) {
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ if ([package isKindOfClass:[WebNetscapePluginPackage class]])
+ return ObjectContentNetscapePlugin;
+#endif
+ ASSERT([package isKindOfClass:[WebPluginPackage class]]);
+ return ObjectContentOtherPlugin;
+ }
+
+ if ([WebFrameView _viewClassForMIMEType:type])
+ return ObjectContentFrame;
+
+ return ObjectContentNone;
+
END_BLOCK_OBJC_EXCEPTIONS;
+
return ObjectContentNone;
}
-static NSArray* nsArray(const Vector<String>& vector)
+static NSMutableArray* kit(const Vector<String>& vector)
{
unsigned len = vector.size();
NSMutableArray* array = [NSMutableArray arrayWithCapacity:len];
@@ -1177,19 +1188,194 @@ static NSArray* nsArray(const Vector<String>& vector)
return array;
}
-Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element, const KURL& url, const Vector<String>& paramNames,
- const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+static String parameterValue(const Vector<String>& paramNames, const Vector<String>& paramValues, const String& name)
+{
+ size_t size = paramNames.size();
+ ASSERT(size == paramValues.size());
+ for (size_t i = 0; i < size; ++i) {
+ if (equalIgnoringCase(paramNames[i], name))
+ return paramValues[i];
+ }
+ return String();
+}
+
+static NSView *pluginView(WebFrame *frame, WebPluginPackage *pluginPackage,
+ NSArray *attributeNames, NSArray *attributeValues, NSURL *baseURL,
+ DOMElement *element, BOOL loadManually)
{
- WebFrameBridge* bridge = m_webFrame->_private->bridge;
+ WebHTMLView *docView = (WebHTMLView *)[[frame frameView] documentView];
+ ASSERT([docView isKindOfClass:[WebHTMLView class]]);
+
+ WebPluginController *pluginController = [docView _pluginController];
+
+ // Store attributes in a dictionary so they can be passed to WebPlugins.
+ NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:attributeValues forKeys:attributeNames];
+
+ [pluginPackage load];
+ Class viewFactory = [pluginPackage viewFactory];
+
+ NSView *view = nil;
+ NSDictionary *arguments = nil;
+
+ if ([viewFactory respondsToSelector:@selector(plugInViewWithArguments:)]) {
+ arguments = [NSDictionary dictionaryWithObjectsAndKeys:
+ baseURL, WebPlugInBaseURLKey,
+ attributes, WebPlugInAttributesKey,
+ pluginController, WebPlugInContainerKey,
+ [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey,
+ [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey,
+ element, WebPlugInContainingElementKey,
+ nil];
+ LOG(Plugins, "arguments:\n%@", arguments);
+ } else if ([viewFactory respondsToSelector:@selector(pluginViewWithArguments:)]) {
+ arguments = [NSDictionary dictionaryWithObjectsAndKeys:
+ baseURL, WebPluginBaseURLKey,
+ attributes, WebPluginAttributesKey,
+ pluginController, WebPluginContainerKey,
+ element, WebPlugInContainingElementKey,
+ nil];
+ LOG(Plugins, "arguments:\n%@", arguments);
+ }
+
+ view = [WebPluginController plugInViewWithArguments:arguments fromPluginPackage:pluginPackage];
+ [attributes release];
+ return view;
+}
+
+class PluginWidget : public Widget {
+public:
+ PluginWidget(NSView *view = 0)
+ : Widget(view)
+ {
+ }
+
+ virtual void invalidateRect(const IntRect& rect)
+ {
+ [platformWidget() setNeedsDisplayInRect:rect];
+ }
+};
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
+class NetscapePluginWidget : public PluginWidget {
+public:
+ NetscapePluginWidget(WebBaseNetscapePluginView *view)
+ : PluginWidget(view)
+ {
+ }
+
+ virtual void handleEvent(Event*)
+ {
+ Frame* frame = Frame::frameForWidget(this);
+ if (!frame)
+ return;
+
+ NSEvent* event = frame->eventHandler()->currentNSEvent();
+ if ([event type] == NSMouseMoved)
+ [(WebBaseNetscapePluginView *)platformWidget() handleMouseMoved:event];
+ }
+
+};
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element, const KURL& url,
+ const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return new Widget([bridge viewForPluginWithFrame:NSMakeRect(0, 0, size.width(), size.height())
- URL:url.getNSURL()
- attributeNames:nsArray(paramNames)
- attributeValues:nsArray(paramValues)
- MIMEType:mimeType
- DOMElement:[DOMElement _wrapElement:element]
- loadManually:loadManually]);
+
+ ASSERT(paramNames.size() == paramValues.size());
+
+ int errorCode = 0;
+
+ WebView *webView = getWebView(m_webFrame.get());
+ SEL selector = @selector(webView:plugInViewWithArguments:);
+ NSURL *URL = url;
+
+ if ([[webView UIDelegate] respondsToSelector:selector]) {
+ NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:kit(paramValues) forKeys:kit(paramNames)];
+ NSDictionary *arguments = [[NSDictionary alloc] initWithObjectsAndKeys:
+ attributes, WebPlugInAttributesKey,
+ [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey,
+ [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey,
+ kit(element), WebPlugInContainingElementKey,
+ URL, WebPlugInBaseURLKey, // URL might be nil, so add it last
+ nil];
+
+ NSView *view = CallUIDelegate(webView, selector, arguments);
+
+ [attributes release];
+ [arguments release];
+
+ if (view)
+ return new PluginWidget(view);
+ }
+
+ NSString *MIMEType;
+ WebBasePluginPackage *pluginPackage;
+ if (mimeType.isEmpty()) {
+ MIMEType = nil;
+ pluginPackage = nil;
+ } else {
+ MIMEType = mimeType;
+ pluginPackage = [webView _pluginForMIMEType:mimeType];
+ }
+
+ NSString *extension = [[URL path] pathExtension];
+ if (!pluginPackage && [extension length] != 0) {
+ pluginPackage = [webView _pluginForExtension:extension];
+ if (pluginPackage) {
+ NSString *newMIMEType = [pluginPackage MIMETypeForExtension:extension];
+ if ([newMIMEType length] != 0)
+ MIMEType = newMIMEType;
+ }
+ }
+
+ NSView *view = nil;
+
+ Document* document = core(m_webFrame.get())->document();
+ NSURL *baseURL = document->baseURL();
+ if (pluginPackage) {
+ if ([pluginPackage isKindOfClass:[WebPluginPackage class]])
+ view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, kit(paramNames), kit(paramValues), baseURL, kit(element), loadManually);
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
+ WebBaseNetscapePluginView *embeddedView = [[[WebBaseNetscapePluginView alloc]
+ initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
+ pluginPackage:(WebNetscapePluginPackage *)pluginPackage
+ URL:URL
+ baseURL:baseURL
+ MIMEType:MIMEType
+ attributeKeys:kit(paramNames)
+ attributeValues:kit(paramValues)
+ loadManually:loadManually
+ DOMElement:kit(element)] autorelease];
+
+ return new NetscapePluginWidget(embeddedView);
+ }
+#endif
+ } else
+ errorCode = WebKitErrorCannotFindPlugIn;
+
+ if (!errorCode && !view)
+ errorCode = WebKitErrorCannotLoadPlugIn;
+
+ if (errorCode) {
+ NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode
+ contentURL:URL
+ pluginPageURL:document->completeURL(parseURL(parameterValue(paramNames, paramValues, "pluginspage")))
+ pluginName:[pluginPackage name]
+ MIMEType:MIMEType];
+ WebNullPluginView *nullView = [[[WebNullPluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
+ error:error DOMElement:kit(element)] autorelease];
+ view = nullView;
+ [error release];
+ }
+
+ ASSERT(view);
+ return new PluginWidget(view);
+
END_BLOCK_OBJC_EXCEPTIONS;
return 0;
@@ -1198,25 +1384,88 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element
void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- [m_webFrame->_private->bridge redirectDataToPlugin:pluginWidget->getView()];
+
+ WebHTMLRepresentation *representation = (WebHTMLRepresentation *)[[m_webFrame.get() _dataSource] representation];
+
+ NSView *pluginView = pluginWidget->platformWidget();
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ if ([pluginView isKindOfClass:[WebBaseNetscapePluginView class]])
+ [representation _redirectDataToManualLoader:(WebBaseNetscapePluginView *)pluginView forPluginView:pluginView];
+ else {
+#else
+ {
+#endif
+ WebHTMLView *documentView = (WebHTMLView *)[[m_webFrame.get() frameView] documentView];
+ ASSERT([documentView isKindOfClass:[WebHTMLView class]]);
+ [representation _redirectDataToManualLoader:[documentView _pluginController] forPluginView:pluginView];
+ }
+
END_BLOCK_OBJC_EXCEPTIONS;
}
-
+
Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, Element* element, const KURL& baseURL,
- const Vector<String>& paramNames, const Vector<String>& paramValues)
+ const Vector<String>& paramNames, const Vector<String>& paramValues)
{
- Widget* result = new Widget;
-
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- WebFrameBridge* bridge = m_webFrame->_private->bridge;
- result->setView([bridge viewForJavaAppletWithFrame:NSMakeRect(0, 0, size.width(), size.height())
- attributeNames:nsArray(paramNames)
- attributeValues:nsArray(paramValues)
- baseURL:baseURL.getNSURL()
- DOMElement:[DOMElement _wrapElement:element]]);
+
+ NSView *view = nil;
+
+ NSString *MIMEType = @"application/x-java-applet";
+
+ WebView *webView = getWebView(m_webFrame.get());
+
+ WebBasePluginPackage *pluginPackage = [webView _pluginForMIMEType:MIMEType];
+
+ if (pluginPackage) {
+ if ([pluginPackage isKindOfClass:[WebPluginPackage class]]) {
+ // For some reason, the Java plug-in requires that we pass the dimension of the plug-in as attributes.
+ NSMutableArray *names = kit(paramNames);
+ NSMutableArray *values = kit(paramValues);
+ if (parameterValue(paramNames, paramValues, "width").isNull()) {
+ [names addObject:@"width"];
+ [values addObject:[NSString stringWithFormat:@"%d", size.width()]];
+ }
+ if (parameterValue(paramNames, paramValues, "height").isNull()) {
+ [names addObject:@"height"];
+ [values addObject:[NSString stringWithFormat:@"%d", size.width()]];
+ }
+ view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, names, values, baseURL, kit(element), NO);
+ }
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
+ view = [[[WebBaseNetscapePluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
+ pluginPackage:(WebNetscapePluginPackage *)pluginPackage
+ URL:nil
+ baseURL:baseURL
+ MIMEType:MIMEType
+ attributeKeys:kit(paramNames)
+ attributeValues:kit(paramValues)
+ loadManually:NO
+ DOMElement:kit(element)] autorelease];
+ } else {
+ ASSERT_NOT_REACHED();
+ }
+#endif
+ }
+
+ if (!view) {
+ NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable
+ contentURL:nil
+ pluginPageURL:nil
+ pluginName:[pluginPackage name]
+ MIMEType:MIMEType];
+ view = [[[WebNullPluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
+ error:error DOMElement:kit(element)] autorelease];
+ [error release];
+ }
+
+ ASSERT(view);
+ return new PluginWidget(view);
+
END_BLOCK_OBJC_EXCEPTIONS;
- return result;
+ return new PluginWidget;
}
String WebFrameLoaderClient::overrideMediaType() const
@@ -1229,7 +1478,22 @@ String WebFrameLoaderClient::overrideMediaType() const
void WebFrameLoaderClient::windowObjectCleared()
{
- [m_webFrame->_private->bridge windowObjectCleared];
+ Frame *frame = core(m_webFrame.get());
+ ScriptController *script = frame->script();
+ WebView *webView = getWebView(m_webFrame.get());
+ WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView);
+ if (implementations->didClearWindowObjectForFrameFunc) {
+ CallFrameLoadDelegate(implementations->didClearWindowObjectForFrameFunc, webView, @selector(webView:didClearWindowObject:forFrame:),
+ script->windowScriptObject(), m_webFrame.get());
+ } else if (implementations->windowScriptObjectAvailableFunc) {
+ CallFrameLoadDelegate(implementations->windowScriptObjectAvailableFunc, webView, @selector(webView:windowScriptObjectAvailable:),
+ script->windowScriptObject());
+ }
+
+ if ([webView scriptDebugDelegate]) {
+ [m_webFrame.get() _detachScriptDebugger];
+ [m_webFrame.get() _attachScriptDebugger];
+ }
}
void WebFrameLoaderClient::registerForIconNotification(bool listen)
@@ -1244,6 +1508,21 @@ void WebFrameLoaderClient::didPerformFirstNavigation() const
[preferences setCacheModel:WebCacheModelDocumentBrowser];
}
+#if ENABLE(MAC_JAVA_BRIDGE)
+jobject WebFrameLoaderClient::javaApplet(NSView* view)
+{
+ if ([view respondsToSelector:@selector(webPlugInGetApplet)])
+ return [view webPlugInGetApplet];
+
+ // Compatibility with older versions of Java.
+ // FIXME: Do we still need this?
+ if ([view respondsToSelector:@selector(pollForAppletInWindow:)])
+ return [view pollForAppletInWindow:[[m_webFrame.get() frameView] window]];
+
+ return 0;
+}
+#endif
+
@implementation WebFramePolicyListener
#ifndef BUILDING_ON_TIGER
@@ -1273,6 +1552,9 @@ void WebFrameLoaderClient::didPerformFirstNavigation() const
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebFramePolicyListener class], self))
+ return;
+
if (m_frame)
m_frame->deref();
[super dealloc];
diff --git a/WebKit/mac/WebCoreSupport/WebImageRendererFactory.m b/WebKit/mac/WebCoreSupport/WebImageRendererFactory.m
index 1219591..36e25b7 100644
--- a/WebKit/mac/WebCoreSupport/WebImageRendererFactory.m
+++ b/WebKit/mac/WebCoreSupport/WebImageRendererFactory.m
@@ -26,9 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// Have to leave this class with these two methods in because old versions of
-// Safari call the methods from the Debug menu. Once we don't need compatibility
-// with those old versions of Safari, we can remove this.
+// Have to leave this class with these two methods in because versions of Safari up to 3.0.4
+// call the methods from the Debug menu. Once we don't need compatibility with those versions
+// of Safari, we can remove this.
@interface WebImageRendererFactory : NSObject
@end
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
index 45cd1f9..6a807c7 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
@@ -31,8 +31,13 @@
#import <wtf/RetainPtr.h>
+#ifdef __OBJC__
@class WebInspectorWindowController;
@class WebView;
+#else
+class WebInspectorWindowController;
+class WebView;
+#endif
class WebInspectorClient : public WebCore::InspectorClient {
public:
@@ -49,10 +54,16 @@ public:
virtual void attachWindow();
virtual void detachWindow();
+ virtual void setAttachedWindowHeight(unsigned height);
+
virtual void highlight(WebCore::Node*);
virtual void hideHighlight();
virtual void inspectedURLChanged(const WebCore::String& newURL);
+ virtual void populateSetting(const WebCore::String& key, WebCore::InspectorController::Setting&);
+ virtual void storeSetting(const WebCore::String& key, const WebCore::InspectorController::Setting&);
+ virtual void removeSetting(const WebCore::String& key);
+
private:
void updateWindowTitle() const;
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index 453cd1a..03d85ae 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,31 +30,25 @@
#import "WebFrameInternal.h"
#import "WebFrameView.h"
+#import "WebInspector.h"
#import "WebLocalizableStrings.h"
#import "WebNodeHighlight.h"
-#import "WebPreferences.h"
-#import "WebTypesInternal.h"
-#import "WebView.h"
+#import "WebUIDelegate.h"
#import "WebViewInternal.h"
-#import "WebViewPrivate.h"
-
-#import <AppKit/NSWindowController.h>
#import <WebCore/InspectorController.h>
#import <WebCore/Page.h>
-#import <WebKit/DOMCore.h>
#import <WebKit/DOMExtensions.h>
#import <WebKitSystemInterface.h>
using namespace WebCore;
-@interface WebInspectorWindowController : NSWindowController {
+@interface WebInspectorWindowController : NSWindowController <NSWindowDelegate> {
@private
WebView *_inspectedWebView;
WebView *_webView;
- NSImageView *_shadowView;
WebNodeHighlight *_currentHighlight;
BOOL _attachedToInspectedWebView;
BOOL _shouldAttach;
@@ -66,7 +60,7 @@ using namespace WebCore;
- (WebView *)webView;
- (void)attach;
- (void)detach;
-- (void)highlightAndScrollToNode:(DOMNode *)node;
+- (void)setAttachedWindowHeight:(unsigned)height;
- (void)highlightNode:(DOMNode *)node;
- (void)hideHighlight;
@end
@@ -94,7 +88,7 @@ Page* WebInspectorClient::createPage()
String WebInspectorClient::localizedStringsURL()
{
- NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"InspectorLocalizedStrings" ofType:@"js"];
+ NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"localizedStrings" ofType:@"js"];
if (path)
return [[NSURL fileURLWithPath:path] absoluteString];
return String();
@@ -121,9 +115,14 @@ void WebInspectorClient::detachWindow()
[m_windowController.get() detach];
}
+void WebInspectorClient::setAttachedWindowHeight(unsigned height)
+{
+ [m_windowController.get() setAttachedWindowHeight:height];
+}
+
void WebInspectorClient::highlight(Node* node)
{
- [m_windowController.get() highlightAndScrollToNode:kit(node)];
+ [m_windowController.get() highlightNode:kit(node)];
}
void WebInspectorClient::hideHighlight()
@@ -145,6 +144,7 @@ void WebInspectorClient::updateWindowTitle() const
#pragma mark -
+#define WebKitInspectorAttachedKey @"WebKitInspectorAttached"
#define WebKitInspectorAttachedViewHeightKey @"WebKitInspectorAttachedViewHeight"
@implementation WebInspectorWindowController
@@ -163,7 +163,6 @@ void WebInspectorClient::updateWindowTitle() const
[preferences setAuthorAndUserStylesEnabled:YES];
[preferences setJavaScriptEnabled:YES];
[preferences setAllowsAnimatedImages:YES];
- [preferences setLoadsImagesAutomatically:YES];
[preferences setPlugInsEnabled:NO];
[preferences setJavaEnabled:NO];
[preferences setUserStyleSheetEnabled:NO];
@@ -175,9 +174,14 @@ void WebInspectorClient::updateWindowTitle() const
[_webView setPreferences:preferences];
[_webView setDrawsBackground:NO];
[_webView setProhibitsMainFrameScrolling:YES];
+ [_webView setUIDelegate:self];
[preferences release];
+ NSNumber *attached = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitInspectorAttachedKey];
+ ASSERT(!attached || [attached isKindOfClass:[NSNumber class]]);
+ _shouldAttach = attached ? [attached boolValue] : YES;
+
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"inspector" ofType:@"html" inDirectory:@"inspector"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL fileURLWithPath:path]];
[[_webView mainFrame] loadRequest:request];
@@ -199,7 +203,7 @@ void WebInspectorClient::updateWindowTitle() const
- (void)dealloc
{
- [_shadowView release];
+ ASSERT(!_currentHighlight);
[_webView release];
[super dealloc];
}
@@ -228,13 +232,13 @@ void WebInspectorClient::updateWindowTitle() const
styleMask |= NSTexturedBackgroundWindowMask;
#endif
- window = [[NSWindow alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 750.0, 650.0) styleMask:styleMask backing:NSBackingStoreBuffered defer:YES];
+ window = [[NSWindow alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 750.0, 650.0) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
[window setDelegate:self];
[window setMinSize:NSMakeSize(400.0, 400.0)];
#ifndef BUILDING_ON_TIGER
[window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
- [window setContentBorderThickness:40. forEdge:NSMaxYEdge];
+ [window setContentBorderThickness:55. forEdge:NSMaxYEdge];
WKNSWindowMakeBottomCornersSquare(window);
#endif
@@ -253,10 +257,7 @@ void WebInspectorClient::updateWindowTitle() const
[_inspectedWebView page]->inspectorController()->setWindowVisible(false);
- [_currentHighlight detachHighlight];
- [_currentHighlight setDelegate:nil];
- [_currentHighlight release];
- _currentHighlight = nil;
+ [self hideHighlight];
return YES;
}
@@ -268,55 +269,31 @@ void WebInspectorClient::updateWindowTitle() const
_visible = NO;
- [_inspectedWebView page]->inspectorController()->setWindowVisible(false);
+ if (!_movingWindows)
+ [_inspectedWebView page]->inspectorController()->setWindowVisible(false);
- if (!_movingWindows) {
- [_currentHighlight detachHighlight];
- [_currentHighlight setDelegate:nil];
- [_currentHighlight release];
- _currentHighlight = nil;
- }
+ [self hideHighlight];
if (_attachedToInspectedWebView) {
if ([_inspectedWebView _isClosed])
return;
- WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
+ [_webView removeFromSuperview];
+ WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
NSRect frameViewRect = [frameView frame];
- NSRect finalFrameViewRect = NSMakeRect(0, 0, NSWidth(frameViewRect), NSHeight([_inspectedWebView frame]));
- NSMutableDictionary *frameViewAnimationInfo = [[NSMutableDictionary alloc] init];
- [frameViewAnimationInfo setObject:frameView forKey:NSViewAnimationTargetKey];
- [frameViewAnimationInfo setObject:[NSValue valueWithRect:finalFrameViewRect] forKey:NSViewAnimationEndFrameKey];
-
- ASSERT(_shadowView);
- NSRect shadowFrame = [_shadowView frame];
- shadowFrame = NSMakeRect(0, NSMinY(frameViewRect) - NSHeight(shadowFrame), NSWidth(frameViewRect), NSHeight(shadowFrame));
- [_shadowView setFrame:shadowFrame];
-
- [_shadowView removeFromSuperview];
- [_inspectedWebView addSubview:_shadowView positioned:NSWindowAbove relativeTo:_webView];
- NSRect finalShadowRect = NSMakeRect(0, -NSHeight(shadowFrame), NSWidth(shadowFrame), NSHeight(shadowFrame));
- NSMutableDictionary *shadowAnimationInfo = [[NSMutableDictionary alloc] init];
- [shadowAnimationInfo setObject:_shadowView forKey:NSViewAnimationTargetKey];
- [shadowAnimationInfo setObject:[NSValue valueWithRect:finalShadowRect] forKey:NSViewAnimationEndFrameKey];
+ // Setting the height based on the previous height is done to work with
+ // Safari's find banner. This assumes the previous height is the Y origin.
+ frameViewRect.size.height += NSMinY(frameViewRect);
+ frameViewRect.origin.y = 0.0;
- NSArray *animationInfo = [[NSArray alloc] initWithObjects:frameViewAnimationInfo, shadowAnimationInfo, nil];
- [frameViewAnimationInfo release];
- [shadowAnimationInfo release];
+ [frameView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+ [frameView setFrame:frameViewRect];
- NSViewAnimation *slideAnimation = [[NSViewAnimation alloc] initWithViewAnimations:animationInfo]; // released in animationDidEnd
- [animationInfo release];
-
- [slideAnimation setAnimationBlockingMode:NSAnimationBlocking];
- [slideAnimation setDelegate:self];
-
- [[_inspectedWebView window] display]; // display once to make sure we start in a good state
- [slideAnimation startAnimation];
- } else {
+ [_inspectedWebView displayIfNeeded];
+ } else
[super close];
- }
}
- (IBAction)showWindow:(id)sender
@@ -329,63 +306,18 @@ void WebInspectorClient::updateWindowTitle() const
_visible = YES;
- [_inspectedWebView page]->inspectorController()->setWindowVisible(true);
-
if (_shouldAttach) {
WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
- NSRect frameViewRect = [frameView frame];
- float attachedHeight = [[NSUserDefaults standardUserDefaults] integerForKey:WebKitInspectorAttachedViewHeightKey];
- attachedHeight = MAX(300.0, MIN(attachedHeight, (NSHeight(frameViewRect) * 0.6)));
-
[_webView removeFromSuperview];
- [_inspectedWebView addSubview:_webView positioned:NSWindowBelow relativeTo:(NSView*)frameView];
- [_webView setFrame:NSMakeRect(0, 0, NSWidth(frameViewRect), attachedHeight)];
- [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMaxYMargin)];
+ [_inspectedWebView addSubview:_webView positioned:NSWindowBelow relativeTo:(NSView *)frameView];
+ [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMaxYMargin)];
[frameView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMinYMargin)];
- NSRect finalFrameViewRect = NSMakeRect(0, attachedHeight, NSWidth(frameViewRect), NSHeight(frameViewRect) - attachedHeight);
- NSMutableDictionary *frameViewAnimationInfo = [[NSMutableDictionary alloc] init];
- [frameViewAnimationInfo setObject:frameView forKey:NSViewAnimationTargetKey];
- [frameViewAnimationInfo setObject:[NSValue valueWithRect:finalFrameViewRect] forKey:NSViewAnimationEndFrameKey];
-
- if (!_shadowView) {
- NSString *imagePath = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"attachedShadow" ofType:@"png" inDirectory:@"inspector/Images"];
- NSImage *image = [[NSImage alloc] initWithContentsOfFile:imagePath];
- _shadowView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, -[image size].height, NSWidth(frameViewRect), [image size].height)];
- [_shadowView setImage:image];
- [_shadowView setImageScaling:NSScaleToFit];
- [_shadowView setImageFrameStyle:NSImageFrameNone];
- [_shadowView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMaxYMargin)];
- }
-
- NSRect shadowFrame = [_shadowView frame];
- shadowFrame = NSMakeRect(0, -NSHeight(shadowFrame), NSWidth(frameViewRect), NSHeight(shadowFrame));
- [_shadowView setFrame:shadowFrame];
-
- [_shadowView removeFromSuperview];
- [_inspectedWebView addSubview:_shadowView positioned:NSWindowAbove relativeTo:_webView];
-
- NSRect finalShadowRect = NSMakeRect(0, attachedHeight - NSHeight(shadowFrame), NSWidth(shadowFrame), NSHeight(shadowFrame));
- NSMutableDictionary *shadowAnimationInfo = [[NSMutableDictionary alloc] init];
- [shadowAnimationInfo setObject:_shadowView forKey:NSViewAnimationTargetKey];
- [shadowAnimationInfo setObject:[NSValue valueWithRect:finalShadowRect] forKey:NSViewAnimationEndFrameKey];
-
- NSArray *animationInfo = [[NSArray alloc] initWithObjects:frameViewAnimationInfo, shadowAnimationInfo, nil];
- [frameViewAnimationInfo release];
- [shadowAnimationInfo release];
-
- NSViewAnimation *slideAnimation = [[NSViewAnimation alloc] initWithViewAnimations:animationInfo]; // released in animationDidEnd
- [animationInfo release];
-
- [slideAnimation setAnimationBlockingMode:NSAnimationBlocking];
- [slideAnimation setDelegate:self];
-
_attachedToInspectedWebView = YES;
- [[_inspectedWebView window] display]; // display once to make sure we start in a good state
- [slideAnimation startAnimation];
+ [self setAttachedWindowHeight:[[NSUserDefaults standardUserDefaults] integerForKey:WebKitInspectorAttachedViewHeightKey]];
} else {
_attachedToInspectedWebView = NO;
@@ -397,6 +329,8 @@ void WebInspectorClient::updateWindowTitle() const
[super showWindow:nil];
}
+
+ [_inspectedWebView page]->inspectorController()->setWindowVisible(true, _shouldAttach);
}
#pragma mark -
@@ -407,14 +341,14 @@ void WebInspectorClient::updateWindowTitle() const
return;
_shouldAttach = YES;
+ _movingWindows = YES;
- if (_visible) {
- _movingWindows = YES;
- [self close];
- _movingWindows = NO;
- }
-
+ [self close];
[self showWindow:nil];
+
+ _movingWindows = NO;
+
+ [[NSUserDefaults standardUserDefaults] setBool:YES forKey:WebKitInspectorAttachedKey];
}
- (void)detach
@@ -423,42 +357,40 @@ void WebInspectorClient::updateWindowTitle() const
return;
_shouldAttach = NO;
+ _movingWindows = YES;
- if (_visible) {
- _movingWindows = YES; // set back to NO in animationDidEnd
- [self close];
- } else {
- [self showWindow:nil];
- }
+ [self close];
+ [self showWindow:nil];
+
+ _movingWindows = NO;
+
+ [[NSUserDefaults standardUserDefaults] setBool:NO forKey:WebKitInspectorAttachedKey];
}
-#pragma mark -
+- (void)setAttachedWindowHeight:(unsigned)height
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:height forKey:WebKitInspectorAttachedViewHeightKey];
-- (void)highlightAndScrollToNode:(DOMNode *)node
-{
- NSRect bounds = [node boundingBox];
- if (!NSIsEmptyRect(bounds)) {
- // FIXME: this needs to use the frame the node coordinates are in
- NSRect visible = [[[[_inspectedWebView mainFrame] frameView] documentView] visibleRect];
- BOOL needsScroll = !NSContainsRect(visible, bounds) && !NSContainsRect(bounds, visible);
-
- // only scroll if the bounds isn't in the visible rect and dosen't contain the visible rect
- if (needsScroll) {
- // scroll to the parent element if we aren't focused on an element
- DOMElement *element;
- if ([node isKindOfClass:[DOMElement class]])
- element = (DOMElement *)node;
- else
- element = (DOMElement *)[node parentNode];
- [element scrollIntoViewIfNeeded:YES];
-
- // give time for the scroll to happen
- [self performSelector:@selector(highlightNode:) withObject:node afterDelay:0.25];
- } else
- [self highlightNode:node];
- }
+ if (!_attachedToInspectedWebView)
+ return;
+
+ WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
+ NSRect frameViewRect = [frameView frame];
+
+ CGFloat attachedHeight = round(MAX(250.0, MIN(height, (NSHeight([_inspectedWebView frame]) * 0.75))));
+
+ // Setting the height based on the difference is done to work with
+ // Safari's find banner. This assumes the previous height is the Y origin.
+ CGFloat heightDifference = (NSMinY(frameViewRect) - attachedHeight);
+ frameViewRect.size.height += heightDifference;
+ frameViewRect.origin.y = attachedHeight;
+
+ [_webView setFrame:NSMakeRect(0.0, 0.0, NSWidth(frameViewRect), attachedHeight)];
+ [frameView setFrame:frameViewRect];
}
+#pragma mark -
+
- (void)highlightNode:(DOMNode *)node
{
// The scrollview's content view stays around between page navigations, so target it
@@ -467,41 +399,41 @@ void WebInspectorClient::updateWindowTitle() const
return; // skip the highlight if we have no window (e.g. hidden tab)
if (!_currentHighlight) {
- _currentHighlight = [[WebNodeHighlight alloc] initWithTargetView:view];
+ _currentHighlight = [[WebNodeHighlight alloc] initWithTargetView:view inspectorController:[_inspectedWebView page]->inspectorController()];
[_currentHighlight setDelegate:self];
- [_currentHighlight attachHighlight];
- }
-
- [_currentHighlight show];
-
- [_currentHighlight setHighlightedNode:node];
-
- // FIXME: this is a hack until we hook up a didDraw and didScroll call in WebHTMLView
- [[_currentHighlight highlightView] setNeedsDisplay:YES];
+ [_currentHighlight attach];
+ } else
+ [[_currentHighlight highlightView] setNeedsDisplay:YES];
}
- (void)hideHighlight
{
- if (!_currentHighlight)
- return;
- [_currentHighlight hide];
- [_currentHighlight setHighlightedNode:nil];
+ [_currentHighlight detach];
+ [_currentHighlight setDelegate:nil];
+ [_currentHighlight release];
+ _currentHighlight = nil;
}
#pragma mark -
+#pragma mark WebNodeHighlight delegate
-- (void)animationDidEnd:(NSAnimation*)animation
+- (void)didAttachWebNodeHighlight:(WebNodeHighlight *)highlight
{
- [animation release];
-
- [_shadowView removeFromSuperview];
+ [_inspectedWebView setCurrentNodeHighlight:highlight];
+}
- if (_movingWindows) {
- _movingWindows = NO;
- [self showWindow:nil];
- }
+- (void)willDetachWebNodeHighlight:(WebNodeHighlight *)highlight
+{
+ [_inspectedWebView setCurrentNodeHighlight:nil];
}
+#pragma mark -
+#pragma mark UI delegate
+
+- (NSUInteger)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo
+{
+ return WebDragDestinationActionNone;
+}
#pragma mark -
@@ -510,17 +442,42 @@ void WebInspectorClient::updateWindowTitle() const
// This method is really only implemented to keep any UI elements enabled.
- (void)showWebInspector:(id)sender
{
- [_inspectedWebView page]->inspectorController()->show();
+ [[_inspectedWebView inspector] show:sender];
}
- (void)showErrorConsole:(id)sender
{
- [_inspectedWebView page]->inspectorController()->showConsole();
+ [[_inspectedWebView inspector] showConsole:sender];
+}
+
+- (void)toggleDebuggingJavaScript:(id)sender
+{
+ [[_inspectedWebView inspector] toggleDebuggingJavaScript:sender];
+}
+
+- (void)toggleProfilingJavaScript:(id)sender
+{
+ [[_inspectedWebView inspector] toggleProfilingJavaScript:sender];
}
-- (void)showNetworkTimeline:(id)sender
+- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
- [_inspectedWebView page]->inspectorController()->showTimeline();
+ BOOL isMenuItem = [(id)item isKindOfClass:[NSMenuItem class]];
+ if ([item action] == @selector(toggleDebuggingJavaScript:) && isMenuItem) {
+ NSMenuItem *menuItem = (NSMenuItem *)item;
+ if ([[_inspectedWebView inspector] isDebuggingJavaScript])
+ [menuItem setTitle:UI_STRING("Stop Debugging JavaScript", "title for Stop Debugging JavaScript menu item")];
+ else
+ [menuItem setTitle:UI_STRING("Start Debugging JavaScript", "title for Start Debugging JavaScript menu item")];
+ } else if ([item action] == @selector(toggleProfilingJavaScript:) && isMenuItem) {
+ NSMenuItem *menuItem = (NSMenuItem *)item;
+ if ([[_inspectedWebView inspector] isProfilingJavaScript])
+ [menuItem setTitle:UI_STRING("Stop Profiling JavaScript", "title for Stop Profiling JavaScript menu item")];
+ else
+ [menuItem setTitle:UI_STRING("Start Profiling JavaScript", "title for Start Profiling JavaScript menu item")];
+ }
+
+ return YES;
}
@end
diff --git a/WebKit/mac/WebCoreSupport/WebJavaScriptTextInputPanel.m b/WebKit/mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
index 573dc84..bd1a601 100644
--- a/WebKit/mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
+++ b/WebKit/mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
@@ -28,7 +28,7 @@
#import "WebJavaScriptTextInputPanel.h"
-#import <JavaScriptCore/Assertions.h>
+#import <wtf/Assertions.h>
#import <WebKit/WebNSControlExtras.h>
#import <WebKit/WebNSWindowExtras.h>
diff --git a/WebKit/mac/WebCoreSupport/WebKeyGenerator.m b/WebKit/mac/WebCoreSupport/WebKeyGenerator.m
index 782a6f4..454175e 100644
--- a/WebKit/mac/WebCoreSupport/WebKeyGenerator.m
+++ b/WebKit/mac/WebCoreSupport/WebKeyGenerator.m
@@ -28,9 +28,9 @@
#import <WebKit/WebKeyGenerator.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebLocalizableStrings.h>
#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
@implementation WebKeyGenerator
diff --git a/WebKit/mac/WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm
deleted file mode 100644
index fcb3fbe..0000000
--- a/WebKit/mac/WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm
+++ /dev/null
@@ -1,57 +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 <WebKit/WebNetscapePlugInStreamLoaderClient.h>
-#import <WebCore/NetscapePlugInStreamLoader.h>
-#import <WebCore/ResourceResponse.h>
-
-using namespace WebCore;
-
-void WebNetscapePlugInStreamLoaderClient::didReceiveResponse(NetscapePlugInStreamLoader*, const ResourceResponse& theResponse)
-{
- [m_stream.get() startStreamWithResponse:theResponse.nsURLResponse()];
-}
-
-void WebNetscapePlugInStreamLoaderClient::didReceiveData(NetscapePlugInStreamLoader*, const char* data, int length)
-{
- NSData *nsData = [[NSData alloc] initWithBytesNoCopy:(void*)data length:length freeWhenDone:NO];
- [m_stream.get() receivedData:nsData];
- [nsData release];
-}
-
-void WebNetscapePlugInStreamLoaderClient::didFail(NetscapePlugInStreamLoader*, const ResourceError& error)
-{
- [m_stream.get() destroyStreamWithError:error];
- m_stream = 0;
-}
-
-void WebNetscapePlugInStreamLoaderClient::didFinishLoading(NetscapePlugInStreamLoader*)
-{
- [m_stream.get() finishedLoading];
- m_stream = 0;
-}
diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.m b/WebKit/mac/WebCoreSupport/WebSystemInterface.m
index e20adfd..417f668 100644
--- a/WebKit/mac/WebCoreSupport/WebSystemInterface.m
+++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.m
@@ -39,9 +39,8 @@ void InitWebCoreSystemInterface(void)
if (didInit)
return;
+ INIT(AdvanceDefaultButtonPulseAnimation);
INIT(CGContextGetShouldSmoothFonts);
- INIT(ClearGlyphVector);
- INIT(ConvertCharToGlyphs);
INIT(CreateCustomCFReadStream);
INIT(CreateNSURLConnectionDelegateProxy);
INIT(DrawCapsLockIndicator);
@@ -58,30 +57,15 @@ void InitWebCoreSystemInterface(void)
INIT(DrawMediaSliderThumb);
INIT(DrawMediaUnMuteButton);
INIT(DrawTextFieldCellFocusRing);
- INIT(FontSmoothingModeIsLCD);
- INIT(GetATSStyleGroup);
- INIT(GetCGFontFromNSFont);
INIT(GetExtensionsForMIMEType);
INIT(GetFontInLanguageForCharacter);
INIT(GetFontInLanguageForRange);
- INIT(GetFontMetrics);
INIT(GetGlyphTransformedAdvances);
- INIT(GetGlyphVectorFirstRecord);
- INIT(GetGlyphVectorNumGlyphs);
- INIT(GetGlyphVectorRecordSize);
INIT(GetMIMETypeForExtension);
- INIT(GetNSFontATSUFontId);
- INIT(GetNSURLResponseCalculatedExpiration);
INIT(GetNSURLResponseLastModifiedDate);
- INIT(GetNSURLResponseMustRevalidate);
INIT(GetPreferredExtensionForMIMEType);
INIT(GetWheelEventDeltas);
- INIT(InitializeGlyphVector);
- INIT(NSURLProtocolClassForReqest);
- INIT(PathFromFont);
INIT(PopupMenu);
- INIT(ReleaseStyleGroup);
- INIT(SecondsSinceLastInputEvent);
INIT(SetCGFontRenderingMode);
INIT(SetDragImage);
INIT(SetNSURLConnectionDefersCallbacks);
@@ -92,11 +76,27 @@ void InitWebCoreSystemInterface(void)
INIT(SignalCFReadStreamEnd);
INIT(SignalCFReadStreamError);
INIT(SignalCFReadStreamHasBytes);
- INIT(SupportsMultipartXMixedReplace);
INIT(QTMovieDataRate);
INIT(QTMovieMaxTimeLoaded);
INIT(QTMovieViewSetDrawSynchronously);
-
+#ifndef BUILDING_ON_TIGER
+ INIT(GetGlyphsForCharacters);
+#else
+ INIT(ClearGlyphVector);
+ INIT(ConvertCharToGlyphs);
+ INIT(CopyFullFontName);
+ INIT(GetATSStyleGroup);
+ INIT(GetCGFontFromNSFont);
+ INIT(GetFontMetrics);
+ INIT(GetGlyphVectorFirstRecord);
+ INIT(GetGlyphVectorNumGlyphs);
+ INIT(GetGlyphVectorRecordSize);
+ INIT(GetNSFontATSUFontId);
+ INIT(InitializeGlyphVector);
+ INIT(ReleaseStyleGroup);
+ INIT(SupportsMultipartXMixedReplace);
+#endif
+
didInit = true;
}
diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
index e7174fe..e9cd746 100644
--- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm
+++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
@@ -28,8 +28,6 @@
#import <WebKit/WebViewFactory.h>
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebFrameBridge.h>
#import <WebKit/WebFrameInternal.h>
#import <WebKit/WebViewInternal.h>
#import <WebKit/WebHTMLViewInternal.h>
@@ -39,6 +37,7 @@
#import <WebKit/WebNSViewExtras.h>
#import <WebKit/WebPluginDatabase.h>
#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
@interface NSMenu (WebViewFactoryAdditions)
- (NSMenuItem *)addItemWithTitle:(NSString *)title action:(SEL)action tag:(int)tag;
@@ -71,35 +70,9 @@
return [[WebPluginDatabase sharedDatabase] plugins];
}
-- (NSString *)pluginNameForMIMEType:(NSString *)MIMEType
-{
- return [[[WebPluginDatabase sharedDatabase] pluginForMIMEType:MIMEType] name];
-}
-
-- (void)refreshPlugins:(BOOL)reloadPages
+- (void)refreshPlugins
{
[[WebPluginDatabase sharedDatabase] refresh];
- if (reloadPages) {
- [WebView _makeAllWebViewsPerformSelector:@selector(_reloadForPluginChanges)];
- }
-}
-
-- (BOOL)pluginSupportsMIMEType:(NSString *)MIMEType
-{
- return [[WebPluginDatabase sharedDatabase] pluginForMIMEType:MIMEType] != nil;
-}
-
-- (WebCoreFrameBridge *)bridgeForView:(NSView *)v
-{
- NSView *aView = [v superview];
-
- while (aView) {
- if ([aView isKindOfClass:[WebHTMLView class]]) {
- return [[[(WebHTMLView *)aView _frame] _dataSource] _bridge];
- }
- aView = [aView superview];
- }
- return nil;
}
- (NSString *)inputElementAltText
@@ -451,7 +424,7 @@
- (NSString *)AXWebAreaText
{
- return UI_STRING("web area", "accessibility role description for web area");
+ return UI_STRING("HTML content", "accessibility role description for web area");
}
- (NSString *)AXLinkText
@@ -474,9 +447,59 @@
return UI_STRING("heading", "accessibility role description for headings");
}
+- (NSString *)AXDefinitionListTermText
+{
+ return UI_STRING("term", "term word of a definition");
+}
+
+- (NSString *)AXDefinitionListDefinitionText
+{
+ return UI_STRING("definition", "definition phrase");
+}
+
+- (NSString *)AXButtonActionVerb
+{
+ return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
+}
+
+- (NSString *)AXRadioButtonActionVerb
+{
+ return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
+}
+
+- (NSString *)AXTextFieldActionVerb
+{
+ return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
+}
+
+- (NSString *)AXCheckedCheckBoxActionVerb
+{
+ return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
+}
+
+- (NSString *)AXUncheckedCheckBoxActionVerb
+{
+ return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
+}
+
+- (NSString *)AXLinkActionVerb
+{
+ return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
+}
+
+- (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles
+{
+ return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles];
+}
+
- (NSString *)unknownFileSizeText
{
return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
}
+- (NSString*)imageTitleForFilename:(NSString*)filename width:(int)width height:(int)height
+{
+ return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename, width, height];
+}
+
@end
diff --git a/WebKit/mac/WebInspector/WebInspector.h b/WebKit/mac/WebInspector/WebInspector.h
index ba4911a..c16726d 100644
--- a/WebKit/mac/WebInspector/WebInspector.h
+++ b/WebKit/mac/WebInspector/WebInspector.h
@@ -38,8 +38,20 @@
- (void)webViewClosed;
- (void)show:(id)sender;
- (void)showConsole:(id)sender;
-- (void)showTimeline:(id)sender;
- (void)close:(id)sender;
- (void)attach:(id)sender;
- (void)detach:(id)sender;
+
+- (BOOL)isDebuggingJavaScript;
+- (void)toggleDebuggingJavaScript:(id)sender;
+- (void)startDebuggingJavaScript:(id)sender;
+- (void)stopDebuggingJavaScript:(id)sender;
+
+- (BOOL)isJavaScriptProfilingEnabled;
+- (void)setJavaScriptProfilingEnabled:(BOOL)enabled;
+
+- (BOOL)isProfilingJavaScript;
+- (void)toggleProfilingJavaScript:(id)sender;
+- (void)startProfilingJavaScript:(id)sender;
+- (void)stopProfilingJavaScript:(id)sender;
@end
diff --git a/WebKit/mac/WebInspector/WebInspector.mm b/WebKit/mac/WebInspector/WebInspector.mm
index 352f7a1..c04a56c 100644
--- a/WebKit/mac/WebInspector/WebInspector.mm
+++ b/WebKit/mac/WebInspector/WebInspector.mm
@@ -28,7 +28,6 @@
#import "WebInspector.h"
#import "WebFrameInternal.h"
-#import "WebView.h"
#include <WebCore/Document.h>
#include <WebCore/Frame.h>
@@ -60,13 +59,91 @@ using namespace WebCore;
- (void)showConsole:(id)sender
{
if (Page* page = core(_webView))
- page->inspectorController()->showConsole();
+ page->inspectorController()->showPanel(InspectorController::ConsolePanel);
}
- (void)showTimeline:(id)sender
{
+ // Not used anymore. Remove when a release of Safari non-longer calls this.
+}
+
+- (BOOL)isDebuggingJavaScript
+{
+ if (Page* page = core(_webView))
+ return page->inspectorController()->debuggerEnabled();
+ return NO;
+}
+
+- (void)toggleDebuggingJavaScript:(id)sender
+{
+ if ([self isDebuggingJavaScript])
+ [self stopDebuggingJavaScript:sender];
+ else
+ [self startDebuggingJavaScript:sender];
+}
+
+- (void)startDebuggingJavaScript:(id)sender
+{
+ Page* page = core(_webView);
+ if (!page)
+ return;
+ page->inspectorController()->showPanel(InspectorController::ScriptsPanel);
+ page->inspectorController()->enableDebugger();
+}
+
+- (void)stopDebuggingJavaScript:(id)sender
+{
+ if (Page* page = core(_webView))
+ page->inspectorController()->disableDebugger();
+}
+
+- (BOOL)isProfilingJavaScript
+{
if (Page* page = core(_webView))
- page->inspectorController()->showTimeline();
+ return page->inspectorController()->isRecordingUserInitiatedProfile();
+ return NO;
+}
+
+- (void)toggleProfilingJavaScript:(id)sender
+{
+ if ([self isProfilingJavaScript])
+ [self stopProfilingJavaScript:sender];
+ else
+ [self startProfilingJavaScript:sender];
+}
+
+- (void)startProfilingJavaScript:(id)sender
+{
+ if (Page* page = core(_webView))
+ page->inspectorController()->startUserInitiatedProfiling();
+}
+
+- (void)stopProfilingJavaScript:(id)sender
+{
+ Page* page = core(_webView);
+ if (!page)
+ return;
+ page->inspectorController()->stopUserInitiatedProfiling();
+ page->inspectorController()->showPanel(InspectorController::ProfilesPanel);
+}
+
+- (BOOL)isJavaScriptProfilingEnabled
+{
+ if (Page* page = core(_webView))
+ return page->inspectorController()->profilerEnabled();
+ return NO;
+}
+
+- (void)setJavaScriptProfilingEnabled:(BOOL)enabled
+{
+ Page* page = core(_webView);
+ if (!page)
+ return;
+
+ if (enabled)
+ page->inspectorController()->enableProfiler();
+ else
+ page->inspectorController()->disableProfiler();
}
- (void)close:(id)sender
@@ -89,21 +166,9 @@ using namespace WebCore;
@end
@implementation WebInspector (Obsolete)
-+ (WebInspector *)sharedWebInspector
-{
- // Safari 3 beta calls this method
- static BOOL logged = NO;
- if (!logged) {
- NSLog(@"+[WebInspector sharedWebInspector]: this method is obsolete.");
- logged = YES;
- }
-
- return [[[WebInspector alloc] init] autorelease];
-}
-
+ (WebInspector *)webInspector
{
- // Safari 3 beta calls this method
+ // Safari 3.0 calls this method
static BOOL logged = NO;
if (!logged) {
NSLog(@"+[WebInspector webInspector]: this method is obsolete.");
@@ -115,7 +180,7 @@ using namespace WebCore;
- (void)setWebFrame:(WebFrame *)frame
{
- // Safari 3 beta calls this method
+ // Safari 3.0 calls this method
static BOOL logged = NO;
if (!logged) {
NSLog(@"-[WebInspector setWebFrame:]: this method is obsolete.");
@@ -139,7 +204,7 @@ using namespace WebCore;
- (void)showWindow:(id)sender
{
- // Safari 3 beta calls this method
+ // Safari 3.0 calls this method
static BOOL logged = NO;
if (!logged) {
NSLog(@"-[WebInspector showWindow:]: this method is obsolete.");
diff --git a/WebKit/mac/WebInspector/WebNodeHighlight.h b/WebKit/mac/WebInspector/WebNodeHighlight.h
index b0c11bb..1eb277a 100644
--- a/WebKit/mac/WebInspector/WebNodeHighlight.h
+++ b/WebKit/mac/WebInspector/WebNodeHighlight.h
@@ -27,38 +27,32 @@
*/
@class WebNodeHighlightView;
-@class DOMNode;
+
+namespace WebCore {
+ class InspectorController;
+}
@interface WebNodeHighlight : NSObject {
NSView *_targetView;
NSWindow *_highlightWindow;
WebNodeHighlightView *_highlightView;
- NSAnimation *_fadeInAnimation;
- DOMNode *_highlightNode;
+ WebCore::InspectorController* _inspectorController;
id _delegate;
}
-- (id)initWithTargetView:(NSView *)targetView;
+- (id)initWithTargetView:(NSView *)targetView inspectorController:(WebCore::InspectorController*)inspectorController;
- (void)setDelegate:(id)delegate;
- (id)delegate;
-- (void)attachHighlight;
-- (void)detachHighlight;
-
-- (void)show;
-- (void)hide;
+- (void)attach;
+- (void)detach;
- (NSView *)targetView;
- (WebNodeHighlightView *)highlightView;
-- (void)setHighlightedNode:(DOMNode *)node;
-- (DOMNode *)highlightedNode;
-
-// Controls whether mouse events are ignored (passed to underlying view). By default mouse events are ignored.
-- (BOOL)ignoresMouseEvents;
-- (void)setIgnoresMouseEvents:(BOOL)newValue;
+- (WebCore::InspectorController*)inspectorController;
-- (void)setHolesNeedUpdateInTargetViewRect:(NSRect)rect;
+- (void)setNeedsUpdateInTargetViewRect:(NSRect)rect;
@end
@interface NSObject (WebNodeHighlightDelegate)
diff --git a/WebKit/mac/WebInspector/WebNodeHighlight.m b/WebKit/mac/WebInspector/WebNodeHighlight.m
index 071f0cb..c918d2d 100644
--- a/WebKit/mac/WebInspector/WebNodeHighlight.m
+++ b/WebKit/mac/WebInspector/WebNodeHighlight.m
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,38 +30,26 @@
#import "WebNodeHighlightView.h"
#import "WebNSViewExtras.h"
-#import <JavaScriptCore/Assertions.h>
+#import <WebCore/InspectorController.h>
+#import <wtf/Assertions.h>
-#define FADE_ANIMATION_DURATION 0.2
-
-@interface WebNodeHighlightFadeInAnimation : NSAnimation
-@end
+using namespace WebCore;
@interface WebNodeHighlight (FileInternal)
- (NSRect)_computeHighlightWindowFrame;
- (void)_repositionHighlightWindow;
-- (void)_animateFadeIn:(WebNodeHighlightFadeInAnimation *)animation;
-@end
-
-@implementation WebNodeHighlightFadeInAnimation
-
-- (void)setCurrentProgress:(NSAnimationProgress)progress
-{
- [super setCurrentProgress:progress];
- [(WebNodeHighlight *)[self delegate] _animateFadeIn:self];
-}
-
@end
@implementation WebNodeHighlight
-- (id)initWithTargetView:(NSView *)targetView
+- (id)initWithTargetView:(NSView *)targetView inspectorController:(InspectorController*)inspectorController
{
self = [super init];
if (!self)
return nil;
_targetView = [targetView retain];
+ _inspectorController = inspectorController;
int styleMask = NSBorderlessWindowMask;
NSRect contentRect = [NSWindow contentRectForFrameRect:[self _computeHighlightWindowFrame] styleMask:styleMask];
@@ -72,51 +60,30 @@
[_highlightWindow setReleasedWhenClosed:NO];
_highlightView = [[WebNodeHighlightView alloc] initWithWebNodeHighlight:self];
- [_highlightView setFractionFadedIn:0.0];
[_highlightWindow setContentView:_highlightView];
[_highlightView release];
return self;
}
-- (void)setHighlightedNode:(DOMNode *)node
-{
- id old = _highlightNode;
- _highlightNode = [node retain];
- [old release];
-}
-
-- (DOMNode *)highlightedNode
-{
- return _highlightNode;
-}
-
- (void)dealloc
{
- // FIXME: Bad to do all this work in dealloc. What about under GC?
-
- [self detachHighlight];
-
ASSERT(!_highlightWindow);
ASSERT(!_targetView);
-
- [_fadeInAnimation setDelegate:nil];
- [_fadeInAnimation stopAnimation];
- [_fadeInAnimation release];
-
- [_highlightNode release];
+ ASSERT(!_highlightView);
[super dealloc];
}
-- (void)attachHighlight
+- (void)attach
{
ASSERT(_targetView);
ASSERT([_targetView window]);
ASSERT(_highlightWindow);
- // Disable screen updates so the highlight moves in sync with the view.
- [[_targetView window] disableScreenUpdatesUntilFlush];
+ if (!_highlightWindow || !_targetView || ![_targetView window])
+ return;
+
[[_targetView window] addChildWindow:_highlightWindow ordered:NSWindowAbove];
// Observe both frame-changed and bounds-changed notifications because either one could leave
@@ -138,7 +105,7 @@
return _delegate;
}
-- (void)detachHighlight
+- (void)detach
{
if (!_highlightWindow) {
ASSERT(!_targetView);
@@ -148,9 +115,6 @@
if (_delegate && [_delegate respondsToSelector:@selector(willDetachWebNodeHighlight:)])
[_delegate willDetachWebNodeHighlight:self];
- // FIXME: is this necessary while detaching? Should test.
- [[_targetView window] disableScreenUpdatesUntilFlush];
-
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter removeObserver:self name:NSViewFrameDidChangeNotification object:nil];
[notificationCenter removeObserver:self name:NSViewBoundsDidChangeNotification object:nil];
@@ -169,36 +133,6 @@
_highlightView = nil;
}
-- (void)show
-{
- ASSERT(!_fadeInAnimation);
- if (_fadeInAnimation || [_highlightView fractionFadedIn] == 1.0)
- return;
-
- _fadeInAnimation = [[WebNodeHighlightFadeInAnimation alloc] initWithDuration:FADE_ANIMATION_DURATION animationCurve:NSAnimationEaseInOut];
- [_fadeInAnimation setAnimationBlockingMode:NSAnimationNonblocking];
- [_fadeInAnimation setDelegate:self];
- [_fadeInAnimation startAnimation];
-}
-
-- (void)hide
-{
- [_highlightView setFractionFadedIn:0.0];
-}
-
-- (void)animationDidEnd:(NSAnimation *)animation
-{
- ASSERT(animation == _fadeInAnimation);
- [_fadeInAnimation release];
- _fadeInAnimation = nil;
-}
-
-- (BOOL)ignoresMouseEvents
-{
- ASSERT(_highlightWindow);
- return [_highlightWindow ignoresMouseEvents];
-}
-
- (WebNodeHighlightView *)highlightView
{
return _highlightView;
@@ -210,27 +144,29 @@
_delegate = delegate;
}
-- (void)setHolesNeedUpdateInTargetViewRect:(NSRect)rect
+- (void)setNeedsUpdateInTargetViewRect:(NSRect)rect
{
ASSERT(_targetView);
- [_highlightView setHolesNeedUpdateInRect:[_targetView _web_convertRect:rect toView:_highlightView]];
+ [[_targetView window] disableScreenUpdatesUntilFlush];
+
+ // Mark the whole highlight view as needing display since we don't know what areas
+ // need updated, since the highlight can be larger than the element to show margins.
+ [_highlightView setNeedsDisplay:YES];
- // Redraw highlight view immediately so it updates in sync with the target view
- // if we called disableScreenUpdatesUntilFlush on the target view earlier. This
- // is especially visible when resizing the window.
+ // Redraw highlight view immediately so it updates in sync with the target view.
+ // This is especially visible when resizing the window, scrolling or with DHTML.
[_highlightView displayIfNeeded];
}
-- (void)setIgnoresMouseEvents:(BOOL)newValue
+- (NSView *)targetView
{
- ASSERT(_highlightWindow);
- [_highlightWindow setIgnoresMouseEvents:newValue];
+ return _targetView;
}
-- (NSView *)targetView
+- (InspectorController*)inspectorController
{
- return _targetView;
+ return _inspectorController;
}
@end
@@ -250,7 +186,14 @@
- (void)_repositionHighlightWindow
{
+ // This assertion fires in cases where a new tab is created while the highlight
+ // is showing (<http://bugs.webkit.org/show_bug.cgi?id=14254>)
ASSERT([_targetView window]);
+
+ // Until that bug is fixed, bail out to avoid worse problems where the highlight
+ // moves to a nonsense location.
+ if (![_targetView window])
+ return;
// Disable screen updates so the highlight moves in sync with the view.
[[_targetView window] disableScreenUpdatesUntilFlush];
@@ -258,9 +201,4 @@
[_highlightWindow setFrame:[self _computeHighlightWindowFrame] display:YES];
}
-- (void)_animateFadeIn:(WebNodeHighlightFadeInAnimation *)animation
-{
- [_highlightView setFractionFadedIn:[animation currentValue]];
-}
-
@end
diff --git a/WebKit/mac/WebInspector/WebNodeHighlightView.h b/WebKit/mac/WebInspector/WebNodeHighlightView.h
index 70d1a5a..cb317b8 100644
--- a/WebKit/mac/WebInspector/WebNodeHighlightView.h
+++ b/WebKit/mac/WebInspector/WebNodeHighlightView.h
@@ -30,17 +30,9 @@
@interface WebNodeHighlightView : NSView {
WebNodeHighlight *_webNodeHighlight;
- float _fractionFadedIn;
}
- (id)initWithWebNodeHighlight:(WebNodeHighlight *)webNodeHighlight;
- (WebNodeHighlight *)webNodeHighlight;
- (void)detachFromWebNodeHighlight;
-
-// Value between 0.0 (completely faded out of view) and 1.0 (completely faded into view) that represents
-// the progress of the fading animation.
-- (float)fractionFadedIn;
-- (void)setFractionFadedIn:(float)alpha;
-
-- (void)setHolesNeedUpdateInRect:(NSRect)rect;
@end
diff --git a/WebKit/mac/WebInspector/WebNodeHighlightView.m b/WebKit/mac/WebInspector/WebNodeHighlightView.m
index cd5a7a7..b3cd69e 100644
--- a/WebKit/mac/WebInspector/WebNodeHighlightView.m
+++ b/WebKit/mac/WebInspector/WebNodeHighlightView.m
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2008 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
@@ -28,21 +28,12 @@
#import "WebNodeHighlightView.h"
#import "WebNodeHighlight.h"
-#import "WebNSViewExtras.h"
-#import <WebKit/DOMCore.h>
-#import <WebKit/DOMExtensions.h>
+#import <WebCore/GraphicsContext.h>
+#import <WebCore/InspectorController.h>
+#import <wtf/Assertions.h>
-#import <JavaScriptCore/Assertions.h>
-
-#define OVERLAY_MAX_ALPHA 0.7
-#define OVERLAY_WHITE_VALUE 0.1
-
-#define WHITE_FRAME_THICKNESS 1.0
-
-@interface WebNodeHighlightView (FileInternal)
-- (NSArray *)_holes;
-@end
+using namespace WebCore;
@implementation WebNodeHighlightView
@@ -69,35 +60,19 @@
_webNodeHighlight = nil;
}
+- (BOOL)isFlipped
+{
+ return YES;
+}
+
- (void)drawRect:(NSRect)rect
{
[NSGraphicsContext saveGraphicsState];
- // draw translucent gray fill, out of which we will cut holes
- [[NSColor colorWithCalibratedWhite:OVERLAY_WHITE_VALUE alpha:(_fractionFadedIn * OVERLAY_MAX_ALPHA)] set];
- NSRectFill(rect);
+ ASSERT([[NSGraphicsContext currentContext] isFlipped]);
- // determine set of holes
- NSArray *holes = [self _holes];
- int holeCount = [holes count];
- int holeIndex;
-
- // Draw white frames around holes in first pass, so they will be erased in
- // places where holes overlap or abut.
- [[NSColor colorWithCalibratedWhite:1.0 alpha:_fractionFadedIn] set];
-
- // white frame is just outside of the hole that the delegate returned
- for (holeIndex = 0; holeIndex < holeCount; ++holeIndex) {
- NSRect hole = [[holes objectAtIndex:holeIndex] rectValue];
- hole = NSInsetRect(hole, -WHITE_FRAME_THICKNESS, -WHITE_FRAME_THICKNESS);
- NSRectFill(hole);
- }
-
- [[NSColor clearColor] set];
-
- // Erase holes in second pass.
- for (holeIndex = 0; holeIndex < holeCount; ++holeIndex)
- NSRectFill([[holes objectAtIndex:holeIndex] rectValue]);
+ GraphicsContext context((PlatformGraphicsContext*)[[NSGraphicsContext currentContext] graphicsPort]);
+ [_webNodeHighlight inspectorController]->drawNodeHighlight(context);
[NSGraphicsContext restoreGraphicsState];
}
@@ -107,69 +82,4 @@
return _webNodeHighlight;
}
-- (float)fractionFadedIn
-{
- return _fractionFadedIn;
-}
-
-- (void)setFractionFadedIn:(float)fraction
-{
- ASSERT_ARG(fraction, fraction >= 0.0 && fraction <= 1.0);
-
- if (_fractionFadedIn == fraction)
- return;
-
- _fractionFadedIn = fraction;
- [self setNeedsDisplay:YES];
-}
-
-- (void)setHolesNeedUpdateInRect:(NSRect)rect
-{
- // Redisplay a slightly larger rect to account for white border around holes
- rect = NSInsetRect(rect, -1 * WHITE_FRAME_THICKNESS,
- -1 * WHITE_FRAME_THICKNESS);
-
- [self setNeedsDisplayInRect:rect];
-}
-
-@end
-
-@implementation WebNodeHighlightView (FileInternal)
-
-- (NSArray *)_holes
-{
- DOMNode *node = [_webNodeHighlight highlightedNode];
-
- // FIXME: node view needs to be the correct frame document view, it isn't always the main frame
- NSView *nodeView = [_webNodeHighlight targetView];
-
- NSArray *lineBoxRects = nil;
- if ([node isKindOfClass:[DOMElement class]]) {
- DOMCSSStyleDeclaration *style = [[node ownerDocument] getComputedStyle:(DOMElement *)node pseudoElement:@""];
- if ([[style getPropertyValue:@"display"] isEqualToString:@"inline"])
- lineBoxRects = [node lineBoxRects];
- } else if ([node isKindOfClass:[DOMText class]]) {
-#if ENABLE(SVG)
- if (![[node parentNode] isKindOfClass:NSClassFromString(@"DOMSVGElement")])
-#endif
- lineBoxRects = [node lineBoxRects];
- }
-
- if (![lineBoxRects count]) {
- NSRect boundingBox = [nodeView _web_convertRect:[node boundingBox] toView:self];
- return [NSArray arrayWithObject:[NSValue valueWithRect:boundingBox]];
- }
-
- NSMutableArray *rects = [[NSMutableArray alloc] initWithCapacity:[lineBoxRects count]];
-
- unsigned lineBoxRectCount = [lineBoxRects count];
- for (unsigned lineBoxRectIndex = 0; lineBoxRectIndex < lineBoxRectCount; ++lineBoxRectIndex) {
- NSRect r = [[lineBoxRects objectAtIndex:lineBoxRectIndex] rectValue];
- NSRect overlayViewRect = [nodeView _web_convertRect:r toView:self];
- [rects addObject:[NSValue valueWithRect:overlayViewRect]];
- }
-
- return [rects autorelease];
-}
-
@end
diff --git a/WebKit/mac/WebKit.exp b/WebKit/mac/WebKit.exp
index df5e130..c284ffa 100644
--- a/WebKit/mac/WebKit.exp
+++ b/WebKit/mac/WebKit.exp
@@ -1,6 +1,5 @@
.objc_class_name_WebArchive
.objc_class_name_WebBackForwardList
-.objc_class_name_WebBaseNetscapePluginView
.objc_class_name_WebCache
.objc_class_name_WebCoreScrollView
.objc_class_name_WebCoreStatistics
@@ -35,11 +34,13 @@ _HIWebViewCreate
_HIWebViewGetWebView
_WebActionButtonKey
_WebActionElementKey
+_WebActionFormKey
_WebActionModifierFlagsKey
_WebActionNavigationTypeKey
_WebActionOriginalURLKey
_WebArchivePboardType
_WebConvertNSImageToCGImageRef
+_WebCoreScrollbarAlwaysOn
_WebDatabaseDidModifyDatabaseNotification
_WebDatabaseDidModifyOriginNotification
_WebDatabaseDirectoryDefaultsKey
@@ -91,13 +92,6 @@ _WebPluginWillPresentNativeUserInterfaceNotification
_WebPreferencesChangedNotification
_WebReportAssertionFailure
_WebReportError
-_WebScriptDebugServerDidLoadNotification
-_WebScriptDebugServerProcessBundleIdentifierKey
-_WebScriptDebugServerProcessIdentifierKey
-_WebScriptDebugServerProcessNameKey
-_WebScriptDebugServerQueryNotification
-_WebScriptDebugServerQueryReplyNotification
-_WebScriptDebugServerWillUnloadNotification
_WebScriptErrorDescriptionKey
_WebScriptErrorDomain
_WebScriptErrorLineNumberKey
diff --git a/WebKit/mac/WebKit.order b/WebKit/mac/WebKit.order
index b6db8b4..6bb0178 100644
--- a/WebKit/mac/WebKit.order
+++ b/WebKit/mac/WebKit.order
@@ -29,41 +29,15 @@ __Z13defaultClientv
+[WebHTMLView(WebPrivate) _selectionPasteboardTypes]
+[WebHTMLView(WebPrivate) supportedNonImageMIMETypes]
+[WebHTMLRepresentation supportedNonImageMIMETypes]
-__ZN21WebIconDatabaseClient13performImportEv
-__Z21importToWebCoreFormatv
-+[ThreadEnabler enableThreading]
--[ThreadEnabler threadEnablingSelector:]
-__Z20objectFromPathForKeyP8NSStringP11objc_object
-__Z11stringArrayRKN3WTF7HashSetIN7WebCore6StringENS_7StrHashIS2_EENS_10HashTraitsIS2_EEEE
+__Z11stringArrayRKN3WTF7HashSetIN7WebCore6StringENS1_10StringHashENS_10HashTraitsIS2_EEEE
+[WebPDFView supportedMIMETypes]
+[WebPDFRepresentation supportedMIMETypes]
+[WebPDFRepresentation postScriptMIMETypes]
+[WebDataSource(WebInternal) _repTypesAllowImageTypeOmission:]
-+[WebView(WebPrivate) _minimumRequiredSafariBuildNumber]
--[WebPreferences(WebPrivate) setTextAreasAreResizable:]
--[WebPreferences _setBoolValue:forKey:]
--[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setBool:forKey:]
--[WebIconDatabase(WebInternal) _resetCachedWebPreferences:]
-+[WebView(WebFileInternal) _preferencesChangedNotification:]
--[WebPreferences(WebPrivate) cacheModel]
-+[WebView(WebFileInternal) _didSetCacheModel]
-+[WebView(WebFileInternal) _setCacheModel:]
-_WKCopyFoundationCacheDirectory
-_WebMemorySize
-_initCapabilities
-_WebVolumeFreeSize
--[WebPreferences(WebPrivate) setEditableLinkBehavior:]
--[WebPreferences _setIntegerValue:forKey:]
--[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setInt:forKey:]
-+[WebView(WebFileInternal) _cacheModel]
--[WebPreferences(WebPrivate) setShrinksStandaloneImagesToFit:]
--[WebPreferences(WebPrivate) setCacheModel:]
--[WebPreferences(WebPrivate) setAutomaticallyDetectsCacheModel:]
+[WebView registerURLSchemeAsLocal:]
-_WebLocalizedString
-[WebIconDatabase retainIconForURL:]
-[WebIconDatabase(WebInternal) _isEnabled]
--[WebIconDatabase releaseIconForURL:]
+_WebLocalizedString
-[WebView initWithFrame:frameName:groupName:]
+[WebViewPrivate initialize]
-[WebViewPrivate init]
@@ -80,11 +54,14 @@ _WebKitInitializeLoggingChannelsIfNecessary
_initializeLogChannel
+[WebHistoryItem initialize]
+[WebHistoryItem(WebInternal) initWindowWatcherIfNecessary]
-__ZN15WebChromeClientC1EP7WebView
-__ZN20WebContextMenuClientC1EP7WebView
-__ZN15WebEditorClientC1EP7WebView
-__ZN13WebDragClientC1EP7WebView
-__ZN18WebInspectorClientC1EP7WebView
+__Z36WebKitInitializeDatabasesIfNecessaryv
+__ZN24WebDatabaseTrackerClient30sharedWebDatabaseTrackerClientEv
+__ZN24WebDatabaseTrackerClientC1Ev
+__ZN15WebChromeClientC2EP7WebView
+__ZN20WebContextMenuClientC2EP7WebView
+__ZN15WebEditorClientC2EP7WebView
+__ZN13WebDragClientC2EP7WebView
+__ZN18WebInspectorClientC2EP7WebView
+[WebFrameBridge initialize]
-[WebFrameBridge initMainFrameWithPage:frameName:frameView:]
-[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:]
@@ -92,9 +69,9 @@ __Z3kitPN7WebCore4PageE
-[WebFrame(WebInternal) _initWithWebFrameView:webView:bridge:]
-[WebFramePrivate setWebFrameView:]
-[WebFrameView(WebInternal) _setWebFrame:]
-__ZN20WebFrameLoaderClientC1EP8WebFrame
+__ZN20WebFrameLoaderClientC2EP8WebFrame
__ZN20WebFrameLoaderClient20createDocumentLoaderERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE
-__ZN20WebDocumentLoaderMacC1ERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE
+__ZN20WebDocumentLoaderMacC2ERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE
-[WebDataSource(WebInternal) _initWithDocumentLoader:]
+[WebDataSourcePrivate initialize]
__Z10getWebViewP8WebFrame
@@ -112,9 +89,11 @@ __ZN20WebFrameLoaderClient17setCopiesOnScrollEv
__ZN20WebFrameLoaderClient31prepareForDataSourceReplacementEv
-[WebFrame(WebInternal) _dataSource]
-[WebFrame(WebInternal) _frameLoader]
-__ZN20WebFrameLoaderClient16makeDocumentViewEv
+__ZN20WebFrameLoaderClient31transitionToCommittedForNewPageEv
__ZNK20WebDocumentLoaderMac10dataSourceEv
+-[WebDataSource(WebPrivate) _responseMIMEType]
-[WebDataSource response]
+-[WebDataSource(WebFileInternal) _MIMETypeOfResponse:]
+[WebFrameView(WebInternal) _viewClassForMIMEType:]
+[WebView(WebPrivate) _viewClass:andRepresentationClass:forMIMEType:]
-[NSDictionary(WebNSDictionaryExtras) _webkit_objectForMIMEType:]
@@ -176,8 +155,6 @@ __ZN20WebFrameLoaderClient21forceLayoutForNonHTMLEv
+[WebView canShowMIMETypeAsHTML:]
+[WebFrameView(WebInternal) _canShowMIMETypeAsHTML:]
__ZNK20WebFrameLoaderClient17overrideMediaTypeEv
--[WebFrameBridge overrideMediaType]
--[WebFrameBridge webView]
-[WebView mediaStyle]
-[WebView textSizeMultiplier]
-[WebView(AllWebViews) _addToAllWebViewsSet]
@@ -186,12 +163,19 @@ __ZNK20WebFrameLoaderClient17overrideMediaTypeEv
+[NSPasteboard(WebExtras) _web_dragTypesForURL]
+[WebView(WebPrivate) _scriptDebuggerEnabled]
-[WebView preferences]
+-[WebIconDatabase(WebInternal) _resetCachedWebPreferences:]
++[WebView(WebFileInternal) _preferencesChangedNotification:]
+-[WebPreferences cacheModel]
++[WebView(WebFileInternal) _didSetCacheModel]
++[WebView(WebFileInternal) _setCacheModel:]
+_WKCopyFoundationCacheDirectory
+_WebMemorySize
+_initCapabilities
+_WebVolumeFreeSize
-[WebView(WebPrivate) _preferencesChangedNotification:]
-[WebPreferences(WebPrivate) _useSiteSpecificSpoofing]
-[WebPreferences cursiveFontFamily]
-[WebPreferences _stringValueForKey:]
--[WebHTMLView setNeedsToApplyStyles:]
--[WebHTMLView setNeedsLayout:]
-[WebPreferences defaultFixedFontSize]
-[WebPreferences defaultFontSize]
-[WebPreferences defaultTextEncodingName]
@@ -218,20 +202,22 @@ __Z4core26WebKitEditableLinkBehavior
-[WebView(WebPrivate) usesPageCache]
-[WebPreferences usesPageCache]
-[WebPreferences(WebPrivate) showsURLsInToolTips]
-+[WebView(WebPrivate) _developerExtrasEnabled]
+-[WebPreferences(WebPrivate) developerExtrasEnabled]
+-[WebPreferences(WebPrivate) authorAndUserStylesEnabled]
-[WebPreferences userStyleSheetEnabled]
-[WebView(WebPrivate) _needsAdobeFrameReloadingQuirk]
_WKAppVersionCheckLessThan
+-[WebView(WebPrivate) _needsKeyboardEventDisambiguationQuirks]
-[WebView setMaintainsBackForwardList:]
-[WebView setUIDelegate:]
-[WebView backForwardList]
__Z3kitPN7WebCore15BackForwardListE
__Z16backForwardListsv
-__ZZN3WTF22HashTableConstIteratorIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_EppEvE8__func__
+[WebBackForwardList initialize]
-[WebBackForwardList(WebBackForwardListInternal) initWithBackForwardList:]
__Z4coreP18WebBackForwardList
-__ZN3WTF7HashMapIPN7WebCore15BackForwardListEP18WebBackForwardListNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE6removeERKS3_
+__ZNK3WTF7HashMapIPN7WebCore15BackForwardListEP18WebBackForwardListNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3getERKS3_
+__ZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E47removeAndInvalidateWithoutEntryConsistencyCheckEPS2_
-[WebBackForwardList setCapacity:]
-[WebView setFrameLoadDelegate:]
-[WebView(WebPrivate) _cacheFrameLoadDelegateImplementations]
@@ -247,6 +233,7 @@ __ZN3WTF7HashMapIPN7WebCore15BackForwardListEP18WebBackForwardListNS_7PtrHashIS3
+[WebStringTruncator initialize]
+[WebStringTruncator centerTruncateString:toWidth:withFont:]
__Z14fontFromNSFontP6NSFont
+_WKGetCGFontFromNSFont
_WKGetNSFontATSUFontId
_WKGetATSStyleGroup
_WKGetFontMetrics
@@ -258,12 +245,10 @@ _WKGetGlyphVectorRecordSize
_WKClearGlyphVector
_WKGetGlyphTransformedAdvances
-[WebIconDatabase defaultIconWithSize:]
--[WebView(WebIBActions) canGoBack]
--[WebView(WebIBActions) canGoForward]
--[WebFrame dataSource]
--[WebFrame provisionalDataSource]
-[WebFrameView setFrameSize:]
-[WebFrameView webFrame]
+-[WebFrame provisionalDataSource]
+-[WebFrame dataSource]
-[WebView viewWillMoveToWindow:]
_WKSetNSWindowShouldPostEventNotifications
-[WebHTMLView viewWillMoveToWindow:]
@@ -271,13 +256,14 @@ _WKSetNSWindowShouldPostEventNotifications
_WKMouseMovedNotification
-[WebHTMLView removeWindowObservers]
-[WebHTMLView(WebHTMLViewFileInternal) _cancelUpdateMouseoverTimer]
--[WebHTMLView(WebHTMLViewFileInternal) _cancelUpdateActiveStateTimer]
+-[WebHTMLView(WebHTMLViewFileInternal) _cancelUpdateFocusedAndActiveStateTimer]
-[WebHTMLView(WebPrivate) _pluginController]
-[WebPluginController stopAllPlugins]
-[WebHTMLView viewDidMoveToWindow]
-[WebHTMLView(WebPrivate) _stopAutoscrollTimer]
-[WebHTMLView addWindowObservers]
-[WebHTMLView(WebPrivate) _frameOrBoundsChanged]
+-[WebHTMLView setNeedsLayout:]
-[WebPluginController startAllPlugins]
-[WebIconDatabase iconForURL:withSize:]
-[WebIconDatabase iconForURL:withSize:cache:]
@@ -292,7 +278,7 @@ _WKMouseMovedNotification
__Z12mapHostNamesP8NSStringa
+[NSURL(WebNSURLExtras) _web_URLWithData:relativeToURL:]
-[NSURL(WebNSURLExtras) _webkit_canonicalize]
-_WKNSURLProtocolClassForReqest
+_WKNSURLProtocolClassForRequest
-[NSURL(WebNSURLExtras) _web_originalDataAsString]
+[NSURL(WebNSURLExtras) _web_URLWithDataAsString:]
+[NSURL(WebNSURLExtras) _web_URLWithDataAsString:relativeToURL:]
@@ -328,6 +314,7 @@ __ZNK20WebFrameLoaderClient16canHandleRequestERKN7WebCore15ResourceRequestE
__ZN15WebChromeClient30canRunBeforeUnloadConfirmPanelEv
-[WebView UIDelegate]
__ZN20WebFrameLoaderClient22clearArchivedResourcesEv
+__ZN3WTF9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_E47removeAndInvalidateWithoutEntryConsistencyCheckEPS5_
__ZN20WebFrameLoaderClient27willChangeEstimatedProgressEv
-[WebView(WebPrivate) _willChangeValueForKey:]
-[WebView(WebPrivate) observationInfo]
@@ -351,23 +338,21 @@ __Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_
-[NSString(WebNSURLExtras) _web_mapHostNameWithRange:encode:makeString:]
-[WebDataSource unreachableURL]
-[NSString(WebKitExtras) _webkit_isCaseInsensitiveEqualToString:]
--[NSURL(WebNSURLExtras) _web_userVisibleString]
--[NSURL(WebNSURLExtras) _web_originalData]
__ZN20WebFrameLoaderClient32assignIdentifierToInitialRequestEmPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestE
__Z45WebViewGetResourceLoadDelegateImplementationsP7WebView
-__Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_iS0_
-__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_iS0_
-[WebView(WebViewInternal) _addObject:forIdentifier:]
-__ZN3WTF7HashMapImNS_9RetainPtrIP11objc_objectEENS_7IntHashImEENS_10HashTraitsImEENS7_IS4_EEE6removeENS_24HashTableIteratorAdapterINS_9HashTableImSt4pairImS4_ENS_18PairFirstExtractorISE_EES6_NS_14PairHashTraitsIS8_S9_EES8_EESE_EE
+__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E3addImS5_NS_17HashMapTranslatorILb1ES6_NS_18PairBaseHashTraitsISD_SE_EESF_SA_EEEES1_INS_17HashTableIteratorImS6_S8_SA_SF_SD_EEbERKT_RKT0_
+__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E47removeAndInvalidateWithoutEntryConsistencyCheckEPS6_
__ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE
__ZN20WebDocumentLoaderMac17increaseLoadCountEm
__ZNK3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E8containsImNS_22IdentityHashTranslatorImmS4_EEEEbRKT_
__ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE3addERKm
-__ZZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E8reinsertERmE8__func__
+__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E3addImmNS_17HashSetTranslatorILb1EmS6_S6_S4_EEEESt4pairINS_17HashTableIteratorImmS2_S4_S6_S6_EEbERKT_RKT0_
+__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E6expandEv
-[WebView(WebViewInternal) _objectForIdentifier:]
-__ZZNK3WTF22HashTableConstIteratorImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E13checkValidityEvE8__func__
-__ZZN3WTF9HashTableIPN7WebCore10StringImplESt4pairIS3_iENS_18PairFirstExtractorIS5_EENS_19CaseInsensitiveHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSB_IiEEEESC_E8reinsertERS5_E8__func__
-__ZN3WTF23HashTableRefCounterBaseILb1ENS_9HashTableIPN7WebCore10StringImplESt4pairIS4_iENS_18PairFirstExtractorIS6_EENS_19CaseInsensitiveHashIS4_EENS_14PairHashTraitsINS_10HashTraitsIS4_EENSC_IiEEEESD_EENS_18PairBaseHashTraitsINSC_INS2_6StringEEESJ_EEE6refAllERSG_
+__ZN3WTF7HashMapImNS_9RetainPtrIP11objc_objectEENS_7IntHashImEENS_10HashTraitsImEENS7_IS4_EEE3setERKmRKS4_
+__ZN3WTF23HashTableRefCounterBaseILb1ENS_9HashTableIPN7WebCore10StringImplESt4pairIS4_iENS_18PairFirstExtractorIS6_EENS2_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS4_EENSB_IiEEEESC_EENS_18PairBaseHashTraitsINSB_INS2_6StringEEESI_EEE6refAllERSF_
+__ZN3WTF9HashTableIPN7WebCore10StringImplESt4pairIS3_iENS_18PairFirstExtractorIS5_EENS1_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS3_EENSA_IiEEEESB_EC1ERKSE_
__ZNK20WebFrameLoaderClient32representationExistsForURLSchemeERKN7WebCore6StringE
+[WebView(WebPrivate) _representationExistsForURLScheme:]
_WKCreateNSURLConnectionDelegateProxy
@@ -383,12 +368,13 @@ _WKCreateNSURLConnectionDelegateProxy
-[WebFrame(WebInternal) _viewDidMoveToHostWindow]
-[WebHTMLView viewDidMoveToHostWindow]
-[WebPreferences(WebPrivate) setRespectStandardStyleKeyEquivalents:]
-+[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_defaultsDidChange]
+-[WebPreferences _setBoolValue:forKey:]
-[WebPreferences setPrivateBrowsingEnabled:]
-[WebPreferences(WebPrivate) setDOMPasteAllowed:]
+[WebPreferences(WebPrivate) _setInitialDefaultTextEncodingToSystemEncoding]
+[WebPreferences(WebPrivate) _systemCFStringEncoding]
_WKGetWebDefaultCFStringEncoding
++[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_defaultsDidChange]
-[WebHistory init]
+[WebHistoryPrivate initialize]
-[WebHistoryPrivate init]
@@ -399,21 +385,33 @@ _WKGetWebDefaultCFStringEncoding
-[WebHistory loadFromURL:error:]
-[WebHistoryPrivate loadFromURL:collectDiscardedItemsInto:error:]
-[WebHistoryPrivate _loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]
+-[WebHistoryPrivate historyItemLimit]
+-[WebHistoryPrivate _ageLimitDate]
+-[WebHistoryPrivate historyAgeInDaysLimit]
+-[WebHistoryItem(WebInternal) initFromDictionaryRepresentation:]
+-[NSDictionary(WebNSDictionaryExtras) _webkit_stringForKey:]
+-[WebHistoryItem(WebInternal) initWithURLString:title:displayTitle:lastVisitedTimeInterval:]
+-[WebHistoryItem(WebInternal) initWithWebCoreHistoryItem:]
+__Z19historyItemWrappersv
+__ZNK3WTF7HashMapIPN7WebCore11HistoryItemEP14WebHistoryItemNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3getERKS3_
+-[NSDictionary(WebNSDictionaryExtras) _webkit_intForKey:]
+-[NSDictionary(WebNSDictionaryExtras) _webkit_numberForKey:]
+-[WebHistoryItem URLString]
+-[WebHistoryItem lastVisitedTimeInterval]
+-[WebHistoryPrivate addItem:]
+-[WebHistoryPrivate _addItemToDateCaches:]
+-[WebHistoryPrivate findKey:forDay:]
+__Z29timeIntervalForBeginningOfDayd
+__ZNK3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E8containsIxNS_22IdentityHashTranslatorIxS5_S9_EEEEbRKT_
+__ZNK3WTF7HashMapIxNS_9RetainPtrI14NSMutableArrayEENS_7IntHashIyEENS_10HashTraitsIxEENS6_IS3_EEE3getERKx
+__ZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E3addIxS4_NS_17HashMapTranslatorILb1ES5_NS_18PairBaseHashTraitsISC_SD_EESE_S9_EEEES1_INS_17HashTableIteratorIxS5_S7_S9_SE_SC_EEbERKT_RKT0_
+__ZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E47removeAndInvalidateWithoutEntryConsistencyCheckEPS5_
+-[WebHistoryPrivate insertItem:forDateKey:]
+[WebHistory setOptionalSharedHistory:]
-[_WebCoreHistoryProvider initWithHistory:]
+[WebIconDatabase allowDatabaseCleanup]
-[WebBackForwardList dealloc]
-__ZN3WTF17HashTableIteratorIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_EppEv
-__ZZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E8reinsertERS2_E8__func__
-__Z29_updateMouseoverTimerCallbackP16__CFRunLoopTimerPv
--[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent]
--[WebHTMLView(WebPrivate) _updateMouseoverWithEvent:]
--[WebHTMLView(WebPrivate) hitTest:]
-__Z31_updateActiveStateTimerCallbackP16__CFRunLoopTimerPv
--[WebHTMLView(WebPrivate) _updateActiveState]
--[WebHTMLView(WebInternal) _frame]
--[WebView estimatedProgress]
-__ZN20WebFrameLoaderClient50dispatchDidReceiveServerRedirectForProvisionalLoadEv
+__ZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E4findIiNS_22IdentityHashTranslatorIiS2_S6_EEEENS_17HashTableIteratorIiS2_S4_S6_SA_S9_EERKT_
__ZN20WebFrameLoaderClient31dispatchDecidePolicyForMIMETypeEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_6StringERKNS0_15ResourceRequestE
+[WebView canShowMIMEType:]
__ZNK20WebFrameLoaderClient15canShowMIMETypeERKN7WebCore6StringE
@@ -433,22 +431,14 @@ __ZN20WebFrameLoaderClient34updateGlobalHistoryForStandardLoadERKN7WebCore4KURLE
-[WebHistory addItemForURL:]
-[WebHistoryItem(WebPrivate) initWithURL:title:]
-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]
--[WebHistoryItem(WebInternal) initWithWebCoreHistoryItem:]
-__Z19historyItemWrappersv
-__ZN3WTF7HashMapIPN7WebCore11HistoryItemEP14WebHistoryItemNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3setERKS3_RKS5_
-[WebHistoryItem(WebPrivate) _setLastVisitedTimeInterval:]
-[WebHistory addItem:]
--[WebHistoryPrivate addItem:]
--[WebHistoryItem URLString]
--[WebHistoryPrivate _addItemToDateCaches:]
--[WebHistoryItem lastVisitedTimeInterval]
--[WebHistoryPrivate findKey:forDay:]
-__Z29timeIntervalForBeginningOfDayd
-__ZNK3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E8containsIxNS_22IdentityHashTranslatorIxS5_S9_EEEEbRKT_
-__ZN3WTF7HashMapIxNS_9RetainPtrI14NSMutableArrayEENS_7IntHashIyEENS_10HashTraitsIxEENS6_IS3_EEE3setERKxRKS3_
-__ZZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E8reinsertERS5_E8__func__
+-[WebHistoryPrivate removeItemForURLString:]
+-[WebHistoryPrivate _removeItemFromDateCaches:]
+__ZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E4findIxNS_22IdentityHashTranslatorIxS5_S9_EEEENS_17HashTableIteratorIxS5_S7_S9_SE_SC_EERKT_
+-[WebHistoryItem(WebInternal) _mergeAutoCompleteHints:]
+-[WebHistoryItem dealloc]
-[WebHistory _sendNotification:entries:]
--[WebHistoryItem hash]
__Z26WKNotifyHistoryItemChangedv
-[WebDynamicScrollBarsView setScrollBarsSuppressed:repaintOnUnsuppress:]
-[WebDataSource dealloc]
@@ -471,9 +461,15 @@ __Z3kitPN7WebCore11HistoryItemE
-[WebHTMLView acceptsFirstResponder]
-[WebHTMLView becomeFirstResponder]
-[WebView(WebPrivate) _isPerformingProgrammaticFocus]
+-[WebHTMLView(WebPrivate) _updateFocusedAndActiveState]
+-[WebHTMLView(WebInternal) _frame]
-[WebHTMLView(WebInternal) _updateFontPanel]
-[WebHTMLView(WebPrivate) _canEdit]
-[WebHTMLView _arrowKeyDownEventSelectorIfPreprocessing]
+-[NSURL(WebNSURLExtras) _web_userVisibleString]
+-[NSURL(WebNSURLExtras) _web_originalData]
+__Z10isHexDigitc
+__Z13hexDigitValuec
__ZN20WebFrameLoaderClient15willChangeTitleEPN7WebCore14DocumentLoaderE
__ZN20WebFrameLoaderClient14didChangeTitleEPN7WebCore14DocumentLoaderE
__ZN20WebFrameLoaderClient8setTitleERKN7WebCore6StringERKNS0_4KURLE
@@ -483,42 +479,8 @@ __ZN20WebFrameLoaderClient8setTitleERKN7WebCore6StringERKNS0_4KURLE
-[WebHistoryItem(WebInternal) setTitle:]
__ZN20WebFrameLoaderClient23dispatchDidReceiveTitleERKN7WebCore6StringE
__Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_
-__ZNK20WebFrameLoaderClient14willUseArchiveEPN7WebCore14ResourceLoaderERKNS0_15ResourceRequestERKNS0_4KURLE
-__ZNK20WebFrameLoaderClient22canUseArchivedResourceEP12NSURLRequest
--[WebDataSource(WebInternal) _archivedSubresourceForURL:]
--[WebHTMLView dataSourceUpdated:]
-__ZN20WebFrameLoaderClient39postProgressEstimateChangedNotificationEv
-__ZN20WebFrameLoaderClient31dispatchDidReceiveContentLengthEPN7WebCore14DocumentLoaderEmi
-__Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_iS0_
-__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_iS0_
-__ZNK20WebFrameLoaderClient17willCacheResponseEPN7WebCore14DocumentLoaderEmP19NSCachedURLResponse
--[WebHTMLRepresentation finishedLoadingWithDataSource:]
--[WebView(WebViewEditing) isEditable]
-__ZN20WebFrameLoaderClient27dispatchDidLoadMainResourceEPN7WebCore14DocumentLoaderE
-+[WebScriptDebugServer listenerCount]
-__ZN20WebFrameLoaderClient24dispatchDidFinishLoadingEPN7WebCore14DocumentLoaderEm
-+[WebCoreStatistics setShouldPrintExceptions:]
--[WebView(WebViewInternal) _removeObjectForIdentifier:]
-__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E4findImNS_22IdentityHashTranslatorImS6_SA_EEEENS_17HashTableIteratorImS6_S8_SA_SF_SD_EERKT_
-__ZZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E8reinsertERS6_E8__func__
-__ZN20WebDocumentLoaderMac17decreaseLoadCountEm
-__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E4findImNS_22IdentityHashTranslatorImmS4_EEEENS_17HashTableIteratorImmS2_S4_S6_S6_EERKT_
-__ZN21WebIconDatabaseClient28dispatchDidAddIconForPageURLERKN7WebCore6StringE
--[WebIconDatabase(WebInternal) _sendNotificationForURL:]
--[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:]
--[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:waitUntilDone:]
-__ZN20WebFrameLoaderClient22dispatchDidReceiveIconEv
--[WebView(WebViewInternal) _dispatchDidReceiveIconFromWebFrame:]
--[WebView(WebViewInternal) _registerForIconNotification:]
-__Z13webGetNSImagePN7WebCore5ImageE7_NSSize
-+[NSNotificationCenter(WebNSNotificationCenterExtras) _postNotificationName:]
-__ZNK20WebFrameLoaderClient19windowObjectClearedEv
--[WebFrameBridge windowObjectCleared]
--[WebView(WebPendingPublic) scriptDebugDelegate]
--[_WebCoreHistoryProvider containsItemForURLUnicode:length:]
--[WebHistory containsItemForURLString:]
--[WebHistoryPrivate containsItemForURLString:]
-_WKSetUpFontCache
+__ZN20WebFrameLoaderClient22dispatchDidFailLoadingEPN7WebCore14DocumentLoaderEmRKNS0_13ResourceErrorE
+__ZN20WebFrameLoaderClient29dispatchDidHandleOnloadEventsEv
-[WebDynamicScrollBarsView verticalScrollingMode]
-[WebDynamicScrollBarsView setVerticalScrollingMode:]
-[WebDynamicScrollBarsView setVerticalScrollingMode:andLock:]
@@ -531,6 +493,12 @@ __ZN15WebEditorClient10isEditableEv
-[WebHTMLView reapplyStyles]
-[WebDataSource(WebInternal) _bridge]
__ZN20WebFrameLoaderClient22dispatchDidFirstLayoutEv
+__ZN20WebFrameLoaderClient21dispatchDidFinishLoadEv
+-[WebView(WebPrivate) _didFinishLoadForFrame:]
+-[WebView(WebPrivate) _didChangeBackForwardKeys]
+-[WebFrame DOMDocument]
+__Z3kitPN7WebCore8DocumentE
+__ZN20WebFrameLoaderClient32postProgressFinishedNotificationEv
-[WebHTMLView(WebPrivate) viewWillDraw]
-[WebHTMLView(WebInternal) _web_layoutIfNeededRecursive]
-[WebHTMLView(WebInternal) _layoutIfNeeded]
@@ -540,49 +508,52 @@ __ZN20WebFrameLoaderClient22dispatchDidFirstLayoutEv
-[WebHTMLView drawSingleRect:]
-[WebClipView setAdditionalClip:]
-[WebHTMLView(WebPrivate) _transparentBackground]
--[WebView(WebPrivate) _UIDelegateForwarder]
-+[WebDefaultUIDelegate sharedUIDelegate]
--[WebClipView resetAdditionalClip]
--[WebHTMLView(WebPrivate) _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
--[WebViewFactory pluginsInfo]
-+[WebPluginDatabase sharedDatabase]
--[WebPluginDatabase init]
-+[WebPluginDatabase(Internal) _defaultPlugInPaths]
--[WebPluginDatabase setPlugInPaths:]
--[WebPluginDatabase refresh]
--[WebPluginDatabase(Internal) _scanForNewPlugins]
--[WebPluginDatabase(Internal) _plugInPaths]
-+[WebBasePluginPackage initialize]
-+[WebBasePluginPackage pluginWithPath:]
--[WebPluginPackage initWithPath:]
--[WebBasePluginPackage initWithPath:]
--[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:]
--[WebBasePluginPackage dealloc]
-+[WebNetscapePluginPackage initialize]
-_WebLMGetCurApRefNum
-_WebLMSetCurApRefNum
--[WebNetscapePluginPackage initWithPath:]
--[WebNetscapePluginPackage _initWithPath:]
+-[WebHistoryItem originalURLString]
+-[WebFrame(WebPrivate) _isFrameSet]
+-[WebHTMLView(WebDocumentPrivateProtocols) string]
+-[WebHTMLView(WebHTMLViewFileInternal) _documentRange]
+-[DOMDocument(WebDOMDocumentOperationsPrivate) _documentRange]
+-[DOMDocument(WebDOMDocumentOperationsPrivate) _createRangeWithNode:]
+-[WebHTMLView _windowChangedKeyState]
+-[WebHTMLView updateCell:]
+-[WebHTMLView windowDidBecomeKey:]
+-[WebHTMLView(WebNSTextInputSupport) inputContext]
+-[WebHTMLView(WebNSTextInputSupport) validAttributesForMarkedText]
+__Z9setCursorP8NSWindowP13objc_selector8_NSPoint
+-[NSWindow(BorderViewAccess) _web_borderView]
+-[WebHTMLView nextResponder]
+-[WebHTMLView mouseMovedNotification:]
+-[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:xHysteresis:yHysteresis:]
+-[NSString(WebNSURLExtras) _webkit_scriptIfJavaScriptURL]
+-[NSString(WebNSURLExtras) _webkit_isJavaScriptURL]
+__ZNK20WebFrameLoaderClient12canCachePageEv
+__ZN20WebFrameLoaderClient19windowObjectClearedEv
+-[WebFrameBridge windowObjectCleared]
+-[WebView(WebPendingPublic) scriptDebugDelegate]
+__ZN20WebFrameLoaderClient28savePlatformDataToCachedPageEPN7WebCore10CachedPageE
+-[WebHistoryItem hash]
+__ZNK20WebFrameLoaderClient25didPerformFirstNavigationEv
+-[WebPreferences(WebPrivate) automaticallyDetectsCacheModel]
+__ZN20WebFrameLoaderClient19saveViewStateToItemEPN7WebCore11HistoryItemE
+-[WebHTMLView resignFirstResponder]
+-[WebHTMLView maintainsInactiveSelection]
+-[WebView(WebViewEditing) maintainsInactiveSelection]
+-[WebHTMLView(WebDocumentPrivateProtocols) deselectAll]
+-[WebHTMLView clearFocus]
+__ZNK20WebFrameLoaderClient17willCacheResponseEPN7WebCore14DocumentLoaderEmP19NSCachedURLResponse
+__ZN21WebIconDatabaseClient28dispatchDidAddIconForPageURLERKN7WebCore6StringE
+-[WebIconDatabase(WebInternal) _sendNotificationForURL:]
+-[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:]
+-[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:waitUntilDone:]
+__ZN20WebFrameLoaderClient27registerForIconNotificationEb
+-[WebView(WebViewInternal) _registerForIconNotification:]
-[WebBasePluginPackage isNativeLibraryData:]
-[WebBasePluginPackage getPluginInfoFromPLists]
--[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]
--[NSArray(WebPluginExtensions) _web_lowercaseStrings]
--[WebBasePluginPackage setMIMEToExtensionsDictionary:]
--[WebBasePluginPackage setMIMEToDescriptionDictionary:]
--[WebBasePluginPackage filename]
--[WebBasePluginPackage setName:]
--[WebBasePluginPackage setPluginDescription:]
--[WebNetscapePluginPackage getPluginInfoFromResources]
--[WebNetscapePluginPackage openResourceFile]
-[WebNetscapePluginPackage stringForStringListID:andIndex:]
+[NSString(WebKitExtras) _web_encodingForResource:]
-[WebNetscapePluginPackage closeResourceFile:]
-[WebBasePluginPackage pListForPath:createFile:]
--[WebPluginPackage load]
-[WebBasePluginPackage load]
--[WebNetscapePluginPackage load]
--[WebNetscapePluginPackage _applyDjVuWorkaround]
-+[WebBasePluginPackage preferredLocalizationName]
-[WebPluginDatabase(Internal) _addPlugin:]
-[WebBasePluginPackage path]
-[WebBasePluginPackage wasAddedToPluginDatabase:]
@@ -590,117 +561,27 @@ _WebLMSetCurApRefNum
-[WebPluginDatabase pluginForMIMEType:]
-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]
-[WebNetscapePluginPackage executableType]
+_checkCandidate
-[WebBasePluginPackage isQuickTimePlugIn]
-[WebBasePluginPackage bundle]
-[WebBasePluginPackage isJavaPlugIn]
+[WebHTMLView(WebPrivate) supportedImageMIMETypes]
+[WebHTMLRepresentation supportedImageMIMETypes]
-__ZN3WTF7HashSetIN7WebCore6StringENS_7StrHashIS2_EENS_10HashTraitsIS2_EEE3addERKS2_
-__ZZN3WTF9HashTableIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS_7StrHashIS3_EENS_10HashTraitsIS3_EES9_E8reinsertERS3_E8__func__
-__ZN3WTF9HashTableIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS_7StrHashIS3_EENS_10HashTraitsIS3_EES9_E4findIS3_NS_22IdentityHashTranslatorIS3_S3_S7_EEEENS_17HashTableIteratorIS3_S3_S5_S7_S9_S9_EERKT_
+__ZN3WTF7HashSetIN7WebCore6StringENS1_10StringHashENS_10HashTraitsIS2_EEE3addERKS2_
+__ZN3WTF9HashTableIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS1_10StringHashENS_10HashTraitsIS3_EES8_E3addINS1_6StringESB_NS_17HashSetTranslatorILb0ESB_NS7_ISB_EES8_S6_EEEESt4pairINS_17HashTableIteratorIS3_S3_S5_S6_S8_S8_EEbERKT_RKT0_
+__ZN3WTF9HashTableIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS1_10StringHashENS_10HashTraitsIS3_EES8_E6expandEv
+__ZN3WTF9HashTableIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS1_10StringHashENS_10HashTraitsIS3_EES8_E4findIS3_NS_22IdentityHashTranslatorIS3_S3_S6_EEEENS_17HashTableIteratorIS3_S3_S5_S6_S8_S8_EERKT_
-[WebPluginDatabase plugins]
-[WebBasePluginPackage name]
-[WebBasePluginPackage pluginDescription]
-[WebBasePluginPackage extensionsForMIMEType:]
-[WebBasePluginPackage descriptionForMIMEType:]
--[WebHTMLView _windowChangedKeyState]
--[WebHTMLView updateCell:]
--[WebHTMLView windowDidBecomeKey:]
--[WebHTMLView(WebPrivate) _web_firstResponderCausesFocusDisplay]
--[WebHTMLView(WebNSTextInputSupport) validAttributesForMarkedText]
-__Z9setCursorP8NSWindowP13objc_selector8_NSPoint
--[NSWindow(BorderViewAccess) _web_borderView]
-__ZN20WebFrameLoaderClient11createFrameERKN7WebCore4KURLERKNS0_6StringEPNS0_21HTMLFrameOwnerElementES6_bii
--[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]
--[WebFrameView setAllowsScrolling:]
--[WebDynamicScrollBarsView setAllowsScrolling:]
--[WebFrameView(WebInternal) _setMarginWidth:]
--[WebFrameView(WebInternal) _setMarginHeight:]
--[WebFrameBridge initSubframeWithOwnerElement:frameName:frameView:]
--[WebHTMLView addSubview:]
-+[WebPluginController isPlugInView:]
--[WebFrame(WebInternal) _addChild:]
--[WebFrame(WebInternal) _loadURL:referrer:intoChild:]
--[WebFrame name]
--[WebDataSource(WebInternal) _popSubframeArchiveWithName:]
--[WebFrame parentFrame]
-__ZN20WebFrameLoaderClient29dispatchDidFinishDocumentLoadEv
-_WKCGContextGetShouldSmoothFonts
-_WKGetCGFontFromNSFont
-_WKSetCGFontRenderingMode
--[WebClipView additionalClip]
--[WebHTMLView nextResponder]
--[WebHTMLView mouseMovedNotification:]
--[WebHTMLView(WebHTMLViewFileInternal) _frameView]
--[WebFrame DOMDocument]
-__Z3kitPN7WebCore8DocumentE
-__ZN20WebFrameLoaderClient29dispatchDidHandleOnloadEventsEv
-__ZN20WebFrameLoaderClient21dispatchDidFinishLoadEv
--[WebView(WebPrivate) _didFinishLoadForFrame:]
--[WebView(WebPrivate) _didChangeBackForwardKeys]
-__ZN20WebFrameLoaderClient32postProgressFinishedNotificationEv
-__ZN15WebChromeClient19addMessageToConsoleERKN7WebCore6StringEjS3_
--[WebHistoryItem originalURLString]
--[WebFrame(WebPrivate) _isFrameSet]
--[WebHTMLView(WebDocumentPrivateProtocols) string]
--[WebHTMLView(WebHTMLViewFileInternal) _documentRange]
--[DOMDocument(WebDOMDocumentOperationsPrivate) _documentRange]
--[DOMDocument(WebDOMDocumentOperationsPrivate) _createRangeWithNode:]
--[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:xHysteresis:yHysteresis:]
--[NSString(WebNSURLExtras) _webkit_scriptIfJavaScriptURL]
--[NSString(WebNSURLExtras) _webkit_isJavaScriptURL]
-__ZN20WebFrameLoaderClient19saveViewStateToItemEPN7WebCore11HistoryItemE
-__ZN20WebFrameLoaderClient19detachedFromParent2Ev
--[WebHTMLView(WebPrivate) close]
--[WebHTMLView(WebPrivate) _clearLastHitViewIfSelf]
--[WebPluginController destroyAllPlugins]
--[WebPluginController _cancelOutstandingChecks]
--[WebHTMLViewPrivate clear]
--[WebPluginController dealloc]
--[WebHTMLRepresentation dealloc]
--[WebHTMLRepresentationPrivate dealloc]
-__ZN20WebFrameLoaderClient19detachedFromParent3Ev
--[WebFrameBridge close]
-__ZN20WebFrameLoaderClient19detachedFromParent4Ev
--[WebHistoryPrivate insertItem:forDateKey:]
-__ZZN3WTF22HashTableConstIteratorIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_EppEvE8__func__
-__ZNK20WebFrameLoaderClient25didPerformFirstNavigationEv
--[WebPreferences(WebPrivate) automaticallyDetectsCacheModel]
--[WebHTMLView willRemoveSubview:]
--[WebFrameBridge dealloc]
--[WebFrameBridge fini]
-__ZN20WebFrameLoaderClient20frameLoaderDestroyedEv
--[WebHTMLView resignFirstResponder]
--[WebHTMLView maintainsInactiveSelection]
--[WebView(WebViewEditing) maintainsInactiveSelection]
--[WebHTMLView(WebDocumentPrivateProtocols) deselectAll]
--[WebHTMLView clearFocus]
--[WebFrame dealloc]
--[WebFramePrivate dealloc]
--[WebFrameView dealloc]
--[WebFrameViewPrivate dealloc]
--[WebHTMLView dealloc]
--[WebHTMLViewPrivate dealloc]
+-[WebView estimatedProgress]
_WKSetNSURLRequestShouldContentSniff
-__ZNK20WebFrameLoaderClient12canCachePageEv
-__ZN20WebFrameLoaderClient28saveDocumentViewToCachedPageEPN7WebCore10CachedPageE
-[WebHistoryItem isEqual:]
--[WebHistoryItem dealloc]
--[WebFrameBridge firstResponder]
-__ZN15WebEditorClient19setInputMethodStateEb
-__ZN15WebEditorClient32isContinuousSpellCheckingEnabledEv
--[WebView(WebViewEditing) isContinuousSpellCheckingEnabled]
--[WebView(WebFileInternal) _continuousCheckingAllowed]
-__ZN15WebEditorClient24isGrammarCheckingEnabledEv
--[WebView(WebViewGrammarChecking) isGrammarCheckingEnabled]
-__ZN15WebEditorClient25respondToChangedSelectionEv
--[WebView selectedFrame]
--[WebView(WebFileInternal) _focusedFrame]
-__Z19containingFrameViewP6NSView
--[WebHTMLView(WebInternal) _selectionChanged]
--[WebHTMLView(WebNSTextInputSupport) _updateSelectionForInputManager]
__ZN20WebFrameLoaderClient17objectContentTypeERKN7WebCore4KURLERKNS0_6StringE
-[WebFrameBridge determineObjectFromMIMEType:URL:]
+-[WebFrameBridge webView]
-[WebView _pluginForMIMEType:]
__ZN20WebFrameLoaderClient12createPluginERKN7WebCore7IntSizeEPNS0_7ElementERKNS0_4KURLERKN3WTF6VectorINS0_6StringELm0EEESE_RKSB_b
__Z7nsArrayRKN3WTF6VectorIN7WebCore6StringELm0EEE
@@ -708,6 +589,8 @@ __Z7nsArrayRKN3WTF6VectorIN7WebCore6StringELm0EEE
+[WebBaseNetscapePluginView initialize]
_WKSendUserChangeNotifications
-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]
+-[WebNetscapePluginPackage load]
+-[WebNetscapePluginPackage _applyDjVuWorkaround]
-[WebBaseNetscapePluginView setPluginPackage:]
-[WebNetscapePluginPackage NPP_New]
-[WebNetscapePluginPackage NPP_Destroy]
@@ -726,6 +609,7 @@ _WKSendUserChangeNotifications
-[WebBaseNetscapePluginView setBaseURL:]
-[WebBaseNetscapePluginView setAttributeKeys:andValues:]
-[WebBaseNetscapePluginView setMode:]
+-[WebHTMLView addSubview:]
-[WebBaseNetscapePluginView viewWillMoveToSuperview:]
-[WebBaseNetscapePluginView visibleRect]
-[WebBaseNetscapePluginView isFlipped]
@@ -752,13 +636,17 @@ _pluginViewForInstance
-[WebView userAgentForURL:]
_NPN_GetValue
-[WebBaseNetscapePluginView(WebNPPCallbacks) getVariable:value:]
+_NPN_SetValue
+-[WebBaseNetscapePluginView(WebNPPCallbacks) setVariable:value:]
+_NPN_InvalidateRect
+-[WebBaseNetscapePluginView(WebNPPCallbacks) invalidateRect:]
-[WebBaseNetscapePluginView updateAndSetWindow]
-[WebBaseNetscapePluginView saveAndSetNewPortState]
-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]
--[WebBaseNetscapePluginView fixWindowPort]
-[WebBaseNetscapePluginView currentWindow]
-[WebBaseNetscapePluginView superviewsHaveSuperviews]
-_WKCGContextIsBitmapContext
+-[WebBaseNetscapePluginView(WebNPPCallbacks) isOpaque]
+__ZN3WTF6VectorI6CGRectLm16EE6resizeEm
-[WebBaseNetscapePluginView setWindowIfNecessary]
-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]
-[WebBaseNetscapePluginView willCallPlugInFunction]
@@ -787,57 +675,49 @@ __ZNK20WebFrameLoaderClient34deliverArchivedResourcesAfterDelayEv
-[WebBaseNetscapePluginView pluginPackage]
__Z7streamsv
__ZN3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEE3addERKS2_RKS4_
+__ZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E3addIPN7WebCore11HistoryItemEP14WebHistoryItemNS_17HashMapTranslatorILb1ES1_ISF_SH_ENS_18PairBaseHashTraitsINS8_ISF_EENS8_ISH_EEEESA_NS_7PtrHashISF_EEEEEES1_INS_17HashTableIteratorIiS2_S4_S6_SA_S9_EEbERKT_RKT0_
-[WebNetscapePluginStream start]
-[WebBaseNetscapePluginView stopNullEvents]
++[WebPluginController isPlugInView:]
-[WebBaseNetscapePluginView renewGState]
-[WebBaseNetscapePluginView(Internal) _viewHasMoved]
-_WKCallDrawingNotification
+-[WebFrameBridge firstResponder]
+__ZN15WebEditorClient19setInputMethodStateEb
+__ZN15WebEditorClient32isContinuousSpellCheckingEnabledEv
+-[WebView(WebViewEditing) isContinuousSpellCheckingEnabled]
+-[WebView(WebFileInternal) _continuousCheckingAllowed]
+__ZN15WebEditorClient24isGrammarCheckingEnabledEv
+-[WebView(WebViewGrammarChecking) isGrammarCheckingEnabled]
+__ZN15WebEditorClient25respondToChangedSelectionEv
+-[WebView selectedFrame]
+-[WebView(WebFileInternal) _focusedFrame]
+__Z19containingFrameViewP6NSView
+-[WebHTMLView(WebInternal) _selectionChanged]
+-[WebHTMLView(WebNSTextInputSupport) _updateSelectionForInputManager]
+-[WebClipView additionalClip]
-[WebBaseNetscapePluginView drawRect:]
-[WebBaseNetscapePluginView sendUpdateEvent]
--[WebBaseNetscapePluginView(WebNPPCallbacks) isOpaque]
-_WKDrawBezeledTextFieldCell
-_WKDrawFocusRing
+__ZN3WTF6VectorI6CGRectLm16EE6shrinkEm
+__ZN20WebFrameLoaderClient22dispatchDidReceiveIconEv
-[WebBaseNetscapePluginView sendNullEvent]
+__ZN35WebNetscapePlugInStreamLoaderClient18didReceiveResponseEPN7WebCore26NetscapePlugInStreamLoaderERKNS0_16ResourceResponseE
-[WebBaseNetscapePluginStream startStreamWithResponse:]
_WKGetNSURLResponseLastModifiedDate
-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]
-[WebBaseNetscapePluginStream setResponseURL:]
-[WebBaseNetscapePluginStream setMIMEType:]
-[NSURL(WebNSURLExtras) _web_URLCString]
+__ZN35WebNetscapePlugInStreamLoaderClient14didReceiveDataEPN7WebCore26NetscapePlugInStreamLoaderEPKci
-[WebBaseNetscapePluginStream receivedData:]
-[WebBaseNetscapePluginStream _deliverData]
-_NPN_InvalidateRect
--[WebBaseNetscapePluginView(WebNPPCallbacks) invalidateRect:]
--[WebBaseNetscapePluginStream finishedLoadingWithData:]
+__ZN35WebNetscapePlugInStreamLoaderClient16didFinishLoadingEPN7WebCore26NetscapePlugInStreamLoaderE
+-[WebBaseNetscapePluginStream finishedLoading]
-[WebBaseNetscapePluginStream _destroyStreamWithReason:]
-[WebBaseNetscapePluginStream _destroyStream]
-[WebBaseNetscapePluginView disconnectStream:]
-[WebNetscapePluginStream dealloc]
+__ZN35WebNetscapePlugInStreamLoaderClientD1Ev
-[WebBaseNetscapePluginStream dealloc]
--[WebView(WebPendingPublic) isHoverFeedbackSuspended]
-__ZN15WebChromeClient23mouseDidMoveOverElementERKN7WebCore13HitTestResultEj
-+[WebElementDictionary initialize]
--[WebElementDictionary initWithHitTestResult:]
-+[WebElementDictionary initializeLookupTable]
-__Z12addLookupKeyP8NSStringP13objc_selector
--[WebView(WebPrivate) _mouseDidMoveOverElement:modifierFlags:]
-__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectj
-__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_j
--[WebElementDictionary objectForKey:]
--[WebElementDictionary _absoluteLinkURL]
--[WebElementDictionary _webFrame]
--[WebElementDictionary _domNode]
-__Z3kitPN7WebCore4NodeE
--[DOMDocument(WebDOMDocumentOperations) webFrame]
--[DOMNode(WebDOMNodeOperations) _bridge]
--[WebElementDictionary _targetWebFrame]
--[NSURL(WebNSURLExtras) _webkit_URLByRemovingFragment]
--[WebElementDictionary dealloc]
-__ZN15WebChromeClient10setToolTipERKN7WebCore6StringE
--[WebHTMLView(WebPrivate) _setToolTip:]
-_NPN_SetValue
--[WebBaseNetscapePluginView(WebNPPCallbacks) setVariable:value:]
--[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:allowShadowContent:]
__ZN20WebFrameLoaderClient14cancelledErrorERKN7WebCore15ResourceRequestE
+[NSError(WebKitExtras) _webKitErrorWithDomain:code:URL:]
+[NSError(WebKitExtras) _registerWebKitErrors]
@@ -848,7 +728,6 @@ _registerErrors
__ZN20WebFrameLoaderClient20setMainDocumentErrorEPN7WebCore14DocumentLoaderERKNS0_13ResourceErrorE
-[WebDataSource(WebInternal) _setMainDocumentError:]
__ZN20WebFrameLoaderClient24cancelPendingArchiveLoadEPN7WebCore14ResourceLoaderE
-__ZN20WebFrameLoaderClient22dispatchDidFailLoadingEPN7WebCore14DocumentLoaderEmRKNS0_13ResourceErrorE
__ZN15WebEditorClient22textFieldDidEndEditingEPN7WebCore7ElementE
__Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_
-[WebView hostWindow]
@@ -856,22 +735,46 @@ __Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_
-[WebBaseNetscapePluginView(Internal) _destroyPlugin]
-[WebNetscapePluginPackage close]
-[WebBaseNetscapePluginView removeKeyEventHandler]
+-[WebHTMLView willRemoveSubview:]
-[WebBaseNetscapePluginView dealloc]
-[WebBaseNetscapePluginView fini]
+-[WebHTMLView dealloc]
+-[WebHTMLView(WebPrivate) close]
+-[WebHTMLView(WebPrivate) _clearLastHitViewIfSelf]
+-[WebPluginController destroyAllPlugins]
+-[WebPluginController _cancelOutstandingChecks]
+-[WebHTMLViewPrivate clear]
+-[WebPluginController dealloc]
+-[WebHTMLRepresentation dealloc]
+-[WebHTMLRepresentationPrivate dealloc]
+-[WebHTMLViewPrivate dealloc]
+__ZN20WebFrameLoaderClient11createFrameERKN7WebCore4KURLERKNS0_6StringEPNS0_21HTMLFrameOwnerElementES6_bii
+-[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]
+-[WebFrameView setAllowsScrolling:]
+-[WebDynamicScrollBarsView setAllowsScrolling:]
+-[WebFrameView(WebInternal) _setMarginWidth:]
+-[WebFrameView(WebInternal) _setMarginHeight:]
+-[WebFrameBridge initSubframeWithOwnerElement:frameName:frameView:]
+-[WebFrame(WebInternal) _addChild:]
+-[WebFrame(WebInternal) _loadURL:referrer:intoChild:]
+-[WebFrame name]
+-[WebDataSource(WebInternal) _popSubframeArchiveWithName:]
+-[WebFrame parentFrame]
_WKGetFontInLanguageForRange
--[WebHTMLView(WebPrivate) addTrackingRect:owner:userData:assumeInside:]
--[WebHTMLView(WebPrivate) _sendToolTipMouseEntered]
--[WebHTMLView(WebPrivate) _sendToolTipMouseExited]
+_WKDrawFocusRing
+__Z41_updateFocusedAndActiveStateTimerCallbackP16__CFRunLoopTimerPv
+-[WebHTMLView(WebHTMLViewFileInternal) _frameView]
-[WebHTMLView keyDown:]
-__ZN15WebEditorClient25handleInputMethodKeypressEPN7WebCore13KeyboardEventE
+__ZN15WebEditorClient24handleInputMethodKeydownEPN7WebCore13KeyboardEventE
-[WebHTMLView(WebInternal) _interceptEditingKeyEvent:shouldSaveCommand:]
-__ZN3WTF6VectorIN7WebCore6StringELm0EEC1ERKS3_
-[WebHTMLView(WebNSTextInputSupport) hasMarkedText]
-[WebHTMLView(WebNSTextInputSupport) insertText:]
-__ZN3WTF6VectorIN7WebCore6StringELm0EEaSERKS3_
-__ZN3WTF6VectorIN7WebCore6StringELm0EE6resizeEm
+__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEmPKS2_
+__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEm
+__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE15reserveCapacityEm
__ZN15WebEditorClient27doTextFieldCommandFromEventEPN7WebCore7ElementEPNS0_13KeyboardEventE
-__ZN15WebEditorClient14handleKeypressEPN7WebCore13KeyboardEventE
+__ZN15WebEditorClient19handleKeyboardEventEPN7WebCore13KeyboardEventE
+-[WebHTMLView coreCommandBySelector:]
__ZN15WebEditorClient16shouldInsertTextEN7WebCore6StringEPNS0_5RangeENS0_18EditorInsertActionE
-[WebView(WebPrivate) _editingDelegateForwarder]
+[WebDefaultEditingDelegate sharedEditingDelegate]
@@ -884,6 +787,8 @@ __ZN15WebEditorClient24textFieldDidBeginEditingEPN7WebCore7ElementE
-[WebHTMLRepresentation elementIsPassword:]
-[WebHTMLRepresentation elementDoesAutoComplete:]
__ZN15WebEditorClient24textDidChangeInTextFieldEPN7WebCore7ElementE
+-[DOMDocument(WebDOMDocumentOperations) webFrame]
+-[DOMNode(WebDOMNodeOperations) _bridge]
__ZN15WebEditorClient25shouldChangeSelectedRangeEPN7WebCore5RangeES2_NS0_9EAffinityEb
-[WebView(WebViewEditing) _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]
-[WebDefaultEditingDelegate webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]
@@ -898,14 +803,30 @@ __ZN15WebEditorClient24respondToChangedContentsEv
__ZN15WebEditorClient21checkSpellingOfStringEPKtiPiS2_
__ZN15WebEditorClient23spellCheckerDocumentTagEv
-[WebView(WebViewEditing) spellCheckerDocumentTag]
-+[WebHTMLView(WebPrivate) _postFlagsChangedEvent:]
-[WebHTMLRepresentation matchLabels:againstElement:]
-[WebHTMLRepresentation searchForLabels:beforeElement:]
-[WebHTMLView(WebNSTextInputSupport) doCommandBySelector:]
-__ZN3WTF6VectorIN7WebCore6StringELm0EE14expandCapacityEm
-__ZN3WTF6VectorIN7WebCore6StringELm0EE15reserveCapacityEm
-__Z32CallFormDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS2_S4_
-[WebDefaultEditingDelegate webView:doCommandBySelector:]
+__ZN15WebEditorClient17shouldDeleteRangeEPN7WebCore5RangeE
+-[WebDefaultEditingDelegate webView:shouldDeleteDOMRange:]
+__ZN15WebEditorClient28textWillBeDeletedInTextFieldEPN7WebCore7ElementE
+__Z32CallFormDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS2_S4_
+-[WebHistoryItem title]
++[WebHTMLView(WebPrivate) _postFlagsChangedEvent:]
+-[WebHTMLView flagsChanged:]
+-[WebHistory saveToURL:error:]
+-[WebHistoryPrivate saveToURL:error:]
+-[WebHistoryPrivate _saveHistoryGuts:URL:error:]
+-[WebHistoryPrivate arrayRepresentation]
+__ZN3WTF6VectorIiLm0EE15reserveCapacityEm
+__ZSt16__introsort_loopIPiiEvT_S1_T0_
+__ZSt22__final_insertion_sortIPiEvT_S1_
+__ZSt16__insertion_sortIPiEvT_S1_
+-[WebHistoryItem(WebPrivate) dictionaryRepresentation]
+__ZN3WTF6VectorIiLm0EE6shrinkEm
+_WKSetPatternPhaseInUserSpace
+-[WebElementDictionary _domNode]
+__Z3kitPN7WebCore4NodeE
__ZN20WebFrameLoaderClient22dispatchWillSubmitFormEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEEN3WTF10PassRefPtrINS0_9FormStateEEE
-[WebView(WebPrivate) _formDelegate]
__Z3kitPN7WebCore11HTMLElementE
@@ -915,6 +836,10 @@ __Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_S4_S4_S4_
__ZN15WebChromeClient5focusEv
-[WebEditCommand dealloc]
-[WebFrame(WebPrivate) _isDescendantOfFrame:]
+-[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:allowShadowContent:]
+-[WebElementDictionary _webFrame]
+-[WebElementDictionary _targetWebFrame]
+-[NSURL(WebNSURLExtras) _webkit_URLByRemovingFragment]
-[WebHTMLView shouldDelayWindowOrderingForEvent:]
-[WebHTMLView(WebHTMLViewFileInternal) _hitViewForEvent:]
-[WebHTMLView _isSelectionEvent:]
@@ -922,25 +847,259 @@ __ZN15WebChromeClient5focusEv
-[WebHTMLView mouseDown:]
-[WebHTMLView(WebHTMLViewFileInternal) _setMouseDownEvent:]
-[WebHTMLView mouseUp:]
+__ZN20WebFrameLoaderClient33dispatchWillPerformClientRedirectERKN7WebCore4KURLEdd
+__Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_dS0_S0_
+__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_dS0_S0_
+__ZN20WebFrameLoaderClient31dispatchDidCancelClientRedirectEv
++[WebStringTruncator centerTruncateString:toWidth:]
+__Z15defaultMenuFontv
+-[WebViewFactory pluginSupportsMIMEType:]
+-[WebHTMLView(WebPrivate) addTrackingRect:owner:userData:assumeInside:]
+-[WebHTMLView(WebPrivate) _sendToolTipMouseEntered]
+-[WebHTMLView(WebPrivate) _sendToolTipMouseExited]
+-[WebHTMLView(WebPrivate) removeTrackingRect:]
+-[WebHTMLView mouseDragged:]
+-[WebViewFactory bridgeForView:]
+-[WebBaseNetscapePluginView createPluginScriptableObject]
+-[WebBaseNetscapePluginView isStarted]
+_NPN_MemFree
+-[WebBaseNetscapePluginView mouseEntered:]
+-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]
+_WKConvertNSEventToCarbonEvent
+-[WebBaseNetscapePluginView modifiersForEvent:]
+_NPN_GetURLNotify
+-[WebBaseNetscapePluginView(WebNPPCallbacks) getURLNotify:target:notifyData:]
+-[WebBaseNetscapePluginView(WebNPPCallbacks) requestWithURLCString:]
+-[NSString(WebKitExtras) _web_stringByStrippingReturnCharacters]
+-[WebBaseNetscapePluginView mouseExited:]
+-[WebHTMLView scrollWheel:]
+_WKGetWheelEventDeltas
+-[WebClipView scrollWheel:]
+-[WebDynamicScrollBarsView scrollWheel:]
+-[WebDynamicScrollBarsView allowsVerticalScrolling]
+-[WebHTMLView performKeyEquivalent:]
+-[WebHTMLView _handleStyleKeyEquivalent:]
+-[WebPreferences(WebPrivate) respectStandardStyleKeyEquivalents]
+-[WebBaseNetscapePluginView acceptsFirstResponder]
+-[WebFrameBridge makeFirstResponder:]
+-[WebView(WebPrivate) _pushPerformingProgrammaticFocus]
+-[WebBaseNetscapePluginView becomeFirstResponder]
+-[WebBaseNetscapePluginView installKeyEventHandler]
+-[WebView(WebPrivate) _popPerformingProgrammaticFocus]
+-[WebBaseNetscapePluginView mouseDown:]
+-[WebBaseNetscapePluginView mouseUp:]
+-[WebBaseNetscapePluginView mouseDragged:]
+-[WebBaseNetscapePluginView resignFirstResponder]
+-[WebHTMLView(WebPrivate) _removeTrackingRects:count:]
+-[WebHTMLView(WebPrivate) _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]
+__ZN20WebFrameLoaderClient19detachedFromParent2Ev
+__ZN20WebFrameLoaderClient19detachedFromParent3Ev
+-[WebFrameBridge close]
+__ZN20WebFrameLoaderClient19detachedFromParent4Ev
+-[WebFrameBridge dealloc]
+-[WebFrameBridge fini]
+__ZN20WebFrameLoaderClient20frameLoaderDestroyedEv
+-[WebFrame dealloc]
+-[WebFramePrivate dealloc]
+-[WebFrameView dealloc]
+-[WebFrameViewPrivate dealloc]
+-[WebNetscapePluginStream stop]
+-[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:]
+-[WebNetscapePluginStream cancelLoadWithError:]
+__ZN35WebNetscapePlugInStreamLoaderClient7didFailEPN7WebCore26NetscapePlugInStreamLoaderERKNS0_13ResourceErrorE
+-[WebBaseNetscapePluginStream destroyStreamWithError:]
++[WebBaseNetscapePluginStream reasonForError:]
+_NPN_GetURL
+-[WebBaseNetscapePluginView(WebNPPCallbacks) getURL:target:]
+-[NSString(WebNSURLExtras) _webkit_stringByReplacingValidPercentEscapes]
+-[WebFrame findFrameNamed:]
+-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]
+-[WebBaseNetscapePluginView(WebNPPCallbacks) loadPluginRequest:]
+-[WebPluginRequest request]
+-[WebPluginRequest frameName]
+-[WebBaseNetscapePluginView(WebNPPCallbacks) evaluateJavaScriptPluginRequest:]
+-[WebPluginRequest isCurrentEventUserGesture]
+-[WebPluginRequest sendNotification]
+-[WebPluginRequest dealloc]
+-[WebViewFactory defaultLanguageCode]
+-[WebDynamicScrollBarsView autoforwardsScrollWheelEvents]
+__ZN20WebFrameLoaderClient14shouldFallBackERKN7WebCore13ResourceErrorE
+__ZN20WebFrameLoaderClient30dispatchDidFailProvisionalLoadERKN7WebCore13ResourceErrorE
+-[WebView(WebPrivate) _didFailProvisionalLoadWithError:forFrame:]
+-[WebHistoryItem alternateTitle]
+-[WebHistoryItem setAlternateTitle:]
+-[WebHTMLView(WebPrivate) view:stringForToolTip:point:userData:]
+-[WebHTMLView windowDidResignKey:]
+-[WebHTMLView removeMouseMovedObserver]
+-[WebBaseNetscapePluginView windowResignedKey:]
+-[WebBaseNetscapePluginView windowBecameKey:]
+-[WebView(WebIBActions) goBack:]
+-[WebView goBack]
+__ZNK20WebFrameLoaderClient21shouldGoToHistoryItemEPN7WebCore11HistoryItemE
+-[WebHistoryItem(WebPrivate) URL]
+__ZN20WebFrameLoaderClient16restoreViewStateEv
+-[WebWindowWatcher windowWillClose:]
+-[WebHTMLView needsPanelToBecomeKey]
+-[WebHTMLView acceptsFirstMouse:]
+__ZN20WebFrameLoaderClient50dispatchDidReceiveServerRedirectForProvisionalLoadEv
+__ZN15WebChromeClient19addMessageToConsoleERKN7WebCore6StringEjS3_
+__ZN13WebDragClient28dragSourceActionMaskForPointERKN7WebCore8IntPointE
+-[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:]
+-[WebFrameBridge willPopupMenu:]
+_WKPopupMenu
+-[WebHTMLView _accessibilityParentForSubview:]
+-[WebHTMLView accessibilityAttributeValue:]
+-[WebClipView _focusRingVisibleRect]
+-[WebFrameBridge window]
+-[WebViewFactory accessibilityHandleFocusChanged]
+_WKAccessibilityHandleFocusChanged
+-[WebViewFactory unregisterUniqueIdForUIElement:]
+_WKUnregisterUniqueIdForElement
+__ZN25WebCachedPagePlatformData5clearEv
+-[WebHTMLView(WebInternal) closeIfNotCurrentView]
+_WKGetFontInLanguageForCharacter
+__ZN20WebFrameLoaderClient35dispatchDidChangeLocationWithinPageEv
+__ZN20WebFrameLoaderClient13didFinishLoadEv
+-[WebView(WebPendingPublic) shouldClose]
+-[WebView _windowWillClose:]
+-[WebView shouldCloseWithWindow]
+-[WebHTMLView windowWillClose:]
+-[WebView(WebPrivate) _isClosed]
+-[WebView close]
+-[WebFrame childFrames]
+-[WebView(WebPrivate) _clearUndoRedoOperations]
+-[WebView(WebPrivate) _close]
+-[WebView(AllWebViews) _removeFromAllWebViewsSet]
+-[WebView(WebPendingPublic) setScriptDebugDelegate:]
+-[WebView(WebPrivate) _detachScriptDebuggerFromAllFrames]
+-[WebView removeDragCaret]
+__ZN15WebEditorClient13pageDestroyedEv
+__ZN18WebInspectorClient18inspectorDestroyedEv
+__ZN20WebContextMenuClient20contextMenuDestroyedEv
+__ZN13WebDragClient23dragControllerDestroyedEv
+__ZN15WebChromeClient15chromeDestroyedEv
+-[WebView preferencesIdentifier]
+-[WebPreferences identifier]
++[WebPreferences(WebPrivate) _removeReferenceForIdentifier:]
+-[WebPreferences(WebPrivate) didRemoveFromWebView]
++[WebView(WebFileInternal) _preferencesRemovedNotification:]
++[WebView(WebFileInternal) _cacheModel]
++[WebView(WebFileInternal) _maxCacheModelInAnyInstance]
+-[WebView dealloc]
+-[WebViewPrivate dealloc]
+__ZN20WebFrameLoaderClient38dispatchDidLoadResourceFromMemoryCacheEPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestERKNS0_16ResourceResponseEi
+__Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_S0_S0_
+__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_S0_S0_
+-[WebViewFactory inputElementAltText]
+__ZN20WebFrameLoaderClient35transitionToCommittedFromCachedPageEPN7WebCore10CachedPageE
+__ZN20WebFrameLoaderClient11forceLayoutEv
+-[WebHTMLView setNeedsToApplyStyles:]
+_WKDrawBezeledTextArea
+__ZN15WebEditorClient23textDidChangeInTextAreaEPN7WebCore7ElementE
+-[WebPreferences setJavaScriptCanOpenWindowsAutomatically:]
+-[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setBool:forKey:]
+__ZN20WebFrameLoaderClient28updateGlobalHistoryForReloadERKN7WebCore4KURLE
+-[WebHistory setLastVisitedTimeInterval:forItem:]
+-[WebHistoryPrivate setLastVisitedTimeInterval:forItem:]
+-[WebDynamicScrollBarsView allowsHorizontalScrolling]
+__ZN15WebChromeClient10windowRectEv
+__ZN15WebChromeClient11scaleFactorEv
+__ZN15WebChromeClient11canRunModalEv
+__ZN20WebFrameLoaderClient19dispatchDidFailLoadERKN7WebCore13ResourceErrorE
+-[WebView(WebPrivate) _didFailLoadWithError:forFrame:]
+__ZN15WebChromeClient12createWindowEPN7WebCore5FrameERKNS0_16FrameLoadRequestERKNS0_14WindowFeaturesE
+__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_
+__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_
+-[WebBaseNetscapePluginView preferencesHaveChanged:]
+__ZN15WebChromeClient18setToolbarsVisibleEb
+-[WebView becomeFirstResponder]
+-[WebFrameView acceptsFirstResponder]
+__ZN15WebChromeClient19setStatusbarVisibleEb
+__ZN15WebChromeClient20setScrollbarsVisibleEb
+__ZN15WebChromeClient17setMenubarVisibleEb
+__ZN15WebChromeClient12setResizableEb
+__ZN15WebChromeClient8pageRectEv
+__ZN15WebChromeClient13setWindowRectERKN7WebCore9FloatRectE
+__ZN15WebChromeClient4showEv
+-[WebFramePolicyListener invalidate]
+__ZN20WebFrameLoaderClient29interruptForPolicyChangeErrorERKN7WebCore15ResourceRequestE
+-[WebFramePolicyListener ignore]
++[NSObject(WebScripting) isKeyExcludedFromWebScript:]
+-[WebIconDatabase iconURLForURL:]
+-[WebHistoryItem(WebPrivate) RSSFeedReferrer]
+-[WebView(WebIBActions) reload:]
+-[WebFrame reload]
+__ZN15WebChromeClient7unfocusEv
+-[WebDefaultUIDelegate webViewUnfocus:]
+__ZN15WebChromeClient15closeWindowSoonEv
+-[WebView(WebPrivate) _closeWindow]
+-[WebBaseNetscapePluginView windowWillClose:]
+-[WebFrameBridge valueForKey:keys:values:]
+-[NSError(WebKitExtras) _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]
+-[WebNullPluginView initWithFrame:error:DOMElement:]
+-[WebNullPluginView viewDidMoveToWindow]
+-[WebNullPluginView reportFailure]
+-[WebFrameBridge getAppletInView:]
+-[WebFrameBridge pollForAppletInView:]
+-[WebNullPluginView dealloc]
+__ZN20WebFrameLoaderClient21fileDoesNotExistErrorERKN7WebCore16ResourceResponseE
+__ZN20WebFrameLoaderClient38dispatchDecidePolicyForNewWindowActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestERKNS0_6StringE
+__ZN20WebFrameLoaderClient18dispatchCreatePageEv
+__ZN20WebFrameLoaderClient12dispatchShowEv
+__ZN3WTF6VectorI6CGRectLm16EE14expandCapacityEm
+__ZN3WTF6VectorI6CGRectLm16EE15reserveCapacityEm
+-[WebViewFactory refreshPlugins:]
+-[WebBackForwardList forwardItem]
+-[WebBackForwardList backItem]
+-[NSString(WebKitExtras) _web_drawAtPoint:font:textColor:]
+_canUseFastRenderer
+-[NSEvent(WebExtras) _web_isOptionTabKeyEvent]
+-[NSString(WebNSURLExtras) _webkit_rangeOfURLScheme]
+-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]
+-[WebFrame _loadHTMLString:baseURL:unreachableURL:]
+-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]
+-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]
+-[WebPluginRequest notifyData]
+__ZNK15WebChromeClient11tabsToLinksEv
+-[WebPreferences tabsToLinks]
+-[WebFrameBridge keyboardUIMode]
+-[WebFrameBridge _retrieveKeyboardUIModeFromPreferences:]
+-[WebFrameBridge _preferences]
+_WKGetMIMETypeForExtension
+-[WebView _pluginForExtension:]
+-[WebPluginDatabase pluginForExtension:]
+-[WebBasePluginPackage extensionEnumerator]
+-[WebBasePluginPackage MIMETypeForExtension:]
+-[WebDataSource(WebPrivate) _mainDocumentError]
+-[WebHTMLView validateUserInterfaceItem:]
+-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]
+__Z3kitN7WebCore8TriStateE
+__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objecta
+__Z28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selectorS2_a
+-[WebFrame(WebPrivate) _isDisplayingStandaloneImage]
+-[WebHTMLView(WebPrivate) _hasSelection]
+-[WebHTMLView(WebPrivate) _isEditable]
+-[WebView(WebIBActions) validateUserInterfaceItem:]
+-[WebView(WebIBActions) validateUserInterfaceItemWithoutDelegate:]
+-[WebHTMLView(WebInternal) isGrammarCheckingEnabled]
+-[WebView(WebIBActions) canMakeTextLarger]
+-[WebView(WebFileInternal) _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]
+-[WebFrame(WebInternal) _documentViews]
+-[WebHTMLView(WebTextSizing) _tracksCommonSizeFactor]
+-[WebView(WebIBActions) canMakeTextStandardSize]
+-[WebView(WebIBActions) canMakeTextSmaller]
+-[WebHTMLRepresentation canProvideDocumentSource]
+-[WebView supportsTextEncoding]
+-[WebHTMLView(WebDocumentPrivateProtocols) supportsTextEncoding]
+-[WebView customTextEncodingName]
+-[WebView _mainFrameOverrideEncoding]
-[WebHistory orderedLastVisitedDays]
-[WebHistoryPrivate orderedLastVisitedDays]
-__ZN3WTF6VectorIiLm0EE15reserveCapacityEm
-__ZSt16__introsort_loopIPiiEvT_S1_T0_
-__ZSt22__final_insertion_sortIPiEvT_S1_
-__ZSt16__insertion_sortIPiEvT_S1_
-__ZN3WTF6VectorIiLm0EE6resizeEm
-[WebHistory orderedItemsLastVisitedOnDay:]
-[WebHistoryPrivate orderedItemsLastVisitedOnDay:]
--[WebHistoryItem title]
--[WebHTMLView mouseDragged:]
-__ZN13WebDragClient28dragSourceActionMaskForPointERKN7WebCore8IntPointE
--[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:]
--[WebHTMLView(WebPrivate) removeTrackingRect:]
--[WebHistory saveToURL:error:]
--[WebHistoryPrivate saveToURL:error:]
--[WebHistoryPrivate _saveHistoryGuts:URL:error:]
--[WebHistoryPrivate arrayRepresentation]
--[WebHistoryItem(WebPrivate) dictionaryRepresentation]
+-[WebHistoryItem icon]
+-[WebView(WebIBActions) goForward:]
+-[WebView goForward]
__ZN13WebDragClient24declareAndWriteDragImageEP12NSPasteboardP10DOMElementP5NSURLP8NSStringPN7WebCore5FrameE
__Z14getTopHTMLViewPN7WebCore5FrameE
-[DOMNode(WebDOMNodeOperations) webArchive]
@@ -953,7 +1112,7 @@ __Z14getTopHTMLViewPN7WebCore5FrameE
-[DOMNode(WebDOMNodeOperations) _URLsFromSelectors:]
-[DOMDocument(WebDOMDocumentOperations) URLWithAttributeString:]
-[WebDataSource subresourceForURL:]
--[WebResource(WebResourcePrivate) _initWithData:URL:response:]
+-[WebResource(WebResourcePrivate) _initWithData:URL:response:MIMEType:]
-[WebArchive initWithMainResource:subresources:subframeArchives:]
-[WebArchive init]
-[NSPasteboard(WebExtras) _web_declareAndWriteDragImageForElement:URL:title:archive:source:]
@@ -977,7 +1136,7 @@ __ZN7WebCore20CachedResourceClient14notifyFinishedEPNS_14CachedResourceE
_WKGetPreferredExtensionForMIMEType
__ZN13WebDragClient27willPerformDragSourceActionEN7WebCore16DragSourceActionERKNS0_8IntPointEPNS0_9ClipboardE
-[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:]
-__ZZN13WebDragClient9startDragEN3WTF9RetainPtrI7NSImageEERKN7WebCore8IntPointES7_PNS4_9ClipboardEPNS4_5FrameEbE19__PRETTY_FUNCTION__
+__ZN13WebDragClient9startDragEN3WTF9RetainPtrI7NSImageEERKN7WebCore8IntPointES7_PNS4_9ClipboardEPNS4_5FrameEb
-[WebHTMLView(WebInternal) _mouseDownEvent]
-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]
-[WebHTMLView draggingSourceOperationMaskForLocal:]
@@ -991,194 +1150,159 @@ __ZNK19WebPasteboardHelper25insertablePasteboardTypesEv
-[WebView draggingUpdated:]
-[WebView _shouldAutoscrollForDraggingInfo:]
-[WebHTMLView draggedImage:movedTo:]
--[WebFrameBridge window]
-[WebView draggingExited:]
-[WebHTMLView draggedImage:endedAt:operation:]
-[WebArchive dealloc]
-[WebArchivePrivate dealloc]
-[WebResource dealloc]
-[WebResourcePrivate dealloc]
-__ZN15WebChromeClient12createWindowEPN7WebCore5FrameERKNS0_16FrameLoadRequestE
-__ZN15WebChromeClient18setToolbarsVisibleEb
-__ZN15WebChromeClient19setStatusbarVisibleEb
-__ZN15WebChromeClient20setScrollbarsVisibleEb
-__ZN15WebChromeClient17setMenubarVisibleEb
-__ZN15WebChromeClient12setResizableEb
-__ZN15WebChromeClient10windowRectEv
-__ZN15WebChromeClient8pageRectEv
-__ZN15WebChromeClient13setWindowRectERKN7WebCore9FloatRectE
-__ZN15WebChromeClient4showEv
--[WebHTMLView windowDidResignKey:]
--[WebHTMLView removeMouseMovedObserver]
-__ZN20WebFrameLoaderClient38dispatchDidLoadResourceFromMemoryCacheEPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestERKNS0_16ResourceResponseEi
-_WKDrawBezeledTextArea
-+[WebStringTruncator centerTruncateString:toWidth:]
-__Z15defaultMenuFontv
-__ZN15WebChromeClient5printEPN7WebCore5FrameE
--[WebFrameView documentViewShouldHandlePrint]
--[WebFrameView printOperationWithPrintInfo:]
--[WebFrameView canPrintHeadersAndFooters]
--[WebHTMLView canPrintHeadersAndFooters]
--[WebHTMLView knowsPageRange:]
--[WebHTMLView _availablePaperWidthForPrintOperation:]
--[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]
--[WebFrame childFrames]
--[WebView(WebViewPrintingPrivate) _adjustPrintingMarginsForHeaderAndFooter]
--[NSPrintOperation(WebKitExtras) _web_pageSetupScaleFactor]
--[WebView(WebViewPrintingPrivate) _headerHeight]
-__Z28CallUIDelegateReturningFloatP7WebViewP13objc_selector
-__Z26CallDelegateReturningFloatP7WebViewP11objc_objectP13objc_selector
--[WebView(WebViewPrintingPrivate) _footerHeight]
--[WebHTMLView _scaleFactorForPrintOperation:]
--[WebHTMLView(WebHTMLViewFileInternal) _calculatePrintHeight]
--[WebHTMLView _provideTotalScaleFactorForPrintOperation:]
--[WebHTMLView beginDocument]
--[WebHTMLView rectForPage:]
--[WebWindowWatcher windowWillClose:]
--[WebHTMLView endDocument]
--[WebHTMLView _endPrintMode]
--[WebHTMLView performKeyEquivalent:]
--[WebHTMLView _handleStyleKeyEquivalent:]
--[WebPreferences(WebPrivate) respectStandardStyleKeyEquivalents]
--[WebView(WebPendingPublic) shouldClose]
--[WebView _windowWillClose:]
--[WebView shouldCloseWithWindow]
--[WebHTMLView windowWillClose:]
--[WebView close]
--[WebView(WebIBActions) stopLoading:]
--[WebFrame stopLoading]
--[WebView(WebPrivate) _clearUndoRedoOperations]
--[WebView(WebPrivate) _close]
--[WebView(AllWebViews) _removeFromAllWebViewsSet]
--[WebView(WebPendingPublic) setScriptDebugDelegate:]
--[WebView(WebPrivate) _detachScriptDebuggerFromAllFrames]
--[WebView removeDragCaret]
-__ZN15WebEditorClient13pageDestroyedEv
-__ZN18WebInspectorClient11closeWindowEv
-__ZN18WebInspectorClient18inspectorDestroyedEv
-__ZN18WebInspectorClientD1Ev
-__ZN20WebContextMenuClient20contextMenuDestroyedEv
-__ZN13WebDragClient23dragControllerDestroyedEv
-__ZN15WebChromeClient15chromeDestroyedEv
--[WebView preferencesIdentifier]
--[WebPreferences identifier]
-+[WebPreferences(WebPrivate) _removeReferenceForIdentifier:]
--[WebPreferences(WebPrivate) didRemoveFromWebView]
--[WebHTMLView(WebPrivate) _removeTrackingRects:count:]
--[WebHTMLView(WebPrivate) _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]
-_NPN_GetURLNotify
--[WebBaseNetscapePluginView(WebNPPCallbacks) getURLNotify:target:notifyData:]
--[WebBaseNetscapePluginView(WebNPPCallbacks) requestWithURLCString:]
--[NSString(WebKitExtras) _web_stringByStrippingReturnCharacters]
--[WebBaseNetscapePluginView mouseEntered:]
--[WebBaseNetscapePluginView getCarbonEvent:withEvent:]
-_WKConvertNSEventToCarbonEvent
--[WebBaseNetscapePluginView modifiersForEvent:]
--[WebBaseNetscapePluginView mouseExited:]
--[WebHistoryItem alternateTitle]
--[WebHistoryItem setAlternateTitle:]
--[WebView(WebIBActions) goBack:]
--[WebView goBack]
--[WebBaseNetscapePluginStream destroyStreamWithError:]
-+[WebBaseNetscapePluginStream reasonForError:]
-__ZNK20WebFrameLoaderClient21shouldGoToHistoryItemEPN7WebCore11HistoryItemE
--[WebHistoryItem(WebPrivate) URL]
-__ZN20WebFrameLoaderClient16restoreViewStateEv
--[WebHTMLView(WebPrivate) scrollPoint:]
--[WebBaseNetscapePluginView acceptsFirstResponder]
--[WebFrameBridge makeFirstResponder:]
--[WebView(WebPrivate) _pushPerformingProgrammaticFocus]
--[WebBaseNetscapePluginView becomeFirstResponder]
--[WebBaseNetscapePluginView installKeyEventHandler]
--[WebView(WebPrivate) _popPerformingProgrammaticFocus]
--[WebBaseNetscapePluginView mouseDown:]
--[WebViewFactory bridgeForView:]
--[WebBaseNetscapePluginView createPluginScriptableObject]
--[WebBaseNetscapePluginView isStarted]
-_NPN_MemFree
--[WebBaseNetscapePluginView mouseUp:]
--[WebBaseNetscapePluginView windowResignedKey:]
--[WebBaseNetscapePluginView windowBecameKey:]
--[WebHistoryItem icon]
--[WebView(WebIBActions) validateUserInterfaceItem:]
--[WebView(WebIBActions) validateUserInterfaceItemWithoutDelegate:]
-__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objecta
-__Z28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selectorS2_a
-__ZN15WebChromeClient11canRunModalEv
--[WebFrameView keyDown:]
--[WebFrameView _goBack]
-__ZN20WebFrameLoaderClient29setDocumentViewFromCachedPageEPN7WebCore10CachedPageE
--[NSEvent(WebExtras) _web_isReturnOrEnterKeyEvent]
--[NSEvent(WebExtras) _web_isKeyEvent:]
-__ZN20WebFrameLoaderClient11forceLayoutEv
--[WebHTMLView validateUserInterfaceItem:]
--[WebHTMLView validateUserInterfaceItemWithoutDelegate:]
--[WebHTMLView selectAll:]
--[WebHTMLView callDelegateDoCommandBySelectorIfNeeded:]
--[WebHTMLView(WebDocumentPrivateProtocols) selectAll]
-_WKSecondsSinceLastInputEvent
--[WebHTMLView(WebInternal) closeIfNotCurrentView]
--[WebHTMLView(WebPrivate) view:stringForToolTip:point:userData:]
--[WebHTMLView scrollWheel:]
-_WKGetWheelEventDeltas
--[WebClipView scrollWheel:]
--[WebDynamicScrollBarsView scrollWheel:]
--[WebDynamicScrollBarsView allowsVerticalScrolling]
--[WebDynamicScrollBarsView autoforwardsScrollWheelEvents]
--[NSString(WebKitExtras) _web_widthWithFont:]
-_canUseFastRenderer
--[WebViewFactory inputElementAltText]
--[WebHTMLView deleteBackward:]
--[WebHTMLView(WebPrivate) _isEditable]
-__ZN15WebEditorClient17shouldDeleteRangeEPN7WebCore5RangeE
--[WebDefaultEditingDelegate webView:shouldDeleteDOMRange:]
-__ZN15WebEditorClient28textWillBeDeletedInTextFieldEPN7WebCore7ElementE
--[WebViewFactory defaultLanguageCode]
-_WKSetPatternPhaseInUserSpace
--[WebFrame(WebInternal) _findFrameWithSelection]
--[WebFrame(WebInternal) _hasSelection]
-__ZN20WebFrameLoaderClient33dispatchWillPerformClientRedirectERKN7WebCore4KURLEdd
-__Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_dS0_S0_
-__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_dS0_S0_
-__ZN20WebFrameLoaderClient31dispatchDidCancelClientRedirectEv
-__Z10isHexDigitc
-__Z13hexDigitValuec
-[WebView acceptsFirstResponder]
--[WebFrameView acceptsFirstResponder]
--[WebView becomeFirstResponder]
--[WebView dealloc]
--[WebViewPrivate dealloc]
-__ZN20WebFrameLoaderClient14shouldFallBackERKN7WebCore13ResourceErrorE
-__ZN20WebFrameLoaderClient30dispatchDidFailProvisionalLoadERKN7WebCore13ResourceErrorE
--[WebView(WebPrivate) _didFailProvisionalLoadWithError:forFrame:]
--[WebHistoryPrivate removeItemForURLString:]
--[WebHistoryPrivate _removeItemFromDateCaches:]
-__ZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E4findIxNS_22IdentityHashTranslatorIxS5_S9_EEEENS_17HashTableIteratorIxS5_S7_S9_SE_SC_EERKT_
--[WebHistoryItem(WebInternal) _mergeAutoCompleteHints:]
--[WebFrameBridge keyboardUIMode]
--[WebFrameBridge _retrieveKeyboardUIModeFromPreferences:]
--[WebFrameBridge _preferences]
--[WebPreferences tabsToLinks]
--[WebClipView _focusRingVisibleRect]
--[WebHTMLView(WebInternal) copy:]
-__ZN15WebEditorClient24smartInsertDeleteEnabledEv
--[WebView(WebViewEditing) smartInsertDeleteEnabled]
+-[WebHTMLRepresentation receivedError:withDataSource:]
+-[WebFrameBridge imageTitleForFilename:size:]
+-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]
+-[WebPluginPackage viewFactory]
++[WebPluginController plugInViewWithArguments:fromPluginPackage:]
+-[WebPluginController webFrame]
+-[WebView(WebPrivate) defersCallbacks]
+-[WebView(WebPrivate) setDefersCallbacks:]
+-[WebPluginController addPlugin:]
++[NSObject(WebScripting) isSelectorExcludedFromWebScript:]
+-[WebPluginController destroyPlugin:]
+-[WebIconDatabase(WebInternal) _applicationWillTerminate:]
++[WebView _applicationWillTerminate]
+-[WebHTMLView(WebPrivate) pasteboard:provideDataForType:]
+-[WebHTMLView(WebInternal) promisedDragTIFFDataSource]
+-[WebArchive initWithData:]
+-[WebArchive _initWithPropertyList:]
+-[WebResource(WebResourcePrivate) _initWithPropertyList:]
++[WebResource(WebResourcePrivate) _resourcesFromPropertyLists:]
+-[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
+-[WebArchive subresources]
+-[WebArchive mainResource]
-[WebResource MIMEType]
--[WebResource data]
-__ZN15WebEditorClient33didSetSelectionTypesForPasteboardEv
--[WebDefaultEditingDelegate webView:didSetSelectionTypesForPasteboard:]
-__ZN15WebEditorClient24dataForArchivedSelectionEPN7WebCore5FrameE
-+[WebArchiver archiveSelectionInFrame:]
--[DOMNode(WebDOMNodeOperations) _subresourceURLs]
-__ZN15WebEditorClient29didWriteSelectionToPasteboardEv
--[WebDefaultEditingDelegate webView:didWriteSelectionToPasteboard:]
--[WebHTMLView(WebInternal) paste:]
-__ZN15WebEditorClient23textDidChangeInTextAreaEPN7WebCore7ElementE
--[WebHTMLView moveToBeginningOfLine:]
--[WebHTMLView callWebCoreCommand:]
-__ZN3WTF6VectorIcLm256EE6resizeEm
--[WebHTMLView moveRight:]
--[WebHTMLView moveToEndOfLine:]
+-[WebResource(WebResourcePrivate) _fileWrapperRepresentation]
+-[NSPasteboard(WebExtras) _web_writeFileWrapperAsRTFDAttachment:]
++[WebPluginDatabase closeSharedDatabase]
+-[WebPluginDatabase close]
+-[WebPluginDatabase(Internal) _removePlugin:]
++[WebView(WebPrivate) _unregisterViewClassAndRepresentationClassForMIMEType:]
+-[WebBasePluginPackage wasRemovedFromPluginDatabase:]
+-[WebNetscapePluginPackage wasRemovedFromPluginDatabase:]
+-[WebNetscapePluginPackage(Internal) _unloadWithShutdown:]
+___tcf_3
+___tcf_0
+___tcf_2
+_WKDrawBezeledTextFieldCell
+-[WebView(WebPrivate) _UIDelegateForwarder]
++[WebDefaultUIDelegate sharedUIDelegate]
+-[WebClipView resetAdditionalClip]
+-[WebView(WebIBActions) canGoBack]
+-[WebView(WebIBActions) canGoForward]
+-[WebHTMLView(WebPrivate) hitTest:]
++[WebElementDictionary initialize]
+-[WebElementDictionary initWithHitTestResult:]
++[WebElementDictionary initializeLookupTable]
+__Z12addLookupKeyP8NSStringP13objc_selector
+-[WebElementDictionary objectForKey:]
+-[WebElementDictionary dealloc]
+-[WebView(WebPendingPublic) isHoverFeedbackSuspended]
+__ZN15WebChromeClient23mouseDidMoveOverElementERKN7WebCore13HitTestResultEj
+-[WebView(WebPrivate) _mouseDidMoveOverElement:modifierFlags:]
+__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectj
+__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_j
+-[WebElementDictionary _absoluteLinkURL]
+__ZN15WebChromeClient10setToolTipERKN7WebCore6StringE
+-[WebHTMLView(WebPrivate) _setToolTip:]
+_WKCGContextGetShouldSmoothFonts
+_WKSetCGFontRenderingMode
+__Z29_updateMouseoverTimerCallbackP16__CFRunLoopTimerPv
+-[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent]
+-[WebHTMLView(WebPrivate) _updateMouseoverWithEvent:]
+-[WebIconDatabase(WebInternal) _iconForFileURL:withSize:]
+-[WebIconDatabase(WebInternal) _iconsBySplittingRepresentationsOfIcon:]
+-[WebIconDatabase(WebInternal) _iconFromDictionary:forSize:cache:]
+-[WebHTMLView(WebPrivate) _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
+__ZN20WebFrameLoaderClient29dispatchDidFinishDocumentLoadEv
+__ZN20WebFrameLoaderClient27dispatchDidLoadMainResourceEPN7WebCore14DocumentLoaderE
++[WebScriptDebugServer listenerCount]
+__ZN20WebFrameLoaderClient24dispatchDidFinishLoadingEPN7WebCore14DocumentLoaderEm
+-[WebView(WebViewInternal) _removeObjectForIdentifier:]
+__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E4findImNS_22IdentityHashTranslatorImS6_SA_EEEENS_17HashTableIteratorImS6_S8_SA_SF_SD_EERKT_
+__ZN20WebDocumentLoaderMac17decreaseLoadCountEm
+__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E4findImNS_22IdentityHashTranslatorImmS4_EEEENS_17HashTableIteratorImmS2_S4_S6_S6_EERKT_
++[WebPluginDatabase sharedDatabase]
+-[WebPluginDatabase init]
++[WebPluginDatabase(Internal) _defaultPlugInPaths]
+-[WebPluginDatabase setPlugInPaths:]
+-[WebPluginDatabase refresh]
+-[WebPluginDatabase(Internal) _scanForNewPlugins]
+-[WebPluginDatabase(Internal) _plugInPaths]
++[WebBasePluginPackage initialize]
++[WebBasePluginPackage pluginWithPath:]
+-[WebPluginPackage initWithPath:]
+-[WebBasePluginPackage initWithPath:]
+-[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:]
+-[WebBasePluginPackage dealloc]
++[WebNetscapePluginPackage initialize]
+_WebLMGetCurApRefNum
+_WebLMSetCurApRefNum
+-[WebNetscapePluginPackage initWithPath:]
+-[WebNetscapePluginPackage _initWithPath:]
+-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]
+-[NSArray(WebPluginExtensions) _web_lowercaseStrings]
+-[WebBasePluginPackage setMIMEToExtensionsDictionary:]
+-[WebBasePluginPackage setMIMEToDescriptionDictionary:]
+-[WebBasePluginPackage filename]
+-[WebBasePluginPackage setName:]
+-[WebBasePluginPackage setPluginDescription:]
+-[WebNetscapePluginPackage getPluginInfoFromResources]
+-[WebNetscapePluginPackage openResourceFile]
++[WebBasePluginPackage preferredLocalizationName]
+-[WebPluginPackage load]
+__Z13webGetNSImagePN7WebCore5ImageE7_NSSize
++[NSNotificationCenter(WebNSNotificationCenterExtras) _postNotificationName:]
+-[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:]
+-[NSString(WebNSURLExtras) _web_isUserVisibleURL]
+-[NSString(WebNSURLExtras) _webkit_looksLikeAbsoluteURL]
+-[WebHistoryItem(WebPrivate) visitCount]
+-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]
+-[WebView(WebViewInternal) _dispatchDidReceiveIconFromWebFrame:]
+__ZNK19WebPasteboardHelper17urlFromPasteboardEPK12NSPasteboardPN7WebCore6StringE
+-[NSPasteboard(WebExtras) _web_bestURL]
++[WebURLsWithTitles URLsFromPasteboard:]
++[WebView(WebPrivate) canShowFile:]
++[WebView(WebPrivate) _MIMETypeForFile:]
+-[WebIconDatabase releaseIconForURL:]
+-[NSView(WebExtras) _web_dragOperationForDraggingInfo:]
+-[WebHistory removeAllItems]
+-[WebHistoryPrivate removeAllItems]
++[WebCache empty]
+-[WebBackForwardList pageCacheSize]
+-[WebBackForwardList setPageCacheSize:]
+-[WebView(WebPrivate) setUsesPageCache:]
+-[WebIconDatabase(WebPendingPublic) removeAllIcons]
+__ZN21WebIconDatabaseClient25dispatchDidRemoveAllIconsEv
+-[WebIconDatabase(WebInternal) _sendDidRemoveAllIconsNotification]
+__ZN21WebIconDatabaseClient13performImportEv
+__Z21importToWebCoreFormatv
++[ThreadEnabler enableThreading]
+__Z20objectFromPathForKeyP8NSStringP11objc_object
+-[ThreadEnabler threadEnablingSelector:]
+-[NSString(WebKitExtras) _webkit_fixedCarbonPOSIXPath]
+-[WebViewFactory pluginsInfo]
+-[WebFrameView keyDown:]
+_NPN_PostURLNotify
+-[WebBaseNetscapePluginView(WebNPPCallbacks) postURLNotify:target:len:buf:file:notifyData:]
+-[WebBaseNetscapePluginView(WebNPPCallbacks) _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]
+-[NSData(PluginExtras) _web_startsWithBlankLine]
+-[NSData(PluginExtras) _web_locationAfterFirstBlankLine]
+-[NSData(WebNSDataExtras) _webkit_parseRFC822HeaderFields]
+-[NSString(WebNSDataExtrasInternal) _web_capitalizeRFC822HeaderFieldName]
+__ZN3WTF6VectorIN7WebCore15FormDataElementELm0EE6shrinkEm
+__ZN3WTF6VectorIcLm0EE6shrinkEm
+-[NSString(WebKitExtras) _web_widthWithFont:]
+-[WebView(WebViewInternal) _receivedIconChangedNotification:]
+-[WebView mainFrameURL]
-[WebHTMLView menuForEvent:]
-[WebViewFactory contextMenuItemTagOpenLink]
-[WebViewFactory contextMenuItemTagOpenLinkInNewWindow]
@@ -1202,848 +1326,47 @@ __ZN3WTF6VectorIcLm256EE6resizeEm
-[WebViewFactory contextMenuItemTagIgnoreGrammar]
-[WebViewFactory contextMenuItemTagCut]
-[WebViewFactory contextMenuItemTagPaste]
-__ZN15WebEditorClient34updateSpellingUIWithMisspelledWordERKN7WebCore6StringE
-__ZN15WebEditorClient17getGuessesForWordERKN7WebCore6StringERN3WTF6VectorIS1_Lm0EEE
--[WebViewFactory contextMenuItemTagSpellingMenu]
--[WebViewFactory contextMenuItemTagShowSpellingPanel:]
--[WebViewFactory contextMenuItemTagCheckSpelling]
--[WebViewFactory contextMenuItemTagCheckSpellingWhileTyping]
--[WebViewFactory contextMenuItemTagCheckGrammarWithSpelling]
-__ZN15WebEditorClient19spellingUIIsShowingEv
--[WebViewFactory contextMenuItemTagFontMenu]
--[WebViewFactory contextMenuItemTagShowFonts]
--[WebViewFactory contextMenuItemTagBold]
--[WebViewFactory contextMenuItemTagItalic]
--[WebViewFactory contextMenuItemTagUnderline]
--[WebViewFactory contextMenuItemTagOutline]
--[WebViewFactory contextMenuItemTagStyles]
--[WebViewFactory contextMenuItemTagShowColors]
--[WebViewFactory contextMenuItemTagSpeechMenu]
--[WebViewFactory contextMenuItemTagStartSpeaking]
--[WebViewFactory contextMenuItemTagStopSpeaking]
--[WebViewFactory contextMenuItemTagWritingDirectionMenu]
--[WebViewFactory contextMenuItemTagDefaultDirection]
--[WebViewFactory contextMenuItemTagLeftToRight]
--[WebViewFactory contextMenuItemTagRightToLeft]
__ZN20WebContextMenuClient29getCustomMenuFromDefaultItemsEPN7WebCore11ContextMenuE
__Z19isPreVersion3Clientv
__Z28isPreInspectElementTagClientv
-__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_
-__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_
--[WebHTMLView accessibilityAttributeValue:]
-__ZN20WebContextMenuClient18lookUpInDictionaryEPN7WebCore5FrameE
--[WebHTMLView(WebInternal) _lookUpInDictionaryFromMenu:]
--[WebHTMLView(WebDocumentPrivateProtocols) selectedString]
--[WebHTMLView(WebDocumentPrivateProtocols) selectedAttributedString]
--[WebHTMLView(WebHTMLViewFileInternal) _selectedRange]
--[WebHTMLView(WebDocumentPrivateProtocols) _attributeStringFromDOMRange:]
--[WebViewFactory unregisterUniqueIdForUIElement:]
-_WKUnregisterUniqueIdForElement
--[WebViewFactory accessibilityHandleFocusChanged]
-_WKAccessibilityHandleFocusChanged
--[WebBaseNetscapePluginView preferencesHaveChanged:]
--[WebIconDatabase(WebInternal) _iconForFileURL:withSize:]
--[WebIconDatabase(WebInternal) _iconsBySplittingRepresentationsOfIcon:]
--[WebIconDatabase(WebInternal) _iconFromDictionary:forSize:cache:]
--[WebHTMLView needsPanelToBecomeKey]
--[WebHTMLView acceptsFirstMouse:]
--[NSEvent(WebExtras) _web_isOptionTabKeyEvent]
--[NSString(WebNSURLExtras) _webkit_rangeOfURLScheme]
--[NSString(WebNSURLExtras) _web_isUserVisibleURL]
--[NSString(WebNSURLExtras) _webkit_looksLikeAbsoluteURL]
--[WebHistory _itemForURLString:]
--[WebHistoryItem(WebPrivate) visitCount]
--[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]
--[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]
--[WebPluginPackage viewFactory]
-+[WebPluginController plugInViewWithArguments:fromPluginPackage:]
--[WebPluginController webFrame]
--[WebView(WebPrivate) defersCallbacks]
--[WebView(WebPrivate) setDefersCallbacks:]
--[WebPluginController addPlugin:]
--[WebPluginController destroyPlugin:]
--[WebPluginController _webPluginContainerCheckIfAllowedToLoadRequest:inFrame:resultObject:selector:]
-+[WebPluginContainerCheck checkWithRequest:target:resultObject:selector:controller:]
--[WebPluginContainerCheck initWithRequest:target:resultObject:selector:controller:]
--[WebPluginContainerCheck start]
--[WebPluginContainerCheck _isForbiddenFileLoad]
--[WebPluginController bridge]
--[WebPluginContainerCheck _askPolicyDelegate]
--[WebPluginController webView]
--[WebPluginContainerCheck _actionInformationWithURL:]
--[WebPolicyDecisionListener _initWithTarget:action:]
--[WebPolicyDecisionListenerPrivate initWithTarget:action:]
--[WebPolicyDecisionListener use]
--[WebPolicyDecisionListener _usePolicy:]
--[WebPluginContainerCheck _continueWithPolicy:]
--[WebPluginController _webPluginContainerCancelCheckIfAllowedToLoadRequest:]
--[WebPluginContainerCheck cancel]
--[WebPolicyDecisionListener _invalidate]
--[WebPolicyDecisionListener dealloc]
--[WebPolicyDecisionListenerPrivate dealloc]
--[WebPluginContainerCheck dealloc]
-+[NSObject(WebScripting) isKeyExcludedFromWebScript:]
-+[NSObject(WebScripting) isSelectorExcludedFromWebScript:]
--[WebDataSource(WebPrivate) _mainDocumentError]
--[WebView(WebIBActions) canMakeTextLarger]
--[WebView(WebFileInternal) _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]
--[WebFrame(WebInternal) _documentViews]
--[WebHTMLView(WebTextSizing) _tracksCommonSizeFactor]
--[WebView(WebIBActions) canMakeTextStandardSize]
--[WebView(WebIBActions) canMakeTextSmaller]
--[WebHTMLRepresentation canProvideDocumentSource]
--[WebViewFactory pluginSupportsMIMEType:]
--[WebView supportsTextEncoding]
--[WebHTMLView(WebDocumentPrivateProtocols) supportsTextEncoding]
--[WebView customTextEncodingName]
--[WebView _mainFrameOverrideEncoding]
--[WebView initWithCoder:]
--[WebPreferences initWithCoder:]
-+[WebPreferences(WebInternal) _concatenateKeyWithIBCreatorID:]
--[WebView setPreferences:]
--[WebPreferences setMinimumFontSize:]
--[WebHTMLRepresentation documentSource]
--[WebDataSource data]
--[WebFrame loadData:MIMEType:textEncodingName:baseURL:]
--[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]
--[WebView(WebViewInternal) _userVisibleBundleVersionFromFullVersion:]
--[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]
-+[WebView(WebFileInternal) _preferencesRemovedNotification:]
-+[WebView(WebFileInternal) _maxCacheModelInAnyInstance]
-+[WebPreferences(WebPrivate) _checkLastReferenceForIdentifier:]
--[WebPreferences dealloc]
--[WebPreferencesPrivate dealloc]
--[WebFramePolicyListener download]
-__ZZN20WebFrameLoaderClient8downloadEPN7WebCore14ResourceHandleERKNS0_15ResourceRequestES5_RKNS0_16ResourceResponseEE19__PRETTY_FUNCTION__
--[WebDownload _initWithLoadingConnection:request:response:delegate:proxy:]
--[WebDownload _setRealDelegate:]
--[WebDownloadInternal setRealDelegate:]
--[WebDownload init]
--[WebDownloadInternal respondsToSelector:]
--[WebDownloadInternal downloadDidBegin:]
--[WebDownloadInternal download:didReceiveResponse:]
-__ZNK20WebFrameLoaderClient25setOriginalURLForDownloadEP11WebDownloadRKN7WebCore15ResourceRequestE
--[WebBackForwardList backListCount]
--[WebBackForwardList itemAtIndex:]
-__ZN20WebFrameLoaderClient29interruptForPolicyChangeErrorERKN7WebCore15ResourceRequestE
--[WebDownloadInternal download:decideDestinationWithSuggestedFilename:]
--[WebDownloadInternal download:didCreateDestination:]
--[WebDownloadInternal download:didReceiveDataOfLength:]
--[WebDownloadInternal downloadDidFinish:]
--[WebDownload dealloc]
--[WebDownloadInternal dealloc]
+-[WebDataSource(WebPrivate) _fileWrapperForURL:]
+-[WebView(WebPrivate) _cachedResponseForURL:]
+-[NSMutableURLRequest(WebNSURLRequestExtras) _web_setHTTPUserAgent:]
+-[WebElementDictionary _absoluteImageURL]
+-[WebElementDictionary _image]
+-[WebElementDictionary _titleDisplayString]
+__Z13NSStringOrNilN7WebCore6StringE
+-[WebElementDictionary _textContent]
__ZNK20WebFrameLoaderClient29generatedMIMETypeForURLSchemeERKN7WebCore6StringE
-[WebHistory removeItems:]
-[WebHistoryPrivate removeItems:]
-[WebHistoryPrivate removeItem:]
-[NSView(WebExtras) _web_parentWebFrameView]
--[WebDynamicScrollBarsView allowsHorizontalScrolling]
-+[NSPasteboard(WebExtras) _web_setFindPasteboardString:withOwner:]
--[WebHTMLView(WebPrivate) pasteboardChangedOwner:]
-__ZN15WebEditorClient17userVisibleStringEP5NSURL
-__ZN13WebDragClient22createDragImageForLinkERN7WebCore4KURLERKNS0_6StringEPNS0_5FrameE
--[WebHTMLView(WebPrivate) _dragImageForURL:withLabel:]
--[NSString(WebKitExtras) _web_drawDoubledAtPoint:withTopColor:bottomColor:font:]
--[NSString(WebKitExtras) _web_drawAtPoint:font:textColor:]
-+[WebStringTruncator rightTruncateString:toWidth:withFont:]
--[WebFramePolicyListener ignore]
--[WebView(WebIBActions) reload:]
--[WebFrame reload]
-__ZN20WebFrameLoaderClient28updateGlobalHistoryForReloadERKN7WebCore4KURLE
-__ZN20WebFrameLoaderClient19dispatchDidFailLoadERKN7WebCore13ResourceErrorE
--[WebView(WebPrivate) _didFailLoadWithError:forFrame:]
-__ZN20WebFrameLoaderClient22createJavaAppletWidgetERKN7WebCore7IntSizeEPNS0_7ElementERKNS0_4KURLERKN3WTF6VectorINS0_6StringELm0EEESE_
--[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]
--[WebFrameBridge valueForKey:keys:values:]
--[WebFrameBridge getAppletInView:]
--[WebPluginController webPlugInContainerShowStatus:]
--[WebFrame(WebPrivate) _isDisplayingStandaloneImage]
--[WebHTMLView(WebPrivate) _hasSelection]
--[WebHTMLView(WebInternal) isGrammarCheckingEnabled]
-_cacheModelForMainBundle
-+[WebIconDatabase(WebPrivate) _checkIntegrityBeforeOpening]
-__ZN21WebIconDatabaseClientC1Ev
-__ZN7WebCore18IconDatabaseClientC2Ev
-__ZN7WebCore6StringD1Ev
-__ZN3WTF6RefPtrIN7WebCore10StringImplEED1Ev
-__ZN7WebCore6SharedINS_10StringImplEE5derefEv
-__ZNK3WTF7HashSetIN7WebCore6StringENS_7StrHashIS2_EENS_10HashTraitsIS2_EEE4sizeEv
-__ZNK3WTF7HashSetIN7WebCore6StringENS_7StrHashIS2_EENS_10HashTraitsIS2_EEE3endEv
-__ZZN3WTF11addIteratorIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS_7StrHashIS3_EENS_10HashTraitsIS3_EES9_EEvPKNS_9HashTableIT_T0_T1_T2_T3_T4_EEPNS_22HashTableConstIteratorISB_SC_SD_SE_SF_SG_EEE8__func__
-__ZZN3WTF22HashTableConstIteratorIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS_7StrHashIS3_EENS_10HashTraitsIS3_EES9_EppEvE8__func__
-__ZZN3WTF14removeIteratorIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS_7StrHashIS3_EENS_10HashTraitsIS3_EES9_EEvPNS_22HashTableConstIteratorIT_T0_T1_T2_T3_T4_EEE8__func__
-__ZNK3WTF7HashSetIN7WebCore6StringENS_7StrHashIS2_EENS_10HashTraitsIS2_EEE5beginEv
-__ZN3WTF17IdentityExtractorIPN7WebCore10StringImplEE7extractERKS3_
-__ZN3WTF17GenericHashTraitsIPN7WebCore10StringImplEE10emptyValueEv
-__ZN3WTF10HashTraitsIPN7WebCore10StringImplEE12deletedValueEv
-__ZN3WTFneINS_9HashTableIPN7WebCore10StringImplES4_NS_17IdentityExtractorIS4_EENS_7StrHashIS4_EENS_10HashTraitsIS4_EESA_EENS2_6StringEEEbRKNS_29HashTableConstIteratorAdapterIT_T0_EESI_
-__ZNK7WebCore6StringcvP8NSStringEv
-__ZNK3WTF6RefPtrIN7WebCore10StringImplEEntEv
-__ZNK3WTF6RefPtrIN7WebCore10StringImplEEdeEv
-__ZN3WTF29HashTableConstIteratorAdapterINS_9HashTableIPN7WebCore10StringImplES4_NS_17IdentityExtractorIS4_EENS_7StrHashIS4_EENS_10HashTraitsIS4_EESA_EENS2_6StringEEppEv
-__ZN3WTF9RetainPtrI7NSArrayEC1EPS1_
-__ZNK3WTF9RetainPtrI7NSArrayE3getEv
-__Z17addTypesFromClassP19NSMutableDictionaryP10objc_classP7NSArray
-__ZN7WebCore6StringC1Ev
-__ZN3WTF6RefPtrIN7WebCore10StringImplEEC1Ev
-__ZN7WebCore12ChromeClientC2Ev
-__ZN7WebCore17ContextMenuClientC2Ev
-__ZN7WebCore12EditorClientC2Ev
-__ZN3WTF9RetainPtrI19WebEditorUndoTargetEC1EPS1_
-__ZN7WebCore10DragClientC2Ev
-__ZN7WebCore15InspectorClientC2Ev
-__ZN3WTF9RetainPtrI28WebInspectorWindowControllerEC1Ev
-__ZNK7WebCore4Page6chromeEv
-__ZNK3WTF6OwnPtrIN7WebCore6ChromeEE3getEv
-__ZN7WebCore6Chrome6clientEv
-__ZN15WebChromeClient7webViewEv
-__ZN7WebCore17FrameLoaderClientC2Ev
-__ZN3WTF9RetainPtrI8WebFrameEC1EPS1_
-__ZN3WTF9RetainPtrI22WebFramePolicyListenerEC1Ev
-__ZN7WebCore5TimerI20WebFrameLoaderClientEC1EPS1_MS1_FvPS2_E
-__ZN7WebCore12AtomicStringC1EP8NSString
-__ZNK7WebCore6String4implEv
-__ZNK3WTF6RefPtrIN7WebCore10StringImplEE3getEv
-__ZN7WebCore6StringC1EPNS_10StringImplE
-__ZN3WTF6RefPtrIN7WebCore10StringImplEEC1EPS2_
-__ZN7WebCore12AtomicStringD1Ev
-__ZN3WTF9RetainPtrIP11objc_objectEC1Ev
-__ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEEC1Ev
-__ZN3WTF6RefPtrI20WebDocumentLoaderMacEC1EPS1_
-__ZN7WebCore6SharedINS_14DocumentLoaderEE3refEv
-__ZNK3WTF6RefPtrI20WebDocumentLoaderMacE3getEv
-__ZNK3WTF9RetainPtrI8WebFrameE3getEv
-__ZNK3WTF6RefPtrI20WebDocumentLoaderMacEptEv
-__ZN3WTF9RetainPtrIP11objc_objectEaSES2_
-__Z23needsDataLoadWorkaroundP7WebView
-__ZN3WTF6RefPtrI20WebDocumentLoaderMacE7releaseEv
-__ZN3WTF8adoptRefI20WebDocumentLoaderMacEENS_10PassRefPtrIT_EEPS3_
-__ZN3WTF10PassRefPtrI20WebDocumentLoaderMacEC1EPS1_b
-__ZN3WTF10PassRefPtrIN7WebCore14DocumentLoaderEEC1I20WebDocumentLoaderMacEERKNS0_IT_EE
-__ZNK3WTF10PassRefPtrI20WebDocumentLoaderMacE10releaseRefEv
-__ZN3WTF10PassRefPtrI20WebDocumentLoaderMacED1Ev
-__ZN3WTF6RefPtrI20WebDocumentLoaderMacED1Ev
-__ZNK3WTF9RetainPtrI8WebFrameEptEv
-__ZNK20WebFrameLoaderClient10hasWebViewEv
-__Z10dataSourcePN7WebCore14DocumentLoaderE
-__ZNK7WebCore9FrameTree10childCountEv
-__ZNK7WebCore11FrameLoader23committingFirstRealLoadEv
-__ZNK7WebCore4Page14dragControllerEv
-__ZNK3WTF6OwnPtrIN7WebCore14DragControllerEE3getEv
-__ZN7WebCore14DragController18setDidInitiateDragEb
-__ZNK20WebFrameLoaderClient8webFrameEv
-__ZNK7WebCore4Page9mainFrameEv
-__ZNK3WTF6RefPtrIN7WebCore5FrameEE3getEv
-__ZNK20WebFrameLoaderClient12hasFrameViewEv
-__ZN3WTF10PassRefPtrIN7WebCore11HistoryItemEEC1EPS2_
-__ZN3WTF10PassRefPtrIN7WebCore11HistoryItemEED1Ev
-+[WebScriptDebugServer sharedScriptDebugServer]
--[WebScriptDebugServer init]
-__ZSt3maxIjERKT_S2_S2_
-__ZN7WebCore6StringaSERKS0_
-__ZN3WTF6RefPtrIN7WebCore10StringImplEEaSERKS3_
-__ZNK7WebCore4Page8settingsEv
-__ZNK3WTF6OwnPtrIN7WebCore8SettingsEE3getEv
-__ZN7WebCore6SharedINS_10StringImplEE3refEv
-__ZN7WebCore4KURLD1Ev
-__ZZN3WTF11addIteratorIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_EEvPKNS_9HashTableIT_T0_T1_T2_T3_T4_EEPNS_22HashTableConstIteratorISC_SD_SE_SF_SG_SH_EEE8__func__
-__ZZN3WTF14removeIteratorIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_EEvPNS_22HashTableConstIteratorIT_T0_T1_T2_T3_T4_EEE8__func__
-__ZN3WTFeqINS_9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS3_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEESA_EESA_EES2_IP9_NPStreamP4_NPPEEEbRKNS_29HashTableConstIteratorAdapterIT_T0_EESN_
-__ZNK3WTF29HashTableConstIteratorAdapterINS_9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS3_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEESA_EESA_EES2_IP9_NPStreamP4_NPPEEptEv
-__ZN3WTF17GenericHashTraitsIP18WebBackForwardListE10emptyValueEv
-__ZN3WTF10PassRefPtrIN7WebCore15BackForwardListEEC1EPS2_
-__ZN7WebCore6SharedINS_15BackForwardListEE3refEv
-__ZNK3WTF10PassRefPtrIN7WebCore15BackForwardListEE10releaseRefEv
-__ZZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E6lookupIP9_NPStreamNS_17HashMapTranslatorILb1ES1_ISE_P4_NPPENS_18PairBaseHashTraitsINS8_ISE_EENS8_ISH_EEEESA_NS_7PtrHashISE_EEEEEES1_IS1_IPS2_bEjERKT_E8__func__
-__ZN3WTF7PtrHashIPN7WebCore15BackForwardListEE4hashES3_
-__ZN3WTF7IntHashImE4hashEm
-__ZN3WTF7intHashEj
-__ZN3WTF18PairFirstExtractorISt4pairIiiEE7extractERKS2_
-__ZN3WTF17GenericHashTraitsIiE10emptyValueEv
-__ZNSt4pairIPS_IiiEbEC1ERKS1_RKb
-__ZNSt4pairIS_IPS_IiiEbEjEC1ERKS2_RKj
-__ZN3WTF10HashTraitsIiE12deletedValueEv
-__ZN3WTF17HashMapTranslatorILb1ESt4pairIPN7WebCore15BackForwardListEP18WebBackForwardListENS_18PairBaseHashTraitsINS_10HashTraitsIS4_EENS9_IS6_EEEENS_14PairHashTraitsINS9_IiEESE_EENS_7PtrHashIS4_EEE4hashERKS4_
-__ZN3WTF8AssignerILb0EPN7WebCore15BackForwardListEiNS_10HashTraitsIS3_EEE6assignERKS3_Ri
-__ZN3WTF8AssignerILb0EP18WebBackForwardListiNS_10HashTraitsIS2_EEE6assignERKS2_Ri
-__ZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E3addIP9_NPStreamP4_NPPNS_17HashMapTranslatorILb1ES1_ISE_SG_ENS_18PairBaseHashTraitsINS8_ISE_EENS8_ISG_EEEESA_NS_7PtrHashISE_EEEEEES1_INS_17HashTableIteratorIiS2_S4_S6_SA_S9_EEbERKT_RKT0_
-__ZNSt4pairIN3WTF24HashTableIteratorAdapterINS0_9HashTableIiS_IiiENS0_18PairFirstExtractorIS3_EENS0_7IntHashIiEENS0_14PairHashTraitsINS0_10HashTraitsIiEESA_EESA_EES_IP9_NPStreamP4_NPPEEEbEC1INS0_17HashTableIteratorIiS3_S5_S7_SB_SA_EEbEERKS_IT_T0_E
-__ZN3WTF24HashTableIteratorAdapterINS_9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS3_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEESA_EESA_EES2_IP9_NPStreamP4_NPPEEC1ERKNS_17HashTableIteratorIiS3_S5_S7_SB_SA_EE
-__ZN3WTF10PassRefPtrIN7WebCore15BackForwardListEED1Ev
-__Z9getMethodP11objc_objectP13objc_selector
-__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
-__ZN7WebCore16FontPlatformDataD1Ev
-__ZN7WebCore15ResourceRequestC1EP12NSURLRequest
-__ZN7WebCore19ResourceRequestBaseC2Ev
-__ZN3WTF7HashMapIN7WebCore6StringES2_NS_19CaseInsensitiveHashIS2_EENS_10HashTraitsIS2_EES6_EaSERKS7_
-__ZN3WTF6RefPtrIN7WebCore8FormDataEEC1Ev
-__ZN3WTF9RetainPtrI12NSURLRequestEC1EPS1_
-__ZNK7WebCore6String6isNullEv
-__ZN7WebCore6StringC1ERKS0_
-__ZN3WTF6RefPtrIN7WebCore10StringImplEEC1ERKS3_
-__ZNK3WTF9RetainPtrI22WebFramePolicyListenerE3getEv
-__ZN3WTF9RetainPtrI22WebFramePolicyListenerEaSEPS1_
-__ZNK3WTF9RetainPtrI22WebFramePolicyListenerEntEv
-__ZN7WebCore6SharedINS_5FrameEE3refEv
-__ZN3WTF9RetainPtrI22WebFramePolicyListenerEC1EPS1_
-__ZNK7WebCore16NavigationAction5eventEv
-__ZNK3WTF6RefPtrIN7WebCore5EventEE3getEv
-__Z14findMouseEventPKN7WebCore5EventE
-__ZNK7WebCore16NavigationAction3URLEv
-__ZN7WebCore4KURLC1ERKS0_
-__ZNK7WebCore16NavigationAction4typeEv
-__ZN3WTF8adoptRefIN7WebCore5FrameEEENS_10PassRefPtrIT_EEPS4_
-__ZN3WTF10PassRefPtrIN7WebCore5FrameEEC1EPS2_b
-__ZN3WTF6RefPtrIN7WebCore5FrameEEC1IS2_EERKNS_10PassRefPtrIT_EE
-__ZNK3WTF10PassRefPtrIN7WebCore5FrameEE10releaseRefEv
-__ZN3WTF10PassRefPtrIN7WebCore5FrameEED1Ev
-__ZNK3WTF6RefPtrIN7WebCore5FrameEEcvMS3_KFPS2_vEEv
-__ZNK3WTF6RefPtrIN7WebCore5FrameEEptEv
-__ZN3WTF19HashTableRefCounterINS_9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS6_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSC_IS5_EEEESD_EENS_18PairBaseHashTraitsINSC_INS_6RefPtrIN7WebCore14ResourceLoaderEEEEESE_EEE6refAllERSG_
-__ZN3WTF23HashTableRefCounterBaseILb1ENS_9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS6_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSC_IS5_EEEESD_EENS_18PairBaseHashTraitsINSC_INS_6RefPtrIN7WebCore14ResourceLoaderEEEEESE_EEE6refAllERSG_
-__ZZN3WTF11addIteratorIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_EEvPKNS_9HashTableIT_T0_T1_T2_T3_T4_EEPNS_22HashTableConstIteratorISG_SH_SI_SJ_SK_SL_EEE8__func__
-__ZN3WTF9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_E4findIiNS_22IdentityHashTranslatorIiS5_S9_EEEENS_17HashTableIteratorIiS5_S7_S9_SE_SC_EERKT_
-__ZZN3WTF14removeIteratorIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_EEvPNS_22HashTableConstIteratorIT_T0_T1_T2_T3_T4_EEE8__func__
-__ZNK7WebCore4KURL7isEmptyEv
-__ZNK7WebCore16DeprecatedString7isEmptyEv
-__ZNK3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E8containsImNS_22IdentityHashTranslatorImS6_SA_EEEEbRKT_
-__ZN3WTF9RetainPtrIP11objc_objectEC1ES2_
-__ZnwmPv
-__ZN3WTF18PairBaseHashTraitsINS_10HashTraitsImEENS1_INS_9RetainPtrIP11objc_objectEEEEE10emptyValueEv
-__ZN3WTF17GenericHashTraitsINS_9RetainPtrIP11objc_objectEEE10emptyValueEv
-__ZN3WTF17GenericHashTraitsImE10emptyValueEv
-__ZSt9make_pairImN3WTF9RetainPtrIP11objc_objectEEESt4pairIT_T0_ES6_S7_
-__ZNSt4pairImN3WTF9RetainPtrIP11objc_objectEEEC1ERKmRKS4_
-__ZN3WTF9RetainPtrIP11objc_objectEC1ERKS3_
-__ZN3WTF9RetainPtrIP11objc_objectED1Ev
-__ZN3WTF18PairFirstExtractorISt4pairImNS_9RetainPtrIP11objc_objectEEEE7extractERKS6_
-__ZNSt4pairIPS_ImN3WTF9RetainPtrIP11objc_objectEEEbEC1ERKS6_RKb
-__ZNSt4pairIS_IPS_ImN3WTF9RetainPtrIP11objc_objectEEEbEjEC1ERKS7_RKj
-__ZN3WTF10HashTraitsImE12deletedValueEv
-__ZN3WTF17HashMapTranslatorILb1ESt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairBaseHashTraitsINS_10HashTraitsImEENS8_IS5_EEEENS_14PairHashTraitsIS9_SA_EENS_7IntHashImEEE5equalERKmSI_
-__ZN3WTF8AssignerILb0EmmNS_10HashTraitsImEEE6assignERKmRm
-__ZN3WTF8AssignerILb0ENS_9RetainPtrIP11objc_objectEES4_NS_10HashTraitsIS4_EEE6assignERKS4_RS4_
-__ZN3WTF9RetainPtrIP11objc_objectEaSERKS3_
-__ZNK3WTF9RetainPtrIP11objc_objectE3getEv
-__ZZN3WTF11addIteratorImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_EEvPKNS_9HashTableIT_T0_T1_T2_T3_T4_EEPNS_22HashTableConstIteratorISH_SI_SJ_SK_SL_SM_EEE8__func__
-__ZZN3WTF14removeIteratorImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_EEvPNS_22HashTableConstIteratorIT_T0_T1_T2_T3_T4_EEE8__func__
-__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E3addImS5_NS_17HashMapTranslatorILb1ES6_NS_18PairBaseHashTraitsISD_SE_EESF_SA_EEEES1_INS_17HashTableIteratorImS6_S8_SA_SF_SD_EEbERKT_RKT0_
-__ZNSt4pairIN3WTF24HashTableIteratorAdapterINS0_9HashTableImS_ImNS0_9RetainPtrIP11objc_objectEEENS0_18PairFirstExtractorIS7_EENS0_7IntHashImEENS0_14PairHashTraitsINS0_10HashTraitsImEENSD_IS6_EEEESE_EES7_EEbEC1INS0_17HashTableIteratorImS7_S9_SB_SG_SE_EEbEERKS_IT_T0_E
-__ZNK3WTF24HashTableIteratorAdapterINS_9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS7_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSD_IS6_EEEESE_EES7_EptEv
-__ZNK7WebCore16ResourceResponse6isNullEv
-__ZNK3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE8containsERKm
-__ZN3WTF17IdentityExtractorImE7extractERKm
-__ZNSt4pairIPmbEC1ERKS0_RKb
-__ZNSt4pairIS_IPmbEjEC1ERKS1_RKj
-__ZN3WTF17HashSetTranslatorILb1EmNS_10HashTraitsImEES2_NS_7IntHashImEEE5equalERKmS7_
-__ZZN3WTF11addIteratorImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_EEvPKNS_9HashTableIT_T0_T1_T2_T3_T4_EEPNS_22HashTableConstIteratorIS8_S9_SA_SB_SC_SD_EEE8__func__
-__ZZNK3WTF22HashTableConstIteratorImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E13checkValidityEvE8__func__
-__ZZN3WTF14removeIteratorImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_EEvPNS_22HashTableConstIteratorIT_T0_T1_T2_T3_T4_EEE8__func__
-__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E3addImmNS_17HashSetTranslatorILb1EmS6_S6_S4_EEEESt4pairINS_17HashTableIteratorImmS2_S4_S6_S6_EEbERKT_RKT0_
-__ZNSt4pairIN3WTF24HashTableIteratorAdapterINS0_9HashTableImmNS0_17IdentityExtractorImEENS0_7IntHashImEENS0_10HashTraitsImEES8_EEmEEbEC1INS0_17HashTableIteratorImmS4_S6_S8_S8_EEbEERKS_IT_T0_E
-__ZZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E6lookupImNS_17HashMapTranslatorILb1ES6_NS_18PairBaseHashTraitsISD_SE_EESF_SA_EEEES1_IS1_IPS6_bEjERKT_E8__func__
-__ZN3WTF22IdentityHashTranslatorImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_7IntHashImEEE5equalERKmSB_
-__ZN3WTF7IntHashImE5equalEmm
-__ZN3WTFeqINS_9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS7_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSD_IS6_EEEESE_EES7_EEbRKNS_24HashTableIteratorAdapterIT_T0_EESN_
-__ZNK3WTF29HashTableConstIteratorAdapterINS_9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS7_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSD_IS6_EEEESE_EES7_EptEv
-__ZN7WebCore15ResourceRequestaSERKS0_
-__ZN7WebCore19ResourceRequestBaseaSERKS0_
-__ZN7WebCore4KURLaSERKS0_
-__ZZN3WTF11addIteratorIPN7WebCore10StringImplESt4pairIS3_iENS_18PairFirstExtractorIS5_EENS_7StrHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSB_IiEEEESC_EEvPKNS_9HashTableIT_T0_T1_T2_T3_T4_EEPNS_22HashTableConstIteratorISG_SH_SI_SJ_SK_SL_EEE8__func__
-__ZZN3WTF22HashTableConstIteratorIPN7WebCore10StringImplESt4pairIS3_iENS_18PairFirstExtractorIS5_EENS_7StrHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSB_IiEEEESC_EppEvE8__func__
-__ZZN3WTF14removeIteratorIPN7WebCore10StringImplESt4pairIS3_iENS_18PairFirstExtractorIS5_EENS_7StrHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSB_IiEEEESC_EEvPNS_22HashTableConstIteratorIT_T0_T1_T2_T3_T4_EEE8__func__
-__ZN3WTF9HashTableIPN7WebCore10StringImplESt4pairIS3_iENS_18PairFirstExtractorIS5_EENS_19CaseInsensitiveHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSB_IiEEEESC_E4findIS3_NS_22IdentityHashTranslatorIS3_S5_S9_EEEENS_17HashTableIteratorIS3_S5_S7_S9_SE_SC_EERKT_
-__ZN3WTF19HashTableRefCounterINS_9HashTableIPN7WebCore10StringImplESt4pairIS4_iENS_18PairFirstExtractorIS6_EENS_19CaseInsensitiveHashIS4_EENS_14PairHashTraitsINS_10HashTraitsIS4_EENSC_IiEEEESD_EENS_18PairBaseHashTraitsINSC_INS2_6StringEEESJ_EEE6refAllERSG_
-__ZN3WTF18PairFirstExtractorISt4pairIPN7WebCore10StringImplEiEE7extractERKS5_
-__ZN3WTF10RefCounterINS_18PairBaseHashTraitsINS_10HashTraitsIN7WebCore6StringEEES5_EENS_14PairHashTraitsINS2_IPNS3_10StringImplEEENS2_IiEEEEE3refERKSt4pairIS9_iE
-__ZN3WTF14RefCounterBaseILb1ENS_10HashTraitsIN7WebCore6StringEEENS1_IPNS2_10StringImplEEEE5derefERKS6_
-__ZN3WTF10HashTraitsIN7WebCore6StringEE5derefEPKNS1_10StringImplE
-__ZN3WTF14RefCounterBaseILb1ENS_10HashTraitsIN7WebCore6StringEEENS1_IiEEE5derefERKi
-__ZN3WTF10HashTraitsIN7WebCore6StringEE5derefERKi
-__ZN3WTF6RefPtrIN7WebCore8FormDataEEaSERKS3_
-__ZNK3WTF6RefPtrIN7WebCore8FormDataEE3getEv
-__ZN3WTF9RetainPtrI12NSURLRequestEaSERKS2_
-__ZNK3WTF9RetainPtrI12NSURLRequestE3getEv
-__ZN7WebCore15ResourceRequestD1Ev
-__ZN3WTF9RetainPtrI12NSURLRequestED1Ev
-__ZN7WebCore19ResourceRequestBaseD2Ev
-__ZN3WTF6RefPtrIN7WebCore8FormDataEED1Ev
-__ZN3WTF6RefPtrIN7WebCore5FrameEED1Ev
-__ZN7WebCore6SharedINS_5FrameEE5derefEv
-__ZN3WTF9RetainPtrI22WebFramePolicyListenerED1Ev
--[WebHistoryPrivate historyItemLimit]
--[WebHistoryPrivate _ageLimitDate]
--[WebHistoryPrivate historyAgeInDaysLimit]
--[WebHistoryItem(WebInternal) initFromDictionaryRepresentation:]
--[NSDictionary(WebNSDictionaryExtras) _webkit_stringForKey:]
--[WebHistoryItem(WebInternal) initWithURLString:title:displayTitle:lastVisitedTimeInterval:]
-__ZN7WebCore6SharedINS_11HistoryItemEE3refEv
-__ZNK3WTF10PassRefPtrIN7WebCore11HistoryItemEE10releaseRefEv
-__Z10kitPrivatePN7WebCore11HistoryItemE
-__Z4coreP21WebHistoryItemPrivate
-__ZN3WTF17GenericHashTraitsIP14WebHistoryItemE10emptyValueEv
-__ZN3WTF7PtrHashIPN7WebCore11HistoryItemEE4hashES3_
-__ZN3WTF17HashMapTranslatorILb1ESt4pairIPN7WebCore11HistoryItemEP14WebHistoryItemENS_18PairBaseHashTraitsINS_10HashTraitsIS4_EENS9_IS6_EEEENS_14PairHashTraitsINS9_IiEESE_EENS_7PtrHashIS4_EEE4hashERKS4_
-__ZN3WTF8AssignerILb0EPN7WebCore11HistoryItemEiNS_10HashTraitsIS3_EEE6assignERKS3_Ri
-__ZN3WTF8AssignerILb0EP14WebHistoryItemiNS_10HashTraitsIS2_EEE6assignERKS2_Ri
--[NSDictionary(WebNSDictionaryExtras) _webkit_intForKey:]
--[NSDictionary(WebNSDictionaryExtras) _webkit_numberForKey:]
-__ZN7WebCore18nsStringNilIfEmptyERKNS_6StringE
-__ZN3WTF9RetainPtrI14NSMutableArrayEC1EPS1_
-__ZN3WTF18PairBaseHashTraitsINS_10HashTraitsIxEENS1_INS_9RetainPtrI14NSMutableArrayEEEEE10emptyValueEv
-__ZN3WTF17GenericHashTraitsINS_9RetainPtrI14NSMutableArrayEEE10emptyValueEv
-__ZN3WTF9RetainPtrI14NSMutableArrayEC1Ev
-__ZN3WTF17GenericHashTraitsIxE10emptyValueEv
-__ZSt9make_pairIxN3WTF9RetainPtrI14NSMutableArrayEEESt4pairIT_T0_ES5_S6_
-__ZNSt4pairIxN3WTF9RetainPtrI14NSMutableArrayEEEC1ERKxRKS3_
-__ZN3WTF9RetainPtrI14NSMutableArrayEC1ERKS2_
-__ZN3WTF9RetainPtrI14NSMutableArrayED1Ev
-__ZN3WTF7IntHashIyE4hashEy
-__ZN3WTF7intHashEy
-__ZN3WTF18PairFirstExtractorISt4pairIxNS_9RetainPtrI14NSMutableArrayEEEE7extractERKS5_
-__ZNSt4pairIPS_IxN3WTF9RetainPtrI14NSMutableArrayEEEbEC1ERKS5_RKb
-__ZNSt4pairIS_IPS_IxN3WTF9RetainPtrI14NSMutableArrayEEEbEjEC1ERKS6_RKj
-__ZN3WTF10HashTraitsIxE12deletedValueEv
-__ZN3WTF17HashMapTranslatorILb1ESt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairBaseHashTraitsINS_10HashTraitsIxEENS7_IS4_EEEENS_14PairHashTraitsIS8_S9_EENS_7IntHashIyEEE5equalERKxSH_
-__ZN3WTF8AssignerILb0ExxNS_10HashTraitsIxEEE6assignERKxRx
-__ZN3WTF8AssignerILb0ENS_9RetainPtrI14NSMutableArrayEES3_NS_10HashTraitsIS3_EEE6assignERKS3_RS3_
-__ZN3WTF9RetainPtrI14NSMutableArrayEaSERKS2_
-__ZNK3WTF9RetainPtrI14NSMutableArrayE3getEv
-__ZZN3WTF11addIteratorIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_EEvPKNS_9HashTableIT_T0_T1_T2_T3_T4_EEPNS_22HashTableConstIteratorISG_SH_SI_SJ_SK_SL_EEE8__func__
-__ZZN3WTF14removeIteratorIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_EEvPNS_22HashTableConstIteratorIT_T0_T1_T2_T3_T4_EEE8__func__
-__ZNK3WTF24HashTableIteratorAdapterINS_9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS6_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSC_IS5_EEEESD_EES6_EptEv
-__ZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E3addIxS4_NS_17HashMapTranslatorILb1ES5_NS_18PairBaseHashTraitsISC_SD_EESE_S9_EEEES1_INS_17HashTableIteratorIxS5_S7_S9_SE_SC_EEbERKT_RKT0_
-__ZNSt4pairIN3WTF24HashTableIteratorAdapterINS0_9HashTableIxS_IxNS0_9RetainPtrI14NSMutableArrayEEENS0_18PairFirstExtractorIS6_EENS0_7IntHashIyEENS0_14PairHashTraitsINS0_10HashTraitsIxEENSC_IS5_EEEESD_EES6_EEbEC1INS0_17HashTableIteratorIxS6_S8_SA_SF_SD_EEbEERKS_IT_T0_E
-__ZN3WTF22IdentityHashTranslatorIiSt4pairIiiENS_7IntHashIiEEE4hashERKi
-__ZN3WTF7IntHashIiE4hashEi
-__ZZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E6lookupIxNS_17HashMapTranslatorILb1ES5_NS_18PairBaseHashTraitsISC_SD_EESE_S9_EEEES1_IS1_IPS5_bEjERKT_E8__func__
-__ZN3WTF22IdentityHashTranslatorIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_7IntHashIyEEE5equalERKxSA_
-__ZN3WTF7IntHashIyE5equalEyy
-__ZN3WTFeqINS_9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS6_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSC_IS5_EEEESD_EES6_EEbRKNS_29HashTableConstIteratorAdapterIT_T0_EESM_
-__ZN3WTF29HashTableConstIteratorAdapterINS_9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS6_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSC_IS5_EEEESD_EES6_EppEv
-__ZN3WTF22IdentityHashTranslatorIiSt4pairIiiENS_7IntHashIiEEE5equalERKiS7_
-__ZN3WTF7IntHashIiE5equalEii
-__ZN3WTF7PtrHashIPN7WebCore11HistoryItemEE5equalES3_S3_
-__ZN3WTF5MoverISt4pairIiiELb0EE4moveERS2_S4_
-__ZN3WTF10RefCounterINS_18PairBaseHashTraitsINS_10HashTraitsIPN7WebCore15BackForwardListEEENS2_IP18WebBackForwardListEEEENS_14PairHashTraitsINS2_IiEESC_EEE5derefERKSt4pairIiiE
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsIPN7WebCore15BackForwardListEEENS1_IiEEE5derefERKi
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsIP18WebBackForwardListEENS1_IiEEE5derefERKi
-__ZN3WTF13assignDeletedISt4pairIiiENS_14PairHashTraitsINS_10HashTraitsIiEES5_EEEEvRT_
-__ZN3WTF20DeletedValueAssignerINS_14PairHashTraitsINS_10HashTraitsIiEES3_EEE18assignDeletedValueERSt4pairIiiE
-__ZN3WTF14PairHashTraitsINS_10HashTraitsIiEES2_E18assignDeletedValueERSt4pairIiiE
-__ZN3WTF13assignDeletedIiNS_10HashTraitsIiEEEEvRT_
-__ZN3WTF20DeletedValueAssignerINS_10HashTraitsIiEEE18assignDeletedValueERi
-__ZN7WebCore6SharedINS_15BackForwardListEE5derefEv
-__ZNK7WebCore4Page15focusControllerEv
-__ZNK3WTF6OwnPtrIN7WebCore15FocusControllerEE3getEv
-__ZNK7WebCore4Page8progressEv
-__ZNK3WTF6OwnPtrIN7WebCore15ProgressTrackerEE3getEv
-__ZNK3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE7isEmptyEv
-__ZN7WebCore6SharedINS_11HistoryItemEE5derefEv
-__ZN3WTF10RefCounterINS_18PairBaseHashTraitsINS_10HashTraitsIPN7WebCore11HistoryItemEEENS2_IP14WebHistoryItemEEEENS_14PairHashTraitsINS2_IiEESC_EEE5derefERKSt4pairIiiE
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsIPN7WebCore11HistoryItemEEENS1_IiEEE5derefERKi
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsIP14WebHistoryItemEENS1_IiEEE5derefERKi
-__ZN7WebCore6SharedINS_14DocumentLoaderEE5derefEv
-__ZN20WebDocumentLoaderMacD1Ev
-__ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEED1Ev
-__ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE8derefAllEv
-__ZN3WTF19HashTableRefCounterINS_9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES7_EES7_E8derefAllERS8_
-__ZN3WTF23HashTableRefCounterBaseILb0ENS_9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES7_EES7_E8derefAllERS8_
-__ZN3WTF9RetainPtrIP13WebDataSourceEC1ES2_
-__ZN7WebCore6Editor27setStartNewKillRingSequenceEb
-__ZN18WebInspectorClient19inspectedURLChangedERKN7WebCore6StringE
-__ZNK18WebInspectorClient17updateWindowTitleEv
-__ZNK3WTF9RetainPtrI28WebInspectorWindowControllerE3getEv
-__ZNK20WebFrameLoaderClient20isArchiveLoadPendingEPN7WebCore14ResourceLoaderE
-__ZN3WTF6RefPtrIN7WebCore14ResourceLoaderEEC1EPS2_
-__ZN7WebCore6SharedINS_14ResourceLoaderEE3refEv
-__ZNK3WTF9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_E8containsIiNS_22IdentityHashTranslatorIiS5_S9_EEEEbRKT_
-__ZN3WTF6RefPtrIN7WebCore14ResourceLoaderEED1Ev
-__ZN7WebCore6SharedINS_14ResourceLoaderEE5derefEv
-__ZZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E6lookupImNS_17HashSetTranslatorILb1EmS6_S6_S4_EEEESt4pairISB_IPmbEjERKT_E8__func__
-__ZN3WTF22IdentityHashTranslatorImmNS_7IntHashImEEE4hashERKm
-__ZN7WebCoreneERKNS_4KURLES2_
-__ZN3WTF9RetainPtrIP13WebDataSourceED1Ev
--[WebFrame(WebInternal) _isMainFrame]
-__ZN7WebCore7IntSizeC1Eii
-__ZNK7WebCore4KURL3urlEv
-__ZN3WTF10RefCounterINS_18PairBaseHashTraitsINS_10HashTraitsImEENS2_INS_9RetainPtrIP11objc_objectEEEEEENS_14PairHashTraitsIS3_S8_EEE5derefERKSt4pairImS7_E
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsImEES2_E5derefERKm
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsINS_9RetainPtrIP11objc_objectEEEES6_E5derefERKS5_
-__ZN3WTF13assignDeletedISt4pairImNS_9RetainPtrIP11objc_objectEEENS_14PairHashTraitsINS_10HashTraitsImEENS8_IS5_EEEEEEvRT_
-__ZN3WTF20DeletedValueAssignerINS_14PairHashTraitsINS_10HashTraitsImEENS2_INS_9RetainPtrIP11objc_objectEEEEEEE18assignDeletedValueERSt4pairImS7_E
-__ZN3WTF14PairHashTraitsINS_10HashTraitsImEENS1_INS_9RetainPtrIP11objc_objectEEEEE18assignDeletedValueERSt4pairImS6_E
-__ZN3WTF13assignDeletedImNS_10HashTraitsImEEEEvRT_
-__ZN3WTF20DeletedValueAssignerINS_10HashTraitsImEEE18assignDeletedValueERm
-__ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE4findERKm
-__ZN3WTF22IdentityHashTranslatorImmNS_7IntHashImEEE5equalERKmS5_
-__ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE3endEv
-__ZN3WTFeqINS_9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES7_EEmEEbRKNS_24HashTableIteratorAdapterIT_T0_EESE_
-__ZN3WTF24HashTableIteratorAdapterINS_9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES7_EEmEC1ERKNS_17HashTableIteratorImmS3_S5_S7_S7_EE
-__ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE6removeENS_24HashTableIteratorAdapterINS_9HashTableImmNS_17IdentityExtractorImEES2_S4_S4_EEmEE
-__ZN3WTF10RefCounterINS_10HashTraitsImEES2_E5derefERKm
-__Z18matchUnicodeLettertt
-_WebCFAutorelease
-__ZN3WTF17HashSetTranslatorILb0EN7WebCore6StringENS_10HashTraitsIS2_EENS3_IPNS1_10StringImplEEENS_7StrHashIS2_EEE9translateERS6_RKS2_SD_j
-__ZN3WTF7StrHashIN7WebCore6StringEE4hashERKS2_
-__ZNK7WebCore10StringImpl4hashEv
-__ZNSt4pairIPPN7WebCore10StringImplEbEC1ERKS3_RKb
-__ZNSt4pairIS_IPPN7WebCore10StringImplEbEjEC1ERKS4_RKj
-__ZN3WTF8AssignerILb1EN7WebCore6StringEPNS1_10StringImplENS_10HashTraitsIS2_EEE6assignERKS2_RS4_
-__ZN3WTF10HashTraitsIN7WebCore6StringEE3refEPKNS1_10StringImplE
-__ZN3WTF9HashTableIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS_7StrHashIS3_EENS_10HashTraitsIS3_EES9_E3addINS1_6StringESC_NS_17HashSetTranslatorILb0ESC_NS8_ISC_EES9_NS6_ISC_EEEEEESt4pairINS_17HashTableIteratorIS3_S3_S5_S7_S9_S9_EEbERKT_RKT0_
-__ZNSt4pairIN3WTF24HashTableIteratorAdapterINS0_9HashTableIPN7WebCore10StringImplES5_NS0_17IdentityExtractorIS5_EENS0_7StrHashIS5_EENS0_10HashTraitsIS5_EESB_EENS3_6StringEEEbEC1INS0_17HashTableIteratorIS5_S5_S7_S9_SB_SB_EEbEERKS_IT_T0_E
-__ZN3WTF24HashTableIteratorAdapterINS_9HashTableIPN7WebCore10StringImplES4_NS_17IdentityExtractorIS4_EENS_7StrHashIS4_EENS_10HashTraitsIS4_EESA_EENS2_6StringEEC1ERKNS_17HashTableIteratorIS4_S4_S6_S8_SA_SA_EE
-__ZN3WTF7StrHashIN7WebCore6StringEE5equalERKS2_S5_
-__ZN3WTF7StrHashIPN7WebCore10StringImplEE5equalEPKS2_S6_
-__ZNK7WebCore10StringImpl6lengthEv
-__ZZN3WTF9HashTableIPN7WebCore10StringImplES3_NS_17IdentityExtractorIS3_EENS_7StrHashIS3_EENS_10HashTraitsIS3_EES9_E6lookupINS1_6StringENS_17HashSetTranslatorILb0ESC_NS8_ISC_EES9_NS6_ISC_EEEEEESt4pairISH_IPS3_bEjERKT_E8__func__
-__ZN3WTF22IdentityHashTranslatorIPN7WebCore10StringImplES3_NS_7StrHashIS3_EEE4hashERKS3_
-__ZN3WTF7StrHashIPN7WebCore10StringImplEE4hashEPKS2_
-__ZN3WTF5MoverIPN7WebCore10StringImplELb0EE4moveERS3_S5_
-__ZN3WTF22IdentityHashTranslatorIPN7WebCore10StringImplES3_NS_7StrHashIS3_EEE5equalERKS3_S8_
-__ZNK7WebCore10StringImpl10charactersEv
-__ZNK7WebCore14DocumentLoader5frameEv
-__ZN3WTF5MoverISt4pairImNS_9RetainPtrIP11objc_objectEEELb1EE4moveERS6_S8_
-__ZN3WTF4swapImNS_9RetainPtrIP11objc_objectEEEEvRSt4pairIT_T0_ES9_
-__ZSt4swapImEvRT_S1_
-__ZN3WTF4swapIP11objc_objectEEvRNS_9RetainPtrIT_EES6_
-__ZN3WTF9RetainPtrIP11objc_objectE4swapERS3_
-__ZSt4swapIP11objc_objectEvRT_S3_
-__ZNSt4pairImN3WTF9RetainPtrIP11objc_objectEEED1Ev
-__ZN3WTF5MoverImLb0EE4moveERmS2_
-__ZNK7WebCore4Node8documentEv
-__ZNK7WebCore6DocPtrINS_8DocumentEEcvMS2_KFPS1_vEEv
-__ZNK7WebCore6DocPtrINS_8DocumentEE3getEv
-__ZNK7WebCore8Document5frameEv
--[WebHTMLView(WebPrivate) didAddSubview:]
-__ZN3WTF6RefPtrIN7WebCore5FrameEEC1EPS2_
-__ZNK3WTF6VectorINS_6RefPtrIN7WebCore11HistoryItemEEELm0EE4sizeEv
-__ZNK7WebCore9FrameTree4nameEv
-__ZNK7WebCore12AtomicStringcvP8NSStringEv
-__ZN3WTF10PassRefPtrIN7WebCore9FormStateEEC1EPS2_
-__ZNK7WebCore9FrameTree6parentEv
-__ZN3WTF10PassRefPtrIN7WebCore9FormStateEED1Ev
-__ZN3WTF6VectorIiLm0EEC1Ev
-__ZN3WTF12VectorBufferIiLm0EEC1Ev
-__ZNK3WTF6VectorIiLm0EE8capacityEv
-__ZNK3WTF12VectorBufferIiLm0EE8capacityEv
-__ZN3WTF6VectorIiLm0EE5beginEv
-__ZN3WTF6VectorIiLm0EE4dataEv
-__ZN3WTF12VectorBufferIiLm0EE6bufferEv
-__ZN3WTF6VectorIiLm0EE3endEv
-__ZN3WTF12VectorBufferIiLm0EE14allocateBufferEm
-__ZNSt14numeric_limitsImE3maxEv
-__ZN3WTF20VectorTypeOperationsIiE4moveEPKiS3_Pi
-__ZN3WTF11VectorMoverILb1EiE4moveEPKiS3_Pi
-__ZN3WTF12VectorBufferIiLm0EE16deallocateBufferEPi
-__ZN3WTFneINS_9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS6_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSC_IS5_EEEESD_EES6_EEbRKNS_29HashTableConstIteratorAdapterIT_T0_EESM_
-__ZN3WTF6VectorIiLm0EE6appendIxEEvRKT_
-__ZNK3WTF6VectorIiLm0EE4sizeEv
-__ZSt4sortIPiEvT_S1_
-__ZSt4__lgIiET_S0_
-__ZN3WTF6VectorIiLm0EEixEm
-__ZN3WTF6VectorIiLm0EE2atEm
-__ZN3WTF6VectorIiLm0EED1Ev
-__ZN3WTF6VectorIiLm0EE5clearEv
-__ZN3WTF20VectorTypeOperationsIiE8destructEPiS2_
-__ZN3WTF16VectorDestructorILb0EiE8destructEPiS2_
-__ZN3WTF12VectorBufferIiLm0EED1Ev
-__ZN7WebCore12EventHandler24setActivationEventNumberEi
-__ZNK7WebCore13HitTestResult18innerNonSharedNodeEv
-__ZNK3WTF6RefPtrIN7WebCore4NodeEE3getEv
-__ZN20WebFrameLoaderClient27registerForIconNotificationEb
--[WebView(WebViewInternal) _receivedIconChangedNotification:]
--[WebView mainFrameURL]
-__ZNK7WebCore19SelectionController7isRangeEv
-__ZNK7WebCore9Selection7isRangeEv
-__ZNK7WebCore9Selection5stateEv
-__ZNK3WTF6VectorIN7WebCore6StringELm0EE4sizeEv
-__ZNK3WTF6VectorIN7WebCore6StringELm0EEixEm
-__ZNK3WTF6VectorIN7WebCore6StringELm0EE2atEm
-__ZNK3WTF12VectorBufferIN7WebCore6StringELm0EE6bufferEv
-__ZNK7WebCore7IntSize6heightEv
-__ZNK7WebCore7IntSize5widthEv
-__ZN7WebCoreeqERKNS_6StringES2_
-__ZN7WebCore13ResourceErrorC1EP7NSError
-__ZN3WTF9RetainPtrI7NSErrorEC1EPS1_
-__ZNK7WebCore13ResourceError9errorCodeEv
-__ZNK7WebCore13ResourceError27unpackPlatformErrorIfNeededEv
-__ZN3WTF7HashMapINS_6RefPtrIN7WebCore14ResourceLoaderEEENS_9RetainPtrI11WebResourceEENS_7PtrHashIS4_EENS_10HashTraitsIS4_EENSA_IS7_EEE6removeERKS4_
-__ZZN3WTF9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_E8reinsertERS5_E8__func__
--[WebHTMLView(WebPrivate) willRemoveSubview:]
-__ZN20WebFrameLoaderClientD1Ev
-__ZN3WTF9RetainPtrI8WebFrameED1Ev
-__ZNK7WebCore19SelectionController17isContentEditableEv
-__ZN3WTF10PassRefPtrIN7WebCore4NodeEEC1EPS2_
-__ZN3WTF10PassRefPtrIN7WebCore4NodeEED1Ev
-__ZNK7WebCore6Editor14hasCompositionEv
-__ZNK3WTF6RefPtrIN7WebCore4TextEEcvMS3_KFPS2_vEEv
-__Z9getNPRectRK7_NSRectR7_NPRect
-__ZNK7WebCore4Page13defersLoadingEv
-__ZN3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEEC1Ev
-__ZN3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEE9inlineAddERKS2_RKS4_
-__ZN3WTF7PtrHashIP9_NPStreamE4hashES2_
-__ZN3WTF17HashMapTranslatorILb1ESt4pairIP9_NPStreamP4_NPPENS_18PairBaseHashTraitsINS_10HashTraitsIS3_EENS8_IS5_EEEENS_14PairHashTraitsINS8_IiEESD_EENS_7PtrHashIS3_EEE4hashERKS3_
-__ZN3WTF8AssignerILb0EP9_NPStreamiNS_10HashTraitsIS2_EEE6assignERKS2_Ri
-__ZN3WTF8AssignerILb0EP4_NPPiNS_10HashTraitsIS2_EEE6assignERKS2_Ri
-__ZNK3WTF10PassRefPtrIN7WebCore26NetscapePlugInStreamLoaderEE10releaseRefEv
-__ZN3WTF10PassRefPtrIN7WebCore26NetscapePlugInStreamLoaderEED1Ev
-__ZNK7WebCore14ResourceLoader14documentLoaderEv
-__ZNK3WTF6RefPtrIN7WebCore14DocumentLoaderEE3getEv
-__ZN3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEE6removeERKS2_
-__ZNK3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEE4findERKS2_
-__ZN3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEE6removeENS_24HashTableIteratorAdapterINS_9HashTableIiSt4pairIiiENS_18PairFirstExtractorISE_EENS_7IntHashIiEENS_14PairHashTraitsINS7_IiEESK_EESK_EESD_IS2_S4_EEE
-__ZN3WTF10RefCounterINS_18PairBaseHashTraitsINS_10HashTraitsIP9_NPStreamEENS2_IP4_NPPEEEENS_14PairHashTraitsINS2_IiEESB_EEE5derefERKSt4pairIiiE
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsIP9_NPStreamEENS1_IiEEE5derefERKi
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsIP4_NPPEENS1_IiEEE5derefERKi
-_NPN_GetURL
--[WebBaseNetscapePluginView(WebNPPCallbacks) getURL:target:]
--[NSString(WebNSURLExtras) _webkit_stringByReplacingValidPercentEscapes]
--[WebFrame findFrameNamed:]
--[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]
--[WebBaseNetscapePluginView(WebNPPCallbacks) loadPluginRequest:]
--[WebPluginRequest request]
--[WebPluginRequest frameName]
--[WebBaseNetscapePluginView(WebNPPCallbacks) evaluateJavaScriptPluginRequest:]
--[WebPluginRequest isCurrentEventUserGesture]
--[WebPluginRequest sendNotification]
--[WebPluginRequest dealloc]
-__ZNK7WebCore19UIEventWithKeyState7ctrlKeyEv
-__ZNK7WebCore19UIEventWithKeyState6altKeyEv
-__ZNK7WebCore19UIEventWithKeyState8shiftKeyEv
-__ZNK7WebCore19UIEventWithKeyState7metaKeyEv
-__ZNK7WebCore17MouseRelatedEvent7clientYEv
-__ZNK7WebCore17MouseRelatedEvent7clientXEv
-__ZN7WebCore8IntPointC1Eii
-__ZNK7WebCore10MouseEvent6buttonEv
--[NSError(WebKitExtras) _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]
--[WebNullPluginView initWithFrame:error:DOMElement:]
--[WebNullPluginView viewDidMoveToWindow]
+-[WebHTMLView validRequestorForSendType:returnType:]
+-[WebHTMLView(WebDocumentPrivateProtocols) pasteboardTypesForSelection]
+-[WebHTMLView(WebInternal) _canSmartCopyOrDelete]
+-[WebView(WebViewEditing) smartInsertDeleteEnabled]
+-[WebBackForwardList containsItem:]
+__Z4coreP14WebHistoryItem
+-[WebView goToBackForwardItem:]
+-[WebFrame(WebInternal) _findFrameWithSelection]
+-[WebFrame(WebInternal) _hasSelection]
+-[WebView(WebIBActions) stopLoading:]
+-[WebFrame stopLoading]
-[NSURL(WebNSURLExtras) _web_URLWithLowercasedScheme]
-__Z7toloweri
--[WebNullPluginView dealloc]
-__ZN3WTF9RetainPtrI11WebHTMLViewEC1EPS1_
-__ZNK7WebCore5Event6targetEv
-__ZNK3WTF6RefPtrIN7WebCore11EventTargetEE3getEv
-__ZNK7WebCore13KeyboardEvent8keyEventEv
-__ZNK7WebCore21PlatformKeyboardEvent8macEventEv
-__ZNK3WTF9RetainPtrI7NSEventE3getEv
-__ZN7WebCore13KeyboardEvent15keypressCommandEv
-__ZN7WebCore15KeypressCommandC1ERKS0_
-__ZNK3WTF6VectorIN7WebCore6StringELm0EE8capacityEv
-__ZNK3WTF12VectorBufferIN7WebCore6StringELm0EE8capacityEv
-__ZN3WTF12VectorBufferIN7WebCore6StringELm0EEC1Em
-__ZN3WTF12VectorBufferIN7WebCore6StringELm0EE14allocateBufferEm
-__ZN3WTF6VectorIN7WebCore6StringELm0EE5beginEv
-__ZN3WTF6VectorIN7WebCore6StringELm0EE4dataEv
-__ZN3WTF12VectorBufferIN7WebCore6StringELm0EE6bufferEv
-__ZNK3WTF6VectorIN7WebCore6StringELm0EE3endEv
-__ZNK3WTF6VectorIN7WebCore6StringELm0EE5beginEv
-__ZNK3WTF6VectorIN7WebCore6StringELm0EE4dataEv
-__ZN3WTF20VectorTypeOperationsIN7WebCore6StringEE17uninitializedCopyEPKS2_S5_PS2_
-__ZN3WTF12VectorCopierILb0EN7WebCore6StringEE17uninitializedCopyEPKS2_S5_PS2_
-__ZNK3WTF6VectorIN7WebCore6StringELm0EE7isEmptyEv
-__ZN7WebCore15KeypressCommandC1Ev
-__ZN3WTF6VectorIN7WebCore6StringELm0EEC1Ev
-__ZN3WTF12VectorBufferIN7WebCore6StringELm0EEC1Ev
-__ZN7WebCore13KeyboardEvent18setKeypressCommandERKNS_15KeypressCommandE
-__ZN7WebCore15KeypressCommandaSERKS0_
-__ZSt4copyIPKN7WebCore6StringEPS1_ET0_T_S6_S5_
-__ZNSt13__copy_normalILb0ELb0EE6copy_nIPKN7WebCore6StringEPS3_EET0_T_S8_S7_
-__ZSt10__copy_auxIPKN7WebCore6StringEPS1_ET0_T_S6_S5_
-__ZNSt6__copyILb0ESt26random_access_iterator_tagE4copyIPKN7WebCore6StringEPS4_EET0_T_S9_S8_
-__ZN3WTF6VectorIN7WebCore6StringELm0EE3endEv
-__ZN7WebCore15KeypressCommandD1Ev
-__ZN3WTF6VectorIN7WebCore6StringELm0EED1Ev
-__ZN3WTF6VectorIN7WebCore6StringELm0EE5clearEv
-__ZN3WTF20VectorTypeOperationsIN7WebCore6StringEE8destructEPS2_S4_
-__ZN3WTF16VectorDestructorILb1EN7WebCore6StringEE8destructEPS2_S4_
-__ZN3WTF12VectorBufferIN7WebCore6StringELm0EED1Ev
-__ZN3WTF12VectorBufferIN7WebCore6StringELm0EE16deallocateBufferEPS2_
-__Z19selectorForKeyEventPN7WebCore13KeyboardEventE
-__ZNK7WebCore13KeyboardEvent13keyIdentifierEv
-__ZN7WebCoreeqERKNS_6StringEPKc
-__ZN7WebCore6String7replaceEtt
-__ZNK3WTF6RefPtrIN7WebCore10StringImplEEcvMS3_KFPS2_vEEv
-__ZNK3WTF6RefPtrIN7WebCore10StringImplEEptEv
-__ZN3WTF6RefPtrIN7WebCore10StringImplEEaSEPS2_
-__ZN7WebCore3kitENS_9EAffinityE
-__ZN3WTF10PassRefPtrIN7WebCore11EditCommandEEC1ERKS3_
-__ZNK3WTF10PassRefPtrIN7WebCore11EditCommandEE10releaseRefEv
-__ZNK3WTF10PassRefPtrIN7WebCore11EditCommandEEntEv
-__ZNK3WTF10PassRefPtrIN7WebCore11EditCommandEEptEv
-__Z21undoNameForEditActionN7WebCore10EditActionE
-__ZN3WTF10PassRefPtrIN7WebCore11EditCommandEED1Ev
-__ZNK3WTF9RetainPtrI19WebEditorUndoTargetE3getEv
-__ZN7WebCore5Event17setDefaultHandledEv
-__ZN3WTF9RetainPtrI11WebHTMLViewED1Ev
-__ZN3WTF6VectorIN7WebCore6StringELm0EE6appendIP8NSStringEEvRKT_
-__ZN3WTF6VectorIN7WebCore6StringELm0EE14expandCapacityIKP8NSStringEEPT_mS9_
-__ZSt3maxImERKT_S2_S2_
-__ZN3WTF20VectorTypeOperationsIN7WebCore6StringEE4moveEPKS2_S5_PS2_
-__ZN3WTF11VectorMoverILb0EN7WebCore6StringEE4moveEPKS2_S5_PS2_
-__ZN3WTF6VectorIN7WebCore6StringELm0EEixEm
-__ZN3WTF6VectorIN7WebCore6StringELm0EE2atEm
-__ZN7WebCore12AtomicStringC1EPKc
-__ZNK3WTF10PassRefPtrIN7WebCore9FormStateEEptEv
-__ZNK7WebCore9FormState6valuesEv
-__ZN3WTFneINS_9HashTableIPN7WebCore10StringImplESt4pairIS4_iENS_18PairFirstExtractorIS6_EENS_7StrHashIS4_EENS_14PairHashTraitsINS_10HashTraitsIS4_EENSC_IiEEEESD_EES5_INS2_6StringESH_EEEbRKNS_29HashTableConstIteratorAdapterIT_T0_EESO_
-__ZN3WTF29HashTableConstIteratorAdapterINS_9HashTableIPN7WebCore10StringImplESt4pairIS4_iENS_18PairFirstExtractorIS6_EENS_7StrHashIS4_EENS_14PairHashTraitsINS_10HashTraitsIS4_EENSC_IiEEEESD_EES5_INS2_6StringESH_EEppEv
-__ZNK7WebCore9FormState4formEv
-__ZNK3WTF6RefPtrIN7WebCore15HTMLFormElementEE3getEv
-__ZNK7WebCore9FormState11sourceFrameEv
-__ZN7WebCore6SharedINS_8FormDataEE5derefEv
-__ZN7WebCore6SharedINS_11EditCommandEE5derefEv
-__ZN20WebFrameLoaderClient38dispatchDecidePolicyForNewWindowActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestERKNS0_6StringE
-__ZN20WebFrameLoaderClient18dispatchCreatePageEv
-__ZN20WebFrameLoaderClient12dispatchShowEv
-__ZN20WebFrameLoaderClient35dispatchDidChangeLocationWithinPageEv
-__ZN20WebFrameLoaderClient13didFinishLoadEv
-__ZN3WTF7PtrHashIPN7WebCore15BackForwardListEE5equalES3_S3_
-__ZN3WTF7PtrHashIP9_NPStreamE5equalES2_S2_
-_NewEventHandlerUPP
--[WebBaseNetscapePluginView mouseDragged:]
--[WebBaseNetscapePluginView resignFirstResponder]
-_CGSizeMake
-__ZNK7WebCore5Event15underlyingEventEv
--[WebView(WebIBActions) goForward:]
--[WebView goForward]
--[WebHTMLView(WebPrivate) _hasInsertionPoint]
-__ZNK7WebCore19SelectionController7isCaretEv
-__ZNK7WebCore9Selection7isCaretEv
-+[WebImageRendererFactory shouldUseThreadedDecoding]
-+[WebCoreStatistics shouldPrintExceptions]
--[WebBackForwardList pageCacheSize]
-__ZN7WebCore15BackForwardList4pageEv
-__ZN7WebCore9PageCache8capacityEv
--[WebPreferences(WebPrivate) _usePDFPreviewView]
--[WebView customUserAgent]
--[WebView(WebPendingPublic) canMarkAllTextMatches]
-__ZNK7WebCore9FrameTree10firstChildEv
-__ZNK7WebCore9FrameTree11nextSiblingEv
-__ZN15WebEditorClientD1Ev
-__ZN3WTF9RetainPtrI19WebEditorUndoTargetED1Ev
-__ZN3WTF9RetainPtrI28WebInspectorWindowControllerED1Ev
-__ZN20WebContextMenuClientD1Ev
-__ZN13WebDragClientD1Ev
-__ZN15WebChromeClientD1Ev
-__ZN3WTF19HashTableRefCounterINS_9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS7_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSD_IS6_EEEESE_EENS_18PairBaseHashTraitsISE_SF_EEE8derefAllERSH_
-__ZN3WTF23HashTableRefCounterBaseILb0ENS_9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS7_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSD_IS6_EEEESE_EENS_18PairBaseHashTraitsISE_SF_EEE8derefAllERSH_
--[WebIconDatabase iconURLForURL:]
--[WebHistoryItem(WebPrivate) RSSFeedReferrer]
--[WebHTMLRepresentation canSaveAsWebArchive]
-+[WebView(WebPrivate) suggestedFileExtensionForMIMEType:]
--[WebHTMLRepresentation DOMDocument]
--[DOMHTMLBodyElement(WebDOMHTMLBodyElementOperationsPrivate) _subresourceURLs]
--[DOMHTMLTableElement(WebDOMHTMLTableElementOperationsPrivate) _subresourceURLs]
--[DOMHTMLTableElement(WebDOMHTMLTableElementOperationsPrivate) _web_background]
--[DOMHTMLTableCellElement(WebDOMHTMLTableCellElementOperationsPrivate) _subresourceURLs]
--[DOMHTMLTableCellElement(WebDOMHTMLTableCellElementOperationsPrivate) _web_background]
--[DOMHTMLInputElement(WebDOMHTMLInputElementOperationsPrivate) _subresourceURLs]
--[WebHTMLRepresentation _loadDataSourceAsWebArchive]
-__ZN3WTF6RefPtrIN7WebCore12SharedBufferEEC1IS2_EERKNS_10PassRefPtrIT_EE
-__ZNK3WTF10PassRefPtrIN7WebCore12SharedBufferEE10releaseRefEv
-__ZN3WTF10PassRefPtrIN7WebCore12SharedBufferEED1Ev
-__ZNK3WTF6RefPtrIN7WebCore12SharedBufferEEntEv
-__ZNK3WTF6RefPtrIN7WebCore12SharedBufferEEptEv
-__ZN3WTF6RefPtrIN7WebCore12SharedBufferEED1Ev
-__ZN7WebCore6SharedINS_12SharedBufferEE5derefEv
--[WebArchive initWithData:]
--[WebArchive _initWithPropertyList:]
--[WebResource(WebResourcePrivate) _initWithPropertyList:]
-+[WebResource(WebResourcePrivate) _resourcesFromPropertyLists:]
--[WebArchive mainResource]
--[WebDataSource(WebInternal) _addToUnarchiveState:]
--[WebUnarchivingState init]
--[WebUnarchivingState addArchive:]
--[WebArchive subresources]
--[WebArchive subframeArchives]
--[WebResource URL]
--[WebResource textEncodingName]
-__ZNK3WTF10PassRefPtrIN7WebCore12SharedBufferEE3getEv
--[WebUnarchivingState archivedResourceForURL:]
-__ZN7WebCore12SharedBufferD1Ev
-__ZN3WTF9RetainPtrI6NSDataED1Ev
-__ZN3WTF6VectorIcLm0EED1Ev
-__ZN3WTF6VectorIcLm0EE5clearEv
-__ZN3WTF6VectorIcLm0EE6resizeEm
-__ZN3WTF6VectorIcLm0EE3endEv
-__ZN3WTF6VectorIcLm0EE5beginEv
-__ZN3WTF6VectorIcLm0EE4dataEv
-__ZN3WTF12VectorBufferIcLm0EE6bufferEv
-__ZN3WTF20VectorTypeOperationsIcE8destructEPcS2_
-__ZN3WTF16VectorDestructorILb0EcE8destructEPcS2_
-__ZN3WTF12VectorBufferIcLm0EED1Ev
-__ZN3WTF12VectorBufferIcLm0EE16deallocateBufferEPc
-__ZN7WebCore6SharedINS_12SharedBufferEED2Ev
-__ZN14WTFNoncopyable11NoncopyableD2Ev
--[WebIconDatabase(WebInternal) _scaleIcon:toSize:]
--[WebUnarchivingState dealloc]
-__ZNK15WebChromeClient11tabsToLinksEv
-__Z14incrementFrameP8WebFrameaa
--[WebView(WebPendingPublic) markAllMatchesForText:caseSensitive:highlight:limit:]
--[WebHTMLView(WebDocumentInternalProtocols) setMarkedTextMatchesAreHighlighted:]
--[WebHTMLView(WebDocumentInternalProtocols) markAllMatchesForText:caseSensitive:limit:]
++[NSPasteboard(WebExtras) _web_setFindPasteboardString:withOwner:]
-[WebView(WebPendingPublic) searchFor:direction:caseSensitive:wrap:startInSelection:]
-[WebView(WebFileInternal) _selectedOrMainFrame]
--[WebHTMLView(WebDocumentPrivateProtocols) searchFor:direction:caseSensitive:wrap:startInSelection:]
--[WebView(WebPendingPublic) unmarkAllTextMatches]
--[WebHTMLView(WebDocumentInternalProtocols) unmarkAllTextMatches]
--[WebFrameView(WebPrivate) _contentView]
--[WebHTMLView(WebDocumentPrivateProtocols) selectionView]
--[WebView(WebPendingPublic) rectsForTextMatches]
--[WebHTMLView(WebDocumentInternalProtocols) rectsForTextMatches]
--[WebHTMLView(WebDocumentPrivateProtocols) selectionRect]
--[WebHTMLView(WebDocumentPrivateProtocols) selectionTextRects]
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EEC1Ev
-__ZN3WTF12VectorBufferIN7WebCore9FloatRectELm0EEC1Ev
-__ZNK3WTF6VectorIN7WebCore9FloatRectELm0EE4sizeEv
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EEixEm
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE2atEm
-__ZN3WTF12VectorBufferIN7WebCore9FloatRectELm0EE6bufferEv
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EED1Ev
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE5clearEv
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE6resizeEm
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE3endEv
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE5beginEv
-__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE4dataEv
-__ZN3WTF20VectorTypeOperationsIN7WebCore9FloatRectEE8destructEPS2_S4_
-__ZN3WTF16VectorDestructorILb1EN7WebCore9FloatRectEE8destructEPS2_S4_
-__ZN7WebCore9FloatRectD1Ev
-__ZN3WTF12VectorBufferIN7WebCore9FloatRectELm0EED1Ev
-__ZN3WTF12VectorBufferIN7WebCore9FloatRectELm0EE16deallocateBufferEPS2_
--[WebHTMLView(WebDocumentPrivateProtocols) selectionImageForcingBlackText:]
-__ZNK7WebCore4Page21contextMenuControllerEv
-__ZNK3WTF6OwnPtrIN7WebCore21ContextMenuControllerEE3getEv
--[WebViewFactory contextMenuItemTagInspectElement]
-__ZNK7WebCore11ContextMenu13hitTestResultEv
-__Z26fixMenusToSendToOldClientsP14NSMutableArray
--[WebElementDictionary _absoluteImageURL]
-__Z30fixMenusReceivedFromOldClientsP14NSMutableArrayS0_
-__ZNK7WebCore21ContextMenuController11contextMenuEv
-__ZNK3WTF6OwnPtrIN7WebCore11ContextMenuEE3getEv
-__ZN20WebFrameLoaderClient21fileDoesNotExistErrorERKN7WebCore16ResourceResponseE
--[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:]
--[WebNetscapePluginStream cancelLoadWithError:]
-__ZN7WebCore13ResourceErrorD1Ev
-__ZN3WTF9RetainPtrI7NSErrorED1Ev
--[WebHistory setLastVisitedTimeInterval:forItem:]
--[WebHistoryPrivate setLastVisitedTimeInterval:forItem:]
-__ZN7WebCore12ClipboardMac10pasteboardEv
-__ZNK3WTF9RetainPtrI12NSPasteboardE3getEv
-__ZN3WTF9RetainPtrI7NSImageEC1EPS1_
-__ZNK3WTF9RetainPtrI11WebHTMLViewE3getEv
-__ZNK3WTF9RetainPtrI7NSImageE3getEv
-__ZNK7WebCore14DragController13dragOperationEv
-__ZN19WebPasteboardHelperC1EP11WebHTMLView
-__ZN7WebCore16PasteboardHelperC2Ev
-__ZNK7WebCore8DragData12platformDataEv
-__ZN19WebPasteboardHelperD0Ev
-__ZN7WebCore16PasteboardHelperD0Ev
-__ZNK7WebCore14DragController10dragOffsetEv
-__ZNK7WebCore8IntPoint1yEv
-__ZNK7WebCore8IntPoint1xEv
+__Z14incrementFrameP8WebFrameaa
+-[WebHistory _itemForURLString:]
+-[WebView(WebPendingPublic) canMarkAllTextMatches]
+-[WebHistoryItem(WebPrivate) _lastVisitedDate]
+-[WebView prepareForDragOperation:]
+-[WebView performDragOperation:]
+__ZN13WebDragClient32willPerformDragDestinationActionEN7WebCore21DragDestinationActionEPNS0_8DragDataE
+-[WebDefaultUIDelegate webView:willPerformDragDestinationAction:forDraggingInfo:]
+-[NSString(WebKitExtras) _webkit_filenameByFixingIllegalCharacters]
+-[WebIconDatabase(WebInternal) _scaleIcon:toSize:]
-[WebPDFRepresentation setDataSource:]
-[WebPDFView initWithFrame:]
+[WebPDFView(FileInternal) _PDFPreviewViewClass]
@@ -2062,11 +1385,10 @@ __ZNK7WebCore8IntPoint1xEv
-[WebPDFView acceptsFirstResponder]
-[WebFrame(WebInternal) _clearSelectionInOtherFrames]
-[WebPDFView selectedString]
--[WebFrame(WebInternal) _atMostOneFrameHasSelection]
-[WebPDFRepresentation receivedData:withDataSource:]
-[WebPDFView dataSourceUpdated:]
--[WebPDFView hitTest:]
-[WebPDFRepresentation finishedLoadingWithDataSource:]
+-[WebDataSource data]
+[WebPDFRepresentation PDFDocumentClass]
-[WebPDFView setPDFDocument:]
-[WebPDFView(FileInternal) _scaleOrDisplayModeOrPageChanged:]
@@ -2074,266 +1396,504 @@ __ZNK7WebCore8IntPoint1xEv
-[WebPreferences(WebPrivate) PDFScaleFactor]
-[WebPreferences _floatValueForKey:]
-[WebPreferences(WebPrivate) PDFDisplayMode]
+-[WebPDFView hitTest:]
+-[WebPDFView string]
+-[WebPDFView(FileInternal) _PDFDocumentViewMightHaveScrolled:]
+-[NSView(WebExtras) _webView]
+-[WebPDFView(FileInternal) _updatePreferencesSoon]
+-[WebPDFView(FileInternal) _updatePreferences:]
+-[WebPreferences(WebPrivate) setPDFScaleFactor:]
+-[WebPreferences _setFloatValue:forKey:]
+-[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setFloat:forKey:]
+-[WebPreferences(WebPrivate) setPDFDisplayMode:]
+-[WebPreferences _setIntegerValue:forKey:]
+-[WebPDFView PDFViewSavePDFToDownloadFolder:]
+__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objecta
+__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_a
+-[NSFileManager(WebNSFileManagerExtras) _webkit_setMetadataURL:referrer:atPath:]
+_WKSetMetadataURL
+-[WebPDFView PDFViewOpenPDFInNativeApplication:]
+-[WebPDFView(FileInternal) _openWithFinder:]
+-[WebPDFView(FileInternal) _path]
+-[WebPDFView(FileInternal) _temporaryPDFDirectoryPath]
+-[WebPDFView menuForEvent:]
+-[WebPDFView(FileInternal) _menuItemsFromPDFKitForEvent:]
+-[NSMutableArray(WebExtras) _webkit_removeUselessMenuItemSeparators]
+-[WebPDFView elementAtPoint:]
+-[WebPDFView(FileInternal) _pointIsInSelection:]
+-[WebView(WebPrivate) _menuForElement:defaultItems:]
+-[WebDefaultUIDelegate(WebContextMenu) webView:contextMenuItemsForElement:defaultMenuItems:]
+-[WebDefaultUIDelegate(WebContextMenu) menuItemWithTag:target:representedObject:]
+-[WebDefaultUIDelegate(WebContextMenu) appendDefaultItems:toArray:]
+-[WebPDFRepresentation canProvideDocumentSource]
+-[WebPDFView(FileInternal) _anyPDFTagsFoundInMenu:]
+-[WebPDFView validateUserInterfaceItem:]
+-[WebPDFView validateUserInterfaceItemWithoutDelegate:]
+-[PDFPrefUpdatingProxy methodSignatureForSelector:]
+-[WebPDFView(FileInternal) _PDFSubview]
+-[PDFPrefUpdatingProxy forwardInvocation:]
-[WebPDFView viewState]
-[WebPDFView dealloc]
+-[WebPDFView setViewState:]
+-[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setInt:forKey:]
+-[WebPDFView deselectAll]
+-[WebView(WebPendingPublic) markAllMatchesForText:caseSensitive:highlight:limit:]
+-[WebPDFView setMarkedTextMatchesAreHighlighted:]
+-[WebPDFView markAllMatchesForText:caseSensitive:limit:]
+-[WebPDFView(FileInternal) _nextMatchFor:direction:caseSensitive:wrap:fromSelection:startInSelection:]
+-[WebPDFView(FileInternal) _setTextMatches:]
+-[WebPDFView searchFor:direction:caseSensitive:wrap:startInSelection:]
+-[WebView(WebPendingPublic) unmarkAllTextMatches]
+-[WebPDFView unmarkAllTextMatches]
+-[WebView(WebViewEditingActions) scrollLineDown:]
+-[WebView(WebViewEditingActions) _performResponderOperation:with:]
+-[WebView(WebFileInternal) _responderForResponderOperations]
+-[NSView(WebExtras) _web_firstResponderIsSelfOrDescendantView]
+-[WebPDFView scrollLineDown:]
+-[WebPDFView(FileInternal) _fakeKeyEventWithFunctionKey:]
+-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]
+-[NSFileManager(WebNSFileManagerExtras) _webkit_pathWithUniqueFilenameForPath:]
+-[WebView _autoscrollForDraggingInfo:timeDelta:]
+-[WebHTMLView(WebPrivate) pasteboardChangedOwner:]
+-[_WebCoreHistoryProvider containsURL:length:]
+-[WebHistory containsItemForURLString:]
+-[WebHistoryPrivate containsItemForURLString:]
+_WKSetUpFontCache
+-[WebHTMLView dataSourceUpdated:]
+__ZN20WebFrameLoaderClient39postProgressEstimateChangedNotificationEv
+__ZN20WebFrameLoaderClient31dispatchDidReceiveContentLengthEPN7WebCore14DocumentLoaderEmi
+__Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_iS0_
+__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_iS0_
+-[WebHTMLRepresentation finishedLoadingWithDataSource:]
+-[WebView(WebViewEditing) isEditable]
+-[WebBaseNetscapePluginView viewWillMoveToHostWindow:]
+-[WebBaseNetscapePluginView viewDidMoveToHostWindow]
+__ZN20WebContextMenuClient11downloadURLERKN7WebCore4KURLE
+-[WebView(WebPrivate) _downloadURL:]
+-[WebDownload _initWithRequest:delegate:directory:]
+-[WebDownload _setRealDelegate:]
+-[WebDownloadInternal setRealDelegate:]
+-[WebDownload initWithRequest:delegate:]
+-[WebDownload init]
+-[WebDownloadInternal respondsToSelector:]
+-[WebDownloadInternal downloadDidBegin:]
+-[WebDownloadInternal download:didReceiveResponse:]
+-[WebDownloadInternal download:decideDestinationWithSuggestedFilename:]
+-[WebDownloadInternal download:didCreateDestination:]
+-[WebDownloadInternal download:didReceiveDataOfLength:]
+-[WebDownloadInternal downloadDidFinish:]
+-[WebDownload dealloc]
+-[WebDownloadInternal dealloc]
+-[WebFramePolicyListener download]
+__ZN20WebFrameLoaderClient8downloadEPN7WebCore14ResourceHandleERKNS0_15ResourceRequestES5_RKNS0_16ResourceResponseE
+-[WebDownload _initWithLoadingConnection:request:response:delegate:proxy:]
+__ZNK20WebFrameLoaderClient25setOriginalURLForDownloadEP11WebDownloadRKN7WebCore15ResourceRequestE
+[WebStringTruncator widthOfString:font:]
--[WebFrameBridge willPopupMenu:]
-_WKPopupMenu
--[WebHTMLView _accessibilityParentForSubview:]
--[WebFrameView(WebFrameViewFileInternal) webCoreBridge]
--[WebFrameBridge imageTitleForFilename:size:]
-__ZN15WebChromeClient11scaleFactorEv
+-[WebBackForwardList backListCount]
+-[WebBackForwardList itemAtIndex:]
+-[NSEvent(WebExtras) _web_isDeleteKeyEvent]
+-[NSEvent(WebExtras) _web_isKeyEvent:]
+-[WebBaseNetscapePluginView keyDown:]
+_WKSendKeyEventToTSM
+__Z15TSMEventHandlerP25OpaqueEventHandlerCallRefP14OpaqueEventRefPv
+-[WebBaseNetscapePluginView keyUp:]
+__ZN20WebFrameLoaderClient22createJavaAppletWidgetERKN7WebCore7IntSizeEPNS0_7ElementERKNS0_4KURLERKN3WTF6VectorINS0_6StringELm0EEESE_
+-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]
+-[WebPluginController webPlugInContainerShowStatus:]
+-[NSEvent(WebExtras) _web_isEscapeKeyEvent]
+-[WebView(WebIBActions) makeTextSmaller:]
+-[WebHTMLView(WebTextSizing) _makeTextSmaller:]
+-[WebView(WebIBActions) makeTextStandardSize:]
+-[WebHTMLView(WebTextSizing) _makeTextStandardSize:]
+-[WebView(WebIBActions) makeTextLarger:]
+-[WebHTMLView(WebTextSizing) _makeTextLarger:]
+-[WebView initWithCoder:]
+-[WebFrameView initWithCoder:]
+-[WebPreferences initWithCoder:]
++[WebPreferences(WebInternal) _concatenateKeyWithIBCreatorID:]
+-[WebView setPreferences:]
+-[WebPreferences setMinimumFontSize:]
+-[WebHTMLRepresentation documentSource]
+-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]
+-[WebView(WebViewInternal) _userVisibleBundleVersionFromFullVersion:]
+-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]
++[WebPreferences(WebPrivate) _checkLastReferenceForIdentifier:]
+-[WebPreferences dealloc]
+-[WebPreferencesPrivate dealloc]
+-[WebBackForwardList backListWithLimit:]
+__Z15vectorToNSArrayRN3WTF6VectorINS_6RefPtrIN7WebCore11HistoryItemEEELm0EEE
+__ZN3WTF6VectorINS_6RefPtrIN7WebCore11HistoryItemEEELm0EE6shrinkEm
+-[WebHistoryItem(WebPrivate) targetItem]
+-[WebHTMLView(WebDocumentInternalProtocols) setMarkedTextMatchesAreHighlighted:]
+-[WebHTMLView(WebDocumentInternalProtocols) markAllMatchesForText:caseSensitive:limit:]
+-[WebHTMLView(WebDocumentPrivateProtocols) searchFor:direction:caseSensitive:wrap:startInSelection:]
+-[WebHTMLView(WebDocumentInternalProtocols) unmarkAllTextMatches]
+-[WebFrameView(WebPrivate) _contentView]
+-[WebHTMLView(WebDocumentPrivateProtocols) selectionView]
+-[WebView(WebPendingPublic) rectsForTextMatches]
+-[WebHTMLView(WebDocumentInternalProtocols) rectsForTextMatches]
+-[WebHTMLView(WebDocumentPrivateProtocols) selectionRect]
+-[WebHTMLView(WebDocumentPrivateProtocols) selectionTextRects]
+__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE6shrinkEm
+-[WebHTMLView(WebDocumentPrivateProtocols) selectionImageForcingBlackText:]
+-[WebHTMLView(WebDocumentPrivateProtocols) selectedString]
+__Z8hexDigiti
+__ZNK20WebFrameLoaderClient14willUseArchiveEPN7WebCore14ResourceLoaderERKNS0_15ResourceRequestERKNS0_4KURLE
+__ZNK20WebFrameLoaderClient22canUseArchivedResourceEP12NSURLRequest
+-[WebDataSource(WebInternal) _archivedSubresourceForURL:]
++[WebHistoryItem(WebPrivate) _releaseAllPendingPageCaches]
+-[WebView initWithFrame:]
+-[WebView stringByEvaluatingJavaScriptFromString:]
+-[WebFrameView(WebPrivate) _hasScrollBars]
+-[WebFrameView(WebPrivate) _largestChildWithScrollBars]
+__ZN15WebEditorClient17userVisibleStringEP5NSURL
+_WKGetExtensionsForMIMEType
+_WKSetPatternBaseCTM
+-[DOMNode(WebDOMNodeOperations) _subresourceURLs]
+-[DOMHTMLScriptElement(WebDOMHTMLScriptElementOperationsPrivate) _subresourceURLs]
+-[DOMHTMLLinkElement(WebDOMHTMLLinkElementOperationsPrivate) _subresourceURLs]
+-[DOMHTMLBodyElement(WebDOMHTMLBodyElementOperationsPrivate) _subresourceURLs]
+-[DOMHTMLInputElement(WebDOMHTMLInputElementOperationsPrivate) _subresourceURLs]
++[WebView(WebPrivate) _decodeData:]
+-[WebPreferences userStyleSheetLocation]
+-[WebPreferences setUserStyleSheetEnabled:]
+-[WebPreferences(WebPrivate) setDeveloperExtrasEnabled:]
+__ZN18WebInspectorClient19inspectedURLChangedERKN7WebCore6StringE
+__ZNK18WebInspectorClient17updateWindowTitleEv
+-[WebView(WebPrivate) inspector]
+-[WebInspector initWithWebView:]
+-[WebInspector show:]
+__ZN18WebInspectorClient10createPageEv
+-[WebInspectorWindowController initWithInspectedWebView:]
+-[WebInspectorWindowController init]
+-[WebPreferences init]
+-[WebPreferences setLoadsImagesAutomatically:]
+-[WebPreferences(WebPrivate) setAuthorAndUserStylesEnabled:]
+-[WebPreferences setJavaScriptEnabled:]
+-[WebPreferences setAllowsAnimatedImages:]
+-[WebPreferences setPlugInsEnabled:]
+-[WebPreferences setJavaEnabled:]
+-[WebPreferences setTabsToLinks:]
+-[WebPreferences setMinimumLogicalFontSize:]
+-[WebView setDrawsBackground:]
+-[WebView(WebPrivate) setProhibitsMainFrameScrolling:]
+-[WebInspectorWindowController webView]
+-[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]
+__ZN18WebInspectorClient19localizedStringsURLEv
+__ZN18WebInspectorClient10showWindowEv
+-[WebInspectorWindowController window]
+_WKNSWindowMakeBottomCornersSquare
+-[WebInspectorWindowController showWindow:]
+-[WebDefaultUIDelegate webViewFirstResponder:]
+-[WebDefaultUIDelegate webView:didDrawRect:]
+-[WebInspectorWindowController windowShouldClose:]
+-[WebInspector showConsole:]
+-[WebDefaultUIDelegate webView:makeFirstResponder:]
+__ZN18WebInspectorClient12attachWindowEv
+-[WebInspectorWindowController attach]
+-[WebInspectorWindowController close]
+-[WebInspectorWindowController animationDidEnd:]
+__ZN18WebInspectorClient12detachWindowEv
+-[WebInspectorWindowController detach]
+-[WebView setShouldCloseWithWindow:]
+-[WebFrame globalContext]
__ZN15WebEditorClient18shouldBeginEditingEPN7WebCore5RangeE
-[WebDefaultEditingDelegate webView:shouldBeginEditingInDOMRange:]
__ZN15WebEditorClient15didBeginEditingEv
--[WebHTMLView _toggleBold]
+__ZN15WebEditorClient25shouldShowDeleteInterfaceEPN7WebCore11HTMLElementE
+-[WebDefaultEditingDelegate webView:shouldShowDeleteInterfaceForElement:]
+-[WebDefaultEditingDelegate undoManagerForWebView:]
__ZN15WebEditorClient16shouldEndEditingEPN7WebCore5RangeE
-[WebDefaultEditingDelegate webView:shouldEndEditingInDOMRange:]
__ZN15WebEditorClient13didEndEditingEv
-__ZN15WebChromeClient18runJavaScriptAlertEPN7WebCore5FrameERKNS0_6StringE
-__ZN15WebChromeClient20runJavaScriptConfirmEPN7WebCore5FrameERKNS0_6StringE
-__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS4_
-__Z28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selectorS2_S2_
-__ZN15WebEditorClient25shouldShowDeleteInterfaceEPN7WebCore11HTMLElementE
--[WebDefaultEditingDelegate webView:shouldShowDeleteInterfaceForElement:]
-__ZN15WebEditorClient26shouldMoveRangeAfterDeleteEPN7WebCore5RangeES2_
--[WebDefaultEditingDelegate webView:shouldMoveRangeAfterDelete:replacingRange:]
--[WebHTMLView(WebInternal) cut:]
-__ZNK7WebCore19SelectionController7toRangeEv
-__ZNK3WTF10PassRefPtrIN7WebCore5RangeEE3getEv
-__ZN3WTF10PassRefPtrIN7WebCore5RangeEED1Ev
-__ZN7WebCore6SharedINS_5RangeEE5derefEv
-__ZNK7WebCore16FrameLoadRequest7isEmptyEv
--[WebViewFactory fileButtonChooseFileLabel]
--[WebBaseNetscapePluginView keyDown:]
-_WKSendKeyEventToTSM
-__Z15TSMEventHandlerP25OpaqueEventHandlerCallRefP14OpaqueEventRefPv
--[WebBaseNetscapePluginView keyUp:]
--[WebBaseNetscapePluginView windowWillClose:]
-+[WebHistoryItem(WebPrivate) _releaseAllPendingPageCaches]
--[WebBaseNetscapePluginView viewWillMoveToHostWindow:]
--[WebBaseNetscapePluginView viewDidMoveToHostWindow]
+-[WebView(WebFileInternal) _isLoading]
+-[WebDefaultUIDelegate webView:didScrollDocumentInFrameView:]
+-[WebFrameBridge setIsSelected:forView:]
+-[WebViewFactory contextMenuItemTagInspectElement]
+__ZN18WebInspectorClient9highlightEPN7WebCore4NodeE
+-[WebInspectorWindowController highlightAndScrollToNode:]
+-[WebInspectorWindowController highlightNode:]
+-[WebNodeHighlight initWithTargetView:]
+-[WebNodeHighlight(FileInternal) _computeHighlightWindowFrame]
+-[WebNodeHighlightView initWithWebNodeHighlight:]
+-[WebNodeHighlightView setFractionFadedIn:]
+-[WebNodeHighlight setDelegate:]
+-[WebNodeHighlight attachHighlight]
+-[WebNodeHighlightView drawRect:]
+-[WebNodeHighlightView(FileInternal) _holes]
+-[WebNodeHighlight highlightedNode]
+-[WebNodeHighlight targetView]
+-[NSView(WebExtras) _web_convertRect:toView:]
+-[WebNodeHighlight show]
+-[WebNodeHighlightView fractionFadedIn]
+-[WebNodeHighlight setHighlightedNode:]
+-[WebNodeHighlight highlightView]
+-[WebNodeHighlightFadeInAnimation setCurrentProgress:]
+-[WebNodeHighlight(FileInternal) _animateFadeIn:]
+-[WebNodeHighlight animationDidEnd:]
+-[WebNodeHighlight(FileInternal) _repositionHighlightWindow]
+-[WebFrameView _goBack]
+__ZN18WebInspectorClient13hideHighlightEv
+-[WebInspectorWindowController hideHighlight]
+-[WebNodeHighlight hide]
+-[WebInspector webViewClosed]
+__ZN18WebInspectorClient11closeWindowEv
+-[WebNodeHighlight detachHighlight]
+-[WebNodeHighlightView detachFromWebNodeHighlight]
+-[WebNodeHighlight dealloc]
+-[WebInspectorWindowController dealloc]
+-[WebNodeHighlightView dealloc]
+-[WebView customUserAgent]
++[WebCoreStatistics setShouldPrintExceptions:]
+[WebKitStatistics webViewCount]
+[WebKitStatistics frameCount]
+[WebKitStatistics dataSourceCount]
+[WebKitStatistics viewCount]
+[WebKitStatistics HTMLRepresentationCount]
+[WebKitStatistics bridgeCount]
-+[WebCoreStatistics javaScriptInterpretersCount]
--[WebView initWithFrame:]
--[WebView stringByEvaluatingJavaScriptFromString:]
--[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]
--[WebFrame _loadHTMLString:baseURL:unreachableURL:]
-__ZN7WebCore15ResourceRequestC1ERKNS_4KURLE
-__ZN7WebCore19ResourceRequestBaseC2ERKNS_4KURLENS_26ResourceRequestCachePolicyE
-__ZN3WTF9RetainPtrI12NSURLRequestEC1Ev
-__ZN7WebCore14SubstituteDataC1EN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_6StringES7_RKNS_4KURLESA_
-__ZN7WebCore14SubstituteDataD1Ev
-+[WebCache setDisabled:]
--[WebResource frameName]
--[WebPreferences setJavaEnabled:]
--[WebPreferences setJavaScriptEnabled:]
--[WebPreferences setUserStyleSheetEnabled:]
--[WebPreferences userStyleSheetLocation]
--[WebPreferences setPlugInsEnabled:]
--[WebPreferences setAllowsAnimatedImages:]
--[WebPreferences setLoadsImagesAutomatically:]
--[WebPreferences setShouldPrintBackgrounds:]
--[WebPreferences setDefaultTextEncodingName:]
--[WebPreferences _setStringValue:forKey:]
--[WebPreferences setUserStyleSheetLocation:]
++[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]
++[WebCoreStatistics statistics]
++[WebCache statistics]
++[WebCoreStatistics javaScriptObjectsCount]
++[WebCoreStatistics javaScriptGlobalObjectsCount]
++[WebCoreStatistics javaScriptProtectedObjectsCount]
++[WebCoreStatistics javaScriptProtectedObjectTypeCounts]
++[WebCoreStatistics iconPageURLMappingCount]
++[WebCoreStatistics iconRetainedPageURLCount]
++[WebCoreStatistics iconRecordCount]
++[WebCoreStatistics iconsWithDataCount]
++[WebCoreStatistics garbageCollectJavaScriptObjects]
+-[WebHTMLView(WebPrivate) _hasInsertionPoint]
+-[WebHTMLRepresentation canSaveAsWebArchive]
++[WebView(WebPrivate) suggestedFileExtensionForMIMEType:]
+-[WebHTMLRepresentation DOMDocument]
+-[WebFrameView documentViewShouldHandlePrint]
+-[WebFrameView printOperationWithPrintInfo:]
+-[WebFrameView canPrintHeadersAndFooters]
+-[WebHTMLView canPrintHeadersAndFooters]
+-[WebHTMLView knowsPageRange:]
+-[WebHTMLView _availablePaperWidthForPrintOperation:]
+-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]
+-[WebView(WebViewPrintingPrivate) _adjustPrintingMarginsForHeaderAndFooter]
+-[NSPrintOperation(WebKitExtras) _web_pageSetupScaleFactor]
+-[WebView(WebViewPrintingPrivate) _headerHeight]
+__Z28CallUIDelegateReturningFloatP7WebViewP13objc_selector
+__Z26CallDelegateReturningFloatP7WebViewP11objc_objectP13objc_selector
+-[WebView(WebViewPrintingPrivate) _footerHeight]
+-[WebHTMLView _scaleFactorForPrintOperation:]
+-[WebHTMLView(WebHTMLViewFileInternal) _calculatePrintHeight]
+-[WebHTMLView _provideTotalScaleFactorForPrintOperation:]
+-[WebHTMLView beginDocument]
+-[WebHTMLView rectForPage:]
+-[WebHTMLView endDocument]
+-[WebHTMLView _endPrintMode]
+-[WebHTMLView drawPageBorderWithSize:]
+-[WebView(WebViewPrintingPrivate) _drawHeaderAndFooter]
+-[WebView(WebViewPrintingPrivate) _drawHeaderInRect:]
+__Z14CallUIDelegateP7WebViewP13objc_selector7_NSRect
+__Z12CallDelegateP7WebViewP11objc_objectP13objc_selector7_NSRect
+-[WebView(WebViewPrintingPrivate) _drawFooterInRect:]
+_NPN_MemAlloc
+-[WebBaseNetscapePluginView fixWindowPort]
+_WKCGContextIsBitmapContext
+_WKCallDrawingNotification
+__ZN20WebFrameLoaderClient41dispatchDidReceiveAuthenticationChallengeEPN7WebCore14DocumentLoaderEmRKNS0_23AuthenticationChallengeE
++[WebPanelAuthenticationHandler sharedHandler]
+-[WebPanelAuthenticationHandler init]
+-[WebPanelAuthenticationHandler startAuthentication:window:]
+-[WebAuthenticationPanel initWithCallback:selector:]
+-[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setObject:forUncopiedKey:]
+-[WebAuthenticationPanel runAsSheetOnWindow:withChallenge:]
+-[WebAuthenticationPanel setUpForChallenge:]
+-[WebAuthenticationPanel loadNib]
+-[NSControl(WebExtras) sizeToFitAndAdjustWindowHeight]
+-[WebAuthenticationPanel logIn:]
+-[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]
+-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]
+-[WebAuthenticationPanel dealloc]
+-[WebPanelAuthenticationHandler tryNextChallengeForWindow:]
+-[WebDownloadInternal download:shouldDecodeSourceDataOfMIMEType:]
+__ZN20WebFrameLoaderClient20redirectDataToPluginEPN7WebCore6WidgetE
+-[WebFrameBridge redirectDataToPlugin:]
+-[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:]
+-[WebPluginController pluginView:receivedResponse:]
+-[WebPluginController pluginView:receivedError:]
+-[WebPluginController pluginView:receivedData:]
+__ZN15WebChromeClient12canTakeFocusEN7WebCore14FocusDirectionE
+__ZN15WebChromeClient9takeFocusEN7WebCore14FocusDirectionE
+-[WebView(WebViewInternal) _becomingFirstResponderFromOutside]
+-[WebPluginController _webPluginContainerCheckIfAllowedToLoadRequest:inFrame:resultObject:selector:]
++[WebPluginContainerCheck checkWithRequest:target:resultObject:selector:controller:]
+-[WebPluginContainerCheck initWithRequest:target:resultObject:selector:controller:]
+-[WebPluginContainerCheck start]
+-[WebPluginContainerCheck _isForbiddenFileLoad]
+-[WebPluginController bridge]
+-[WebPluginContainerCheck _askPolicyDelegate]
+-[WebPluginController webView]
+-[WebPluginContainerCheck _actionInformationWithURL:]
+-[WebPolicyDecisionListener _initWithTarget:action:]
+-[WebPolicyDecisionListenerPrivate initWithTarget:action:]
+-[WebPolicyDecisionListener use]
+-[WebPolicyDecisionListener _usePolicy:]
+-[WebPluginContainerCheck _continueWithPolicy:]
+-[WebPluginController _webPluginContainerCancelCheckIfAllowedToLoadRequest:]
+-[WebPluginContainerCheck cancel]
+-[WebPolicyDecisionListener _invalidate]
+-[WebPolicyDecisionListener dealloc]
+-[WebPolicyDecisionListenerPrivate dealloc]
+-[WebPluginContainerCheck dealloc]
+-[WebBaseNetscapePluginView(Internal) _redeliverStream]
+-[WebBaseNetscapePluginView pluginView:receivedResponse:]
+-[WebNetscapePluginStream initWithFrameLoader:]
+-[WebBaseNetscapePluginView pluginView:receivedData:]
+-[WebBaseNetscapePluginStream plugin]
+-[WebBaseNetscapePluginView plugin]
+-[WebBaseNetscapePluginView pluginViewFinishedLoading:]
+__ZN13WebDragClient22createDragImageForLinkERN7WebCore4KURLERKNS0_6StringEPNS0_5FrameE
+-[WebHTMLView(WebPrivate) _dragImageForURL:withLabel:]
+-[NSString(WebKitExtras) _web_drawDoubledAtPoint:withTopColor:bottomColor:font:]
+-[WebViewFactory fileButtonChooseFileLabel]
+-[WebViewFactory fileButtonNoFileSelectedLabel]
+-[WebViewFactory submitButtonDefaultLabel]
+__ZN15WebChromeClient19runJavaScriptPromptEPN7WebCore5FrameERKNS0_6StringES5_RS3_
+__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_S4_
+__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_S2_
+-[WebJavaScriptTextInputPanel initWithPrompt:text:]
+-[NSWindow(WebExtras) centerOverMainWindow]
+-[WebJavaScriptTextInputPanel pressedOK:]
+-[WebJavaScriptTextInputPanel text]
+__ZN15WebEditorClient26shouldMoveRangeAfterDeleteEPN7WebCore5RangeES2_
+-[WebDefaultEditingDelegate webView:shouldMoveRangeAfterDelete:replacingRange:]
+__ZN15WebChromeClient18runJavaScriptAlertEPN7WebCore5FrameERKNS0_6StringE
+__ZN15WebChromeClient27runBeforeUnloadConfirmPanelERKN7WebCore6StringEPNS0_5FrameE
+__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS4_
+__Z28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selectorS2_S2_
+__ZN15WebEditorClient34updateSpellingUIWithMisspelledWordERKN7WebCore6StringE
+__ZN15WebEditorClient17getGuessesForWordERKN7WebCore6StringERN3WTF6VectorIS1_Lm0EEE
+__ZN3WTF6VectorIN7WebCore6StringELm0EE14expandCapacityEm
+__ZN3WTF6VectorIN7WebCore6StringELm0EE15reserveCapacityEm
+-[WebViewFactory contextMenuItemTagSpellingMenu]
+-[WebViewFactory contextMenuItemTagShowSpellingPanel:]
+-[WebViewFactory contextMenuItemTagCheckSpelling]
+-[WebViewFactory contextMenuItemTagCheckSpellingWhileTyping]
+-[WebViewFactory contextMenuItemTagCheckGrammarWithSpelling]
+__ZN15WebEditorClient19spellingUIIsShowingEv
+-[WebViewFactory contextMenuItemTagFontMenu]
+-[WebViewFactory contextMenuItemTagShowFonts]
+-[WebViewFactory contextMenuItemTagBold]
+-[WebViewFactory contextMenuItemTagItalic]
+-[WebViewFactory contextMenuItemTagUnderline]
+-[WebViewFactory contextMenuItemTagOutline]
+-[WebViewFactory contextMenuItemTagStyles]
+-[WebViewFactory contextMenuItemTagShowColors]
+-[WebViewFactory contextMenuItemTagSpeechMenu]
+-[WebViewFactory contextMenuItemTagStartSpeaking]
+-[WebViewFactory contextMenuItemTagStopSpeaking]
+-[WebViewFactory contextMenuItemTagWritingDirectionMenu]
+-[WebViewFactory contextMenuItemTagDefaultDirection]
+-[WebViewFactory contextMenuItemTagLeftToRight]
+-[WebViewFactory contextMenuItemTagRightToLeft]
+__ZN15WebEditorClient21toggleGrammarCheckingEv
+-[WebView(WebViewGrammarChecking) toggleGrammarChecking:]
+-[WebView(WebViewGrammarChecking) setGrammarCheckingEnabled:]
+__ZN15WebEditorClient20checkGrammarOfStringEPKtiRN3WTF6VectorIN7WebCore13GrammarDetailELm0EEEPiS8_
+__ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EE14expandCapacityEmPKS2_
+__ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EE14expandCapacityEm
+__ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EE15reserveCapacityEm
+__ZN3WTF6VectorIN7WebCore6StringELm0EEC2ERKS3_
+__ZN3WTF6VectorIN7WebCore6StringELm0EE14expandCapacityEmPKS2_
+__ZN3WTF6VectorIN7WebCore6StringELm0EE6shrinkEm
+-[WebHTMLView selectAll:]
+-[WebHTMLView executeCoreCommandBySelector:]
+-[WebHTMLView callDelegateDoCommandBySelectorIfNeeded:]
+-[WebHTMLView showGuessPanel:]
+-[WebHTMLView ignoreSpelling:]
+-[WebHTMLView checkSpelling:]
+__ZN15WebEditorClient33updateSpellingUIWithGrammarStringERKN7WebCore6StringERKNS0_13GrammarDetailE
+-[WebHTMLView changeSpelling:]
+-[WebHTMLView _changeSpellingToWord:]
+-[WebHTMLView(WebHTMLViewFileInternal) _shouldReplaceSelectionWithText:givenAction:]
+-[WebHTMLView(WebHTMLViewFileInternal) _selectedRange]
+-[WebHTMLView(WebHTMLViewFileInternal) _shouldInsertText:replacingDOMRange:givenAction:]
+-[WebView windowScriptObject]
+-[WebView setCustomTextEncodingName:]
-[WebPreferences setStandardFontFamily:]
+-[WebPreferences _setStringValue:forKey:]
-[WebPreferences setDefaultFontSize:]
--[WebPreferences setFixedFontFamily:]
--[WebPreferences setDefaultFixedFontSize:]
--[WebFrame loadArchive:]
-__ZN3WTF6RefPtrIN7WebCore14DocumentLoaderEEC1IS2_EERKNS_10PassRefPtrIT_EE
-__ZNK3WTF10PassRefPtrIN7WebCore14DocumentLoaderEE10releaseRefEv
-__ZN3WTF10PassRefPtrIN7WebCore14DocumentLoaderEED1Ev
-__ZN3WTF6RefPtrIN7WebCore14DocumentLoaderEED1Ev
--[WebDefaultUIDelegate webView:didDrawRect:]
--[WebView setTextSizeMultiplier:]
--[WebPreferences(WebPrivate) setShowsURLsInToolTips:]
--[WebResource(WebResourcePrivate) _ignoreWhenUnarchiving]
--[WebView(WebViewEditing) editingDelegate]
--[NSView(WebExtras) _webView]
--[WebView(WebPrivate) setAlwaysShowVerticalScroller:]
--[WebDynamicScrollBarsView setVerticalScrollingModeLocked:]
--[WebView frameLoadDelegate]
-__Z22createUniqueWebDataURLv
--[WebView(WebViewEditing) setContinuousSpellCheckingEnabled:]
-+[WebView(WebFileInternal) _preflightSpellChecker]
--[WebDefaultEditingDelegate undoManagerForWebView:]
--[WebView(WebViewEditing) selectedDOMRange]
--[WebView(WebViewEditing) selectionAffinity]
-__ZNK7WebCore19SelectionController8affinityEv
-__ZNK7WebCore9Selection8affinityEv
--[WebView(WebViewEditing) setSelectedDOMRange:affinity:]
--[WebView(WebViewEditing) setEditable:]
-__ZN7WebCore4Page30setTabKeyCyclesThroughElementsEb
--[WebView(WebPendingPublic) setTabKeyCyclesThroughElements:]
-+[WebView(WebFileInternal) _preflightSpellCheckerNow:]
--[WebDefaultUIDelegate webViewFirstResponder:]
--[WebDefaultUIDelegate webView:makeFirstResponder:]
--[WebView(WebViewEditing) typingStyle]
--[WebView(WebFileInternal) _bridgeForSelectedOrMainFrame]
--[WebHTMLView moveToBeginningOfLineAndModifySelection:]
-__ZN3WTF6VectorIcLm256EEC1Em
-__ZN3WTF12VectorBufferIcLm256EEC1Ev
-__ZN3WTF12VectorBufferIcLm256EE12inlineBufferEv
-__ZN3WTF12VectorBufferIcLm0EEC2EPcm
-__ZNK3WTF6VectorIcLm256EE8capacityEv
-__ZNK3WTF12VectorBufferIcLm0EE8capacityEv
-__ZN3WTF6VectorIcLm256EE5beginEv
-__ZN3WTF6VectorIcLm256EE4dataEv
-__ZN3WTF6VectorIcLm256EE3endEv
-__ZN3WTF20VectorTypeOperationsIcE10initializeEPcS2_
-__ZN3WTF17VectorInitializerILb0ELb0EcE10initializeEPcS2_
-__Z7toupperi
-__ZN3WTF6VectorIcLm256EEixEm
-__ZN3WTF6VectorIcLm256EE2atEm
-__ZNK3WTF6VectorIcLm256EE4sizeEv
-__ZN3WTF6VectorIcLm256EED1Ev
-__ZN3WTF6VectorIcLm256EE5clearEv
-__ZN3WTF12VectorBufferIcLm256EED1Ev
--[WebHTMLView changeFont:]
--[WebHTMLView _styleFromFontManagerOperation]
--[WebHTMLView _emptyStyle]
--[WebHTMLView _originalFontA]
--[WebHTMLView _originalFontB]
--[WebHTMLView _addToStyle:fontA:fontB:]
--[WebHTMLView _applyStyleToSelection:withUndoAction:]
-__Z4coreP22DOMCSSStyleDeclaration
-__ZN15WebEditorClient16shouldApplyStyleEPN7WebCore19CSSStyleDeclarationEPNS0_5RangeE
-__Z3kitPN7WebCore19CSSStyleDeclarationE
--[WebResource(WebResourcePrivate) _shouldIgnoreWhenUnarchiving]
--[WebDefaultUIDelegate webView:didScrollDocumentInFrameView:]
+-[WebPreferences setDefaultTextEncodingName:]
++[WebDatabaseManager sharedWebDatabaseManager]
+-[WebDatabaseManager origins]
+-[WebFrameBridge runOpenPanelForFileButtonWithResultListener:]
+_WKCreateCustomCFReadStream
+_WKSignalCFReadStreamHasBytes
+_WKSignalCFReadStreamEnd
+-[WebHTMLView copy:]
+__ZN15WebEditorClient24smartInsertDeleteEnabledEv
+__ZN15WebEditorClient33didSetSelectionTypesForPasteboardEv
+-[WebDefaultEditingDelegate webView:didSetSelectionTypesForPasteboard:]
+__ZN15WebEditorClient24dataForArchivedSelectionEPN7WebCore5FrameE
++[WebArchiver archiveSelectionInFrame:]
+-[DOMHTMLTableCellElement(WebDOMHTMLTableCellElementOperationsPrivate) _subresourceURLs]
+-[DOMHTMLTableCellElement(WebDOMHTMLTableCellElementOperationsPrivate) _web_background]
+-[DOMHTMLTableElement(WebDOMHTMLTableElementOperationsPrivate) _subresourceURLs]
+-[DOMHTMLTableElement(WebDOMHTMLTableElementOperationsPrivate) _web_background]
+__ZN15WebEditorClient29didWriteSelectionToPasteboardEv
+-[WebDefaultEditingDelegate webView:didWriteSelectionToPasteboard:]
+-[WebView(WebPendingPublic) setHoverFeedbackSuspended:]
+-[WebHTMLView(WebInternal) _hoverFeedbackSuspendedChanged]
-[WebView elementAtPoint:]
-[WebView _elementAtWindowPoint:]
-[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:]
--[WebHTMLView changeColor:]
--[WebHTMLView _styleFromColorPanelWithSelector:]
--[WebHTMLView _colorAsString:]
--[WebHTMLView deleteForward:]
--[WebFrameBridge setIsSelected:forView:]
--[WebView policyDelegate]
--[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]
--[WebFrameView(WebPrivate) _setCustomScrollViewClass:]
--[WebFrameView _bridge]
--[WebDynamicScrollBarsView setHorizontalScrollingModeLocked:]
--[WebHTMLView(WebPrivate) _setHighlighter:ofType:]
-__ZN3WTF10PassRefPtrIN7WebCore5FrameEEC1EPS2_
-__ZNK3WTF10PassRefPtrIN7WebCore13KeyboardEventEE3getEv
-__ZN3WTF10PassRefPtrIN7WebCore13KeyboardEventEED1Ev
-__Z4coreP7DOMNode
-__ZN7WebCore4coreEj
--[WebHTMLView moveUp:]
--[WebView(WebViewEditing) editableDOMRangeForPoint:]
--[WebView moveDragCaretToPoint:]
--[WebHTMLView(WebPrivate) _documentFragmentFromPasteboard:forType:inContext:subresources:]
--[WebHTMLView(WebHTMLViewFileInternal) _dataSource]
--[WebDataSource(WebInternal) _documentFragmentWithArchive:]
--[WebResource(WebResourcePrivate) _response]
-__ZNK20WebFrameLoaderClient22canUseArchivedResourceEP13NSURLResponse
-_WKGetNSURLResponseMustRevalidate
-_WKGetNSURLResponseCalculatedExpiration
-__ZN3WTF9RetainPtrI11WebResourceEC1EPS1_
-__ZN3WTF18PairBaseHashTraitsINS_10HashTraitsIiEENS1_INS_9RetainPtrI11WebResourceEEEEE10emptyValueEv
-__ZN3WTF17GenericHashTraitsINS_9RetainPtrI11WebResourceEEE10emptyValueEv
-__ZN3WTF9RetainPtrI11WebResourceEC1Ev
-__ZSt9make_pairIiN3WTF9RetainPtrI11WebResourceEEESt4pairIT_T0_ES5_S6_
-__ZNSt4pairIiN3WTF9RetainPtrI11WebResourceEEEC1ERKiRKS3_
-__ZN3WTF9RetainPtrI11WebResourceEC1ERKS2_
-__ZN3WTF9RetainPtrI11WebResourceED1Ev
-__ZN3WTF7PtrHashINS_6RefPtrIN7WebCore14ResourceLoaderEEEE4hashERKS4_
-__ZNK3WTF6RefPtrIN7WebCore14ResourceLoaderEE3getEv
-__ZN3WTF7PtrHashIPN7WebCore14ResourceLoaderEE4hashES3_
-__ZN3WTF18PairFirstExtractorISt4pairIiNS_9RetainPtrI11WebResourceEEEE7extractERKS5_
-__ZNSt4pairIPS_IiN3WTF9RetainPtrI11WebResourceEEEbEC1ERKS5_RKb
-__ZNSt4pairIS_IPS_IiN3WTF9RetainPtrI11WebResourceEEEbEjEC1ERKS6_RKj
-__ZN3WTF17HashMapTranslatorILb0ESt4pairINS_6RefPtrIN7WebCore14ResourceLoaderEEENS_9RetainPtrI11WebResourceEEENS_18PairBaseHashTraitsINS_10HashTraitsIS5_EENSB_IS8_EEEENS_14PairHashTraitsINSB_IiEESD_EENS_7PtrHashIS5_EEE5equalERKiRKS5_
-__ZN3WTF8AssignerILb1ENS_6RefPtrIN7WebCore14ResourceLoaderEEEiNS_10HashTraitsIS4_EEE6assignERKS4_Ri
-__ZN3WTF10HashTraitsINS_6RefPtrIN7WebCore14ResourceLoaderEEEE3refERKi
-__ZN3WTF10HashTraitsINS_6RefPtrIN7WebCore14ResourceLoaderEEEE5derefERKi
-__ZN3WTF8AssignerILb0ENS_9RetainPtrI11WebResourceEES3_NS_10HashTraitsIS3_EEE6assignERKS3_RS3_
-__ZN3WTF9RetainPtrI11WebResourceEaSERKS2_
-__ZNK3WTF9RetainPtrI11WebResourceE3getEv
-__ZZN3WTF22HashTableConstIteratorIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_EppEvE8__func__
-__ZN3WTF9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_E3addINS_6RefPtrIN7WebCore14ResourceLoaderEEES4_NS_17HashMapTranslatorILb0ES1_ISK_S4_ENS_18PairBaseHashTraitsINSB_ISK_EESD_EESE_NS_7PtrHashISK_EEEEEES1_INS_17HashTableIteratorIiS5_S7_S9_SE_SC_EEbERKT_RKT0_
-__ZNSt4pairIN3WTF24HashTableIteratorAdapterINS0_9HashTableIiS_IiNS0_9RetainPtrI11WebResourceEEENS0_18PairFirstExtractorIS6_EENS0_7IntHashIiEENS0_14PairHashTraitsINS0_10HashTraitsIiEENSC_IS5_EEEESD_EES_INS0_6RefPtrIN7WebCore14ResourceLoaderEEES5_EEEbEC1INS0_17HashTableIteratorIiS6_S8_SA_SF_SD_EEbEERKS_IT_T0_E
-__ZN3WTF24HashTableIteratorAdapterINS_9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS6_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSC_IS5_EEEESD_EES2_INS_6RefPtrIN7WebCore14ResourceLoaderEEES5_EEC1ERKNS_17HashTableIteratorIiS6_S8_SA_SF_SD_EE
-__ZN7WebCore9TimerBase12startOneShotEd
-__ZZN3WTF9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_E6lookupINS_6RefPtrIN7WebCore14ResourceLoaderEEENS_17HashMapTranslatorILb0ES1_ISK_S4_ENS_18PairBaseHashTraitsINSB_ISK_EESD_EESE_NS_7PtrHashISK_EEEEEES1_IS1_IPS5_bEjERKT_E8__func__
-__ZN3WTF22IdentityHashTranslatorIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_7IntHashIiEEE4hashERKi
--[WebHTMLView(WebHTMLViewFileInternal) _canSmartReplaceWithPasteboard:]
--[WebView(WebViewEditingInMail) _replaceSelectionWithNode:matchStyle:]
--[WebPluginController webPlugInContainerSelectionColor]
-__ZN7WebCore5TimerI20WebFrameLoaderClientE5firedEv
-__ZN20WebFrameLoaderClient24deliverArchivedResourcesEPN7WebCore5TimerIS_EE
-__ZN3WTF22IdentityHashTranslatorIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_7IntHashIiEEE9translateERS5_RKiRKS5_j
-__ZNSt4pairIiN3WTF9RetainPtrI11WebResourceEEEaSERKS4_
-__ZN3WTF14RefCounterBaseILb1ENS_10HashTraitsINS_6RefPtrIN7WebCore14ResourceLoaderEEEEENS1_IiEEE3refERKi
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsINS_9RetainPtrI11WebResourceEEEES5_E3refERKS4_
-__ZN3WTF10RefCounterINS_18PairBaseHashTraitsINS_10HashTraitsINS_6RefPtrIN7WebCore14ResourceLoaderEEEEENS2_INS_9RetainPtrI11WebResourceEEEEEENS_14PairHashTraitsINS2_IiEESB_EEE3refERKSt4pairIiSA_E
-__ZN3WTF14RefCounterBaseILb1ENS_10HashTraitsINS_6RefPtrIN7WebCore14ResourceLoaderEEEEENS1_IiEEE5derefERKi
-__ZN3WTF14RefCounterBaseILb0ENS_10HashTraitsINS_9RetainPtrI11WebResourceEEEES5_E5derefERKS4_
-__ZNSt4pairIiN3WTF9RetainPtrI11WebResourceEEED1Ev
-__ZN3WTFneINS_9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS6_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSC_IS5_EEEESD_EES2_INS_6RefPtrIN7WebCore14ResourceLoaderEEES5_EEEbRKNS_29HashTableConstIteratorAdapterIT_T0_EESR_
-__ZN3WTF6RefPtrIN7WebCore14ResourceLoaderEEC1ERKS3_
-__ZNK3WTF6RefPtrIN7WebCore14ResourceLoaderEEptEv
-__ZN7WebCore16ResourceResponseC1EP13NSURLResponse
-__ZN3WTF9RetainPtrI13NSURLResponseEC1EPS1_
-__ZN7WebCore16ResourceResponseD1Ev
-__ZN3WTF9RetainPtrI13NSURLResponseED1Ev
-__ZN3WTF29HashTableConstIteratorAdapterINS_9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS6_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSC_IS5_EEEESD_EES2_INS_6RefPtrIN7WebCore14ResourceLoaderEEES5_EEppEv
--[WebResource(WebResourcePrivate) _stringValue]
--[WebPreferences setJavaScriptCanOpenWindowsAutomatically:]
--[WebPreferences setAllowsAnimatedImageLooping:]
--[WebFrame(WebPrivate) _bodyBackgroundColor]
-__ZNK7WebCore4Node8rendererEv
-__ZNK7WebCore12RenderObject5styleEv
-__ZNK7WebCore11RenderStyle15backgroundColorEv
-__ZNK7WebCore7DataRefINS_19StyleBackgroundDataEEptEv
-__ZNK7WebCore5Color7isValidEv
--[WebView(WebViewEditingInMail) _insertNewlineInQuotedContent]
--[WebHTMLView moveDown:]
--[WebHTMLView moveDownAndModifySelection:]
--[WebHTMLView validRequestorForSendType:returnType:]
--[WebHTMLView(WebDocumentPrivateProtocols) pasteboardTypesForSelection]
--[WebHTMLView(WebInternal) _canSmartCopyOrDelete]
--[WebHTMLView(WebPrivate) _canIncreaseSelectionListLevel]
--[WebHTMLView(WebPrivate) _canDecreaseSelectionListLevel]
--[WebHTMLView(WebPrivate) _canEditRichly]
--[DOMRange(WebDOMRangeOperations) webArchive]
-+[WebArchiver archiveRange:]
--[DOMRange(WebDOMRangeOperations) _bridge]
--[WebDataSource addSubresource:]
--[WebUnarchivingState addResource:]
-__ZNK7WebCore19SelectionController23isContentRichlyEditableEv
--[WebHTMLView(WebHTMLViewFileInternal) _pasteWithPasteboard:allowPlainText:]
--[WebHTMLView(WebHTMLViewFileInternal) _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]
-__ZN3WTF22IdentityHashTranslatorIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_7IntHashIiEEE5equalERKiSA_
-__ZN3WTF7PtrHashINS_6RefPtrIN7WebCore14ResourceLoaderEEEE5equalERKS4_S7_
-__ZN3WTFeqIN7WebCore14ResourceLoaderES2_EEbRKNS_6RefPtrIT_EERKNS3_IT0_EE
--[WebHTMLView(WebHTMLViewFileInternal) _shouldInsertFragment:replacingDOMRange:givenAction:]
--[WebView(WebViewUndoableEditing) replaceSelectionWithNode:]
--[WebHTMLView indent:]
--[WebHTMLView outdent:]
--[WebHTMLView alignCenter:]
--[WebHTMLView _alignSelectionUsingCSSValue:withUndoAction:]
--[WebHTMLView alignRight:]
--[WebHTMLView alignJustified:]
--[WebHTMLView alignLeft:]
--[WebHTMLView(WebPrivate) _increaseSelectionListLevelUnordered]
-__ZNK3WTF10PassRefPtrIN7WebCore4NodeEE3getEv
-__ZN7WebCore10TreeSharedINS_4NodeEE5derefEv
--[WebHTMLView underline:]
-+[WebView _applicationWillTerminate]
--[WebScriptDebugServer applicationTerminating:]
-__ZN3WTF9RetainPtrI7NSArrayED1Ev
--[WebFrame loadHTMLString:baseURL:]
--[WebNetscapePluginPackage(Internal) _unloadWithShutdown:]
--[WebPreferences init]
--[WebView(WebPrivate) _setUseFastImageScalingMode:]
--[WebView(WebIBActions) makeTextLarger:]
--[WebHTMLView(WebTextSizing) _makeTextLarger:]
++[WebIconDatabase(WebPrivate) _checkIntegrityBeforeOpening]
+-[WebPDFRepresentation receivedError:withDataSource:]
+-[WebViewFactory resetButtonDefaultLabel]
+_NPN_GetJavaEnv
+_NPN_GetJavaPeer
+__ZNK15WebEditorClient7canUndoEv
+__ZN15WebEditorClient4undoEv
+-[WebEditorUndoTarget undoEditing:]
+-[WebEditCommand command]
+__ZN15WebEditorClient22registerCommandForRedoEN3WTF10PassRefPtrIN7WebCore11EditCommandEEE
+__ZN15WebChromeClient5printEPN7WebCore5FrameE
+__ZNK15WebEditorClient7canRedoEv
+__ZN15WebEditorClient4redoEv
+-[WebEditorUndoTarget redoEditing:]
+-[WebFrameBridge customHighlightRect:forLine:representedNode:]
+-[WebHTMLView(WebInternal) _highlighterForType:]
+-[WebFrameBridge paintCustomHighlight:forBox:onLine:behindText:entireLine:representedNode:]
+_WKQTMovieViewSetDrawSynchronously
+-[WebViewFactory searchableIndexIntroduction]
+_WKDrawMediaMuteButton
+_drawMediaImage
+_WKDrawMediaPlayButton
+_WKDrawMediaSliderTrack
+_WKDrawMediaSliderThumb
+_WKDrawMediaSeekBackButton
+_WKDrawMediaSeekForwardButton
+_WKQTMovieMaxTimeLoaded
+__ZN20WebFrameLoaderClient12blockedErrorERKN7WebCore15ResourceRequestE
+__ZN15WebChromeClient21exceededDatabaseQuotaEPN7WebCore5FrameERKNS0_6StringE
+-[WebSecurityOrigin(WebInternal) _initWithWebCoreSecurityOrigin:]
+-[WebSecurityOrigin quota]
+-[WebDatabaseManager detailsForDatabase:withOrigin:]
+-[WebSecurityOrigin(WebInternal) _core]
+-[WebSecurityOrigin setQuota:]
+__ZN24WebDatabaseTrackerClient23dispatchDidModifyOriginEPN7WebCore14SecurityOriginE
+-[WebSecurityOrigin dealloc]
+__ZN24WebDatabaseTrackerClient25dispatchDidModifyDatabaseEPN7WebCore14SecurityOriginERKNS0_6StringE
+_WKReleaseStyleGroup
+-[WebKeyGenerator strengthMenuItemTitles]
+__ZN15WebChromeClient20runJavaScriptConfirmEPN7WebCore5FrameERKNS0_6StringE
+__ZN15WebChromeClient15toolbarsVisibleEv
+__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selector
+__Z28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selector
+__ZN15WebChromeClient14menubarVisibleEv
+__ZN15WebChromeClient17scrollbarsVisibleEv
+-[WebFrameView allowsScrolling]
+-[WebDynamicScrollBarsView allowsScrolling]
+__ZN15WebChromeClient16statusbarVisibleEv
+__ZSt25__unguarded_linear_insertIPiiEvT_T0_
+-[WebFrame(WebInternal) _internalLoadDelegate]
+-[WebFrame(WebInternal) _setInternalLoadDelegate:]
+-[WebBaseNetscapePluginView(WebNPPCallbacks) webFrame:didFinishLoadWithError:]
+-[WebBaseNetscapePluginView(WebNPPCallbacks) webFrame:didFinishLoadWithReason:]
diff --git a/WebKit/mac/WebKitPrefix.h b/WebKit/mac/WebKitPrefix.h
index 73a1048..da2f2d4 100644
--- a/WebKit/mac/WebKitPrefix.h
+++ b/WebKit/mac/WebKitPrefix.h
@@ -57,20 +57,32 @@
#import <ApplicationServices/ApplicationServices.h>
#import <Carbon/Carbon.h>
+#ifndef CGFLOAT_DEFINED
+#ifdef __LP64__
+typedef double CGFloat;
+#else
+typedef float CGFloat;
+#endif
+#define CGFLOAT_DEFINED 1
+#endif
+
#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 <JavaScriptCore/Platform.h>
+#include "EmptyProtocolDefinitions.h"
-#ifdef __LP64__
-#define WTF_USE_NPOBJECT 0
-#else
-#define WTF_USE_NPOBJECT 1
-#endif
+#include <wtf/Platform.h>
+
+/* 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 */
+#define WTF_USE_JSC 1
+#define WTF_USE_V8 0
#ifdef __cplusplus
#include <wtf/FastMalloc.h>
diff --git a/WebKit/mac/WebView/WebArchive.m b/WebKit/mac/WebView/WebArchive.m
deleted file mode 100644
index bb4bd59..0000000
--- a/WebKit/mac/WebView/WebArchive.m
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 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 "WebArchive.h"
-
-#import "WebKitLogging.h"
-#import "WebResourcePrivate.h"
-#import "WebTypesInternal.h"
-
-NSString *WebArchivePboardType = @"Apple Web Archive pasteboard type";
-
-static NSString * const WebMainResourceKey = @"WebMainResource";
-static NSString * const WebSubresourcesKey = @"WebSubresources";
-static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
-
-@interface WebArchivePrivate : NSObject
-{
- @public
- WebResource *mainResource;
- NSArray *subresources;
- NSArray *subframeArchives;
-}
-@end
-
-@implementation WebArchivePrivate
-
-- (void)dealloc
-{
- [mainResource release];
- [subresources release];
- [subframeArchives release];
- [super dealloc];
-}
-
-@end
-
-static BOOL isArrayOfClass(id object, Class elementClass)
-{
- if (![object isKindOfClass:[NSArray class]])
- return NO;
- NSArray *array = (NSArray *)object;
- NSUInteger count = [array count];
- for (NSUInteger i = 0; i < count; ++i)
- if (![[array objectAtIndex:i] isKindOfClass:elementClass])
- return NO;
- return YES;
-}
-
-@implementation WebArchive
-
-- (id)init
-{
- self = [super init];
- if (!self)
- return nil;
- _private = [[WebArchivePrivate alloc] init];
- return self;
-}
-
-- (id)initWithMainResource:(WebResource *)mainResource subresources:(NSArray *)subresources subframeArchives:(NSArray *)subframeArchives
-{
- self = [self init];
- if (!self)
- return nil;
-
- _private->mainResource = [mainResource retain];
- _private->subresources = [subresources retain];
- _private->subframeArchives = [subframeArchives retain];
-
- if (!_private->mainResource) {
- [self release];
- return nil;
- }
-
- return self;
-}
-
-- (id)_initWithPropertyList:(id)propertyList
-{
- self = [self init];
- if (!self)
- return nil;
-
- if (![propertyList isKindOfClass:[NSDictionary class]]) {
- [self release];
- return nil;
- }
-
- _private->mainResource = [[WebResource alloc] _initWithPropertyList:[propertyList objectForKey:WebMainResourceKey]];
- if (!_private->mainResource) {
- [self release];
- return nil;
- }
-
- _private->subresources = [[WebResource _resourcesFromPropertyLists:[propertyList objectForKey:WebSubresourcesKey]] retain];
-
- NSEnumerator *enumerator = [[propertyList objectForKey:WebSubframeArchivesKey] objectEnumerator];
- NSMutableArray *subframeArchives = [[NSMutableArray alloc] init];
- NSDictionary *archivePropertyList;
- while ((archivePropertyList = [enumerator nextObject]) != nil) {
- WebArchive *archive = [[WebArchive alloc] _initWithPropertyList:archivePropertyList];
- if (archive) {
- [subframeArchives addObject:archive];
- [archive release];
- }
- }
- _private->subframeArchives = subframeArchives;
-
- return self;
-}
-
-- (id)initWithData:(NSData *)data
-{
-#if !LOG_DISABLED
- CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
-#endif
- NSDictionary *propertyList = [NSPropertyListSerialization propertyListFromData:data
- mutabilityOption:NSPropertyListImmutable
- format:nil
- errorDescription:nil];
-#if !LOG_DISABLED
- CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
- CFAbsoluteTime duration = end - start;
-#endif
- LOG(Timing, "Parsing web archive with [NSPropertyListSerialization propertyListFromData::::] took %f seconds", duration);
-
- return [self _initWithPropertyList:propertyList];
-}
-
-- (id)initWithCoder:(NSCoder *)decoder
-{
- self = [self init];
- if (!self)
- return nil;
-
- @try {
- id object = [decoder decodeObjectForKey:WebMainResourceKey];
- if ([object isKindOfClass:[WebResource class]])
- _private->mainResource = [object retain];
- object = [decoder decodeObjectForKey:WebSubresourcesKey];
- if (isArrayOfClass(object, [WebResource class]))
- _private->subresources = [object retain];
- object = [decoder decodeObjectForKey:WebSubframeArchivesKey];
- if (isArrayOfClass(object, [WebArchive class]))
- _private->subframeArchives = [object retain];
- } @catch(id) {
- [self release];
- return nil;
- }
-
- if (!_private->mainResource) {
- [self release];
- return nil;
- }
-
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)encoder
-{
- [encoder encodeObject:_private->mainResource forKey:WebMainResourceKey];
- [encoder encodeObject:_private->subresources forKey:WebSubresourcesKey];
- [encoder encodeObject:_private->subframeArchives forKey:WebSubframeArchivesKey];
-}
-
-- (void)dealloc
-{
- [_private release];
- [super dealloc];
-}
-
-- (id)copyWithZone:(NSZone *)zone
-{
- return [self retain];
-}
-
-- (WebResource *)mainResource
-{
- return [[_private->mainResource retain] autorelease];
-}
-
-- (NSArray *)subresources
-{
- return [[_private->subresources retain] autorelease];
-}
-
-- (NSArray *)subframeArchives
-{
- return [[_private->subframeArchives retain] autorelease];
-}
-
-- (NSDictionary *)_propertyListRepresentation
-{
- NSMutableDictionary *propertyList = [NSMutableDictionary dictionary];
- if (_private->mainResource) {
- [propertyList setObject:[_private->mainResource _propertyListRepresentation] forKey:WebMainResourceKey];
- }
- NSArray *propertyLists = [WebResource _propertyListsFromResources:_private->subresources];
- if ([propertyLists count] > 0) {
- [propertyList setObject:propertyLists forKey:WebSubresourcesKey];
- }
- NSEnumerator *enumerator = [_private->subframeArchives objectEnumerator];
- NSMutableArray *subarchivePropertyLists = [[NSMutableArray alloc] init];
- WebArchive *archive;
- while ((archive = [enumerator nextObject]) != nil) {
- [subarchivePropertyLists addObject:[archive _propertyListRepresentation]];
- }
- if ([subarchivePropertyLists count] > 0) {
- [propertyList setObject:subarchivePropertyLists forKey:WebSubframeArchivesKey];
- }
- [subarchivePropertyLists release];
- return propertyList;
-}
-
-- (NSData *)data
-{
- NSDictionary *propertyList = [self _propertyListRepresentation];
-#if !LOG_DISABLED
- CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
-#endif
- NSData *data = [NSPropertyListSerialization dataFromPropertyList:propertyList format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil];
-#if !LOG_DISABLED
- CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
- CFAbsoluteTime duration = end - start;
-#endif
- LOG(Timing, "Serializing web archive with [NSPropertyListSerialization dataFromPropertyList:::] took %f seconds", duration);
- return data;
-}
-
-@end
diff --git a/WebKit/mac/WebView/WebArchive.mm b/WebKit/mac/WebView/WebArchive.mm
new file mode 100644
index 0000000..c989a9a
--- /dev/null
+++ b/WebKit/mac/WebView/WebArchive.mm
@@ -0,0 +1,374 @@
+/*
+ * Copyright (C) 2005, 2006, 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 "WebArchive.h"
+#import "WebArchiveInternal.h"
+
+#import "WebKitLogging.h"
+#import "WebResourceInternal.h"
+#import "WebResourcePrivate.h"
+#import "WebTypesInternal.h"
+
+#import <WebCore/ArchiveResource.h>
+#import <WebCore/LegacyWebArchive.h>
+#import <WebCore/WebCoreObjCExtras.h>
+
+using namespace WebCore;
+
+NSString *WebArchivePboardType = @"Apple Web Archive pasteboard type";
+
+static NSString * const WebMainResourceKey = @"WebMainResource";
+static NSString * const WebSubresourcesKey = @"WebSubresources";
+static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
+
+@interface WebArchivePrivate : NSObject
+{
+@public
+ WebResource *cachedMainResource;
+ NSArray *cachedSubresources;
+ NSArray *cachedSubframeArchives;
+@private
+ LegacyWebArchive* coreArchive;
+}
+
+- (id)initWithCoreArchive:(PassRefPtr<LegacyWebArchive>)coreArchive;
+- (LegacyWebArchive*)coreArchive;
+- (void)setCoreArchive:(PassRefPtr<LegacyWebArchive>)newCoreArchive;
+@end
+
+@implementation WebArchivePrivate
+
+#ifndef BUILDING_ON_TIGER
++ (void)initialize
+{
+ WebCoreObjCFinalizeOnMainThread(self);
+}
+#endif
+
+- (id)init
+{
+ self = [super init];
+ if (self)
+ coreArchive = LegacyWebArchive::create().releaseRef();
+ return self;
+}
+
+- (id)initWithCoreArchive:(PassRefPtr<LegacyWebArchive>)_coreArchive
+{
+ self = [super init];
+ if (!self || !_coreArchive) {
+ [self release];
+ return nil;
+ }
+
+ coreArchive = _coreArchive.releaseRef();
+
+ return self;
+}
+
+- (LegacyWebArchive*)coreArchive
+{
+ return coreArchive;
+}
+
+- (void)setCoreArchive:(PassRefPtr<LegacyWebArchive>)newCoreArchive
+{
+ ASSERT(coreArchive);
+ ASSERT(newCoreArchive);
+ coreArchive->deref();
+ coreArchive = newCoreArchive.releaseRef();
+}
+
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebArchivePrivate class], self))
+ return;
+
+ ASSERT(coreArchive);
+ coreArchive->deref();
+ coreArchive = 0;
+
+ [cachedMainResource release];
+ [cachedSubresources release];
+ [cachedSubframeArchives release];
+
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ ASSERT(coreArchive);
+ coreArchive->deref();
+ coreArchive = 0;
+
+ [super finalize];
+}
+
+@end
+
+@implementation WebArchive
+
+- (id)init
+{
+ self = [super init];
+ if (!self)
+ return nil;
+ _private = [[WebArchivePrivate alloc] init];
+ return self;
+}
+
+static BOOL isArrayOfClass(id object, Class elementClass)
+{
+ if (![object isKindOfClass:[NSArray class]])
+ return NO;
+ NSArray *array = (NSArray *)object;
+ NSUInteger count = [array count];
+ for (NSUInteger i = 0; i < count; ++i)
+ if (![[array objectAtIndex:i] isKindOfClass:elementClass])
+ return NO;
+ return YES;
+}
+
+- (id)initWithMainResource:(WebResource *)mainResource subresources:(NSArray *)subresources subframeArchives:(NSArray *)subframeArchives
+{
+ self = [super init];
+ if (!self)
+ return nil;
+
+ _private = [[WebArchivePrivate alloc] init];
+
+ _private->cachedMainResource = [mainResource retain];
+ if (!_private->cachedMainResource) {
+ [self release];
+ return nil;
+ }
+
+ if (!subresources || isArrayOfClass(subresources, [WebResource class]))
+ _private->cachedSubresources = [subresources retain];
+ else {
+ [self release];
+ return nil;
+ }
+
+ if (!subframeArchives || isArrayOfClass(subframeArchives, [WebArchive class]))
+ _private->cachedSubframeArchives = [subframeArchives retain];
+ else {
+ [self release];
+ return nil;
+ }
+
+ RefPtr<ArchiveResource> coreMainResource = mainResource ? [mainResource _coreResource] : 0;
+
+ Vector<PassRefPtr<ArchiveResource> > coreResources;
+ NSEnumerator *enumerator = [subresources objectEnumerator];
+ WebResource *subresource;
+ while ((subresource = [enumerator nextObject]) != nil)
+ coreResources.append([subresource _coreResource]);
+
+ Vector<PassRefPtr<LegacyWebArchive> > coreArchives;
+ enumerator = [subframeArchives objectEnumerator];
+ WebArchive *subframeArchive;
+ while ((subframeArchive = [enumerator nextObject]) != nil)
+ coreArchives.append([subframeArchive->_private coreArchive]);
+
+ [_private setCoreArchive:LegacyWebArchive::create(coreMainResource.release(), coreResources, coreArchives)];
+ if (![_private coreArchive]) {
+ [self release];
+ return nil;
+ }
+
+ return self;
+}
+
+- (id)initWithData:(NSData *)data
+{
+ self = [super init];
+ if (!self)
+ return nil;
+
+#if !LOG_DISABLED
+ CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
+#endif
+
+ _private = [[WebArchivePrivate alloc] init];
+ [_private setCoreArchive:LegacyWebArchive::create(SharedBuffer::wrapNSData(data).get())];
+
+#if !LOG_DISABLED
+ CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
+ CFAbsoluteTime duration = end - start;
+#endif
+ LOG(Timing, "Parsing web archive with [NSPropertyListSerialization propertyListFromData::::] took %f seconds", duration);
+
+ return self;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder
+{
+ WebResource *mainResource = nil;
+ NSArray *subresources = nil;
+ NSArray *subframeArchives = nil;
+
+ @try {
+ id object = [decoder decodeObjectForKey:WebMainResourceKey];
+ if ([object isKindOfClass:[WebResource class]])
+ mainResource = [object retain];
+ object = [decoder decodeObjectForKey:WebSubresourcesKey];
+ if (isArrayOfClass(object, [WebResource class]))
+ subresources = [object retain];
+ object = [decoder decodeObjectForKey:WebSubframeArchivesKey];
+ if (isArrayOfClass(object, [WebArchive class]))
+ subframeArchives = [object retain];
+ } @catch(id) {
+ [self release];
+ return nil;
+ }
+
+ return [self initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives];
+}
+
+- (void)encodeWithCoder:(NSCoder *)encoder
+{
+ [encoder encodeObject:[self mainResource] forKey:WebMainResourceKey];
+ [encoder encodeObject:[self subresources] forKey:WebSubresourcesKey];
+ [encoder encodeObject:[self subframeArchives] forKey:WebSubframeArchivesKey];
+}
+
+- (void)dealloc
+{
+ [_private release];
+ [super dealloc];
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+ return [self retain];
+}
+
+- (WebResource *)mainResource
+{
+ // Currently from WebKit API perspective, WebArchives are entirely immutable once created
+ // If they ever become mutable, we'll need to rethink this.
+ if (!_private->cachedMainResource) {
+ LegacyWebArchive* coreArchive = [_private coreArchive];
+ if (coreArchive)
+ _private->cachedMainResource = [[WebResource alloc] _initWithCoreResource:coreArchive->mainResource()];
+ }
+
+ return [[_private->cachedMainResource retain] autorelease];
+}
+
+- (NSArray *)subresources
+{
+ // Currently from WebKit API perspective, WebArchives are entirely immutable once created
+ // If they ever become mutable, we'll need to rethink this.
+ if (!_private->cachedSubresources) {
+ LegacyWebArchive* coreArchive = [_private coreArchive];
+ if (!coreArchive)
+ _private->cachedSubresources = [[NSArray alloc] init];
+ else {
+ const Vector<RefPtr<ArchiveResource> >& subresources(coreArchive->subresources());
+ NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:subresources.size()];
+ _private->cachedSubresources = mutableArray;
+ for (unsigned i = 0; i < subresources.size(); ++i) {
+ WebResource *resource = [[WebResource alloc] _initWithCoreResource:subresources[i].get()];
+ if (resource) {
+ [mutableArray addObject:resource];
+ [resource release];
+ }
+ }
+ }
+ }
+
+ return [[_private->cachedSubresources retain] autorelease];
+}
+
+- (NSArray *)subframeArchives
+{
+ // Currently from WebKit API perspective, WebArchives are entirely immutable once created
+ // If they ever become mutable, we'll need to rethink this.
+ if (!_private->cachedSubframeArchives) {
+ LegacyWebArchive* coreArchive = [_private coreArchive];
+ if (!coreArchive)
+ _private->cachedSubframeArchives = [[NSArray alloc] init];
+ else {
+ const Vector<RefPtr<Archive> >& subframeArchives(coreArchive->subframeArchives());
+ NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:subframeArchives.size()];
+ _private->cachedSubframeArchives = mutableArray;
+ for (unsigned i = 0; i < subframeArchives.size(); ++i) {
+ WebArchive *archive = [[WebArchive alloc] _initWithCoreLegacyWebArchive:(LegacyWebArchive *)subframeArchives[i].get()];
+ [mutableArray addObject:archive];
+ [archive release];
+ }
+ }
+ }
+
+ return [[_private->cachedSubframeArchives retain] autorelease];
+}
+
+- (NSData *)data
+{
+#if !LOG_DISABLED
+ CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
+#endif
+
+ RetainPtr<CFDataRef> data = [_private coreArchive]->rawDataRepresentation();
+
+#if !LOG_DISABLED
+ CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
+ CFAbsoluteTime duration = end - start;
+#endif
+ LOG(Timing, "Serializing web archive to raw CFPropertyList data took %f seconds", duration);
+
+ return [[(NSData *)data.get() retain] autorelease];
+}
+
+@end
+
+@implementation WebArchive (WebInternal)
+
+- (id)_initWithCoreLegacyWebArchive:(PassRefPtr<WebCore::LegacyWebArchive>)coreLegacyWebArchive
+{
+ self = [super init];
+ if (!self)
+ return nil;
+
+ _private = [[WebArchivePrivate alloc] initWithCoreArchive:coreLegacyWebArchive];
+ if (!_private) {
+ [self release];
+ return nil;
+ }
+
+ return self;
+}
+
+- (WebCore::LegacyWebArchive *)_coreLegacyWebArchive
+{
+ return [_private coreArchive];
+}
+
+@end
diff --git a/WebKit/mac/WebView/WebScriptDebugDelegatePrivate.h b/WebKit/mac/WebView/WebArchiveInternal.h
index 6bda4a7..071d4ab 100644
--- a/WebKit/mac/WebView/WebScriptDebugDelegatePrivate.h
+++ b/WebKit/mac/WebView/WebArchiveInternal.h
@@ -1,18 +1,18 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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.
+ * 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.
+ * 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
@@ -26,16 +26,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebScriptDebugDelegate.h>
-#import <WebCore/WebCoreScriptDebugger.h>
+#import "WebArchive.h"
+#import <JavaScriptCore/Forward.h>
-@interface WebScriptDebugger : NSObject <WebScriptDebugger>
-{
-@private
- WebFrame *_webFrame;
- WebCoreScriptDebugger *_debugger;
+namespace WebCore {
+ class LegacyWebArchive;
}
-- (WebScriptDebugger *)initWithWebFrame:(WebFrame *)webFrame;
+@interface WebArchive (WebInternal)
+
+- (id)_initWithCoreLegacyWebArchive:(WTF::PassRefPtr<WebCore::LegacyWebArchive>)coreLegacyWebArchive;
+- (WebCore::LegacyWebArchive *)_coreLegacyWebArchive;
@end
diff --git a/WebKit/mac/WebView/WebArchiver.mm b/WebKit/mac/WebView/WebArchiver.mm
deleted file mode 100644
index 4c68191..0000000
--- a/WebKit/mac/WebView/WebArchiver.mm
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2006 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 "WebArchiver.h"
-
-#import "WebArchive.h"
-#import "WebDOMOperationsPrivate.h"
-#import "WebDataSource.h"
-#import "WebDocument.h"
-#import "WebFrame.h"
-#import "WebFrameBridge.h"
-#import "WebFrameInternal.h"
-#import "WebResource.h"
-#import <JavaScriptCore/Assertions.h>
-#import <WebCore/Frame.h>
-#import <WebCore/SelectionController.h>
-#import <WebKit/DOM.h>
-
-using namespace WebCore;
-
-@implementation WebArchiver
-
-+ (NSArray *)_subframeArchivesForFrame:(WebFrame *)frame
-{
- NSEnumerator *enumerator = [[frame childFrames] objectEnumerator];
- NSMutableArray *subframeArchives = [NSMutableArray array];
- WebFrame *childFrame;
- while ((childFrame = [enumerator nextObject])) {
- WebArchive *childFrameArchive = [self archiveFrame:childFrame];
- if (childFrameArchive)
- [subframeArchives addObject:childFrameArchive];
- }
-
- return subframeArchives;
-}
-
-+ (WebArchive *)archiveFrame:(WebFrame *)frame;
-{
- return [[[WebArchive alloc] initWithMainResource:[[frame _dataSource] mainResource]
- subresources:[[frame _dataSource] subresources]
- subframeArchives:[self _subframeArchivesForFrame:frame]] autorelease];
-}
-
-+ (WebArchive *)archiveMainResourceForFrame:(WebFrame *)frame;
-{
- return [[[WebArchive alloc] initWithMainResource:[[frame _dataSource] mainResource]
- subresources:nil
- subframeArchives:nil] autorelease];
-}
-
-+ (WebArchive *)_archiveCurrentStateForFrame:(WebFrame *)frame
-{
- if ([frame DOMDocument])
- return [self archiveNode:[frame DOMDocument]];
-
- return [self archiveFrame:frame];
-}
-
-+ (WebArchive *)_archiveWithMarkupString:(NSString *)markupString fromFrame:(WebFrame *)frame nodes:(NSArray *)nodes
-{
- NSURLResponse *response = [[frame _dataSource] response];
- NSURL *responseURL = [response URL];
-
- // it's possible to have a response without a URL here
- // <rdar://problem/5454935>
- if (!responseURL)
- responseURL = [NSURL URLWithString:@""];
-
- WebResource *mainResource = [[WebResource alloc] initWithData:[markupString dataUsingEncoding:NSUTF8StringEncoding]
- URL:responseURL
- MIMEType:[response MIMEType]
- textEncodingName:@"UTF-8"
- frameName:[frame name]];
-
- NSMutableArray *subframeArchives = [[NSMutableArray alloc] init];
- NSMutableArray *subresources = [[NSMutableArray alloc] init];
- NSMutableSet *uniqueSubresources = [[NSMutableSet alloc] init];
- NSEnumerator *enumerator = [nodes objectEnumerator];
- DOMNode *node;
- while ((node = [enumerator nextObject]) != nil) {
- WebFrame *childFrame;
- if (([node isKindOfClass:[DOMHTMLFrameElement class]] ||
- [node isKindOfClass:[DOMHTMLIFrameElement class]] ||
- [node isKindOfClass:[DOMHTMLObjectElement class]]) &&
- ((childFrame = [(DOMHTMLFrameElement *)node contentFrame]) != nil)) {
- [subframeArchives addObject:[self _archiveCurrentStateForFrame:childFrame]];
- } else {
- NSEnumerator *enumerator = [[node _subresourceURLs] objectEnumerator];
- NSURL *URL;
- while ((URL = [enumerator nextObject]) != nil) {
- if ([uniqueSubresources containsObject:URL])
- continue;
- [uniqueSubresources addObject:URL];
- WebResource *subresource = [[frame _dataSource] subresourceForURL:URL];
- if (subresource)
- [subresources addObject:subresource];
- else
- // FIXME: should do something better than spew to console here
- LOG_ERROR("Failed to archive subresource for %@", URL);
- }
- }
- }
-
- WebArchive *archive = [[[WebArchive alloc] initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives] autorelease];
- [mainResource release];
- [uniqueSubresources release];
- [subresources release];
- [subframeArchives release];
-
- return archive;
-}
-
-+ (WebArchive *)archiveRange:(DOMRange *)range
-{
- WebFrameBridge *bridge = [range _bridge];
- WebFrame *frame = [bridge webFrame];
- NSArray *nodes;
- NSString *markupString = [bridge markupStringFromRange:range nodes:&nodes];
- return [self _archiveWithMarkupString:markupString fromFrame:frame nodes:nodes];
-}
-
-+ (WebArchive *)archiveNode:(DOMNode *)node
-{
- WebFrame *frame = [[node ownerDocument] webFrame];
- WebFrameBridge *bridge = [frame _bridge];
- NSArray *nodes;
- NSString *markupString = [bridge markupStringFromNode:node nodes:&nodes];
- return [self _archiveWithMarkupString:markupString fromFrame:frame nodes:nodes];
-}
-
-+ (WebArchive *)archiveSelectionInFrame:(WebFrame *)frame
-{
- Frame* coreFrame = core(frame);
- if (!coreFrame)
- return nil;
-
- WebFrameBridge *bridge = [frame _bridge];
- NSArray *nodes;
- NSString *markupString = [bridge markupStringFromRange:kit(coreFrame->selectionController()->toRange().get()) nodes:&nodes];
- WebArchive *archive = [self _archiveWithMarkupString:markupString fromFrame:frame nodes:nodes];
-
- if (coreFrame->isFrameSet()) {
- // Wrap the frameset document in an iframe so it can be pasted into
- // another document (which will have a body or frameset of its own).
-
- NSString *iframeMarkup = [[NSString alloc] initWithFormat:@"<iframe frameborder=\"no\" marginwidth=\"0\" marginheight=\"0\" width=\"98%%\" height=\"98%%\" src=\"%@\"></iframe>", [[[frame _dataSource] response] URL]];
- WebResource *iframeResource = [[WebResource alloc] initWithData:[iframeMarkup dataUsingEncoding:NSUTF8StringEncoding]
- URL:[NSURL URLWithString:@"about:blank"]
- MIMEType:@"text/html"
- textEncodingName:@"UTF-8"
- frameName:nil];
-
- NSArray *subframeArchives = [NSArray arrayWithObject:archive];
- archive = [[[WebArchive alloc] initWithMainResource:iframeResource subresources:nil subframeArchives:subframeArchives] autorelease];
-
- [iframeResource release];
- [iframeMarkup release];
- }
-
- return archive;
-}
-
-@end
-
diff --git a/WebKit/mac/WebView/WebClipView.m b/WebKit/mac/WebView/WebClipView.m
index 9231932..b551145 100644
--- a/WebKit/mac/WebView/WebClipView.m
+++ b/WebKit/mac/WebView/WebClipView.m
@@ -28,10 +28,10 @@
#import "WebClipView.h"
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebHTMLView.h>
#import <WebKit/WebNSViewExtras.h>
#import <WebKit/WebViewPrivate.h>
+#import <wtf/Assertions.h>
// WebClipView's entire reason for existing is to set the clip used by focus ring redrawing.
// There's no easy way to prevent the focus ring from drawing outside the passed-in clip rectangle
@@ -104,10 +104,12 @@
{
NSView *docView = [self documentView];
if ([docView respondsToSelector:@selector(_webView)]) {
+#if ENABLE(DASHBOARD_SUPPORT)
WebView *wv = [docView _webView];
if ([wv _dashboardBehavior:WebDashboardBehaviorAllowWheelScrolling]) {
[super scrollWheel:event];
}
+#endif
return;
}
[super scrollWheel:event];
diff --git a/WebKit/mac/WebView/WebDataSource.mm b/WebKit/mac/WebView/WebDataSource.mm
index cd033b1..aeff7d7 100644
--- a/WebKit/mac/WebView/WebDataSource.mm
+++ b/WebKit/mac/WebView/WebDataSource.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,11 +29,10 @@
#import "WebDataSource.h"
#import "WebArchive.h"
-#import "WebArchiver.h"
+#import "WebArchiveInternal.h"
#import "WebDataSourceInternal.h"
#import "WebDocument.h"
#import "WebDocumentLoaderMac.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebFrameLoadDelegate.h"
#import "WebFrameLoaderClient.h"
@@ -41,23 +40,26 @@
#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
#import "WebKitStatisticsPrivate.h"
+#import "WebKitNSStringExtras.h"
#import "WebNSURLExtras.h"
#import "WebNSURLRequestExtras.h"
#import "WebPDFRepresentation.h"
+#import "WebResourceInternal.h"
#import "WebResourceLoadDelegate.h"
#import "WebResourcePrivate.h"
-#import "WebUnarchivingState.h"
#import "WebViewInternal.h"
-#import <JavaScriptCore/Assertions.h>
+#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/KURL.h>
+#import <WebCore/LegacyWebArchive.h>
#import <WebCore/MIMETypeRegistry.h>
#import <WebCore/ResourceRequest.h>
#import <WebCore/SharedBuffer.h>
#import <WebCore/WebCoreObjCExtras.h>
+#import <WebCore/WebCoreURLResponse.h>
#import <WebKit/DOMHTML.h>
#import <WebKit/DOMPrivate.h>
-#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
using namespace WebCore;
@@ -67,7 +69,6 @@ using namespace WebCore;
id <WebDocumentRepresentation> representation;
- WebUnarchivingState *unarchivingState;
BOOL representationFinishedLoading;
}
@end
@@ -83,12 +84,14 @@ using namespace WebCore;
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebDataSourcePrivate class], self))
+ return;
+
ASSERT(!loader->isLoading());
loader->detachDataSource();
loader->deref();
[representation release];
- [unarchivingState release];
[super dealloc];
}
@@ -135,20 +138,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
Class repClass;
return [WebView _viewClass:nil andRepresentationClass:&repClass forMIMEType:MIMEType] ? repClass : nil;
}
-
-- (NSString *)_MIMETypeOfResponse:(NSURLResponse *)response
-{
-#ifdef BUILDING_ON_TIGER
- return [response MIMEType];
-#else
- // FIXME: This is part of a workaround for <rdar://problem/5321972> REGRESSION: Plain text document from HTTP server detected
- // as application/octet-stream
- NSString *MIMEType = [response MIMEType];
- if ([MIMEType isEqualToString:@"application/octet-stream"] && [response isKindOfClass:[NSHTTPURLResponse class]] && [[[(NSHTTPURLResponse *)response allHeaderFields] objectForKey:@"Content-Type"] hasPrefix:@"text/plain"])
- return @"text/plain";
- return MIMEType;
-#endif
-}
@end
@implementation WebDataSource (WebPrivate)
@@ -160,10 +149,14 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (void)_addSubframeArchives:(NSArray *)subframeArchives
{
+ // FIXME: This SPI is poor, poor design. Can we come up with another solution for those who need it?
+ DocumentLoader* loader = [self _documentLoader];
+ ASSERT(loader);
+
NSEnumerator *enumerator = [subframeArchives objectEnumerator];
WebArchive *archive;
while ((archive = [enumerator nextObject]) != nil)
- [self _addToUnarchiveState:archive];
+ loader->addAllArchiveResources([archive _coreLegacyWebArchive]);
}
- (NSFileWrapper *)_fileWrapperForURL:(NSURL *)URL
@@ -189,11 +182,23 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (NSString *)_responseMIMEType
{
-#ifdef BUILDING_ON_TIGER
- return [[self response] MIMEType];
-#else
- return [self _MIMETypeOfResponse:[self response]];
-#endif
+ return [[self response] _webcore_MIMEType];
+}
+
+- (BOOL)_transferApplicationCache:(NSString*)destinationBundleIdentifier
+{
+ DocumentLoader* loader = [self _documentLoader];
+
+ if (!loader)
+ return NO;
+
+ ApplicationCache* cache = loader->applicationCache();
+ if (!cache)
+ return YES;
+
+ NSString *cacheDir = [NSString _webkit_localCacheDirectoryWithBundleIdentifier:destinationBundleIdentifier];
+
+ return ApplicationCacheStorage::storeCopyOfCache(cacheDir, cache);
}
@end
@@ -223,12 +228,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
}
}
-- (void)_clearUnarchivingState
-{
- [_private->unarchivingState release];
- _private->unarchivingState = nil;
-}
-
- (void)_revertToProvisionalState
{
[self _setRepresentation:nil];
@@ -257,18 +256,14 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
return repTypes;
}
-- (WebResource *)_archivedSubresourceForURL:(NSURL *)URL
-{
- return [_private->unarchivingState archivedResourceForURL:URL];
-}
-
- (void)_replaceSelectionWithArchive:(WebArchive *)archive selectReplacement:(BOOL)selectReplacement
{
DOMDocumentFragment *fragment = [self _documentFragmentWithArchive:archive];
if (fragment)
- [[self _bridge] replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:NO matchStyle:NO];
+ [[self webFrame] _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:NO matchStyle:NO];
}
+// FIXME: There are few reasons why this method and many of its related methods can't be pushed entirely into WebCore in the future.
- (DOMDocumentFragment *)_documentFragmentWithArchive:(WebArchive *)archive
{
ASSERT(archive);
@@ -278,8 +273,10 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
if ([WebView canShowMIMETypeAsHTML:MIMEType]) {
NSString *markupString = [[NSString alloc] initWithData:[mainResource data] encoding:NSUTF8StringEncoding];
// FIXME: seems poor form to do this as a side effect of getting a document fragment
- [self _addToUnarchiveState:archive];
- DOMDocumentFragment *fragment = [[self _bridge] documentFragmentWithMarkupString:markupString baseURLString:[[mainResource URL] _web_originalDataAsString]];
+ if (DocumentLoader* loader = [self _documentLoader])
+ loader->addAllArchiveResources([archive _coreLegacyWebArchive]);
+
+ DOMDocumentFragment *fragment = [[self webFrame] _documentFragmentWithMarkupString:markupString baseURLString:[[mainResource URL] _web_originalDataAsString]];
[markupString release];
return fragment;
} else if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType)) {
@@ -319,19 +316,10 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
// May return nil if not initialized with a URL.
- (NSURL *)_URL
{
- KURL URL = _private->loader->url();
- return URL.isEmpty() ? nil : URL.getNSURL();
-}
-
-- (WebArchive *)_popSubframeArchiveWithName:(NSString *)frameName
-{
- return [_private->unarchivingState popSubframeArchiveWithFrameName:frameName];
-}
-
-- (WebFrameBridge *)_bridge
-{
- ASSERT(_private->loader->isCommitted());
- return [[self webFrame] _bridge];
+ const KURL& url = _private->loader->url();
+ if (url.isEmpty())
+ return nil;
+ return url;
}
- (WebView *)_webView
@@ -359,19 +347,12 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
[_private->representation setDataSource:self];
}
-- (void)_addToUnarchiveState:(WebArchive *)archive
-{
- if (!_private->unarchivingState)
- _private->unarchivingState = [[WebUnarchivingState alloc] init];
- [_private->unarchivingState addArchive:archive];
-}
-
- (DocumentLoader*)_documentLoader
{
return _private->loader;
}
-- (id)_initWithDocumentLoader:(WebDocumentLoaderMac *)loader
+- (id)_initWithDocumentLoader:(PassRefPtr<WebDocumentLoaderMac>)loader
{
self = [super init];
if (!self)
@@ -379,10 +360,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
_private = [[WebDataSourcePrivate alloc] init];
- _private->loader = loader;
- loader->ref();
+ _private->loader = loader.releaseRef();
- LOG(Loading, "creating datasource for %@", _private->loader->request().url().getNSURL());
+ LOG(Loading, "creating datasource for %@", static_cast<NSURL *>(_private->loader->request().url()));
++WebDataSourceCount;
@@ -395,7 +375,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (id)initWithRequest:(NSURLRequest *)request
{
- return [self _initWithDocumentLoader:new WebDocumentLoaderMac(request, SubstituteData())];
+ return [self _initWithDocumentLoader:WebDocumentLoaderMac::create(request, SubstituteData())];
}
- (void)dealloc
@@ -437,7 +417,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (NSURLRequest *)initialRequest
{
- return _private->loader->initialRequest().nsURLRequest();
+ return _private->loader->originalRequest().nsURLRequest();
}
- (NSMutableURLRequest *)request
@@ -476,8 +456,10 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (NSURL *)unreachableURL
{
- KURL URL = _private->loader->unreachableURL();
- return URL.isEmpty() ? nil : URL.getNSURL();
+ const KURL& unreachableURL = _private->loader->unreachableURL();
+ if (unreachableURL.isEmpty())
+ return nil;
+ return unreachableURL;
}
- (WebArchive *)webArchive
@@ -485,58 +467,38 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
// it makes no sense to grab a WebArchive from an uncommitted document.
if (!_private->loader->isCommitted())
return nil;
- return [WebArchiver archiveFrame:[self webFrame]];
+
+ return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core([self webFrame]))] autorelease];
}
- (WebResource *)mainResource
{
- NSURLResponse *response = [self response];
- return [[[WebResource alloc] initWithData:[self data]
- URL:[response URL]
- MIMEType:[self _responseMIMEType]
- textEncodingName:[response textEncodingName]
- frameName:[[self webFrame] name]] autorelease];
+ RefPtr<ArchiveResource> coreResource = _private->loader->mainResource();
+ return [[[WebResource alloc] _initWithCoreResource:coreResource.release()] autorelease];
}
- (NSArray *)subresources
{
- if (!_private->loader->isCommitted())
- return [NSMutableArray array];
-
- NSArray *datas;
- NSArray *responses;
- [[self _bridge] getAllResourceDatas:&datas andResponses:&responses];
- ASSERT([datas count] == [responses count]);
-
- NSMutableArray *subresources = [[NSMutableArray alloc] initWithCapacity:[datas count]];
- for (unsigned i = 0; i < [datas count]; ++i) {
- NSURLResponse *response = [responses objectAtIndex:i];
- [subresources addObject:[[[WebResource alloc] _initWithData:[datas objectAtIndex:i] URL:[response URL] response:response MIMEType:[self _MIMETypeOfResponse:response]] autorelease]];
- }
+ Vector<PassRefPtr<ArchiveResource> > coreSubresources;
+ _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]];
+
return [subresources autorelease];
}
- (WebResource *)subresourceForURL:(NSURL *)URL
{
- if (!_private->loader->isCommitted())
- return nil;
-
- NSData *data;
- NSURLResponse *response;
- if (![[self _bridge] getData:&data andResponse:&response forURL:[URL _web_originalDataAsString]])
- return [self _archivedSubresourceForURL:URL];
-
- return [[[WebResource alloc] _initWithData:data URL:URL response:response MIMEType:[self _MIMETypeOfResponse:response]] autorelease];
+ RefPtr<ArchiveResource> subresource = _private->loader->subresource(URL);
+
+ return subresource ? [[[WebResource alloc] _initWithCoreResource:subresource.get()] autorelease] : nil;
}
- (void)addSubresource:(WebResource *)subresource
-{
- if (subresource) {
- if (!_private->unarchivingState)
- _private->unarchivingState = [[WebUnarchivingState alloc] init];
- [_private->unarchivingState addResource:subresource];
- }
+{
+ _private->loader->addArchiveResource([subresource _coreResource]);
}
@end
diff --git a/WebKit/mac/WebView/WebDataSourceInternal.h b/WebKit/mac/WebView/WebDataSourceInternal.h
index 94a6fd1..29497d5 100644
--- a/WebKit/mac/WebView/WebDataSourceInternal.h
+++ b/WebKit/mac/WebView/WebDataSourceInternal.h
@@ -27,48 +27,34 @@
*/
#import "WebDataSourcePrivate.h"
+#import <wtf/Forward.h>
-#ifdef __cplusplus
namespace WebCore {
class DocumentLoader;
}
-typedef WebCore::DocumentLoader WebCoreDocumentLoader;
+
class WebDocumentLoaderMac;
-#else
-@class WebCoreDocumentLoader;
-@class WebDocumentLoaderMac;
-#endif
@class DOMDocumentFragment;
@class DOMElement;
-@class NSError;
-@class NSURL;
@class WebArchive;
-@class WebFrameBridge;
@class WebResource;
@class WebView;
-@protocol WebDocumentRepresentation;
-
@interface WebDataSource (WebInternal)
-- (void)_addToUnarchiveState:(WebArchive *)archive;
- (void)_makeRepresentation;
- (BOOL)_isDocumentHTML;
- (WebView *)_webView;
-- (WebFrameBridge *)_bridge;
-- (WebArchive *)_popSubframeArchiveWithName:(NSString *)frameName;
- (NSURL *)_URL;
- (DOMElement *)_imageElementWithImageResource:(WebResource *)resource;
- (DOMDocumentFragment *)_documentFragmentWithImageResource:(WebResource *)resource;
- (DOMDocumentFragment *)_documentFragmentWithArchive:(WebArchive *)archive;
+ (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
- (void)_replaceSelectionWithArchive:(WebArchive *)archive selectReplacement:(BOOL)selectReplacement;
-- (WebResource *)_archivedSubresourceForURL:(NSURL *)URL;
-- (id)_initWithDocumentLoader:(WebDocumentLoaderMac*)loader;
+- (id)_initWithDocumentLoader:(PassRefPtr<WebDocumentLoaderMac>)loader;
- (void)_finishedLoading;
- (void)_receivedData:(NSData *)data;
- (void)_revertToProvisionalState;
- (void)_setMainDocumentError:(NSError *)error;
-- (void)_clearUnarchivingState;
-- (WebCoreDocumentLoader*)_documentLoader;
+- (WebCore::DocumentLoader*)_documentLoader;
@end
diff --git a/WebKit/mac/WebView/WebDataSourcePrivate.h b/WebKit/mac/WebView/WebDataSourcePrivate.h
index a394b53..ae8d4cf 100644
--- a/WebKit/mac/WebView/WebDataSourcePrivate.h
+++ b/WebKit/mac/WebView/WebDataSourcePrivate.h
@@ -31,10 +31,10 @@
@interface WebDataSource (WebPrivate)
- (NSFileWrapper *)_fileWrapperForURL:(NSURL *)URL;
-
- (void)_addSubframeArchives:(NSArray *) archives;
-
- (NSError *)_mainDocumentError;
-
- (NSString *)_responseMIMEType;
+
+- (BOOL)_transferApplicationCache:(NSString*)destinationBundleIdentifier;
+
@end
diff --git a/WebKit/mac/WebView/WebDocumentInternal.h b/WebKit/mac/WebView/WebDocumentInternal.h
index 81e961a..191264b 100644
--- a/WebKit/mac/WebView/WebDocumentInternal.h
+++ b/WebKit/mac/WebView/WebDocumentInternal.h
@@ -36,29 +36,20 @@
#endif
/*!
-@protocol _WebDocumentTextSizing
-@discussion Optional protocol for making text larger and smaller.
+@protocol _WebDocumentZooming
+@discussion Optional protocol for a view that wants to handle its own zoom.
*/
-@protocol _WebDocumentTextSizing <NSObject>
+@protocol _WebDocumentZooming <NSObject>
// Methods to perform the actual commands
-- (IBAction)_makeTextSmaller:(id)sender;
-- (IBAction)_makeTextLarger:(id)sender;
-- (IBAction)_makeTextStandardSize:(id)sender;
+- (IBAction)_zoomOut:(id)sender;
+- (IBAction)_zoomIn:(id)sender;
+- (IBAction)_resetZoom:(id)sender;
-// Views that do text sizing come in two flavors. Some will track the common textSizeMultiplier factor stored
-// in the WebView. Others (see PDFView) keep their own scaling factor, but still want to play along loosely
-// with the smaller/larger commands, which in the user model operate across all frames of the WebView.
-- (BOOL)_tracksCommonSizeFactor;
-
-// Views that track the common size factor need to be told when the WebView itself changed the value.
-- (void)_textSizeMultiplierChanged;
-
-// Views that do not track the common size factor must answer for themselves if they are able to zoom in
-// or out. Views that do track it are not sent these messages.
-- (BOOL)_canMakeTextSmaller;
-- (BOOL)_canMakeTextLarger;
-- (BOOL)_canMakeTextStandardSize;
+// Whether or not the commands can be executed.
+- (BOOL)_canZoomOut;
+- (BOOL)_canZoomIn;
+- (BOOL)_canResetZoom;
@end
diff --git a/WebKit/mac/WebView/WebDocumentLoaderMac.h b/WebKit/mac/WebView/WebDocumentLoaderMac.h
index 9acba89..83e2bb3 100644
--- a/WebKit/mac/WebView/WebDocumentLoaderMac.h
+++ b/WebKit/mac/WebView/WebDocumentLoaderMac.h
@@ -39,19 +39,24 @@ namespace WebCore {
class WebDocumentLoaderMac : public WebCore::DocumentLoader {
public:
- WebDocumentLoaderMac(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
+ static PassRefPtr<WebDocumentLoaderMac> create(const WebCore::ResourceRequest& request, const WebCore::SubstituteData& data)
+ {
+ return adoptRef(new WebDocumentLoaderMac(request, data));
+ }
void setDataSource(WebDataSource *, WebView*);
void detachDataSource();
WebDataSource *dataSource() const;
- virtual void attachToFrame();
- virtual void detachFromFrame();
-
void increaseLoadCount(unsigned long identifier);
void decreaseLoadCount(unsigned long identifier);
private:
+ WebDocumentLoaderMac(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
+
+ virtual void attachToFrame();
+ virtual void detachFromFrame();
+
void retainDataSource();
void releaseDataSource();
diff --git a/WebKit/mac/WebView/WebDocumentPrivate.h b/WebKit/mac/WebView/WebDocumentPrivate.h
index dff4c03..f09d3bd 100644
--- a/WebKit/mac/WebView/WebDocumentPrivate.h
+++ b/WebKit/mac/WebView/WebDocumentPrivate.h
@@ -55,14 +55,6 @@
// The text is all black according to the parameter.
- (NSImage *)selectionImageForcingBlackText:(BOOL)forceBlackText;
-// NSImage of the portion of the selection that's in view. This does not draw backgrounds.
-// The text is all white according to the parameter.
-// NOTE: This method is deprecated. It has been supplanted by selectionImageForcingBlackText:,
-// and implementations typically just call that method, so its name no longer matches its
-// behavior. It will be removed when doing so won't cause trouble for people using the latest
-// WebKit with beta releases of Safari 3.0.
-- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText;
-
// Rect tightly enclosing the entire selected area, in coordinates of selectionView.
// NOTE: This method is equivalent to selectionRect and shouldn't be used; use selectionRect instead.
- (NSRect)selectionImageRect;
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.h b/WebKit/mac/WebView/WebDynamicScrollBarsView.h
index 255deb8..a0f8006 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsView.h
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,46 +26,23 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <AppKit/NSScrollView.h>
+// This is a Private header (containing SPI), despite the fact that its name
+// does not contain the word Private.
-#import <WebCore/WebCoreFrameView.h>
+// FIXME: Does Safari really need to use this any more? AppKit added autohidesScrollers
+// in Panther, and that was the original reason we needed this view in Safari.
-// FIXME 2980779: This has grown to be more than just a dynamic scroll bar view,
-// and it is no longer completely appropriate for use outside of WebKit.
+// FIXME: <rdar://problem/5898985> Mail currently expects this header to define WebCoreScrollbarAlwaysOn.
+extern const int WebCoreScrollbarAlwaysOn;
-@interface WebDynamicScrollBarsView : NSScrollView <WebCoreFrameView>
-{
- WebCoreScrollbarMode hScroll;
- WebCoreScrollbarMode vScroll;
+@interface WebDynamicScrollBarsView : NSScrollView {
+ int hScroll; // FIXME: Should be WebCore::ScrollbarMode if this was an ObjC++ header.
+ int vScroll; // Ditto.
BOOL hScrollModeLocked;
BOOL vScrollModeLocked;
BOOL suppressLayout;
BOOL suppressScrollers;
BOOL inUpdateScrollers;
}
-
-- (void)setAllowsHorizontalScrolling:(BOOL)flag;
-- (BOOL)allowsHorizontalScrolling;
-- (void)setAllowsVerticalScrolling:(BOOL)flag;
-- (BOOL)allowsVerticalScrolling;
-
-- (void)setHorizontalScrollingMode:(WebCoreScrollbarMode)mode andLock:(BOOL)lock;
-- (void)setVerticalScrollingMode:(WebCoreScrollbarMode)mode andLock:(BOOL)lock;
-- (void)setScrollingMode:(WebCoreScrollbarMode)mode andLock:(BOOL)lock;
-
-- (void)setHorizontalScrollingModeLocked:(BOOL)locked;
-- (void)setVerticalScrollingModeLocked:(BOOL)locked;
-- (void)setScrollingModesLocked:(BOOL)mode;
-
-- (BOOL)horizontalScrollingModeLocked;
-- (BOOL)verticalScrollingModeLocked;
-
-// Convenience method to affect both scrolling directions at once.
-- (void)setAllowsScrolling:(BOOL)flag;
-
-// Returns YES if either horizontal or vertical scrolling is allowed.
-- (BOOL)allowsScrolling;
-
-- (void)updateScrollers;
-- (void)setSuppressLayout: (BOOL)flag;
+- (void)setAllowsHorizontalScrolling:(BOOL)flag; // This method is used by Safari, so it cannot be removed.
@end
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.m b/WebKit/mac/WebView/WebDynamicScrollBarsView.m
index 8374725..1eb2d80 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsView.m
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.m
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,14 +26,35 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebDynamicScrollBarsView.h>
+#import "WebDynamicScrollBarsViewInternal.h"
-#import <WebKit/WebDocument.h>
+#import "WebDocument.h"
+#import "WebFrameView.h"
#import <WebKitSystemInterface.h>
+using namespace WebCore;
+
+// FIXME: <rdar://problem/5898985> Mail expects a constant of this name to exist.
+const int WebCoreScrollbarAlwaysOn = ScrollbarAlwaysOn;
+
@implementation WebDynamicScrollBarsView
-- (void)setSuppressLayout: (BOOL)flag;
+- (void)setAllowsHorizontalScrolling:(BOOL)flag
+{
+ if (hScrollModeLocked)
+ return;
+ if (flag && hScroll == ScrollbarAlwaysOff)
+ hScroll = ScrollbarAuto;
+ else if (!flag && hScroll != ScrollbarAlwaysOff)
+ hScroll = ScrollbarAlwaysOff;
+ [self updateScrollers];
+}
+
+@end
+
+@implementation WebDynamicScrollBarsView (WebInternal)
+
+- (void)setSuppressLayout:(BOOL)flag;
{
suppressLayout = flag;
}
@@ -82,7 +103,7 @@
BOOL scrollsVertically;
BOOL scrollsHorizontally;
- if (!suppressLayout && !suppressScrollers && (hScroll == WebCoreScrollbarAuto || vScroll == WebCoreScrollbarAuto)) {
+ if (!suppressLayout && !suppressScrollers && (hScroll == ScrollbarAuto || vScroll == ScrollbarAuto)) {
// Do a layout if pending, before checking if scrollbars are needed.
// This fixes 2969367, although may introduce a slowdown in live resize performance.
NSView *documentView = [self documentView];
@@ -99,22 +120,22 @@
NSSize documentSize = [documentView frame].size;
NSSize frameSize = [self frame].size;
- scrollsVertically = (vScroll == WebCoreScrollbarAlwaysOn) ||
- (vScroll == WebCoreScrollbarAuto && documentSize.height > frameSize.height);
+ scrollsVertically = (vScroll == ScrollbarAlwaysOn) ||
+ (vScroll == ScrollbarAuto && documentSize.height > frameSize.height);
if (scrollsVertically)
- scrollsHorizontally = (hScroll == WebCoreScrollbarAlwaysOn) ||
- (hScroll == WebCoreScrollbarAuto && documentSize.width + [NSScroller scrollerWidth] > frameSize.width);
+ scrollsHorizontally = (hScroll == ScrollbarAlwaysOn) ||
+ (hScroll == ScrollbarAuto && documentSize.width + [NSScroller scrollerWidth] > frameSize.width);
else {
- scrollsHorizontally = (hScroll == WebCoreScrollbarAlwaysOn) ||
- (hScroll == WebCoreScrollbarAuto && documentSize.width > frameSize.width);
+ scrollsHorizontally = (hScroll == ScrollbarAlwaysOn) ||
+ (hScroll == ScrollbarAuto && documentSize.width > frameSize.width);
if (scrollsHorizontally)
- scrollsVertically = (vScroll == WebCoreScrollbarAlwaysOn) ||
- (vScroll == WebCoreScrollbarAuto && documentSize.height + [NSScroller scrollerWidth] > frameSize.height);
+ scrollsVertically = (vScroll == ScrollbarAlwaysOn) ||
+ (vScroll == ScrollbarAuto && documentSize.height + [NSScroller scrollerWidth] > frameSize.height);
}
}
} else {
- scrollsHorizontally = (hScroll == WebCoreScrollbarAuto) ? hasHorizontalScroller : (hScroll == WebCoreScrollbarAlwaysOn);
- scrollsVertically = (vScroll == WebCoreScrollbarAuto) ? hasVerticalScroller : (vScroll == WebCoreScrollbarAlwaysOn);
+ scrollsHorizontally = (hScroll == ScrollbarAuto) ? hasHorizontalScroller : (hScroll == ScrollbarAlwaysOn);
+ scrollsVertically = (vScroll == ScrollbarAuto) ? hasVerticalScroller : (vScroll == ScrollbarAlwaysOn);
}
if (hasVerticalScroller != scrollsVertically) {
@@ -167,126 +188,52 @@
#endif
}
-- (void)setAllowsScrolling:(BOOL)flag
-{
- if (hScrollModeLocked && vScrollModeLocked)
- return;
-
- if (flag && vScroll == WebCoreScrollbarAlwaysOff)
- vScroll = WebCoreScrollbarAuto;
- else if (!flag && vScroll != WebCoreScrollbarAlwaysOff)
- vScroll = WebCoreScrollbarAlwaysOff;
-
- if (flag && hScroll == WebCoreScrollbarAlwaysOff)
- hScroll = WebCoreScrollbarAuto;
- else if (!flag && hScroll != WebCoreScrollbarAlwaysOff)
- hScroll = WebCoreScrollbarAlwaysOff;
-
- [self updateScrollers];
-}
-
-- (BOOL)allowsScrolling
-{
- // Returns YES if either horizontal or vertical scrolling is allowed.
- return hScroll != WebCoreScrollbarAlwaysOff || vScroll != WebCoreScrollbarAlwaysOff;
-}
-
-- (void)setAllowsHorizontalScrolling:(BOOL)flag
-{
- if (hScrollModeLocked)
- return;
- if (flag && hScroll == WebCoreScrollbarAlwaysOff)
- hScroll = WebCoreScrollbarAuto;
- else if (!flag && hScroll != WebCoreScrollbarAlwaysOff)
- hScroll = WebCoreScrollbarAlwaysOff;
- [self updateScrollers];
-}
-
-- (void)setAllowsVerticalScrolling:(BOOL)flag
-{
- if (vScrollModeLocked)
- return;
- if (flag && vScroll == WebCoreScrollbarAlwaysOff)
- vScroll = WebCoreScrollbarAuto;
- else if (!flag && vScroll != WebCoreScrollbarAlwaysOff)
- vScroll = WebCoreScrollbarAlwaysOff;
- [self updateScrollers];
-}
-
- (BOOL)allowsHorizontalScrolling
{
- return hScroll != WebCoreScrollbarAlwaysOff;
+ return hScroll != ScrollbarAlwaysOff;
}
- (BOOL)allowsVerticalScrolling
{
- return vScroll != WebCoreScrollbarAlwaysOff;
+ return vScroll != ScrollbarAlwaysOff;
}
--(WebCoreScrollbarMode)horizontalScrollingMode
+- (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode
{
- return hScroll;
+ *hMode = static_cast<ScrollbarMode>(hScroll);
+ *vMode = static_cast<ScrollbarMode>(vScroll);
}
--(WebCoreScrollbarMode)verticalScrollingMode
+- (ScrollbarMode)horizontalScrollingMode
{
- return vScroll;
+ return static_cast<ScrollbarMode>(hScroll);
}
-- (void)setHorizontalScrollingMode:(WebCoreScrollbarMode)mode
+- (ScrollbarMode)verticalScrollingMode
{
- [self setHorizontalScrollingMode:mode andLock:NO];
+ return static_cast<ScrollbarMode>(vScroll);
}
-- (void)setHorizontalScrollingMode:(WebCoreScrollbarMode)mode andLock:(BOOL)lock
+- (void)setHorizontalScrollingMode:(ScrollbarMode)horizontalMode andLock:(BOOL)lock
{
- if (mode == hScroll || hScrollModeLocked)
- return;
-
- hScroll = mode;
-
- if (lock)
- [self setHorizontalScrollingModeLocked:YES];
-
- [self updateScrollers];
+ [self setScrollingModes:horizontalMode vertical:[self verticalScrollingMode] andLock:lock];
}
-- (void)setVerticalScrollingMode:(WebCoreScrollbarMode)mode
+- (void)setVerticalScrollingMode:(ScrollbarMode)verticalMode andLock:(BOOL)lock
{
- [self setVerticalScrollingMode:mode andLock:NO];
+ [self setScrollingModes:[self horizontalScrollingMode] vertical:verticalMode andLock:lock];
}
-- (void)setVerticalScrollingMode:(WebCoreScrollbarMode)mode andLock:(BOOL)lock
+- (void)setScrollingModes:(ScrollbarMode)horizontalMode vertical:(ScrollbarMode)verticalMode andLock:(BOOL)lock
{
- if (mode == vScroll || vScrollModeLocked)
- return;
-
- vScroll = mode;
-
- if (lock)
- [self setVerticalScrollingModeLocked:YES];
-
- [self updateScrollers];
-}
-
-- (void)setScrollingMode:(WebCoreScrollbarMode)mode
-{
- [self setScrollingMode:mode andLock:NO];
-}
-
-- (void)setScrollingMode:(WebCoreScrollbarMode)mode andLock:(BOOL)lock
-{
- if ((mode == vScroll && mode == hScroll) || (vScrollModeLocked && hScrollModeLocked))
- return;
-
BOOL update = NO;
- if (mode != vScroll && !vScrollModeLocked) {
- vScroll = mode;
+ if (verticalMode != vScroll && !vScrollModeLocked) {
+ vScroll = verticalMode;
update = YES;
}
- if (mode != hScroll && !hScrollModeLocked) {
- hScroll = mode;
+ if (horizontalMode != hScroll && !hScrollModeLocked) {
+ hScroll = horizontalMode;
update = YES;
}
@@ -347,4 +294,13 @@
[super scrollWheel:event];
}
+- (BOOL)accessibilityIsIgnored
+{
+ id docView = [self documentView];
+ if ([docView isKindOfClass:[WebFrameView class]] && ![(WebFrameView *)docView allowsScrolling])
+ return YES;
+
+ return [super accessibilityIsIgnored];
+}
+
@end
diff --git a/WebKit/mac/Plugins/WebPluginJava.h b/WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h
index 8015dba..312cf9d 100644
--- a/WebKit/mac/Plugins/WebPluginJava.h
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,23 +26,31 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <JavaVM/JavaVM.h>
+#import "WebDynamicScrollBarsView.h"
+#import <WebCore/WebCoreFrameView.h>
-// The WebPluginContainer will call these methods for LiveConnect support. The
-// WebPluginContainer should see if the WebPlugin supports these methods before
-// calling them.
+@interface WebDynamicScrollBarsView (WebInternal) <WebCoreFrameScrollView>
-@protocol WebPluginJava <NSObject>
+- (BOOL)allowsHorizontalScrolling;
+- (BOOL)allowsVerticalScrolling;
-// This returns the jobject representing the java applet to the WebPluginContainer.
-// It should always be called from the AppKit Main Thread.
-- (jobject) getApplet;
+- (void)setScrollingModes:(WebCore::ScrollbarMode)hMode vertical:(WebCore::ScrollbarMode)vMode andLock:(BOOL)lock;
+- (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode;
-// This will call the given method on the given jobject with the given arguments
-// from the proper thread for this WebPlugin. This way, no java applet code will
-// be run on the AppKit Main Thread, it will be called on a thread belonging to the
-// java applet.
-// It should always be called from the AppKit Main Thread.
-- (jvalue) callJavaOn:(jobject)object withMethod:(jmethodID) withArgs:(jvalue*)args;
+- (WebCore::ScrollbarMode)horizontalScrollingMode;
+- (WebCore::ScrollbarMode)verticalScrollingMode;
+
+- (void)setHorizontalScrollingMode:(WebCore::ScrollbarMode)mode andLock:(BOOL)lock;
+- (void)setVerticalScrollingMode:(WebCore::ScrollbarMode)mode andLock:(BOOL)lock;
+
+- (void)setHorizontalScrollingModeLocked:(BOOL)locked;
+- (void)setVerticalScrollingModeLocked:(BOOL)locked;
+- (void)setScrollingModesLocked:(BOOL)mode;
+
+- (BOOL)horizontalScrollingModeLocked;
+- (BOOL)verticalScrollingModeLocked;
+
+- (void)updateScrollers;
+- (void)setSuppressLayout:(BOOL)flag;
@end
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 71ac0eb..13a6ad4 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,60 +29,64 @@
#import "WebFrameInternal.h"
#import "DOMCSSStyleDeclarationInternal.h"
+#import "DOMDocumentFragmentInternal.h"
#import "DOMDocumentInternal.h"
#import "DOMElementInternal.h"
#import "DOMHTMLElementInternal.h"
#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
-#import "WebBackForwardList.h"
+#import "WebArchiveInternal.h"
#import "WebChromeClient.h"
#import "WebDataSourceInternal.h"
-#import "WebDocumentInternal.h"
#import "WebDocumentLoaderMac.h"
-#import "WebFrameBridge.h"
-#import "WebFrameLoadDelegate.h"
#import "WebFrameLoaderClient.h"
#import "WebFrameViewInternal.h"
+#import "WebHTMLView.h"
#import "WebHTMLViewInternal.h"
-#import "WebHistoryItem.h"
-#import "WebHistoryItemInternal.h"
-#import "WebHistoryItemPrivate.h"
-#import "WebKitLogging.h"
+#import "WebIconFetcherInternal.h"
#import "WebKitStatisticsPrivate.h"
#import "WebNSURLExtras.h"
-#import "WebNSURLRequestExtras.h"
-#import "WebNetscapePluginEmbeddedView.h"
-#import "WebNullPluginView.h"
-#import "WebPlugin.h"
-#import "WebPluginController.h"
-#import "WebPreferencesPrivate.h"
-#import "WebScriptDebugDelegatePrivate.h"
+#import "WebScriptDebugger.h"
#import "WebViewInternal.h"
-#import <WebCore/Chrome.h>
+#import <JavaScriptCore/APICast.h>
+#import <WebCore/AccessibilityObject.h>
+#import <WebCore/AXObjectCache.h>
#import <WebCore/ColorMac.h>
-#import <WebCore/Document.h>
-#import <WebCore/Event.h>
-#import <WebCore/FrameLoader.h>
+#import <WebCore/DOMImplementation.h>
+#import <WebCore/DocLoader.h>
+#import <WebCore/DocumentFragment.h>
+#import <WebCore/EventHandler.h>
#import <WebCore/Frame.h>
+#import <WebCore/FrameLoader.h>
#import <WebCore/FrameTree.h>
-#import <WebCore/HistoryItem.h>
-#import <WebCore/HTMLFormElement.h>
+#import <WebCore/GraphicsContext.h>
#import <WebCore/HTMLFrameOwnerElement.h>
+#import <WebCore/HistoryItem.h>
+#import <WebCore/HitTestResult.h>
+#import <WebCore/LegacyWebArchive.h>
#import <WebCore/Page.h>
-#import <WebCore/SelectionController.h>
-#import <WebCore/SharedBuffer.h>
-#import <WebCore/FormState.h>
-#import <WebCore/ResourceRequest.h>
-#import <WebCore/kjs_binding.h>
-#import <WebCore/kjs_proxy.h>
-#import <WebKit/DOMDocument.h>
-#import <WebKit/DOMElement.h>
-#import <WebKit/DOMHTMLElement.h>
-#import <WebKit/DOMNode.h>
-#import <WebKit/DOMRange.h>
-#import <JavaScriptCore/APICast.h>
-
+#import <WebCore/PluginData.h>
+#import <WebCore/RenderPart.h>
+#import <WebCore/RenderView.h>
+#import <WebCore/RenderLayer.h>
+#import <WebCore/ReplaceSelectionCommand.h>
+#import <WebCore/SmartReplace.h>
+#import <WebCore/SystemTime.h>
+#import <WebCore/TextIterator.h>
+#import <WebCore/TypingCommand.h>
+#import <WebCore/htmlediting.h>
+#import <WebCore/ScriptController.h>
+#import <WebCore/markup.h>
+#import <WebCore/visible_units.h>
+#import <runtime/JSLock.h>
+
+using namespace std;
using namespace WebCore;
+using namespace HTMLNames;
+
+using JSC::JSGlobalObject;
+using JSC::JSLock;
+using JSC::JSValue;
/*
Here is the current behavior matrix for four types of navigations:
@@ -116,33 +120,31 @@ Repeat load of the same URL (by any other means of navigation other than the rel
Add to back/forward list: NO
*/
-using namespace WebCore;
-
NSString *WebPageCacheEntryDateKey = @"WebPageCacheEntryDateKey";
NSString *WebPageCacheDataSourceKey = @"WebPageCacheDataSourceKey";
NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
-@interface WebFrame (ForwardDecls)
-- (void)_loadHTMLString:(NSString *)string baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL;
-- (WebHistoryItem *)_createItem:(BOOL)useOriginal;
-- (WebHistoryItem *)_createItemTreeWithTargetFrame:(WebFrame *)targetFrame clippedAtTarget:(BOOL)doClip;
-@end
-
-@interface NSView (WebFramePluginHosting)
-- (void)setWebFrame:(WebFrame *)webFrame;
-@end
+// FIXME: Remove when this key becomes publicly defined
+NSString *NSAccessibilityEnhancedUserInterfaceAttribute = @"AXEnhancedUserInterface";
@implementation WebFramePrivate
- (void)dealloc
{
[webFrameView release];
-
- [scriptDebugger release];
+
+ delete scriptDebugger;
[super dealloc];
}
+- (void)finalize
+{
+ delete scriptDebugger;
+
+ [super finalize];
+}
+
- (void)setWebFrameView:(WebFrameView *)v
{
[v retain];
@@ -197,6 +199,16 @@ DOMDocument *kit(Document* document)
return [DOMDocument _wrapDocument:document];
}
+DocumentFragment* core(DOMDocumentFragment *fragment)
+{
+ return [fragment _documentFragment];
+}
+
+DOMDocumentFragment *kit(DocumentFragment* fragment)
+{
+ return [DOMDocumentFragment _wrapDocumentFragment:fragment];
+}
+
HTMLElement* core(DOMHTMLElement *element)
{
return [element _HTMLElement];
@@ -217,38 +229,34 @@ DOMRange *kit(Range* range)
return [DOMRange _wrapRange:range];
}
-WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior editableLinkBehavior)
-{
- return static_cast<WebCore::EditableLinkBehavior>(editableLinkBehavior);
-}
-
-WebKitEditableLinkBehavior kit(WebCore::EditableLinkBehavior editableLinkBehavior)
+EditableLinkBehavior core(WebKitEditableLinkBehavior editableLinkBehavior)
{
- return static_cast<WebKitEditableLinkBehavior>(editableLinkBehavior);
+ switch (editableLinkBehavior) {
+ case WebKitEditableLinkDefaultBehavior:
+ return EditableLinkDefaultBehavior;
+ case WebKitEditableLinkAlwaysLive:
+ return EditableLinkAlwaysLive;
+ case WebKitEditableLinkOnlyLiveWithShiftKey:
+ return EditableLinkOnlyLiveWithShiftKey;
+ case WebKitEditableLinkLiveWhenNotFocused:
+ return EditableLinkLiveWhenNotFocused;
+ case WebKitEditableLinkNeverLive:
+ return EditableLinkNeverLive;
+ }
+ ASSERT_NOT_REACHED();
+ return EditableLinkDefaultBehavior;
}
@implementation WebFrame (WebInternal)
-
-static inline WebFrame *frame(WebCoreFrameBridge *bridge)
-{
- return ((WebFrameBridge *)bridge)->_frame;
-}
-
Frame* core(WebFrame *frame)
{
- if (!frame)
- return 0;
-
- if (!frame->_private->bridge)
- return 0;
-
- return frame->_private->bridge->m_frame;
+ return frame ? frame->_private->coreFrame : 0;
}
WebFrame *kit(Frame* frame)
{
- return frame ? ((WebFrameBridge *)frame->bridge())->_frame : nil;
+ return frame ? static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame() : nil;
}
Page* core(WebView *webView)
@@ -269,156 +277,102 @@ WebView *getWebView(WebFrame *webFrame)
return kit(coreFrame->page());
}
-/*
- In the case of saving state about a page with frames, we store a tree of items that mirrors the frame tree.
- The item that was the target of the user's navigation is designated as the "targetItem".
- When this method is called with doClip=YES we're able to create the whole tree except for the target's children,
- which will be loaded in the future. That part of the tree will be filled out as the child loads are committed.
-*/
-
-+ (CFAbsoluteTime)_timeOfLastCompletedLoad
-{
- return FrameLoader::timeOfLastCompletedLoad() - kCFAbsoluteTimeIntervalSince1970;
-}
-
-- (WebFrameBridge *)_bridge
++ (PassRefPtr<Frame>)_createFrameWithPage:(Page*)page frameName:(const String&)name frameView:(WebFrameView *)frameView ownerElement:(HTMLFrameOwnerElement*)ownerElement
{
- return _private->bridge;
-}
-
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer intoChild:(WebFrame *)childFrame
-{
- ASSERT(childFrame);
- HistoryItem* parentItem = core(self)->loader()->currentHistoryItem();
- FrameLoadType loadType = [self _frameLoader]->loadType();
- FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedHistory;
+ WebView *webView = kit(page);
- // If we're moving in the backforward list, we might want to replace the content
- // of this child frame with whatever was there at that point.
- // Reload will maintain the frame contents, LoadSame will not.
- if (parentItem && parentItem->children().size() &&
- (isBackForwardLoadType(loadType)
- || loadType == FrameLoadTypeReload
- || loadType == FrameLoadTypeReloadAllowingStaleData))
- {
- HistoryItem* childItem = parentItem->childItemWithName([childFrame name]);
- if (childItem) {
- // Use the original URL to ensure we get all the side-effects, such as
- // onLoad handlers, of any redirects that happened. An example of where
- // this is needed is Radar 3213556.
- URL = [NSURL _web_URLWithDataAsString:childItem->originalURLString()];
- // These behaviors implied by these loadTypes should apply to the child frames
- childLoadType = loadType;
+ WebFrame *frame = [[self alloc] _initWithWebFrameView:frameView webView:webView];
+ RefPtr<Frame> coreFrame = Frame::create(page, ownerElement, new WebFrameLoaderClient(frame));
+ [frame release];
+ frame->_private->coreFrame = coreFrame.get();
- if (isBackForwardLoadType(loadType))
- // For back/forward, remember this item so we can traverse any child items as child frames load
- core(childFrame)->loader()->setProvisionalHistoryItem(childItem);
- else
- // For reload, just reinstall the current item, since a new child frame was created but we won't be creating a new BF item
- core(childFrame)->loader()->setCurrentHistoryItem(childItem);
- }
+ coreFrame->tree()->setName(name);
+ if (ownerElement) {
+ ASSERT(ownerElement->document()->frame());
+ ownerElement->document()->frame()->tree()->appendChild(coreFrame.get());
}
- WebArchive *archive = [[self _dataSource] _popSubframeArchiveWithName:[childFrame name]];
- if (archive)
- [childFrame loadArchive:archive];
- else
- [childFrame _frameLoader]->load([URL absoluteURL], referrer, childLoadType,
- String(), 0, 0);
-}
+ coreFrame->init();
+ [webView _setZoomMultiplier:[webView _realZoomMultiplier] isTextOnly:[webView _realZoomMultiplierIsTextOnly]];
-- (void)_viewWillMoveToHostWindow:(NSWindow *)hostWindow
-{
- Frame* coreFrame = core(self);
- for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
- [[[kit(frame) frameView] documentView] viewWillMoveToHostWindow:hostWindow];
+ return coreFrame.release();
}
-- (void)_viewDidMoveToHostWindow
++ (void)_createMainFrameWithPage:(Page*)page frameName:(const String&)name frameView:(WebFrameView *)frameView
{
- Frame* coreFrame = core(self);
- for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
- [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
+ [self _createFrameWithPage:page frameName:name frameView:frameView ownerElement:0];
}
-- (void)_addChild:(WebFrame *)child
++ (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(HTMLFrameOwnerElement*)ownerElement frameName:(const String&)name frameView:(WebFrameView *)frameView
{
- core(self)->tree()->appendChild(adoptRef(core(child)));
- if ([child _dataSource])
- [[child _dataSource] _documentLoader]->setOverrideEncoding([[self _dataSource] _documentLoader]->overrideEncoding());
+ return [self _createFrameWithPage:ownerElement->document()->frame()->page() frameName:name frameView:frameView ownerElement:ownerElement];
}
-- (int)_numPendingOrLoadingRequests:(BOOL)recurse
+- (void)_attachScriptDebugger
{
- return core(self)->loader()->numPendingOrLoadingRequests(recurse);
-}
+ ScriptController* scriptController = _private->coreFrame->script();
-- (void)_reloadForPluginChanges
-{
- Frame* coreFrame = core(self);
- for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
- NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
- if (([documentView isKindOfClass:[WebHTMLView class]] && coreFrame->loader()->containsPlugins()))
- [kit(frame) reload];
+ // Calling ScriptController::globalObject() would create a window shell, and dispatch corresponding callbacks, which may be premature
+ // if the script debugger is attached before a document is created.
+ if (!scriptController->haveWindowShell())
+ return;
+
+ JSGlobalObject* globalObject = scriptController->globalObject();
+ if (!globalObject)
+ return;
+
+ if (_private->scriptDebugger) {
+ ASSERT(_private->scriptDebugger == globalObject->debugger());
+ return;
}
-}
-- (void)_attachScriptDebugger
-{
- if (!_private->scriptDebugger && core(self)->scriptProxy()->haveGlobalObject())
- _private->scriptDebugger = [[WebScriptDebugger alloc] initWithWebFrame:self];
+ _private->scriptDebugger = new WebScriptDebugger(globalObject);
}
- (void)_detachScriptDebugger
{
- if (_private->scriptDebugger) {
- id old = _private->scriptDebugger;
- _private->scriptDebugger = nil;
- [old release];
- }
+ if (!_private->scriptDebugger)
+ return;
+
+ delete _private->scriptDebugger;
+ _private->scriptDebugger = 0;
}
-- (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v bridge:(WebFrameBridge *)bridge
+- (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v
{
self = [super init];
if (!self)
return nil;
_private = [[WebFramePrivate alloc] init];
- _private->bridge = bridge;
if (fv) {
[_private setWebFrameView:fv];
[fv _setWebFrame:self];
}
+ _private->shouldCreateRenderers = YES;
+
++WebFrameCount;
return self;
}
-- (NSArray *)_documentViews
+- (void)_clearCoreFrame
{
- NSMutableArray *result = [NSMutableArray array];
- Frame* coreFrame = core(self);
- for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
- id docView = [[kit(frame) frameView] documentView];
- if (docView)
- [result addObject:docView];
- }
- return result;
+ _private->coreFrame = 0;
}
-- (void)_updateBackground
+- (void)_updateBackgroundAndUpdatesWhileOffscreen
{
- BOOL drawsBackground = [getWebView(self) drawsBackground];
- NSColor *backgroundColor = [getWebView(self) backgroundColor];
+ WebView *webView = getWebView(self);
+ BOOL drawsBackground = [webView drawsBackground];
+ NSColor *backgroundColor = [webView backgroundColor];
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
- WebFrameBridge *bridge = (WebFrameBridge *)frame->bridge();
- WebFrame *webFrame = [bridge webFrame];
+ WebFrame *webFrame = kit(frame);
// Never call setDrawsBackground:YES here on the scroll view or the background color will
// flash between pages loads. setDrawsBackground:YES will be called in _frameLoadCompleted.
if (!drawsBackground)
@@ -429,8 +383,12 @@ WebView *getWebView(WebFrame *webFrame)
[documentView setDrawsBackground:drawsBackground];
if ([documentView respondsToSelector:@selector(setBackgroundColor:)])
[documentView setBackgroundColor:backgroundColor];
- [bridge setDrawsBackground:drawsBackground];
- [bridge setBaseBackgroundColor:backgroundColor];
+ if (frame && frame->view()) {
+ frame->view()->setTransparent(!drawsBackground);
+ Color color = colorFromNSColor([backgroundColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]);
+ frame->view()->setBaseBackgroundColor(color);
+ frame->view()->setShouldUpdateWhileOffscreen([webView shouldUpdateWhileOffscreen]);
+ }
}
}
@@ -447,26 +405,20 @@ WebView *getWebView(WebFrame *webFrame)
#ifndef BUILDING_ON_TIGER
- (void)_unmarkAllBadGrammar
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
- Document *doc = frame->document();
- if (!doc)
- return;
-
- doc->removeMarkers(DocumentMarker::Grammar);
+ if (Document* document = frame->document())
+ document->removeMarkers(DocumentMarker::Grammar);
}
}
#endif
- (void)_unmarkAllMisspellings
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
- Document *doc = frame->document();
- if (!doc)
- return;
-
- doc->removeMarkers(DocumentMarker::Spelling);
+ if (Document* document = frame->document())
+ document->removeMarkers(DocumentMarker::Spelling);
}
}
@@ -476,8 +428,8 @@ WebView *getWebView(WebFrame *webFrame)
// optimization for common case to avoid creating potentially large selection string
if ([documentView isKindOfClass:[WebHTMLView class]])
- if (Frame* coreFrame = core(self))
- return coreFrame->selectionController()->isRange();
+ if (Frame* coreFrame = _private->coreFrame)
+ return coreFrame->selection()->isRange();
if ([documentView conformsToProtocol:@protocol(WebDocumentText)])
return [[documentView selectedString] length] > 0;
@@ -497,7 +449,7 @@ WebView *getWebView(WebFrame *webFrame)
{
// FIXME: 4186050 is one known case that makes this debug check fail.
BOOL found = NO;
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
if ([kit(frame) _hasSelection]) {
if (found)
@@ -510,10 +462,12 @@ WebView *getWebView(WebFrame *webFrame)
- (WebFrame *)_findFrameWithSelection
{
- Frame* coreFrame = core(self);
- for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
- if ([kit(frame) _hasSelection])
- return kit(frame);
+ Frame* coreFrame = _private->coreFrame;
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+ WebFrame *webFrame = kit(frame);
+ if ([webFrame _hasSelection])
+ return webFrame;
+ }
return nil;
}
@@ -530,64 +484,577 @@ WebView *getWebView(WebFrame *webFrame)
ASSERT([[getWebView(self) mainFrame] _atMostOneFrameHasSelection]);
}
-- (BOOL)_isMainFrame
+static inline WebDataSource *dataSource(DocumentLoader* loader)
{
- Frame* coreFrame = core(self);
- if (!coreFrame)
- return NO;
- return coreFrame == coreFrame->page()->mainFrame() ;
+ return loader ? static_cast<WebDocumentLoaderMac*>(loader)->dataSource() : nil;
}
-- (FrameLoader*)_frameLoader
+- (WebDataSource *)_dataSource
{
- Frame* frame = core(self);
- return frame ? frame->loader() : 0;
+ return dataSource(_private->coreFrame->loader()->documentLoader());
}
-static inline WebDataSource *dataSource(DocumentLoader* loader)
+- (void)_addData:(NSData *)data
{
- return loader ? static_cast<WebDocumentLoaderMac*>(loader)->dataSource() : nil;
+ Document* document = _private->coreFrame->document();
+
+ // Document may be nil if the part is about to redirect
+ // as a result of JS executing during load, i.e. one frame
+ // changing another's location before the frame's document
+ // has been created.
+ if (!document)
+ return;
+
+ document->setShouldCreateRenderers(_private->shouldCreateRenderers);
+ _private->coreFrame->loader()->addData((const char *)[data bytes], [data length]);
}
-- (WebDataSource *)_dataSourceForDocumentLoader:(DocumentLoader*)loader
+- (NSString *)_stringWithDocumentTypeStringAndMarkupString:(NSString *)markupString
{
- return dataSource(loader);
+ return _private->coreFrame->documentTypeString() + markupString;
}
-- (void)_addDocumentLoader:(DocumentLoader*)loader toUnarchiveState:(WebArchive *)archive
+- (NSArray *)_nodesFromList:(Vector<Node*> *)nodesVector
{
- [dataSource(loader) _addToUnarchiveState:archive];
+ size_t size = nodesVector->size();
+ NSMutableArray *nodes = [NSMutableArray arrayWithCapacity:size];
+ for (size_t i = 0; i < size; ++i)
+ [nodes addObject:[DOMNode _wrapNode:(*nodesVector)[i]]];
+ return nodes;
}
-- (WebDataSource *)_dataSource
+- (NSString *)_markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes
+{
+ // FIXME: This is always "for interchange". Is that right? See the previous method.
+ Vector<Node*> nodeList;
+ NSString *markupString = createMarkup([range _range], nodes ? &nodeList : 0, AnnotateForInterchange);
+ if (nodes)
+ *nodes = [self _nodesFromList:&nodeList];
+
+ return [self _stringWithDocumentTypeStringAndMarkupString:markupString];
+}
+
+- (NSString *)_selectedString
+{
+ String text = _private->coreFrame->selectedText();
+ text.replace('\\', _private->coreFrame->backslashAsCurrencySymbol());
+ return text;
+}
+
+- (NSString *)_stringForRange:(DOMRange *)range
+{
+ // This will give a system malloc'd buffer that can be turned directly into an NSString
+ unsigned length;
+ UChar* buf = plainTextToMallocAllocatedBuffer([range _range], length);
+
+ if (!buf)
+ return [NSString string];
+
+ UChar backslashAsCurrencySymbol = _private->coreFrame->backslashAsCurrencySymbol();
+ if (backslashAsCurrencySymbol != '\\')
+ for (unsigned n = 0; n < length; n++)
+ if (buf[n] == '\\')
+ buf[n] = backslashAsCurrencySymbol;
+
+ // Transfer buffer ownership to NSString
+ return [[[NSString alloc] initWithCharactersNoCopy:buf length:length freeWhenDone:YES] autorelease];
+}
+
+- (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly
+{
+ PlatformGraphicsContext* platformContext = static_cast<PlatformGraphicsContext*>([[NSGraphicsContext currentContext] graphicsPort]);
+ ASSERT([[NSGraphicsContext currentContext] isFlipped]);
+ GraphicsContext context(platformContext);
+
+ if (contentsOnly)
+ _private->coreFrame->view()->paintContents(&context, enclosingIntRect(rect));
+ else
+ _private->coreFrame->view()->paint(&context, enclosingIntRect(rect));
+}
+
+// Used by pagination code called from AppKit when a standalone web page is printed.
+- (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight
+{
+ NSMutableArray* pages = [NSMutableArray arrayWithCapacity:5];
+ if (printWidthScaleFactor <= 0) {
+ LOG_ERROR("printWidthScaleFactor has bad value %.2f", printWidthScaleFactor);
+ return pages;
+ }
+
+ if (printHeight <= 0) {
+ LOG_ERROR("printHeight has bad value %.2f", printHeight);
+ return pages;
+ }
+
+ if (!_private->coreFrame || !_private->coreFrame->document() || !_private->coreFrame->view()) return pages;
+ RenderView* root = static_cast<RenderView *>(_private->coreFrame->document()->renderer());
+ if (!root) return pages;
+
+ FrameView* view = _private->coreFrame->view();
+ if (!view)
+ return pages;
+
+ NSView* documentView = view->documentView();
+ if (!documentView)
+ return pages;
+
+ float currPageHeight = printHeight;
+ float docHeight = root->layer()->height();
+ float docWidth = root->layer()->width();
+ float printWidth = docWidth/printWidthScaleFactor;
+
+ // 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);
+ currPageHeight = max(1.0f, proposedBottom - i);
+ for (float j = 0; j < docWidth; j += printWidth) {
+ NSValue* val = [NSValue valueWithRect: NSMakeRect(j, i, printWidth, currPageHeight)];
+ [pages addObject: val];
+ }
+ }
+
+ return pages;
+}
+
+- (BOOL)_getVisibleRect:(NSRect*)rect;
+{
+ ASSERT_ARG(rect, rect);
+ if (RenderPart* ownerRenderer = _private->coreFrame->ownerRenderer()) {
+ if (ownerRenderer->needsLayout())
+ return NO;
+ *rect = ownerRenderer->absoluteClippedOverflowRect();
+ return YES;
+ }
+
+ return NO;
+}
+
+- (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string
+{
+ return [self _stringByEvaluatingJavaScriptFromString:string forceUserGesture:true];
+}
+
+- (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture
+{
+ ASSERT(_private->coreFrame->document());
+
+ JSValue* result = _private->coreFrame->loader()->executeScript(string, forceUserGesture);
+
+ if (!_private->coreFrame) // In case the script removed our frame from the page.
+ return @"";
+
+ // This bizarre set of rules matches behavior from WebKit for Safari 2.0.
+ // If you don't like it, use -[WebScriptObject evaluateWebScript:] or
+ // JSEvaluateScript instead, since they have less surprising semantics.
+ if (!result || !result->isBoolean() && !result->isString() && !result->isNumber())
+ return @"";
+
+ JSLock lock(false);
+ return String(result->toString(_private->coreFrame->script()->globalObject()->globalExec()));
+}
+
+- (NSRect)_caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity
+{
+ VisiblePosition visiblePosition([node _node], offset, static_cast<EAffinity>(affinity));
+ return visiblePosition.caretRect();
+}
+
+- (NSRect)_firstRectForDOMRange:(DOMRange *)range
+{
+ return _private->coreFrame->firstRectForRange([range _range]);
+}
+
+- (void)_scrollDOMRangeToVisible:(DOMRange *)range
+{
+ NSRect rangeRect = [self _firstRectForDOMRange:range];
+ Node *startNode = [[range startContainer] _node];
+
+ if (startNode && startNode->renderer()) {
+ RenderLayer *layer = startNode->renderer()->enclosingLayer();
+ if (layer)
+ layer->scrollRectToVisible(enclosingIntRect(rangeRect), false, RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignToEdgeIfNeeded);
+ }
+}
+
+- (BOOL)_needsLayout
{
- FrameLoader* frameLoader = [self _frameLoader];
+ return _private->coreFrame->view() ? _private->coreFrame->view()->needsLayout() : false;
+}
+
+- (id)_accessibilityTree
+{
+ if (!AXObjectCache::accessibilityEnabled()) {
+ AXObjectCache::enableAccessibility();
+ if ([[NSApp accessibilityAttributeValue:NSAccessibilityEnhancedUserInterfaceAttribute] boolValue])
+ AXObjectCache::enableEnhancedUserInterfaceAccessibility();
+ }
- if (!frameLoader)
+ if (!_private->coreFrame || !_private->coreFrame->document())
+ return nil;
+ RenderView* root = static_cast<RenderView *>(_private->coreFrame->document()->renderer());
+ if (!root)
+ return nil;
+ return _private->coreFrame->document()->axObjectCache()->get(root)->wrapper();
+}
+
+- (DOMRange *)_rangeByAlteringCurrentSelection:(SelectionController::EAlteration)alteration direction:(SelectionController::EDirection)direction granularity:(TextGranularity)granularity
+{
+ if (_private->coreFrame->selection()->isNone())
return nil;
- return dataSource(frameLoader->documentLoader());
+ SelectionController selection;
+ selection.setSelection(_private->coreFrame->selection()->selection());
+ selection.modify(alteration, direction, granularity);
+ return [DOMRange _wrapRange:selection.toRange().get()];
+}
+
+- (TextGranularity)_selectionGranularity
+{
+ return _private->coreFrame->selectionGranularity();
+}
+
+- (NSRange)_convertToNSRange:(Range *)range
+{
+ if (!range || !range->startContainer())
+ return NSMakeRange(NSNotFound, 0);
+
+ Element* selectionRoot = _private->coreFrame->selection()->rootEditableElement();
+ Element* scope = selectionRoot ? selectionRoot : _private->coreFrame->document()->documentElement();
+
+ // Mouse events may cause TSM to attempt to create an NSRange for a portion of the view
+ // that is not inside the current editable region. These checks ensure we don't produce
+ // potentially invalid data when responding to such requests.
+ if (range->startContainer() != scope && !range->startContainer()->isDescendantOf(scope))
+ return NSMakeRange(NSNotFound, 0);
+ if (range->endContainer() != scope && !range->endContainer()->isDescendantOf(scope))
+ return NSMakeRange(NSNotFound, 0);
+
+ RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset());
+ ASSERT(testRange->startContainer() == scope);
+ int startPosition = TextIterator::rangeLength(testRange.get());
+
+ ExceptionCode ec;
+ testRange->setEnd(range->endContainer(), range->endOffset(), ec);
+ ASSERT(testRange->startContainer() == scope);
+ int endPosition = TextIterator::rangeLength(testRange.get());
+
+ return NSMakeRange(startPosition, endPosition - startPosition);
+}
+
+- (PassRefPtr<Range>)_convertToDOMRange:(NSRange)nsrange
+{
+ if (nsrange.location > INT_MAX)
+ return 0;
+ if (nsrange.length > INT_MAX || nsrange.location + nsrange.length > INT_MAX)
+ nsrange.length = INT_MAX - nsrange.location;
+
+ // our critical assumption is that we are only called by input methods that
+ // concentrate on a given area containing the selection
+ // We have to do this because of text fields and textareas. The DOM for those is not
+ // directly in the document DOM, so serialization is problematic. Our solution is
+ // to use the root editable element of the selection start as the positional base.
+ // That fits with AppKit's idea of an input context.
+ Element* selectionRoot = _private->coreFrame->selection()->rootEditableElement();
+ Element* scope = selectionRoot ? selectionRoot : _private->coreFrame->document()->documentElement();
+ return TextIterator::rangeFromLocationAndLength(scope, nsrange.location, nsrange.length);
+}
+
+- (DOMRange *)_convertNSRangeToDOMRange:(NSRange)nsrange
+{
+ return [DOMRange _wrapRange:[self _convertToDOMRange:nsrange].get()];
+}
+
+- (NSRange)_convertDOMRangeToNSRange:(DOMRange *)range
+{
+ return [self _convertToNSRange:[range _range]];
+}
+
+- (DOMRange *)_markDOMRange
+{
+ return [DOMRange _wrapRange:_private->coreFrame->mark().toRange().get()];
+}
+
+// Given proposedRange, returns an extended range that includes adjacent whitespace that should
+// be deleted along with the proposed range in order to preserve proper spacing and punctuation of
+// the text surrounding the deletion.
+- (DOMRange *)_smartDeleteRangeForProposedRange:(DOMRange *)proposedRange
+{
+ Node *startContainer = [[proposedRange startContainer] _node];
+ Node *endContainer = [[proposedRange endContainer] _node];
+ if (startContainer == nil || endContainer == nil)
+ return nil;
+
+ ASSERT(startContainer->document() == endContainer->document());
+
+ _private->coreFrame->document()->updateLayoutIgnorePendingStylesheets();
+
+ Position start(startContainer, [proposedRange startOffset]);
+ Position end(endContainer, [proposedRange endOffset]);
+ Position newStart = start.upstream().leadingWhitespacePosition(DOWNSTREAM, true);
+ if (newStart.isNull())
+ newStart = start;
+ Position newEnd = end.downstream().trailingWhitespacePosition(DOWNSTREAM, true);
+ if (newEnd.isNull())
+ newEnd = end;
+
+ newStart = rangeCompliantEquivalent(newStart);
+ newEnd = rangeCompliantEquivalent(newEnd);
+
+ RefPtr<Range> range = _private->coreFrame->document()->createRange();
+ int exception = 0;
+ range->setStart(newStart.node(), newStart.offset(), exception);
+ range->setEnd(newStart.node(), newStart.offset(), exception);
+ return [DOMRange _wrapRange:range.get()];
+}
+
+// Determines whether whitespace needs to be added around aString to preserve proper spacing and
+// punctuation when it’s inserted into the receiver’s text over charRange. Returns by reference
+// in beforeString and afterString any whitespace that should be added, unless either or both are
+// nil. Both are returned as nil if aString is nil or if smart insertion and deletion are disabled.
+- (void)_smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)rangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString
+{
+ // give back nil pointers in case of early returns
+ if (beforeString)
+ *beforeString = nil;
+ if (afterString)
+ *afterString = nil;
+
+ // inspect destination
+ Node *startContainer = [[rangeToReplace startContainer] _node];
+ Node *endContainer = [[rangeToReplace endContainer] _node];
+
+ Position startPos(startContainer, [rangeToReplace startOffset]);
+ Position endPos(endContainer, [rangeToReplace endOffset]);
+
+ VisiblePosition startVisiblePos = VisiblePosition(startPos, VP_DEFAULT_AFFINITY);
+ VisiblePosition endVisiblePos = VisiblePosition(endPos, VP_DEFAULT_AFFINITY);
+
+ // this check also ensures startContainer, startPos, endContainer, and endPos are non-null
+ if (startVisiblePos.isNull() || endVisiblePos.isNull())
+ return;
+
+ bool addLeadingSpace = startPos.leadingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isStartOfParagraph(startVisiblePos);
+ if (addLeadingSpace)
+ if (UChar previousChar = startVisiblePos.previous().characterAfter())
+ addLeadingSpace = !isCharacterSmartReplaceExempt(previousChar, true);
+
+ bool addTrailingSpace = endPos.trailingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isEndOfParagraph(endVisiblePos);
+ if (addTrailingSpace)
+ if (UChar thisChar = endVisiblePos.characterAfter())
+ addTrailingSpace = !isCharacterSmartReplaceExempt(thisChar, false);
+
+ // inspect source
+ bool hasWhitespaceAtStart = false;
+ bool hasWhitespaceAtEnd = false;
+ unsigned pasteLength = [pasteString length];
+ if (pasteLength > 0) {
+ NSCharacterSet *whiteSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
+
+ if ([whiteSet characterIsMember:[pasteString characterAtIndex:0]]) {
+ hasWhitespaceAtStart = YES;
+ }
+ if ([whiteSet characterIsMember:[pasteString characterAtIndex:(pasteLength - 1)]]) {
+ hasWhitespaceAtEnd = YES;
+ }
+ }
+
+ // issue the verdict
+ if (beforeString && addLeadingSpace && !hasWhitespaceAtStart)
+ *beforeString = @" ";
+ if (afterString && addTrailingSpace && !hasWhitespaceAtEnd)
+ *afterString = @" ";
+}
+
+- (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString
+{
+ if (!_private->coreFrame || !_private->coreFrame->document())
+ return 0;
+
+ return [DOMDocumentFragment _wrapDocumentFragment:createFragmentFromMarkup(_private->coreFrame->document(), markupString, baseURLString).get()];
+}
+
+- (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes
+{
+ if (!_private->coreFrame || !_private->coreFrame->document())
+ return 0;
+
+ NSEnumerator *nodeEnum = [nodes objectEnumerator];
+ Vector<Node*> nodesVector;
+ DOMNode *node;
+ while ((node = [nodeEnum nextObject]))
+ nodesVector.append([node _node]);
+
+ 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()];
+ [fragment appendChild:node];
+ [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);
+}
+
+- (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;
+}
+
+- (DOMRange *)_characterRangeAtPoint:(NSPoint)point
+{
+ VisiblePosition position = [self _visiblePositionForPoint:point];
+ if (position.isNull())
+ return nil;
+
+ VisiblePosition previous = position.previous();
+ if (previous.isNotNull()) {
+ DOMRange *previousCharacterRange = [DOMRange _wrapRange:makeRange(previous, position).get()];
+ NSRect rect = [self _firstRectForDOMRange:previousCharacterRange];
+ if (NSPointInRect(point, rect))
+ return previousCharacterRange;
+ }
+
+ VisiblePosition next = position.next();
+ if (next.isNotNull()) {
+ DOMRange *nextCharacterRange = [DOMRange _wrapRange:makeRange(position, next).get()];
+ NSRect rect = [self _firstRectForDOMRange:nextCharacterRange];
+ if (NSPointInRect(point, rect))
+ return nextCharacterRange;
+ }
+
+ return nil;
+}
+
+- (DOMCSSStyleDeclaration *)_typingStyle
+{
+ if (!_private->coreFrame || !_private->coreFrame->typingStyle())
+ return nil;
+ return [DOMCSSStyleDeclaration _wrapCSSStyleDeclaration:_private->coreFrame->typingStyle()->copy().get()];
+}
+
+- (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
+{
+ if (!_private->coreFrame)
+ return;
+ _private->coreFrame->computeAndSetTypingStyle([style _CSSStyleDeclaration], undoAction);
+}
+
+- (void)_dragSourceMovedTo:(NSPoint)windowLoc
+{
+ if (!_private->coreFrame)
+ return;
+ FrameView* view = _private->coreFrame->view();
+ if (!view)
+ return;
+ // FIXME: These are fake modifier keys here, but they should be real ones instead.
+ PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]),
+ LeftButton, MouseEventMoved, 0, false, false, false, false, currentTime());
+ _private->coreFrame->eventHandler()->dragSourceMovedTo(event);
+}
+
+- (void)_dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation
+{
+ if (!_private->coreFrame)
+ return;
+ FrameView* view = _private->coreFrame->view();
+ if (!view)
+ return;
+ // FIXME: These are fake modifier keys here, but they should be real ones instead.
+ PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]),
+ LeftButton, MouseEventMoved, 0, false, false, false, false, currentTime());
+ _private->coreFrame->eventHandler()->dragSourceEndedAt(event, (DragOperation)operation);
+}
+
+- (BOOL)_canProvideDocumentSource
+{
+ String mimeType = _private->coreFrame->loader()->responseMIMEType();
+
+ if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||
+ Image::supportsType(mimeType) ||
+ (_private->coreFrame->page() && _private->coreFrame->page()->pluginData()->supportsMimeType(mimeType)))
+ return NO;
+
+ return YES;
+}
+
+- (BOOL)_canSaveAsWebArchive
+{
+ // Currently, all documents that we can view source for
+ // (HTML and XML documents) can also be saved as web archives
+ return [self _canProvideDocumentSource];
+}
+
+- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
+{
+ // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
+ String encoding = _private->coreFrame->loader()->documentLoader()->overrideEncoding();
+ bool userChosen = !encoding.isNull();
+ if (encoding.isNull())
+ encoding = textEncodingName;
+ _private->coreFrame->loader()->setEncoding(encoding, userChosen);
+ [self _addData:data];
}
@end
@implementation WebFrame (WebPrivate)
-// FIXME: Yhis exists only as a convenience for Safari, consider moving there.
+// FIXME: This exists only as a convenience for Safari, consider moving there.
- (BOOL)_isDescendantOfFrame:(WebFrame *)ancestor
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
return coreFrame && coreFrame->tree()->isDescendantOf(core(ancestor));
}
-- (void)_setShouldCreateRenderers:(BOOL)frame
+- (void)_setShouldCreateRenderers:(BOOL)shouldCreateRenderers
{
- [_private->bridge setShouldCreateRenderers:frame];
+ _private->shouldCreateRenderers = shouldCreateRenderers;
}
- (NSColor *)_bodyBackgroundColor
{
- Document* document = core(self)->document();
+ Document* document = _private->coreFrame->document();
if (!document)
return nil;
HTMLElement* body = document->body();
@@ -604,20 +1071,61 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (BOOL)_isFrameSet
{
- return core(self)->isFrameSet();
+ return _private->coreFrame->isFrameSet();
}
- (BOOL)_firstLayoutDone
{
- return [self _frameLoader]->firstLayoutDone();
+ return _private->coreFrame->loader()->firstLayoutDone();
}
- (WebFrameLoadType)_loadType
{
- return (WebFrameLoadType)[self _frameLoader]->loadType();
+ return (WebFrameLoadType)_private->coreFrame->loader()->loadType();
+}
+
+- (NSRange)_selectedNSRange
+{
+ return [self _convertToNSRange:_private->coreFrame->selection()->toRange().get()];
+}
+
+- (void)_selectNSRange:(NSRange)range
+{
+ RefPtr<Range> domRange = [self _convertToDOMRange:range];
+ if (domRange)
+ _private->coreFrame->selection()->setSelection(Selection(domRange.get(), SEL_DEFAULT_AFFINITY));
+}
+
+- (BOOL)_isDisplayingStandaloneImage
+{
+ Document* document = _private->coreFrame->document();
+ return document && document->isImageDocument();
}
-#ifndef __LP64__
+- (unsigned)_pendingFrameUnloadEventCount
+{
+ return _private->coreFrame->eventHandler()->pendingFrameUnloadEventCount();
+}
+
+- (WebIconFetcher *)fetchApplicationIcon:(id)target
+ selector:(SEL)selector
+{
+ return [WebIconFetcher _fetchApplicationIconForFrame:self
+ target:target
+ selector:selector];
+}
+
+- (void)_setIsDisconnected:(bool)isDisconnected
+{
+ _private->coreFrame->setIsDisconnected(isDisconnected);
+}
+
+- (void)_setExcludeFromTextSearch:(bool)exclude
+{
+ _private->coreFrame->setExcludeFromTextSearch(exclude);
+}
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
- (void)_recursive_resumeNullEventsForAllNetscapePlugins
{
Frame* coreFrame = core(self);
@@ -627,9 +1135,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
[(WebHTMLView *)documentView _resumeNullEventsForAllNetscapePlugins];
}
}
-#endif
-#ifndef __LP64__
- (void)_recursive_pauseNullEventsForAllNetscapePlugins
{
Frame* coreFrame = core(self);
@@ -641,22 +1147,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
}
#endif
-- (NSRange)_selectedNSRange
-{
- return [_private->bridge selectedNSRange];
-}
-
-- (void)_selectNSRange:(NSRange)range
-{
- [_private->bridge selectNSRange:range];
-}
-
-- (BOOL)_isDisplayingStandaloneImage
-{
- Document* document = core(self)->document();
- return document && document->isImageDocument();
-}
-
@end
@implementation WebFrame
@@ -674,7 +1164,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (void)dealloc
{
- ASSERT(_private->bridge == nil);
[_private release];
--WebFrameCount;
[super dealloc];
@@ -682,14 +1171,13 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (void)finalize
{
- ASSERT(_private->bridge == nil);
--WebFrameCount;
[super finalize];
}
- (NSString *)name
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return nil;
return coreFrame->tree()->name();
@@ -707,7 +1195,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (DOMDocument *)DOMDocument
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return nil;
@@ -730,7 +1218,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (DOMHTMLElement *)frameElement
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return nil;
return kit(coreFrame->ownerElement());
@@ -738,22 +1226,19 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (WebDataSource *)provisionalDataSource
{
- FrameLoader* frameLoader = [self _frameLoader];
- return frameLoader ? dataSource(frameLoader->provisionalDocumentLoader()) : nil;
+ Frame* coreFrame = _private->coreFrame;
+ return coreFrame ? dataSource(coreFrame->loader()->provisionalDocumentLoader()) : nil;
}
- (WebDataSource *)dataSource
{
- FrameLoader* loader = [self _frameLoader];
- if (!loader || !loader->frameHasLoaded())
- return nil;
-
- return [self _dataSource];
+ Frame* coreFrame = _private->coreFrame;
+ return coreFrame && coreFrame->loader()->frameHasLoaded() ? [self _dataSource] : nil;
}
- (void)loadRequest:(NSURLRequest *)request
{
- [self _frameLoader]->load(request);
+ _private->coreFrame->loader()->load(request);
}
static NSURL *createUniqueWebDataURL()
@@ -766,80 +1251,69 @@ static NSURL *createUniqueWebDataURL()
return URL;
}
-- (void)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL
+- (void)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL unreachableURL:(NSURL *)unreachableURL
{
KURL responseURL;
- if (!URL) {
- URL = [NSURL URLWithString:@"about:blank"];
+ if (!baseURL) {
+ baseURL = blankURL();
responseURL = createUniqueWebDataURL();
}
- ResourceRequest request([URL absoluteURL]);
+ ResourceRequest request([baseURL absoluteURL]);
// hack because Mail checks for this property to detect data / archive loads
[NSURLProtocol setProperty:@"" forKey:@"WebDataRequest" inRequest:(NSMutableURLRequest *)request.nsURLRequest()];
SubstituteData substituteData(WebCore::SharedBuffer::wrapNSData(data), MIMEType, encodingName, [unreachableURL absoluteURL], responseURL);
- [self _frameLoader]->load(request, substituteData);
+ _private->coreFrame->loader()->load(request, substituteData);
}
-- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL
+- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL
{
if (!MIMEType)
MIMEType = @"text/html";
- [self _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:URL unreachableURL:nil];
+ [self _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:nil];
}
-- (void)_loadHTMLString:(NSString *)string baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL
+- (void)_loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL unreachableURL:(NSURL *)unreachableURL
{
NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
- [self _loadData:data MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:URL unreachableURL:unreachableURL];
+ [self _loadData:data MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:baseURL unreachableURL:unreachableURL];
}
-- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)URL
+- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
{
- [self _loadHTMLString:string baseURL:URL unreachableURL:nil];
+ [self _loadHTMLString:string baseURL:baseURL unreachableURL:nil];
}
-- (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)URL forUnreachableURL:(NSURL *)unreachableURL
+- (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL
{
- [self _loadHTMLString:string baseURL:URL unreachableURL:unreachableURL];
+ [self _loadHTMLString:string baseURL:baseURL unreachableURL:unreachableURL];
}
- (void)loadArchive:(WebArchive *)archive
{
- WebResource *mainResource = [archive mainResource];
- if (mainResource) {
- SubstituteData substituteData(WebCore::SharedBuffer::wrapNSData([mainResource data]), [mainResource MIMEType], [mainResource textEncodingName], KURL());
- ResourceRequest request([mainResource URL]);
-
- // hack because Mail checks for this property to detect data / archive loads
- [NSURLProtocol setProperty:@"" forKey:@"WebDataRequest" inRequest:(NSMutableURLRequest *)request.nsURLRequest()];
-
- RefPtr<DocumentLoader> documentLoader = core(self)->loader()->client()->createDocumentLoader(request, substituteData);
-
- [dataSource(documentLoader.get()) _addToUnarchiveState:archive];
-
- [self _frameLoader]->load(documentLoader.get());
- }
+ if (LegacyWebArchive* coreArchive = [archive _coreLegacyWebArchive])
+ _private->coreFrame->loader()->loadArchive(coreArchive);
}
- (void)stopLoading
{
- if (FrameLoader* frameLoader = [self _frameLoader])
- frameLoader->stopForUserCancel();
+ if (!_private->coreFrame)
+ return;
+ _private->coreFrame->loader()->stopForUserCancel();
}
- (void)reload
{
- [self _frameLoader]->reload();
+ _private->coreFrame->loader()->reload();
}
- (WebFrame *)findFrameNamed:(NSString *)name
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return nil;
return kit(coreFrame->tree()->find(name));
@@ -847,7 +1321,7 @@ static NSURL *createUniqueWebDataURL()
- (WebFrame *)parentFrame
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return nil;
return [[kit(coreFrame->tree()->parent()) retain] autorelease];
@@ -855,7 +1329,7 @@ static NSURL *createUniqueWebDataURL()
- (NSArray *)childFrames
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return [NSArray array];
NSMutableArray *children = [NSMutableArray arrayWithCapacity:coreFrame->tree()->childCount()];
@@ -866,18 +1340,18 @@ static NSURL *createUniqueWebDataURL()
- (WebScriptObject *)windowObject
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return 0;
- return coreFrame->windowScriptObject();
+ return coreFrame->script()->windowScriptObject();
}
- (JSGlobalContextRef)globalContext
{
- Frame* coreFrame = core(self);
+ Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return 0;
- return toGlobalRef(coreFrame->scriptProxy()->globalObject()->globalExec());
+ return toGlobalRef(coreFrame->script()->globalObject()->globalExec());
}
@end
diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h
index 89b5b1d..5cf7690 100644
--- a/WebKit/mac/WebView/WebFrameInternal.h
+++ b/WebKit/mac/WebView/WebFrameInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,21 +31,20 @@
#import "WebFramePrivate.h"
#import "WebPreferencesPrivate.h"
-#ifdef __cplusplus
+#import <WebCore/EditAction.h>
#import <WebCore/FrameLoaderTypes.h>
+#import <WebCore/SelectionController.h>
#import <WebCore/Settings.h>
-#endif
@class DOMCSSStyleDeclaration;
+@class DOMDocumentFragment;
@class DOMElement;
@class DOMNode;
@class DOMRange;
@class WebFrameView;
-@class WebFrameBridge;
@class WebHistoryItem;
-@class WebScriptDebugger;
-#ifdef __cplusplus
+class WebScriptDebugger;
namespace WebCore {
class CSSStyleDeclaration;
@@ -54,9 +53,9 @@ namespace WebCore {
class Element;
class Frame;
class Frame;
- class FrameLoader;
class HistoryItem;
class HTMLElement;
+ class HTMLFrameOwnerElement;
class Node;
class Page;
class Range;
@@ -79,6 +78,9 @@ DOMNode *kit(WebCore::Node*);
WebCore::Document* core(DOMDocument *);
DOMDocument *kit(WebCore::Document*);
+WebCore::DocumentFragment* core(DOMDocumentFragment *);
+DOMDocumentFragment *kit(WebCore::DocumentFragment*);
+
WebCore::HTMLElement* core(DOMHTMLElement *);
DOMHTMLElement *kit(WebCore::HTMLElement*);
@@ -89,80 +91,100 @@ WebCore::Page* core(WebView *);
WebView *kit(WebCore::Page*);
WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior);
-WebKitEditableLinkBehavior kit(WebCore::EditableLinkBehavior);
WebView *getWebView(WebFrame *webFrame);
-@interface WebFramePrivate : NSObject
-{
+@interface WebFramePrivate : NSObject {
@public
+ WebCore::Frame* coreFrame;
WebFrameView *webFrameView;
-
- WebFrameBridge *bridge;
-
- WebScriptDebugger *scriptDebugger;
+ WebScriptDebugger* scriptDebugger;
id internalLoadDelegate;
+ BOOL shouldCreateRenderers;
}
@end
-#else
-struct WebCoreHistoryItem;
-#endif
+@protocol WebCoreRenderTreeCopier <NSObject>
+- (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)position rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
+@end
@interface WebFrame (WebInternal)
-- (void)_updateBackground;
++ (void)_createMainFrameWithPage:(WebCore::Page*)page frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView;
++ (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView;
+- (id)_initWithWebFrameView:(WebFrameView *)webFrameView webView:(WebView *)webView;
+
+- (void)_clearCoreFrame;
+
+- (void)_updateBackgroundAndUpdatesWhileOffscreen;
- (void)_setInternalLoadDelegate:(id)internalLoadDelegate;
- (id)_internalLoadDelegate;
#ifndef BUILDING_ON_TIGER
- (void)_unmarkAllBadGrammar;
#endif
- (void)_unmarkAllMisspellings;
-// Note that callers should not perform any ops on these views that could change the set of frames
-- (NSArray *)_documentViews;
- (BOOL)_hasSelection;
- (void)_clearSelection;
- (WebFrame *)_findFrameWithSelection;
- (void)_clearSelectionInOtherFrames;
-#ifdef __cplusplus
-- (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v bridge:(WebFrameBridge *)bridge;
-#endif
-- (BOOL)_isMainFrame;
+- (void)_attachScriptDebugger;
+- (void)_detachScriptDebugger;
-#ifdef __cplusplus
+// dataSource reports null for the initial empty document's data source; this is needed
+// to preserve compatibility with Mail and Safari among others. But internal to WebKit,
+// we need to be able to get the initial data source as well, so the _dataSource method
+// should be used instead.
+- (WebDataSource *)_dataSource;
-- (WebCore::FrameLoader*)_frameLoader;
-- (WebDataSource *)_dataSourceForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (BOOL)_needsLayout;
+- (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly;
+- (BOOL)_getVisibleRect:(NSRect*)rect;
+- (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
-- (void)_addDocumentLoader:(WebCore::DocumentLoader*)loader toUnarchiveState:(WebArchive *)archive;
+- (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string;
+- (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture;
-#endif
+- (NSString *)_selectedString;
+- (NSString *)_stringForRange:(DOMRange *)range;
-- (WebFrameBridge *)_bridge;
+- (NSString *)_markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes;
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer intoChild:(WebFrame *)childFrame;
+- (NSRect)_caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
+- (NSRect)_firstRectForDOMRange:(DOMRange *)range;
+- (void)_scrollDOMRangeToVisible:(DOMRange *)range;
-- (void)_viewWillMoveToHostWindow:(NSWindow *)hostWindow;
-- (void)_viewDidMoveToHostWindow;
+- (id)_accessibilityTree;
-- (void)_addChild:(WebFrame *)child;
+- (DOMRange *)_rangeByAlteringCurrentSelection:(WebCore::SelectionController::EAlteration)alteration direction:(WebCore::SelectionController::EDirection)direction granularity:(WebCore::TextGranularity)granularity;
+- (void)_smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
+- (NSRange)_convertToNSRange:(WebCore::Range*)range;
+- (DOMRange *)_convertNSRangeToDOMRange:(NSRange)range;
+- (NSRange)_convertDOMRangeToNSRange:(DOMRange *)range;
-+ (CFAbsoluteTime)_timeOfLastCompletedLoad;
+- (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
+- (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes;
-- (int)_numPendingOrLoadingRequests:(BOOL)recurse;
+- (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)_reloadForPluginChanges;
+- (void)_insertParagraphSeparatorInQuotedContent;
-- (void)_attachScriptDebugger;
-- (void)_detachScriptDebugger;
+- (DOMRange *)_characterRangeAtPoint:(NSPoint)point;
-// dataSource reports null for the initial empty document's data source; this is needed
-// to preserve compatibility with Mail and Safari among others. But internal to WebKit,
-// we need to be able to get the initial data source as well, so the _dataSource method
-// should be used instead.
-- (WebDataSource *)_dataSource;
+- (DOMCSSStyleDeclaration *)_typingStyle;
+- (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebCore::EditAction)undoAction;
+
+- (void)_dragSourceMovedTo:(NSPoint)windowLoc;
+- (void)_dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
+
+- (BOOL)_canProvideDocumentSource;
+- (BOOL)_canSaveAsWebArchive;
+
+- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
@end
diff --git a/WebKit/mac/WebView/WebFrameLoadDelegate.h b/WebKit/mac/WebView/WebFrameLoadDelegate.h
index b463988..e5f1c7c 100644
--- a/WebKit/mac/WebView/WebFrameLoadDelegate.h
+++ b/WebKit/mac/WebView/WebFrameLoadDelegate.h
@@ -27,6 +27,7 @@
*/
#import <Cocoa/Cocoa.h>
+#import <JavaScriptCore/WebKitAvailability.h>
@class NSError;
@class WebFrame;
@@ -191,6 +192,6 @@
@discussion This method is deprecated. Consider using webView:didClearWindowObject:forFrame:
instead.
*/
-- (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject;
+- (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
@end
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index 4595572..428c142 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -31,6 +31,11 @@
#import <WebKit/WebFrame.h>
#import <JavaScriptCore/JSBase.h>
+#if !defined(ENABLE_NETSCAPE_PLUGIN_API)
+#define ENABLE_NETSCAPE_PLUGIN_API 1
+#endif
+
+@class WebIconFetcher;
@class WebScriptObject;
// Keys for accessing the values in the page cache dictionary.
@@ -57,10 +62,6 @@ typedef enum {
- (BOOL)_isFrameSet;
- (BOOL)_firstLayoutDone;
- (WebFrameLoadType)_loadType;
-#ifndef __LP64__
-- (void)_recursive_resumeNullEventsForAllNetscapePlugins;
-- (void)_recursive_pauseNullEventsForAllNetscapePlugins;
-#endif
// These methods take and return NSRanges based on the root editable element as the positional base.
// This fits with AppKit's idea of an input context. These methods are slow compared to their DOMRange equivalents.
@@ -70,4 +71,17 @@ typedef enum {
- (BOOL)_isDisplayingStandaloneImage;
+- (unsigned) _pendingFrameUnloadEventCount;
+
+- (WebIconFetcher *)fetchApplicationIcon:(id)target
+ selector:(SEL)selector;
+
+- (void)_setIsDisconnected:(bool)isDisconnected;
+- (void)_setExcludeFromTextSearch:(bool)exclude;
+
+#if ENABLE_NETSCAPE_PLUGIN_API
+- (void)_recursive_resumeNullEventsForAllNetscapePlugins;
+- (void)_recursive_pauseNullEventsForAllNetscapePlugins;
+#endif
+
@end
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index ef1a4bd..e9c0aae 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,10 +31,9 @@
#import "WebClipView.h"
#import "WebDataSourcePrivate.h"
#import "WebDocument.h"
-#import "WebDynamicScrollBarsView.h"
+#import "WebDynamicScrollBarsViewInternal.h"
#import "WebFrame.h"
#import "WebFrameInternal.h"
-#import "WebFrameBridge.h"
#import "WebFrameViewInternal.h"
#import "WebFrameViewPrivate.h"
#import "WebHistoryItemInternal.h"
@@ -55,16 +54,18 @@
#import "WebViewInternal.h"
#import "WebViewPrivate.h"
#import <Foundation/NSURLRequest.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebCore/DragController.h>
+#import <WebCore/EventHandler.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameView.h>
#import <WebCore/HistoryItem.h>
#import <WebCore/Page.h>
+#import <WebCore/RenderPart.h>
#import <WebCore/ThreadCheck.h>
#import <WebCore/WebCoreFrameView.h>
#import <WebCore/WebCoreView.h>
#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
using namespace WebCore;
@@ -81,35 +82,19 @@ enum {
SpaceKey = 0x0020
};
-@interface WebFrameView (WebFrameViewFileInternal) <WebCoreBridgeHolder>
+@interface WebFrameView (WebFrameViewFileInternal) <WebCoreFrameView>
- (float)_verticalKeyboardScrollDistance;
-- (WebCoreFrameBridge *) webCoreBridge;
@end
@interface WebFrameViewPrivate : NSObject {
@public
WebFrame *webFrame;
WebDynamicScrollBarsView *frameScrollView;
-
- // These margin values are used to temporarily hold the margins of a frame until
- // we have the appropriate document view type.
- int marginWidth;
- int marginHeight;
}
@end
@implementation WebFrameViewPrivate
-- init
-{
- [super init];
-
- marginWidth = -1;
- marginHeight = -1;
-
- return self;
-}
-
- (void)dealloc
{
[frameScrollView release];
@@ -126,9 +111,9 @@ enum {
return [[self _scrollView] verticalLineScroll];
}
-- (WebCoreFrameBridge *) webCoreBridge
+- (Frame*)_web_frame
{
- return [_private->webFrame _bridge];
+ return core(_private->webFrame);
}
@end
@@ -141,26 +126,6 @@ enum {
return [_private->webFrame webView];
}
-- (void)_setMarginWidth:(int)w
-{
- _private->marginWidth = w;
-}
-
-- (int)_marginWidth
-{
- return _private->marginWidth;
-}
-
-- (void)_setMarginHeight:(int)h
-{
- _private->marginHeight = h;
-}
-
-- (int)_marginHeight
-{
- return _private->marginHeight;
-}
-
- (void)_setDocumentView:(NSView <WebDocumentView> *)view
{
WebDynamicScrollBarsView *sv = [self _scrollView];
@@ -285,6 +250,33 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
return [WebView _viewClass:&viewClass andRepresentationClass:nil forMIMEType:MIMEType] ? viewClass : nil;
}
+- (void)_install
+{
+ ASSERT(_private->webFrame);
+ ASSERT(_private->frameScrollView);
+
+ Frame* frame = core(_private->webFrame);
+
+ ASSERT(frame);
+ ASSERT(frame->page());
+
+ // If this isn't the main frame, it must have an owner element set, or it
+ // won't ever get installed in the view hierarchy.
+ ASSERT(frame == frame->page()->mainFrame() || frame->ownerElement());
+
+ FrameView* view = frame->view();
+
+ view->setPlatformWidget(_private->frameScrollView);
+
+ // FIXME: Frame tries to do this too. Is this code needed?
+ if (RenderPart* owner = frame->ownerRenderer()) {
+ owner->setWidget(view);
+ // Now the render part owns the view, so we don't any more.
+ }
+
+ view->initScrollbars();
+}
+
@end
@implementation WebFrameView
@@ -373,18 +365,17 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (void)setAllowsScrolling:(BOOL)flag
{
- WebDynamicScrollBarsView *scrollView = [self _scrollView];
- [scrollView setAllowsScrolling:flag];
WebCore::Frame *frame = core([self webFrame]);
- if (WebCore::FrameView *view = frame? frame->view() : 0) {
- view->setHScrollbarMode((WebCore::ScrollbarMode)[scrollView horizontalScrollingMode]);
- view->setVScrollbarMode((WebCore::ScrollbarMode)[scrollView verticalScrollingMode]);
- }
+ if (WebCore::FrameView *view = frame? frame->view() : 0)
+ view->setCanHaveScrollbars(flag);
}
- (BOOL)allowsScrolling
{
- return [[self _scrollView] allowsScrolling];
+ WebCore::Frame *frame = core([self webFrame]);
+ if (WebCore::FrameView *view = frame? frame->view() : 0)
+ return view->canHaveScrollbars();
+ return YES;
}
- (NSView <WebDocumentView> *)documentView
@@ -467,6 +458,37 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
}
}
+- (NSRect)visibleRect
+{
+ // This method can be called beneath -[NSView dealloc] after we have cleared _private.
+ if (!_private)
+ return [super visibleRect];
+
+ // FIXME: <rdar://problem/6213380> This method does not work correctly with transforms, for two reasons:
+ // 1) [super visibleRect] does not account for the transform, since it is not represented
+ // in the NSView hierarchy.
+ // 2) -_getVisibleRect: does not correct for transforms.
+
+ NSRect rendererVisibleRect;
+ if (![[self webFrame] _getVisibleRect:&rendererVisibleRect])
+ return [super visibleRect];
+
+ if (NSIsEmptyRect(rendererVisibleRect))
+ return NSZeroRect;
+
+ NSRect viewVisibleRect = [super visibleRect];
+ if (NSIsEmptyRect(viewVisibleRect))
+ return NSZeroRect;
+
+ NSRect frame = [self frame];
+ // rendererVisibleRect is in the parent's coordinate space, and frame is in the superview's coordinate space.
+ // The return value from this method needs to be in this view's coordinate space. We get that right by subtracting
+ // the origins (and correcting for flipping), but when we support transforms, we will need to do better than this.
+ rendererVisibleRect.origin.x -= frame.origin.x;
+ rendererVisibleRect.origin.y = NSMaxY(frame) - NSMaxY(rendererVisibleRect);
+ return NSIntersectionRect(rendererVisibleRect, viewVisibleRect);
+}
+
- (void)setFrameSize:(NSSize)size
{
if (!NSEqualSizes(size, [self frame].size) && [[[self webFrame] webView] drawsBackground]) {
@@ -475,20 +497,20 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
[super setFrameSize:size];
}
-- (WebFrameBridge *)_bridge
-{
- return [[self webFrame] _bridge];
-}
-
-- (BOOL)_scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity
+- (BOOL)_scrollOverflowInDirection:(ScrollDirection)direction granularity:(ScrollGranularity)granularity
{
// scrolling overflows is only applicable if we're dealing with an WebHTMLView
- return ([[self documentView] isKindOfClass:[WebHTMLView class]] && [[self _bridge] scrollOverflowInDirection:direction granularity:granularity]);
+ if (![[self documentView] isKindOfClass:[WebHTMLView class]])
+ return NO;
+ Frame* frame = core([self webFrame]);
+ if (!frame)
+ return NO;
+ return frame->eventHandler()->scrollOverflow(direction, granularity);
}
- (void)scrollToBeginningOfDocument:(id)sender
{
- if (![self _scrollOverflowInDirection:WebScrollUp granularity:WebScrollDocument]) {
+ if (![self _scrollOverflowInDirection:ScrollUp granularity:ScrollByDocument]) {
if (![self _hasScrollBars]) {
[[self _largestChildWithScrollBars] scrollToBeginningOfDocument:sender];
@@ -501,7 +523,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (void)scrollToEndOfDocument:(id)sender
{
- if (![self _scrollOverflowInDirection:WebScrollDown granularity:WebScrollDocument]) {
+ if (![self _scrollOverflowInDirection:ScrollDown granularity:ScrollByDocument]) {
if (![self _hasScrollBars]) {
[[self _largestChildWithScrollBars] scrollToEndOfDocument:sender];
@@ -557,7 +579,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (BOOL)_pageVertically:(BOOL)up
{
- if ([self _scrollOverflowInDirection:up ? WebScrollUp : WebScrollDown granularity:WebScrollPage])
+ if ([self _scrollOverflowInDirection:up ? ScrollUp : ScrollDown granularity:ScrollByPage])
return YES;
if (![self _hasScrollBars])
@@ -569,7 +591,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (BOOL)_pageHorizontally:(BOOL)left
{
- if ([self _scrollOverflowInDirection:left ? WebScrollLeft : WebScrollRight granularity:WebScrollPage])
+ if ([self _scrollOverflowInDirection:left ? ScrollLeft : ScrollRight granularity:ScrollByPage])
return YES;
if (![self _hasScrollBars])
@@ -581,7 +603,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (BOOL)_scrollLineVertically:(BOOL)up
{
- if ([self _scrollOverflowInDirection:up ? WebScrollUp : WebScrollDown granularity:WebScrollLine])
+ if ([self _scrollOverflowInDirection:up ? ScrollUp : ScrollDown granularity:ScrollByLine])
return YES;
if (![self _hasScrollBars])
@@ -593,7 +615,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (BOOL)_scrollLineHorizontally:(BOOL)left
{
- if ([self _scrollOverflowInDirection:left ? WebScrollLeft : WebScrollRight granularity:WebScrollLine])
+ if ([self _scrollOverflowInDirection:left ? ScrollLeft : ScrollRight granularity:ScrollByLine])
return YES;
if (![self _hasScrollBars])
@@ -645,7 +667,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
NSString *characters = [event characters];
int index, count;
BOOL callSuper = YES;
- BOOL maintainsBackForwardList = core([self webFrame])->page()->backForwardList()->enabled() ? YES : NO;
+ Frame* coreFrame = [self _web_frame];
+ BOOL maintainsBackForwardList = coreFrame && coreFrame->page()->backForwardList()->enabled() ? YES : NO;
count = [characters length];
for (index = 0; index < count; ++index) {
@@ -928,33 +951,34 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
ASSERT([customClass isSubclassOfClass:[WebDynamicScrollBarsView class]]);
if (customClass == [_private->frameScrollView class])
return;
- if ([customClass isSubclassOfClass:[WebDynamicScrollBarsView class]]) {
- WebDynamicScrollBarsView *oldScrollView = _private->frameScrollView; // already retained
- NSView <WebDocumentView> *documentView = [[self documentView] retain];
-
- WebDynamicScrollBarsView *scrollView = [[customClass alloc] initWithFrame:[oldScrollView frame]];
- [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]];
- [scrollView setDrawsBackground:[oldScrollView drawsBackground]];
- [scrollView setHasVerticalScroller:[oldScrollView hasVerticalScroller]];
- [scrollView setHasHorizontalScroller:[oldScrollView hasHorizontalScroller]];
- [scrollView setAutoresizingMask:[oldScrollView autoresizingMask]];
- [scrollView setLineScroll:[oldScrollView lineScroll]];
- [self addSubview:scrollView];
-
- // don't call our overridden version here; we need to make the standard NSView link between us
- // and our subview so that previousKeyView and previousValidKeyView work as expected. This works
- // together with our becomeFirstResponder and setNextKeyView overrides.
- [super setNextKeyView:scrollView];
-
- _private->frameScrollView = scrollView;
-
- [self _setDocumentView:documentView];
- [[self _bridge] installInFrame:scrollView];
-
- [oldScrollView removeFromSuperview];
- [oldScrollView release];
- [documentView release];
- }
+ if (![customClass isSubclassOfClass:[WebDynamicScrollBarsView class]])
+ return;
+
+ WebDynamicScrollBarsView *oldScrollView = _private->frameScrollView; // already retained
+ NSView <WebDocumentView> *documentView = [[self documentView] retain];
+
+ WebDynamicScrollBarsView *scrollView = [[customClass alloc] initWithFrame:[oldScrollView frame]];
+ [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]];
+ [scrollView setDrawsBackground:[oldScrollView drawsBackground]];
+ [scrollView setHasVerticalScroller:[oldScrollView hasVerticalScroller]];
+ [scrollView setHasHorizontalScroller:[oldScrollView hasHorizontalScroller]];
+ [scrollView setAutoresizingMask:[oldScrollView autoresizingMask]];
+ [scrollView setLineScroll:[oldScrollView lineScroll]];
+ [self addSubview:scrollView];
+
+ // don't call our overridden version here; we need to make the standard NSView link between us
+ // and our subview so that previousKeyView and previousValidKeyView work as expected. This works
+ // together with our becomeFirstResponder and setNextKeyView overrides.
+ [super setNextKeyView:scrollView];
+
+ _private->frameScrollView = scrollView;
+
+ [self _setDocumentView:documentView];
+ [self _install];
+
+ [oldScrollView removeFromSuperview];
+ [oldScrollView release];
+ [documentView release];
}
@end
diff --git a/WebKit/mac/WebView/WebFrameViewInternal.h b/WebKit/mac/WebView/WebFrameViewInternal.h
index 0304617..726b62e 100644
--- a/WebKit/mac/WebView/WebFrameViewInternal.h
+++ b/WebKit/mac/WebView/WebFrameViewInternal.h
@@ -37,14 +37,11 @@
- (void)_setDocumentView:(NSView <WebDocumentView> *)view;
- (NSView <WebDocumentView> *)_makeDocumentViewForDataSource:(WebDataSource *)dataSource;
- (void)_setWebFrame:(WebFrame *)webFrame;
-- (int)_marginWidth;
-- (int)_marginHeight;
-- (void)_setMarginWidth:(int)w;
-- (void)_setMarginHeight:(int)h;
- (float)_verticalPageScrollDistance;
+ (NSMutableDictionary *)_viewTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
+ (Class)_viewClassForMIMEType:(NSString *)MIMEType;
+ (BOOL)_canShowMIMETypeAsHTML:(NSString *)MIMEType;
- (WebDynamicScrollBarsView *)_scrollView;
+- (void)_install;
@end
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 1a25ade..4b4d11e 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -34,7 +34,6 @@
#import "WebBasePluginPackage.h"
#import "WebDataSourceInternal.h"
#import "WebDocumentPrivate.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebKitNSStringExtras.h"
#import "WebKitStatisticsPrivate.h"
@@ -43,22 +42,26 @@
#import "WebResourcePrivate.h"
#import "WebView.h"
#import <Foundation/NSURLResponse.h>
-#import <JavaScriptCore/Assertions.h>
#import <WebCore/Document.h>
#import <WebCore/DocumentLoader.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameLoaderClient.h>
+#import <WebCore/HTMLFormControlElement.h>
+#import <WebCore/HTMLInputElement.h>
+#import <WebCore/HTMLNames.h>
#import <WebCore/MIMETypeRegistry.h>
#import <WebCore/Range.h>
+#import <WebCore/TextResourceDecoder.h>
+#import <WebKit/DOMHTMLInputElement.h>
+#import <wtf/Assertions.h>
using namespace WebCore;
+using namespace HTMLNames;
-@interface WebHTMLRepresentationPrivate : NSObject
-{
+@interface WebHTMLRepresentationPrivate : NSObject {
@public
WebDataSource *dataSource;
- WebFrameBridge *bridge;
- NSData *parsedArchiveData;
BOOL hasSentResponseToPlugin;
id <WebPluginManualLoader> manualLoader;
@@ -67,13 +70,6 @@ using namespace WebCore;
@end
@implementation WebHTMLRepresentationPrivate
-
-- (void)dealloc
-{
- [parsedArchiveData release];
- [super dealloc];
-}
-
@end
@implementation WebHTMLRepresentation
@@ -144,11 +140,6 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
[super finalize];
}
-- (WebFrameBridge *)_bridge
-{
- return _private->bridge;
-}
-
- (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView;
{
_private->manualLoader = manualLoader;
@@ -158,7 +149,6 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)setDataSource:(WebDataSource *)dataSource
{
_private->dataSource = dataSource;
- _private->bridge = [[dataSource webFrame] _bridge];
}
- (BOOL)_isDisplayingWebArchive
@@ -168,9 +158,15 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
{
- if ([dataSource webFrame] && ![self _isDisplayingWebArchive]) {
+ WebFrame *webFrame = [dataSource webFrame];
+ if (webFrame) {
if (!_private->pluginView)
- [_private->bridge receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]];
+ [webFrame _receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]];
+
+ // If the document is a stand-alone media document, now is the right time to cancel the WebKit load
+ Frame* coreFrame = core(webFrame);
+ if (coreFrame->document() && coreFrame->document()->isMediaDocument())
+ coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));
if (_private->pluginView) {
if (!_private->hasSentResponseToPlugin) {
@@ -190,31 +186,6 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
}
}
-- (void)_loadDataSourceAsWebArchive
-{
- WebArchive *archive = [[WebArchive alloc] initWithData:[_private->dataSource data]];
- WebResource *mainResource = [archive mainResource];
- if (!mainResource) {
- [archive release];
- return;
- }
-
- NSData *data = [mainResource data];
- [data retain];
- [_private->parsedArchiveData release];
- _private->parsedArchiveData = data;
-
- [_private->dataSource _addToUnarchiveState:archive];
- [archive release];
-
- WebFrame *webFrame = [_private->dataSource webFrame];
-
- if (!webFrame)
- return;
-
- core(webFrame)->loader()->continueLoadWithData(SharedBuffer::wrapNSData(data).get(), [mainResource MIMEType], [mainResource textEncodingName], [mainResource URL]);
-}
-
- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
{
WebFrame *frame = [dataSource webFrame];
@@ -225,13 +196,12 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
}
if (frame) {
- if ([self _isDisplayingWebArchive])
- [self _loadDataSourceAsWebArchive];
- else
- // Telling the bridge we received some data and passing nil as the data is our
+ if (![self _isDisplayingWebArchive]) {
+ // Telling the frame we received some data and passing nil as the data is our
// way to get work done that is normally done when the first bit of data is
// received, even for the case of a document with no data (like about:blank).
- [_private->bridge receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]];
+ [frame _receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]];
+ }
WebView *webView = [frame webView];
if ([webView isEditable])
@@ -241,20 +211,37 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (BOOL)canProvideDocumentSource
{
- return [_private->bridge canProvideDocumentSource];
+ return [[_private->dataSource webFrame] _canProvideDocumentSource];
}
- (BOOL)canSaveAsWebArchive
{
- return [_private->bridge canSaveAsWebArchive];
+ return [[_private->dataSource webFrame] _canSaveAsWebArchive];
}
- (NSString *)documentSource
{
- if ([self _isDisplayingWebArchive])
- return [[[NSString alloc] initWithData:_private->parsedArchiveData encoding:NSUTF8StringEncoding] autorelease];
+ if ([self _isDisplayingWebArchive]) {
+ SharedBuffer *parsedArchiveData = [_private->dataSource _documentLoader]->parsedArchiveData();
+ NSData *nsData = parsedArchiveData ? parsedArchiveData->createNSData() : nil;
+ NSString *result = [[NSString alloc] initWithData:nsData encoding:NSUTF8StringEncoding];
+ [nsData release];
+ return [result autorelease];
+ }
- return [_private->bridge stringWithData:[_private->dataSource data]];
+ Frame* coreFrame = core([_private->dataSource webFrame]);
+ if (!coreFrame)
+ return nil;
+ Document* document = coreFrame->document();
+ if (!document)
+ return nil;
+ TextResourceDecoder* decoder = document->decoder();
+ if (!decoder)
+ return nil;
+ NSData *data = [_private->dataSource data];
+ if (!data)
+ return nil;
+ return decoder->encoding().decode(reinterpret_cast<const char*>([data bytes]), [data length]);
}
- (NSString *)title
@@ -264,7 +251,7 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (DOMDocument *)DOMDocument
{
- return [[_private->bridge webFrame] DOMDocument];
+ return [[_private->dataSource webFrame] DOMDocument];
}
- (NSAttributedString *)attributedText
@@ -275,48 +262,89 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset
{
- Range range([startNode _node]->document(), [startNode _node], startOffset, [endNode _node], endOffset);
- return [NSAttributedString _web_attributedStringFromRange:&range];
+ return [NSAttributedString _web_attributedStringFromRange:Range::create([startNode _node]->document(), [startNode _node], startOffset, [endNode _node], endOffset).get()];
+}
+
+static HTMLFormElement* formElementFromDOMElement(DOMElement *element)
+{
+ Node* node = [element _node];
+ return node && node->hasTagName(formTag) ? static_cast<HTMLFormElement *>(node) : 0;
}
- (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form
{
- return [_private->bridge elementWithName:name inForm:form];
+ HTMLFormElement* formElement = formElementFromDOMElement(form);
+ if (!formElement)
+ return nil;
+ Vector<HTMLFormControlElement*>& elements = formElement->formElements;
+ AtomicString targetName = name;
+ for (unsigned i = 0; i < elements.size(); i++) {
+ HTMLFormControlElement* elt = elements[i];
+ if (elt->name() == targetName)
+ return kit(elt);
+ }
+ return nil;
+}
+
+static HTMLInputElement* inputElementFromDOMElement(DOMElement* element)
+{
+ Node* node = [element _node];
+ return node && node->hasTagName(inputTag) ? static_cast<HTMLInputElement*>(node) : 0;
}
- (BOOL)elementDoesAutoComplete:(DOMElement *)element
{
- return [_private->bridge elementDoesAutoComplete:element];
+ HTMLInputElement* inputElement = inputElementFromDOMElement(element);
+ return inputElement
+ && inputElement->inputType() == HTMLInputElement::TEXT
+ && inputElement->autoComplete();
}
- (BOOL)elementIsPassword:(DOMElement *)element
{
- return [_private->bridge elementIsPassword:element];
+ HTMLInputElement* inputElement = inputElementFromDOMElement(element);
+ return inputElement
+ && inputElement->inputType() == HTMLInputElement::PASSWORD;
}
- (DOMElement *)formForElement:(DOMElement *)element
{
- return [_private->bridge formForElement:element];
+ HTMLInputElement* inputElement = inputElementFromDOMElement(element);
+ return inputElement ? kit(inputElement->form()) : 0;
}
- (DOMElement *)currentForm
{
- return [_private->bridge currentForm];
+ return kit(core([_private->dataSource webFrame])->currentForm());
}
- (NSArray *)controlsInForm:(DOMElement *)form
{
- return [_private->bridge controlsInForm:form];
+ HTMLFormElement* formElement = formElementFromDOMElement(form);
+ if (!formElement)
+ return nil;
+ NSMutableArray *results = nil;
+ Vector<HTMLFormControlElement*>& elements = formElement->formElements;
+ for (unsigned i = 0; i < elements.size(); i++) {
+ if (elements[i]->isEnumeratable()) { // Skip option elements, other duds
+ DOMElement* de = kit(elements[i]);
+ if (!results)
+ results = [NSMutableArray arrayWithObject:de];
+ else
+ [results addObject:de];
+ }
+ }
+ return results;
}
- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element
{
- return [_private->bridge searchForLabels:labels beforeElement:element];
+ return core([_private->dataSource webFrame])->searchForLabelsBeforeElement(labels, core(element));
}
- (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element
{
- return [_private->bridge matchLabels:labels againstElement:element];
+ return core([_private->dataSource webFrame])->matchLabelsAgainstElement(labels, core(element));
}
@end
diff --git a/WebKit/mac/Misc/WebSearchableTextView.h b/WebKit/mac/WebView/WebHTMLRepresentationInternal.h
index fda38ee..d42b400 100644
--- a/WebKit/mac/Misc/WebSearchableTextView.h
+++ b/WebKit/mac/WebView/WebHTMLRepresentationInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 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
@@ -26,7 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebDocumentPrivate.h>
+#import <WebKit/WebHTMLRepresentationPrivate.h>
-@interface WebSearchableTextView : NSTextView <WebDocumentSearching, WebDocumentSelection>
+@interface WebHTMLRepresentation (WebInternal)
++ (NSArray *)supportedNonImageMIMETypes;
@end
diff --git a/WebKit/mac/WebView/WebHTMLRepresentationPrivate.h b/WebKit/mac/WebView/WebHTMLRepresentationPrivate.h
index 3737bb2..d0c18ab 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentationPrivate.h
+++ b/WebKit/mac/WebView/WebHTMLRepresentationPrivate.h
@@ -28,11 +28,9 @@
#import <WebKit/WebHTMLRepresentation.h>
-@class WebFrameBridge;
@protocol WebPluginManualLoader;
@interface WebHTMLRepresentation (WebPrivate)
-- (WebFrameBridge *)_bridge;
- (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView;
- (void)printDOMTree;
@end
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index 987d7df..4d9b3a8 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* (C) 2006, 2007 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
@@ -32,8 +32,7 @@
#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
#import "WebArchive.h"
-#import "WebArchiver.h"
-#import "WebBaseNetscapePluginViewInternal.h"
+#import "WebBaseNetscapePluginView.h"
#import "WebClipView.h"
#import "WebDOMOperationsPrivate.h"
#import "WebDataSourceInternal.h"
@@ -42,7 +41,6 @@
#import "WebDynamicScrollBarsView.h"
#import "WebEditingDelegate.h"
#import "WebElementDictionary.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebFramePrivate.h"
#import "WebFrameViewInternal.h"
@@ -53,6 +51,7 @@
#import "WebKitPluginContainerView.h"
#import "WebKitVersionChecks.h"
#import "WebLocalizableStrings.h"
+#import "WebNodeHighlight.h"
#import "WebNSAttributedStringExtras.h"
#import "WebNSEventExtras.h"
#import "WebNSFileManagerExtras.h"
@@ -62,12 +61,12 @@
#import "WebNSPrintOperationExtras.h"
#import "WebNSURLExtras.h"
#import "WebNSViewExtras.h"
-#import "WebNetscapePluginEmbeddedView.h"
#import "WebPluginController.h"
#import "WebPreferences.h"
#import "WebPreferencesPrivate.h"
#import "WebResourcePrivate.h"
#import "WebStringTruncator.h"
+#import "WebTypesInternal.h"
#import "WebUIDelegatePrivate.h"
#import "WebViewInternal.h"
#import <AppKit/NSAccessibility.h>
@@ -79,11 +78,11 @@
#import <WebCore/ContextMenu.h>
#import <WebCore/ContextMenuController.h>
#import <WebCore/Document.h>
+#import <WebCore/DocumentFragment.h>
#import <WebCore/Editor.h>
#import <WebCore/EditorDeleteAction.h>
#import <WebCore/Element.h>
#import <WebCore/EventHandler.h>
-#import <WebCore/EventNames.h>
#import <WebCore/ExceptionHandlers.h>
#import <WebCore/DragController.h>
#import <WebCore/FloatRect.h>
@@ -95,6 +94,7 @@
#import <WebCore/HTMLNames.h>
#import <WebCore/Image.h>
#import <WebCore/KeyboardEvent.h>
+#import <WebCore/LegacyWebArchive.h>
#import <WebCore/MIMETypeRegistry.h>
#import <WebCore/Page.h>
#import <WebCore/PlatformKeyboardEvent.h>
@@ -102,13 +102,16 @@
#import <WebCore/Range.h>
#import <WebCore/SelectionController.h>
#import <WebCore/SharedBuffer.h>
+#import <WebCore/SimpleFontData.h>
#import <WebCore/Text.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebCore/WebCoreTextRenderer.h>
+#import <WebCore/markup.h>
#import <WebKit/DOM.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMPrivate.h>
#import <WebKitSystemInterface.h>
+#import <limits>
using namespace WebCore;
using namespace HTMLNames;
@@ -174,35 +177,35 @@ extern "C" {
// Need to declare these attribute names because AppKit exports them but does not make them available in API or SPI headers.
-extern NSString *NSMarkedClauseSegmentAttributeName;
-extern NSString *NSTextInputReplacementRangeAttributeName;
-
+extern NSString *NSMarkedClauseSegmentAttributeName;
+extern NSString *NSTextInputReplacementRangeAttributeName;
}
-@interface NSView (AppKitSecretsIKnowAbout)
+@interface NSView (WebNSViewDetails)
- (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView;
- (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect;
+- (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView;
- (NSRect)_dirtyRect;
- (void)_setDrawsOwnDescendants:(BOOL)drawsOwnDescendants;
- (void)_propagateDirtyRectsToOpaqueAncestors;
- (void)_windowChangedKeyState;
@end
-@interface NSApplication (AppKitSecretsIKnowAbout)
+@interface NSApplication (WebNSApplicationDetails)
- (void)speakString:(NSString *)string;
@end
-@interface NSWindow (AppKitSecretsIKnowAbout)
+@interface NSWindow (WebNSWindowDetails)
- (id)_newFirstResponderAfterResigning;
- (void)_setForceActiveControls:(BOOL)flag;
@end
-@interface NSAttributedString (AppKitSecretsIKnowAbout)
-- (id)_initWithDOMRange:(DOMRange *)domRange;
+@interface NSAttributedString (WebNSAttributedStringDetails)
+- (id)_initWithDOMRange:(DOMRange *)range;
- (DOMDocumentFragment *)_documentFromRange:(NSRange)range document:(DOMDocument *)document documentAttributes:(NSDictionary *)dict subresources:(NSArray **)subresources;
@end
-@interface NSSpellChecker (CurrentlyPrivateForTextView)
+@interface NSSpellChecker (WebNSSpellCheckerDetails)
- (void)learnWord:(NSString *)word;
@end
@@ -250,8 +253,8 @@ extern NSString *NSTextInputReplacementRangeAttributeName;
#define WebSmartPastePboardType @"NeXT smart paste pasteboard type"
#define STANDARD_WEIGHT 5
-#define MIN_BOLD_WEIGHT 9
-#define STANDARD_BOLD_WEIGHT 10
+#define MIN_BOLD_WEIGHT 7
+#define STANDARD_BOLD_WEIGHT 9
// Fake URL scheme.
#define WebDataProtocolScheme @"webkit-fake-url"
@@ -279,9 +282,6 @@ static CachedResourceClient* promisedDataClient()
return staticCachedResourceClient;
}
-@interface WebHTMLView (WebTextSizing) <_WebDocumentTextSizing>
-@end
-
@interface WebHTMLView (WebHTMLViewFileInternal)
- (BOOL)_imageExistsAtPaths:(NSArray *)paths;
- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard inContext:(DOMRange *)context allowPlainText:(BOOL)allowPlainText;
@@ -292,13 +292,11 @@ static CachedResourceClient* promisedDataClient()
- (BOOL)_shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action;
- (BOOL)_shouldReplaceSelectionWithText:(NSString *)text givenAction:(WebViewInsertAction)action;
- (float)_calculatePrintHeight;
-- (void)_updateTextSizeMultiplier;
- (DOMRange *)_selectedRange;
- (BOOL)_shouldDeleteRange:(DOMRange *)range;
- (NSView *)_hitViewForEvent:(NSEvent *)event;
- (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard cachedAttributedString:(NSAttributedString *)attributedString;
- (DOMRange *)_documentRange;
-- (WebFrameBridge *)_bridge;
- (void)_setMouseDownEvent:(NSEvent *)event;
- (WebHTMLView *)_topHTMLView;
- (BOOL)_isTopHTMLView;
@@ -311,9 +309,14 @@ static CachedResourceClient* promisedDataClient()
- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize;
@end
-@class NSInputContext;
-@interface NSResponder (IMSecretsIKnowAbout)
-- (NSInputContext *)inputContext;
+@class NSTextInputContext;
+@interface NSResponder (AppKitDetails)
+- (NSTextInputContext *)inputContext;
+@end
+
+@interface NSObject (NSTextInputContextDetails)
+- (BOOL)wantsToHandleMouseEvents;
+- (BOOL)handleMouseEvent:(NSEvent *)event;
@end
@interface WebHTMLView (WebNSTextInputSupport) <NSTextInput>
@@ -334,7 +337,7 @@ static CachedResourceClient* promisedDataClient()
@end
// Handles the complete: text command
-@interface WebTextCompleteController : NSObject {
+@interface WebTextCompleteController : NSObject <NSTableViewDelegate, NSTableViewDataSource> {
@private
WebHTMLView *_view;
NSWindow *_popupWindow;
@@ -360,6 +363,65 @@ struct WebHTMLViewInterpretKeyEventsParameters {
BOOL consumedByIM;
};
+@interface WebHTMLViewPrivate : NSObject {
+@public
+ BOOL closed;
+ BOOL needsLayout;
+ BOOL needsToApplyStyles;
+ BOOL ignoringMouseDraggedEvents;
+ BOOL printing;
+ BOOL avoidingPrintOrphan;
+
+ id savedSubviews;
+ BOOL subviewsSetAside;
+
+ NSEvent *mouseDownEvent; // Kept after handling the event.
+ BOOL handlingMouseDownEvent;
+ NSEvent *keyDownEvent; // Kept after handling the event.
+
+ NSSize lastLayoutSize;
+
+ NSPoint lastScrollPosition;
+
+ WebPluginController *pluginController;
+
+ NSString *toolTip;
+ NSToolTipTag lastToolTipTag;
+ id trackingRectOwner;
+ void *trackingRectUserData;
+
+ NSTimer *autoscrollTimer;
+ NSEvent *autoscrollTriggerEvent;
+
+ NSArray* pageRects;
+
+ NSMutableDictionary* highlighters;
+
+ BOOL resigningFirstResponder;
+ BOOL nextResponderDisabledOnce;
+
+ WebTextCompleteController *compController;
+
+ BOOL transparentBackground;
+
+ WebHTMLViewInterpretKeyEventsParameters *interpretKeyEventsParameters;
+ BOOL receivedNOOP;
+
+ WebDataSource *dataSource;
+ WebCore::CachedImage *promisedDragTIFFDataSource;
+
+ CFRunLoopTimerRef updateFocusedAndActiveStateTimer;
+ CFRunLoopTimerRef updateMouseoverTimer;
+
+ SEL selectorForDoCommandBySelector;
+
+#ifndef NDEBUG
+ BOOL enumeratingSubviews;
+#endif
+}
+- (void)clear;
+@end
+
static NSCellStateValue kit(TriState state)
{
switch (state) {
@@ -407,6 +469,9 @@ static NSCellStateValue kit(TriState state)
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebHTMLViewPrivate class], self))
+ return;
+
ASSERT(!autoscrollTimer);
ASSERT(!autoscrollTriggerEvent);
ASSERT(!updateFocusedAndActiveStateTimer);
@@ -420,7 +485,7 @@ static NSCellStateValue kit(TriState state)
[dataSource release];
[highlighters release];
if (promisedDragTIFFDataSource)
- promisedDragTIFFDataSource->deref(promisedDataClient());
+ promisedDragTIFFDataSource->removeClient(promisedDataClient());
[super dealloc];
}
@@ -430,7 +495,7 @@ static NSCellStateValue kit(TriState state)
ASSERT_MAIN_THREAD();
if (promisedDragTIFFDataSource)
- promisedDragTIFFDataSource->deref(promisedDataClient());
+ promisedDragTIFFDataSource->removeClient(promisedDataClient());
[super finalize];
}
@@ -445,7 +510,7 @@ static NSCellStateValue kit(TriState state)
[dataSource release];
[highlighters release];
if (promisedDragTIFFDataSource)
- promisedDragTIFFDataSource->deref(promisedDataClient());
+ promisedDragTIFFDataSource->removeClient(promisedDataClient());
mouseDownEvent = nil;
keyDownEvent = nil;
@@ -485,11 +550,6 @@ static NSCellStateValue kit(TriState state)
return _private->dataSource;
}
-- (WebFrameBridge *)_bridge
-{
- return [_private->dataSource _bridge];
-}
-
- (WebView *)_webView
{
return [_private->dataSource _webView];
@@ -514,7 +574,7 @@ static NSCellStateValue kit(TriState state)
[domNodes addObject:[[[self _frame] DOMDocument] createTextNode: url]];
}
- fragment = [[self _bridge] documentFragmentWithNodesAsParagraphs:domNodes];
+ fragment = [[self _frame] _documentFragmentWithNodesAsParagraphs:domNodes];
[domNodes release];
@@ -607,7 +667,16 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
inContext:context
subresources:0]))
return fragment;
-
+
+ // Only 10.5 and higher support setting and retrieving pasteboard types with UTIs, but we don't believe
+ // that any applications on Tiger put types for which we only have a UTI, like PNG, on the pasteboard.
+ if ([types containsObject:(NSString*)kUTTypePNG] &&
+ (fragment = [self _documentFragmentFromPasteboard:pasteboard
+ forType:(NSString*)kUTTypePNG
+ inContext:context
+ subresources:0]))
+ return fragment;
+
if ([types containsObject:NSURLPboardType] &&
(fragment = [self _documentFragmentFromPasteboard:pasteboard
forType:NSURLPboardType
@@ -668,9 +737,9 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
DOMRange *range = [self _selectedRange];
DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard
inContext:range allowPlainText:allowPlainText];
- WebFrameBridge *bridge = [self _bridge];
+ WebFrame *frame = [self _frame];
if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:[self _selectedRange] givenAction:WebViewInsertActionPasted]) {
- [bridge replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO];
+ [frame _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO];
}
}
@@ -678,7 +747,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
{
NSString *text = [self _plainTextFromPasteboard:pasteboard];
if ([self _shouldReplaceSelectionWithText:text givenAction:WebViewInsertActionPasted])
- [[self _bridge] replaceSelectionWithText:text selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard]];
+ [[self _frame] _replaceSelectionWithText:text selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard]];
}
- (BOOL)_shouldInsertFragment:(DOMDocumentFragment *)fragment replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action
@@ -712,15 +781,10 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
return paperSize.height - [pi topMargin] - [pi bottomMargin];
}
-- (void)_updateTextSizeMultiplier
-{
- [[self _bridge] setTextSizeMultiplier:[[self _webView] textSizeMultiplier]];
-}
-
- (DOMRange *)_selectedRange
{
Frame* coreFrame = core([self _frame]);
- return coreFrame ? kit(coreFrame->selectionController()->toRange().get()) : nil;
+ return coreFrame ? kit(coreFrame->selection()->toRange().get()) : nil;
}
- (BOOL)_shouldDeleteRange:(DOMRange *)range
@@ -743,8 +807,10 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
{
// Put HTML on the pasteboard.
if ([types containsObject:WebArchivePboardType]) {
- WebArchive *archive = [WebArchiver archiveSelectionInFrame:[self _frame]];
- [pasteboard setData:[archive data] forType:WebArchivePboardType];
+ if (RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::createFromSelection(core([self _frame]))) {
+ if (RetainPtr<CFDataRef> data = coreArchive ? coreArchive->rawDataRepresentation() : 0)
+ [pasteboard setData:(NSData *)data.get() forType:WebArchivePboardType];
+ }
}
// Put the attributed string on the pasteboard (RTF/RTFD format).
@@ -984,7 +1050,8 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
NSPoint origin = [[self superview] bounds].origin;
if (!NSEqualPoints(_private->lastScrollPosition, origin)) {
- [[self _bridge] sendScrollEvent];
+ if (Frame* coreFrame = core([self _frame]))
+ coreFrame->sendScrollEvent();
[_private->compController endRevertingChange:NO moveLeft:NO];
WebView *webView = [self _webView];
@@ -1072,12 +1139,15 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
// If the WebHTMLView itself is what we're printing, then we will never have to do this.
BOOL wasInPrintingMode = _private->printing;
BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen];
- if (wasInPrintingMode != isPrinting) {
- if (isPrinting)
+ if (isPrinting) {
+ if (!wasInPrintingMode)
[self _web_setPrintingModeRecursive];
+#ifndef BUILDING_ON_TIGER
else
- [self _web_clearPrintingModeRecursive];
- }
+ [self _web_layoutIfNeededRecursive];
+#endif
+ } else if (wasInPrintingMode)
+ [self _web_clearPrintingModeRecursive];
#ifdef BUILDING_ON_TIGER
@@ -1110,12 +1180,15 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
if (needToSetAsideSubviews) {
// This helps when we print as part of a larger print process.
// If the WebHTMLView itself is what we're printing, then we will never have to do this.
- if (wasInPrintingMode != isPrinting) {
- if (isPrinting)
+ if (isPrinting) {
+ if (!wasInPrintingMode)
[self _web_setPrintingModeRecursive];
+#ifndef BUILDING_ON_TIGER
else
- [self _web_clearPrintingModeRecursive];
- }
+ [self _web_layoutIfNeededRecursive];
+#endif
+ } else if (wasInPrintingMode)
+ [self _web_clearPrintingModeRecursive];
#ifdef BUILDING_ON_TIGER
@@ -1150,6 +1223,19 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
}
}
+// Don't let AppKit even draw subviews. We take care of that.
+- (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView
+{
+#ifdef BUILDING_ON_TIGER
+ // Because Tiger does not have viewWillDraw we need to do layout here.
+ [self _web_layoutIfNeededRecursive];
+#endif
+
+ [self _setAsideSubviews];
+ [super _recursive:recurse displayRectIgnoringOpacity:displayRect inContext:context topView:topView];
+ [self _restoreSubviews];
+}
+
- (BOOL)_insideAnotherHTMLView
{
return self != [self _topHTMLView];
@@ -1380,7 +1466,8 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
if (!types) {
types = [[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType,
NSFilenamesPboardType, NSTIFFPboardType, NSPICTPboardType, NSURLPboardType,
- NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, nil];
+ NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType,
+ kUTTypePNG, nil];
CFRetain(types);
}
return types;
@@ -1522,7 +1609,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
return;
}
- [[self _bridge] smartInsertForString:pasteString replacingRange:rangeToReplace beforeString:beforeString afterString:afterString];
+ [[self _frame] _smartInsertForString:pasteString replacingRange:rangeToReplace beforeString:beforeString afterString:afterString];
}
- (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard
@@ -1596,25 +1683,25 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
- (BOOL)_hasSelection
{
Frame* coreFrame = core([self _frame]);
- return coreFrame && coreFrame->selectionController()->isRange();
+ return coreFrame && coreFrame->selection()->isRange();
}
- (BOOL)_hasSelectionOrInsertionPoint
{
Frame* coreFrame = core([self _frame]);
- return coreFrame && coreFrame->selectionController()->isCaretOrRange();
+ return coreFrame && coreFrame->selection()->isCaretOrRange();
}
- (BOOL)_hasInsertionPoint
{
Frame* coreFrame = core([self _frame]);
- return coreFrame && coreFrame->selectionController()->isCaret();
+ return coreFrame && coreFrame->selection()->isCaret();
}
- (BOOL)_isEditable
{
Frame* coreFrame = core([self _frame]);
- return coreFrame && coreFrame->selectionController()->isContentEditable();
+ return coreFrame && coreFrame->selection()->isContentEditable();
}
- (BOOL)_transparentBackground
@@ -1708,38 +1795,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
{
[self _cancelUpdateFocusedAndActiveStateTimer];
- // This method does the job of updating the view based on the view's firstResponder-ness and
- // the window key-ness of the window containing this view. This involves four kinds of
- // drawing updates right now.
- //
- // The four display attributes are as follows:
- //
- // 1. The background color used to draw behind selected content (active | inactive color)
- // 2. Caret blinking (blinks | does not blink)
- // 3. The drawing of a focus ring around links in web pages.
- //
- // Also, this is responsible for letting the bridge know if the window has gained or lost focus
- // so we can send focus and blur events.
-
- Frame* frame = core([self _frame]);
- if (!frame)
- return;
-
- Page* page = frame->page();
- if (!page)
- return;
-
- NSWindow *window = [self window];
- BOOL windowIsKey = [window isKeyWindow];
- BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow];
-
- // FIXME: this can move to WebView since active state is Page level, not Frame level.
- NSResponder *firstResponder = [window firstResponder];
- if (firstResponder == self || firstResponder == [self _frameView])
- page->focusController()->setActive(!_private->resigningFirstResponder && windowIsKey);
-
- Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
- frame->selectionController()->setFocused(frame == focusedFrame && windowOrSheetIsKey);
+ [[self _webView] _updateFocusedAndActiveStateForFrame:[self _frame]];
}
- (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard
@@ -1767,6 +1823,9 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
// 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;
+
+ _private->closed = YES;
+
[self _cancelUpdateMouseoverTimer];
[self _cancelUpdateFocusedAndActiveStateTimer];
[self _clearLastHitViewIfSelf];
@@ -1777,7 +1836,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
// remove tooltips before clearing _private so removeTrackingRect: will work correctly
[self removeAllToolTips];
[_private clear];
- _private->closed = YES;
+
Page* page = core([self _webView]);
if (page)
page->dragController()->setDraggingImageURL(KURL());
@@ -1819,7 +1878,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
if ([HTMLString length] == 0)
return nil;
- return [[self _bridge] documentFragmentWithMarkupString:HTMLString baseURLString:nil];
+ return [[self _frame] _documentFragmentWithMarkupString:HTMLString baseURLString:nil];
}
// The _hasHTMLDocument clause here is a workaround for a bug in NSAttributedString: Radar 5052369.
@@ -1882,6 +1941,18 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
[resource release];
return fragment;
}
+ // Only 10.5 and higher support setting and retrieving pasteboard types with UTIs, but we don't believe
+ // that any applications on Tiger put types for which we only have a UTI, like PNG, on the pasteboard.
+ if ([pboardType isEqualToString:(NSString*)kUTTypePNG]) {
+ WebResource *resource = [[WebResource alloc] initWithData:[pasteboard dataForType:(NSString*)kUTTypePNG]
+ URL:uniqueURLWithRelativePart(@"image.png")
+ MIMEType:@"image/png"
+ textEncodingName:nil
+ frameName:nil];
+ DOMDocumentFragment *fragment = [[self _dataSource] _documentFragmentWithImageResource:resource];
+ [resource release];
+ return fragment;
+ }
if (pboardType == NSURLPboardType) {
NSURL *URL = [NSURL URLFromPasteboard:pasteboard];
DOMDocument* document = [[self _frame] DOMDocument];
@@ -1901,12 +1972,40 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
return fragment;
}
if (pboardType == NSStringPboardType)
- return [[self _bridge] documentFragmentWithText:[pasteboard stringForType:NSStringPboardType]
- inContext:context];
-
+ return kit(createFragmentFromText(core(context), [pasteboard stringForType:NSStringPboardType]).get());
return nil;
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
+- (void)_pauseNullEventsForAllNetscapePlugins
+{
+ NSArray *subviews = [self subviews];
+ unsigned int subviewCount = [subviews count];
+ unsigned int subviewIndex;
+
+ for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) {
+ NSView *subview = [subviews objectAtIndex:subviewIndex];
+ if ([subview isKindOfClass:[WebBaseNetscapePluginView class]])
+ [(WebBaseNetscapePluginView *)subview stopTimers];
+ }
+}
+#endif
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+- (void)_resumeNullEventsForAllNetscapePlugins
+{
+ NSArray *subviews = [self subviews];
+ unsigned int subviewCount = [subviews count];
+ unsigned int subviewIndex;
+
+ for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) {
+ NSView *subview = [subviews objectAtIndex:subviewIndex];
+ if ([subview isKindOfClass:[WebBaseNetscapePluginView class]])
+ [(WebBaseNetscapePluginView *)subview restartTimers];
+ }
+}
+#endif
+
@end
@implementation NSView (WebHTMLViewFileInternal)
@@ -1998,6 +2097,9 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebHTMLView class], self))
+ return;
+
// We can't assert that close has already been called because
// this view can be removed from it's superview, even though
// it could be needed later, so close if needed.
@@ -2108,6 +2210,7 @@ WEBCORE_COMMAND(deleteToEndOfParagraph)
WEBCORE_COMMAND(deleteToMark)
WEBCORE_COMMAND(deleteWordBackward)
WEBCORE_COMMAND(deleteWordForward)
+WEBCORE_COMMAND(ignoreSpelling)
WEBCORE_COMMAND(indent)
WEBCORE_COMMAND(insertBacktab)
WEBCORE_COMMAND(insertLineBreak)
@@ -2203,7 +2306,7 @@ WEBCORE_COMMAND(yankAndSelect)
Frame* coreFrame = core([self _frame]);
if (!coreFrame)
return NO;
- if (coreFrame->selectionController()->isContentRichlyEditable())
+ if (coreFrame->selection()->isContentRichlyEditable())
[self _pasteWithPasteboard:pasteboard allowPlainText:YES];
else
[self _pasteAsPlainTextWithPasteboard:pasteboard];
@@ -2272,7 +2375,9 @@ WEBCORE_COMMAND(yankAndSelect)
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
BOOL panelShowing = [[[NSSpellChecker sharedSpellChecker] spellingPanel] isVisible];
- [menuItem setTitle:panelShowing ? UI_STRING("Hide Spelling and Grammar", "menu item title") : UI_STRING("Show Spelling and Grammar", "menu item title")];
+ [menuItem setTitle:panelShowing
+ ? UI_STRING("Hide Spelling and Grammar", "menu item title")
+ : UI_STRING("Show Spelling and Grammar", "menu item title")];
}
#endif
return [self _canEdit];
@@ -2284,7 +2389,7 @@ WEBCORE_COMMAND(yankAndSelect)
return NO;
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
- RefPtr<CSSStyleDeclaration> style = new CSSMutableStyleDeclaration;
+ RefPtr<CSSStyleDeclaration> style = CSSMutableStyleDeclaration::create();
ExceptionCode ec;
style->setProperty("direction", writingDirection == NSWritingDirectionLeftToRight ? "LTR" : "RTL", ec);
[menuItem setState:frame->editor()->selectionHasStyle(style.get())];
@@ -2295,11 +2400,11 @@ WEBCORE_COMMAND(yankAndSelect)
if (action == @selector(toggleBaseWritingDirection:)) {
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
- RefPtr<CSSStyleDeclaration> style = new CSSMutableStyleDeclaration;
+ RefPtr<CSSStyleDeclaration> style = CSSMutableStyleDeclaration::create();
ExceptionCode ec;
style->setProperty("direction", "RTL", ec);
- // Take control of the title of the menu item, instead of just checking/unchecking it because otherwise
- // we don't know what the check would mean.
+ // Take control of the title of the menu item instead of just checking/unchecking it because
+ // a check would be ambiguous.
[menuItem setTitle:frame->editor()->selectionHasStyle(style.get())
? UI_STRING("Left to Right", "Left to Right context menu item")
: UI_STRING("Right to Left", "Right to Left context menu item")];
@@ -2335,7 +2440,7 @@ WEBCORE_COMMAND(yankAndSelect)
if (action == @selector(pasteAsRichText:))
return frame && (frame->editor()->canDHTMLPaste()
- || (frame->editor()->canPaste() && frame->selectionController()->isContentRichlyEditable()));
+ || (frame->editor()->canPaste() && frame->selection()->isContentRichlyEditable()));
if (action == @selector(performFindPanelAction:))
return NO;
@@ -2368,6 +2473,10 @@ WEBCORE_COMMAND(yankAndSelect)
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
+ // This can be called during teardown when _webView is nil. Return NO when this happens, because CallUIDelegateReturningBoolean
+ // assumes the WebVIew is non-nil.
+ if (![self _webView])
+ return NO;
BOOL result = [self validateUserInterfaceItemWithoutDelegate:item];
return CallUIDelegateReturningBoolean(result, [self _webView], @selector(webView:validateUserInterfaceItem:defaultValidation:), item, result);
}
@@ -2418,7 +2527,7 @@ WEBCORE_COMMAND(yankAndSelect)
return YES;
Frame* coreFrame = core([self _frame]);
- bool selectionIsEditable = coreFrame && coreFrame->selectionController()->isContentEditable();
+ bool selectionIsEditable = coreFrame && coreFrame->selection()->isContentEditable();
bool nextResponderIsInWebView = [nextResponder isKindOfClass:[NSView class]]
&& [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]];
@@ -2431,7 +2540,11 @@ WEBCORE_COMMAND(yankAndSelect)
return;
// Unless the Dashboard asks us to do this for all windows, keep an observer going only for the key window.
- if (!([[self window] isKeyWindow] || [[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows]))
+ if (!([[self window] isKeyWindow]
+#if ENABLE(DASHBOARD_SUPPORT)
+ || [[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows]
+#endif
+ ))
return;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mouseMovedNotification:)
@@ -2447,9 +2560,11 @@ WEBCORE_COMMAND(yankAndSelect)
- (void)removeMouseMovedObserver
{
+#if ENABLE(DASHBOARD_SUPPORT)
// Don't remove the observer if we're running the Dashboard.
if ([[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows])
return;
+#endif
[[self _webView] _mouseDidMoveOverElement:nil modifierFlags:0];
[self removeMouseMovedObserverUnconditionally];
@@ -2502,6 +2617,8 @@ WEBCORE_COMMAND(yankAndSelect)
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];
}
}
@@ -2515,6 +2632,8 @@ WEBCORE_COMMAND(yankAndSelect)
name:NSWindowDidResignKeyNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NSWindowWillCloseNotification object:window];
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:WKWindowWillOrderOnScreenNotification() object:window];
}
}
@@ -2525,12 +2644,8 @@ WEBCORE_COMMAND(yankAndSelect)
- (void)viewDidMoveToSuperview
{
- // Do this here in case the text size multiplier changed when a non-HTML
- // view was installed.
- if ([self superview] != nil) {
- [self _updateTextSizeMultiplier];
+ if ([self superview] != nil)
[self addSuperviewObservers];
- }
}
static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, void *info)
@@ -2622,18 +2737,21 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
- (void)reapplyStyles
{
- if (!_private->needsToApplyStyles) {
+ if (!_private->needsToApplyStyles)
return;
- }
-#ifdef _KWQ_TIMING
+#ifdef LOG_TIMES
double start = CFAbsoluteTimeGetCurrent();
#endif
- [[self _bridge] reapplyStylesForDeviceType:
- _private->printing ? WebCoreDevicePrinter : WebCoreDeviceScreen];
+ Frame* coreFrame = core([self _frame]);
+ if (FrameView* coreView = coreFrame->view())
+ coreView->setMediaType(_private->printing ? "print" : "screen");
+ if (Document* document = coreFrame->document())
+ document->setPrinting(_private->printing);
+ coreFrame->reapplyStyles();
-#ifdef _KWQ_TIMING
+#ifdef LOG_TIMES
double thisTime = CFAbsoluteTimeGetCurrent() - start;
LOG(Timing, "%s apply style seconds = %f", [self URL], thisTime);
#endif
@@ -2647,26 +2765,34 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
{
[self reapplyStyles];
- if (!_private->needsLayout && ![[self _bridge] needsLayout])
+ if (!_private->needsLayout && ![[self _frame] _needsLayout])
return;
-#ifdef _KWQ_TIMING
+#ifdef LOG_TIMES
double start = CFAbsoluteTimeGetCurrent();
#endif
LOG(View, "%@ doing layout", self);
- if (minPageWidth > 0.0) {
- [[self _bridge] forceLayoutWithMinimumPageWidth:minPageWidth maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize];
- } else {
- [[self _bridge] forceLayoutAdjustingViewSize:adjustViewSize];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame) {
+ _private->needsLayout = NO;
+ return;
+ }
+
+ if (minPageWidth > 0.0)
+ coreFrame->forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth, adjustViewSize);
+ else {
+ coreFrame->forceLayout(!adjustViewSize);
+ if (adjustViewSize)
+ coreFrame->view()->adjustViewSize();
}
_private->needsLayout = NO;
if (!_private->printing)
_private->lastLayoutSize = [(NSClipView *)[self superview] documentVisibleRect].size;
-#ifdef _KWQ_TIMING
+#ifdef LOG_TIMES
double thisTime = CFAbsoluteTimeGetCurrent() - start;
LOG(Timing, "%s layout seconds = %f", [self URL], thisTime);
#endif
@@ -2677,6 +2803,14 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
[self layoutToMinimumPageWidth:0.0f maximumPageWidth:0.0f adjustingViewSize:NO];
}
+// Deliver mouseup events to the DOM for button 2.
+- (void)rightMouseUp:(NSEvent *)event
+{
+ [super rightMouseUp:event];
+ if (Frame* coreframe = core([self _frame]))
+ coreframe->eventHandler()->mouseUp(event);
+}
+
- (NSMenu *)menuForEvent:(NSEvent *)event
{
[_private->compController endRevertingChange:NO moveLeft:NO];
@@ -2773,16 +2907,19 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
NSRectFill (rect);
}
- [[self _bridge] drawRect:rect];
+ [[self _frame] _drawRect:rect contentsOnly:YES];
+
+ WebView *webView = [self _webView];
// This hack is needed for <rdar://problem/5023545>. We can hit a race condition where drawRect will be
// called after the WebView has closed. If the client did not properly close the WebView and set the
// UIDelegate to nil, then the UIDelegate will be stale and this code will crash.
static BOOL version3OrLaterClient = WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_QUICKBOOKS_QUIRK);
- if (version3OrLaterClient) {
- WebView *webView = [self _webView];
+ if (version3OrLaterClient)
[[webView _UIDelegateForwarder] webView:webView didDrawRect:[webView convertRect:rect fromView:self]];
- }
+
+ if (WebNodeHighlight *currentHighlight = [webView currentNodeHighlight])
+ [currentHighlight setNeedsUpdateInTargetViewRect:[self convertRect:rect toView:[currentHighlight targetView]]];
[(WebClipView *)[self superview] resetAdditionalClip];
@@ -2808,37 +2945,17 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
if (subviewsWereSetAside)
[self _restoreSubviews];
-#ifdef _KWQ_TIMING
+#ifdef LOG_TIMES
double start = CFAbsoluteTimeGetCurrent();
#endif
- // If count == 0 here, use the rect passed in for drawing. This is a workaround for:
- // <rdar://problem/3908282> REGRESSION (Mail): No drag image dragging selected text in Blot and Mail
- // The reason for the workaround is that this method is called explicitly from the code
- // to generate a drag image, and at that time, getRectsBeingDrawn:count: will return a zero count.
- const int cRectThreshold = 10;
- const float cWastedSpaceThreshold = 0.75f;
- BOOL useUnionedRect = (count <= 1) || (count > cRectThreshold);
- if (!useUnionedRect) {
- // Attempt to guess whether or not we should use the unioned rect or the individual rects.
- // We do this by computing the percentage of "wasted space" in the union. If that wasted space
- // is too large, then we will do individual rect painting instead.
- float unionPixels = (rect.size.width * rect.size.height);
- float singlePixels = 0;
- for (int i = 0; i < count; ++i)
- singlePixels += rects[i].size.width * rects[i].size.height;
- float wastedSpace = 1 - (singlePixels / unionPixels);
- if (wastedSpace <= cWastedSpaceThreshold)
- useUnionedRect = YES;
- }
-
- if (useUnionedRect)
+ if ([[self _webView] _mustDrawUnionedRect:rect singleRects:rects count:count])
[self drawSingleRect:rect];
else
for (int i = 0; i < count; ++i)
[self drawSingleRect:rects[i]];
-#ifdef _KWQ_TIMING
+#ifdef LOG_TIMES
double thisTime = CFAbsoluteTimeGetCurrent() - start;
LOG(Timing, "%s draw seconds = %f", widget->part()->baseURL().URL().latin1(), thisTime);
#endif
@@ -2902,6 +3019,12 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
[[self _pluginController] destroyAllPlugins];
}
+- (void)windowWillOrderOnScreen:(NSNotification *)notification
+{
+ if (![[self _webView] shouldUpdateWhileOffscreen])
+ [self setNeedsDisplay:YES];
+}
+
- (void)scrollWheel:(NSEvent *)event
{
[self retain];
@@ -2922,8 +3045,10 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
NSView *hitView = [self _hitViewForEvent:event];
WebHTMLView *hitHTMLView = [hitView isKindOfClass:[self class]] ? (WebHTMLView *)hitView : nil;
+#if ENABLE(DASHBOARD_SUPPORT)
if ([[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysAcceptsFirstMouse])
return YES;
+#endif
if (hitHTMLView) {
bool result = false;
@@ -3045,7 +3170,7 @@ done:
NSPoint windowMouseLoc = NSMakePoint(windowImageLoc.x + dragController->dragOffset().x(), windowImageLoc.y + dragController->dragOffset().y());
}
- [[self _bridge] dragSourceMovedTo:windowMouseLoc];
+ [[self _frame] _dragSourceMovedTo:windowMouseLoc];
}
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
@@ -3061,7 +3186,7 @@ done:
dragController->dragEnded();
}
- [[self _bridge] dragSourceEndedAt:windowMouseLoc operation:operation];
+ [[self _frame] _dragSourceEndedAt:windowMouseLoc operation:operation];
// Prevent queued mouseDragged events from coming after the drag and fake mouseUp event.
_private->ignoringMouseDraggedEvents = YES;
@@ -3108,9 +3233,9 @@ noPromisedData:
if (!page)
return nil;
- KURL imageURL = page->dragController()->draggingImageURL();
+ const KURL& imageURL = page->dragController()->draggingImageURL();
ASSERT(!imageURL.isEmpty());
- draggingImageURL = imageURL.getNSURL();
+ draggingImageURL = imageURL;
wrapper = [[self _dataSource] _fileWrapperForURL:draggingImageURL];
}
@@ -3276,7 +3401,7 @@ noPromisedData:
// This is needed for the case where the webview is embedded in the view that's being printed.
// It shouldn't be called when the webview is being printed directly.
-- (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit
+- (void)adjustPageHeightNew:(CGFloat *)newBottom top:(CGFloat)oldTop bottom:(CGFloat)oldBottom limit:(CGFloat)bottomLimit
{
// This helps when we print as part of a larger print process.
// If the WebHTMLView itself is what we're printing, then we will never have to do this.
@@ -3284,7 +3409,17 @@ noPromisedData:
if (!wasInPrintingMode)
[self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
- [[self _bridge] adjustPageHeightNew:newBottom top:oldTop bottom:oldBottom limit:bottomLimit];
+ float newBottomFloat = *newBottom;
+ core([self _frame])->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
+ // oldBottom over to newBottom. This prevents rounding errors that can occur when converting newBottomFloat to a double.
+ if (fabs((float)oldBottom - newBottomFloat) <= std::numeric_limits<float>::epsilon())
+ *newBottom = oldBottom;
+ else
+#endif
+ *newBottom = newBottomFloat;
if (!wasInPrintingMode) {
NSPrintOperation *currenPrintOperation = [NSPrintOperation currentOperation];
@@ -3321,7 +3456,7 @@ noPromisedData:
// FIXME 3491344: This is a secret AppKit-internal method that we need to override in order
// to get our shrink-to-fit to work with a custom pagination scheme. We can do this better
// if AppKit makes it SPI/API.
-- (float)_provideTotalScaleFactorForPrintOperation:(NSPrintOperation *)printOperation
+- (CGFloat)_provideTotalScaleFactorForPrintOperation:(NSPrintOperation *)printOperation
{
return [self _scaleFactorForPrintOperation:printOperation];
}
@@ -3405,7 +3540,7 @@ noPromisedData:
float userScaleFactor = [printOperation _web_pageSetupScaleFactor];
[_private->pageRects release];
float fullPageHeight = floorf([self _calculatePrintHeight]/totalScaleFactor);
- NSArray *newPageRects = [[self _bridge] computePageRectsWithPrintWidthScaleFactor:userScaleFactor
+ NSArray *newPageRects = [[self _frame] _computePageRectsWithPrintWidthScaleFactor:userScaleFactor
printHeight:fullPageHeight];
// AppKit gets all messed up if you give it a zero-length page count (see 3576334), so if we
@@ -3419,7 +3554,7 @@ noPromisedData:
// content onto one fewer page. If it does, use the adjusted scale. If not, use the original scale.
float lastPageHeight = NSHeight([[newPageRects lastObject] rectValue]);
if (lastPageHeight/fullPageHeight < LastPrintedPageOrphanRatio) {
- NSArray *adjustedPageRects = [[self _bridge] computePageRectsWithPrintWidthScaleFactor:userScaleFactor
+ NSArray *adjustedPageRects = [[self _frame] _computePageRectsWithPrintWidthScaleFactor:userScaleFactor
printHeight:fullPageHeight*PrintingOrphanShrinkAdjustment];
// Use the adjusted rects only if the page count went down
if ([adjustedPageRects count] < [newPageRects count]) {
@@ -3437,7 +3572,7 @@ noPromisedData:
}
// Return the drawing rectangle for a particular page number
-- (NSRect)rectForPage:(int)page
+- (NSRect)rectForPage:(NSInteger)page
{
return [[_private->pageRects objectAtIndex:page - 1] rectValue];
}
@@ -3502,11 +3637,12 @@ noPromisedData:
{
BOOL eventWasSentToWebCore = (_private->keyDownEvent == event);
- [self retain];
+ RetainPtr<WebHTMLView> selfProtector = self;
Frame* coreFrame = core([self _frame]);
- if (eventWasSentToWebCore || !coreFrame || !coreFrame->eventHandler()->keyEvent(event))
- [super keyUp:event];
- [self release];
+ if (coreFrame && !eventWasSentToWebCore)
+ coreFrame->eventHandler()->keyEvent(event);
+ else
+ [super keyUp:event];
}
- (void)flagsChanged:(NSEvent *)event
@@ -3518,9 +3654,12 @@ noPromisedData:
RetainPtr<WebHTMLView> selfProtector = self;
unsigned short keyCode = [event keyCode];
+
//Don't make an event from the num lock and function keys
- if (coreFrame && keyCode != 0 && keyCode != 10 && keyCode != 63)
+ if (coreFrame && keyCode != 0 && keyCode != 10 && keyCode != 63) {
coreFrame->eventHandler()->keyEvent(PlatformKeyboardEvent(event));
+ return;
+ }
[super flagsChanged:event];
}
@@ -3528,7 +3667,7 @@ noPromisedData:
- (id)accessibilityAttributeValue:(NSString*)attributeName
{
if ([attributeName isEqualToString: NSAccessibilityChildrenAttribute]) {
- id accTree = [[self _bridge] accessibilityTree];
+ id accTree = [[self _frame] _accessibilityTree];
if (accTree)
return [NSArray arrayWithObject:accTree];
return nil;
@@ -3538,7 +3677,7 @@ noPromisedData:
- (id)accessibilityFocusedUIElement
{
- id accTree = [[self _bridge] accessibilityTree];
+ id accTree = [[self _frame] _accessibilityTree];
if (accTree)
return [accTree accessibilityFocusedUIElement];
return self;
@@ -3546,7 +3685,7 @@ noPromisedData:
- (id)accessibilityHitTest:(NSPoint)point
{
- id accTree = [[self _bridge] accessibilityTree];
+ id accTree = [[self _frame] _accessibilityTree];
if (accTree) {
NSPoint windowCoord = [[self window] convertScreenToBase:point];
return [accTree accessibilityHitTest:[self convertPoint:windowCoord fromView:nil]];
@@ -3556,7 +3695,7 @@ noPromisedData:
- (id)_accessibilityParentForSubview:(NSView *)subview
{
- id accTree = [[self _bridge] accessibilityTree];
+ id accTree = [[self _frame] _accessibilityTree];
if (!accTree)
return self;
id parent = [accTree _accessibilityParentForSubview:subview];
@@ -3652,7 +3791,7 @@ noPromisedData:
[style setBackgroundColor:[self _colorAsString:color]];
NSFont *font = [dictionary objectForKey:NSFontAttributeName];
- if (font == nil) {
+ if (!font) {
[style setFontFamily:@"Helvetica"];
[style setFontSize:@"12px"];
[style setFontWeight:@"normal"];
@@ -3663,11 +3802,12 @@ noPromisedData:
// with characters like single quote or backslash in their names.
[style setFontFamily:[NSString stringWithFormat:@"'%@'", [font familyName]]];
[style setFontSize:[NSString stringWithFormat:@"%0.fpx", [font pointSize]]];
+ // FIXME: Map to the entire range of CSS weight values.
if ([fm weightOfFont:font] >= MIN_BOLD_WEIGHT)
[style setFontWeight:@"bold"];
else
[style setFontWeight:@"normal"];
- if (([fm traitsOfFont:font] & NSItalicFontMask) != 0)
+ if ([fm traitsOfFont:font] & NSItalicFontMask)
[style setFontStyle:@"italic"];
else
[style setFontStyle:@"normal"];
@@ -3802,7 +3942,7 @@ noPromisedData:
- (NSFont *)_originalFontB
{
- return [[NSFontManager sharedFontManager] fontWithFamily:@"Times" traits:(NSBoldFontMask | NSItalicFontMask) weight:STANDARD_BOLD_WEIGHT size:12.0f];
+ return [[NSFontManager sharedFontManager] fontWithFamily:@"Times" traits:NSFontItalicTrait weight:STANDARD_BOLD_WEIGHT size:12.0f];
}
- (void)_addToStyle:(DOMCSSStyleDeclaration *)style fontA:(NSFont *)a fontB:(NSFont *)b
@@ -3828,8 +3968,6 @@ noPromisedData:
int aWeight = [fm weightOfFont:a];
int bWeight = [fm weightOfFont:b];
- BOOL aIsBold = aWeight >= MIN_BOLD_WEIGHT;
-
BOOL aIsItalic = ([fm traitsOfFont:a] & NSItalicFontMask) != 0;
BOOL bIsItalic = ([fm traitsOfFont:b] & NSItalicFontMask) != 0;
@@ -3841,18 +3979,13 @@ noPromisedData:
// the Postscript name.
// Find the font the same way the rendering code would later if it encountered this CSS.
- NSFontTraitMask traits = 0;
- if (aIsBold)
- traits |= NSBoldFontMask;
- if (aIsItalic)
- traits |= NSItalicFontMask;
- NSFont *foundFont = WebCoreFindFont(aFamilyName, traits, aPointSize);
+ NSFontTraitMask traits = aIsItalic ? NSFontItalicTrait : 0;
+ NSFont *foundFont = WebCoreFindFont(aFamilyName, traits, aWeight, aPointSize);
// If we don't find a font with the same Postscript name, then we'll have to use the
// Postscript name to make the CSS specific enough.
- if (![[foundFont fontName] isEqualToString:[a fontName]]) {
+ if (![[foundFont fontName] isEqualToString:[a fontName]])
familyNameForCSS = [a fontName];
- }
// FIXME: Need more sophisticated escaping code if we want to handle family names
// with characters like single quote or backslash in their names.
@@ -3868,7 +4001,7 @@ noPromisedData:
[style _setFontSizeDelta:@"1px"];
if (aWeight == bWeight)
- [style setFontWeight:aIsBold ? @"bold" : @"normal"];
+ [style setFontWeight:aWeight > MIN_BOLD_WEIGHT ? @"bold" : @"normal"];
if (aIsItalic == bIsItalic)
[style setFontStyle:aIsItalic ? @"italic" : @"normal"];
@@ -4043,7 +4176,7 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co
// to do the right thing because it works in startSpeaking:, and I know setBackgroundColor: does the
// right thing because I tested it with [self _selectedRange].
// FIXME: This won't actually apply the style to the entire range here, because it ends up calling
- // [bridge applyStyle:], which operates on the current selection. To make this work right, we'll
+ // [frame _applyStyle:], which operates on the current selection. To make this work right, we'll
// need to save off the selection, temporarily set it to the entire range, make the change, then
// restore the old selection.
[self _changeCSSColorUsingSelector:@selector(setBackgroundColor:) inRange:[self _documentRange]];
@@ -4067,12 +4200,12 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co
if (![self _canEdit])
return;
- WebFrameBridge *bridge = [self _bridge];
+ WebFrame *frame = [self _frame];
[self selectWord:nil];
- NSString *word = [[bridge selectedString] performSelector:selector];
+ NSString *word = [[frame _selectedString] performSelector:selector];
// FIXME: Does this need a different action context other than "typed"?
if ([self _shouldReplaceSelectionWithText:word givenAction:WebViewInsertActionTyped])
- [bridge replaceSelectionWithText:word selectReplacement:NO smartReplace:NO];
+ [frame _replaceSelectionWithText:word selectReplacement:NO smartReplace:NO];
}
- (void)uppercaseWord:(id)sender
@@ -4155,7 +4288,7 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co
return;
if ([self _shouldReplaceSelectionWithText:newWord givenAction:WebViewInsertActionPasted])
- [[self _bridge] replaceSelectionWithText:newWord selectReplacement:YES smartReplace:NO];
+ [[self _frame] _replaceSelectionWithText:newWord selectReplacement:YES smartReplace:NO];
}
- (void)changeSpelling:(id)sender
@@ -4165,24 +4298,6 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co
[self _changeSpellingToWord:[[sender selectedCell] stringValue]];
}
-- (void)ignoreSpelling:(id)sender
-{
- COMMAND_PROLOGUE
-
- NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
- if (!checker) {
- LOG_ERROR("No NSSpellChecker");
- return;
- }
-
- NSString *stringToIgnore = [sender stringValue];
- unsigned int length = [stringToIgnore length];
- if (stringToIgnore && length > 0) {
- [checker ignoreWord:stringToIgnore inSpellDocumentWithTag:[[self _webView] spellCheckerDocumentTag]];
- // FIXME: Need to clear misspelling marker if the currently selected word is the one we are to ignore?
- }
-}
-
- (void)performFindPanelAction:(id)sender
{
COMMAND_PROLOGUE
@@ -4196,11 +4311,11 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co
{
COMMAND_PROLOGUE
- WebFrameBridge *bridge = [self _bridge];
+ WebFrame *frame = [self _frame];
DOMRange *range = [self _selectedRange];
if (!range || [range collapsed])
range = [self _documentRange];
- [NSApp speakString:[bridge stringForRange:range]];
+ [NSApp speakString:[frame _stringForRange:range]];
}
- (void)stopSpeaking:(id)sender
@@ -4221,12 +4336,12 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co
if (!coreFrame)
return;
- const char* direction = "rtl";
+ WritingDirection direction = RightToLeftWritingDirection;
switch (coreFrame->baseWritingDirectionForSelectionStart()) {
case NSWritingDirectionLeftToRight:
break;
case NSWritingDirectionRightToLeft:
- direction = "ltr";
+ direction = LeftToRightWritingDirection;
break;
// The writingDirectionForSelectionStart method will never return "natural". It
// will always return a concrete direction. So, keep the compiler happy, and assert not reached.
@@ -4253,7 +4368,7 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co
ASSERT(writingDirection != NSWritingDirectionNatural);
if (Frame* coreFrame = core([self _frame]))
- coreFrame->editor()->setBaseWritingDirection(writingDirection == NSWritingDirectionLeftToRight ? "ltr" : "rtl");
+ coreFrame->editor()->setBaseWritingDirection(writingDirection == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);
}
static BOOL writingDirectionKeyBindingsEnabled()
@@ -4275,7 +4390,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
}
if (Frame* coreFrame = core([self _frame]))
- coreFrame->editor()->setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? "ltr" : "rtl");
+ coreFrame->editor()->setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);
}
- (void)changeBaseWritingDirectionToLTR:(id)sender
@@ -4420,63 +4535,15 @@ static BOOL writingDirectionKeyBindingsEnabled()
@end
-@implementation WebHTMLView (WebTextSizing)
-
-- (IBAction)_makeTextSmaller:(id)sender
-{
- [self _updateTextSizeMultiplier];
-}
-
-- (IBAction)_makeTextLarger:(id)sender
-{
- [self _updateTextSizeMultiplier];
-}
-
-- (IBAction)_makeTextStandardSize:(id)sender
-{
- [self _updateTextSizeMultiplier];
-}
-
-- (BOOL)_tracksCommonSizeFactor
-{
- return YES;
-}
-
-- (void)_textSizeMultiplierChanged
-{
- [self _updateTextSizeMultiplier];
-}
-
-// never sent because we track the common size factor
-- (BOOL)_canMakeTextSmaller
-{
- ASSERT_NOT_REACHED();
- return NO;
-}
-
-- (BOOL)_canMakeTextLarger
-{
- ASSERT_NOT_REACHED();
- return NO;
-}
-
-- (BOOL)_canMakeTextStandardSize
-{
- ASSERT_NOT_REACHED();
- return NO;
-}
-
-@end
-
@implementation NSArray (WebHTMLView)
- (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object
{
-#ifndef __LP64__
+#if ENABLE(NETSCAPE_PLUGIN_API)
NSEnumerator *enumerator = [self objectEnumerator];
- WebNetscapePluginEmbeddedView *view;
+ WebBaseNetscapePluginView *view;
while ((view = [enumerator nextObject]) != nil)
- if ([view isKindOfClass:[WebNetscapePluginEmbeddedView class]])
+ if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
[view performSelector:selector withObject:object];
#endif
}
@@ -4506,8 +4573,13 @@ static BOOL writingDirectionKeyBindingsEnabled()
if ([NSApp keyWindow] != window || [window firstResponder] != self)
return;
- BOOL multiple = NO;
- NSFont *font = [[self _bridge] fontForSelection:&multiple];
+ bool multipleFonts = false;
+ NSFont *font = nil;
+ if (Frame* coreFrame = core([self _frame])) {
+ if (const SimpleFontData* fd = coreFrame->editor()->fontForSelection(multipleFonts))
+ font = fd->getNSFont();
+ }
+
// FIXME: for now, return a bogus font that distinguishes the empty selection from the non-empty
// selection. We should be able to remove this once the rest of this code works properly.
@@ -4515,8 +4587,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
font = [self _hasSelection] ? [NSFont menuFontOfSize:23] : [NSFont toolTipsFontOfSize:17];
ASSERT(font != nil);
- NSFontManager *fm = [NSFontManager sharedFontManager];
- [fm setSelectedFont:font isMultiple:multiple];
+ [[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:multipleFonts];
// FIXME: we don't keep track of selected attributes, or set them on the font panel. This
// appears to have no effect on the UI. E.g., underlined text in Mail or TextEdit is
@@ -4525,7 +4596,10 @@ static BOOL writingDirectionKeyBindingsEnabled()
- (BOOL)_canSmartCopyOrDelete
{
- return [[self _webView] smartInsertDeleteEnabled] && [[self _bridge] selectionGranularity] == WordGranularity;
+ if (![[self _webView] smartInsertDeleteEnabled])
+ return NO;
+ Frame* coreFrame = core([self _frame]);
+ return coreFrame && coreFrame->selectionGranularity() == WordGranularity;
}
- (NSEvent *)_mouseDownEvent
@@ -4533,36 +4607,6 @@ static BOOL writingDirectionKeyBindingsEnabled()
return _private->mouseDownEvent;
}
-#ifndef __LP64__
-- (void)_pauseNullEventsForAllNetscapePlugins
-{
- NSArray *subviews = [self subviews];
- unsigned int subviewCount = [subviews count];
- unsigned int subviewIndex;
-
- for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) {
- NSView *subview = [subviews objectAtIndex:subviewIndex];
- if ([subview isKindOfClass:[WebBaseNetscapePluginView class]])
- [(WebBaseNetscapePluginView *)subview stopNullEvents];
- }
-}
-#endif
-
-#ifndef __LP64__
-- (void)_resumeNullEventsForAllNetscapePlugins
-{
- NSArray *subviews = [self subviews];
- unsigned int subviewCount = [subviews count];
- unsigned int subviewIndex;
-
- for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) {
- NSView *subview = [subviews objectAtIndex:subviewIndex];
- if ([subview isKindOfClass:[WebBaseNetscapePluginView class]])
- [(WebBaseNetscapePluginView *)subview restartNullEvents];
- }
-}
-#endif
-
- (id<WebHTMLHighlighter>)_highlighterForType:(NSString*)type
{
return [_private->highlighters objectForKey:type];
@@ -4585,7 +4629,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
return; // DHTML did the whole operation
if (!coreFrame->editor()->canPaste())
return;
- if (coreFrame->selectionController()->isContentRichlyEditable())
+ if (coreFrame->selection()->isContentRichlyEditable())
[self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
else
coreFrame->editor()->pasteAsPlainText();
@@ -4791,10 +4835,10 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
- (void)setPromisedDragTIFFDataSource:(WebCore::CachedImage*)source
{
if (source)
- source->ref(promisedDataClient());
+ source->addClient(promisedDataClient());
if (_private->promisedDragTIFFDataSource)
- _private->promisedDragTIFFDataSource->deref(promisedDataClient());
+ _private->promisedDragTIFFDataSource->removeClient(promisedDataClient());
_private->promisedDragTIFFDataSource = source;
}
@@ -4804,7 +4848,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
{
ASSERT(!_private->subviewsSetAside);
- if ([[self _bridge] needsLayout])
+ if ([[self _frame] _needsLayout])
_private->needsLayout = YES;
if (_private->needsToApplyStyles || _private->needsLayout)
[self layout];
@@ -4833,6 +4877,11 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
#endif
}
+- (void) _destroyAllWebPlugins
+{
+ [[self _pluginController] destroyAllPlugins];
+}
+
@end
@implementation WebHTMLView (WebNSTextInputSupport)
@@ -4859,24 +4908,18 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
// API when an editable region is not currently focused.
static BOOL isTextInput(Frame* coreFrame)
{
- return coreFrame && !coreFrame->selectionController()->isNone() && coreFrame->selectionController()->isContentEditable();
+ return coreFrame && !coreFrame->selection()->isNone() && coreFrame->selection()->isContentEditable();
}
-// Work around for <rdar://problem/5522011>
-// Some input methods do not properly behave when TSM is in secure input mode
-// which can allow the password to be made visible. We prevent this by overriding
-// the active context if a password field is focused.
-- (NSInputContext *)inputContext
+static BOOL isInPasswordField(Frame* coreFrame)
{
- Frame* coreFrame = core([self _frame]);
- if (coreFrame && coreFrame->selectionController()->isInPasswordField())
- return nil;
- return [super inputContext];
+ return coreFrame && coreFrame->selection()->isInPasswordField();
}
- (NSAttributedString *)textStorage
{
- if (!isTextInput(core([self _frame]))) {
+ Frame* coreFrame = core([self _frame]);
+ if (!isTextInput(coreFrame) || isInPasswordField(coreFrame)) {
LOG(TextInput, "textStorage -> nil");
return nil;
}
@@ -4891,26 +4934,26 @@ static BOOL isTextInput(Frame* coreFrame)
- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
{
NSWindow *window = [self window];
- WebFrameBridge *bridge = [self _bridge];
+ WebFrame *frame = [self _frame];
if (window)
thePoint = [window convertScreenToBase:thePoint];
thePoint = [self convertPoint:thePoint fromView:nil];
- DOMRange *range = [bridge characterRangeAtPoint:thePoint];
+ DOMRange *range = [frame _characterRangeAtPoint:thePoint];
if (!range) {
LOG(TextInput, "characterIndexForPoint:(%f, %f) -> NSNotFound", thePoint.x, thePoint.y);
return NSNotFound;
}
- unsigned result = [bridge convertDOMRangeToNSRange:range].location;
+ unsigned result = [frame _convertDOMRangeToNSRange:range].location;
LOG(TextInput, "characterIndexForPoint:(%f, %f) -> %u", thePoint.x, thePoint.y, result);
return result;
}
- (NSRect)firstRectForCharacterRange:(NSRange)theRange
{
- WebFrameBridge *bridge = [self _bridge];
+ WebFrame *frame = [self _frame];
// Just to match NSTextView's behavior. Regression tests cannot detect this;
// to reproduce, use a test application from http://bugs.webkit.org/show_bug.cgi?id=4682
@@ -4918,7 +4961,7 @@ static BOOL isTextInput(Frame* coreFrame)
if ((theRange.location + theRange.length < theRange.location) && (theRange.location + theRange.length != 0))
theRange.length = 0;
- DOMRange *range = [bridge convertNSRangeToDOMRange:theRange];
+ DOMRange *range = [frame _convertNSRangeToDOMRange:theRange];
if (!range) {
LOG(TextInput, "firstRectForCharacterRange:(%u, %u) -> (0, 0, 0, 0)", theRange.location, theRange.length);
return NSMakeRect(0, 0, 0, 0);
@@ -4927,7 +4970,7 @@ static BOOL isTextInput(Frame* coreFrame)
ASSERT([range startContainer]);
ASSERT([range endContainer]);
- NSRect resultRect = [bridge firstRectForDOMRange:range];
+ NSRect resultRect = [frame _firstRectForDOMRange:range];
resultRect = [self convertRect:resultRect toView:nil];
NSWindow *window = [self window];
@@ -4944,7 +4987,7 @@ static BOOL isTextInput(Frame* coreFrame)
LOG(TextInput, "selectedRange -> (NSNotFound, 0)");
return NSMakeRange(NSNotFound, 0);
}
- NSRange result = [[self _bridge] selectedNSRange];
+ NSRange result = [[self _frame] _selectedNSRange];
LOG(TextInput, "selectedRange -> (%u, %u)", result.location, result.length);
return result;
@@ -4952,19 +4995,21 @@ static BOOL isTextInput(Frame* coreFrame)
- (NSRange)markedRange
{
- NSRange result = [[self _bridge] markedTextNSRange];
+ WebFrame *webFrame = [self _frame];
+ NSRange result = [webFrame _convertToNSRange:core(webFrame)->editor()->compositionRange().get()];
LOG(TextInput, "markedRange -> (%u, %u)", result.location, result.length);
return result;
}
- (NSAttributedString *)attributedSubstringFromRange:(NSRange)nsRange
{
- if (!isTextInput(core([self _frame]))) {
+ WebFrame *frame = [self _frame];
+ Frame* coreFrame = core(frame);
+ if (!isTextInput(coreFrame) || isInPasswordField(coreFrame)) {
LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> nil", nsRange.location, nsRange.length);
return nil;
}
- WebFrameBridge *bridge = [self _bridge];
- DOMRange *domRange = [bridge convertNSRangeToDOMRange:nsRange];
+ DOMRange *domRange = [frame _convertNSRangeToDOMRange:nsRange];
if (!domRange) {
LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> nil", nsRange.location, nsRange.length);
return nil;
@@ -5074,7 +5119,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
// The AppKit adds a 'secret' property to the string that contains the replacement range.
// The replacement range is the range of the the text that should be replaced with the new string.
if (rangeString)
- [[self _bridge] selectNSRange:NSRangeFromString(rangeString)];
+ [[self _frame] _selectNSRange:NSRangeFromString(rangeString)];
text = [string string];
extractUnderlines(string, underlines);
@@ -5155,7 +5200,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:NULL inRange:NSMakeRange(0, [text length])];
LOG(TextInput, " ReplacementRange: %@", rangeString);
if (rangeString) {
- [[self _bridge] selectNSRange:NSRangeFromString(rangeString)];
+ [[self _frame] _selectNSRange:NSRangeFromString(rangeString)];
isFromInputMethod = YES;
}
} else
@@ -5260,9 +5305,9 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
{
// FIXME: 3769654 - We should preserve case of string being inserted, even in prefix (but then also be
// able to revert that). Mimic NSText.
- WebFrameBridge *bridge = [_view _bridge];
+ WebFrame *frame = [_view _frame];
NSString *newText = [match substringFromIndex:prefixLength];
- [bridge replaceSelectionWithText:newText selectReplacement:YES smartReplace:NO];
+ [frame _replaceSelectionWithText:newText selectReplacement:YES smartReplace:NO];
}
// mostly lifted from NSTextView_KeyBinding.m
@@ -5359,9 +5404,9 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
}
// Get preceeding word stem
- WebFrameBridge *bridge = [_view _bridge];
- DOMRange *selection = kit(core([_view _frame])->selectionController()->toRange().get());
- DOMRange *wholeWord = [bridge rangeByAlteringCurrentSelection:SelectionController::EXTEND
+ WebFrame *frame = [_view _frame];
+ DOMRange *selection = kit(core(frame)->selection()->toRange().get());
+ DOMRange *wholeWord = [frame _rangeByAlteringCurrentSelection:SelectionController::EXTEND
direction:SelectionController::BACKWARD granularity:WordGranularity];
DOMRange *prefix = [wholeWord cloneRange];
[prefix setEnd:[selection startContainer] offset:[selection startOffset]];
@@ -5371,7 +5416,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
NSBeep();
return;
}
- NSString *prefixStr = [bridge stringForRange:prefix];
+ NSString *prefixStr = [frame _stringForRange:prefix];
NSString *trimmedPrefix = [prefixStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([trimmedPrefix length] == 0) {
NSBeep();
@@ -5390,9 +5435,9 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
[self _insertMatch:[_completions objectAtIndex:0]];
} else {
ASSERT(!_originalString); // this should only be set IFF we have a popup window
- _originalString = [[bridge stringForRange:selection] retain];
+ _originalString = [[frame _stringForRange:selection] retain];
[self _buildUI];
- NSRect wordRect = [bridge caretRectAtNode:[wholeWord startContainer] offset:[wholeWord startOffset] affinity:NSSelectionAffinityDownstream];
+ NSRect wordRect = [frame _caretRectAtNode:[wholeWord startContainer] offset:[wholeWord startOffset] affinity:NSSelectionAffinityDownstream];
// +1 to be under the word, not the caret
// FIXME - 3769652 - Wrong positioning for right to left languages. We should line up the upper
// right corner with the caret instead of upper left, and the +1 would be a -1.
@@ -5415,8 +5460,8 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
_popupWindow = nil;
if (revertChange) {
- WebFrameBridge *bridge = [_view _bridge];
- [bridge replaceSelectionWithText:_originalString selectReplacement:YES smartReplace:NO];
+ WebFrame *frame = [_view _frame];
+ [frame _replaceSelectionWithText:_originalString selectReplacement:YES smartReplace:NO];
} else if ([_view _hasSelection]) {
if (goLeft)
[_view moveBackward:nil];
@@ -5496,12 +5541,12 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
[self endRevertingChange:NO moveLeft:NO];
}
-- (int)numberOfRowsInTableView:(NSTableView *)tableView
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
{
return [_completions count];
}
-- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
return [_completions objectAtIndex:row];
}
@@ -5551,13 +5596,6 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
return nil;
}
-- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText
-{
- // NOTE: this method is obsolete and doesn't behave as its name suggests.
- // See comment in WebDocumentPrivate.h.
- return [self selectionImageForcingBlackText:forceWhiteText];
-}
-
- (NSRect)selectionImageRect
{
if ([self _hasSelection])
@@ -5585,7 +5623,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
{
Frame* coreFrame = core([self _frame]);
if (coreFrame)
- coreFrame->selectionController()->selectAll();
+ coreFrame->selection()->selectAll();
}
- (void)deselectAll
@@ -5593,12 +5631,12 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
Frame* coreFrame = core([self _frame]);
if (!coreFrame)
return;
- coreFrame->selectionController()->clear();
+ coreFrame->selection()->clear();
}
- (NSString *)string
{
- return [[self _bridge] stringForRange:[self _documentRange]];
+ return [[self _frame] _stringForRange:[self _documentRange]];
}
- (NSAttributedString *)_attributeStringFromDOMRange:(DOMRange *)range
@@ -5621,15 +5659,14 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
NSAttributedString *attributedString = [self _attributeStringFromDOMRange:[document _documentRange]];
if (!attributedString) {
Document* coreDocument = core(document);
- Range range(coreDocument, coreDocument, 0, 0, 0);
- attributedString = [NSAttributedString _web_attributedStringFromRange:&range];
+ attributedString = [NSAttributedString _web_attributedStringFromRange:Range::create(coreDocument, coreDocument, 0, coreDocument, coreDocument->childNodeCount()).get()];
}
return attributedString;
}
- (NSString *)selectedString
{
- return [[self _bridge] selectedString];
+ return [[self _frame] _selectedString];
}
- (NSAttributedString *)selectedAttributedString
@@ -5638,7 +5675,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
if (!attributedString) {
Frame* coreFrame = core([self _frame]);
if (coreFrame) {
- RefPtr<Range> range = coreFrame->selectionController()->selection().toRange();
+ RefPtr<Range> range = coreFrame->selection()->selection().toRange();
attributedString = [NSAttributedString _web_attributedStringFromRange:range.get()];
}
}
@@ -5654,8 +5691,8 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
{
if (![string length])
return NO;
-
- return [[self _bridge] searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag startInSelection:startInSelection];
+ Frame* coreFrame = core([self _frame]);
+ return coreFrame && coreFrame->findString(string, forward, caseFlag, wrapFlag, startInSelection);
}
@end
@@ -5669,35 +5706,60 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
- (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow;
{
- Frame* coreframe = core([self _frame]);
- if (coreframe)
- return [[[WebElementDictionary alloc] initWithHitTestResult:coreframe->eventHandler()->hitTestResultAtPoint(IntPoint(point), allow)] autorelease];
- return nil;
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return nil;
+ return [[[WebElementDictionary alloc] initWithHitTestResult:coreFrame->eventHandler()->hitTestResultAtPoint(IntPoint(point), allow)] autorelease];
}
- (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(NSUInteger)limit
{
- return [[self _bridge] markAllMatchesForText:string caseSensitive:caseFlag limit:limit];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return 0;
+ return coreFrame->markAllMatchesForText(string, caseFlag, limit);
}
- (void)setMarkedTextMatchesAreHighlighted:(BOOL)newValue
{
- [[self _bridge] setMarkedTextMatchesAreHighlighted:newValue];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return;
+ coreFrame->setMarkedTextMatchesAreHighlighted(newValue);
}
- (BOOL)markedTextMatchesAreHighlighted
{
- return [[self _bridge] markedTextMatchesAreHighlighted];
+ Frame* coreFrame = core([self _frame]);
+ return coreFrame && coreFrame->markedTextMatchesAreHighlighted();
}
- (void)unmarkAllTextMatches
{
- return [[self _bridge] unmarkAllTextMatches];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return;
+ Document* document = coreFrame->document();
+ if (!document)
+ return;
+ document->removeMarkers(DocumentMarker::TextMatch);
}
- (NSArray *)rectsForTextMatches
{
- return [[self _bridge] rectsForTextMatches];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return [NSArray array];
+ Document* document = coreFrame->document();
+ if (!document)
+ return [NSArray array];
+
+ Vector<IntRect> rects = document->renderedRectsForMarkers(DocumentMarker::TextMatch);
+ unsigned count = rects.size();
+ NSMutableArray *result = [NSMutableArray arrayWithCapacity:count];
+ for (unsigned index = 0; index < count; ++index)
+ [result addObject:[NSValue valueWithRect:rects[index]]];
+ return result;
}
@end
diff --git a/WebKit/mac/WebView/WebHTMLViewInternal.h b/WebKit/mac/WebView/WebHTMLViewInternal.h
index e54ab2d..0fb0cdc 100644
--- a/WebKit/mac/WebView/WebHTMLViewInternal.h
+++ b/WebKit/mac/WebView/WebHTMLViewInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,95 +28,26 @@
// Things internal to the WebKit framework; not SPI.
-#import <WebKit/WebHTMLViewPrivate.h>
+#import "WebHTMLViewPrivate.h"
-@class WebTextCompleteController;
-@class DOMDocumentFragment;
-@class DOMElement;
+@class WebFrame;
namespace WebCore {
- class KeyboardEvent;
class CachedImage;
+ class KeyboardEvent;
}
-struct WebHTMLViewInterpretKeyEventsParameters;
-
-@interface WebHTMLViewPrivate : NSObject
-{
-@public
- BOOL closed;
- BOOL needsLayout;
- BOOL needsToApplyStyles;
- BOOL ignoringMouseDraggedEvents;
- BOOL printing;
- BOOL avoidingPrintOrphan;
-
- id savedSubviews;
- BOOL subviewsSetAside;
-
- NSEvent *mouseDownEvent; // Kept after handling the event.
- BOOL handlingMouseDownEvent;
- NSEvent *keyDownEvent; // Kept after handling the event.
-
- NSSize lastLayoutSize;
-
- NSPoint lastScrollPosition;
-
- WebPluginController *pluginController;
-
- NSString *toolTip;
- NSToolTipTag lastToolTipTag;
- id trackingRectOwner;
- void *trackingRectUserData;
-
- NSTimer *autoscrollTimer;
- NSEvent *autoscrollTriggerEvent;
-
- NSArray* pageRects;
-
- NSMutableDictionary* highlighters;
-
- BOOL resigningFirstResponder;
- BOOL nextResponderDisabledOnce;
-
- WebTextCompleteController *compController;
-
- BOOL transparentBackground;
-
- WebHTMLViewInterpretKeyEventsParameters *interpretKeyEventsParameters;
- BOOL receivedNOOP;
-
- WebDataSource *dataSource;
- WebCore::CachedImage *promisedDragTIFFDataSource;
-
- CFRunLoopTimerRef updateFocusedAndActiveStateTimer;
- CFRunLoopTimerRef updateMouseoverTimer;
-
- SEL selectorForDoCommandBySelector;
-
-#ifndef NDEBUG
- BOOL enumeratingSubviews;
-#endif
-}
-- (void)clear;
-@end
-
@interface WebHTMLView (WebInternal)
- (void)_selectionChanged;
- (void)_updateFontPanel;
- (BOOL)_canSmartCopyOrDelete;
-#ifndef __LP64__
-- (void)_pauseNullEventsForAllNetscapePlugins;
-- (void)_resumeNullEventsForAllNetscapePlugins;
-#endif
-- (id<WebHTMLHighlighter>)_highlighterForType:(NSString*)type;
+
+- (id <WebHTMLHighlighter>)_highlighterForType:(NSString*)type;
- (WebFrame *)_frame;
-- (void)paste:(id)sender;
-- (void)closeIfNotCurrentView;
- (void)_lookUpInDictionaryFromMenu:(id)sender;
- (void)_hoverFeedbackSuspendedChanged;
- (BOOL)_interceptEditingKeyEvent:(WebCore::KeyboardEvent *)event shouldSaveCommand:(BOOL)shouldSave;
-- (DOMDocumentFragment*)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard;
+- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard;
- (NSEvent *)_mouseDownEvent;
#ifndef BUILDING_ON_TIGER
- (BOOL)isGrammarCheckingEnabled;
@@ -126,4 +57,5 @@ struct WebHTMLViewInterpretKeyEventsParameters;
- (WebCore::CachedImage*)promisedDragTIFFDataSource;
- (void)setPromisedDragTIFFDataSource:(WebCore::CachedImage*)source;
- (void)_web_layoutIfNeededRecursive;
+- (void)_destroyAllWebPlugins;
@end
diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h
index a2773f4..40de97f 100644
--- a/WebKit/mac/WebView/WebHTMLViewPrivate.h
+++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,14 +28,13 @@
#import <WebKit/WebHTMLView.h>
+#if !defined(ENABLE_NETSCAPE_PLUGIN_API)
+#define ENABLE_NETSCAPE_PLUGIN_API 1
+#endif
+
@class DOMDocumentFragment;
-@class DOMElement;
@class DOMNode;
@class DOMRange;
-@class WebArchive;
-@class WebFrameBridge;
-@class WebView;
-@class WebFrame;
@class WebPluginController;
@protocol WebHTMLHighlighter
@@ -93,11 +92,12 @@
- (BOOL)_isEditable;
- (BOOL)_transparentBackground;
-- (void)_setTransparentBackground:(BOOL)f;
+- (void)_setTransparentBackground:(BOOL)isBackgroundTransparent;
- (void)_setToolTip:(NSString *)string;
-// SPI's for Mail.
+// SPI used by Mail.
+// FIXME: These should all be moved to WebView; we won't always have a WebHTMLView.
- (NSImage *)_selectionDraggingImage;
- (NSRect)_selectionDraggingRect;
- (DOMNode *)_insertOrderedList;
@@ -108,10 +108,15 @@
- (DOMNode *)_increaseSelectionListLevelOrdered;
- (DOMNode *)_increaseSelectionListLevelUnordered;
- (void)_decreaseSelectionListLevel;
-- (void)_setHighlighter:(id<WebHTMLHighlighter>)highlighter ofType:(NSString*)type;
-- (void)_removeHighlighterOfType:(NSString*)type;
+- (void)_setHighlighter:(id <WebHTMLHighlighter>)highlighter ofType:(NSString *)type;
+- (void)_removeHighlighterOfType:(NSString *)type;
- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard forType:(NSString *)pboardType inContext:(DOMRange *)context subresources:(NSArray **)subresources;
+#if ENABLE_NETSCAPE_PLUGIN_API
+- (void)_resumeNullEventsForAllNetscapePlugins;
+- (void)_pauseNullEventsForAllNetscapePlugins;
+#endif
+
// SPI for DumpRenderTree
- (void)_updateFocusedAndActiveState;
@@ -122,5 +127,4 @@
- (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard;
-
@end
diff --git a/WebKit/mac/WebView/WebPDFRepresentation.m b/WebKit/mac/WebView/WebPDFRepresentation.m
index beba1fa..1a2ddab 100644
--- a/WebKit/mac/WebView/WebPDFRepresentation.m
+++ b/WebKit/mac/WebView/WebPDFRepresentation.m
@@ -26,13 +26,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <JavaScriptCore/Assertions.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebFrameView.h>
#import <WebKit/WebNSObjectExtras.h>
#import <WebKit/WebPDFRepresentation.h>
#import <WebKit/WebPDFView.h>
+#import <wtf/Assertions.h>
#import <PDFKit/PDFDocument.h>
diff --git a/WebKit/mac/WebView/WebPDFView.h b/WebKit/mac/WebView/WebPDFView.h
index 5d9ce1f..55d2a08 100644
--- a/WebKit/mac/WebView/WebPDFView.h
+++ b/WebKit/mac/WebView/WebPDFView.h
@@ -32,7 +32,7 @@
@class PDFView;
@class WebDataSource;
-@interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching, WebDocumentIncrementalSearching, WebMultipleTextMatches, WebDocumentSelection, WebDocumentElement, _WebDocumentViewState, _WebDocumentTextSizing>
+@interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching, WebDocumentIncrementalSearching, WebMultipleTextMatches, WebDocumentSelection, WebDocumentElement, _WebDocumentViewState, _WebDocumentZooming>
{
NSView *previewView;
PDFView *PDFSubview;
diff --git a/WebKit/mac/WebView/WebPDFView.mm b/WebKit/mac/WebView/WebPDFView.mm
index 630b6de..1009cdd 100644
--- a/WebKit/mac/WebView/WebPDFView.mm
+++ b/WebKit/mac/WebView/WebPDFView.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,18 +45,18 @@
#import "WebUIDelegatePrivate.h"
#import "WebView.h"
#import "WebViewInternal.h"
-#import <JavaScriptCore/Assertions.h>
#import <PDFKit/PDFKit.h>
#import <WebCore/EventNames.h>
+#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameLoadRequest.h>
#import <WebCore/KURL.h>
#import <WebCore/KeyboardEvent.h>
#import <WebCore/MouseEvent.h>
#import <WebCore/PlatformKeyboardEvent.h>
-#import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
using namespace WebCore;
-using namespace EventNames;
// Redeclarations of PDFKit notifications. We can't use the API since we use a weak link to the framework.
#define _webkit_PDFViewDisplayModeChangedNotification @"PDFViewDisplayModeChanged"
@@ -491,6 +491,10 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
+ // This can be called during teardown when _webView is nil. Return NO when this happens, because CallUIDelegateReturningBoolean
+ // assumes the WebVIew is non-nil.
+ if (![self _webView])
+ return NO;
BOOL result = [self validateUserInterfaceItemWithoutDelegate:item];
return CallUIDelegateReturningBoolean(result, [self _webView], @selector(webView:validateUserInterfaceItem:defaultValidation:), item, result);
}
@@ -782,43 +786,32 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
#pragma mark _WebDocumentTextSizing PROTOCOL IMPLEMENTATION
-- (IBAction)_makeTextSmaller:(id)sender
+- (IBAction)_zoomOut:(id)sender
{
[PDFSubviewProxy zoomOut:sender];
}
-- (IBAction)_makeTextLarger:(id)sender
+- (IBAction)_zoomIn:(id)sender
{
[PDFSubviewProxy zoomIn:sender];
}
-- (IBAction)_makeTextStandardSize:(id)sender
+- (IBAction)_resetZoom:(id)sender
{
[PDFSubviewProxy setScaleFactor:1.0f];
}
-// never sent because we do not track the common size factor
-- (void)_textSizeMultiplierChanged { ASSERT_NOT_REACHED(); }
-
-- (BOOL)_tracksCommonSizeFactor
-{
- // We keep our own scale factor instead of tracking the common one in the WebView for a couple reasons.
- // First, PDFs tend to have visually smaller text because they are laid out for a printed page instead of
- // the screen. Second, the PDFView feature of AutoScaling means our scaling factor can be quiet variable.
- return NO;
-}
-
-- (BOOL)_canMakeTextSmaller
+- (BOOL)_canZoomOut
{
return [PDFSubview canZoomOut];
}
-- (BOOL)_canMakeTextLarger
+- (BOOL)_canZoomIn
{
return [PDFSubview canZoomIn];
}
-- (BOOL)_canMakeTextStandardSize
+- (BOOL)_canResetZoom
{
return [PDFSubview scaleFactor] != 1.0;
}
@@ -884,13 +877,6 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
return selectionImage;
}
-- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText
-{
- // NOTE: this method is obsolete and doesn't behave as its name suggests.
- // See comment in WebDocumentPrivate.h.
- return [self selectionImageForcingBlackText:forceWhiteText];
-}
-
- (NSRect)selectionImageRect
{
// FIXME: deal with clipping?
@@ -948,7 +934,7 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
case NSKeyDown: {
PlatformKeyboardEvent pe(nsEvent);
pe.disambiguateKeyDownEvent(PlatformKeyboardEvent::RawKeyDown);
- event = new KeyboardEvent(keydownEvent, true, true, 0,
+ event = KeyboardEvent::create(eventNames().keydownEvent, true, true, 0,
pe.keyIdentifier(), pe.windowsVirtualKeyCode(),
pe.ctrlKey(), pe.altKey(), pe.shiftKey(), pe.metaKey(), false);
}
@@ -956,7 +942,7 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
break;
}
if (button != noButton)
- event = new MouseEvent(clickEvent, true, true, 0, [nsEvent clickCount], 0, 0, 0, 0,
+ event = MouseEvent::create(eventNames().clickEvent, true, true, 0, [nsEvent clickCount], 0, 0, 0, 0,
[nsEvent modifierFlags] & NSControlKeyMask,
[nsEvent modifierFlags] & NSAlternateKeyMask,
[nsEvent modifierFlags] & NSShiftKeyMask,
@@ -964,7 +950,7 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
button, 0, 0, true);
// Call to the frame loader because this is where our security checks are made.
- [[dataSource webFrame] _frameLoader]->load(URL, event.get());
+ core([dataSource webFrame])->loader()->loadFrameRequestWithFormAndValues(ResourceRequest(URL), false, event.get(), 0, HashMap<String, String>());
}
- (void)PDFViewOpenPDFInNativeApplication:(PDFView *)sender
@@ -973,6 +959,11 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
[self _openWithFinder:sender];
}
+- (void)PDFViewPerformPrint:(PDFView *)sender
+{
+ CallUIDelegate([self _webView], @selector(webView:printFrameView:), [[dataSource webFrame] frameView]);
+}
+
- (void)PDFViewSavePDFToDownloadFolder:(PDFView *)sender
{
// We don't want to write the file until we have a document to write (see 5267607).
diff --git a/WebKit/mac/WebView/WebPolicyDelegate.mm b/WebKit/mac/WebView/WebPolicyDelegate.mm
index 147e761..f2df744 100644
--- a/WebKit/mac/WebView/WebPolicyDelegate.mm
+++ b/WebKit/mac/WebView/WebPolicyDelegate.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -33,10 +33,11 @@
using namespace WebCore;
-NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
-NSString *WebActionElementKey = @"WebActionElementKey";
NSString *WebActionButtonKey = @"WebActionButtonKey";
+NSString *WebActionElementKey = @"WebActionElementKey";
+NSString *WebActionFormKey = @"WebActionFormKey";
NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
+NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
NSString *WebActionOriginalURLKey = @"WebActionOriginalURLKey";
@interface WebPolicyDecisionListenerPrivate : NSObject
diff --git a/WebKit/mac/WebView/WebPolicyDelegatePrivate.h b/WebKit/mac/WebView/WebPolicyDelegatePrivate.h
index f7bbbd5..45f8f45 100644
--- a/WebKit/mac/WebView/WebPolicyDelegatePrivate.h
+++ b/WebKit/mac/WebView/WebPolicyDelegatePrivate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,6 +31,8 @@
@class WebHistoryItem;
@class WebPolicyDecisionListenerPrivate;
+extern NSString *WebActionFormKey; // HTMLFormElement
+
typedef enum {
WebNavigationTypePlugInRequest = WebNavigationTypeOther + 1
} WebExtraNavigationType;
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index d7a798c..bcb17db 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -64,6 +64,12 @@
#define WebKitForceFTPDirectoryListings @"WebKitForceFTPDirectoryListings"
#define WebKitDeveloperExtrasEnabledPreferenceKey @"WebKitDeveloperExtrasEnabledPreferenceKey"
#define WebKitAuthorAndUserStylesEnabledPreferenceKey @"WebKitAuthorAndUserStylesEnabledPreferenceKey"
+#define WebKitApplicationChromeModeEnabledPreferenceKey @"WebKitApplicationChromeModeEnabledPreferenceKey"
+#define WebKitWebArchiveDebugModeEnabledPreferenceKey @"WebKitWebArchiveDebugModeEnabledPreferenceKey"
+#define WebKitLocalStorageDatabasePathPreferenceKey @"WebKitLocalStorageDatabasePathPreferenceKey"
+#define WebKitEnableFullDocumentTeardownPreferenceKey @"WebKitEnableFullDocumentTeardown"
+#define WebKitOfflineWebApplicationCacheEnabledPreferenceKey @"WebKitOfflineWebApplicationCacheEnabled"
+#define WebKitZoomsTextOnlyPreferenceKey @"WebKitZoomsTextOnly"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
@@ -83,3 +89,4 @@
// For debugging only. Don't use these.
#define WebKitPageCacheSizePreferenceKey @"WebKitPageCacheSizePreferenceKey"
#define WebKitObjectCacheSizePreferenceKey @"WebKitObjectCacheSizePreferenceKey"
+#define WebKitDebugFullPageZoomPreferenceKey @"WebKitDebugFullPageZoomPreferenceKey"
diff --git a/WebKit/mac/WebView/WebPreferences.m b/WebKit/mac/WebView/WebPreferences.mm
index 1d5f480..8b2f43e 100644
--- a/WebKit/mac/WebView/WebPreferences.m
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -330,8 +330,17 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitDOMPasteAllowedPreferenceKey,
[NSNumber numberWithBool:YES], WebKitUsesPageCachePreferenceKey,
[NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitDeveloperExtrasEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitDeveloperExtrasEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitAuthorAndUserStylesEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitApplicationChromeModeEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitWebArchiveDebugModeEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitZoomsTextOnlyPreferenceKey,
+#ifndef NDEBUG
+ // In Release and Production we skip a lot of object teardown during quit to speed up shutdown time. This breaks
+ // our RefCount Leak tracking, and so for Debug we will use the full document teardown.
+ [NSNumber numberWithBool:YES], WebKitEnableFullDocumentTeardownPreferenceKey,
+#endif
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
@@ -755,6 +764,46 @@ static WebCacheModel cacheModelForMainBundle(void)
[self _setBoolValue:flag forKey:WebKitAuthorAndUserStylesEnabledPreferenceKey];
}
+- (BOOL)applicationChromeModeEnabled
+{
+ return [self _boolValueForKey:WebKitApplicationChromeModeEnabledPreferenceKey];
+}
+
+- (void)setApplicationChromeModeEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitApplicationChromeModeEnabledPreferenceKey];
+}
+
+- (BOOL)webArchiveDebugModeEnabled
+{
+ return [self _boolValueForKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
+}
+
+- (void)setWebArchiveDebugModeEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
+}
+
+- (BOOL)offlineWebApplicationCacheEnabled
+{
+ return [self _boolValueForKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
+}
+
+- (void)setOfflineWebApplicationCacheEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
+}
+
+- (BOOL)zoomsTextOnly
+{
+ return [self _boolValueForKey:WebKitZoomsTextOnlyPreferenceKey];
+}
+
+- (void)setZoomsTextOnly:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitZoomsTextOnlyPreferenceKey];
+}
+
- (BOOL)respectStandardStyleKeyEquivalents
{
return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
@@ -838,7 +887,7 @@ static WebCacheModel cacheModelForMainBundle(void)
- (WebKitEditableLinkBehavior)editableLinkBehavior
{
- WebKitEditableLinkBehavior value = [self _integerValueForKey:WebKitEditableLinkBehaviorPreferenceKey];
+ WebKitEditableLinkBehavior value = static_cast<WebKitEditableLinkBehavior> ([self _integerValueForKey:WebKitEditableLinkBehaviorPreferenceKey]);
if (value != WebKitEditableLinkDefaultBehavior &&
value != WebKitEditableLinkAlwaysLive &&
value != WebKitEditableLinkNeverLive &&
@@ -917,9 +966,15 @@ static WebCacheModel cacheModelForMainBundle(void)
+ (void)_setInitialDefaultTextEncodingToSystemEncoding
{
+ NSString *systemEncodingName = (NSString *)CFStringConvertEncodingToIANACharSetName([self _systemCFStringEncoding]);
+
+ // CFStringConvertEncodingToIANACharSetName() returns CP949 for kTextEncodingDOSKorean AKA "extended EUC-KR" AKA windows-939.
+ // ICU uses this name for a different encoding, so we need to change the name to a value that actually gives us windows-939.
+ // In addition, this value must match what is used in Safari, see <rdar://problem/5579292>.
+ if ([systemEncodingName isEqualToString:@"CP949"])
+ systemEncodingName = @"ks_c_5601-1987";
[[NSUserDefaults standardUserDefaults] registerDefaults:
- [NSDictionary dictionaryWithObject:(NSString *)CFStringConvertEncodingToIANACharSetName([self _systemCFStringEncoding])
- forKey:WebKitDefaultTextEncodingNamePreferenceKey]];
+ [NSDictionary dictionaryWithObject:systemEncodingName forKey:WebKitDefaultTextEncodingNamePreferenceKey]];
}
static NSString *classIBCreatorID = nil;
@@ -943,12 +998,22 @@ static NSString *classIBCreatorID = nil;
- (void)_setFTPDirectoryTemplatePath:(NSString *)path
{
- [self _setStringValue:path forKey:WebKitFTPDirectoryTemplatePath];
+ [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitFTPDirectoryTemplatePath];
+}
+
+- (NSString *)_localStorageDatabasePath
+{
+ return [[self _stringValueForKey:WebKitLocalStorageDatabasePathPreferenceKey] stringByStandardizingPath];
+}
+
+- (void)_setLocalStorageDatabasePath:(NSString *)path
+{
+ [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitLocalStorageDatabasePathPreferenceKey];
}
- (NSString *)_ftpDirectoryTemplatePath
{
- return [self _stringValueForKey:WebKitFTPDirectoryTemplatePath];
+ return [[self _stringValueForKey:WebKitFTPDirectoryTemplatePath] stringByStandardizingPath];
}
- (void)_setForceFTPDirectoryListings:(BOOL)force
@@ -976,6 +1041,15 @@ static NSString *classIBCreatorID = nil;
++_private->numWebViews;
}
+- (void)setFullDocumentTeardownEnabled:(BOOL)fullDocumentTeardownEnabled
+{
+ [self _setBoolValue:fullDocumentTeardownEnabled forKey:WebKitEnableFullDocumentTeardownPreferenceKey];
+}
+
+- (BOOL)fullDocumentTeardownEnabled
+{
+ return [self _boolValueForKey:WebKitEnableFullDocumentTeardownPreferenceKey];
+}
@end
@implementation WebPreferences (WebInternal)
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index a6b5cb2..1981290 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -29,9 +29,8 @@
#import <WebKit/WebPreferences.h>
#import <Quartz/Quartz.h>
-// WebKitEditableLinkBehavior needs to match the EditableLinkBehavior enum in WebCore
typedef enum {
- WebKitEditableLinkDefaultBehavior = 0,
+ WebKitEditableLinkDefaultBehavior,
WebKitEditableLinkAlwaysLive,
WebKitEditableLinkOnlyLiveWithShiftKey,
WebKitEditableLinkLiveWhenNotFocused,
@@ -51,6 +50,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)authorAndUserStylesEnabled;
- (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
+- (BOOL)applicationChromeModeEnabled;
+- (void)setApplicationChromeModeEnabled:(BOOL)flag;
+
- (BOOL)respectStandardStyleKeyEquivalents;
- (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
@@ -69,6 +71,15 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)automaticallyDetectsCacheModel;
- (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel;
+- (BOOL)webArchiveDebugModeEnabled;
+- (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
+
+- (BOOL)offlineWebApplicationCacheEnabled;
+- (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
+
+- (BOOL)zoomsTextOnly;
+- (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
+
// zero means do AutoScale
- (float)PDFScaleFactor;
- (void)setPDFScaleFactor:(float)scale;
@@ -90,6 +101,8 @@ extern NSString *WebPreferencesRemovedNotification;
- (void)_setFTPDirectoryTemplatePath:(NSString *)path;
- (void)_setForceFTPDirectoryListings:(BOOL)force;
- (BOOL)_forceFTPDirectoryListings;
+- (NSString *)_localStorageDatabasePath;
+- (void)_setLocalStorageDatabasePath:(NSString *)path;
// Other private methods
- (void)_postPreferencesChangesNotification;
@@ -105,4 +118,7 @@ extern NSString *WebPreferencesRemovedNotification;
- (void)willAddToWebView;
- (void)didRemoveFromWebView;
+// Force document tear down at application quit
+- (void)setFullDocumentTeardownEnabled:(BOOL)fullDocumentTeardownEnabled;
+- (BOOL)fullDocumentTeardownEnabled;
@end
diff --git a/WebKit/mac/WebView/WebRenderNode.mm b/WebKit/mac/WebView/WebRenderNode.mm
index 8d626e8..c34ac34 100644
--- a/WebKit/mac/WebView/WebRenderNode.mm
+++ b/WebKit/mac/WebView/WebRenderNode.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,19 +28,19 @@
#import "WebRenderNode.h"
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebHTMLView.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebNSViewExtras.h>
#import "WebFrameInternal.h"
+#import "WebFrameView.h"
+#import "WebHTMLView.h"
+#import <WebCore/Frame.h>
+#import <WebCore/RenderWidget.h>
+#import <WebCore/RenderView.h>
+#import <WebCore/Widget.h>
-@interface WebKitRenderTreeCopier : NSObject <WebCoreRenderTreeCopier>
-@end
+using namespace WebCore;
@implementation WebRenderNode
-- initWithName:(NSString *)n position: (NSPoint)p rect:(NSRect)r view:(NSView *)view children:(NSArray *)c
+- (id)initWithName:(NSString *)n position:(NSPoint)p rect:(NSRect)r view:(NSView *)view children:(NSArray *)c
{
NSMutableArray *collectChildren;
@@ -71,21 +71,45 @@
return self;
}
-- initWithWebFrameView:(WebFrameView *)view
+static WebRenderNode *copyRenderNode(RenderObject* node)
{
- WebKitRenderTreeCopier *copier;
+ NSMutableArray *children = [[NSMutableArray alloc] init];
+ for (RenderObject* child = node->firstChild(); child; child = child->nextSibling()) {
+ WebRenderNode *childCopy = copyRenderNode(child);
+ [children addObject:childCopy];
+ [childCopy release];
+ }
+
+ NSString *name = [[NSString alloc] initWithUTF8String:node->renderName()];
+ RenderWidget* renderWidget = node->isWidget() ? static_cast<RenderWidget*>(node) : 0;
+ Widget* widget = renderWidget ? renderWidget->widget() : 0;
+ NSView *view = widget ? widget->platformWidget() : nil;
+
+ int nx, ny;
+ node->absolutePosition(nx, ny);
+ WebRenderNode *result = [[WebRenderNode alloc] initWithName:name
+ position:NSMakePoint(nx, ny) rect:NSMakeRect(node->xPos(), node->yPos(), node->width(), node->height())
+ view:view children:children];
+
+ [name release];
+ [children release];
+
+ return result;
+}
+
+- (id)initWithWebFrameView:(WebFrameView *)view
+{
[self release];
- if (![[view documentView] isMemberOfClass:[WebHTMLView class]]) {
+ if (![[view documentView] isMemberOfClass:[WebHTMLView class]])
return nil;
- }
-
- copier = [[WebKitRenderTreeCopier alloc] init];
- self = [[[[[view webFrame] _dataSource] _bridge] copyRenderTree:copier] retain];
- [copier release];
-
- return self;
+
+ RenderObject* renderer = core([view webFrame])->contentRenderer();
+ if (!renderer)
+ return nil;
+
+ return copyRenderNode(renderer);
}
- (void)dealloc
@@ -126,12 +150,3 @@
}
@end
-
-@implementation WebKitRenderTreeCopier
-
-- (NSObject *)nodeWithName:(NSString *)name position: (NSPoint)p rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children
-{
- return [[[WebRenderNode alloc] initWithName:name position: p rect:rect view:view children:children] autorelease];
-}
-
-@end
diff --git a/WebKit/mac/WebView/WebResource.h b/WebKit/mac/WebView/WebResource.h
index 2544d78..7d817b7 100644
--- a/WebKit/mac/WebView/WebResource.h
+++ b/WebKit/mac/WebView/WebResource.h
@@ -28,7 +28,6 @@
#import <Foundation/Foundation.h>
-@class WebMainResourcePrivate;
@class WebResourcePrivate;
diff --git a/WebKit/mac/WebView/WebResource.mm b/WebKit/mac/WebView/WebResource.mm
index 5f2928d..6e0c9f0 100644
--- a/WebKit/mac/WebView/WebResource.mm
+++ b/WebKit/mac/WebView/WebResource.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,10 +28,20 @@
#import "WebResourcePrivate.h"
-#import "WebFrameBridge.h"
+#import "WebFrameInternal.h"
#import "WebNSDictionaryExtras.h"
#import "WebNSURLExtras.h"
+#import <WebCore/ArchiveResource.h>
+#import <WebCore/LegacyWebArchive.h>
+#import <WebCore/TextEncoding.h>
+#import <WebCore/WebCoreObjCExtras.h>
+#import <WebCore/WebCoreURLResponse.h>
+
+#import <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
static NSString * const WebResourceDataKey = @"WebResourceData";
static NSString * const WebResourceFrameNameKey = @"WebResourceFrameName";
static NSString * const WebResourceMIMETypeKey = @"WebResourceMIMEType";
@@ -44,29 +54,55 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
@interface WebResourcePrivate : NSObject
{
@public
- NSData *data;
- NSURL *URL;
- NSString *frameName;
- NSString *MIMEType;
- NSString *textEncodingName;
- NSURLResponse *response;
- BOOL shouldIgnoreWhenUnarchiving;
+ ArchiveResource* coreResource;
}
+
+- (id)initWithCoreResource:(PassRefPtr<ArchiveResource>)coreResource;
@end
@implementation WebResourcePrivate
+#ifndef BUILDING_ON_TIGER
++ (void)initialize
+{
+ WebCoreObjCFinalizeOnMainThread(self);
+}
+#endif
+
+- (id)init
+{
+ return [super init];
+}
+
+- (id)initWithCoreResource:(PassRefPtr<ArchiveResource>)passedResource
+{
+ self = [super init];
+ if (!self)
+ return self;
+
+ // Acquire the PassRefPtr<>'s ref as our own manual ref
+ coreResource = passedResource.releaseRef();
+
+ return self;
+}
+
- (void)dealloc
{
- [data release];
- [URL release];
- [frameName release];
- [MIMEType release];
- [textEncodingName release];
- [response release];
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebResourcePrivate class], self))
+ return;
+
+ if (coreResource)
+ coreResource->deref();
[super dealloc];
}
+- (void)finalize
+{
+ if (coreResource)
+ coreResource->deref();
+ [super finalize];
+}
+
@end
@implementation WebResource
@@ -87,45 +123,68 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
- (id)initWithCoder:(NSCoder *)decoder
{
- self = [self init];
+ self = [super init];
if (!self)
return nil;
+ NSData *data = nil;
+ NSURL *url = nil;
+ NSString *mimeType = nil, *textEncoding = nil, *frameName = nil;
+ NSURLResponse *response = nil;
+
@try {
id object = [decoder decodeObjectForKey:WebResourceDataKey];
if ([object isKindOfClass:[NSData class]])
- _private->data = [object retain];
+ data = object;
object = [decoder decodeObjectForKey:WebResourceURLKey];
if ([object isKindOfClass:[NSURL class]])
- _private->URL = [object retain];
+ url = object;
object = [decoder decodeObjectForKey:WebResourceMIMETypeKey];
if ([object isKindOfClass:[NSString class]])
- _private->MIMEType = [object retain];
+ mimeType = object;
object = [decoder decodeObjectForKey:WebResourceTextEncodingNameKey];
if ([object isKindOfClass:[NSString class]])
- _private->textEncodingName = [object retain];
+ textEncoding = object;
object = [decoder decodeObjectForKey:WebResourceFrameNameKey];
if ([object isKindOfClass:[NSString class]])
- _private->frameName = [object retain];
+ frameName = object;
object = [decoder decodeObjectForKey:WebResourceResponseKey];
if ([object isKindOfClass:[NSURLResponse class]])
- _private->response = [object retain];
+ response = object;
} @catch(id) {
[self release];
return nil;
}
+ _private = [[WebResourcePrivate alloc] initWithCoreResource:ArchiveResource::create(SharedBuffer::wrapNSData(data), url, mimeType, textEncoding, frameName, response)];
+
return self;
}
- (void)encodeWithCoder:(NSCoder *)encoder
{
- [encoder encodeObject:_private->data forKey:WebResourceDataKey];
- [encoder encodeObject:_private->URL forKey:WebResourceURLKey];
- [encoder encodeObject:_private->MIMEType forKey:WebResourceMIMETypeKey];
- [encoder encodeObject:_private->textEncodingName forKey:WebResourceTextEncodingNameKey];
- [encoder encodeObject:_private->frameName forKey:WebResourceFrameNameKey];
- [encoder encodeObject:_private->response forKey:WebResourceResponseKey];
+ ArchiveResource *resource = _private->coreResource;
+
+ NSData *data = nil;
+ NSURL *url = nil;
+ NSString *mimeType = nil, *textEncoding = nil, *frameName = nil;
+ NSURLResponse *response = nil;
+
+ if (resource) {
+ if (resource->data())
+ data = [resource->data()->createNSData() autorelease];
+ url = resource->url();
+ mimeType = resource->mimeType();
+ textEncoding = resource->textEncoding();
+ frameName = resource->frameName();
+ response = resource->response().nsURLResponse();
+ }
+ [encoder encodeObject:data forKey:WebResourceDataKey];
+ [encoder encodeObject:url forKey:WebResourceURLKey];
+ [encoder encodeObject:mimeType forKey:WebResourceMIMETypeKey];
+ [encoder encodeObject:textEncoding forKey:WebResourceTextEncodingNameKey];
+ [encoder encodeObject:frameName forKey:WebResourceFrameNameKey];
+ [encoder encodeObject:response forKey:WebResourceResponseKey];
}
- (void)dealloc
@@ -141,27 +200,29 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
- (NSData *)data
{
- return _private->data;
+ if (_private->coreResource && _private->coreResource->data())
+ return [_private->coreResource->data()->createNSData() autorelease];
+ return 0;
}
- (NSURL *)URL
{
- return _private->URL;
+ return _private->coreResource ? (NSURL *)_private->coreResource->url() : 0;
}
- (NSString *)MIMEType
{
- return _private->MIMEType;
+ return _private->coreResource ? (NSString *)_private->coreResource->mimeType() : 0;
}
- (NSString *)textEncodingName
{
- return _private->textEncodingName;
+ return _private->coreResource ? (NSString *)_private->coreResource->textEncoding() : 0;
}
- (NSString *)frameName
{
- return _private->frameName;
+ return _private->coreResource ? (NSString *)_private->coreResource->frameName() : 0;
}
- (id)description
@@ -171,46 +232,43 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
@end
-@implementation WebResource (WebResourcePrivate)
+@implementation WebResource (WebResourceInternal)
-// SPI for Mail (5066325)
-- (void)_ignoreWhenUnarchiving
+- (id)_initWithCoreResource:(PassRefPtr<ArchiveResource>)coreResource
{
- _private->shouldIgnoreWhenUnarchiving = YES;
+ self = [super init];
+ if (!self)
+ return nil;
+
+ ASSERT(coreResource);
+
+ // WebResources should not be init'ed with nil data, and doing so breaks certain uses of NSHTMLReader
+ // See <rdar://problem/5820157> for more info
+ if (!coreResource->data()) {
+ [self release];
+ return nil;
+ }
+
+ _private = [[WebResourcePrivate alloc] initWithCoreResource:coreResource];
+
+ return self;
}
-- (BOOL)_shouldIgnoreWhenUnarchiving
+- (WebCore::ArchiveResource *)_coreResource
{
- return _private->shouldIgnoreWhenUnarchiving;
+ return _private->coreResource;
}
-+ (NSArray *)_resourcesFromPropertyLists:(NSArray *)propertyLists
-{
- if (![propertyLists isKindOfClass:[NSArray class]]) {
- return nil;
- }
- NSEnumerator *enumerator = [propertyLists objectEnumerator];
- NSMutableArray *resources = [NSMutableArray array];
- NSDictionary *propertyList;
- while ((propertyList = [enumerator nextObject]) != nil) {
- WebResource *resource = [[WebResource alloc] _initWithPropertyList:propertyList];
- if (resource) {
- [resources addObject:resource];
- [resource release];
- }
- }
- return resources;
-}
+@end
-+ (NSArray *)_propertyListsFromResources:(NSArray *)resources
+@implementation WebResource (WebResourcePrivate)
+
+// SPI for Mail (5066325)
+// FIXME: This "ignoreWhenUnarchiving" concept is an ugly one - can we find a cleaner solution for those who need this SPI?
+- (void)_ignoreWhenUnarchiving
{
- NSEnumerator *enumerator = [resources objectEnumerator];
- NSMutableArray *propertyLists = [NSMutableArray array];
- WebResource *resource;
- while ((resource = [enumerator nextObject]) != nil) {
- [propertyLists addObject:[resource _propertyListRepresentation]];
- }
- return propertyLists;
+ if (_private->coreResource)
+ _private->coreResource->ignoreWhenUnarchiving();
}
- (id)_initWithData:(NSData *)data
@@ -221,128 +279,68 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
response:(NSURLResponse *)response
copyData:(BOOL)copyData
{
- [self init];
-
- if (!data) {
- [self release];
- return nil;
- }
- _private->data = copyData ? [data copy] : [data retain];
-
- if (!URL) {
- [self release];
+ self = [super init];
+ if (!self)
return nil;
- }
- _private->URL = [URL copy];
- if (!MIMEType) {
+ if (!data || !URL || !MIMEType) {
[self release];
return nil;
}
- _private->MIMEType = [MIMEType copy];
-
- _private->textEncodingName = [textEncodingName copy];
- _private->frameName = [frameName copy];
- _private->response = [response retain];
-
+
+ _private = [[WebResourcePrivate alloc] initWithCoreResource:ArchiveResource::create(SharedBuffer::wrapNSData(copyData ? [[data copy] autorelease] : data), URL, MIMEType, textEncodingName, frameName, response)];
+
return self;
}
-- (id)_initWithData:(NSData *)data URL:(NSURL *)URL response:(NSURLResponse *)response MIMEType:(NSString *)MIMEType
+- (id)_initWithData:(NSData *)data URL:(NSURL *)URL response:(NSURLResponse *)response
{
// Pass NO for copyData since the data doesn't need to be copied since we know that callers will no longer modify it.
// Copying it will also cause a performance regression.
return [self _initWithData:data
URL:URL
- MIMEType:MIMEType
+ MIMEType:[response _webcore_MIMEType]
textEncodingName:[response textEncodingName]
frameName:nil
response:response
copyData:NO];
}
-- (id)_initWithPropertyList:(id)propertyList
+- (NSFileWrapper *)_fileWrapperRepresentation
{
- if (![propertyList isKindOfClass:[NSDictionary class]]) {
- [self release];
- return nil;
- }
+ SharedBuffer* coreData = _private->coreResource ? _private->coreResource->data() : 0;
+ NSData *data = coreData ? [coreData->createNSData() autorelease] : nil;
- NSURLResponse *response = nil;
- NSData *responseData = [propertyList objectForKey:WebResourceResponseKey];
- if ([responseData isKindOfClass:[NSData class]]) {
- NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:responseData];
- @try {
- id responseObject = [unarchiver decodeObjectForKey:WebResourceResponseKey];
- if ([responseObject isKindOfClass:[NSURLResponse class]])
- response = responseObject;
- [unarchiver finishDecoding];
- } @catch(id) {
- response = nil;
- }
- [unarchiver release];
+ NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease];
+ NSString *preferredFilename = _private->coreResource ? (NSString *)_private->coreResource->response().suggestedFilename() : nil;
+ if (!preferredFilename || ![preferredFilename length]) {
+ NSURL *url = _private->coreResource ? (NSURL *)_private->coreResource->url() : nil;
+ NSString *mimeType = _private->coreResource ? (NSString *)_private->coreResource->mimeType() : nil;
+ preferredFilename = [url _webkit_suggestedFilenameWithMIMEType:mimeType];
}
-
- NSData *data = [propertyList objectForKey:WebResourceDataKey];
- NSString *URLString = [propertyList _webkit_stringForKey:WebResourceURLKey];
- return [self _initWithData:[data isKindOfClass:[NSData class]] ? data : nil
- URL:URLString ? [NSURL _web_URLWithDataAsString:URLString] : nil
- MIMEType:[propertyList _webkit_stringForKey:WebResourceMIMETypeKey]
- textEncodingName:[propertyList _webkit_stringForKey:WebResourceTextEncodingNameKey]
- frameName:[propertyList _webkit_stringForKey:WebResourceFrameNameKey]
- response:response
- copyData:NO];
-}
-
-- (NSFileWrapper *)_fileWrapperRepresentation
-{
- NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:_private->data] autorelease];
- NSString *preferredFilename = [_private->response suggestedFilename];
- if (!preferredFilename || ![preferredFilename length])
- preferredFilename = [_private->URL _webkit_suggestedFilenameWithMIMEType:_private->MIMEType];
+
[wrapper setPreferredFilename:preferredFilename];
return wrapper;
}
-- (id)_propertyListRepresentation
-{
- NSMutableDictionary *propertyList = [NSMutableDictionary dictionary];
- [propertyList setObject:_private->data forKey:WebResourceDataKey];
- [propertyList setObject:[_private->URL _web_originalDataAsString] forKey:WebResourceURLKey];
- [propertyList setObject:_private->MIMEType forKey:WebResourceMIMETypeKey];
- if (_private->textEncodingName != nil) {
- [propertyList setObject:_private->textEncodingName forKey:WebResourceTextEncodingNameKey];
- }
- if (_private->frameName != nil) {
- [propertyList setObject:_private->frameName forKey:WebResourceFrameNameKey];
- }
- if (_private->response != nil) {
- NSMutableData *responseData = [[NSMutableData alloc] init];
- NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:responseData];
- [archiver encodeObject:_private->response forKey:WebResourceResponseKey];
- [archiver finishEncoding];
- [archiver release];
- [propertyList setObject:responseData forKey:WebResourceResponseKey];
- [responseData release];
- }
- return propertyList;
-}
-
- (NSURLResponse *)_response
{
- if (_private->response != nil) {
- return _private->response;
- }
- return [[[NSURLResponse alloc] initWithURL:_private->URL
- MIMEType:_private->MIMEType
- expectedContentLength:[_private->data length]
- textEncodingName:_private->textEncodingName] autorelease];
+ NSURLResponse *response = nil;
+ if (_private->coreResource)
+ response = _private->coreResource->response().nsURLResponse();
+
+ return response ? response : [[[NSURLResponse alloc] init] autorelease];
}
- (NSString *)_stringValue
{
- NSString *textEncodingName = [self textEncodingName];
- return [WebFrameBridge stringWithData:_private->data textEncodingName:textEncodingName];
+ WebCore::TextEncoding encoding(_private->coreResource ? (NSString *)_private->coreResource->textEncoding() : nil);
+ if (!encoding.isValid())
+ encoding = WindowsLatin1Encoding();
+
+ SharedBuffer* coreData = _private->coreResource ? _private->coreResource->data() : 0;
+
+ return encoding.decode(reinterpret_cast<const char*>(coreData ? coreData->data() : 0), coreData ? coreData->size() : 0);
}
@end
diff --git a/WebKit/mac/WebView/WebArchiver.h b/WebKit/mac/WebView/WebResourceInternal.h
index c91ce5f..84f6aba 100644
--- a/WebKit/mac/WebView/WebArchiver.h
+++ b/WebKit/mac/WebView/WebResourceInternal.h
@@ -1,18 +1,18 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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.
+ * 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.
+ * 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
@@ -26,21 +26,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Foundation/Foundation.h>
+#import "WebResource.h"
-@class DOMNode;
-@class DOMRange;
-@class WebArchive;
-@class WebFrame;
+#import <wtf/PassRefPtr.h>
-@interface WebArchiver : NSObject
-{
+namespace WebCore {
+ class ArchiveResource;
}
-+ (WebArchive *)archiveNode:(DOMNode *)node;
-+ (WebArchive *)archiveRange:(DOMRange *)range;
-+ (WebArchive *)archiveSelectionInFrame:(WebFrame *)frame;
-+ (WebArchive *)archiveFrame:(WebFrame *)frame;
-+ (WebArchive *)archiveMainResourceForFrame:(WebFrame *)frame;
+@interface WebResource (WebResourceInternal)
+
+- (id)_initWithCoreResource:(WTF::PassRefPtr<WebCore::ArchiveResource>)coreResource;
+- (WebCore::ArchiveResource *)_coreResource;
@end
diff --git a/WebKit/mac/WebView/WebResourcePrivate.h b/WebKit/mac/WebView/WebResourcePrivate.h
index 34ae701..80d9835 100644
--- a/WebKit/mac/WebView/WebResourcePrivate.h
+++ b/WebKit/mac/WebView/WebResourcePrivate.h
@@ -38,18 +38,11 @@
response:(NSURLResponse *)response
copyData:(BOOL)copyData;
-- (id)_initWithData:(NSData *)data URL:(NSURL *)URL response:(NSURLResponse *)response MIMEType:(NSString *)MIMEType;
+- (id)_initWithData:(NSData *)data URL:(NSURL *)URL response:(NSURLResponse *)response;
-- (BOOL)_shouldIgnoreWhenUnarchiving;
- (void)_ignoreWhenUnarchiving;
-+ (NSArray *)_resourcesFromPropertyLists:(NSArray *)propertyLists;
-+ (NSArray *)_propertyListsFromResources:(NSArray *)resources;
-
-- (id)_initWithPropertyList:(id)propertyList;
-
- (NSFileWrapper *)_fileWrapperRepresentation;
-- (id)_propertyListRepresentation;
- (NSURLResponse *)_response;
- (NSString *)_stringValue;
diff --git a/WebKit/mac/WebView/WebScriptDebugDelegate.h b/WebKit/mac/WebView/WebScriptDebugDelegate.h
index 7a4c349..fba48f6 100644
--- a/WebKit/mac/WebView/WebScriptDebugDelegate.h
+++ b/WebKit/mac/WebView/WebScriptDebugDelegate.h
@@ -37,7 +37,8 @@
@class WebView;
@class WebFrame;
@class WebScriptCallFrame;
-@class WebCoreScriptCallFrame;
+@class WebScriptCallFramePrivate;
+@class WebScriptObject;
extern NSString * const WebScriptErrorDomain;
extern NSString * const WebScriptErrorDescriptionKey;
@@ -106,8 +107,8 @@ enum {
@interface WebScriptCallFrame : NSObject
{
@private
- WebCoreScriptCallFrame *_private;
- id _userInfo;
+ WebScriptCallFramePrivate* _private;
+ id _userInfo;
}
// associate user info with frame
diff --git a/WebKit/mac/WebView/WebScriptDebugDelegate.mm b/WebKit/mac/WebView/WebScriptDebugDelegate.mm
index 71ad1ef..be0a0d5 100644
--- a/WebKit/mac/WebView/WebScriptDebugDelegate.mm
+++ b/WebKit/mac/WebView/WebScriptDebugDelegate.mm
@@ -26,17 +26,24 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebScriptDebugDelegatePrivate.h"
-
+#import "WebScriptDebugger.h"
#import "WebDataSource.h"
#import "WebDataSourceInternal.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
-#import "WebScriptDebugServerPrivate.h"
+#import "WebScriptDebugDelegate.h"
#import "WebViewInternal.h"
+#import <debugger/DebuggerCallFrame.h>
+#import <runtime/ExecState.h>
+#import <runtime/JSGlobalObject.h>
+#import <runtime/JSFunction.h>
+#import <runtime/JSLock.h>
+#import <kjs/interpreter.h>
#import <WebCore/Frame.h>
-#import <WebCore/WebCoreScriptDebugger.h>
+#import <WebCore/WebScriptObjectPrivate.h>
+#import <WebCore/ScriptController.h>
+#import <WebCore/runtime_root.h>
+using namespace JSC;
using namespace WebCore;
// FIXME: these error strings should be public for future use by WebScriptObject and in WebScriptObject.h
@@ -46,100 +53,80 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber";
@interface WebScriptCallFrame (WebScriptDebugDelegateInternal)
-- (WebScriptCallFrame *)_initWithFrame:(WebCoreScriptCallFrame *)frame;
+- (id)_convertValueToObjcValue:(JSValue*)value;
@end
-@implementation WebScriptDebugger
-
-- (WebScriptDebugger *)initWithWebFrame:(WebFrame *)webFrame
-{
- if ((self = [super init])) {
- _webFrame = webFrame;
- _debugger = [[WebCoreScriptDebugger alloc] initWithDelegate:self];
- }
- return self;
+@interface WebScriptCallFramePrivate : NSObject {
+@public
+ WebScriptObject *globalObject; // the global object's proxy (not retained)
+ WebScriptCallFrame *caller; // previous stack frame
+ DebuggerCallFrame* debuggerCallFrame;
}
+@end
+@implementation WebScriptCallFramePrivate
- (void)dealloc
{
- [_debugger release];
+ [caller release];
+ delete debuggerCallFrame;
[super dealloc];
}
+@end
-- (WebScriptObject *)globalObject
-{
- return core(_webFrame)->windowScriptObject();
-}
+// WebScriptCallFrame
+//
+// One of these is created to represent each stack frame. Additionally, there is a "global"
+// frame to represent the outermost scope. This global frame is always the last frame in
+// the chain of callers.
+//
+// The delegate can assign a "wrapper" to each frame object so it can relay calls through its
+// own exported interface. This class is private to WebCore (and the delegate).
-- (id)newWrapperForFrame:(WebCoreScriptCallFrame *)frame
-{
- return [[WebScriptCallFrame alloc] _initWithFrame:frame];
-}
+@implementation WebScriptCallFrame (WebScriptDebugDelegateInternal)
-- (void)parsedSource:(NSString *)source fromURL:(NSURL *)url sourceId:(int)sid startLine:(int)startLine errorLine:(int)errorLine errorMessage:(NSString *)errorMessage
+- (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame
{
- WebView *webView = [_webFrame webView];
- if (errorLine == -1) {
- [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:source baseLineNumber:startLine fromURL:url sourceId:sid forWebFrame:_webFrame];
- [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:source fromURL:[url absoluteString] sourceId:sid forWebFrame:_webFrame]; // deprecated delegate method
- if ([WebScriptDebugServer listenerCount])
- [[WebScriptDebugServer sharedScriptDebugServer] webView:webView didParseSource:source baseLineNumber:startLine fromURL:url sourceId:sid forWebFrame:_webFrame];
- } else {
- NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:errorMessage, WebScriptErrorDescriptionKey, [NSNumber numberWithUnsignedInt:errorLine], WebScriptErrorLineNumberKey, nil];
- NSError *error = [[NSError alloc] initWithDomain:WebScriptErrorDomain code:WebScriptGeneralErrorCode userInfo:info];
- [[webView _scriptDebugDelegateForwarder] webView:webView failedToParseSource:source baseLineNumber:startLine fromURL:url withError:error forWebFrame:_webFrame];
- if ([WebScriptDebugServer listenerCount])
- [[WebScriptDebugServer sharedScriptDebugServer] webView:webView failedToParseSource:source baseLineNumber:startLine fromURL:url withError:error forWebFrame:_webFrame];
- [error release];
- [info release];
+ if ((self = [super init])) {
+ _private = [[WebScriptCallFramePrivate alloc] init];
+ _private->globalObject = globalObj;
+ _private->caller = [caller retain];
}
+ return self;
}
-- (void)enteredFrame:(WebCoreScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno
-{
- WebView *webView = [_webFrame webView];
- [[webView _scriptDebugDelegateForwarder] webView:webView didEnterCallFrame:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
- if ([WebScriptDebugServer listenerCount])
- [[WebScriptDebugServer sharedScriptDebugServer] webView:webView didEnterCallFrame:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
-}
-
-- (void)hitStatement:(WebCoreScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno
+- (void)_setDebuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame
{
- WebView *webView = [_webFrame webView];
- [[webView _scriptDebugDelegateForwarder] webView:webView willExecuteStatement:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
- if ([WebScriptDebugServer listenerCount])
- [[WebScriptDebugServer sharedScriptDebugServer] webView:webView willExecuteStatement:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
+ if (!_private->debuggerCallFrame)
+ _private->debuggerCallFrame = new DebuggerCallFrame(debuggerCallFrame);
+ else
+ *_private->debuggerCallFrame = debuggerCallFrame;
}
-- (void)leavingFrame:(WebCoreScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno
+- (void)_clearDebuggerCallFrame
{
- WebView *webView = [_webFrame webView];
- [[webView _scriptDebugDelegateForwarder] webView:webView willLeaveCallFrame:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
- if ([WebScriptDebugServer listenerCount])
- [[WebScriptDebugServer sharedScriptDebugServer] webView:webView willLeaveCallFrame:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
+ delete _private->debuggerCallFrame;
+ _private->debuggerCallFrame = 0;
}
-- (void)exceptionRaised:(WebCoreScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno
+- (id)_convertValueToObjcValue:(JSValue*)value
{
- WebView *webView = [_webFrame webView];
- [[webView _scriptDebugDelegateForwarder] webView:webView exceptionWasRaised:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
- if ([WebScriptDebugServer listenerCount])
- [[WebScriptDebugServer sharedScriptDebugServer] webView:webView exceptionWasRaised:[frame wrapper] sourceId:sid line:lineno forWebFrame:_webFrame];
-}
-
-@end
+ if (!value)
+ return nil;
+ WebScriptObject *globalObject = _private->globalObject;
+ if (value == [globalObject _imp])
+ return globalObject;
+ Bindings::RootObject* root1 = [globalObject _originRootObject];
+ if (!root1)
+ return nil;
-@implementation WebScriptCallFrame (WebScriptDebugDelegateInternal)
+ Bindings::RootObject* root2 = [globalObject _rootObject];
+ if (!root2)
+ return nil;
-- (WebScriptCallFrame *)_initWithFrame:(WebCoreScriptCallFrame *)frame
-{
- if ((self = [super init])) {
- _private = frame;
- }
- return self;
+ return [WebScriptObject _convertValueToObjcValue:value originRootObject:root1 rootObject:root2];
}
@end
@@ -151,6 +138,7 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber";
- (void) dealloc
{
[_userInfo release];
+ [_private release];
[super dealloc];
}
@@ -169,27 +157,75 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber";
- (WebScriptCallFrame *)caller
{
- return [[_private caller] wrapper];
+ return _private->caller;
}
+// Returns an array of scope objects (most local first).
+// The properties of each scope object are the variables for that scope.
+// Note that the last entry in the array will _always_ be the global object (windowScriptObject),
+// whose properties are the global variables.
+
- (NSArray *)scopeChain
{
- return [_private scopeChain];
+ if (!_private->debuggerCallFrame)
+ return [NSArray array];
+
+ const ScopeChainNode* scopeChain = _private->debuggerCallFrame->scopeChain();
+ if (!scopeChain->next) // global frame
+ return [NSArray arrayWithObject:_private->globalObject];
+
+ NSMutableArray *scopes = [[NSMutableArray alloc] init];
+
+ ScopeChainIterator end = scopeChain->end();
+ for (ScopeChainIterator it = scopeChain->begin(); it != end; ++it)
+ [scopes addObject:[self _convertValueToObjcValue:(*it)]];
+
+ NSArray *result = [NSArray arrayWithArray:scopes];
+ [scopes release];
+ return result;
}
+// Returns the name of the function for this frame, if available.
+// Returns nil for anonymous functions and for the global frame.
+
- (NSString *)functionName
{
- return [_private functionName];
+ if (!_private->debuggerCallFrame)
+ return nil;
+
+ const UString* functionName = _private->debuggerCallFrame->functionName();
+ return functionName ? toNSString(*functionName) : nil;
}
+// Returns the pending exception for this frame (nil if none).
+
- (id)exception
{
- return [_private exception];
+ if (!_private->debuggerCallFrame)
+ return nil;
+
+ JSValue* exception = _private->debuggerCallFrame->exception();
+ return exception ? [self _convertValueToObjcValue:exception] : nil;
}
+// Evaluate some JavaScript code in the context of this frame.
+// The code is evaluated as if by "eval", and the result is returned.
+// If there is an (uncaught) exception, it is returned as though _it_ were the result.
+// Calling this method on the global frame is not quite the same as calling the WebScriptObject
+// method of the same name, due to the treatment of exceptions.
+
- (id)evaluateWebScript:(NSString *)script
{
- return [_private evaluateWebScript:script];
+ if (!_private->debuggerCallFrame)
+ return nil;
+
+ JSLock lock(false);
+
+ JSValue* exception = noValue();
+ JSValue* result = _private->debuggerCallFrame->evaluate(String(script), exception);
+ if (exception)
+ return [self _convertValueToObjcValue:exception];
+ return result ? [self _convertValueToObjcValue:result] : nil;
}
@end
diff --git a/WebKit/mac/WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h b/WebKit/mac/WebView/WebScriptDebugger.h
index 3f74097..caec994 100644
--- a/WebKit/mac/WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h
+++ b/WebKit/mac/WebView/WebScriptDebugger.h
@@ -1,18 +1,18 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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.
+ * 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.
+ * 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
@@ -26,25 +26,42 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebPlugInStreamLoaderDelegate.h>
-#import <WebCore/NetscapePlugInStreamLoader.h>
-#import <wtf/RetainPtr.h>
+#ifndef WebScriptDebugger_h
+#define WebScriptDebugger_h
-namespace WebCore {
- class NetscapePlugInStreamLoader;
- class ResourceResponse;
-};
+#include <debugger/Debugger.h>
+
+#include <wtf/RetainPtr.h>
+
+namespace JSC {
+ class DebuggerCallFrame;
+ class ExecState;
+ class JSGlobalObject;
+ class JSObject;
+ class ArgList;
+ class UString;
+}
-typedef id <WebPlugInStreamLoaderDelegate> PlugInStreamLoaderDelegate;
+@class WebScriptCallFrame;
-class WebNetscapePlugInStreamLoaderClient : public WebCore::NetscapePlugInStreamLoaderClient {
+NSString *toNSString(const JSC::UString&);
+
+class WebScriptDebugger : public JSC::Debugger {
public:
- WebNetscapePlugInStreamLoaderClient(PlugInStreamLoaderDelegate delegate) : m_stream(delegate) { }
- virtual void didReceiveResponse(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceResponse&);
- virtual void didReceiveData(WebCore::NetscapePlugInStreamLoader*, const char*, int);
- virtual void didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError&);
- virtual void didFinishLoading(WebCore::NetscapePlugInStreamLoader*);
+ WebScriptDebugger(JSC::JSGlobalObject*);
+
+ virtual void sourceParsed(JSC::ExecState*, const JSC::SourceCode&, int errorLine, const JSC::UString& errorMsg);
+ virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
+ virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
+ virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
+ virtual void exception(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
+ virtual void willExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
+ virtual void didExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
+ virtual void didReachBreakpoint(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
private:
- RetainPtr<PlugInStreamLoaderDelegate> m_stream;
+ bool m_callingDelegate;
+ RetainPtr<WebScriptCallFrame> m_topCallFrame;
};
+
+#endif // WebScriptDebugger_h
diff --git a/WebKit/mac/WebView/WebScriptDebugger.mm b/WebKit/mac/WebView/WebScriptDebugger.mm
new file mode 100644
index 0000000..0dd6b0e
--- /dev/null
+++ b/WebKit/mac/WebView/WebScriptDebugger.mm
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 "WebScriptDebugger.h"
+
+#import "WebFrameInternal.h"
+#import "WebViewInternal.h"
+#import "WebScriptDebugDelegate.h"
+#import <runtime/JSGlobalObject.h>
+#import <debugger/DebuggerCallFrame.h>
+#import <WebCore/DOMWindow.h>
+#import <WebCore/Frame.h>
+#import <WebCore/JSDOMWindow.h>
+#import <WebCore/KURL.h>
+#import <WebCore/ScriptController.h>
+
+using namespace JSC;
+using namespace WebCore;
+
+@interface WebScriptCallFrame (WebScriptDebugDelegateInternal)
+- (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame;
+- (void)_setDebuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame;
+- (void)_clearDebuggerCallFrame;
+@end
+
+NSString *toNSString(const UString& s)
+{
+ if (s.isEmpty())
+ return nil;
+ return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.size()];
+}
+
+NSString *toNSString(const SourceCode& s)
+{
+ if (!s.length())
+ return nil;
+ return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.length()];
+}
+
+// convert UString to NSURL
+static NSURL *toNSURL(const UString& s)
+{
+ if (s.isEmpty())
+ return nil;
+ return KURL(s);
+}
+
+static WebFrame *toWebFrame(JSGlobalObject* globalObject)
+{
+ JSDOMWindow* window = static_cast<JSDOMWindow*>(globalObject);
+ return kit(window->impl()->frame());
+}
+
+WebScriptDebugger::WebScriptDebugger(JSGlobalObject* globalObject)
+ : m_callingDelegate(false)
+{
+ attach(globalObject);
+ callEvent(globalObject->globalExec(), 0, -1);
+}
+
+// callbacks - relay to delegate
+void WebScriptDebugger::sourceParsed(ExecState* exec, const SourceCode& source, int errorLine, const UString& errorMsg)
+{
+ if (m_callingDelegate)
+ return;
+
+ m_callingDelegate = true;
+
+ NSString *nsSource = toNSString(source);
+ NSURL *nsURL = toNSURL(source.provider()->url());
+
+ WebFrame *webFrame = toWebFrame(exec->dynamicGlobalObject());
+ WebView *webView = [webFrame webView];
+ if (errorLine == -1) {
+ [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:nsSource baseLineNumber:source.firstLine() fromURL:nsURL sourceId:static_cast<int>(source.provider()->asID()) forWebFrame:webFrame];
+ [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:nsSource fromURL:[nsURL absoluteString] sourceId:static_cast<int>(source.provider()->asID()) forWebFrame:webFrame]; // deprecated delegate method
+ } 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];
+ [error release];
+ [info release];
+ }
+
+ m_callingDelegate = false;
+}
+
+void WebScriptDebugger::callEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+ if (m_callingDelegate)
+ return;
+
+ m_callingDelegate = true;
+
+ WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject());
+
+ m_topCallFrame.adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script()->windowScriptObject() caller:m_topCallFrame.get() debuggerCallFrame:debuggerCallFrame]);
+
+ WebView *webView = [webFrame webView];
+ [[webView _scriptDebugDelegateForwarder] webView:webView didEnterCallFrame:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame];
+
+ m_callingDelegate = false;
+}
+
+void WebScriptDebugger::atStatement(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+ if (m_callingDelegate)
+ return;
+
+ m_callingDelegate = true;
+
+ WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject());
+ WebView *webView = [webFrame webView];
+
+ [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame];
+ [[webView _scriptDebugDelegateForwarder] webView:webView willExecuteStatement:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame];
+
+ m_callingDelegate = false;
+}
+
+void WebScriptDebugger::returnEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+ if (m_callingDelegate)
+ return;
+
+ m_callingDelegate = true;
+
+ WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject());
+ WebView *webView = [webFrame webView];
+
+ [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame];
+ [[webView _scriptDebugDelegateForwarder] webView:webView willLeaveCallFrame:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame];
+
+ [m_topCallFrame.get() _clearDebuggerCallFrame];
+ m_topCallFrame = [m_topCallFrame.get() caller];
+
+ m_callingDelegate = false;
+}
+
+void WebScriptDebugger::exception(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+ if (m_callingDelegate)
+ return;
+
+ m_callingDelegate = true;
+
+ WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject());
+ WebView *webView = [webFrame webView];
+ [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame];
+
+ [[webView _scriptDebugDelegateForwarder] webView:webView exceptionWasRaised:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame];
+
+ m_callingDelegate = false;
+}
+
+void WebScriptDebugger::willExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineno)
+{
+}
+
+void WebScriptDebugger::didExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineno)
+{
+}
+
+void WebScriptDebugger::didReachBreakpoint(const DebuggerCallFrame&, intptr_t, int)
+{
+ return;
+}
diff --git a/WebKit/mac/WebView/WebTextIterator.h b/WebKit/mac/WebView/WebTextIterator.h
new file mode 100644
index 0000000..e6f77ac
--- /dev/null
+++ b/WebKit/mac/WebView/WebTextIterator.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 DOMRange;
+@class DOMNode;
+@class WebTextIteratorPrivate;
+
+@interface WebTextIterator : NSObject
+{
+@private
+ WebTextIteratorPrivate *_private;
+}
+
+- (id)initWithRange:(DOMRange *)range;
+
+/*!
+ @method advance:
+ @abstract Makes the WebTextIterator iterate to the next visible text element.
+ */
+- (void)advance;
+
+/*!
+ @method currentNode:
+ @result The current DOMNode in the WebTextIterator.
+ */
+- (DOMNode *)currentNode;
+
+/*!
+ @method currentText:
+ @result The current text in the WebTextIterator.
+ */
+- (NSString *)currentText;
+
+/*!
+ @method atEnd:
+ @result YES if the WebTextIterator has reached the end of the DOMRange.
+ */
+- (BOOL)atEnd;
+
+
+@end
diff --git a/WebKit/mac/WebView/WebTextIterator.mm b/WebKit/mac/WebView/WebTextIterator.mm
new file mode 100644
index 0000000..86db6d3
--- /dev/null
+++ b/WebKit/mac/WebView/WebTextIterator.mm
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 "WebTextIterator.h"
+
+#import "DOMNodeInternal.h"
+#import "DOMRangeInternal.h"
+#import <WebCore/TextIterator.h>
+#import <wtf/Vector.h>
+
+using namespace WebCore;
+
+@interface WebTextIteratorPrivate : NSObject
+{
+@public
+ TextIterator* m_textIterator;
+}
+@end
+
+@implementation WebTextIteratorPrivate
+
+- (void)dealloc
+{
+ delete m_textIterator;
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ delete m_textIterator;
+ [super finalize];
+}
+
+@end
+
+@implementation WebTextIterator
+
+- (void)dealloc
+{
+ [_private release];
+ [super dealloc];
+}
+
+- (id)initWithRange:(DOMRange *)range
+{
+ self = [super init];
+ if (!self)
+ return self;
+
+ _private = [[WebTextIteratorPrivate alloc] init];
+ _private->m_textIterator = new TextIterator([range _range], true, false);
+ return self;
+}
+
+- (void)advance
+{
+ ASSERT(_private->m_textIterator);
+
+ if (_private->m_textIterator->atEnd())
+ return;
+
+ _private->m_textIterator->advance();
+}
+
+- (DOMNode *)currentNode
+{
+ ASSERT(_private->m_textIterator);
+
+ return [DOMNode _wrapNode:_private->m_textIterator->node()];
+}
+
+- (NSString *)currentText
+{
+ ASSERT(_private->m_textIterator);
+
+ return [NSString stringWithCharacters:_private->m_textIterator->characters() length:_private->m_textIterator->length()];
+}
+
+- (BOOL)atEnd
+{
+ ASSERT(_private->m_textIterator);
+
+ return _private->m_textIterator->atEnd();
+}
+
+@end
diff --git a/WebKit/mac/WebView/WebUIDelegate.h b/WebKit/mac/WebView/WebUIDelegate.h
index 15c4444..8440bcb 100644
--- a/WebKit/mac/WebView/WebUIDelegate.h
+++ b/WebKit/mac/WebView/WebUIDelegate.h
@@ -28,6 +28,7 @@
#import <Cocoa/Cocoa.h>
#import <Foundation/NSURLRequest.h>
+#import <JavaScriptCore/WebKitAvailability.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
#define WebNSUInteger unsigned int
@@ -128,6 +129,13 @@ typedef enum {
- (void)chooseFilename:(NSString *)fileName;
/*!
+ @method chooseFilenames:
+ @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);
+
+/*!
@method cancel
@abstract Call this method to indicate that the file open panel was cancelled.
*/
@@ -380,7 +388,7 @@ typedef enum {
- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WebFrame *)frame;
/*!
- @method webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:
+ @method webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:
@abstract Display a confirm panel by an "before unload" event handler.
@param sender The WebView sending the delegate method.
@param message The message to display.
@@ -403,6 +411,17 @@ typedef enum {
- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener;
/*!
+ @method webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles
+ @abstract Display a file open panel for a file input control that may allow multiple files to be selected.
+ @param sender The WebView sending the delegate method.
+ @param resultListener The object to call back with the results.
+ @param allowMultipleFiles YES if the open panel should allow myltiple files to be selected, NO if not.
+ @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);
+
+/*!
@method webView:mouseDidMoveOverElement:modifierFlags:
@abstract Update the window's feedback for mousing over links to reflect a new item the mouse is over
or new modifier flags.
@@ -543,13 +562,13 @@ typedef enum {
// The following delegate methods are deprecated in favor of the ones above that specify
// the WebFrame whose JavaScript initiated this call.
-- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message;
-- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message;
-- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText;
+- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
+- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
+- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
// The following delegate methods are deprecated. Content rect calculations are now done automatically.
-- (void)webView:(WebView *)sender setContentRect:(NSRect)frame;
-- (NSRect)webViewContentRect:(WebView *)sender;
+- (void)webView:(WebView *)sender setContentRect:(NSRect)frame WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
+- (NSRect)webViewContentRect:(WebView *)sender WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
@end
diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h
index 62ef3f9..6a3c32f 100644
--- a/WebKit/mac/WebView/WebUIDelegatePrivate.h
+++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h
@@ -28,6 +28,10 @@
#import <WebKit/WebUIDelegate.h>
+#if !defined(ENABLE_DASHBOARD_SUPPORT)
+#define ENABLE_DASHBOARD_SUPPORT 1
+#endif
+
// Mail on Tiger expects the old value for WebMenuItemTagSearchInGoogle
#define WebMenuItemTagSearchInGoogle OldWebMenuItemTagSearchWeb
@@ -74,8 +78,10 @@ enum {
- (NSView *)webView:(WebView *)webView plugInViewWithArguments:(NSDictionary *)arguments;
+#if ENABLE_DASHBOARD_SUPPORT
// regions is an dictionary whose keys are regions label and values are arrays of WebDashboardRegions.
- (void)webView:(WebView *)webView dashboardRegionsChanged:(NSDictionary *)regions;
+#endif
- (void)webView:(WebView *)sender dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag forView:(NSView *)view;
- (void)webView:(WebView *)sender didDrawRect:(NSRect)rect;
@@ -97,4 +103,7 @@ enum {
- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request windowFeatures:(NSDictionary *)features;
+- (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename;
+- (NSString *)webView:(WebView *)sender generateReplacementFile:(NSString *)path;
+
@end
diff --git a/WebKit/mac/WebView/WebUnarchivingState.h b/WebKit/mac/WebView/WebUnarchivingState.h
deleted file mode 100644
index 84d808b..0000000
--- a/WebKit/mac/WebView/WebUnarchivingState.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2006 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>
-
-@class WebArchive;
-@class WebResource;
-
-@interface WebUnarchivingState : NSObject
-{
- NSMutableDictionary *archivedSubframes;
- NSMutableDictionary *archivedResources;
-}
-
-- (void)addArchive:(WebArchive *)archive;
-- (void)addResource:(WebResource *)resource;
-- (WebResource *)archivedResourceForURL:(NSURL *)URL;
-- (WebArchive *)popSubframeArchiveWithFrameName:(NSString *)frameName;
-
-@end
diff --git a/WebKit/mac/WebView/WebUnarchivingState.m b/WebKit/mac/WebView/WebUnarchivingState.m
deleted file mode 100644
index c1b975a..0000000
--- a/WebKit/mac/WebView/WebUnarchivingState.m
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
- * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
- *
- * 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 "WebUnarchivingState.h"
-
-#import "WebArchive.h"
-#import <JavaScriptCore/Assertions.h>
-#import "WebResource.h"
-#import "WebResourcePrivate.h"
-#import "WebNSURLExtras.h"
-
-@implementation WebUnarchivingState
-
-- (id)init
-{
- if (!(self = [super init]))
- return nil;
-
- archivedSubframes = [[NSMutableDictionary alloc] init];
- archivedResources = [[NSMutableDictionary alloc] init];
-
- return self;
-}
-
-- (void)dealloc
-{
- [archivedSubframes release];
- [archivedResources release];
- [super dealloc];
-}
-
-- (void)addArchive:(WebArchive *)archive
-{
- NSEnumerator *enumerator = [[archive subresources] objectEnumerator];
- WebResource *subresource;
- while ((subresource = [enumerator nextObject]) != nil)
- [archivedResources setObject:subresource forKey:[[subresource URL] _web_originalDataAsString]];
-
- enumerator = [[archive subframeArchives] objectEnumerator];
- WebArchive *subframeArchive;
- while ((subframeArchive = [enumerator nextObject]) != nil) {
- NSString *frameName = [[subframeArchive mainResource] frameName];
- if (frameName)
- [archivedSubframes setObject:subframeArchive forKey:frameName];
- }
-}
-
-- (void)addResource:(WebResource *)subresource
-{
- [archivedResources setObject:subresource forKey:[[subresource URL] _web_originalDataAsString]];
-}
-
-- (WebResource *)archivedResourceForURL:(NSURL *)URL
-{
- WebResource *resource = [archivedResources objectForKey:[URL _web_originalDataAsString]];
- if ([resource _shouldIgnoreWhenUnarchiving])
- return nil;
- return resource;
-}
-
-- (WebArchive *)popSubframeArchiveWithFrameName:(NSString *)frameName
-{
- ASSERT(frameName != nil);
-
- WebArchive *archive = [[[archivedSubframes objectForKey:frameName] retain] autorelease];
- if (archive != nil)
- [archivedSubframes removeObjectForKey:frameName];
-
- return archive;
-}
-
-@end
diff --git a/WebKit/mac/WebView/WebView.h b/WebKit/mac/WebView/WebView.h
index 6038703..30aa7bd 100644
--- a/WebKit/mac/WebView/WebView.h
+++ b/WebKit/mac/WebView/WebView.h
@@ -617,6 +617,22 @@ extern NSString *WebViewProgressFinishedNotification;
- (BOOL)drawsBackground;
/*!
+ @method setShouldUpdateWhileOffscreen:
+ @abstract Sets whether the receiver must update even when it is not in a window that is currently visible.
+ @param updateWhileOffscreen whether the receiver is required to render updates to the web page when it is not in a visible window.
+ @abstract If set to NO, then whenever the web view is not in a visible window, updates to the web page will not necessarily be rendered in the view.
+ However, when the window is made visible, the view will be updated automatically. Not updating while hidden can improve performance. If set to is YES,
+ hidden web views are always updated. This is the default.
+*/
+- (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen;
+
+/*!
+ @method shouldUpdateWhileOffscreen
+ @result Returns whether the web view is always updated even when it is not in a window that is currently visible.
+*/
+- (BOOL)shouldUpdateWhileOffscreen;
+
+/*!
@method setMainFrameURL:
@param URLString The URL to load in the mainFrame.
*/
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index f5285f4..a52d3b5 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -30,15 +30,13 @@
#import "WebViewInternal.h"
#import "DOMRangeInternal.h"
-#import "WebBackForwardList.h"
#import "WebBackForwardListInternal.h"
#import "WebBaseNetscapePluginView.h"
#import "WebChromeClient.h"
#import "WebContextMenuClient.h"
#import "WebDOMOperationsPrivate.h"
-#import "WebDatabaseManagerInternal.h"
-#import "WebDatabaseManagerPrivate.h"
#import "WebDataSourceInternal.h"
+#import "WebDatabaseManagerInternal.h"
#import "WebDefaultEditingDelegate.h"
#import "WebDefaultPolicyDelegate.h"
#import "WebDefaultScriptDebugDelegate.h"
@@ -48,17 +46,15 @@
#import "WebDownload.h"
#import "WebDownloadInternal.h"
#import "WebDragClient.h"
-#import "WebDynamicScrollBarsView.h"
+#import "WebDynamicScrollBarsViewInternal.h"
#import "WebEditingDelegate.h"
#import "WebEditorClient.h"
#import "WebFormDelegatePrivate.h"
-#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebFrameViewInternal.h"
#import "WebHTMLRepresentation.h"
#import "WebHTMLViewInternal.h"
#import "WebHistoryItemInternal.h"
-#import "WebIconDatabase.h"
#import "WebIconDatabaseInternal.h"
#import "WebInspector.h"
#import "WebInspectorClient.h"
@@ -69,6 +65,7 @@
#import "WebKitSystemBits.h"
#import "WebKitVersionChecks.h"
#import "WebLocalizableStrings.h"
+#import "WebNodeHighlight.h"
#import "WebNSDataExtras.h"
#import "WebNSDataExtrasPrivate.h"
#import "WebNSDictionaryExtras.h"
@@ -80,20 +77,19 @@
#import "WebNSURLRequestExtras.h"
#import "WebNSUserDefaultsExtras.h"
#import "WebNSViewExtras.h"
+#import "WebPDFView.h"
#import "WebPanelAuthenticationHandler.h"
#import "WebPasteboardHelper.h"
-#import "WebPDFView.h"
#import "WebPluginDatabase.h"
#import "WebPolicyDelegate.h"
#import "WebPreferenceKeysPrivate.h"
#import "WebPreferencesPrivate.h"
-#import "WebScriptDebugDelegatePrivate.h"
-#import "WebScriptDebugServerPrivate.h"
+#import "WebTextIterator.h"
#import "WebUIDelegate.h"
#import "WebUIDelegatePrivate.h"
#import <CoreFoundation/CFSet.h>
#import <Foundation/NSURLConnection.h>
-#import <JavaScriptCore/Assertions.h>
+#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/Cache.h>
#import <WebCore/ColorMac.h>
#import <WebCore/Document.h>
@@ -101,37 +97,52 @@
#import <WebCore/DragController.h>
#import <WebCore/DragData.h>
#import <WebCore/Editor.h>
+#import <WebCore/EventHandler.h>
#import <WebCore/ExceptionHandlers.h>
+#import <WebCore/FocusController.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameView.h>
#import <WebCore/FrameTree.h>
+#import <WebCore/GCController.h>
#import <WebCore/HTMLNames.h>
#import <WebCore/HistoryItem.h>
#import <WebCore/Logging.h>
#import <WebCore/MIMETypeRegistry.h>
#import <WebCore/Page.h>
#import <WebCore/PageCache.h>
+#import <WebCore/PageGroup.h>
#import <WebCore/PlatformMouseEvent.h>
#import <WebCore/ProgressTracker.h>
+#import <WebCore/ScriptController.h>
#import <WebCore/SelectionController.h>
#import <WebCore/Settings.h>
#import <WebCore/TextResourceDecoder.h>
-#import <WebCore/WebCoreFrameBridge.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebCore/WebCoreTextRenderer.h>
#import <WebCore/WebCoreView.h>
#import <WebKit/DOM.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMPrivate.h>
-#import <WebKit/WebDashboardRegion.h>
#import <WebKitSystemInterface.h>
+#import <runtime/ArrayPrototype.h>
+#import <runtime/DateInstance.h>
+#import <runtime/InitializeThreading.h>
+#import <runtime/JSLock.h>
#import <mach-o/dyld.h>
#import <objc/objc-auto.h>
#import <objc/objc-runtime.h>
-#import <wtf/RefPtr.h>
+#import <wtf/Assertions.h>
#import <wtf/HashTraits.h>
+#import <wtf/RefCountedLeakCounter.h>
+#import <wtf/RefPtr.h>
+
+#if ENABLE(DASHBOARD_SUPPORT)
+#import <WebKit/WebDashboardRegion.h>
+#endif
using namespace WebCore;
+using namespace JSC;
#if defined(__ppc__) || defined(__ppc64__)
#define PROCESSOR "PPC"
@@ -261,12 +272,20 @@ macro(yankAndSelect) \
#define WebKitOriginalTopPrintingMarginKey @"WebKitOriginalTopMargin"
#define WebKitOriginalBottomPrintingMarginKey @"WebKitOriginalBottomMargin"
+#define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange"
+#define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode")
+#define UniversalAccessDomain CFSTR("com.apple.universalaccess")
+
static BOOL s_didSetCacheModel;
static WebCacheModel s_cacheModel = WebCacheModelDocumentViewer;
static BOOL applicationIsTerminating;
static int pluginDatabaseClientCount = 0;
+#ifndef NDEBUG
+static const char webViewIsOpen[] = "At least one WebView is still open.";
+#endif
+
@interface NSSpellChecker (AppKitSecretsIKnow)
- (void)_preflightChosenSpellServer;
@end
@@ -294,8 +313,7 @@ static int pluginDatabaseClientCount = 0;
- (id)initWithTarget:(id)target defaultTarget:(id)defaultTarget catchExceptions:(BOOL)catchExceptions;
@end
-@interface WebViewPrivate : NSObject
-{
+@interface WebViewPrivate : NSObject {
@public
Page* page;
@@ -314,13 +332,15 @@ static int pluginDatabaseClientCount = 0;
id scriptDebugDelegateForwarder;
WebInspector *inspector;
+ WebNodeHighlight *currentNodeHighlight;
BOOL allowsUndo;
- float textSizeMultiplier;
+ float zoomMultiplier;
+ BOOL zoomMultiplierIsTextOnly;
NSString *applicationNameForUserAgent;
- String* userAgent;
+ String userAgent;
BOOL userAgentOverridden;
WebPreferences *preferences;
@@ -356,29 +376,36 @@ static int pluginDatabaseClientCount = 0;
BOOL smartInsertDeleteEnabled;
+#if ENABLE(DASHBOARD_SUPPORT)
BOOL dashboardBehaviorAlwaysSendMouseEventsToAllWindows;
BOOL dashboardBehaviorAlwaysSendActiveNullEventsToPlugIns;
BOOL dashboardBehaviorAlwaysAcceptsFirstMouse;
BOOL dashboardBehaviorAllowWheelScrolling;
+#endif
// WebKit has both a global plug-in database and a separate, per WebView plug-in database. Dashboard uses the per WebView database.
WebPluginDatabase *pluginDatabase;
- HashMap<unsigned long, RetainPtr<id> >* identifierMap;
+ HashMap<unsigned long, RetainPtr<id> > identifierMap;
+
+ BOOL _keyboardUIModeAccessed;
+ KeyboardUIMode _keyboardUIMode;
+
+ BOOL shouldUpdateWhileOffscreen;
+
+ // When this flag is set, we will not make any subviews underneath this WebView. This means no WebFrameViews and no WebHTMLViews.
+ BOOL useDocumentViews;
}
@end
@interface WebView (WebFileInternal)
- (WebFrame *)_selectedOrMainFrame;
-- (WebFrameBridge *)_bridgeForSelectedOrMainFrame;
- (BOOL)_isLoading;
- (WebFrameView *)_frameViewAtWindowPoint:(NSPoint)point;
- (WebFrame *)_focusedFrame;
+ (void)_preflightSpellChecker;
- (BOOL)_continuousCheckingAllowed;
- (NSResponder *)_responderForResponderOperations;
-- (BOOL)_performTextSizingSelector:(SEL)sel withObject:(id)arg onTrackingDocs:(BOOL)doTrackingViews selForNonTrackingDocs:(SEL)testSel newScaleFactor:(float)newScaleFactor;
-- (void)_notifyTextSizeMultiplierChanged;
@end
@interface WebView (WebCallDelegateFunctions)
@@ -455,37 +482,40 @@ static BOOL grammarCheckingEnabled;
self = [super init];
if (!self)
return nil;
+ JSC::initializeThreading();
allowsUndo = YES;
- textSizeMultiplier = 1;
+ zoomMultiplier = 1;
+ zoomMultiplierIsTextOnly = YES;
+#if ENABLE(DASHBOARD_SUPPORT)
dashboardBehaviorAllowWheelScrolling = YES;
+#endif
shouldCloseWithWindow = objc_collecting_enabled();
continuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled];
#ifndef BUILDING_ON_TIGER
grammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled];
#endif
- userAgent = new String;
usesPageCache = YES;
- identifierMap = new HashMap<unsigned long, RetainPtr<id> >();
pluginDatabaseClientCount++;
+ shouldUpdateWhileOffscreen = YES;
+
return self;
}
- (void)dealloc
-{
- ASSERT(!page);
- ASSERT(!preferences);
-
- delete userAgent;
- delete identifierMap;
+{
+ ASSERT(applicationIsTerminating || !page);
+ ASSERT(applicationIsTerminating || !preferences);
[applicationNameForUserAgent release];
[backgroundColor release];
[inspector release];
+ [currentNodeHighlight release];
+
[hostWindow release];
[policyDelegateForwarder release];
@@ -503,9 +533,6 @@ static BOOL grammarCheckingEnabled;
{
ASSERT_MAIN_THREAD();
- delete userAgent;
- delete identifierMap;
-
[super finalize];
}
@@ -550,37 +577,288 @@ static CFMutableSetRef allWebViewsSet;
@implementation WebView (WebPrivate)
-#ifdef DEBUG_WIDGET_DRAWING
-static bool debugWidget = true;
-- (void)drawRect:(NSRect)rect
+static inline int callGestalt(OSType selector)
+{
+ SInt32 value = 0;
+ Gestalt(selector, &value);
+ return value;
+}
+
+// Uses underscores instead of dots because if "4." ever appears in a user agent string, old DHTML libraries treat it as Netscape 4.
+static NSString *createMacOSXVersionString()
+{
+ // Can't use -[NSProcessInfo operatingSystemVersionString] because it has too much stuff we don't want.
+ int major = callGestalt(gestaltSystemVersionMajor);
+ ASSERT(major);
+
+ int minor = callGestalt(gestaltSystemVersionMinor);
+ int bugFix = callGestalt(gestaltSystemVersionBugFix);
+ if (bugFix)
+ return [[NSString alloc] initWithFormat:@"%d_%d_%d", major, minor, bugFix];
+ if (minor)
+ return [[NSString alloc] initWithFormat:@"%d_%d", major, minor];
+ return [[NSString alloc] initWithFormat:@"%d", major];
+}
+
+static NSString *createUserVisibleWebKitVersionString()
{
- [[NSColor blueColor] set];
- NSRectFill (rect);
+ // If the version is 4 digits long or longer, then the first digit represents
+ // the version of the OS. Our user agent string should not include this first digit,
+ // so strip it off and report the rest as the version. <rdar://problem/4997547>
+ NSString *fullVersion = [[NSBundle bundleForClass:[WebView class]] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
+ NSRange nonDigitRange = [fullVersion rangeOfCharacterFromSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]];
+ if (nonDigitRange.location == NSNotFound && [fullVersion length] >= 4)
+ return [[fullVersion substringFromIndex:1] copy];
+ if (nonDigitRange.location != NSNotFound && nonDigitRange.location >= 4)
+ return [[fullVersion substringFromIndex:1] copy];
+ return [fullVersion copy];
+}
+
++ (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName
+{
+ // Note: Do *not* move the initialization of osVersion nor webKitVersion into the declaration.
+ // Garbage collection won't correctly mark the global variable in that case <rdar://problem/5733674>.
+ static NSString *osVersion;
+ static NSString *webKitVersion;
+ if (!osVersion)
+ osVersion = createMacOSXVersionString();
+ if (!webKitVersion)
+ webKitVersion = createUserVisibleWebKitVersionString();
+ NSString *language = [NSUserDefaults _webkit_preferredLanguageCode];
+ if ([applicationName length])
+ return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko) %@", osVersion, language, webKitVersion, applicationName];
+ return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko)", osVersion, language, webKitVersion];
+}
+
+static void WebKitInitializeApplicationCachePathIfNecessary()
+{
+ static BOOL initialized = NO;
+ if (initialized)
+ return;
+
+ NSString *appName = [[NSBundle mainBundle] bundleIdentifier];
+ if (!appName)
+ appName = [[NSProcessInfo processInfo] processName];
- NSRect htmlViewRect = [[[[self mainFrame] frameView] documentView] frame];
+ ASSERT(appName);
- if (debugWidget) {
- while (debugWidget) {
- sleep (1);
- }
+ NSString* cacheDir = [NSString _webkit_localCacheDirectoryWithBundleIdentifier:appName];
+
+ cacheStorage().setCacheDirectory(cacheDir);
+ initialized = YES;
+}
+
+- (void)_registerDraggedTypes
+{
+ NSArray *editableTypes = [WebHTMLView _insertablePasteboardTypes];
+ NSArray *URLTypes = [NSPasteboard _web_dragTypesForURL];
+ NSMutableSet *types = [[NSMutableSet alloc] initWithArray:editableTypes];
+ [types addObjectsFromArray:URLTypes];
+ [self registerForDraggedTypes:[types allObjects]];
+ [types release];
+}
+
+- (BOOL)_usesDocumentViews
+{
+ return _private->useDocumentViews;
+}
+
+- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
+{
+#ifndef NDEBUG
+ WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
+#endif
+
+ WebPreferences *standardPreferences = [WebPreferences standardPreferences];
+ [standardPreferences willAddToWebView];
+
+ _private->preferences = [standardPreferences retain];
+ _private->catchesDelegateExceptions = YES;
+ _private->mainFrameDocumentReady = NO;
+ _private->drawsBackground = YES;
+ _private->smartInsertDeleteEnabled = YES;
+ _private->backgroundColor = [[NSColor whiteColor] retain];
+ _private->useDocumentViews = usesDocumentViews;
+
+ WebFrameView *frameView = nil;
+ if (_private->useDocumentViews) {
+ NSRect f = [self frame];
+ frameView = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)];
+ [frameView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+ [self addSubview:frameView];
+ [frameView release];
}
- NSLog (@"%s: rect: (%0.f,%0.f) %0.f %0.f, htmlViewRect: (%0.f,%0.f) %0.f %0.f\n",
- __PRETTY_FUNCTION__, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height,
- htmlViewRect.origin.x, htmlViewRect.origin.y, htmlViewRect.size.width, htmlViewRect.size.height
- );
+ WebKitInitializeLoggingChannelsIfNecessary();
+ WebCore::InitializeLoggingChannelsIfNecessary();
+ [WebHistoryItem initWindowWatcherIfNecessary];
+ WebKitInitializeDatabasesIfNecessary();
+ WebKitInitializeApplicationCachePathIfNecessary();
+
+ _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self));
+
+ _private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
+
+ [WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
+
+#ifndef BUILDING_ON_TIGER
+ if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES))
+ [self scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
+ else
+ [self scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
+#endif
- [super drawRect:rect];
+ [self _addToAllWebViewsSet];
+ [self setGroupName:groupName];
+
+ // If there's already a next key view (e.g., from a nib), wire it up to our
+ // contained frame view. In any case, wire our next key view up to the our
+ // contained frame view. This works together with our becomeFirstResponder
+ // and setNextKeyView overrides.
+ NSView *nextKeyView = [self nextKeyView];
+ if (nextKeyView && nextKeyView != frameView)
+ [frameView setNextKeyView:nextKeyView];
+ [super setNextKeyView:frameView];
+
+ ++WebViewCount;
+
+ [self _registerDraggedTypes];
+
+ WebPreferences *prefs = [self preferences];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:)
+ name:WebPreferencesChangedNotification object:prefs];
+
+ // Post a notification so the WebCore settings update.
+ [[self preferences] _postPreferencesChangesNotification];
+
+ if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION)) {
+ // Originally, we allowed all local loads.
+ FrameLoader::setLocalLoadPolicy(FrameLoader::AllowLocalLoadsForAll);
+ } else if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_MORE_STRICT_LOCAL_RESOURCE_SECURITY_RESTRICTION)) {
+ // Later, we allowed local loads for local URLs and documents loaded
+ // with substitute data.
+ FrameLoader::setLocalLoadPolicy(FrameLoader::AllowLocalLoadsForLocalAndSubstituteData);
+ }
}
+
+- (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
+{
+ self = [super initWithFrame:f];
+ if (!self)
+ return nil;
+
+#ifdef ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH
+ // DYLD_FRAMEWORK_PATH is used so Safari will load the development version of WebKit, which
+ // may not work with other WebKit applications. Unsetting DYLD_FRAMEWORK_PATH removes the
+ // need for Safari to unset it to prevent it from being passed to applications it launches.
+ // Unsetting it when a WebView is first created is as good a place as any.
+ // See <http://bugs.webkit.org/show_bug.cgi?id=4286> for more details.
+ if (getenv("WEBKIT_UNSET_DYLD_FRAMEWORK_PATH")) {
+ unsetenv("DYLD_FRAMEWORK_PATH");
+ unsetenv("WEBKIT_UNSET_DYLD_FRAMEWORK_PATH");
+ }
#endif
-+ (BOOL)_scriptDebuggerEnabled
+ _private = [[WebViewPrivate alloc] init];
+ [self _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:usesDocumentViews];
+ [self setMaintainsBackForwardList: YES];
+ return self;
+}
+
+- (void)_boundsChanged
+{
+ Frame* frame = core([self mainFrame]);
+ IntSize oldSize = frame->view()->frameRect().size();
+ frame->view()->resize([self bounds].size.width, [self bounds].size.height);
+ if (oldSize != frame->view()->frameRect().size())
+ [self setNeedsDisplay: YES];
+}
+
+- (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count
+{
+ // If count == 0 here, use the rect passed in for drawing. This is a workaround for:
+ // <rdar://problem/3908282> REGRESSION (Mail): No drag image dragging selected text in Blot and Mail
+ // The reason for the workaround is that this method is called explicitly from the code
+ // to generate a drag image, and at that time, getRectsBeingDrawn:count: will return a zero count.
+ const int cRectThreshold = 10;
+ const float cWastedSpaceThreshold = 0.75f;
+ BOOL useUnionedRect = (count <= 1) || (count > cRectThreshold);
+ if (!useUnionedRect) {
+ // Attempt to guess whether or not we should use the unioned rect or the individual rects.
+ // We do this by computing the percentage of "wasted space" in the union. If that wasted space
+ // is too large, then we will do individual rect painting instead.
+ float unionPixels = (rect.size.width * rect.size.height);
+ float singlePixels = 0;
+ for (int i = 0; i < count; ++i)
+ singlePixels += rects[i].size.width * rects[i].size.height;
+ float wastedSpace = 1 - (singlePixels / unionPixels);
+ if (wastedSpace <= cWastedSpaceThreshold)
+ useUnionedRect = YES;
+ }
+ return useUnionedRect;
+}
+
+- (void)drawSingleRect:(NSRect)rect
{
-#ifdef NDEBUG
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitScriptDebuggerEnabled"];
-#else
- return YES; // always enable in debug builds
+ ASSERT(!_private->useDocumentViews);
+
+ [NSGraphicsContext saveGraphicsState];
+ NSRectClip(rect);
+
+ @try {
+ [[self mainFrame] _drawRect:rect contentsOnly:NO];
+
+ WebView *webView = [self _webView];
+ [[webView _UIDelegateForwarder] webView:webView didDrawRect:rect];
+
+ if (WebNodeHighlight *currentHighlight = [webView currentNodeHighlight])
+ [currentHighlight setNeedsUpdateInTargetViewRect:rect];
+
+ [NSGraphicsContext restoreGraphicsState];
+ } @catch (NSException *localException) {
+ [NSGraphicsContext restoreGraphicsState];
+ LOG_ERROR("Exception caught while drawing: %@", localException);
+ [localException raise];
+ }
+}
+
+- (BOOL)isFlipped
+{
+ return _private && !_private->useDocumentViews;
+}
+
+#ifndef BUILDING_ON_TIGER
+
+- (void)viewWillDraw
+{
+ if (!_private->useDocumentViews) {
+ Frame* frame = core([self mainFrame]);
+ if (frame && frame->view())
+ frame->view()->layoutIfNeededRecursive();
+ }
+ [super viewWillDraw];
+}
+
#endif
+
+
+- (void)drawRect:(NSRect)rect
+{
+ if (_private->useDocumentViews)
+ return [super drawRect:rect];
+
+ ASSERT_MAIN_THREAD();
+
+ const NSRect *rects;
+ NSInteger count;
+ [self getRectsBeingDrawn:&rects count:&count];
+
+
+ if ([self _mustDrawUnionedRect:rect singleRects:rects count:count])
+ [self drawSingleRect:rect];
+ else
+ for (int i = 0; i < count; ++i)
+ [self drawSingleRect:rects[i]];
}
+ (NSArray *)_supportedMIMETypes
@@ -661,7 +939,12 @@ static bool debugWidget = true;
+ (void)_setAlwaysUseATSU:(BOOL)f
{
- WebCoreSetAlwaysUseATSU(f);
+ [self _setAlwaysUsesComplexTextCodePath:f];
+}
+
++ (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f
+{
+ WebCoreSetAlwaysUsesComplexTextCodePath(f);
}
+ (BOOL)canShowFile:(NSString *)path
@@ -676,22 +959,72 @@ static bool debugWidget = true;
- (BOOL)_isClosed
{
- if (!_private || _private->closed)
- return YES;
- return NO;
+ return !_private || _private->closed;
}
+- (void)_closePluginDatabases
+{
+ pluginDatabaseClientCount--;
+
+ // Close both sets of plug-in databases because plug-ins need an opportunity to clean up files, etc.
+
+ // Unload the WebView local plug-in database.
+ if (_private->pluginDatabase) {
+ [_private->pluginDatabase destroyAllPluginInstanceViews];
+ [_private->pluginDatabase close];
+ [_private->pluginDatabase release];
+ _private->pluginDatabase = nil;
+ }
+
+ // Keep the global plug-in database active until the app terminates to avoid having to reload plug-in bundles.
+ if (!pluginDatabaseClientCount && applicationIsTerminating)
+ [WebPluginDatabase closeSharedDatabase];
+}
+
+- (void)_closeWithFastTeardown
+{
+#ifndef NDEBUG
+ WTF::RefCountedLeakCounter::suppressMessages("At least one WebView was closed with fast teardown.");
+#endif
+
+ // Dispatch unload events.
+ // FIXME: Shouldn't have to use a RefPtr here -- keeping the frame alive while stopping it
+ // should be WebCore's responsibility -- but we do as of the time this comment was written.
+ RefPtr<Frame> mainFrame = core([self mainFrame]);
+ if (mainFrame && mainFrame->page() && mainFrame->page()->pendingUnloadEventCount())
+ mainFrame->loader()->stopLoading(true);
+
+ _private->closed = YES;
+
+ [self _closePluginDatabases];
+}
+
+// _close is here only for backward compatibility; clients and subclasses should use
+// public method -close instead.
- (void)_close
{
if (!_private || _private->closed)
return;
- FrameLoader* mainFrameLoader = [[self mainFrame] _frameLoader];
- if (mainFrameLoader)
- mainFrameLoader->detachFromParent();
+#ifndef NDEBUG
+ WTF::RefCountedLeakCounter::cancelMessageSuppression(webViewIsOpen);
+#endif
+
+ WebPreferences *preferences = _private->preferences;
+ BOOL fullDocumentTeardown = [preferences fullDocumentTeardownEnabled];
+
+ // To quit the apps fast we skip document teardown. Two exceptions:
+ // 1) plugins need to be destroyed and unloaded
+ // 2) unload events need to be called
+ if (applicationIsTerminating && !fullDocumentTeardown) {
+ [self _closeWithFastTeardown];
+ return;
+ }
+
+ if (Frame* mainFrame = core([self mainFrame]))
+ mainFrame->loader()->detachFromParent();
[self _removeFromAllWebViewsSet];
- [self setGroupName:nil];
[self setHostWindow:nil];
[self setDownloadDelegate:nil];
@@ -721,29 +1054,22 @@ static bool debugWidget = true;
_private->hasSpellCheckerDocumentTag = NO;
}
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[WebPreferences _removeReferenceForIdentifier:[self preferencesIdentifier]];
- WebPreferences *preferences = _private->preferences;
_private->preferences = nil;
[preferences didRemoveFromWebView];
[preferences release];
- pluginDatabaseClientCount--;
-
- // Make sure to close both sets of plug-ins databases because plug-ins need an opportunity to clean up files, etc.
-
- // Unload the WebView local plug-in database.
- if (_private->pluginDatabase) {
- [_private->pluginDatabase close];
- [_private->pluginDatabase release];
- _private->pluginDatabase = nil;
- }
-
- // Keep the global plug-in database active until the app terminates to avoid having to reload plug-in bundles.
- if (!pluginDatabaseClientCount && applicationIsTerminating)
- [WebPluginDatabase closeSharedDatabase];
+ [self _closePluginDatabases];
+
+#ifndef NDEBUG
+ // Need this to make leak messages accurate.
+ if (applicationIsTerminating)
+ gcController().garbageCollectNow();
+#endif
}
+ (NSString *)_MIMETypeForFile:(NSString *)path
@@ -921,7 +1247,7 @@ static bool debugWidget = true;
return needsQuirks;
needsQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH)
- && ![[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Safari"];
+ && ![[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Safari"];
checked = YES;
return needsQuirks;
@@ -931,9 +1257,9 @@ static bool debugWidget = true;
{
WebPreferences *preferences = (WebPreferences *)[notification object];
ASSERT(preferences == [self preferences]);
-
+
if (!_private->userAgentOverridden)
- *_private->userAgent = String();
+ _private->userAgent = String();
// Cache this value so we don't have to read NSUserDefaults on each page load
_private->useSiteSpecificSpoofing = [preferences _useSiteSpecificSpoofing];
@@ -952,6 +1278,7 @@ static bool debugWidget = true;
settings->setFixedFontFamily([preferences fixedFontFamily]);
settings->setForceFTPDirectoryListings([preferences _forceFTPDirectoryListings]);
settings->setFTPDirectoryTemplatePath([preferences _ftpDirectoryTemplatePath]);
+ settings->setLocalStorageDatabasePath([preferences _localStorageDatabasePath]);
settings->setJavaEnabled([preferences isJavaEnabled]);
settings->setJavaScriptEnabled([preferences isJavaScriptEnabled]);
settings->setJavaScriptCanOpenWindowsAutomatically([preferences javaScriptCanOpenWindowsAutomatically]);
@@ -972,6 +1299,7 @@ static bool debugWidget = true;
settings->setShowsURLsInToolTips([preferences showsURLsInToolTips]);
settings->setDeveloperExtrasEnabled([preferences developerExtrasEnabled]);
settings->setAuthorAndUserStylesEnabled([preferences authorAndUserStylesEnabled]);
+ settings->setApplicationChromeMode([preferences applicationChromeModeEnabled]);
if ([preferences userStyleSheetEnabled]) {
NSString* location = [[preferences userStyleSheetLocation] _web_originalDataAsString];
settings->setUserStyleSheetLocation([NSURL URLWithString:(location ? location : @"")]);
@@ -979,6 +1307,12 @@ static bool debugWidget = true;
settings->setUserStyleSheetLocation([NSURL URLWithString:@""]);
settings->setNeedsAdobeFrameReloadingQuirk([self _needsAdobeFrameReloadingQuirk]);
settings->setNeedsKeyboardEventDisambiguationQuirks([self _needsKeyboardEventDisambiguationQuirks]);
+ 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));
}
static inline IMP getMethod(id o, SEL s)
@@ -1132,9 +1466,9 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return [schemesWithRepresentationsSet containsObject:[URLScheme lowercaseString]];
}
-+ (BOOL)_canHandleRequest:(NSURLRequest *)request
++ (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame
{
- // FIXME: If <rdar://problem/5217309> gets fixed, this check can be removed
+ // FIXME: If <rdar://problem/5217309> gets fixed, this check can be removed.
if (!request)
return NO;
@@ -1143,16 +1477,22 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
NSString *scheme = [[request URL] scheme];
- if ([self _representationExistsForURLScheme:scheme])
+ // Representations for URL schemes work at the top level.
+ if (forMainFrame && [self _representationExistsForURLScheme:scheme])
return YES;
- return ([scheme _webkit_isCaseInsensitiveEqualToString:@"applewebdata"]);
+ return [scheme _webkit_isCaseInsensitiveEqualToString:@"applewebdata"];
+}
+
++ (BOOL)_canHandleRequest:(NSURLRequest *)request
+{
+ return [self _canHandleRequest:request forMainFrame:YES];
}
+ (NSString *)_decodeData:(NSData *)data
{
HTMLNames::init(); // this method is used for importing bookmarks at startup, so HTMLNames are likely to be uninitialized yet
- RefPtr<TextResourceDecoder> decoder = new TextResourceDecoder("text/html"); // bookmark files are HTML
+ RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/html"); // bookmark files are HTML
String result = decoder->decode(static_cast<const char*>([data bytes]), [data length]);
result += decoder->flush();
return result;
@@ -1281,11 +1621,6 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
[NSApp setWindowsNeedUpdate:YES];
}
-- (void)_reloadForPluginChanges
-{
- [[self mainFrame] _reloadForPluginChanges];
-}
-
- (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL
{
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
@@ -1322,6 +1657,8 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
_private->page->dragController()->setDidInitiateDrag(initiatedDrag);
}
+#if ENABLE(DASHBOARD_SUPPORT)
+
#define DASHBOARD_CONTROL_LABEL @"control"
- (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions from:(NSArray *)views
@@ -1371,7 +1708,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (NSDictionary *)_dashboardRegions
{
// Only return regions from main frame.
- Frame* mainFrame = [[[self mainFrame] _bridge] _frame];
+ Frame* mainFrame = core([self mainFrame]);
if (!mainFrame)
return nil;
NSMutableDictionary *regions = mainFrame->dashboardRegionsDictionary();
@@ -1433,6 +1770,8 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return NO;
}
+#endif /* ENABLE(DASHBOARD_SUPPORT) */
+
+ (void)_setShouldUseFontSmoothing:(BOOL)f
{
WebCoreSetShouldUseFontSmoothing(f);
@@ -1453,7 +1792,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return usesTestModeFocusRingColor();
}
-// This is only used by older versions of Safari and should be removed in a future release.
+// This is only used by versions of Safari up to and including 3.0 and should be removed in a future release.
+ (NSString *)_minimumRequiredSafariBuildNumber
{
return @"420+";
@@ -1463,53 +1802,53 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
{
WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
if (flag) {
- [scrollview setVerticalScrollingMode:WebCoreScrollbarAlwaysOn andLock:YES];
+ [scrollview setVerticalScrollingMode:ScrollbarAlwaysOn andLock:YES];
} else {
[scrollview setVerticalScrollingModeLocked:NO];
- [scrollview setVerticalScrollingMode:WebCoreScrollbarAuto];
+ [scrollview setVerticalScrollingMode:ScrollbarAuto andLock:NO];
}
}
- (BOOL)alwaysShowVerticalScroller
{
WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
- return [scrollview verticalScrollingModeLocked] && [scrollview verticalScrollingMode] == WebCoreScrollbarAlwaysOn;
+ return [scrollview verticalScrollingModeLocked] && [scrollview verticalScrollingMode] == ScrollbarAlwaysOn;
}
- (void)setAlwaysShowHorizontalScroller:(BOOL)flag
{
WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
if (flag) {
- [scrollview setHorizontalScrollingMode:WebCoreScrollbarAlwaysOn andLock:YES];
+ [scrollview setHorizontalScrollingMode:ScrollbarAlwaysOn andLock:YES];
} else {
[scrollview setHorizontalScrollingModeLocked:NO];
- [scrollview setHorizontalScrollingMode:WebCoreScrollbarAuto];
+ [scrollview setHorizontalScrollingMode:ScrollbarAuto andLock:NO];
}
}
- (void)setProhibitsMainFrameScrolling:(BOOL)prohibits
{
- Frame* mainFrame = [[[self mainFrame] _bridge] _frame];
+ Frame* mainFrame = core([self mainFrame]);
if (mainFrame)
- mainFrame->setProhibitsScrolling(prohibits);
+ mainFrame->view()->setProhibitsScrolling(prohibits);
}
- (BOOL)alwaysShowHorizontalScroller
{
WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
- return [scrollview horizontalScrollingModeLocked] && [scrollview horizontalScrollingMode] == WebCoreScrollbarAlwaysOn;
+ return [scrollview horizontalScrollingModeLocked] && [scrollview horizontalScrollingMode] == ScrollbarAlwaysOn;
}
- (void)_setInViewSourceMode:(BOOL)flag
{
- Frame* mainFrame = [[[self mainFrame] _bridge] _frame];
+ Frame* mainFrame = core([self mainFrame]);
if (mainFrame)
mainFrame->setInViewSourceMode(flag);
}
- (BOOL)_inViewSourceMode
{
- Frame* mainFrame = [[[self mainFrame] _bridge] _frame];
+ Frame* mainFrame = core([self mainFrame]);
return mainFrame && mainFrame->inViewSourceMode();
}
@@ -1528,6 +1867,19 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return NO;
}
+- (BOOL)_cookieEnabled
+{
+ if (_private->page)
+ return _private->page->cookieEnabled();
+ return YES;
+}
+
+- (void)_setCookieEnabled:(BOOL)enable
+{
+ if (_private->page)
+ _private->page->setCookieEnabled(enable);
+}
+
- (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths
{
if (!_private->pluginDatabase)
@@ -1558,7 +1910,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
_private->backgroundColor = [backgroundColor retain];
[old release];
- [[self mainFrame] _updateBackground];
+ [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen];
}
- (NSColor *)backgroundColor
@@ -1596,6 +1948,20 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
[[self preferences] _postPreferencesChangesNotification];
}
+- (WebTextIterator *)textIteratorForRect:(NSRect)rect
+{
+ IntPoint rectStart(rect.origin.x, rect.origin.y);
+ IntPoint rectEnd(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height);
+
+ Frame* coreFrame = core([self mainFrame]);
+ if (!coreFrame)
+ return nil;
+
+ Selection selectionInsideRect(coreFrame->visiblePositionForPoint(rectStart), coreFrame->visiblePositionForPoint(rectEnd));
+
+ return [[[WebTextIterator alloc] initWithRange:[DOMRange _wrapRange:selectionInsideRect.toRange().get()]] autorelease];
+}
+
- (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
{
NSWindow *window = [self hostWindow] ? [self hostWindow] : [self window];
@@ -1621,12 +1987,31 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value
{
- Frame* coreFrame = [[[self mainFrame] _bridge] _frame];
+ Frame* coreFrame = core([self mainFrame]);
if (!coreFrame)
return;
coreFrame->editor()->command(name).execute(value);
}
+- (void)_setCustomHTMLTokenizerTimeDelay:(double)timeDelay
+{
+ if (!_private->page)
+ return;
+ return _private->page->setCustomHTMLTokenizerTimeDelay(timeDelay);
+}
+
+- (void)_setCustomHTMLTokenizerChunkSize:(int)chunkSize
+{
+ if (!_private->page)
+ return;
+ return _private->page->setCustomHTMLTokenizerChunkSize(chunkSize);
+}
+
+- (void)_clearMainFrameName
+{
+ _private->page->mainFrame()->tree()->clearName();
+}
+
@end
@implementation _WebSafeForwarder
@@ -1682,7 +2067,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillTerminate) name:NSApplicationWillTerminateNotification object:NSApp];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) name:WebPreferencesChangedNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil];
}
+ (void)_applicationWillTerminate
@@ -1690,6 +2075,8 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
applicationIsTerminating = YES;
if (!pluginDatabaseClientCount)
[WebPluginDatabase closeSharedDatabase];
+
+ PageGroup::closeLocalStorage();
}
+ (BOOL)canShowMIMEType:(NSString *)MIMEType
@@ -1721,6 +2108,25 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return nil;
}
+- (void)addPluginInstanceView:(NSView *)view
+{
+ if (!_private->pluginDatabase)
+ _private->pluginDatabase = [[WebPluginDatabase alloc] init];
+ [_private->pluginDatabase addPluginInstanceView:view];
+}
+
+- (void)removePluginInstanceView:(NSView *)view
+{
+ if (_private->pluginDatabase)
+ [_private->pluginDatabase removePluginInstanceView:view];
+}
+
+- (void)removePluginInstanceViewsFor:(WebFrame*)webFrame
+{
+ if (_private->pluginDatabase)
+ [_private->pluginDatabase removePluginInstanceViewsFor:webFrame];
+}
+
- (BOOL)_isMIMETypeRegisteredAsPlugin:(NSString *)MIMEType
{
if ([[WebPluginDatabase sharedDatabase] isMIMETypeRegistered:MIMEType])
@@ -1786,101 +2192,14 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
FrameLoader::registerURLSchemeAsLocal(protocol);
}
-- (void)_registerDraggedTypes
-{
- NSArray *editableTypes = [WebHTMLView _insertablePasteboardTypes];
- NSArray *URLTypes = [NSPasteboard _web_dragTypesForURL];
- NSMutableSet *types = [[NSMutableSet alloc] initWithArray:editableTypes];
- [types addObjectsFromArray:URLTypes];
- [self registerForDraggedTypes:[types allObjects]];
- [types release];
-}
-
-- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName
-{
- WebPreferences *standardPreferences = [WebPreferences standardPreferences];
- [standardPreferences willAddToWebView];
-
- _private->preferences = [standardPreferences retain];
- _private->catchesDelegateExceptions = YES;
- _private->mainFrameDocumentReady = NO;
- _private->drawsBackground = YES;
- _private->smartInsertDeleteEnabled = YES;
- _private->backgroundColor = [[NSColor whiteColor] retain];
-
- NSRect f = [self frame];
- WebFrameView *frameView = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)];
- [frameView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
- [self addSubview:frameView];
- [frameView release];
-
- WebKitInitializeLoggingChannelsIfNecessary();
- WebCore::InitializeLoggingChannelsIfNecessary();
- [WebHistoryItem initWindowWatcherIfNecessary];
- WebKitInitializeDatabasesIfNecessary();
-
- _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self));
- [[[WebFrameBridge alloc] initMainFrameWithPage:_private->page frameName:frameName frameView:frameView] release];
-
- [self _addToAllWebViewsSet];
- [self setGroupName:groupName];
-
- // If there's already a next key view (e.g., from a nib), wire it up to our
- // contained frame view. In any case, wire our next key view up to the our
- // contained frame view. This works together with our becomeFirstResponder
- // and setNextKeyView overrides.
- NSView *nextKeyView = [self nextKeyView];
- if (nextKeyView != nil && nextKeyView != frameView) {
- [frameView setNextKeyView:nextKeyView];
- }
- [super setNextKeyView:frameView];
-
- ++WebViewCount;
-
- [self _registerDraggedTypes];
-
- // initialize WebScriptDebugServer here so listeners can register before any pages are loaded.
- if ([WebView _scriptDebuggerEnabled])
- [WebScriptDebugServer sharedScriptDebugServer];
-
- WebPreferences *prefs = [self preferences];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:)
- name:WebPreferencesChangedNotification object:prefs];
-
- // Post a notification so the WebCore settings update.
- [[self preferences] _postPreferencesChangesNotification];
-
- if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION))
- FrameLoader::setRestrictAccessToLocal(false);
-}
-
- (id)initWithFrame:(NSRect)f
{
return [self initWithFrame:f frameName:nil groupName:nil];
}
-- (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName;
+- (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName
{
- self = [super initWithFrame:f];
- if (!self)
- return nil;
-
-#ifdef ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH
- // DYLD_FRAMEWORK_PATH is used so Safari will load the development version of WebKit, which
- // may not work with other WebKit applications. Unsetting DYLD_FRAMEWORK_PATH removes the
- // need for Safari to unset it to prevent it from being passed to applications it launches.
- // Unsetting it when a WebView is first created is as good a place as any.
- // See <http://bugs.webkit.org/show_bug.cgi?id=4286> for more details.
- if (getenv("WEBKIT_UNSET_DYLD_FRAMEWORK_PATH")) {
- unsetenv("DYLD_FRAMEWORK_PATH");
- unsetenv("WEBKIT_UNSET_DYLD_FRAMEWORK_PATH");
- }
-#endif
-
- _private = [[WebViewPrivate alloc] init];
- [self _commonInitializationWithFrameName:frameName groupName:groupName];
- [self setMaintainsBackForwardList: YES];
- return self;
+ return [self _initWithFrame:f frameName:frameName groupName:groupName usesDocumentViews:YES];
}
- (id)initWithCoder:(NSCoder *)decoder
@@ -1930,7 +2249,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
preferences = nil;
LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", frameName, groupName, (int)useBackForwardList);
- [result _commonInitializationWithFrameName:frameName groupName:groupName];
+ [result _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:YES];
[result page]->backForwardList()->setEnabled(useBackForwardList);
result->_private->allowsUndo = allowsUndo;
if (preferences)
@@ -1977,9 +2296,12 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (void)dealloc
{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WebView class], self))
+ return;
+
// call close to ensure we tear-down completely
// this maintains our old behavior for existing applications
- [self _close];
+ [self close];
--WebViewCount;
@@ -2001,6 +2323,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (void)close
{
+ // _close existed first, and some clients might be calling or overriding it, so call through.
[self _close];
}
@@ -2014,29 +2337,149 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return _private->shouldCloseWithWindow;
}
+- (void)removeSizeObservers
+{
+ if (!_private->useDocumentViews && [self window]) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:NSViewFrameDidChangeNotification object:self];
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:NSViewBoundsDidChangeNotification object:self];
+ }
+}
+
+- (void)addSizeObservers
+{
+ if (!_private->useDocumentViews && [self window]) {
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_boundsChanged)
+ name:NSViewFrameDidChangeNotification object:self];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_boundsChanged)
+ name:NSViewBoundsDidChangeNotification object:self];
+ [self _boundsChanged];
+ }
+}
+
+- (void)addWindowObservers
+{
+ NSWindow *window = [self window];
+ if (!_private->useDocumentViews && 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(_windowWillOrderOnScreen:)
+ name:WKWindowWillOrderOnScreenNotification() object:window];
+ }
+}
+
+- (void)removeWindowObservers
+{
+ NSWindow *window = [self window];
+ if (!_private->useDocumentViews && window) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:NSWindowDidBecomeKeyNotification object:nil];
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:NSWindowDidResignKeyNotification object:nil];
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:WKWindowWillOrderOnScreenNotification() object:window];
+ }
+}
+
- (void)viewWillMoveToWindow:(NSWindow *)window
{
- // Don't do anything if we aren't initialized. This happens when decoding a WebView.
+ // Don't do anything if the WebView isn't initialized.
+ // This happens when decoding a WebView in a nib.
+ // FIXME: What sets up the observer of NSWindowWillCloseNotification in this case?
if (!_private)
return;
+
+ if (_private->closed)
+ return;
- if ([self window])
+ if ([self window] && [self window] != [self hostWindow])
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:[self window]];
if (window) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:window];
-
- // Ensure that we will receive the events that WebHTMLView (at least) needs. It's expensive enough
- // that we don't want to call it over and over.
+
+ // Ensure that we will receive the events that WebHTMLView (at least) needs.
+ // The following are expensive enough that we don't want to call them over
+ // and over, so do them when we move into a window.
[window setAcceptsMouseMovedEvents:YES];
WKSetNSWindowShouldPostEventNotifications(window, YES);
+
+ [self removeWindowObservers];
+ [self removeSizeObservers];
}
}
+- (void)viewDidMoveToWindow
+{
+ // Don't do anything if we aren't initialized. This happens
+ // when decoding a WebView. When WebViews are decoded their subviews
+ // are created by initWithCoder: and so won't be normally
+ // initialized. The stub views are discarded by WebView.
+ if (!_private || _private->closed)
+ return;
+
+ if ([self window]) {
+ [self addWindowObservers];
+ [self addSizeObservers];
+ }
+}
+
+- (void)_updateFocusedAndActiveState
+{
+ ASSERT(!_private->useDocumentViews);
+ [self _updateFocusedAndActiveStateForFrame:[self mainFrame]];
+}
+
+- (void)_updateFocusedAndActiveStateForFrame:(WebFrame *)webFrame
+{
+ Frame* frame = core(webFrame);
+ if (!frame)
+ return;
+
+ Page* page = frame->page();
+ if (!page)
+ return;
+
+ NSWindow *window = [self window];
+ BOOL windowIsKey = [window isKeyWindow];
+ BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow];
+
+ page->focusController()->setActive(windowIsKey);
+
+ Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
+ frame->selection()->setFocused(frame == focusedFrame && windowOrSheetIsKey);
+}
+
+- (void)_windowDidBecomeKey:(NSNotification *)notification
+{
+ ASSERT(!_private->useDocumentViews);
+ NSWindow *keyWindow = [notification object];
+ if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet])
+ [self _updateFocusedAndActiveState];
+}
+
+- (void)_windowDidResignKey:(NSNotification *)notification
+{
+ ASSERT(!_private->useDocumentViews);
+ NSWindow *formerKeyWindow = [notification object];
+ if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet])
+ [self _updateFocusedAndActiveState];
+}
+
+- (void)_windowWillOrderOnScreen:(NSNotification *)notification
+{
+ ASSERT(!_private->useDocumentViews);
+ if (![self shouldUpdateWhileOffscreen])
+ [self setNeedsDisplay:YES];
+}
+
- (void)_windowWillClose:(NSNotification *)notification
{
if ([self shouldCloseWithWindow] && ([self window] == [self hostWindow] || ([self window] && ![self hostWindow]) || (![self window] && [self hostWindow])))
- [self _close];
+ [self close];
}
- (void)setPreferences:(WebPreferences *)prefs
@@ -2213,17 +2656,120 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (void)setTextSizeMultiplier:(float)m
{
+ [self _setZoomMultiplier:m isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]];
+}
+
+- (float)textSizeMultiplier
+{
+ return _private->zoomMultiplierIsTextOnly ? _private->zoomMultiplier : 1.0f;
+}
+
+- (void)_setZoomMultiplier:(float)m isTextOnly:(BOOL)isTextOnly
+{
// NOTE: This has no visible effect when viewing a PDF (see <rdar://problem/4737380>)
- if (_private->textSizeMultiplier == m)
- return;
+ _private->zoomMultiplier = m;
+ _private->zoomMultiplierIsTextOnly = isTextOnly;
+ Frame* coreFrame = core([self mainFrame]);
+ if (coreFrame)
+ coreFrame->setZoomFactor(m, isTextOnly);
+}
- _private->textSizeMultiplier = m;
- [self _notifyTextSizeMultiplierChanged];
+- (float)_zoomMultiplier:(BOOL)isTextOnly
+{
+ if (isTextOnly != _private->zoomMultiplierIsTextOnly)
+ return 1.0f;
+ return _private->zoomMultiplier;
}
-- (float)textSizeMultiplier
+- (float)_realZoomMultiplier
+{
+ return _private->zoomMultiplier;
+}
+
+- (BOOL)_realZoomMultiplierIsTextOnly
{
- return _private->textSizeMultiplier;
+ return _private->zoomMultiplierIsTextOnly;
+}
+
+#define MinimumZoomMultiplier 0.5f
+#define MaximumZoomMultiplier 3.0f
+#define ZoomMultiplierRatio 1.2f
+
+- (BOOL)_canZoomOut:(BOOL)isTextOnly
+{
+ id docView = [[[self mainFrame] frameView] documentView];
+ if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) {
+ id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView;
+ return [zoomingDocView _canZoomOut];
+ }
+ return [self _zoomMultiplier:isTextOnly] / ZoomMultiplierRatio > MinimumZoomMultiplier;
+}
+
+
+- (BOOL)_canZoomIn:(BOOL)isTextOnly
+{
+ id docView = [[[self mainFrame] frameView] documentView];
+ if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) {
+ id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView;
+ return [zoomingDocView _canZoomIn];
+ }
+ return [self _zoomMultiplier:isTextOnly] * ZoomMultiplierRatio < MaximumZoomMultiplier;
+}
+
+- (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly
+{
+ id docView = [[[self mainFrame] frameView] documentView];
+ if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) {
+ id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView;
+ return [zoomingDocView _zoomOut:sender];
+ }
+ float newScale = [self _zoomMultiplier:isTextOnly] / ZoomMultiplierRatio;
+ if (newScale > MinimumZoomMultiplier)
+ [self _setZoomMultiplier:newScale isTextOnly:isTextOnly];
+}
+
+- (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly
+{
+ id docView = [[[self mainFrame] frameView] documentView];
+ if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) {
+ id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView;
+ return [zoomingDocView _zoomIn:sender];
+ }
+ float newScale = [self _zoomMultiplier:isTextOnly] * ZoomMultiplierRatio;
+ if (newScale < MaximumZoomMultiplier)
+ [self _setZoomMultiplier:newScale isTextOnly:isTextOnly];
+}
+
+- (BOOL)_canResetZoom:(BOOL)isTextOnly
+{
+ id docView = [[[self mainFrame] frameView] documentView];
+ if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) {
+ id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView;
+ return [zoomingDocView _canResetZoom];
+ }
+ return [self _zoomMultiplier:isTextOnly] != 1.0f;
+}
+
+- (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly
+{
+ id docView = [[[self mainFrame] frameView] documentView];
+ if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) {
+ id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView;
+ return [zoomingDocView _resetZoom:sender];
+ }
+ if ([self _zoomMultiplier:isTextOnly] != 1.0f)
+ [self _setZoomMultiplier:1.0f isTextOnly:isTextOnly];
+}
+
+- (void)viewWillMoveToSuperview:(NSView *)newSuperview
+{
+ [self removeSizeObservers];
+}
+
+- (void)viewDidMoveToSuperview
+{
+ if ([self superview] != nil)
+ [self addSizeObservers];
}
- (void)setApplicationNameForUserAgent:(NSString *)applicationName
@@ -2232,7 +2778,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
[_private->applicationNameForUserAgent release];
_private->applicationNameForUserAgent = name;
if (!_private->userAgentOverridden)
- *_private->userAgent = String();
+ _private->userAgent = String();
}
- (NSString *)applicationNameForUserAgent
@@ -2242,7 +2788,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (void)setCustomUserAgent:(NSString *)userAgentString
{
- *_private->userAgent = userAgentString;
+ _private->userAgent = userAgentString;
_private->userAgentOverridden = userAgentString != nil;
}
@@ -2250,7 +2796,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
{
if (!_private->userAgentOverridden)
return nil;
- return *_private->userAgent;
+ return _private->userAgent;
}
- (void)setMediaStyle:(NSString *)mediaStyle
@@ -2278,9 +2824,8 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
NSString *oldEncoding = [self customTextEncodingName];
if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding])
return;
- FrameLoader* mainFrameLoader = [[self mainFrame] _frameLoader];
- if (mainFrameLoader)
- mainFrameLoader->reloadAllowingStaleData(encoding);
+ if (Frame* mainFrame = core([self mainFrame]))
+ mainFrame->loader()->reloadAllowingStaleData(encoding);
}
- (NSString *)_mainFrameOverrideEncoding
@@ -2310,7 +2855,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
script = [script substringFromIndex:returnStringRange.location + returnStringRange.length];
}
- NSString *result = [[[self mainFrame] _bridge] stringByEvaluatingJavaScriptFromString:script];
+ NSString *result = [[self mainFrame] _stringByEvaluatingJavaScriptFromString:script];
// The only way stringByEvaluatingJavaScriptFromString can return nil is if the frame was removed by the script
// Since there's no way to get rid of the main frame, result will never ever be nil here.
ASSERT(result);
@@ -2323,7 +2868,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
Frame* coreFrame = core([self mainFrame]);
if (!coreFrame)
return nil;
- return coreFrame->windowScriptObject();
+ return coreFrame->script()->windowScriptObject();
}
// Get the appropriate user-agent string for a particular URL.
@@ -2334,16 +2879,22 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (void)setHostWindow:(NSWindow *)hostWindow
{
- if (!_private->closed && hostWindow != _private->hostWindow) {
- [[self mainFrame] _viewWillMoveToHostWindow:hostWindow];
- if (_private->hostWindow)
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:_private->hostWindow];
- if (hostWindow)
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:hostWindow];
- [_private->hostWindow release];
- _private->hostWindow = [hostWindow retain];
- [[self mainFrame] _viewDidMoveToHostWindow];
- }
+ if (_private->closed)
+ return;
+ if (hostWindow == _private->hostWindow)
+ return;
+
+ Frame* coreFrame = core([self mainFrame]);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ [[[kit(frame) frameView] documentView] viewWillMoveToHostWindow:hostWindow];
+ if (_private->hostWindow && [self window] != _private->hostWindow)
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:_private->hostWindow];
+ if (hostWindow)
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:hostWindow];
+ [_private->hostWindow release];
+ _private->hostWindow = [hostWindow retain];
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
}
- (NSWindow *)hostWindow
@@ -2402,22 +2953,30 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)draggingInfo
{
+ Page* page = core(self);
+ if (!page)
+ return NSDragOperationNone;
+
NSView <WebDocumentView>* view = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]];
WebPasteboardHelper helper([view isKindOfClass:[WebHTMLView class]] ? (WebHTMLView*)view : nil);
IntPoint client([draggingInfo draggingLocation]);
IntPoint global(globalPoint([draggingInfo draggingLocation], [self window]));
DragData dragData(draggingInfo, client, global, (DragOperation)[draggingInfo draggingSourceOperationMask], &helper);
- return core(self)->dragController()->dragUpdated(&dragData);
+ return page->dragController()->dragUpdated(&dragData);
}
- (void)draggingExited:(id <NSDraggingInfo>)draggingInfo
{
+ Page* page = core(self);
+ if (!page)
+ return;
+
NSView <WebDocumentView>* view = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]];
WebPasteboardHelper helper([view isKindOfClass:[WebHTMLView class]] ? (WebHTMLView*)view : nil);
IntPoint client([draggingInfo draggingLocation]);
IntPoint global(globalPoint([draggingInfo draggingLocation], [self window]));
DragData dragData(draggingInfo, client, global, (DragOperation)[draggingInfo draggingSourceOperationMask], &helper);
- core(self)->dragController()->dragExited(&dragData);
+ page->dragController()->dragExited(&dragData);
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)draggingInfo
@@ -2659,7 +3218,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
if (_private->drawsBackground == drawsBackground)
return;
_private->drawsBackground = drawsBackground;
- [[self mainFrame] _updateBackground];
+ [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen];
}
- (BOOL)drawsBackground
@@ -2667,6 +3226,31 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
return _private->drawsBackground;
}
+- (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen
+{
+ if (_private->shouldUpdateWhileOffscreen == updateWhileOffscreen)
+ return;
+ _private->shouldUpdateWhileOffscreen = updateWhileOffscreen;
+ [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen];
+}
+
+- (BOOL)shouldUpdateWhileOffscreen
+{
+ return _private->shouldUpdateWhileOffscreen;
+}
+
+- (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight
+{
+ id old = _private->currentNodeHighlight;
+ _private->currentNodeHighlight = [nodeHighlight retain];
+ [old release];
+}
+
+- (WebNodeHighlight *)currentNodeHighlight
+{
+ return _private->currentNodeHighlight;
+}
+
@end
@implementation WebView (WebIBActions)
@@ -2714,34 +3298,36 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
[[self mainFrame] reload];
}
-#define MinimumTextSizeMultiplier 0.5f
-#define MaximumTextSizeMultiplier 3.0f
-#define TextSizeMultiplierRatio 1.2f
-
+// FIXME: This code should move into WebCore so that it is not duplicated in each WebKit.
+// (This includes canMakeTextSmaller/Larger, makeTextSmaller/Larger, and canMakeTextStandardSize/makeTextStandardSize)
- (BOOL)canMakeTextSmaller
{
- BOOL canShrinkMore = _private->textSizeMultiplier/TextSizeMultiplierRatio > MinimumTextSizeMultiplier;
- return [self _performTextSizingSelector:(SEL)0 withObject:nil onTrackingDocs:canShrinkMore selForNonTrackingDocs:@selector(_canMakeTextSmaller) newScaleFactor:0];
+ return [self _canZoomOut:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]];
}
-- (BOOL)canMakeTextLarger
+- (IBAction)makeTextSmaller:(id)sender
{
- BOOL canGrowMore = _private->textSizeMultiplier*TextSizeMultiplierRatio < MaximumTextSizeMultiplier;
- return [self _performTextSizingSelector:(SEL)0 withObject:nil onTrackingDocs:canGrowMore selForNonTrackingDocs:@selector(_canMakeTextLarger) newScaleFactor:0];
+ return [self _zoomOut:sender isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]];
}
-- (IBAction)makeTextSmaller:(id)sender
+- (BOOL)canMakeTextLarger
{
- float newScale = _private->textSizeMultiplier / TextSizeMultiplierRatio;
- BOOL canShrinkMore = newScale > MinimumTextSizeMultiplier;
- [self _performTextSizingSelector:@selector(_makeTextSmaller:) withObject:sender onTrackingDocs:canShrinkMore selForNonTrackingDocs:@selector(_canMakeTextSmaller) newScaleFactor:newScale];
+ return [self _canZoomIn:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]];
}
- (IBAction)makeTextLarger:(id)sender
{
- float newScale = _private->textSizeMultiplier*TextSizeMultiplierRatio;
- BOOL canGrowMore = newScale < MaximumTextSizeMultiplier;
- [self _performTextSizingSelector:@selector(_makeTextLarger:) withObject:sender onTrackingDocs:canGrowMore selForNonTrackingDocs:@selector(_canMakeTextLarger) newScaleFactor:newScale];
+ return [self _zoomIn:sender isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]];
+}
+
+- (BOOL)canMakeTextStandardSize
+{
+ return [self _canResetZoom:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]];
+}
+
+- (IBAction)makeTextStandardSize:(id)sender
+{
+ return [self _resetZoom:sender isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]];
}
- (IBAction)toggleSmartInsertDelete:(id)sender
@@ -2767,18 +3353,6 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
return NO;
}
-- (BOOL)canMakeTextStandardSize
-{
- BOOL notAlreadyStandard = _private->textSizeMultiplier != 1.0f;
- return [self _performTextSizingSelector:(SEL)0 withObject:nil onTrackingDocs:notAlreadyStandard selForNonTrackingDocs:@selector(_canMakeTextStandardSize) newScaleFactor:0.0f];
-}
-
-- (IBAction)makeTextStandardSize:(id)sender
-{
- BOOL notAlreadyStandard = _private->textSizeMultiplier != 1.0f;
- [self _performTextSizingSelector:@selector(_makeTextStandardSize:) withObject:sender onTrackingDocs:notAlreadyStandard selForNonTrackingDocs:@selector(_canMakeTextStandardSize) newScaleFactor:1.0f];
-}
-
#define VALIDATE(name) \
else if (action == @selector(name:)) { return [self _responderValidateUserInterfaceItem:item]; }
@@ -2837,6 +3411,22 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
@implementation WebView (WebPendingPublic)
+- (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
{
if (_private->closed)
@@ -2982,9 +3572,73 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
return coreFrame->shouldClose();
}
+static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsValue)
+{
+ NSAppleEventDescriptor* aeDesc = 0;
+ if (jsValue->isBoolean())
+ return [NSAppleEventDescriptor descriptorWithBoolean:jsValue->getBoolean()];
+ if (jsValue->isString())
+ return [NSAppleEventDescriptor descriptorWithString:String(jsValue->getString())];
+ if (jsValue->isNumber()) {
+ double value = jsValue->getNumber();
+ int intValue = value;
+ if (value == intValue)
+ return [NSAppleEventDescriptor descriptorWithDescriptorType:typeSInt32 bytes:&intValue length:sizeof(intValue)];
+ return [NSAppleEventDescriptor descriptorWithDescriptorType:typeIEEE64BitFloatingPoint bytes:&value length:sizeof(value)];
+ }
+ if (jsValue->isObject()) {
+ JSObject* object = jsValue->getObject();
+ if (object->inherits(&DateInstance::info)) {
+ DateInstance* date = static_cast<DateInstance*>(object);
+ double ms = 0;
+ int tzOffset = 0;
+ if (date->getTime(ms, tzOffset)) {
+ CFAbsoluteTime utcSeconds = ms / 1000 - kCFAbsoluteTimeIntervalSince1970;
+ LongDateTime ldt;
+ if (noErr == UCConvertCFAbsoluteTimeToLongDateTime(utcSeconds, &ldt))
+ return [NSAppleEventDescriptor descriptorWithDescriptorType:typeLongDateTime bytes:&ldt length:sizeof(ldt)];
+ }
+ }
+ else if (object->inherits(&JSArray::info)) {
+ static HashSet<JSObject*> visitedElems;
+ if (!visitedElems.contains(object)) {
+ visitedElems.add(object);
+
+ JSArray* array = static_cast<JSArray*>(object);
+ aeDesc = [NSAppleEventDescriptor listDescriptor];
+ unsigned numItems = array->length();
+ for (unsigned i = 0; i < numItems; ++i)
+ [aeDesc insertDescriptor:aeDescFromJSValue(exec, array->get(exec, i)) atIndex:0];
+
+ visitedElems.remove(object);
+ return aeDesc;
+ }
+ }
+ JSValue* primitive = object->toPrimitive(exec);
+ if (exec->hadException()) {
+ exec->clearException();
+ return [NSAppleEventDescriptor nullDescriptor];
+ }
+ return aeDescFromJSValue(exec, primitive);
+ }
+ if (jsValue->isUndefined())
+ return [NSAppleEventDescriptor descriptorWithTypeCode:cMissingValue];
+ ASSERT(jsValue->isNull());
+ return [NSAppleEventDescriptor nullDescriptor];
+}
+
- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script
{
- return [[[self mainFrame] _bridge] aeDescByEvaluatingJavaScriptFromString:script];
+ Frame* coreFrame = core([self mainFrame]);
+ if (!coreFrame)
+ return nil;
+ if (!coreFrame->document())
+ return nil;
+ JSValue* result = coreFrame->loader()->executeScript(script, true);
+ if (!result) // FIXME: pass errors
+ return 0;
+ JSLock lock(false);
+ return aeDescFromJSValue(coreFrame->script()->globalObject()->globalExec(), result);
}
- (BOOL)canMarkAllTextMatches
@@ -3075,7 +3729,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
- (void)scrollDOMRangeToVisible:(DOMRange *)range
{
- [[[range startContainer] _bridge] scrollDOMRangeToVisible:range];
+ [[[[range startContainer] ownerDocument] webFrame] _scrollDOMRangeToVisible:range];
}
- (BOOL)allowsUndo
@@ -3088,6 +3742,46 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
_private->allowsUndo = flag;
}
+- (void)setPageSizeMultiplier:(float)m
+{
+ [self _setZoomMultiplier:m isTextOnly:NO];
+}
+
+- (float)pageSizeMultiplier
+{
+ return !_private->zoomMultiplierIsTextOnly ? _private->zoomMultiplier : 1.0f;
+}
+
+- (BOOL)canZoomPageIn
+{
+ return [self _canZoomIn:NO];
+}
+
+- (IBAction)zoomPageIn:(id)sender
+{
+ return [self _zoomIn:sender isTextOnly:NO];
+}
+
+- (BOOL)canZoomPageOut
+{
+ return [self _canZoomOut:NO];
+}
+
+- (IBAction)zoomPageOut:(id)sender
+{
+ return [self _zoomOut:sender isTextOnly:NO];
+}
+
+- (BOOL)canResetPageZoom
+{
+ return [self _canResetZoom:NO];
+}
+
+- (IBAction)resetPageZoom:(id)sender
+{
+ return [self _resetZoom:sender isTextOnly:NO];
+}
+
@end
@implementation WebView (WebViewPrintingPrivate)
@@ -3261,16 +3955,16 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
return;
if (range == nil)
- coreFrame->selectionController()->clear();
+ coreFrame->selection()->clear();
else {
// Derive the frame to use from the range passed in.
- // Using _bridgeForSelectedOrMainFrame could give us a different document than
+ // Using _selectedOrMainFrame could give us a different document than
// the one the range uses.
coreFrame = core([range startContainer])->document()->frame();
if (!coreFrame)
return;
- coreFrame->selectionController()->setSelectedRange([range _range], core(selectionAffinity), true);
+ coreFrame->selection()->setSelectedRange([range _range], core(selectionAffinity), true);
}
}
@@ -3279,7 +3973,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
Frame* coreFrame = core([self _selectedOrMainFrame]);
if (!coreFrame)
return nil;
- return kit(coreFrame->selectionController()->toRange().get());
+ return kit(coreFrame->selection()->toRange().get());
}
- (NSSelectionAffinity)selectionAffinity
@@ -3287,7 +3981,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
Frame* coreFrame = core([self _selectedOrMainFrame]);
if (!coreFrame)
return NSSelectionAffinityDownstream;
- return kit(coreFrame->selectionController()->affinity());
+ return kit(coreFrame->selection()->affinity());
}
- (void)setEditable:(BOOL)flag
@@ -3296,7 +3990,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
_private->editable = flag;
if (!_private->tabKeyCyclesThroughElementsChanged && _private->page)
_private->page->setTabKeyCyclesThroughElements(!flag);
- Frame* mainFrame = [[[self mainFrame] _bridge] _frame];
+ Frame* mainFrame = core([self mainFrame]);
if (mainFrame) {
if (flag) {
mainFrame->applyEditingStyleToBodyElement();
@@ -3318,12 +4012,12 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
{
// We don't know enough at thls level to pass in a relevant WebUndoAction; we'd have to
// change the API to allow this.
- [[self _bridgeForSelectedOrMainFrame] setTypingStyle:style withUndoAction:EditActionUnspecified];
+ [[self _selectedOrMainFrame] _setTypingStyle:style withUndoAction:EditActionUnspecified];
}
- (DOMCSSStyleDeclaration *)typingStyle
{
- return [[self _bridgeForSelectedOrMainFrame] typingStyle];
+ return [[self _selectedOrMainFrame] _typingStyle];
}
- (void)setSmartInsertDeleteEnabled:(BOOL)flag
@@ -3471,22 +4165,22 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
- (void)replaceSelectionWithNode:(DOMNode *)node
{
- [[self _bridgeForSelectedOrMainFrame] replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:NO];
+ [[self _selectedOrMainFrame] _replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:NO];
}
- (void)replaceSelectionWithText:(NSString *)text
{
- [[self _bridgeForSelectedOrMainFrame] replaceSelectionWithText:text selectReplacement:YES smartReplace:NO];
+ [[self _selectedOrMainFrame] _replaceSelectionWithText:text selectReplacement:YES smartReplace:NO];
}
- (void)replaceSelectionWithMarkupString:(NSString *)markupString
{
- [[self _bridgeForSelectedOrMainFrame] replaceSelectionWithMarkupString:markupString baseURLString:nil selectReplacement:YES smartReplace:NO];
+ [[self _selectedOrMainFrame] _replaceSelectionWithMarkupString:markupString baseURLString:nil selectReplacement:YES smartReplace:NO];
}
- (void)replaceSelectionWithArchive:(WebArchive *)archive
{
- [[[[self _bridgeForSelectedOrMainFrame] webFrame] _dataSource] _replaceSelectionWithArchive:archive selectReplacement:YES];
+ [[[self _selectedOrMainFrame] _dataSource] _replaceSelectionWithArchive:archive selectReplacement:YES];
}
- (void)deleteSelection
@@ -3553,12 +4247,12 @@ FOR_EACH_RESPONDER_SELECTOR(FORWARD)
- (void)_insertNewlineInQuotedContent;
{
- [[self _bridgeForSelectedOrMainFrame] insertParagraphSeparatorInQuotedContent];
+ [[self _selectedOrMainFrame] _insertParagraphSeparatorInQuotedContent];
}
- (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle
{
- [[self _bridgeForSelectedOrMainFrame] replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:matchStyle];
+ [[self _selectedOrMainFrame] _replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:matchStyle];
}
@end
@@ -3583,13 +4277,14 @@ static WebFrameView *containingFrameView(NSView *view)
// As a fudge factor, use 1000 instead of 1024, in case the reported byte
// count doesn't align exactly to a megabyte boundary.
- vm_size_t memSize = WebMemorySize() / 1024 / 1000;
+ uint64_t memSize = WebMemorySize() / 1024 / 1000;
unsigned long long diskFreeSize = WebVolumeFreeSize(nsurlCacheDirectory) / 1024 / 1000;
NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
unsigned cacheTotalCapacity = 0;
unsigned cacheMinDeadCapacity = 0;
unsigned cacheMaxDeadCapacity = 0;
+ double deadDecodedDataDeletionInterval = 0;
unsigned pageCacheCapacity = 0;
@@ -3602,11 +4297,7 @@ static WebFrameView *containingFrameView(NSView *view)
pageCacheCapacity = 0;
// Object cache capacities (in bytes)
- if (memSize >= 4096)
- cacheTotalCapacity = 256 * 1024 * 1024;
- else if (memSize >= 3072)
- cacheTotalCapacity = 192 * 1024 * 1024;
- else if (memSize >= 2048)
+ if (memSize >= 2048)
cacheTotalCapacity = 128 * 1024 * 1024;
else if (memSize >= 1536)
cacheTotalCapacity = 86 * 1024 * 1024;
@@ -3640,11 +4331,7 @@ static WebFrameView *containingFrameView(NSView *view)
pageCacheCapacity = 0;
// Object cache capacities (in bytes)
- if (memSize >= 4096)
- cacheTotalCapacity = 256 * 1024 * 1024;
- else if (memSize >= 3072)
- cacheTotalCapacity = 192 * 1024 * 1024;
- else if (memSize >= 2048)
+ if (memSize >= 2048)
cacheTotalCapacity = 128 * 1024 * 1024;
else if (memSize >= 1536)
cacheTotalCapacity = 86 * 1024 * 1024;
@@ -3683,11 +4370,7 @@ static WebFrameView *containingFrameView(NSView *view)
case WebCacheModelPrimaryWebBrowser: {
// Page cache capacity (in pages)
// (Research indicates that value / page drops substantially after 3 pages.)
- if (memSize >= 8192)
- pageCacheCapacity = 7;
- if (memSize >= 4096)
- pageCacheCapacity = 6;
- else if (memSize >= 2048)
+ if (memSize >= 2048)
pageCacheCapacity = 5;
else if (memSize >= 1024)
pageCacheCapacity = 4;
@@ -3702,11 +4385,7 @@ static WebFrameView *containingFrameView(NSView *view)
// (Testing indicates that value / MB depends heavily on content and
// browsing pattern. Even growth above 128MB can have substantial
// value / MB for some content / browsing patterns.)
- if (memSize >= 4096)
- cacheTotalCapacity = 512 * 1024 * 1024;
- else if (memSize >= 3072)
- cacheTotalCapacity = 384 * 1024 * 1024;
- else if (memSize >= 2048)
+ if (memSize >= 2048)
cacheTotalCapacity = 256 * 1024 * 1024;
else if (memSize >= 1536)
cacheTotalCapacity = 172 * 1024 * 1024;
@@ -3724,6 +4403,8 @@ static WebFrameView *containingFrameView(NSView *view)
// can prove that the overall system gain would justify the regression.
cacheMaxDeadCapacity = max(24u, cacheMaxDeadCapacity);
+ deadDecodedDataDeletionInterval = 60;
+
// Foundation memory cache capacity (in bytes)
// (These values are small because WebCore does most caching itself.)
if (memSize >= 1024)
@@ -3765,10 +4446,11 @@ static WebFrameView *containingFrameView(NSView *view)
nsurlCacheDiskCapacity = max(nsurlCacheDiskCapacity, [nsurlCache diskCapacity]);
cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+ cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
pageCache()->setCapacity(pageCacheCapacity);
[nsurlCache setMemoryCapacity:nsurlCacheMemoryCapacity];
[nsurlCache setDiskCapacity:nsurlCacheDiskCapacity];
-
+
s_cacheModel = cacheModel;
s_didSetCacheModel = YES;
}
@@ -3833,11 +4515,6 @@ static WebFrameView *containingFrameView(NSView *view)
return result;
}
-- (WebFrameBridge *)_bridgeForSelectedOrMainFrame
-{
- return [[self _selectedOrMainFrame] _bridge];
-}
-
- (BOOL)_isLoading
{
WebFrame *mainFrame = [self mainFrame];
@@ -3907,8 +4584,9 @@ static WebFrameView *containingFrameView(NSView *view)
NSDictionary *element = [sender representedObject];
ASSERT([element isKindOfClass:[NSDictionary class]]);
-
- NSURLRequest *request = [[[[element objectForKey:WebElementFrameKey] dataSource] request] copy];
+
+ WebDataSource *dataSource = [[element objectForKey:WebElementFrameKey] dataSource];
+ NSURLRequest *request = [[dataSource request] copy];
ASSERT(request);
[self _openNewWindowWithRequest:request];
@@ -3953,68 +4631,6 @@ static WebFrameView *containingFrameView(NSView *view)
(void)HISearchWindowShow((CFStringRef)selectedString, kNilOptions);
}
-
-// Slightly funky method that lets us have one copy of the logic for finding docViews that can do
-// text sizing. It returns whether it found any "suitable" doc views. It sends sel to any suitable
-// doc views, or if sel==0 we do nothing to them. For doc views that track our size factor, they are
-// suitable if doTrackingViews==YES (which in practice means that our size factor isn't at its max or
-// min). For doc views that don't track it, we send them testSel to determine suitablility. If we
-// do find any suitable tracking doc views and newScaleFactor!=0, we will set the common scale factor
-// to that new factor before we send sel to any of them.
-- (BOOL)_performTextSizingSelector:(SEL)sel withObject:(id)arg onTrackingDocs:(BOOL)doTrackingViews selForNonTrackingDocs:(SEL)testSel newScaleFactor:(float)newScaleFactor
-{
- if ([[self mainFrame] _dataSource] == nil)
- return NO;
-
- BOOL foundSome = NO;
- NSArray *docViews = [[self mainFrame] _documentViews];
- for (int i = [docViews count]-1; i >= 0; i--) {
- id docView = [docViews objectAtIndex:i];
- if ([docView conformsToProtocol:@protocol(_WebDocumentTextSizing)]) {
- id <_WebDocumentTextSizing> sizingDocView = (id <_WebDocumentTextSizing>)docView;
- BOOL isSuitable;
- if ([sizingDocView _tracksCommonSizeFactor]) {
- isSuitable = doTrackingViews;
- if (isSuitable && newScaleFactor != 0)
- _private->textSizeMultiplier = newScaleFactor;
- } else {
- // Incantation to perform a selector returning a BOOL.
- isSuitable = ((BOOL(*)(id, SEL))objc_msgSend)(sizingDocView, testSel);
- }
-
- if (isSuitable) {
- if (sel != 0) {
- foundSome = YES;
- [sizingDocView performSelector:sel withObject:arg];
- } else {
- // if we're just called for the benefit of the return value, we can return at first match
- return YES;
- }
- }
- }
- }
-
- return foundSome;
-}
-
-- (void)_notifyTextSizeMultiplierChanged
-{
- if ([[self mainFrame] _dataSource] == nil)
- return;
-
- NSArray *docViews = [[self mainFrame] _documentViews];
- for (int i = [docViews count]-1; i >= 0; i--) {
- id docView = [docViews objectAtIndex:i];
- if ([docView conformsToProtocol:@protocol(_WebDocumentTextSizing)] == NO)
- continue;
-
- id <_WebDocumentTextSizing> sizingDocView = (id <_WebDocumentTextSizing>)docView;
- if ([sizingDocView _tracksCommonSizeFactor])
- [sizingDocView _textSizeMultiplierChanged];
- }
-
-}
-
@end
@implementation WebView (WebViewInternal)
@@ -4065,104 +4681,87 @@ static WebFrameView *containingFrameView(NSView *view)
[self _didChangeValueForKey:_WebMainFrameIconKey];
}
-- (NSString *)_userVisibleBundleVersionFromFullVersion:(NSString *)fullVersion
-{
- // If the version is 4 digits long or longer, then the first digit represents
- // the version of the OS. Our user agent string should not include this first digit,
- // so strip it off and report the rest as the version. <rdar://problem/4997547>
- NSRange nonDigitRange = [fullVersion rangeOfCharacterFromSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]];
- if (nonDigitRange.location == NSNotFound && [fullVersion length] >= 4)
- return [fullVersion substringFromIndex:1];
- if (nonDigitRange.location != NSNotFound && nonDigitRange.location >= 4)
- return [fullVersion substringFromIndex:1];
- return fullVersion;
-}
-
-static inline int callGestalt(OSType selector)
-{
- SInt32 value = 0;
- Gestalt(selector, &value);
- return value;
-}
-
-// Uses underscores instead of dots because if "4." ever appears in a user agent string, old DHTML libraries treat it as Netscape 4.
-static NSString *createMacOSXVersionString()
-{
- // Can't use -[NSProcessInfo operatingSystemVersionString] because it has too much stuff we don't want.
- int major = callGestalt(gestaltSystemVersionMajor);
- ASSERT(major);
-
- int minor = callGestalt(gestaltSystemVersionMinor);
- int bugFix = callGestalt(gestaltSystemVersionBugFix);
- if (bugFix)
- return [[NSString alloc] initWithFormat:@"%d_%d_%d", major, minor, bugFix];
- if (minor)
- return [[NSString alloc] initWithFormat:@"%d_%d", major, minor];
- return [[NSString alloc] initWithFormat:@"%d", major];
-}
-
-- (NSString *)_userAgentWithApplicationName:(NSString *)applicationName andWebKitVersion:(NSString *)version
-{
- static NSString *osVersion = createMacOSXVersionString();
- NSString *language = [NSUserDefaults _webkit_preferredLanguageCode];
- if ([applicationName length])
- return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko) %@",
- osVersion, language, version, applicationName];
- return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko)",
- osVersion, language, version];
-}
-
// Get the appropriate user-agent string for a particular URL.
- (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url
{
if (_private->useSiteSpecificSpoofing) {
// No current site-specific spoofs.
}
-
- if (_private->userAgent->isNull()) {
- NSString *sourceVersion = [[NSBundle bundleForClass:[WebView class]] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
- sourceVersion = [self _userVisibleBundleVersionFromFullVersion:sourceVersion];
- *_private->userAgent = [self _userAgentWithApplicationName:_private->applicationNameForUserAgent andWebKitVersion:sourceVersion];
- }
- return *_private->userAgent;
+ if (_private->userAgent.isNull())
+ _private->userAgent = [[self class] _standardUserAgentWithApplicationName:_private->applicationNameForUserAgent];
+
+ return _private->userAgent;
}
- (void)_addObject:(id)object forIdentifier:(unsigned long)identifier
{
- ASSERT(!_private->identifierMap->contains(identifier));
+ ASSERT(!_private->identifierMap.contains(identifier));
// If the identifier map is initially empty it means we're starting a load
// of something. The semantic is that the web view should be around as long
// as something is loading. Because of that we retain the web view.
- if (_private->identifierMap->isEmpty())
+ if (_private->identifierMap.isEmpty())
CFRetain(self);
- _private->identifierMap->set(identifier, object);
+ _private->identifierMap.set(identifier, object);
}
- (id)_objectForIdentifier:(unsigned long)identifier
{
- return _private->identifierMap->get(identifier).get();
+ return _private->identifierMap.get(identifier).get();
}
- (void)_removeObjectForIdentifier:(unsigned long)identifier
{
- HashMap<unsigned long, RetainPtr<id> >::iterator it = _private->identifierMap->find(identifier);
-
- // FIXME: This is currently needed because of a bug that causes didFail to be sent twice
- // sometimes, see <rdar://problem/5009627> for more information.
- if (it == _private->identifierMap->end())
- return;
-
- _private->identifierMap->remove(it);
+ ASSERT(_private->identifierMap.contains(identifier));
+ _private->identifierMap.remove(identifier);
// If the identifier map is now empty it means we're no longer loading anything
// and we should release the web view.
- if (_private->identifierMap->isEmpty())
+ if (_private->identifierMap.isEmpty())
CFRelease(self);
}
+- (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification
+{
+ CFPreferencesAppSynchronize(UniversalAccessDomain);
+
+ Boolean keyExistsAndHasValidFormat;
+ int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat);
+
+ // The keyboard access mode is reported by two bits:
+ // Bit 0 is set if feature is on
+ // Bit 1 is set if full keyboard access works for any control, not just text boxes and lists
+ // We require both bits to be on.
+ // I do not know that we would ever get one bit on and the other off since
+ // checking the checkbox in system preferences which is marked as "Turn on full keyboard access"
+ // turns on both bits.
+ _private->_keyboardUIMode = (mode & 0x2) ? KeyboardAccessFull : KeyboardAccessDefault;
+
+ // check for tabbing to links
+ if ([_private->preferences tabsToLinks])
+ _private->_keyboardUIMode = (KeyboardUIMode)(_private->_keyboardUIMode | KeyboardAccessTabsToLinks);
+}
+
+- (KeyboardUIMode)_keyboardUIMode
+{
+ if (!_private->_keyboardUIModeAccessed) {
+ _private->_keyboardUIModeAccessed = YES;
+
+ [self _retrieveKeyboardUIModeFromPreferences:nil];
+
+ [[NSDistributedNotificationCenter defaultCenter]
+ addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
+ name:KeyboardUIModeDidChangeNotification object:nil];
+
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
+ name:WebPreferencesChangedNotification object:nil];
+ }
+ return _private->_keyboardUIMode;
+}
+
@end
// We use these functions to call the delegates and block exceptions. These functions are
@@ -4171,9 +4770,11 @@ static NSString *createMacOSXVersionString()
@implementation WebView (WebCallDelegateFunctions)
-#if !(defined(__i386__) || defined(__x86_64__))
-typedef double (*ObjCMsgSendFPRet)(id, SEL, ...);
-static const ObjCMsgSendFPRet objc_msgSend_fpret = reinterpret_cast<ObjCMsgSendFPRet>(objc_msgSend);
+typedef float (*ObjCMsgSendFPRet)(id, SEL, ...);
+#if defined(__i386__)
+static const ObjCMsgSendFPRet objc_msgSend_float_return = reinterpret_cast<ObjCMsgSendFPRet>(objc_msgSend_fpret);
+#else
+static const ObjCMsgSendFPRet objc_msgSend_float_return = reinterpret_cast<ObjCMsgSendFPRet>(objc_msgSend);
#endif
static inline id CallDelegate(WebView *self, id delegate, SEL selector)
@@ -4279,9 +4880,9 @@ static inline float CallDelegateReturningFloat(WebView *self, id delegate, SEL s
if (!delegate || ![delegate respondsToSelector:selector])
return 0.0f;
if (!self->_private->catchesDelegateExceptions)
- return static_cast<float>(objc_msgSend_fpret(delegate, selector, self));
+ return objc_msgSend_float_return(delegate, selector, self);
@try {
- return static_cast<float>(objc_msgSend_fpret(delegate, selector, self));
+ return objc_msgSend_float_return(delegate, selector, self);
} @catch(id exception) {
ReportDiscardedDelegateException(selector, exception);
}
diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h
index b6addad..39b3ef5 100644
--- a/WebKit/mac/WebView/WebViewInternal.h
+++ b/WebKit/mac/WebView/WebViewInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,13 +26,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// This header contains WebView declarations that can be used anywhere in the Web Kit, but are neither SPI nor API.
+// This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API.
#import "WebPreferences.h"
#import "WebViewPrivate.h"
#import "WebTypesInternal.h"
#ifdef __cplusplus
+#import <WebCore/WebCoreKeyboardUIMode.h>
+#endif
+
+#ifdef __cplusplus
namespace WebCore {
class KeyboardEvent;
class KURL;
@@ -48,6 +52,7 @@ typedef WebCore::Page WebCorePage;
@class WebBasePluginPackage;
@class WebDownload;
+@class WebNodeHighlight;
@interface WebView (WebViewEditingExtras)
- (BOOL)_interceptEditingKeyEvent:(WebCoreKeyboardEvent *)event shouldSaveCommand:(BOOL)shouldSave;
@@ -63,6 +68,7 @@ typedef WebCore::Page WebCorePage;
@interface WebView (WebViewInternal)
#ifdef __cplusplus
- (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url;
+- (WebCore::KeyboardUIMode)_keyboardUIMode;
#endif
@end
@@ -108,6 +114,13 @@ typedef WebCore::Page WebCorePage;
- (WebBasePluginPackage *)_pluginForExtension:(NSString *)extension;
- (BOOL)_isMIMETypeRegisteredAsPlugin:(NSString *)MIMEType;
+- (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight;
+- (WebNodeHighlight *)currentNodeHighlight;
+
+- (void)addPluginInstanceView:(NSView *)view;
+- (void)removePluginInstanceView:(NSView *)view;
+- (void)removePluginInstanceViewsFor:(WebFrame*)webFrame;
+
- (void)_addObject:(id)object forIdentifier:(unsigned long)identifier;
- (id)_objectForIdentifier:(unsigned long)identifier;
- (void)_removeObjectForIdentifier:(unsigned long)identifier;
@@ -116,6 +129,22 @@ typedef WebCore::Page WebCorePage;
- (void)_registerForIconNotification:(BOOL)listen;
- (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame;
+- (void)_setZoomMultiplier:(float)m isTextOnly:(BOOL)isTextOnly;
+- (float)_zoomMultiplier:(BOOL)isTextOnly;
+- (float)_realZoomMultiplier;
+- (BOOL)_realZoomMultiplierIsTextOnly;
+- (BOOL)_canZoomOut:(BOOL)isTextOnly;
+- (BOOL)_canZoomIn:(BOOL)isTextOnly;
+- (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly;
+- (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly;
+- (BOOL)_canResetZoom:(BOOL)isTextOnly;
+- (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly;
+
+- (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count;
+- (void)_updateFocusedAndActiveStateForFrame:(WebFrame *)webFrame;
+
++ (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame;
+
@end
typedef struct _WebResourceDelegateImplementationCache {
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index 9c95ab0..3a33bf9 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -29,6 +29,10 @@
#import <WebKit/WebView.h>
#import <WebKit/WebFramePrivate.h>
+#if !defined(ENABLE_DASHBOARD_SUPPORT)
+#define ENABLE_DASHBOARD_SUPPORT 1
+#endif
+
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
#define WebNSInteger int
#define WebNSUInteger unsigned int
@@ -41,6 +45,7 @@
@class WebFrame;
@class WebInspector;
@class WebPreferences;
+@class WebTextIterator;
@protocol WebFormDelegate;
@@ -61,6 +66,7 @@ extern NSString *WebElementIsContentEditableKey; // NSNumber indicating whether
// other WebElementDictionary keys
extern NSString *WebElementLinkIsLiveKey; // NSNumber of BOOL indictating whether the link is live or not
+#if ENABLE_DASHBOARD_SUPPORT
typedef enum {
WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows,
WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns,
@@ -68,6 +74,7 @@ typedef enum {
WebDashboardBehaviorAllowWheelScrolling,
WebDashboardBehaviorUseBackwardCompatibilityMode
} WebDashboardBehavior;
+#endif
@interface WebController : NSTreeController {
IBOutlet WebView *webView;
@@ -84,6 +91,9 @@ typedef enum {
@interface WebView (WebPendingPublic)
+- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
+- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
+
/*!
@method searchFor:direction:caseSensitive:wrap:startInSelection:
@abstract Searches a document view for a string and highlights the string if it is found.
@@ -146,12 +156,31 @@ typedef enum {
- (BOOL)allowsUndo;
- (void)setAllowsUndo:(BOOL)flag;
+/*!
+ @method setPageSizeMultiplier:
+ @abstract Change the zoom factor of the page in views managed by this webView.
+ @param multiplier A fractional percentage value, 1.0 is 100%.
+*/
+- (void)setPageSizeMultiplier:(float)multiplier;
+
+/*!
+ @method pageSizeMultiplier
+ @result The page size multipler.
+*/
+- (float)pageSizeMultiplier;
+
+// Commands for doing page zoom. Will end up in WebView (WebIBActions) <NSUserInterfaceValidations>
+- (BOOL)canZoomPageIn;
+- (IBAction)zoomPageIn:(id)sender;
+- (BOOL)canZoomPageOut;
+- (IBAction)zoomPageOut:(id)sender;
+- (BOOL)canResetPageZoom;
+- (IBAction)resetPageZoom:(id)sender;
+
@end
@interface WebView (WebPrivate)
-+ (BOOL)_scriptDebuggerEnabled;
-
- (WebInspector *)inspector;
/*!
@@ -196,11 +225,16 @@ Could be worth adding to the API.
*/
+ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType;
++ (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName;
+
// May well become public
- (void)_setFormDelegate:(id<WebFormDelegate>)delegate;
- (id<WebFormDelegate>)_formDelegate;
- (BOOL)_isClosed;
+
+// _close is now replaced by public method -close. It remains here only for backward compatibility
+// until callers can be weaned off of it.
- (void)_close;
/*!
@@ -232,15 +266,19 @@ Could be worth adding to the API.
+ (NSString *)_decodeData:(NSData *)data;
++ (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f;
+// This is the old name of the above method. Needed for Safari versions that call it.
+ (void)_setAlwaysUseATSU:(BOOL)f;
- (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL;
+#if ENABLE_DASHBOARD_SUPPORT
- (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions;
- (NSDictionary *)_dashboardRegions;
- (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag;
- (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior;
+#endif
+ (void)_setShouldUseFontSmoothing:(BOOL)f;
+ (BOOL)_shouldUseFontSmoothing;
@@ -324,9 +362,18 @@ Could be worth adding to the API.
- (BOOL)usesPageCache;
- (void)setUsesPageCache:(BOOL)usesPageCache;
+/*!
+ @method textIteratorForRect:
+ @param rectangle from which we want the WebTextIterator to load text from
+ @result a WebtextIterator object.
+ */
+- (WebTextIterator *)textIteratorForRect:(NSRect)rect;
+
+#if ENABLE_DASHBOARD_SUPPORT
// <rdar://problem/5217124> Clients other than dashboard, don't use this.
// Do not remove until Dashboard has moved off it
- (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource;
+#endif
- (void)_clearUndoRedoOperations;
@@ -334,8 +381,18 @@ Could be worth adding to the API.
- (BOOL)_inFastImageScalingMode;
- (void)_setUseFastImageScalingMode:(BOOL)flag;
+- (BOOL)_cookieEnabled;
+- (void)_setCookieEnabled:(BOOL)enable;
+
// SPI for DumpRenderTree
- (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value;
+- (void)_clearMainFrameName;
+
+- (void)_setCustomHTMLTokenizerTimeDelay:(double)timeDelay;
+- (void)_setCustomHTMLTokenizerChunkSize:(int)chunkSize;
+
+- (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews;
+- (BOOL)_usesDocumentViews;
@end
diff --git a/WebKit/mac/icu/unicode/utf_old.h b/WebKit/mac/icu/unicode/utf_old.h
index e69de29..8504a03 100644
--- a/WebKit/mac/icu/unicode/utf_old.h
+++ b/WebKit/mac/icu/unicode/utf_old.h
@@ -0,0 +1 @@
+/* This file is intentionally left blank. */