diff options
Diffstat (limited to 'WebKit/mac')
111 files changed, 11242 insertions, 4895 deletions
diff --git a/WebKit/mac/Carbon/CarbonWindowAdapter.m b/WebKit/mac/Carbon/CarbonWindowAdapter.mm index 843fc59..ba1da71 100644 --- a/WebKit/mac/Carbon/CarbonWindowAdapter.m +++ b/WebKit/mac/Carbon/CarbonWindowAdapter.mm @@ -73,6 +73,7 @@ #import <assert.h> #import <WebCore/WebCoreObjCExtras.h> +#import <runtime/InitializeThreading.h> #import "WebKitLogging.h" #import "WebNSObjectExtras.h" @@ -265,12 +266,13 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall } } -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} // Given a reference to a Carbon window that is to be encapsulated, and an indicator of whether or not this object should take responsibility for disposing of the Carbon window, initialize. - (id)initWithCarbonWindowRef:(WindowRef)inWindowRef takingOwnership:(BOOL)inWindowRefIsOwned { diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index 78db0ab..16a69b1 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,3822 @@ +2009-02-18 Mark Rowe <mrowe@apple.com> + + Merge r41071. + + 2009-02-18 Dan Bernstein <mitz@apple.com> + + Reviewed by Brady Eidson. + + - WebKit part of fixing <rdar://problem/6507512> Crash in iChat at CSSStyleSelector::adjustRenderStyle + + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): Activate the WebCore + workaround for this crash in iChat. + +2009-02-13 Mark Rowe <mrowe@apple.com> + + Merge r40940. + + 2009-02-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + <rdar://problem/6579412> + REGRESSION (3.2.1-ToT): Crash in Silverlight viewing streaming lecture + + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView userAgent]): + Apply workaround for Silverlight workaround. + + (-[WebNetscapePluginView _createPlugin]): + Check if the plug-in that we're creating is the silverlight plug-in. + +2009-02-13 Mark Rowe <mrowe@apple.com> + + Merge r40920. + + 2009-02-12 Brady Eidson <beidson@apple.com> + + Reviewed by Kevin Decker + + <rdar://problem/6579750> - Crash in WebArchivePrivate in Tiger TextEdit + + NSHTMLReader tries to create a WebArchive from a random chunk of data. Previously, WebArchive creation would + fail and return nil and NSHTMLReader would try something else. When we changed the behavior to return an invalid + WebArchive object, things started getting weird. + + * WebView/WebArchive.mm: + (-[WebArchivePrivate setCoreArchive:]): Null check the pointer before calling ->deref() + (-[WebArchivePrivate dealloc]): Remove the ASSERT which is now invalid, and null check the pointer before ->deref(). + (-[WebArchivePrivate finalize]): Ditto + (-[WebArchive initWithData:]): If the LegacyWebArchive cannot be created, return nil instead of an invalid object. + +2009-02-12 Mark Rowe <mrowe@apple.com> + + Merge r40884. + + 2009-02-11 Mark Rowe <mrowe@apple.com> + + Fix the build. + + * History/WebHistory.mm: + (-[WebHistoryPrivate visitedURL:withTitle:]): Use ASSERT_UNUSED in a manner that makes sense. + +2009-02-12 Mark Rowe <mrowe@apple.com> + + Merge r40882. + + 2009-02-11 Brady Eidson <beidson@apple.com> + + Reviewed by Mark Rowe + + <rdar://problem/6570573> Some visit counts in History.plist have insanely high values, can roll over to negative + + Remove the item from the date caches before registering the visit. Otherwise it might not be successfully removed + and when we add it back later it will exist in the list twice. This will cause the entry to be written out twice, + which would lead to doubling (or more!) the visit count on next launch when these multiple items are merged. + + * History/WebHistory.mm: + (-[WebHistoryPrivate visitedURL:withTitle:]): Swap the removeItemFromDateCaches and visitedWithTitle calls. + (-[WebHistoryPrivate addItem:discardDuplicate:]): Add a mode that allows the entry being added to be discarded + if an entry for the URL already exists. Use that mode when reading the History.plist so only the most + recent entry for a given URL will be used. + (-[WebHistoryPrivate addItems:]): + (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): + +2009-02-11 Mark Rowe <mrowe@apple.com> + + Merge r40851. + + 2009-02-10 John Sullivan <sullivan@apple.com> + + Reviewed by Dan Bernstein + + <https://bugs.webkit.org/show_bug.cgi?id=23889>, <rdar://problem/6572300> + Negative visit counts stored in History.plist aren't corrected. + + It's not clear how a huge negative visit count ended up in History.plist, but we can't + trust data read from disk so we can at least reset this to something sane. WebCore has + no guard against a visit count overflowing an int, but that seems very unlikely to have + caused this. + + * History/WebHistoryItem.mm: + (-[WebHistoryItem initFromDictionaryRepresentation:]): + If a negative visit count is in the dictionary, replace it with 1. If a negative daily or + weekly visit count is in the dictionary, replace it with 0. + +2009-02-06 Mark Rowe <mrowe@apple.com> + + Merge r40727. + + 2009-02-06 Dan Bernstein <mitz@apple.com> + + - try to fix the Tiger build + + * Misc/WebNSArrayExtras.h: + +2009-02-06 Mark Rowe <mrowe@apple.com> + + Merge r40711. + + 2009-02-05 Maciej Stachowiak <mjs@apple.com> and Brady Eidson <beidson@apple.com> + + Reviewed by Dan Bernstein and Geoff Garen. + + - WebKit code to track per-day and per-week visit counts in history + + For now this data is only exposed via SPI for performance reasons. + + * History/WebHistoryItem.mm: + (-[WebHistoryItem initFromDictionaryRepresentation:]): Add parsing support + for new data. + (-[WebHistoryItem _recordInitialVisit]): Tell WebCore to record an initial visit. + (-[WebHistoryItem dictionaryRepresentation]): Add saving support for new data. + (-[WebHistoryItem _getDailyVisitCounts:]): SPI accessor. + (-[WebHistoryItem _getWeeklyVisitCounts:]): SPI accessor. + * History/WebHistoryItemInternal.h: Declare new methods. + * History/WebHistoryItemPrivate.h: Ditto. + + * History/WebHistory.mm: + (-[WebHistoryPrivate visitedURL:withTitle:]): For the initial visit, use + the new _recordInitialVisit method instead of setting visit count to 1. + + * Misc/WebNSArrayExtras.h: + * Misc/WebNSArrayExtras.m: + (-[NSArray _webkit_numberAtIndex:]): Helper to retrieve an NSNumber or nil from an NSArray + (-[NSArray _webkit_stringAtIndex:]): Helper to retrieve an NSString of nil from an NSArray + +2009-02-06 Mark Rowe <mrowe@apple.com> + + Merge r40680. + + 2009-02-05 Beth Dakin <bdakin@apple.com> + + Reviewed by John Sullivan and Brady Eidson. + + Fix for <rdar://problem/6557595> REGRESSION: In Mail, selecting a + mail note message doesn't display it in Mail's preview pane + + This was failing because revision 36962 removed a version of + setVerticalScrollingMode that mail calls. This patch simply adds + that method back. + + * WebView/WebDynamicScrollBarsView.m: + (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40514. + + 2009-02-02 Geoffrey Garen <ggaren@apple.com> + + Build fix. + + * Plugins/WebPluginController.mm: + (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40508. + + 2009-02-02 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Sam Weinig. + + Track redirects in global history. + + * History/WebHistory.mm: + (-[WebHistoryPrivate dealloc]): + (-[WebHistoryPrivate lastVisitedEntry]): + (-[WebHistoryPrivate setLastVisitedEntry:]): Remember the last global history + entry in case we're asked to add redirect information to it later. + + (-[WebHistory _visitedURL:withTitle:method:wasFailure:serverRedirectURL:isClientRedirect:]): + (-[WebHistory _visitedURLForRedirectWithoutHistoryItem:]): Record redirect + information in global history. + + * History/WebHistoryInternal.h: + * WebCoreSupport/WebFrameLoaderClient.h: See above and below. + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::updateGlobalHistory): + (WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem): Record redirect + information in global history. + + * WebView/WebFrame.mm: + (-[WebFrame loadRequest:]): + (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): + * WebView/WebFramePrivate.h: Updated for rename and extra parameter. + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40382. + + 2009-01-29 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Second step in tracking the urls a HistoryItem was redirected through + Add SPI to access the array of redirect urls associated with a HistoryItem. + + * History/WebHistoryItem.mm: + (-[WebHistoryItem dictionaryRepresentation]): + (-[WebHistoryItem _redirectURLs]): + * History/WebHistoryItemPrivate.h: + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40380. + + 2009-01-29 Sam Weinig <sam@webkit.org> + + Reviewed by Mark Rowe. + + First step in tracking the urls a HistoryItem was redirected through. + + * History/WebHistoryItem.mm: + (-[WebHistoryItem initFromDictionaryRepresentation:]): + (-[WebHistoryItem dictionaryRepresentation]): + * Misc/WebNSDictionaryExtras.h: + * Misc/WebNSDictionaryExtras.m: + (-[NSDictionary _webkit_arrayForKey:]): Add helper. + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40436. + + 2009-01-30 Geoffrey Garen <ggaren@apple.com> + + Build fix. + + * WebView/WebFramePrivate.h: + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40432. + + 2009-01-30 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Sam Weinig. + + Split "lockHistory" into "lockHistory" and "lockBackForwardList" in + preparation for setting them differently during a redirect. + + * WebView/WebPDFView.mm: + (-[WebPDFView PDFViewWillClickOnLink:withURL:]): + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40353. + + 2009-01-28 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Sam Weinig. + + Updated for WebCore rename. + + * WebView/WebView.mm: + (-[WebView setCustomTextEncodingName:]): + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40397. + + 2009-01-29 Stephanie Lewis <slewis@apple.com> + + RS by Oliver Hunt. + + Update the order files. + + * WebKit.order: + +2009-02-03 Mark Rowe <mrowe@apple.com> + + Merge r40332. + + 2009-01-28 Sam Weinig <sam@webkit.org> + + Reviewed by Geoff Garen. + + Fix for <rdar://problem/6129678> + REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view + + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): Wrap JSActivations in DebuggerActivations. + +2009-01-27 Brady Eidson <beidson@apple.com> + + Reviewed by Dan Bernstein + + Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage + + * History/WebHistoryItem.mm: + + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::savePlatformDataToCachedFrame): + (WebFrameLoaderClient::transitionToCommittedFromCachedFrame): + * WebKit.order: + +2009-01-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add the ability for plug-ins to make WebKit operate in "modal mode" + + * Plugins/Hosted/NetscapePluginHostProxy.h: + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + (WebKit::NetscapePluginHostProxy::pluginHostDied): + If the plug-in crashes while we're modal, make sure to leave the modal mode. + + (WebKit::NetscapePluginHostProxy::setModal): + (WKPCSetModal): + * Plugins/Hosted/WebKitPluginClient.defs: + +2009-01-26 John Sullivan <sullivan@apple.com> + + fixed <rdar://problem/6530053> REGRESSION (Leopard): Shift-tab in http authentication window gets + stuck in the Name field rather than cycling around + + Reviewed by Dan Bernstein + + * Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib: + * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib: + The two static text fields and the last button all had their "next key view" outlets set to the + name field, which caused shift-tab from the name field to do the wrong thing. Fixed by making each + selectable view have exactly one "next key view" set to it. + +2009-01-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add the ability for a plug-in to show or hide the menu bar. + + * Plugins/Hosted/NetscapePluginHostProxy.h: + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + (WebKit::NetscapePluginHostProxy::pluginHostDied): + (WebKit::NetscapePluginHostProxy::setMenuBarVisible): + (WKPCSetMenuBarVisible): + * Plugins/Hosted/WebKitPluginClient.defs: + +2009-01-26 Cameron Zwarich <cwzwarich@uwaterloo.ca> + + Reviewed by Gavin Barraclough. + + Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames + <https://bugs.webkit.org/show_bug.cgi?id=23552> + <rdar://problem/6398839> + + Dashcode will crash when using the evaluator because it saves a global call + frame, even after global code has finished executing, and then uses this as + a launching pad to execute new JS in the evaluator. The fix is to detect + when Dashcode is attempting to do this and execute code from a global call + frame instead. + + * ForwardingHeaders/runtime/Protect.h: Added. + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame _initWithGlobalObject:debugger:caller:debuggerCallFrame:]): + Added debugger, a WebScriptDebugger* argument. + (-[WebScriptCallFrame evaluateWebScript:]): Detect when Dashcode is using + a stale WebScriptCallFrame to execute new JS and evaluate it starting from + the global object's global call frame instead. + * WebView/WebScriptDebugger.h: + (WebScriptDebugger::globalObject): Added. + (WebScriptDebugger::globalCallFrame): Added. + * WebView/WebScriptDebugger.mm: + (WebScriptDebugger::WebScriptDebugger): Initialize m_globalObject. + (WebScriptDebugger::initGlobalCallFrame): Created as a clone of callEvent + so that the global call frame can be saved immediately after being created. + (WebScriptDebugger::callEvent): Pass 'this' as the debugger argument of + WebScriptCallFrame's _initWithGlobalObject method. + +2009-01-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Oliver Hunt. + + Make WKPCInvoke a simpleroutine. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCInvoke): + * Plugins/Hosted/WebKitPluginClient.defs: + +2009-01-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Implement using plug-in objects as constructors, and setting and getting properties from a plug-in object. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCBooleanAndDataReply): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::Reply::): + (WebKit::NetscapePluginInstanceProxy::BooleanAndDataReply::BooleanAndDataReply): + Rename NPObjectInvokeReply to BooleanAndDataReply. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::addValueToArray): + Fix a cut and paste error. + + (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): + Handle NPObjects. + + * Plugins/Hosted/ProxyInstance.h: + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyField::valueFromInstance): + (WebKit::ProxyField::setValueToInstance): + Call the ProxyInstance method. + + (WebKit::ProxyInstance::~ProxyInstance): + Release the NPObject. + + (WebKit::ProxyInstance::supportsConstruct): + Ask the plug-in host if an instance supports construct. + + (WebKit::ProxyInstance::fieldValue): + (WebKit::ProxyInstance::setFieldValue): + Call the plug-in host methods. + + * Plugins/Hosted/WebKitPluginHostTypes.h: + Rename ObjectValueType to JSObjectValueType, and add NPObjectValueType. + +2009-01-26 Mark Rowe <mrowe@apple.com> + + Fix the build. + + Remove -Wformat=2 from the warning flags as newer versions of GCC emit + warnings about non-literal format strings for uses of our UI_STRING macro. + + * Configurations/Base.xcconfig: + +2009-01-26 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Sam Weinig. + + Clean up after r40240. + + * Configurations/Base.xcconfig: Don't dead code strip in debug builds for now as it leads to link errors. + * Plugins/Hosted/HostedNetscapePluginStream.mm: Revert change that is no longer needed now that WebKitPluginHost.defs + is back in the build. + +2009-01-25 Darin Adler <darin@apple.com> + + * Plugins/Hosted/HostedNetscapePluginStream.mm: Added a missing extern "C". + +2009-01-25 Darin Adler <darin@apple.com> + + Discussed with Mark Rowe; not sure he reviewed it. + + * Configurations/Base.xcconfig: Add all the same warnings as in WebCore except for + -Wcast-qual and -Wunused-parameter, which both need to be off at least for now. + +2009-01-25 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Dan Bernstein. + + Improve the consistency of settings in our .xcconfig files. + + * Configurations/Base.xcconfig: Only dead code strip the normal variant. + Handle all cases in GCC_GENERATE_DEBUGGING_SYMBOLS. + +2009-01-25 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Bug 23522: use checked casts for render tree + https://bugs.webkit.org/show_bug.cgi?id=23522 + + Step one: RenderText. + + * WebView/WebRenderNode.mm: + (copyRenderNode): Use toRenderText. + +2009-01-23 Brady Eidson <beidson@apple.com> + + Rubberstamped by Darin Adler + + Rename CachedPagePlatformData to CachedFramePlatformData to more accurately reflect its true role. + + * WebCoreSupport/WebCachedFramePlatformData.h: Copied from WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h. + (WebCachedFramePlatformData::WebCachedFramePlatformData): + * WebCoreSupport/WebCachedPagePlatformData.h: Removed. + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::savePlatformDataToCachedPage): + (WebFrameLoaderClient::transitionToCommittedFromCachedPage): + + * WebKit.order: + +2009-01-23 Adele Peterson <adele@apple.com> + + Build fix. + + Use new linesBoundingBox method instead of + boundingBoxWidth and boundingBoxHeight for RenderText objects. + + * WebView/WebRenderNode.mm: (copyRenderNode): + +2009-01-23 Anders Carlsson <andersca@apple.com> + + Fix 64-bit build. + + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::proxyClass): + +2009-01-23 Anders Carlsson <andersca@apple.com> + + Fix GCC 4.0 build. + + * Configurations/Base.xcconfig: + +2009-01-23 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Turn on -Wmissing-prototypes and fix the resulting warnings. + + * Configurations/Base.xcconfig: + * History/WebHistory.mm: + (timeIntervalForBeginningOfDay): + * History/WebHistoryItem.mm: + (historyItemWrappers): + * Misc/WebNSPasteboardExtras.mm: + (imageFromElement): + * WebView/WebFrame.mm: + * WebView/WebScriptDebugger.mm: + (toNSString): + +2009-01-22 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Anders Carlsson. + + Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily. + + Current versions of Xcode only respect it for C and Objective-C files, + and our code doesn't currently compile if it is applied to C++ and + Objective-C++ files. + + * Configurations/Base.xcconfig: + +2009-01-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add support for Invoke and InvokeDefault. Clean up code. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCBooleanReply): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::Reply::): + (WebKit::NetscapePluginInstanceProxy::BooleanReply::BooleanReply): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): + * Plugins/Hosted/ProxyInstance.h: + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyInstance::invoke): + (WebKit::ProxyInstance::invokeMethod): + (WebKit::ProxyInstance::supportsInvokeDefaultMethod): + (WebKit::ProxyInstance::invokeDefaultMethod): + (WebKit::ProxyInstance::methodsNamed): + (WebKit::ProxyInstance::fieldNamed): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHost.defs: + * Plugins/Hosted/WebKitPluginHostTypes.h: + +2009-01-22 Eric Roman <eroman@chromium.og> + + Reviewed by Eric Seidel. + + https://bugs.webkit.org/show_bug.cgi?id=20806 + Deprecate RSSFeedReferrer() and setRSSFeedReferrer(). + + * History/WebHistoryItem.mm: + (-[WebHistoryItem RSSFeedReferrer]): + (-[WebHistoryItem setRSSFeedReferrer:]): + +2009-01-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Don't crash or hang when we fail to instantiate a plug-in. + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::instantiatePlugin): + Return 0 on failure. + + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]): + Null check for the proxy member. + +2009-01-21 David Hyatt <hyatt@apple.com> + + Devirtualize width/height/x/y on RenderObject and move the methods to RenderBox. + + Reviewed by Eric Seidel and Darin Adler + + * WebView/WebRenderNode.mm: + (copyRenderNode): + +2009-01-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + More browser->plug-in scripting support. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCNPObjectHasPropertyReply): + (WKPCNPObjectHasMethodReply): + (WKPCNPObjectInvokeReply): + MIG reply functions. + + (WKPCIdentifierInfo): + Return information about an identifier given its 64-bit value. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + Add new reply structs. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::addValueToArray): + Split out code that adds values to the arrays from marshalValue. + + (WebKit::NetscapePluginInstanceProxy::marshalValue): + Call addValueToArray. + + (WebKit::NetscapePluginInstanceProxy::marshalValues): + Marshal a list of values. + + (WebKit::NetscapePluginInstanceProxy::createBindingsInstance): + Actually create a proxy instance. + + * Plugins/Hosted/ProxyInstance.h: + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyClass::methodsNamed): + (WebKit::ProxyClass::fieldNamed): + Add a proxy ProxyClass class that just forwards everything to the ProxyInstance class. + + (WebKit::proxyClass): + Shared proxyClass getter. + + (WebKit::ProxyField::ProxyField): + (WebKit::ProxyField::valueFromInstance): + (WebKit::ProxyField::setValueToInstance): + Add a proxy ProxyField class that just forwards everything to the ProxyInstance class. + + (WebKit::ProxyMethod::ProxyMethod): + (WebKit::ProxyMethod::serverIdentifier): + (WebKit::ProxyMethod::numParameters): + Add a dummy ProxyMethod class. + + (WebKit::ProxyInstance::invokeMethod): + Call _WKPHNPObjectInvoke. + + (WebKit::ProxyInstance::defaultValue): + (WebKit::ProxyInstance::stringValue): + (WebKit::ProxyInstance::numberValue): + (WebKit::ProxyInstance::booleanValue): + (WebKit::ProxyInstance::valueOf): + Add dummy implementations (taken from CInstance). + + (WebKit::ProxyInstance::methodsNamed): + Call _WKPHNPObjectHasMethod to determine whether a method with the given name exists. + + (WebKit::ProxyInstance::fieldNamed): + Call _WKPHNPObjectHasProperty to determine whether a property with the given name exists. + + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHost.defs: + Add new MIG definitions. + +2009-01-21 Mark Rowe <mrowe@apple.com> + + Reviewed by Tim Hatcher. + + Clean up how we force invocations of API that happened on background threads over to the main thread. + + This was previously accomplished in a somewhat ad-hoc manner using a mutable dictionary to pass arguments + and return values back from the function. The new approach is to use a proxy object that forwards an + NSInvocation over to the main thread and applies it to the target object, which leads to a much cleaner + call site. + + * Misc/WebNSObjectExtras.h: + * Misc/WebNSObjectExtras.mm: + (-[WebMainThreadInvoker initWithTarget:]): + (-[WebMainThreadInvoker forwardInvocation:]): + (-[WebMainThreadInvoker methodSignatureForSelector:]): + (-[WebMainThreadInvoker handleException:]): + (-[NSInvocation _webkit_invokeAndHandleException:]): Execute the invocation and forward any exception that was + raised back to the WebMainThreadInvoker. + (-[NSObject _webkit_invokeOnMainThread]): + + The following methods are updated to use the proxy object to forward methods to the main thread: + + * WebView/WebArchive.mm: + (-[WebArchive initWithMainResource:subresources:subframeArchives:]): + (-[WebArchive mainResource]): + (-[WebArchive subresources]): + (-[WebArchive subframeArchives]): + * WebView/WebResource.mm: + (-[WebResource data]): + (-[WebResource URL]): + (-[WebResource MIMEType]): + (-[WebResource textEncodingName]): + (-[WebResource frameName]): + (-[WebResource _ignoreWhenUnarchiving]): + (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): + (-[WebResource _initWithData:URL:response:]): + (-[WebResource _suggestedFilename]): + (-[WebResource _response]): + (-[WebResource _stringValue]): + * WebView/WebView.mm: + (-[WebView initWithFrame:frameName:groupName:]): + (-[WebView initWithCoder:]): + +2009-01-20 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> + + Reviewed by George Staikos. + + Fixes: https://bugs.webkit.org/show_bug.cgi?id=23434 (Add WML <input> element support) + + Protect text field related WebEditorClient.mm methods against non-HTMLElement callers. + WebEditorClient.mm relies on HTMLInputElement as input element. Ignore calls from non-HTMLElement elements. + + * WebCoreSupport/WebEditorClient.mm: + (WebEditorClient::textFieldDidBeginEditing): + (WebEditorClient::textFieldDidEndEditing): + (WebEditorClient::textDidChangeInTextField): + (WebEditorClient::doTextFieldCommandFromEvent): + (WebEditorClient::textWillBeDeletedInTextField): + (WebEditorClient::textDidChangeInTextArea): + +2009-01-19 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add and implement GetScriptableNPObject. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCGetScriptableNPObjectReply): + Create a new reply struct and set it as the current reply. + + (WKPCEvaluate): + Get rid of an unused variable. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::Reply::): + (WebKit::NetscapePluginInstanceProxy::GetScriptableNPObjectReply::GetScriptableNPObjectReply): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::createBindingsInstance): + Call _WKPHGetScriptableNPObject and wait for a reply. + + * Plugins/Hosted/ProxyInstance.h: Added. + * Plugins/Hosted/ProxyInstance.mm: Added. + Add empty files. + + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]): + Call NetscapePluginInstanceProxy::createBindingsInstance. + + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHost.defs: + Add new declarations. + +2009-01-19 Sam Weinig <sam@webkit.org> + + Rubber-stamped by Gavin Barraclough. + + Remove temporary operator-> from JSValuePtr. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::invoke): + (WebKit::NetscapePluginInstanceProxy::hasMethod): + (WebKit::NetscapePluginInstanceProxy::marshalValue): + * WebView/WebFrame.mm: + (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): + * WebView/WebView.mm: + (aeDescFromJSValue): + +2009-01-19 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Make Evaluate an asynchronous method that has a reply method. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCEvaluate): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHost.defs: + +2009-01-19 Brady Eidson <beidson@apple.com> + + Rubberstamped by Tim Hatcher + + Fix long standing typo. + + * History/WebBackForwardList.h: + +2009-01-19 Mark Rowe <mrowe@apple.com> + + Fix the build! + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::demarshalValue): + (WebKit::NetscapePluginInstanceProxy::demarshalValues): + +2009-01-18 Mark Rowe <mrowe@apple.com> + + Reviewed by Anders Carlsson. + + Fix <https://bugs.webkit.org/show_bug.cgi?id=23414>. + Bug 23414: Reproducible crash accessing View menu with plugins disabled + + * WebView/WebFrame.mm: + (-[WebFrame _canProvideDocumentSource]): Null-check the PluginData before using it. + +2009-01-17 David Hyatt <hyatt@apple.com> + + Eliminate dependencies on "backslashAsCurrencySymbol()" from WebKit, and make sure these alterations + are done in WebCore instead. + + Reviewed by Oliver Hunt + + * WebView/WebFrame.mm: + (-[WebFrame _selectedString]): + (-[WebFrame _stringForRange:]): + +2009-01-17 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Adele Peterson + + Complete <rdar://problem/6293969> + + * WebCoreSupport/WebSystemInterface.m: + (InitWebCoreSystemInterface): Remove UseSharedMediaUI + +2009-01-15 Brady Eidson <beidson@apple.com> + + Reviewed by Dan Bernstein + + Fix problem where a URL visited as non-GET once is flagged as non-GET forever. + + * History/WebHistory.mm: + (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): Always update the HTTPNonGet + flag for all loads with an HTTP Method + +2009-01-14 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Implement InvokeDefault, Construct, GetProperty and SetProperty. + + Fully implement marshalValue. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCInvokeDefault): + (WKPCConstruct): + (WKPCGetProperty): + (WKPCSetProperty): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::evaluate): + (WebKit::NetscapePluginInstanceProxy::invoke): + (WebKit::NetscapePluginInstanceProxy::invokeDefault): + (WebKit::NetscapePluginInstanceProxy::construct): + (WebKit::NetscapePluginInstanceProxy::getProperty): + (WebKit::NetscapePluginInstanceProxy::setProperty): + (WebKit::NetscapePluginInstanceProxy::marshalValue): + (WebKit::NetscapePluginInstanceProxy::demarshalValue): + * Plugins/Hosted/WebKitPluginClient.defs: + +2009-01-14 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Demarshal arguments and pass them to the JS call. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCInvoke): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::invoke): + (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): + (WebKit::NetscapePluginInstanceProxy::demarshalValues): + +2009-01-14 Mark Rowe <mrowe@apple.com> + + Reviewed by Timothy Hatcher. + + <rdar://problem/6496520> REGRESSION: In Mail, a crash occurs when attempting to display a mail message + + Move WebArchive and WebResource to use the same approach for initializing themselves on the main thread + that WebView uses. + + * WebView/WebArchive.mm: + (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Use _webkit_performSelectorOnMainThread:withObject:. + (-[WebArchive _initWithArguments:]): + * WebView/WebResource.mm: + (-[WebResource _initWithArguments:]): Unbox the BOOL argument. + +2009-01-14 Darin Adler <darin@apple.com> + + Reviewed by Oliver Hunt. + + Fix crash I ran into while printing. I was unable to reproduce it, but also, + it's clear there's no guarantee that the frame will be non-zero in this case, + so it seems fine to check it. + + * WebView/WebHTMLView.mm: (-[WebHTMLView reapplyStyles]): Check frame for zero + and don't do anything with it if it's zero. + +2009-01-14 Dan Bernstein <mitz@apple.com> + + Reviewed by John Sullivan. + + - update copyright + + * Info.plist: + +2009-01-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Add a bunch of methods to WebKitPluginClient.defs, and implement them. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::fromUTF8WithLatin1Fallback): + If the length isn't specified, get it by calling strlen. + + (WKPCEvaluate): + Evaluate doesn't take any arguments. + + (WKPCGetIntIdentifier): + Call _NPN_GetIntIdentifier. + + (identifierFromServerIdentifier): + New helper function that returns a JSC Identifier from an NPIdentifier. + + (WKPCInvoke): + Call identifierFromServerIdentifier. + + (WKPCRemoveProperty): + (WKPCHasProperty): + (WKPCHasMethod): + Call NetscapePluginInstanceProxy. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::removeProperty): + (WebKit::NetscapePluginInstanceProxy::hasProperty): + (WebKit::NetscapePluginInstanceProxy::hasMethod): + + * Plugins/Hosted/WebKitPluginClient.defs: + Add new definitions. + +2009-01-13 Anders Carlsson <andersca@apple.com> + + Fix build. + + * WebView/WebView.mm: + (-[WebView _initWithArguments:]): + +2009-01-13 Timothy Hatcher <timothy@apple.com> + + Adds a workaround for the flip4mac installer plugin decoding a WebView from a NIB on a secondary thread. + + <rdar://problem/6489788> New WebKit thread checks break installation of flip4mac (thread violation) + + Reviewed by Darin Adler. + + * Misc/WebKitVersionChecks.h: Add WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND. + * Misc/WebNSObjectExtras.h: Add _webkit_performSelectorOnMainThread:withObject:. + * Misc/WebNSObjectExtras.mm: + (-[NSObject _webkit_performSelectorWithArguments:]): Renamed from _webkit_getPropertyWithArguments. + Passes the optional object to the selector. + (-[NSObject _webkit_performSelectorOnMainThread:withObject:]): Renamed from _webkit_getPropertyOnMainThread:. + Put the optional object into the arguments dictionary. + (-[NSObject _webkit_getPropertyOnMainThread:]): Call _webkit_performSelectorOnMainThread with a nil object. + * WebView/WebResource.mm: + (-[WebResource _ignoreWhenUnarchiving]): Use _cmd instead of making the selector again. + (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): Use the new + _webkit_performSelectorOnMainThread:withObject: method instead of performSelectorOnMainThread. + * WebView/WebView.mm: + (-[WebView _initWithArguments:]): Added. Pulls arguments out of the dictionary and calls the right init method. + (needsWebViewInitThreadWorkaround): Checks if the thead is not the main thread and if we are in the Installer bundle. + (-[WebView initWithFrame:frameName:groupName:]): Call needsWebViewInitThreadWorkaround and use _webkit_performSelectorOnMainThread + to call _initWithArguments: passing the frame, frameName and groupName. + (-[WebView initWithCoder:]): Ditto, except pass the coder to _initWithArguments:. + +2009-01-12 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Oliver Hunt. + + Deprecate JSValuePtr::getNumber() - two ways to get a number should be enough. + + * WebView/WebView.mm: + (aeDescFromJSValue): + +2009-01-12 Brady Eidson <beidson@apple.com> + + Reviewed by Darin Adler + + <rdar://problem/6468274> - Track Non-get requests in global history + + * History/WebHistory.mm: + (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): + * History/WebHistoryInternal.h: + + * History/WebHistoryItem.mm: + (-[WebHistoryItem initFromDictionaryRepresentation:]): + (-[WebHistoryItem dictionaryRepresentation]): + (-[WebHistoryItem _lastVisitWasHTTPNonGet]): + * History/WebHistoryItemPrivate.h: + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::updateGlobalHistory): Only pass the method through if it was an HTTP load + +2009-01-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Move marshalling into NetscapePluginInstanceProxy. + + Add support for marshallin strings. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCEvaluate): + (WKPCInvoke): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::evaluate): + (WebKit::NetscapePluginInstanceProxy::invoke): + (WebKit::NetscapePluginInstanceProxy::marshalValue): + * Plugins/Hosted/WebKitPluginHostTypes.h: + +2009-01-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Implement WKPCInvoke. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCEvaluate): + (WKPCInvoke): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::idForObject): + (WebKit::NetscapePluginInstanceProxy::invoke): + * Plugins/Hosted/WebKitPluginClient.defs: + +2009-01-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Move marshalling code to NetscapePluginInstanceProxy. Add support for marshalling JS objects. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCEvaluate): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::marshalValue): + * Plugins/Hosted/WebKitPluginHostTypes.h: + +2009-01-12 Julien Chaffraix <jchaffraix@pleyo.com> + + Reviewed by Darin Adler. + + Bug 22861: Turn the FontCache into a singleton + https://bugs.webkit.org/show_bug.cgi?id=22861 + + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics cachedFontDataCount]): + (+[WebCoreStatistics cachedFontDataInactiveCount]): + (+[WebCoreStatistics purgeInactiveFontData]): + Redirected all the static calls to the global FontCache + instance. + +2009-01-11 Dmitry Titov <dimich@chromium.org> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=23207 + Moved currentTime() to from WebCore to WTF. + + * WebView/WebFrame.mm: a different header file included. + +2009-01-10 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/5845089> REGRESSION (r30044): Mail custom stationery missing images + because of change to -[HTMLObjectElement data] + + * WebView/WebView.mm: + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Added a thread + violation check because I saw this being done off the main thread while testing Mail, and it + caused problems. Put all the one time initialization under a single guard to make things just + a little faster other times, and to make it clearer which things are one-time. Added a call to + the new patchMailRemoveAttributesMethod function. + (-[WebView initWithFrame:frameName:groupName:]): Added a thread violation check here too, + because I assumed it would be slightly better to have a public method name in the violation + message. This calls commonInitialization later, so it will hit that one eventually. + (objectElementDataAttribute): Added. Just returns the value of the "data" attribute. + (recursivelyRemoveMailAttributes): Added. Patch to an internal Mail method that in turn patches + a WebKit method and removes the patch again on the way out. + (patchMailRemoveAttributesMethod): Added. On Leopard only, checks the Mail version, and then + applies the patch that fixes this bug. + +2009-01-09 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + - fixed <rdar://problem/6234347> Add/change conditional key + bindings for changing paragraph- and character-level writing + direction (to match NSTextView) + + * WebView/WebHTMLView.mm: + (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Added + code to validate makeBaseWritingDirectionLeftToRight: and + makeBaseWritingDirectionRightToLeft:. + (writingDirectionKeyBindingsEnabled): Changed this function to + always return YES, except on Tiger and Leopard. + (-[WebHTMLView makeBaseWritingDirectionLeftToRight:]): Renamed + changeBaseWritingDirectionToLTR: to this. + (-[WebHTMLView makeBaseWritingDirectionRightToLeft:]): Renamed + changeBaseWritingDirectionToRTL: to this. + (-[WebHTMLView changeBaseWritingDirectionToLTR:]): Now calls + makeBaseWritingDirectionLeftToRight:. + (-[WebHTMLView changeBaseWritingDirectionToRTL:]): Now calls + makeBaseWritingDirectionRightToLeft:. + * WebView/WebView.mm: Added makeBaseWritingDirectionLeftToRight + and makeBaseWritingDirectionRightToLeft to + FOR_EACH_RESPONDER_SELECTOR. + +2009-01-08 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add and implement WKPCGetStringIdentifier. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCGetStringIdentifier): + * Plugins/Hosted/WebKitPluginClient.defs: + +2009-01-08 Stephanie Lewis <slewis@gmail.com> + + Fix Tiger build. + + * WebView/WebTextIterator.mm: + +2009-01-08 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add basic support for evaluating scripts. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::fromUTF8WithLatin1Fallback): + (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): + (WKPCReleaseObject): + (marshalValue): + (WKPCEvaluate): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::releaseObject): + (WebKit::NetscapePluginInstanceProxy::evaluate): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHostTypes.h: + +2009-01-08 David Hyatt <hyatt@apple.com> + + Fix for <rdar://problem/6465682> REGRESSION: In Mail, can't force a message to auto scroll + + Add a new ChromeClient method for handling exposure of scrolled rects. + + Reviewed by Oliver Hunt + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::scrollRectIntoView): + +2009-01-08 Darin Adler <darin@apple.com> + + Reviewed by Tim Hatcher. + + Bug 23185: add a currentRange method to the WebTextIterator SPI + https://bugs.webkit.org/show_bug.cgi?id=23185 + rdar://problem/6455834 + + I also noticed a garbage-collection-related threading issue that I fixed, and + that the SPI for getting text was unnecessarily inefficient, so I fixed that too. + + * WebView/WebTextIterator.h: Moved currentNode and currentText into a "deprecated" + category. Added currentTextPointer and currentTextLength. + + * WebView/WebTextIterator.mm: Changed m_textIterator into an OwnPtr, and also + used _textIterator to be consistent with ObjC rather than C++ naming. + (+[WebTextIteratorPrivate initialize]): Added. Calls WebCoreObjCFinalizeOnMainThread, + since the finalize method here works with main-thread only WebCore objects. + (-[WebTextIterator initWithRange:]): Changed since _textIterator is an OwnPtr now. + (-[WebTextIterator advance]): Changed name of m_textIterator. Removed null assertion, + since I don't think it provides much value. + (-[WebTextIterator atEnd]): Ditto. + (-[WebTextIterator currentRange]): Added. + (-[WebTextIterator currentTextPointer]): Added. + (-[WebTextIterator currentTextLength]): Added. + (-[WebTextIterator currentNode]): Did same as above, but also put into new category. + (-[WebTextIterator currentText]): Ditto. + +2009-01-08 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Adele Peterson. + + Simplify Mac interfaces for drawing media controller elements + + <rdar://problem/6293969> + + * WebCoreSupport/WebSystemInterface.m: + (InitWebCoreSystemInterface): Update for changes to media controller functions + +2009-01-07 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Fix build. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::idForObject): + +2009-01-07 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add a way for a plug-in to get a reference to the Window JS object. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCGetWindowNPObject): + Call the appropriate instance. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + Add object ID counter. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::destroy): + Clear the object ID map. + + (WebKit::NetscapePluginInstanceProxy::idForObject): + New method that returns a unique ID for a given JS object. + + (WebKit::NetscapePluginInstanceProxy::getWindowNPObject): + Return the object ID for the window JS object. + + * Plugins/Hosted/WebKitPluginClient.defs: + Add GetWindowNPObject. + +2009-01-07 Darin Adler <darin@apple.com> + + Reviewed by Oliver Hunt. + + Bug 23160: add setMemoryCacheClientCallsEnabled SPI so Safari can be faster with activity window closed + https://bugs.webkit.org/show_bug.cgi?id=23160 + + * WebView/WebView.mm: + (-[WebView setMemoryCacheDelegateCallsEnabled:]): Added. + (-[WebView areMemoryCacheDelegateCallsEnabled]): Added + * WebView/WebViewPrivate.h: Ditto. + +2009-01-05 Gavin Barraclough <baraclough@apple.com> + + Rubber Stamped by Oliver Hunt. + + Replace all uses of JSValue* with new wrapper class, JSValuePtr. + See JavaScriptCore/ChangeLog for more detailed description. + + * WebView/WebFrame.mm: + (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame _convertValueToObjcValue:]): + (-[WebScriptCallFrame exception]): + (-[WebScriptCallFrame evaluateWebScript:]): + * WebView/WebView.mm: + (aeDescFromJSValue): + (-[WebView aeDescByEvaluatingJavaScriptFromString:]): + +2009-01-06 Pierre-Olivier Latour <pol@apple.com> + + Reviewed by Darin Adler. + + Exposed through WebFrame private interface the new WebCore API AnimationController::numberOfActiveAnimations() to be used by DRT. + + https://bugs.webkit.org/show_bug.cgi?id=23126 + + * WebView/WebFrame.mm: + (-[WebFrame _numberOfActiveAnimations]): + * WebView/WebFramePrivate.h: + +2009-01-05 David Kilzer <ddkilzer@apple.com> + + Add SPI to enable, disable and check state of WebIconDatabase + + Reviewed by Darin Adler & Timothy Hatcher. + + Add -[WebIconDatabase isEnabled] and -[WebIconDatabase setEnabled:] + SPI to make it possible to enable, disable and check the state of + the icon database. + + * Misc/WebIconDatabase.mm: + (-[WebIconDatabase init]): Extracted code into -_startUpIconDatabase. + (-[WebIconDatabase iconForURL:withSize:cache:]): Switched to use + -isEnabled instead of -_isEnabled. + (-[WebIconDatabase iconURLForURL:]): Ditto. + (-[WebIconDatabase retainIconForURL:]): Ditto. + (-[WebIconDatabase releaseIconForURL:]): Ditto. + (-[WebIconDatabase isEnabled]): Renamed from -_isEnabled in + WebInternal category. + (-[WebIconDatabase setEnabled:]): Added. Takes care of changing + the enabled/disabled state of the icon database. + (-[WebIconDatabase removeAllIcons]): Switched to use -isEnabled + instead of -_isEnabled. + (-[WebIconDatabase _startUpIconDatabase]): Added. Extrated from + -init. + (-[WebIconDatabase _shutDownIconDatabase]): Added. Remove + observers when the icon database is disabled. + * Misc/WebIconDatabaseInternal.h: Added declarations for + -_startUpIconDatabase and -_shutDownIconDatabase. + * Misc/WebIconDatabasePrivate.h: Added declarations for + -isEnabled and -setEnabled:. + +2009-01-05 Brady Eidson <beidson@apple.com> + + Reviewed by Jon Honeycutt + + Expose setting the last-visit-was-failure flag on a history items in preparation for <rdar://problem/6173319> + + * History/WebHistoryItem.mm: + (-[WebHistoryItem _setLastVisitWasFailure:]): + * History/WebHistoryItemPrivate.h: + +2009-01-05 Adam Treat <adam.treat@torchmobile.com> + + Another blind mac build fix + + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::contentsSizeChanged): + +2009-01-05 Adam Treat <adam.treat@torchmobile.com> + + Blind mac build fix + + * WebCoreSupport/WebChromeClient.mm: + +2009-01-05 Adam Treat <adam.treat@torchmobile.com> + + Fix mac build + + * WebCoreSupport/WebChromeClient.h: + +2009-01-05 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by George Staikos. + + Build fix for contentsSizeChanged + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::contentsSizeChanged): + +2009-01-02 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears + inside its web view when resizing its window + https://bugs.webkit.org/show_bug.cgi?id=23072 + rdar://problem/6368028 + + The first attempt at fixing this did not work. + This time I was able to reproduce the bug and test the fix. + + * WebCoreSupport/WebFrameLoaderClient.mm: + (applyAppleDictionaryApplicationQuirkNonInlinePart): Changed the arguments and + function names around a bit to make even less code at the call site. + (applyAppleDictionaryApplicationQuirk): Put the check for whether this is the + Dictionary application in here. + (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): Put a call to + applyAppleDictionaryApplicationQuirk here. This was a case I had missed before, + when the script is cached. This fixes one of the two problems with the initial + patch; the other fix is in WebCore. + (WebFrameLoaderClient::dispatchWillSendRequest): Changed the + applyAppleDictionaryApplicationQuirk call here to work the new simpler way. + + * WebView/WebView.mm: Had to add an include due to changes in WebCore header includes. + +2009-01-02 Cameron Zwarich <cwzwarich@uwaterloo.ca> + + Reviewed by Darin Adler. + + Bug 23060: REGRESSION (r38629): Cannot scroll a WebHTMLView using Home/End/Page up/Page down + <https://bugs.webkit.org/show_bug.cgi?id=23060> + <rdar://problem/6467830> + + After r38629, all keyboard events get sent by Editor to the EditorClient, even + if the selection is not editable. If the event's command is unsupported by + WebHTMLView, WebHTMLView mistakenly thinks that the event was handled when it + was not. When using the page up / page down keys, the events generated are of + the form scrollPageUp rather than movePageUp, so they are unsupported by + WebHTMLView and cause this bug to occur. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView doCommandBySelector:]): + +2009-01-02 Darin Adler <darin@apple.com> + + Reviewed by Oliver Hunt. + + Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears inside its web view when resizing its window + https://bugs.webkit.org/show_bug.cgi?id=23072 + rdar://problem/6368028 + + * WebCoreSupport/WebFrameLoaderClient.mm: + (isAppleDictionaryApplication): Added. + (applyAppleDictionaryApplicationQuirk): Added. Under the right conditions, sets + a flag to ask HTMLFrameElementBase to ignore the scrolling attribute. + (WebFrameLoaderClient::dispatchWillSendRequest): Call the two functions above to + apply the quirk when the relevant script is loaded. + +2008-12-26 Dan Bernstein <mitz@apple.com> + + Reviewed by Sam Weinig. + + - fix <rdar://problem/6467608> lastVisitWasFailure flag persists in + global history after a successful visit + + * History/WebHistory.mm: + (-[WebHistory _visitedURL:withTitle:wasFailure:]): Changed to always + update the wasFailure flag on the HistoryItem. + +2008-12-23 Darin Adler <darin@apple.com> + + Reviewed by Alexey Proskuryakov (a slightly earlier version). + + - fix https://bugs.webkit.org/show_bug.cgi?id=22976 + crash due to Mail's use of WebArchive and WebResource on non-main thread + + * Misc/WebKitLogging.h: Improved comments for ASSERT_MAIN_THREAD. Got rid of + WebKitRunningOnMainThread function, which was just a cover for pthread_main_np. + * Misc/WebKitLogging.m: Ditto. + + * Misc/WebKitVersionChecks.h: Added a version after which we won't do the + main thread workaround. + + * Misc/WebNSObjectExtras.h: Added a new method, _webkit_getPropertyOnMainThread:, + which performs a selector on the main thread, waits for it to complete, and then + returns the value on the caller thread. + * Misc/WebNSObjectExtras.mm: Added. + + * WebView/WebArchive.mm: + (-[WebArchive init]): Added WebCoreThreadViolationCheck. + (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Perform + initialization on main thread if needMailThreadWorkaround is true. + Also added WebCoreThreadViolationCheck. + (-[WebArchive initWithData:]): Added WebCoreThreadViolationCheck. + (-[WebArchive mainResource]): Get property on main thread if + needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. + (-[WebArchive subresources]): Ditto. + (-[WebArchive subframeArchives]): Ditto. + (-[WebArchive data]): Ditto. + (-[WebArchive _initWithCoreLegacyWebArchive:]): Added WebCoreThreadViolationCheck. + (-[WebArchive _coreLegacyWebArchive]): Ditto. + (-[WebArchive _initWithArguments:]): Added. Used to implement the cross-thread + version of initWithMainResource above. + + * WebView/WebResource.mm: + (-[WebResource initWithCoder:]): Added WebCoreThreadViolationCheck. + (-[WebResource data]): Get property on main thread if + needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. + (-[WebResource URL]): Ditto. + (-[WebResource MIMEType]): Ditto. + (-[WebResource textEncodingName]): Ditto. + (-[WebResource frameName]): Ditto. + (-[WebResource _ignoreWhenUnarchiving]): Ditto. + (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): + Perform initialization on main thread if needMailThreadWorkaround is true. + Also added WebCoreThreadViolationCheck. + (-[WebResource _suggestedFilename]): Added. Helper for _fileWrapperRepresentation. + (-[WebResource _fileWrapperRepresentation]): Rewrote to use methods instead of + getting at coreResource directly. + (-[WebResource _response]): Get property on main thread if + needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. + (-[WebResource _stringValue]): Ditto. + (+[WebResource _needMailThreadWorkaroundIfCalledOffMainThread]): Added. + (-[WebResource _initWithArguments:]): Added. Used to implement the cross-thread + version of _initWithData above. + + * WebView/WebResourceInternal.h: Changed to include WebResourcePrivate.h since internal + clients have access to the SPI as well as the API. Added definition of MAIL_THREAD_WORKAROUND + and the needMainThreadWorkaround helper function. + + * Misc/WebIconDatabase.mm: Removed include of now-defunct FoundationExtras.h + file. This probably fixes clean builds. + * WebCoreSupport/WebIconDatabaseClient.mm: Ditto. + + * WebCoreSupport/WebFrameLoaderClient.mm: Removed include of WebResourcePrivate.h, + since it's not actually used. + * WebView/WebDataSource.mm: Ditto. + * WebView/WebHTMLRepresentation.mm: Ditto. + +2008-12-23 Darin Adler <darin@apple.com> + + Reviewed by Dan Bernstein. + + - fix https://bugs.webkit.org/show_bug.cgi?id=22979 + crash seen in -[WebView drawsBackground] when quitting + <rdar://problem/6464601> + + * WebView/WebView.mm: + (-[WebView drawsBackground]): Added comment and a null check for _private. + +2008-12-22 Kevin Decker <kdecker@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/6449588> REGRESSION (r38279-r38280): Minimize them remaximize a window with a flash plugin, plugin doesn't resume at full speed + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): Deminiaturizing should restart timers, not stop timers. + +2008-12-19 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Darin Adler, Adele Peterson, Brady Eidson. + + Added SPI for getting an unsorted vector of all items in history. + + * History/WebHistory.h: + * History/WebHistory.mm: + (-[WebHistory allItems]): + +2008-12-18 Dan Bernstein <mitz@apple.com> + + Reviewed by Sam Weinig. + + - implement FrameLoaderClient::shouldUseCredentialStorage() by calling + a new resource load delegae method. + + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::shouldUseCredentialStorage): Added. Calls the + delegate method. If the method is unimplemented, returns true for + backwards compatibility. + * WebView/WebView.mm: + (-[WebView _cacheResourceLoadDelegateImplementations]): Initialize the + shouldUseCredentialStorageFunc member. + (CallResourceLoadDelegateReturningBoolean): Added. + * WebView/WebViewInternal.h: + * WebView/WebResourceLoadDelegatePrivate.h: Declared the delegate method + -webView:resource:shouldUseCredentialStorageForDataSource:. + +2008-12-18 Cameron Zwarich <zwarich@apple.com> + + Reviewed by Jonathan Honeycutt. + + Fix an apparent typo in r39385 that is causing lots of crashes. + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout): + +2008-12-18 Brady Eidson <beidson@apple.com> + + Reviewed by John Sullivan + + Initial visit to a website creates history items that start with a visit count of + zero instead of one + + * History/WebHistory.mm: + (-[WebHistoryPrivate visitedURL:withTitle:]): Set the visit count on new items + + * History/WebHistoryItem.mm: + (-[WebHistoryItem _setVisitCount:]): Call through to the WebCore item + * History/WebHistoryItemInternal.h: + +2008-12-18 Sam Weinig <sam@webkit.org> + + Reviewed by John Sullivan. + + Implement FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() by calling + a new private frame load delegate method. + + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout): + * WebView/WebView.mm: + (-[WebView _cacheFrameLoadDelegateImplementations]): + * WebView/WebViewInternal.h: + * WebView/WebViewPrivate.h: + +2008-12-16 Antti Koivisto <antti@apple.com> + + Reviewed by John Sullivan. + + Add version check for shift-reload behavior. + + * Misc/WebKitVersionChecks.h: + * WebView/WebFrame.mm: + (-[WebFrame reload]): + +2008-12-16 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Start sending keyboard events to the plug-in host. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::keyEvent): + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView keyDown:]): + (-[WebHostedNetscapePluginView keyUp:]): + * Plugins/Hosted/WebKitPluginHost.defs: + +2008-12-16 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + <rdar://problem/6450538> + + Fix flag enumeration. + + * Plugins/Hosted/WebKitPluginHostTypes.h: + +2008-12-16 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Instead of passing a gazillion booleans to WKPCLoadURL, pass a single set of flags. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCLoadURL): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::loadURL): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHostTypes.h: + +2008-12-16 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Add trailing null to headers to avoid a crash in the plug-in host. + + * Plugins/Hosted/HostedNetscapePluginStream.mm: + (WebKit::HostedNetscapePluginStream::didReceiveResponse): + +2008-12-15 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Cameron Zwarich. + + <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard. + + * Configurations/Base.xcconfig: + * Configurations/DebugRelease.xcconfig: + +2008-12-15 Stephanie Lewis <slewis@apple.com> + + Fix build. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + +2008-12-15 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Change InstantiatePlugin to be asynchronous so we won't deadlock if the plug-in tries to call + back into us while it's being instantiated. + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::instantiatePlugin): + * Plugins/Hosted/NetscapePluginHostProxy.h: + (WebKit::NetscapePluginHostProxy::clientPort): + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCInstantiatePluginReply): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::Reply::): + (WebKit::NetscapePluginInstanceProxy::Reply::Reply): + (WebKit::NetscapePluginInstanceProxy::Reply::~Reply): + (WebKit::NetscapePluginInstanceProxy::InstantiatePluginReply::InstantiatePluginReply): + (WebKit::NetscapePluginInstanceProxy::setCurrentReply): + (WebKit::NetscapePluginInstanceProxy::waitForReply): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHost.defs: + +2008-12-15 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Let WebKit generate a plug-in ID instead of having the plug-in host do it. + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::instantiatePlugin): + Create the plug-in proxy before instantiating the plug-in. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::create): + (WebKit::NetscapePluginInstanceProxy::setRenderContextID): + (WebKit::NetscapePluginInstanceProxy::setUseSoftwareRenderer): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + * Plugins/Hosted/WebKitPluginHost.defs: + +2008-12-15 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + LoadURL doesn't need to be asynchronous. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCLoadURL): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHost.defs: + +2008-12-15 Antti Koivisto <antti@apple.com> + + Reviewed by Darin Adler. + + - Add [WebFrame reloadFromOrigin] for performing end-to-end reload. + - Add corresponding IBAction to WebView. + - Temporarily make [WebFrame reload] trigger end-to-end reload if shift modifier is pressed when it is called. + + * WebView/WebFrame.h: + * WebView/WebFrame.mm: + (-[WebFrame reload]): + (-[WebFrame reloadFromOrigin]): + * WebView/WebFramePrivate.h: Match the FrameLoadType enum in WebCore. + * WebView/WebView.h: + * WebView/WebView.mm: + (-[WebView reloadFromOrigin:]): + +2008-12-14 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + - fix <rdar://problem/3258561> WebHistoryAllItemsRemovedNotification + should add items to userInfo + + * History/WebHistory.mm: + (-[WebHistoryPrivate allItems]): Added this helper method, which returns + all values in the _entriesByURL dictionary. + (-[WebHistory removeAllItems]): Changed to send the array of all items + in the notification. + +2008-12-13 Darin Adler <darin@apple.com> + + - <rdar://problem/6441035> WebTextIterator class not exported in WebKit + + * WebKit.exp: Added the class. We forgot to export it when we added + the WebTextIterator SPI. + +2008-12-12 Darin Adler <darin@apple.com> + + Rubber stamped by Adam Roben. + + - fix <rdar://problem/5648301> Can't tab around to text fields in Safari + login sheet after clicking static text, due to AppKit key loop change + + * Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib: Removed. + * Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib: Added. + * Panels/English.lproj/WebAuthenticationPanel.nib/info.nib: Removed. + * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib: + Set nextKeyView of the selectable static texts to the editable text. + Updated nib format. + +2008-12-12 Stephanie Lewis <slewis@apple.com> + + Reviewed by Geoff Garen. + + Shrink Cache Sizes. + + * WebView/WebView.mm: + (+[WebView _setCacheModel:]): + +2008-12-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Tim Hatcher. + + Don't try to free the dummy "1" port state. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView sendEvent:isDrawRect:]): + (-[WebNetscapePluginView updateAndSetWindow]): + +2008-12-11 Cameron Zwarich <zwarich@apple.com> + + Rubber-stamped by Mark Rowe. + + Roll out r39212 due to assertion failures during layout tests, multiple + layout test failures, memory leaks, and obvious incorrectness. + + * WebView/WebPreferenceKeysPrivate.h: + * WebView/WebPreferences.mm: + (-[WebPreferences fullDocumentTeardownEnabled]): + * WebView/WebPreferencesPrivate.h: + +2008-12-11 Stephanie Lewis <slewis@apple.com> + + Fix build. + + * WebView/WebView.mm: + +2008-12-11 Stephanie Lewis <slewis@apple.com> + + Reviewed by Oliver Hunt. + + Empty Web cache before quitting a debug build in order + to report accurate CachedResource leaks. + + * WebView/WebView.mm: + (-[WebView _close]): + +2008-12-11 Anders Carlsson <andersca@apple.com> + + Fix Tiger build. + + * Misc/WebNSDataExtras.h: + +2008-12-11 Anders Carlsson <andersca@apple.com> + + Reviewed by Cameron Zwarich. + + https://bugs.webkit.org/show_bug.cgi?id=22797 + REGRESSION: Crash at http://news.cnet.com/8301-17939_109-10119149-2.html + + Make sure to protect the stream because destroyStream can otherwise cause it to be deleted. + + * Plugins/WebBaseNetscapePluginStream.mm: + (WebNetscapePluginStream::destroyStreamWithReason): + +2008-12-10 Glenn Wilson <gwilson@google.com> + + Reviewed by Adam Roben. + + Added new methods for overriding default WebPreference values + and for resetting preferences to their defaults. + https://bugs.webkit.org/show_bug.cgi?id=20534 + + * WebView/WebPreferenceKeysPrivate.h: + * WebView/WebPreferences.mm: + (-[WebPreferences resetToDefaults]): new method + (-[WebPreferences overridePreference:flag:]): new method + * WebView/WebPreferencesPrivate.h: new method signatures + +2008-12-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Implement support for NPN_PostURL/NPN_PostURLNotify in WebKit. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + Add stopAllStreams. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::stopAllStreams): + Factored out this from ::destroy. + + (WebKit::NetscapePluginInstanceProxy::destroy): + Call stopAllStreams(). + + (WebKit::NetscapePluginInstanceProxy::pluginHostDied): + Ditto. + + (WebKit::NetscapePluginInstanceProxy::loadURL): + Handle post being true. This code has been copied from WebNetscapePluginView.mm (for now). + +2008-12-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Move two NSData category methods to WebNSDataExtras.m. + + * Misc/WebNSDataExtras.h: + * Misc/WebNSDataExtras.m: + (-[NSData _web_startsWithBlankLine]): + (-[NSData _web_locationAfterFirstBlankLine]): + * Plugins/WebNetscapePluginView.mm: + +2008-12-10 Alice Liu <alice.liu@apple.com> + + fixed https://bugs.webkit.org/show_bug.cgi?id=20685 + + Reviewed by Darin Adler. + + * Misc/WebNSPasteboardExtras.mm: + Ask image for its file extension instead of falling back on MIME type and file path. + Also moved this code to before setting the pasteboard data so as not to set any if + no extension can be determined. + (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): + + * WebView/WebHTMLView.mm: + Fixed a separate but related long-standing bug of how the filename for the promised + drag data is determined by asking the image for a proper file extension. + (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): + +2008-12-09 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Fix typecast. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): + +2008-12-09 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Implement software rendering of hosted plug-ins. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCInvalidateRect): + New MiG function. This is called by the plug-in host when it has drawn something. + + * Plugins/Hosted/WebHostedNetscapePluginView.h: + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView createPlugin]): + Create a software renderer. + + (-[WebHostedNetscapePluginView destroyPlugin]): + Destroy the software renderer. + + (-[WebHostedNetscapePluginView drawRect:]): + Draw using the software renderer. + + * Plugins/Hosted/WebKitPluginClient.defs: + Add InvalidateRect. + +2008-12-09 Brett Wilson <brettw@chromium.org> + + Reviewed by Dave Hyatt. + + https://bugs.webkit.org/show_bug.cgi?id=22177 + + Add a callback on ChromeClient that the state of form elements on + the page has changed. This is to allow clients implementing session + saving to know when the current state is dirty. + + * WebCoreSupport/WebChromeClient.h: + (WebChromeClient::formStateDidChange): + +2008-12-09 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Make sure to pause null events for hosted plug-ins as well. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): + +2008-12-09 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + * Plugins/Hosted/NetscapePluginHostProxy.h: + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): + Unfortunately we can't use a libdispatch source right now, because of <rdar://problem/6393180>. + +2008-12-09 Timothy Hatcher <timothy@apple.com> + + Implement a few methods needed to keep Dictionary.app working on Leopard. + + <rdar://problem/6002160> Internal changes to WebKit in Safari 4 + Developer Preview might break Dictionary + + Reviewed by Dan Bernstein. + + * WebView/WebFrame.mm: + (-[WebFrame convertNSRangeToDOMRange:]): Added. Calls _convertNSRangeToDOMRange. + (-[WebFrame convertDOMRangeToNSRange:]): Added. Calls _convertDOMRangeToNSRange. + * WebView/WebHTMLView.mm: + (-[WebHTMLView _bridge]): Added. Returns the WebFrame, which has the methods + that Dictionary.app is using. + +2008-12-08 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + More work towards getting NPN_GetURL working. + + * Plugins/Hosted/HostedNetscapePluginStream.h: + Inherit from NetscapePlugInStreamLoaderClient. + + (WebKit::HostedNetscapePluginStream::streamID): + * Plugins/Hosted/HostedNetscapePluginStream.mm: + (WebKit::HostedNetscapePluginStream::startStream): + Keep track of the resposne URL and the MIME type. Pass the response URL to the + plug-in host. + + (WebKit::HostedNetscapePluginStream::didFinishLoading): + Disconnect the stream. + + (WebKit::HostedNetscapePluginStream::start): + Create a plug-in stream loader and start loading. + + (WebKit::HostedNetscapePluginStream::stop): + Cancel the load. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCLoadURL): + Fix the parameter order. + + (WKPCCancelLoadURL): + New function that cancels a load of a stream with a given reason. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::destroy): + Stop the streams. + + (WebKit::NetscapePluginInstanceProxy::pluginStream): + Return a plug-in stream given a stream ID. + + (WebKit::NetscapePluginInstanceProxy::disconnectStream): + Remove the stream from the streams map. + + (WebKit::NetscapePluginInstanceProxy::loadRequest): + Create a stream and load it. + + * Plugins/Hosted/WebKitPluginClient.defs: + Add CancelLoadURL. + + * Plugins/Hosted/WebKitPluginHost.defs: + Add responseURL to StartStream. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView pluginPackage]): + Move this down to the base class from WebNetscapePluginView. + + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + +2008-12-08 Dan Bernstein <mitz@apple.com> + + Reviewed by John Sullivan. + + - WebKit/mac part of tracking the global history item for a WebView + + * WebView/WebView.mm: + (-[WebView _globalHistoryItem]): Added. Returns the page's global + history item. + * WebView/WebViewPrivate.h: + +2008-12-06 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dave Hyatt + + https://bugs.webkit.org/show_bug.cgi?id=15671 + + VisiblePosition::caretRect() was renaemd to absoluteCaretBounds(). + + * WebView/WebFrame.mm: + (-[WebFrame _caretRectAtNode:offset:affinity:]): + +2008-12-06 David Kilzer <ddkilzer@apple.com> + + Bug 22666: Clean up data structures used when collecting URLs of subresources for webarchives + + <https://bugs.webkit.org/show_bug.cgi?id=22666> + + Reviewed by Darin Adler. + + * DOM/WebDOMOperations.mm: + (-[DOMNode _subresourceURLs]): Changed from using Vector<KURL> to + ListHashSet<KURL> when calling WebCore::Node::getSubresourceURLs(). + +2008-12-05 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Darin Adler. + + <rdar://problem/6405599> Tiger Mail crashes when using "Mail Contents of This Page" + in Safari before opening a mail message in Mail + + * Carbon/CarbonWindowAdapter.m: Removed. + * Carbon/CarbonWindowAdapter.mm: Copied from WebKit/mac/Carbon/CarbonWindowAdapter.m. + (+[CarbonWindowAdapter initialize]): + * History/WebBackForwardList.mm: + (+[WebBackForwardList initialize]): + * History/WebHistoryItem.mm: + (+[WebHistoryItem initialize]): + * Misc/WebElementDictionary.mm: + (+[WebElementDictionary initialize]): + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (+[WebHostedNetscapePluginView initialize]): + * Plugins/WebBaseNetscapePluginView.mm: + * Plugins/WebBasePluginPackage.m: Removed. + * Plugins/WebBasePluginPackage.mm: Copied from WebKit/mac/Plugins/WebBasePluginPackage.m. + (+[WebBasePluginPackage initialize]): + * Plugins/WebNetscapePluginView.mm: + (+[WebNetscapePluginView initialize]): + * WebCoreSupport/WebEditorClient.mm: + (+[WebEditCommand initialize]): + * WebCoreSupport/WebFrameLoaderClient.mm: + * WebView/WebArchive.mm: + (+[WebArchivePrivate initialize]): + * WebView/WebDataSource.mm: + (+[WebDataSourcePrivate initialize]): + * WebView/WebHTMLView.mm: + (+[WebHTMLViewPrivate initialize]): + (+[WebHTMLView initialize]): + * WebView/WebResource.mm: + (+[WebResourcePrivate initialize]): + * WebView/WebView.mm: + (+[WebViewPrivate initialize]): + Call JSC::initializeThreading(); + +2008-12-04 Stephanie Lewis <slewis@apple.com> + + Fix build. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCLoadURL): + +2008-12-04 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + More work on streams. + + * Plugins/Hosted/HostedNetscapePluginStream.h: Added. + (WebKit::HostedNetscapePluginStream::create): + * Plugins/Hosted/HostedNetscapePluginStream.mm: Added. + (WebKit::HostedNetscapePluginStream::HostedNetscapePluginStream): + (WebKit::HostedNetscapePluginStream::startStreamWithResponse): + (WebKit::HostedNetscapePluginStream::startStream): + (WebKit::HostedNetscapePluginStream::didReceiveData): + (WebKit::HostedNetscapePluginStream::didFinishLoading): + (WebKit::HostedNetscapePluginStream::didReceiveResponse): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::pluginView): + (WebKit::NetscapePluginInstanceProxy::hostProxy): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::PluginRequest::PluginRequest): + (WebKit::NetscapePluginInstanceProxy::PluginRequest::requestID): + (WebKit::NetscapePluginInstanceProxy::PluginRequest::request): + (WebKit::NetscapePluginInstanceProxy::PluginRequest::frameName): + (WebKit::NetscapePluginInstanceProxy::PluginRequest::didStartFromUserGesture): + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + (WebKit::NetscapePluginInstanceProxy::performRequest): + (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript): + (WebKit::NetscapePluginInstanceProxy::requestTimerFired): + (WebKit::NetscapePluginInstanceProxy::loadRequest): + * Plugins/Hosted/WebKitPluginHost.defs: + +2008-12-04 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Start implementing WKPCLoadURL. Currently this has copied a lot of code from WebNetscapePluginView + but once we have a more complete implementation of NPStreams we can start refactoring things so that the + implementations can share more code. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WKPCLoadURL): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + (WebKit::NetscapePluginInstanceProxy::loadURL): + (WebKit::NetscapePluginInstanceProxy::performRequest): + (WebKit::NetscapePluginInstanceProxy::requestTimerFired): + (WebKit::NetscapePluginInstanceProxy::loadRequest): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/Hosted/WebKitPluginHost.defs: + +2008-12-04 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Move requestWithURLCString to WebBaseNetscapePluginView. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView requestWithURLCString:]): + * Plugins/WebNetscapePluginView.mm: + +2008-12-03 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Move WebPluginRequest to its own file. + + * Plugins/WebNetscapePluginView.mm: + * Plugins/WebPluginRequest.h: Added. + * Plugins/WebPluginRequest.m: Added. + (-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]): + (-[WebPluginRequest dealloc]): + (-[WebPluginRequest request]): + (-[WebPluginRequest frameName]): + (-[WebPluginRequest isCurrentEventUserGesture]): + (-[WebPluginRequest sendNotification]): + (-[WebPluginRequest notifyData]): + +2008-12-03 Anders Carlsson <andersca@apple.com> + + Handle the CA model. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView setWindowIfNecessary]): + +2008-12-03 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + <rdar://problem/6412293> + Call NPP_SetWindow for CA plug-ins. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): + (-[WebNetscapePluginView restorePortState:]): + (-[WebNetscapePluginView isNewWindowEqualToOldWindow]): + (-[WebNetscapePluginView updateAndSetWindow]): + (-[WebNetscapePluginView setWindowIfNecessary]): + +2008-12-03 Anders Carlsson <andersca@apple.com> + + Fix the release build. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::deadNameNotificationCallback): + +2008-12-03 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + <rdar://problem/6412234> + Don't crash if we can't launch the plug-in host. + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::instantiatePlugin): + +2008-12-02 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Start processing messages sent to the client port. + + * Plugins/Hosted/NetscapePluginHostProxy.h: + * Plugins/Hosted/NetscapePluginHostProxy.mm: + Add a map from ports to plug-in proxies. Turn the set of instances into a map from + pluginID to instance proxy. + + (WKPCStatusText): + Look up the right instance proxy and call status(). + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::pluginID): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::status): + Implement this. + + * Plugins/Hosted/WebKitPluginClient.defs: + Add the plug-in ID to StatusText. + +2008-12-02 Gregory Hughes <ghughes@apple.com> + + Reviewed by Beth Dakin. + + Bug 22513: ZOOM: text selection does not send correct zoom bounds + + When zoomed, text selection must send the zoom bounds in flipped + screen coordinates. + + * WebCoreSupport/WebViewFactory.mm: + (-[WebViewFactory accessibilityConvertScreenRect:]): + +2008-12-02 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Create a client mach port and pass it to the plug-in host. + + * Plugins/Hosted/NetscapePluginHostManager.h: + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::hostForPackage): + (WebKit::NetscapePluginHostManager::spawnPluginHost): + * Plugins/Hosted/NetscapePluginHostProxy.h: + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + * Plugins/Hosted/WebKitPluginHost.defs: + +2008-12-02 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Let the plug-in views know if the plug-in host crashes. + + * Plugins/Hosted/NetscapePluginHostManager.h: + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::instantiatePlugin): + * Plugins/Hosted/NetscapePluginHostProxy.h: + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::pluginHostDied): + (WebKit::NetscapePluginHostProxy::addPluginInstance): + (WebKit::NetscapePluginHostProxy::removePluginInstance): + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::create): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + Keep a pointer to the host proxy. + + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + Add the instance to the host set. + + (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy): + Remove the instance form the host set. + + (WebKit::NetscapePluginInstanceProxy::pluginHostDied): + Tell the plug-in view that the plug-in died. + + * Plugins/Hosted/WebHostedNetscapePluginView.h: + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView createPlugin]): + Pass the plug-in view to the instantiatePlugin. + + (-[WebHostedNetscapePluginView pluginHostDied]): + Handle the plug-in host crashing. + + (-[WebHostedNetscapePluginView drawRect:]): + Fill the plug-in view with a nice red shade if the plug-in crashes. + +2008-12-01 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Recover if the plug-in host dies and we try to instantiate another plugin before we get the port death notification + + * Plugins/Hosted/NetscapePluginHostManager.h: + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::pluginHostDied): + Remove the plug-in host from the map. + + (WebKit::NetscapePluginHostManager::instantiatePlugin): + NetscapePluginHostProxy is no longer refcounted. + + * Plugins/Hosted/NetscapePluginHostProxy.h: + This is no longer refcounted. Add a set of plug-in instances (unused for now). + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + Create a death notification port. + + (WebKit::NetscapePluginHostProxy::pluginHostDied): + Tell the manager that we're gone and delete ourselves. + + (WebKit::NetscapePluginHostProxy::deathPortCallback): + New CFMachPort callback. + +2008-12-01 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Move instantiatePlugin to NetscapePluginHostManager. + + * Plugins/Hosted/NetscapePluginHostManager.h: + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::instantiatePlugin): + * Plugins/Hosted/NetscapePluginHostProxy.h: + * Plugins/Hosted/NetscapePluginHostProxy.mm: + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView createPlugin]): + +2008-12-01 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Pass the plug-in host port directly to the instance proxy. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::instantiatePlugin): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::create): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + (WebKit::NetscapePluginInstanceProxy::resize): + (WebKit::NetscapePluginInstanceProxy::destroy): + (WebKit::NetscapePluginInstanceProxy::focusChanged): + (WebKit::NetscapePluginInstanceProxy::windowFocusChanged): + (WebKit::NetscapePluginInstanceProxy::windowFrameChanged): + (WebKit::NetscapePluginInstanceProxy::startTimers): + (WebKit::NetscapePluginInstanceProxy::mouseEvent): + (WebKit::NetscapePluginInstanceProxy::stopTimers): + +2008-12-01 Anders Carlsson <andersca@apple.com> + + Try to fix the Tiger build. + + * Plugins/WebNetscapePluginView.mm: + +2008-12-01 Anders Carlsson <andersca@apple.com> + + Rename _layer to _pluginLayer where I forgot to do so. + + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView destroyPlugin]): + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView createPlugin]): + (-[WebNetscapePluginView setLayer:]): + (-[WebNetscapePluginView destroyPlugin]): + +2008-12-01 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam Roben. + + Make sure to re-insert layers as needed so they won't be lost when the layer backed + view is removed from the view hierarchy. + + * Plugins/Hosted/WebHostedNetscapePluginView.h: + Add _pluginLayer ivar. + + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView createPlugin]): + Don't add the layer here. + + (-[WebHostedNetscapePluginView setLayer:]): + Instead, add it here. + + (-[WebHostedNetscapePluginView destroyPlugin]): + Set _pluginLayer to 0. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView createPlugin]): + Don't add the layer here. + + (-[WebNetscapePluginView setLayer:]): + Do it here. + +2008-11-30 Antti Koivisto <antti@apple.com> + + Reviewed by Mark Rowe. + + https://bugs.webkit.org/show_bug.cgi?id=22557 + + Report free size in central and thread caches too. + + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics memoryStatistics]): + +2008-11-29 Antti Koivisto <antti@apple.com> + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=22557 + Add statistics for JavaScript GC heap. + + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics javaScriptObjectsCount]): + (+[WebCoreStatistics memoryStatistics]): + +2008-11-29 Antti Koivisto <antti@apple.com> + + Reviewed by Alexey Proskuryakov. + + https://bugs.webkit.org/show_bug.cgi?id=22557 + + - Add purgeable memory statistics to cache statistics. + - Add method for getting fastMalloc statistics. + - Add method to force returning free memory back to system. + + * Misc/WebCache.mm: + (+[WebCache statistics]): + * Misc/WebCoreStatistics.h: + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics stopIgnoringWebCoreNodeLeaks]): + (+[WebCoreStatistics memoryStatistics]): + (+[WebCoreStatistics returnFreeMemoryToSystem]): + +2008-11-26 Mark Rowe <mrowe@apple.com> + + Fix the Tiger build. + + mig.h does not always define __MigTypeCheck on Tiger, which leads to problems when the generated + code is built with -Wundef. + + * Plugins/Hosted/WebKitPluginHostTypes.h: + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Fix build. + + * Configurations/Base.xcconfig: + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Mark Rowe. + + Move WebHostedNetscapePluginView.{h|mm} to Plugins/Hosted. + + (-[WebHostedNetscapePluginView handleMouseMoved:]): + (-[WebHostedNetscapePluginView setAttributeKeys:andValues:]): + Fix a leak. + + (-[WebHostedNetscapePluginView createPlugin]): + Instantiate the plug-in, store the plug-in proxy in the _proxy ivar. + + (-[WebHostedNetscapePluginView loadStream]): + (-[WebHostedNetscapePluginView shouldStop]): + Add stubs for these. + + (-[WebHostedNetscapePluginView updateAndSetWindow]): + (-[WebHostedNetscapePluginView windowFocusChanged:]): + (-[WebHostedNetscapePluginView destroyPlugin]): + (-[WebHostedNetscapePluginView startTimers]): + (-[WebHostedNetscapePluginView stopTimers]): + (-[WebHostedNetscapePluginView focusChanged]): + (-[WebHostedNetscapePluginView windowFrameDidChange:]): + (-[WebHostedNetscapePluginView mouseDown:]): + (-[WebHostedNetscapePluginView mouseUp:]): + (-[WebHostedNetscapePluginView mouseDragged:]): + (-[WebHostedNetscapePluginView mouseEntered:]): + (-[WebHostedNetscapePluginView mouseExited:]): + Call the proxy. + + (-[WebHostedNetscapePluginView addWindowObservers]): + (-[WebHostedNetscapePluginView removeWindowObservers]): + Add/remove observers for when the window frame changes. + + * Plugins/WebHostedNetscapePluginView.h: Removed. + * Plugins/WebHostedNetscapePluginView.mm: Removed. + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Mark Rowe. + + Add the plug-in host proxy and plug-in instance proxy objects. + + These are just simple objects that forward their calls to the plug-in host. + + * Plugins/Hosted/NetscapePluginHostProxy.h: Added. + (WebKit::NetscapePluginHostProxy::create): + (WebKit::NetscapePluginHostProxy::port): + * Plugins/Hosted/NetscapePluginHostProxy.mm: Added. + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + (WebKit::NetscapePluginHostProxy::instantiatePlugin): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: Added. + (WebKit::NetscapePluginInstanceProxy::create): + (WebKit::NetscapePluginInstanceProxy::renderContextID): + (WebKit::NetscapePluginInstanceProxy::useSoftwareRenderer): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: Added. + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + (WebKit::NetscapePluginInstanceProxy::resize): + (WebKit::NetscapePluginInstanceProxy::destroy): + (WebKit::NetscapePluginInstanceProxy::focusChanged): + (WebKit::NetscapePluginInstanceProxy::windowFocusChanged): + (WebKit::NetscapePluginInstanceProxy::windowFrameChanged): + (WebKit::NetscapePluginInstanceProxy::startTimers): + (WebKit::NetscapePluginInstanceProxy::mouseEvent): + (WebKit::NetscapePluginInstanceProxy::stopTimers): + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein, Mark Rowe and Kevin Decker. + + Add the plug-in host manager singleton. + + * Plugins/Hosted/NetscapePluginHostManager.h: Added. + * Plugins/Hosted/NetscapePluginHostManager.mm: Added. + + (WebKit::NetscapePluginHostManager::hostForPackage): + If there's an existing host proxy available, just return it. Otherwise spawn a new plug-in host and + create a new plug-in host proxy from the new plug-in host port. + + (WebKit::NetscapePluginHostManager::spawnPluginHost): + Pass the plug-in host path and the preferred CPU type to the plug-in agent. When the plug-in host has + finished launching, pass it the path to the plug-in bundle. + + (WebKit::NetscapePluginHostManager::initializeVendorPort): + Check in with the plug-in agent and get the new plug-in vendor port back. + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Mark Rowe. + + * Plugins/Hosted/WebKitPluginHostTypes.h: + Add copyright headers and fix the spacing around the *'s. + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + * Plugins/Hosted/WebKitPluginHost.defs: + Add copyright headers. + + * Plugins/Hosted/WebKitPluginHostTypes.h: Added. + Forgot to add this. + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add plug-in host .defs. + + * Plugins/Hosted/WebKitPluginAgent.defs: Added. + * Plugins/Hosted/WebKitPluginAgentReply.defs: Added. + * Plugins/Hosted/WebKitPluginClient.defs: Added. + * Plugins/Hosted/WebKitPluginHost.defs: Added. + * Plugins/Hosted/WebKitPluginHostTypes.defs: Added. + +2008-11-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Mark Rowe and Kevin Decker. + + Minor plug-in changes. + + * Plugins/WebBaseNetscapePluginView.h: + Add add/remove observer method declarations. + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView isFlipped]): + Move this down from WebNetscapePluginView. + + * Plugins/WebNetscapePluginPackage.h: + * Plugins/WebNetscapePluginPackage.m: + (-[WebNetscapePluginPackage pluginHostArchitecture]): + Getter for the plug-in host architecture. + + * Plugins/WebNetscapePluginView.mm: + +2008-11-25 Dan Bernstein <mitz@apple.com> + + Reviewed by Mark Rowe. + + - include the text direction submenu in context menus when appropriate + + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): Changed the default + textDirectionSubmenuInclusionBehavior to "automatically", which includes + the menu when the selection is confined to a single paragraph the either + has right-to-left base writing direction or contains right-to-left or + embedded text. Left the default for Tiger and Leopard to be "never". + +2008-11-24 Darin Fisher <darin@chromium.org> + + Fix bustage. + + * History/WebHistory.mm: + +2008-11-24 Glenn Wilson <gwilson@chromium.org> + + Reviewed by Alexey Proskuryakov. + + http://bugs.webkit.org/show_bug.cgi?id=15643 + + Added API support for the "trailing whitespace" work-around. This includes an APIs + to get and set the state of this configuration variable. + + * WebCoreSupport/WebEditorClient.h: + * WebCoreSupport/WebEditorClient.mm: + (WebEditorClient::selectTrailingWhitespaceEnabled): + * WebView/WebView.mm: + (-[WebView setSelectTrailingWhitespaceEnabled:]): + (-[WebView isSelectTrailingWhitespaceEnabled]): + (-[WebView setSmartInsertDeleteEnabled:]): + * WebView/WebViewPrivate.h: + +2008-11-24 Darin Adler <darin@apple.com> + + Reviewed by Dan Bernstein. + + - https://bugs.webkit.org/show_bug.cgi?id=22470 + remove unneeded URL argument from FrameLoaderClient::updateGlobalHistory + + * WebCoreSupport/WebFrameLoaderClient.h: Remove argument. + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::updateGlobalHistory): Get the URL from the + DocumentLoader, just as we do the title and the failure flag. + +2008-11-24 Darin Adler <darin@apple.com> + + Reviewed by Dan Bernstein. + + - finish https://bugs.webkit.org/show_bug.cgi?id=22295 + track which history items are from page load failures + + Last time around I did this only for the back/forward list and missed the + global history list. + + * History/WebHistory.mm: + (-[WebHistory _visitedURL:withTitle:wasFailure:]): Added wasFailure argument. + Set the flag on the newly created history item. Also eliminated the use of + autorelease on the added-items array. + * History/WebHistoryInternal.h: Ditto. + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::updateGlobalHistory): Added code to check for failure + and pass the argument in to WebHistory. Given that this function gets other + data from the DocumentLoader, I think we should get rid of the KURL argument, + but that's a separate issue so I don't do it in this patch. + +2008-11-24 Simon Fraser <simon.fraser@apple.com> + + Fix call to Frame::selectionBounds in Tiger build. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _lookUpInDictionaryFromMenu:]): + +2008-11-24 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dan Bernstein + + Via: https://bugs.webkit.org/show_bug.cgi?id=22433 + + Rename RenderView::selectionRect() to selectionBounds(), to remove + longstanding ambiguity with the base class selectionRect() method. + Do the same on Frame for consistency with RenderView. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _lookUpInDictionaryFromMenu:]): + (-[WebHTMLView selectionRect]): + (-[WebHTMLView selectionImageRect]): + +2008-11-20 Pierre-Olivier Latour <pol@apple.com> + + Reviewed by Dan Bernstein. + + WebKit should be using Device RGB colorspace everywhere for + consistency. + + https://bugs.webkit.org/show_bug.cgi?id=22300 + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _dragImageForURL:withLabel:]): + (-[WebHTMLView _colorAsString:]): + +2008-11-20 Darin Adler <darin@apple.com> + + Earlier version reviewed by Justin Garcia. + + - part of fix for <rdar://problem/4108572> REGRESSION: Can't extend selection with shift-arrow in read only mode + Also resolves <rdar://problem/5000134>. + + * WebView/WebHTMLView.mm: Removed some unused code, and made the Tiger workaround for bug 3789278 + be Tiger-only. + (-[WebHTMLView resignFirstResponder]): Removed code setting unused resigningFirstResponder flag. + (-[WebHTMLView _wantsKeyDownForEvent:]): Added. Returns YES. + (-[WebHTMLView insertText:]): Don't try to insert text if the selection is not editable. We used + to prevent even processing the input, but that's not practical since some commands need to work + even in non-editable regions. + +2008-11-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Jon Honeycutt. + + Move some frame/page checking code down to the base class. + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView start]): + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView _createPlugin]): + +2008-11-19 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Test: plugins/netscape-plugin-setwindow-size-2.html + + Fix bug where NPP_SetWindow wasn't getting called for some plug-ins. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView updateAndSetWindow]): + Don't bail if the drawing model is not the CA drawing model. Remove some code + that was doing the wrong thing. + +2008-11-19 Darin Fisher <darin@chromium.org> + + Reviewed by Geoff Garen. + + https://bugs.webkit.org/show_bug.cgi?id=22345 + Define ScriptValue as a thin container for a JSC::Value*. + + * WebView/WebFrame.mm: + (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): + * WebView/WebView.mm: + (-[WebView aeDescByEvaluatingJavaScriptFromString:]): + +2008-11-19 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/6383762> WebKit r38340 crash on key press in plugin + + Set the value to 0 before calling NPP_GetValue, in case the plug-in returns NPERR_NO_ERROR but does not + update the value. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView createPlugin]): + +2008-11-19 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Make sure to copy the MIME type. + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): + +2008-11-19 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Darin Adler. + + First step toward fixing <rdar://problem/6263293> WebScriptDebugDelegate + should use intptr_t for sourceId, not int + + Added a conditional typedef (currently disabled) to switch sourceId to + intptr_t in non-Tiger, non-Leopard builds. + + * DefaultDelegates/WebDefaultScriptDebugDelegate.m: + (-[WebDefaultScriptDebugDelegate webView:didParseSource:fromURL:sourceId:forWebFrame:]): + (-[WebDefaultScriptDebugDelegate webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): + (-[WebDefaultScriptDebugDelegate webView:didEnterCallFrame:sourceId:line:forWebFrame:]): + (-[WebDefaultScriptDebugDelegate webView:willExecuteStatement:sourceId:line:forWebFrame:]): + (-[WebDefaultScriptDebugDelegate webView:willLeaveCallFrame:sourceId:line:forWebFrame:]): + (-[WebDefaultScriptDebugDelegate webView:exceptionWasRaised:sourceId:line:forWebFrame:]): + * WebView/WebScriptDebugDelegate.h: + * WebView/WebScriptDebugger.mm: + (WebScriptDebugger::sourceParsed): + (WebScriptDebugger::callEvent): + (WebScriptDebugger::atStatement): + (WebScriptDebugger::returnEvent): + (WebScriptDebugger::exception): + +2008-11-18 Dan Bernstein <mitz@apple.com> + + Reviewed by Mark Rowe. + + - fix https://bugs.webkit.org/show_bug.cgi?id=22331 + <rdar://problem/6381657> REGRESSION: Contextual menu no longer has an "Inspect Element" item + + * WebView/WebUIDelegatePrivate.h: Reorder new enum values after existing + ones. + +2008-11-17 Beth Dakin <bdakin@apple.com> + + Reviewed by Adele Peterson. + + Fix for <rdar://problem/6373102> REGRESSION (r36919): In a new mail + message, the caret appears in message body by default + + This fixes a regression caused by http://trac.webkit.org/changeset/36919. + That change was too sweeping; we do not want to + unconditionally set the page to be active, but we can be looser + than the original constraints. This patch set the window active if + the first responder is or is a descendant of the main frame's frame + view. + + * WebView/WebView.mm: + (-[WebView _updateFocusedAndActiveStateForFrame:]): + +2008-11-18 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=22337 + Enable workers by default + + * Configurations/WebKit.xcconfig: Define ENABLE_WORKERS (change from ENABLE_WORKER_THREADS, + which was accidentally committed before). + +2008-11-17 Geoffrey Garen <ggaren@apple.com> + + Not reviewed. + + Try to fix Mac build. + + * WebView/WebScriptDebugDelegate.mm: + +2008-11-17 Pierre-Olivier Latour <pol@apple.com> + + Reviewed by Sam Weinig. + + Added SPI to allow pausing a running CSS transition or animation + at a given time for testing purposes. + + https://bugs.webkit.org/show_bug.cgi?id=21261 + + * WebView/WebFrame.mm: + (-[WebFrame _pauseAnimation:onNode:atTime:]): + (-[WebFrame _pauseTransitionOfProperty:onNode:atTime:]): + * WebView/WebFramePrivate.h: + +2008-11-17 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Sam Weinig. + + Updated for JavaScriptCore renames. + + * ForwardingHeaders/runtime/Completion.h: Copied from ForwardingHeaders/runtime/Interpreter.h. + * ForwardingHeaders/runtime/Interpreter.h: Removed. + * WebView/WebScriptDebugDelegate.mm: + +2008-11-16 Greg Bolsinga <bolsinga@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=21810 + Remove use of static C++ objects that are destroyed at exit time (destructors) + + Use DEFINE_STATIC_LOCAL for static RetainPtr<T> + + * Misc/WebNSPasteboardExtras.mm: Use DEFINE_STATIC_LOCAL + (+[NSPasteboard _web_writableTypesForURL]): + (_createWritableTypesForImageWithoutArchive): Created so accessor has one line initialization + (_writableTypesForImageWithoutArchive): Use create function for one line initialization + (_createWritableTypesForImageWithArchive): Created so accessor has one line initialization + (_writableTypesForImageWithArchive): Use create function for one line initialization + * WebCoreSupport/WebPasteboardHelper.mm: Use DEFINE_STATIC_LOCAL + (WebPasteboardHelper::insertablePasteboardTypes): + * WebView/WebHTMLRepresentation.mm: Use DEFINE_STATIC_LOCAL + (+[WebHTMLRepresentation supportedMIMETypes]): + (+[WebHTMLRepresentation supportedNonImageMIMETypes]): + (+[WebHTMLRepresentation supportedImageMIMETypes]): + +2008-11-16 Darin Adler <darin@apple.com> + + Reviewed by Dan Bernstein. + + - https://bugs.webkit.org/show_bug.cgi?id=22295 + track which history items are from page load failures + + * History/WebHistoryItem.mm: Added lastVisitWasFailureKey. + (-[WebHistoryItem initFromDictionaryRepresentation:]): Set the lastVisitWasFailure + flag in the history item if the dictionary had lastVisitWasFailureKey true. + (-[WebHistoryItem dictionaryRepresentation]): Set the lastVisitWasFailureKey boolean + in the dictionary if the history item had the lastVisitWasFailure flag. + (-[WebHistoryItem lastVisitWasFailure]): Added. + + * History/WebHistoryItemInternal.h: Moved include of WebBackForwardList here from + WebHistoryItemPrivate.h; removed other unneeded includes. + + * History/WebHistoryItemPrivate.h: Added lastVisitWasFailure method. + Removed unneeded includes. + + * Misc/WebNSDictionaryExtras.h: Added _webkit_boolForKey. + * Misc/WebNSDictionaryExtras.m: + (-[NSDictionary _webkit_boolForKey:]): Added. + +2008-11-14 Greg Bolsinga <bolsinga@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=21810 + Remove use of static C++ objects that are destroyed at exit time (destructors) + + Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid + exit-time destructor. Update code that was changed to fix this issue that ran + into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference + in gcc build 5465). Also typdefs for template types needed to be added in some + cases so the type could make it through the macro successfully. + + Basically code of the form: + static T m; + becomes: + DEFINE_STATIC_LOCAL(T, m, ()); + + Also any code of the form: + static T& m = *new T; + also becomes: + DEFINE_STATIC_LOCAL(T, m, ()); + + * ForwardingHeaders/wtf/StdLibExtras.h: Added. + * History/WebBackForwardList.mm: + (backForwardLists): + * History/WebHistoryItem.mm: + (historyItemWrappers): + * Misc/WebStringTruncator.m: + (fontFromNSFont): + * Plugins/WebBaseNetscapePluginStream.mm: + (streams): + * WebView/WebView.mm: + (aeDescFromJSValue): + +2008-11-14 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + - <rdar://problem/6234333> Implement action methods for setting and clearing character-level directionality + - part of <rdar://problem/6234337> Add a Text Direction menu to the default context menu when appropriate + + * WebCoreSupport/WebViewFactory.mm: + (-[WebViewFactory contextMenuItemTagTextDirectionMenu]): Added. + * WebView/WebFrame.mm: + (core): Added a convertor from WebTextDirectionSubmenuInclusionBehavior + to WebCore::TextDirectionSubmenuInclusionBehavior. + * WebView/WebFrameInternal.h: + * WebView/WebHTMLView.mm: + Added makeTextWritingDirectionLeftToRight:, + makeTextWritingDirectionNatural: and + makeTextWritingDirectionRightToLeft: using the WEBCORE_COMMAND macro. + * WebView/WebPreferenceKeysPrivate.h: + Added WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey. + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): Set the default Text Direction + submenu inclusion behavior to never include. + (-[WebPreferences textDirectionSubmenuInclusionBehavior]): Added this + accessor. + (-[WebPreferences setTextDirectionSubmenuInclusionBehavior:]): Ditto. + * WebView/WebPreferencesPrivate.h: Defined the + WebTextDirectionSubmenuInclusionBehavior enum and declared + accessors. + * WebView/WebUIDelegatePrivate.h: + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): Added code to transfer + the Text Direction submenu inclusion behavior preference to WebCore + settings. + +2008-11-14 Darin Adler <darin@apple.com> + + Reviewed by Mark Rowe. + + - fix https://bugs.webkit.org/show_bug.cgi?id=22222 + selectKeyViewPrecedingView: with document view that can't be first responder + makes WebFrameView be first responder + + * WebView/WebFrameView.mm: (-[WebFrameView becomeFirstResponder]): + Moved the acceptsFirstResponder special case inside the if statement so it won't + run in the "selecting previous" case. Also removed the "just before shipping Tiger" + code that doesn't need to be here any more. + +2008-11-13 Mark Rowe <mrowe@apple.com> + + Fix the build. + + Don't use NSPICTPboardType on systems where it is deprecated. The system will take care of converting + from this format to a format that we can understand. + + * WebCoreSupport/WebPasteboardHelper.mm: + (WebPasteboardHelper::insertablePasteboardTypes): + * WebView/WebHTMLView.mm: + (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]): + (+[WebHTMLView _insertablePasteboardTypes]): + (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): + +2008-11-13 John Sullivan <sullivan@apple.com> + + fixed <rdar://problem/6361578> Web Kit UI strings: a few edits + + Reviewed by Tim Hatcher + + * Misc/WebKitErrors.m: + "Cannot show content with specified mime type" -> "Content with specified MIME type can't be shown" + "Cannot show URL" -> "The URL can't be shown" + "Cannot find plug-in" -> "The plug-in can't be found" + "Cannot load plug-in" -> "The plug-in can't be loaded" + + * Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib: + * Panels/English.lproj/WebAuthenticationPanel.nib/info.nib: + * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib: Added. + * Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib: Removed. + Changed placeholder fine print in the nib to match one of the two strings it might be replaced by. + This automagically updated the nib to a newer format, hence the objects -> keyedobjects change. + I could have changed the placeholder fine print to be empty but this lets localizers understand + the dialog layout better. + + * Panels/WebAuthenticationPanel.m: + (-[WebAuthenticationPanel setUpForChallenge:]): + "you need to log in" -> "you must log in" + "Your log-in information" -> "Your login information" + "The name or password entered" -> "The user name or password you entered" + "Please try again." -> "Make sure you're entering them correctly, and then try again." + +2008-11-12 Stephanie Lewis <slewis@apple.com> + + Fix Mac build. + + * Panels/WebAuthenticationPanel.m: + +2008-11-12 John Sullivan <sullivan@apple.com> + + fixed <rdar://problem/3839110> Authentication dialogs talk about passwords being sent "in the clear" + + Reviewed by Tim Hatcher + + * Panels/WebAuthenticationPanel.m: + (-[WebAuthenticationPanel setUpForChallenge:]): + use "unencrypted" instead of "in the clear". Also, use the "Your log-in information + will be sent securely" version when the receiving server is https, regardless of + whether it uses basic or digest authentication. + +2008-11-12 Darin Adler <darin@apple.com> + + Reviewed by Mark Rowe. + + - fix https://bugs.webkit.org/show_bug.cgi?id=22223 + <rdar://problem/6366864> REGRESSION(r38245): "View Source" crashes the browser + + * WebView/WebFrameView.mm: (-[WebFrameView viewDidMoveToWindow]): + Add missing null check. + +2008-11-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Fix stupid bug. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView createPlugin]): + +2008-11-10 Tor Arne Vestbø <tavestbo@trolltech.com> + + Reviewed by Simon Hausmann. + + Move _web_encodingForResource from WebKit into WebCore and change return type + + This change is needed to implement NSAPI in WebCore for Mac, see: + + https://bugs.webkit.org/show_bug.cgi?id=21427 + + + * Misc/WebKitNSStringExtras.m: + (+[NSString _web_encodingForResource:]): + +2008-11-10 Tor Arne Vestbø <tavestbo@trolltech.com> + + Reviewed by Simon Hausmann. + + Moved the implementation of _webkit_isCaseInsensitiveEqualToString to + WebCore's WebCoreNSStringExtras as _stringIsCaseInsensitiveEqualToString. + + This change is needed to implement NSAPI in WebCore for Mac, see: + + https://bugs.webkit.org/show_bug.cgi?id=21427 + + * Misc/WebKitNSStringExtras.m: + (-[NSString _webkit_isCaseInsensitiveEqualToString:]): + +2008-11-11 Dan Bernstein <mitz@apple.com> + + Reviewed by Adam Roben. + + WebKit/mac part of adding a master volume control for media elements in a WebView + + * WebView/WebView.mm: + (-[WebView setMediaVolume:]): Added. + (-[WebView mediaVolume]): Added. + * WebView/WebViewPrivate.h: + +2008-11-11 Aaron Golden <agolden@apple.com> + + Bug 22134: -[WebHistoryItem dictionaryRepresentation] accesses past the end of a vector + + <https://bugs.webkit.org/show_bug.cgi?id=22134> + + Reviewed by Geoff Garen. + + * History/WebHistoryItem.mm: + (-[WebHistoryItem initFromDictionaryRepresentation:]): + (-[WebHistoryItem dictionaryRepresentation]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Move renewGState to the base class. + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView renewGState]): + * Plugins/WebNetscapePluginView.mm: + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Move start, stop and all the related methods down to WebBaseNetscapePluginView. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView updateAndSetWindow]): + (-[WebBaseNetscapePluginView addWindowObservers]): + (-[WebBaseNetscapePluginView removeWindowObservers]): + (-[WebBaseNetscapePluginView start]): + (-[WebBaseNetscapePluginView stop]): + (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): + (-[WebBaseNetscapePluginView viewWillMoveToSuperview:]): + (-[WebBaseNetscapePluginView viewDidMoveToWindow]): + (-[WebBaseNetscapePluginView viewWillMoveToHostWindow:]): + (-[WebBaseNetscapePluginView viewDidMoveToHostWindow]): + (-[WebBaseNetscapePluginView windowWillClose:]): + (-[WebBaseNetscapePluginView windowBecameKey:]): + (-[WebBaseNetscapePluginView windowResignedKey:]): + (-[WebBaseNetscapePluginView windowDidMiniaturize:]): + (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): + (-[WebBaseNetscapePluginView loginWindowDidSwitchFromUser:]): + (-[WebBaseNetscapePluginView loginWindowDidSwitchToUser:]): + (-[WebBaseNetscapePluginView preferencesHaveChanged:]): + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Move rightMouseDown, rightMouseUp and sendActivateEvent to the base plugin view. + Add stubs for createPlugin, loadStream, shouldStop and destroyPlugin. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView windowFocusChanged:]): + (-[WebBaseNetscapePluginView createPlugin]): + (-[WebBaseNetscapePluginView loadStream]): + (-[WebBaseNetscapePluginView destroyPlugin]): + (-[WebBaseNetscapePluginView sendActivateEvent:]): + (-[WebBaseNetscapePluginView rightMouseDown:]): + (-[WebBaseNetscapePluginView rightMouseUp:]): + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView windowFocusChanged:]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Factor plug-in type specific code out to three new methods, createPlugin, destroyPlugin and loadStream. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView createPlugin]): + (-[WebNetscapePluginView loadStream]): + (-[WebNetscapePluginView start]): + (-[WebNetscapePluginView shouldStop]): + (-[WebNetscapePluginView destroyPlugin]): + (-[WebNetscapePluginView stop]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Fix Tiger build. + + * Plugins/WebNetscapePluginPackage.m: + (-[WebNetscapePluginPackage load]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Move even more code down to WebBaseNetscapePluginView, get rid of some unnecessary methods. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView focusChanged]): + (-[WebBaseNetscapePluginView visibleRect]): + (-[WebBaseNetscapePluginView acceptsFirstResponder]): + (-[WebBaseNetscapePluginView setHasFocus:]): + (-[WebBaseNetscapePluginView becomeFirstResponder]): + (-[WebBaseNetscapePluginView resignFirstResponder]): + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView focusChanged]): + (-[WebNetscapePluginView tellQuickTimeToChill]): + (-[WebNetscapePluginView updateAndSetWindow]): + (-[WebNetscapePluginView start]): + (-[WebNetscapePluginView stop]): + (-[WebNetscapePluginView viewWillMoveToWindow:]): + (-[WebNetscapePluginView createPluginScriptableObject]): + (-[WebNetscapePluginView pluginView:receivedData:]): + (-[WebNetscapePluginView pluginView:receivedError:]): + (-[WebNetscapePluginView pluginViewFinishedLoading:]): + (-[WebNetscapePluginView inputContext]): + (-[WebNetscapePluginView hasMarkedText]): + (-[WebNetscapePluginView insertText:]): + (-[WebNetscapePluginView markedRange]): + (-[WebNetscapePluginView selectedRange]): + (-[WebNetscapePluginView setMarkedText:selectedRange:]): + (-[WebNetscapePluginView unmarkText]): + (-[WebNetscapePluginView validAttributesForMarkedText]): + (-[WebNetscapePluginView attributedSubstringFromRange:]): + (-[WebNetscapePluginView characterIndexForPoint:]): + (-[WebNetscapePluginView doCommandBySelector:]): + (-[WebNetscapePluginView firstRectForCharacterRange:]): + (-[WebNetscapePluginView _viewHasMoved]): + (-[WebNetscapePluginView _redeliverStream]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Move timer handling code down to WebBaseNetscapePluginView. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView stopTimers]): + (-[WebBaseNetscapePluginView startTimers]): + (-[WebBaseNetscapePluginView restartTimers]): + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView stopTimers]): + (-[WebNetscapePluginView startTimers]): + (-[WebNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]): + * WebView/WebHTMLView.mm: + (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Move a bunch of methods and ivars up to WebBaseNetscapePluginView. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView dealloc]): + (-[WebBaseNetscapePluginView finalize]): + (-[WebBaseNetscapePluginView removeTrackingRect]): + (-[WebBaseNetscapePluginView resetTrackingRect]): + (-[WebBaseNetscapePluginView dataSource]): + (-[WebBaseNetscapePluginView webFrame]): + (-[WebBaseNetscapePluginView webView]): + (-[WebBaseNetscapePluginView currentWindow]): + * Plugins/WebNetscapePluginEventHandlerCarbon.mm: + (WebNetscapePluginEventHandlerCarbon::windowFocusChanged): + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView sendEvent:isDrawRect:]): + (-[WebNetscapePluginView sendActivateEvent:]): + (-[WebNetscapePluginView restartTimers]): + (-[WebNetscapePluginView setHasFocus:]): + (-[WebNetscapePluginView mouseDown:]): + (-[WebNetscapePluginView mouseUp:]): + (-[WebNetscapePluginView mouseEntered:]): + (-[WebNetscapePluginView mouseExited:]): + (-[WebNetscapePluginView handleMouseMoved:]): + (-[WebNetscapePluginView mouseDragged:]): + (-[WebNetscapePluginView scrollWheel:]): + (-[WebNetscapePluginView keyUp:]): + (-[WebNetscapePluginView keyDown:]): + (-[WebNetscapePluginView flagsChanged:]): + (-[WebNetscapePluginView updateAndSetWindow]): + (-[WebNetscapePluginView setWindowIfNecessary]): + (-[WebNetscapePluginView start]): + (-[WebNetscapePluginView stop]): + (-[WebNetscapePluginView isStarted]): + (-[WebNetscapePluginView dealloc]): + (-[WebNetscapePluginView finalize]): + (-[WebNetscapePluginView drawRect:]): + (-[WebNetscapePluginView windowBecameKey:]): + (-[WebNetscapePluginView preferencesHaveChanged:]): + (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): + (-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]): + (-[WebNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]): + (-[WebNetscapePluginView _viewHasMoved]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker and Mark Rowe. + + Add a WebHostedNetscapePluginView class. + + * Plugins/WebHostedNetscapePluginView.h: Added. + * Plugins/WebHostedNetscapePluginView.mm: Added. + + * Plugins/WebNetscapePluginPackage.h: + Use the right define. + + * Plugins/WebPluginDatabase.mm: + (-[WebPluginDatabase removePluginInstanceViewsFor:]): + Check for WebBaseNetscapePluginView. + + (-[WebPluginDatabase destroyAllPluginInstanceViews]): + Check for WebBaseNetscapePluginView. + + * WebCoreSupport/WebFrameLoaderClient.mm: + (NetscapePluginWidget::NetscapePluginWidget): + (NetscapePluginWidget::handleEvent): + Use WebBaseNetscapePluginView. + + (netscapePluginViewClass): + New function that returns the right netscape plugin view type to use. + + (WebFrameLoaderClient::createPlugin): + Get the right class. + + * WebKitPrefix.h: + Prefix the #define with WTF_. + + * WebView/WebHTMLView.mm: + (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): + Check for WebBaseNetscapePluginView. + + * WebView/WebView.mm: + Remove an unnecessary include. + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Don't use individual ivars for each plug-in vtable function. Instead, get them from the plugin package. + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): + * Plugins/WebNetscapePluginPackage.h: + * Plugins/WebNetscapePluginPackage.m: + (-[WebNetscapePluginPackage load]): + (-[WebNetscapePluginPackage _unloadWithShutdown:]): + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView sendEvent:isDrawRect:]): + (-[WebNetscapePluginView setWindowIfNecessary]): + (-[WebNetscapePluginView start]): + (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): + (-[WebNetscapePluginView createPluginScriptableObject]): + (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): + (-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]): + (-[WebNetscapePluginView loadPluginRequest:]): + (-[WebNetscapePluginView _createPlugin]): + (-[WebNetscapePluginView _destroyPlugin]): + (-[WebNetscapePluginView _printedPluginBitmap]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Add a new WebBaseNetscapePluginView class. + + * Plugins/WebBaseNetscapePluginView.h: Added. + * Plugins/WebBaseNetscapePluginView.mm: Added. + (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): + (-[WebBaseNetscapePluginView setAttributeKeys:andValues:]): + (-[WebBaseNetscapePluginView handleMouseMoved:]): + * Plugins/WebNetscapePluginView.h: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView cut:]): + (-[WebNetscapePluginView copy:]): + (-[WebNetscapePluginView paste:]): + (-[WebNetscapePluginView selectAll:]): + (-[WebNetscapePluginView start]): + (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): + +2008-11-10 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam Roben. + + Rename WebBaseNetscapePluginView to WebNetscapePluginView. + + * Plugins/WebBaseNetscapePluginStream.h: + * Plugins/WebBaseNetscapePluginStream.mm: + (WebNetscapePluginStream::WebNetscapePluginStream): + (WebNetscapePluginStream::setPlugin): + * Plugins/WebBaseNetscapePluginView.h: Removed. + * Plugins/WebBaseNetscapePluginView.mm: Removed. + * Plugins/WebNetscapePluginEventHandler.h: + (WebNetscapePluginEventHandler::WebNetscapePluginEventHandler): + * Plugins/WebNetscapePluginEventHandler.mm: + (WebNetscapePluginEventHandler::create): + * Plugins/WebNetscapePluginEventHandlerCarbon.h: + * Plugins/WebNetscapePluginEventHandlerCarbon.mm: + (WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon): + * Plugins/WebNetscapePluginEventHandlerCocoa.h: + * Plugins/WebNetscapePluginEventHandlerCocoa.mm: + (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa): + * Plugins/WebNetscapePluginView.h: Copied from mac/Plugins/WebBaseNetscapePluginView.h. + * Plugins/WebNetscapePluginView.mm: Copied from mac/Plugins/WebBaseNetscapePluginView.mm. + (+[WebNetscapePluginView setCurrentPluginView:]): + (+[WebNetscapePluginView currentPluginView]): + (-[WebNetscapePluginView loadPluginRequest:]): + * Plugins/WebPluginDatabase.mm: + (-[WebPluginDatabase removePluginInstanceViewsFor:]): + (-[WebPluginDatabase destroyAllPluginInstanceViews]): + * Plugins/npapi.mm: + (pluginViewForInstance): + (NPN_MarkedTextAbandoned): + (NPN_MarkedTextSelectionChanged): + * WebCoreSupport/WebFrameLoaderClient.mm: + (NetscapePluginWidget::NetscapePluginWidget): + (NetscapePluginWidget::handleEvent): + (WebFrameLoaderClient::createPlugin): + * WebView/WebHTMLView.mm: + (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): + (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): + (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): + * WebView/WebView.mm: + +2008-11-09 Darin Adler <darin@apple.com> + + Reviewed by John Sullivan. + + - fix https://bugs.webkit.org/show_bug.cgi?id=15063 + <rdar://problem/5452227> REGRESSION (r25151): Switching to a tab waiting + for first data does not clear the window + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::frameLoadCompleted): Added comments, and got rid of + a local variable to make this code match the code in the function below + more closely. + (WebFrameLoaderClient::provisionalLoadStarted): Added comments. + + * WebView/WebFrame.mm: + (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Improved comment. + + * WebView/WebFrameView.mm: + (-[WebFrameView _scrollView]): Tweaked formatting. + (-[WebFrameView initWithFrame:]): Ditto. + (-[WebFrameView setFrameSize:]): Added a comment and tweaked formatting. + (-[WebFrameView viewDidMoveToWindow]): Added. This is the change that fixes + the bug. Calls setDrawsBackground:YES as appropriate since moving the view + out of the window to switch to another view disrupts the special technique + for showing the old page during the start of loading. This is the identical + reason for the setFrameSize: method above, and the code is almost the same. + +2008-11-08 David Kilzer <ddkilzer@apple.com> + + Bug 22137: PLATFORM(MAC) build broken with HAVE(ACCESSIBILITY) disabled + + <https://bugs.webkit.org/show_bug.cgi?id=22137> + + Reviewed by Darin Adler. + + * WebView/WebFrame.mm: + (-[WebFrame _accessibilityTree]): Return nil if HAVE(ACCESSIBILITY) + is false. + +2008-11-08 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + - WebKit/mac part of adding WebPreferences for controlling databases and local storage + + * WebView/WebPreferenceKeysPrivate.h: Added + WebKitDatabasesEnabledPreferenceKey and + WebKitLocalStorageEnabledPreferenceKey. + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): Made databases and local storage enabled + by default. + (-[WebPreferences databasesEnabled]): Added. + (-[WebPreferences setDatabasesEnabled:]): Added. + (-[WebPreferences localStorageEnabled]): Added. + (-[WebPreferences setLocalStorageEnabled:]): Added. + * WebView/WebPreferencesPrivate.h: + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): Transfer the databases + and local storage preferences to WebCore settings. + +2008-11-06 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + https://bugs.webkit.org/show_bug.cgi?id=22115 + NPN_HasPropertyUPP and NPN_HasMethodUPP entries in NPNetscapeFuncs are NULL + + Initialize the browser funcs correctly. + + * Plugins/WebNetscapePluginPackage.m: + (-[WebNetscapePluginPackage load]): + +2008-11-06 David Kilzer <ddkilzer@apple.com> + + BUILD FIX: Backed out r38189 (and r38203) for Xcode 3.0. + + Apparently older versions of gcc have issues with this patch. + Backing out a second time until the issues are resolved. + +2008-11-06 Cameron Zwarich <zwarich@apple.com> + + Reviewed by Geoff Garen. + + Move the remaining files in the kjs subdirectory of JavaScriptCore to + a new parser subdirectory, and remove the kjs subdirectory entirely. + + The header SavedBuiltins.h was removed in r32587, so it no longer needs + a forwarding header. + + * ForwardingHeaders/kjs: Removed. + * ForwardingHeaders/kjs/SavedBuiltins.h: Removed. + +2008-11-06 David Kilzer <ddkilzer@apple.com> + + BUILD WAS NOT BROKEN: Rolling r38189 back in. + + Please perform a clean build if you see crashes. + +2008-11-06 David Kilzer <ddkilzer@apple.com> + + BUILD FIX: Backed out r38189 since it apparently broke the world. + +2008-11-06 John Sullivan <sullivan@apple.com> + + Fixed problem with switching between text-only zoom and full-content zoom + + There were two booleans tracking whether zoom was text-only, one in WebCore settings + and one in WebViewPrivate. Fixed by eliminating the one in WebViewPrivate. + + Reviewed by Adam Roben + + * WebView/WebView.mm: + remove declaration of zoomMultiplierIsTextOnly instance variable in WebViewPrivate + (-[WebViewPrivate init]): + removed initialization of zoomMultiplierIsTextOnly + (-[WebView textSizeMultiplier]): + call [self _realZoomMultiplierIsTextOnly] instead of accessing WebViewPrivate instance variable + (-[WebView _setZoomMultiplier:isTextOnly:]): + update WebCore settings rather than WebViewPrivate instance variable + (-[WebView _zoomMultiplier:]): + call [self _realZoomMultiplierIsTextOnly] instead of accessing WebViewPrivate instance variable + (-[WebView _realZoomMultiplierIsTextOnly]): + return value from WebCore settings instead of accessing WebViewPrivate instance variable + (-[WebView pageSizeMultiplier]): + call [self _realZoomMultiplierIsTextOnly] instead of accessing WebViewPrivate instance variable + +2008-11-06 Greg Bolsinga <bolsinga@apple.com> + + Reviewed by Darin Adler. + + Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors) + https://bugs.webkit.org/show_bug.cgi?id=21810 + + * History/WebBackForwardList.mm: + (backForwardLists): Changed to leak an object to avoid an exit-time destructor. + * History/WebHistoryItem.mm: + (historyItemWrappers): Ditto + * Misc/WebStringTruncator.m: + (fontFromNSFont): Ditto + * Plugins/WebBaseNetscapePluginStream.mm: + (streams): Ditto + * WebView/WebView.mm: + (aeDescFromJSValue): Ditto + +2008-11-05 Anders Carlsson <andersca@apple.com> + + Reviewed by Mark Rowe. + + Keep track of which plug-in host architecture would be needed for a given plug-in package. + + * Plugins/WebNetscapePluginPackage.h: + * Plugins/WebNetscapePluginPackage.m: + (-[WebNetscapePluginPackage _initWithPath:]): + * WebKitPrefix.h: + +2008-11-05 Cameron Zwarich <zwarich@apple.com> + + Rubber-stamped by Sam Weinig. + + Correct forwarding headers for files moved to the runtime subdirectory + of JavaScriptCore and remove unused forwarding headers. + + * ForwardingHeaders/kjs/collector.h: Removed. + * ForwardingHeaders/kjs/identifier.h: Removed. + * ForwardingHeaders/kjs/interpreter.h: Removed. + * ForwardingHeaders/kjs/lookup.h: Removed. + * ForwardingHeaders/kjs/operations.h: Removed. + * ForwardingHeaders/kjs/protect.h: Removed. + * ForwardingHeaders/runtime/Interpreter.h: Copied from ForwardingHeaders/kjs/interpreter.h. + * WebView/WebScriptDebugDelegate.mm: + +2008-11-05 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Remove WebPlugInStreamLoaderDelegate.h + + * Plugins/WebBaseNetscapePluginStream.h: + * Plugins/WebPlugInStreamLoaderDelegate.h: Removed. + +2008-11-05 Dan Bernstein <mitz@apple.com> + + - Tiger build fix + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView stop]): + +2008-11-04 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + Don't leak the CALayer. + + * Plugins/WebBaseNetscapePluginView.h: + Make the layer a RetainPtr. + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView start]): + + (-[WebBaseNetscapePluginView stop]): + Make sure to clear out the layer here. + +2008-11-04 Cameron Zwarich <zwarich@apple.com> + + Rubber-stamped by Sam Weinig. + + Remove the unused kjs/dtoa.h forwarding header. + + * ForwardingHeaders/kjs/dtoa.h: Removed. + +2008-11-04 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + More cleanup. Make a bunch of instance variables RetainPtrs. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView visibleRect]): + (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): + (-[WebBaseNetscapePluginView sendActivateEvent:]): + (-[WebBaseNetscapePluginView sendDrawRectEvent:]): + (-[WebBaseNetscapePluginView stopTimers]): + (-[WebBaseNetscapePluginView restartTimers]): + (-[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 didStart]): + (-[WebBaseNetscapePluginView start]): + (-[WebBaseNetscapePluginView stop]): + (-[WebBaseNetscapePluginView dataSource]): + (-[WebBaseNetscapePluginView pluginPackage]): + (-[WebBaseNetscapePluginView setPluginPackage:]): + (-[WebBaseNetscapePluginView setAttributeKeys:andValues:]): + (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): + (-[WebBaseNetscapePluginView fini]): + (-[WebBaseNetscapePluginView dealloc]): + (-[WebBaseNetscapePluginView pluginView:receivedError:]): + (-[WebBaseNetscapePluginView requestWithURLCString:]): + (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): + (-[WebBaseNetscapePluginView loadPluginRequest:]): + (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): + (-[WebBaseNetscapePluginView userAgent]): + (-[WebBaseNetscapePluginView getVariable:value:]): + (-[WebBaseNetscapePluginView setVariable:value:]): + (-[WebBaseNetscapePluginView _createPlugin]): + (-[WebBaseNetscapePluginView _redeliverStream]): + +2008-11-04 Brady Eidson <beidson@apple.com> + + Reviewed by John Sullivan + + Cleanup global history a tad. + + Used to _addItemForURL always create a new item and merge it with a previous item if one existed. + + It is more efficient and less complicated to update the previous item if one exists. + + * History/WebHistory.mm: + (-[WebHistoryPrivate visitedURL:withTitle:]): + (-[WebHistory _visitedURL:withTitle:]): Instead of calling the general purpose [WebHistoryPrivate addItem:] + with a new history item, call the new special purposed visitedURL:withTitle: + * History/WebHistoryInternal.h: + + * History/WebHistoryItem.mm: + (-[WebHistoryItem _visitedWithTitle:]): Call "visited()" on the WebCore history item with the pertinent info. + * History/WebHistoryItemInternal.h: + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::updateGlobalHistory): + +2008-11-04 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + https://bugs.webkit.org/show_bug.cgi?id=22065 + + Only create the plug-in stream loader when the stream is started. + + * Plugins/WebBaseNetscapePluginStream.mm: + (WebNetscapePluginStream::WebNetscapePluginStream): + (WebNetscapePluginStream::start): + +2008-11-04 Anders Carlsson <andersca@apple.com> + + Reviewed by Kevin Decker. + + https://bugs.webkit.org/show_bug.cgi?id=22065 + + Remove some old, unused plug-in code. + + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): + (-[WebBaseNetscapePluginView start]): + (-[WebBaseNetscapePluginView setVariable:value:]): + +2008-11-04 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dave Hyatt + + https://bugs.webkit.org/show_bug.cgi?id=21941 + + Rename absolutePosition() to localToAbsolute(), and add the ability + to optionally take transforms into account (which will eventually be the + default behavior). + + * WebView/WebRenderNode.mm: + (copyRenderNode): + 2008-11-01 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. diff --git a/WebKit/mac/Configurations/Base.xcconfig b/WebKit/mac/Configurations/Base.xcconfig index 52c224b..2c83815 100644 --- a/WebKit/mac/Configurations/Base.xcconfig +++ b/WebKit/mac/Configurations/Base.xcconfig @@ -1,4 +1,3 @@ -DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DEBUGGING_SYMBOLS = default; @@ -19,13 +18,14 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; LINKER_DISPLAYS_MANGLED_NAMES = YES; +OTHER_MIGFLAGS = -F$(BUILT_PRODUCTS_DIR); PREBINDING = NO; VALID_ARCHS = i386 ppc x86_64 ppc64; // FIXME: <rdar://problem/5070292> WebKit should build with -Wshorten-64-to-32 -WARNING_CFLAGS = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wundef; +WARNING_CFLAGS = -Wall -Wextra -Wcast-align -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings; -// DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL and STRIP_INSTALLED_PRODUCT vary between the debug and normal variants. +// DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants. // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant. DEBUG_DEFINES_debug = DISABLE_THREAD_CHECK; DEBUG_DEFINES_normal = NDEBUG; @@ -39,6 +39,14 @@ STRIP_INSTALLED_PRODUCT = $(STRIP_INSTALLED_PRODUCT_$(CURRENT_VARIANT)); STRIP_INSTALLED_PRODUCT_normal = YES; STRIP_INSTALLED_PRODUCT_debug = NO; +// Dead code stripping needs to be on in the debug variant to avoid link errors. This is due to unconditionally +// building the MiG bindings for WebKitPluginClient even when the functions that the bindings wrap are not built. +DEAD_CODE_STRIPPING = YES; + + +GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL)); +GCC_VERSION_0310 = 4.2; + // <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. @@ -53,3 +61,4 @@ GCC_GENERATE_DEBUGGING_SYMBOLS_ppc_Production = $(GCC_GENERATE_DEBUGGING_SYMBOLS GCC_GENERATE_DEBUGGING_SYMBOLS_ppc_Production_ = NO; GCC_GENERATE_DEBUGGING_SYMBOLS_ppc_Production_1040 = NO; GCC_GENERATE_DEBUGGING_SYMBOLS_ppc_Production_1050 = YES; +GCC_GENERATE_DEBUGGING_SYMBOLS_ppc_Production_1060 = YES; diff --git a/WebKit/mac/Configurations/DebugRelease.xcconfig b/WebKit/mac/Configurations/DebugRelease.xcconfig index 55b489f..10699fb 100644 --- a/WebKit/mac/Configurations/DebugRelease.xcconfig +++ b/WebKit/mac/Configurations/DebugRelease.xcconfig @@ -9,10 +9,6 @@ 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; diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index 16698b9..bf339bf 100644 --- a/WebKit/mac/Configurations/Version.xcconfig +++ b/WebKit/mac/Configurations/Version.xcconfig @@ -1,5 +1,5 @@ MAJOR_VERSION = 528; -MINOR_VERSION = 5; +MINOR_VERSION = 16; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebKit/mac/Configurations/WebKit.xcconfig b/WebKit/mac/Configurations/WebKit.xcconfig index 8deb186..0937fdb 100644 --- a/WebKit/mac/Configurations/WebKit.xcconfig +++ b/WebKit/mac/Configurations/WebKit.xcconfig @@ -18,4 +18,4 @@ WEBCORE_PRIVATE_HEADERS_DIR = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/Priva 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; +FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT; diff --git a/WebKit/mac/DOM/WebDOMOperations.mm b/WebKit/mac/DOM/WebDOMOperations.mm index 5ef92f1..8f5fc03 100644 --- a/WebKit/mac/DOM/WebDOMOperations.mm +++ b/WebKit/mac/DOM/WebDOMOperations.mm @@ -67,15 +67,16 @@ using namespace WebCore; - (NSArray *)_subresourceURLs { - Vector<KURL> urls; + ListHashSet<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]]; - + ListHashSet<KURL>::iterator end = urls.end(); + for (ListHashSet<KURL>::iterator it = urls.begin(); it != end; ++it) + [array addObject:(NSURL *)*it]; + return array; } diff --git a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m index 2ba9291..85cef90 100644 --- a/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m +++ b/WebKit/mac/DefaultDelegates/WebDefaultScriptDebugDelegate.m @@ -28,7 +28,6 @@ #import <WebKit/WebScriptDebugDelegate.h> #import "WebDefaultScriptDebugDelegate.h" - #import "WebTypesInternal.h" @implementation WebDefaultScriptDebugDelegate @@ -45,7 +44,7 @@ static WebDefaultScriptDebugDelegate *sharedDelegate = nil; - (void)webView:(WebView *)webView didParseSource:(NSString *)source fromURL:(NSString *)url - sourceId:(int)sid + sourceId:(WebSourceId)sid forWebFrame:(WebFrame *)webFrame { } @@ -53,7 +52,7 @@ static WebDefaultScriptDebugDelegate *sharedDelegate = nil; - (void)webView:(WebView *)webView didParseSource:(NSString *)source baseLineNumber:(NSUInteger)lineNumber fromURL:(NSURL *)url - sourceId:(int)sid + sourceId:(WebSourceId)sid forWebFrame:(WebFrame *)webFrame { } @@ -67,28 +66,28 @@ static WebDefaultScriptDebugDelegate *sharedDelegate = nil; } - (void)webView:(WebView *)webView didEnterCallFrame:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame { } - (void)webView:(WebView *)webView willExecuteStatement:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame { } - (void)webView:(WebView *)webView willLeaveCallFrame:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame { } - (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame { diff --git a/WebKit/mac/ForwardingHeaders/runtime/Completion.h b/WebKit/mac/ForwardingHeaders/runtime/Completion.h new file mode 100644 index 0000000..25f9cec --- /dev/null +++ b/WebKit/mac/ForwardingHeaders/runtime/Completion.h @@ -0,0 +1 @@ +#import <JavaScriptCore/Completion.h> diff --git a/WebKit/mac/ForwardingHeaders/runtime/Protect.h b/WebKit/mac/ForwardingHeaders/runtime/Protect.h new file mode 100644 index 0000000..f1186aa --- /dev/null +++ b/WebKit/mac/ForwardingHeaders/runtime/Protect.h @@ -0,0 +1 @@ +#import <JavaScriptCore/Protect.h> diff --git a/WebKit/mac/ForwardingHeaders/wtf/StdLibExtras.h b/WebKit/mac/ForwardingHeaders/wtf/StdLibExtras.h new file mode 100644 index 0000000..d48b324 --- /dev/null +++ b/WebKit/mac/ForwardingHeaders/wtf/StdLibExtras.h @@ -0,0 +1 @@ +#import <JavaScriptCore/StdLibExtras.h> diff --git a/WebKit/mac/History/WebBackForwardList.h b/WebKit/mac/History/WebBackForwardList.h index c2750d2..9806a64 100644 --- a/WebKit/mac/History/WebBackForwardList.h +++ b/WebKit/mac/History/WebBackForwardList.h @@ -126,7 +126,7 @@ - (int)capacity; /*! - @method setCacpacity + @method setCapacity @abstract Sets the list's maximum size. @param size The new maximum size for the list. */ diff --git a/WebKit/mac/History/WebBackForwardList.mm b/WebKit/mac/History/WebBackForwardList.mm index 30767c3..20988b8 100644 --- a/WebKit/mac/History/WebBackForwardList.mm +++ b/WebKit/mac/History/WebBackForwardList.mm @@ -44,14 +44,18 @@ #import <WebCore/Settings.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> +#import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> #import <wtf/RetainPtr.h> +#import <wtf/StdLibExtras.h> using namespace WebCore; -static HashMap<BackForwardList*, WebBackForwardList*>& backForwardLists() +typedef HashMap<BackForwardList*, WebBackForwardList*> BackForwardListMap; + +static BackForwardListMap& backForwardLists() { - static HashMap<BackForwardList*, WebBackForwardList*> staticBackForwardLists; + DEFINE_STATIC_LOCAL(BackForwardListMap, staticBackForwardLists, ()); return staticBackForwardLists; } @@ -92,12 +96,13 @@ WebBackForwardList *kit(BackForwardList* backForwardList) @implementation WebBackForwardList -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - (id)init { diff --git a/WebKit/mac/History/WebHistory.mm b/WebKit/mac/History/WebHistory.mm index 1eedd8e..417aadb 100644 --- a/WebKit/mac/History/WebHistory.mm +++ b/WebKit/mac/History/WebHistory.mm @@ -32,13 +32,8 @@ #import "WebKitLogging.h" #import "WebNSURLExtras.h" #import "WebTypesInternal.h" -#import <Foundation/NSError.h> -#import <WebCore/Page.h> +#import <WebCore/HistoryItem.h> #import <WebCore/PageGroup.h> -#import <wtf/Assertions.h> -#import <wtf/HashMap.h> -#import <wtf/RetainPtr.h> -#import <wtf/Vector.h> using namespace WebCore; @@ -65,13 +60,16 @@ NSString *DatesArrayKey = @"WebHistoryDates"; NSMutableDictionary *_entriesByURL; DateToEntriesMap* _entriesByDate; NSMutableArray *_orderedLastVisitedDays; + WebHistoryItem *_lastVisitedEntry; BOOL itemLimitSet; int itemLimit; BOOL ageInDaysLimitSet; int ageInDaysLimit; } -- (void)addItem:(WebHistoryItem *)entry; +- (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title; + +- (BOOL)addItem:(WebHistoryItem *)entry discardDuplicate:(BOOL)discardDuplicate; - (void)addItems:(NSArray *)newEntries; - (BOOL)removeItem:(WebHistoryItem *)entry; - (BOOL)removeItems:(NSArray *)entries; @@ -82,6 +80,7 @@ NSString *DatesArrayKey = @"WebHistoryDates"; - (BOOL)containsURL:(NSURL *)URL; - (WebHistoryItem *)itemForURL:(NSURL *)URL; - (WebHistoryItem *)itemForURLString:(NSString *)URLString; +- (NSArray *)allItems; - (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error; - (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error; @@ -95,6 +94,9 @@ NSString *DatesArrayKey = @"WebHistoryDates"; - (void)addVisitedLinksToPageGroup:(PageGroup&)group; +- (WebHistoryItem *)lastVisitedEntry; +- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry; + @end @implementation WebHistoryPrivate @@ -125,6 +127,7 @@ NSString *DatesArrayKey = @"WebHistoryDates"; { [_entriesByURL release]; [_orderedLastVisitedDays release]; + [_lastVisitedEntry release]; delete _entriesByDate; [super dealloc]; } @@ -137,7 +140,7 @@ NSString *DatesArrayKey = @"WebHistoryDates"; #pragma mark MODIFYING CONTENTS -WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) +static WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) { CFTimeZoneRef timeZone = CFTimeZoneCopyDefault(); CFGregorianDate date = CFAbsoluteTimeGetGregorianDate(interval, timeZone); @@ -258,7 +261,36 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) } } -- (void)addItem:(WebHistoryItem *)entry +- (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title +{ + ASSERT(url); + ASSERT(title); + + NSString *URLString = [url _web_originalDataAsString]; + WebHistoryItem *entry = [_entriesByURL objectForKey:URLString]; + + if (entry) { + LOG(History, "Updating global history entry %@", entry); + // Remove the item from date caches before changing its last visited date. Otherwise we might get duplicate entries + // as seen in <rdar://problem/6570573>. + BOOL itemWasInDateCaches = [self removeItemFromDateCaches:entry]; + ASSERT_UNUSED(itemWasInDateCaches, itemWasInDateCaches); + + [entry _visitedWithTitle:title]; + } else { + LOG(History, "Adding new global history entry for %@", url); + entry = [[WebHistoryItem alloc] initWithURLString:URLString title:title lastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate]]; + [entry _recordInitialVisit]; + [_entriesByURL setObject:entry forKey:URLString]; + [entry release]; + } + + [self addItemToDateCaches:entry]; + + return entry; +} + +- (BOOL)addItem:(WebHistoryItem *)entry discardDuplicate:(BOOL)discardDuplicate { ASSERT_ARG(entry, entry); ASSERT_ARG(entry, [entry lastVisitedTimeInterval] != 0); @@ -267,6 +299,9 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) WebHistoryItem *oldEntry = [_entriesByURL objectForKey:URLString]; if (oldEntry) { + if (discardDuplicate) + return NO; + // The last reference to oldEntry might be this dictionary, so we hold onto a reference // until we're done with oldEntry. [oldEntry retain]; @@ -280,6 +315,8 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) [self addItemToDateCaches:entry]; [_entriesByURL setObject:entry forKey:URLString]; + + return YES; } - (BOOL)removeItem:(WebHistoryItem *)entry @@ -336,7 +373,7 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) // faster (fewer compares) by inserting them from oldest to newest. NSEnumerator *enumerator = [newEntries reverseObjectEnumerator]; while (WebHistoryItem *entry = [enumerator nextObject]) - [self addItem:entry]; + [self addItem:entry discardDuplicate:NO]; } #pragma mark DATE-BASED RETRIEVAL @@ -388,6 +425,11 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) return [self itemForURLString:[URL _web_originalDataAsString]]; } +- (NSArray *)allItems +{ + return [_entriesByURL allValues]; +} + #pragma mark ARCHIVING/UNARCHIVING - (void)setHistoryAgeInDaysLimit:(int)limit @@ -516,8 +558,8 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) if (ageLimitPassed || itemLimitPassed) [discardedItems addObject:item]; else { - [self addItem:item]; - ++(*numberOfItemsLoaded); + if ([self addItem:item discardDuplicate:YES]) + ++(*numberOfItemsLoaded); if (*numberOfItemsLoaded == itemCountLimit) itemLimitPassed = YES; @@ -606,6 +648,19 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) } } +- (WebHistoryItem *)lastVisitedEntry +{ + return _lastVisitedEntry; +} + +- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry +{ + if (_lastVisitedEntry == lastVisitedEntry) + return; + [_lastVisitedEntry release]; + _lastVisitedEntry = [lastVisitedEntry retain]; +} + @end @implementation WebHistory @@ -661,11 +716,9 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) - (void)removeAllItems { - if ([_historyPrivate removeAllItems]) { - [[NSNotificationCenter defaultCenter] - postNotificationName:WebHistoryAllItemsRemovedNotification - object:self]; - } + NSArray *entries = [_historyPrivate allItems]; + if ([_historyPrivate removeAllItems]) + [self _sendNotification:WebHistoryAllItemsRemovedNotification entries:entries]; } - (void)addItems:(NSArray *)newEntries @@ -759,21 +812,46 @@ WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) return [_historyPrivate itemForURLString:URLString]; } +- (NSArray *)allItems +{ + return [_historyPrivate allItems]; +} + @end @implementation WebHistory (WebInternal) -- (void)_addItemForURL:(NSURL *)URL title:(NSString *)title +- (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure serverRedirectURL:(NSString *)serverRedirectURL isClientRedirect:(BOOL)isClientRedirect { - WebHistoryItem *entry = [[WebHistoryItem alloc] initWithURL:URL title:title]; - [entry _setLastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate]]; + if (isClientRedirect) { + ASSERT(!serverRedirectURL); + if (WebHistoryItem *lastVisitedEntry = [_historyPrivate lastVisitedEntry]) + core(lastVisitedEntry)->addRedirectURL([url _web_originalDataAsString]); + } - LOG(History, "adding %@", entry); - [_historyPrivate addItem:entry]; - [self _sendNotification:WebHistoryItemsAddedNotification - entries:[NSArray arrayWithObject:entry]]; - - [entry release]; + WebHistoryItem *entry = [_historyPrivate visitedURL:url withTitle:title]; + [_historyPrivate setLastVisitedEntry:entry]; + + HistoryItem* item = core(entry); + item->setLastVisitWasFailure(wasFailure); + + if ([method length]) + item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"]); + + if (serverRedirectURL) { + ASSERT(!isClientRedirect); + item->addRedirectURL(serverRedirectURL); + } + + NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil]; + [self _sendNotification:WebHistoryItemsAddedNotification entries:entries]; + [entries release]; +} + +- (void)_visitedURLForRedirectWithoutHistoryItem:(NSURL *)url +{ + if (WebHistoryItem *lastVisitedEntry = [_historyPrivate lastVisitedEntry]) + core(lastVisitedEntry)->addRedirectURL([url _web_originalDataAsString]); } - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group diff --git a/WebKit/mac/History/WebHistoryInternal.h b/WebKit/mac/History/WebHistoryInternal.h index fa8fc7c..9e69734 100644 --- a/WebKit/mac/History/WebHistoryInternal.h +++ b/WebKit/mac/History/WebHistoryInternal.h @@ -33,6 +33,7 @@ namespace WebCore { } @interface WebHistory (WebInternal) -- (void)_addItemForURL:(NSURL *)URL title:(NSString *)title; +- (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure serverRedirectURL:(NSString *)serverRedirectURL isClientRedirect:(BOOL)isClientRedirect; +- (void)_visitedURLForRedirectWithoutHistoryItem:(NSURL *)url; - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group; @end diff --git a/WebKit/mac/History/WebHistoryItem.mm b/WebKit/mac/History/WebHistoryItem.mm index 4d4f924..1d2de1d 100644 --- a/WebKit/mac/History/WebHistoryItem.mm +++ b/WebKit/mac/History/WebHistoryItem.mm @@ -35,6 +35,7 @@ #import "WebIconDatabase.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" +#import "WebNSArrayExtras.h" #import "WebNSDictionaryExtras.h" #import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" @@ -42,7 +43,6 @@ #import "WebNSViewExtras.h" #import "WebPluginController.h" #import "WebTypesInternal.h" -#import <WebCore/CachedPage.h> #import <WebCore/HistoryItem.h> #import <WebCore/Image.h> #import <WebCore/KURL.h> @@ -50,27 +50,37 @@ #import <WebCore/PlatformString.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> +#import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> +#import <wtf/StdLibExtras.h> // Private keys used in the WebHistoryItem's dictionary representation. // see 3245793 for explanation of "lastVisitedDate" -static NSString *WebLastVisitedTimeIntervalKey = @"lastVisitedDate"; -static NSString *WebVisitCountKey = @"visitCount"; -static NSString *WebTitleKey = @"title"; -static NSString *WebChildrenKey = @"children"; -static NSString *WebDisplayTitleKey = @"displayTitle"; +static NSString *lastVisitedTimeIntervalKey = @"lastVisitedDate"; +static NSString *visitCountKey = @"visitCount"; +static NSString *titleKey = @"title"; +static NSString *childrenKey = @"children"; +static NSString *displayTitleKey = @"displayTitle"; +static NSString *lastVisitWasFailureKey = @"lastVisitWasFailure"; +static NSString *lastVisitWasHTTPNonGetKey = @"lastVisitWasHTTPNonGet"; +static NSString *redirectURLsKey = @"redirectURLs"; +static NSString *dailyVisitCountKey = @"D"; // short key to save space +static NSString *weeklyVisitCountKey = @"W"; // short key to save space // Notification strings. NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotification"; using namespace WebCore; +using namespace std; + +typedef HashMap<HistoryItem*, WebHistoryItem*> HistoryItemMap; static inline WebHistoryItemPrivate* kitPrivate(WebCoreHistoryItem* list) { return (WebHistoryItemPrivate*)list; } static inline WebCoreHistoryItem* core(WebHistoryItemPrivate* list) { return (WebCoreHistoryItem*)list; } -HashMap<HistoryItem*, WebHistoryItem*>& historyItemWrappers() +static HistoryItemMap& historyItemWrappers() { - static HashMap<HistoryItem*, WebHistoryItem*> historyItemWrappers; + DEFINE_STATIC_LOCAL(HistoryItemMap, historyItemWrappers, ()); return historyItemWrappers; } @@ -82,12 +92,13 @@ void WKNotifyHistoryItemChanged() @implementation WebHistoryItem -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - (id)init { @@ -329,14 +340,14 @@ static WebWindowWatcher *_windowWatcher = nil; { ASSERT_MAIN_THREAD(); NSString *URLString = [dict _webkit_stringForKey:@""]; - NSString *title = [dict _webkit_stringForKey:WebTitleKey]; + NSString *title = [dict _webkit_stringForKey:titleKey]; // Do an existence check to avoid calling doubleValue on a nil string. Leave // time interval at 0 if there's no value in dict. - NSString *timeIntervalString = [dict _webkit_stringForKey:WebLastVisitedTimeIntervalKey]; + NSString *timeIntervalString = [dict _webkit_stringForKey:lastVisitedTimeIntervalKey]; NSTimeInterval lastVisited = timeIntervalString == nil ? 0 : [timeIntervalString doubleValue]; - self = [self initWithURLString:URLString title:title displayTitle:[dict _webkit_stringForKey:WebDisplayTitleKey] lastVisitedTimeInterval:lastVisited]; + self = [self initWithURLString:URLString title:title displayTitle:[dict _webkit_stringForKey:displayTitleKey] lastVisitedTimeInterval:lastVisited]; // Check if we've read a broken URL from the file that has non-Latin1 chars. If so, try to convert // as if it was from user typing. @@ -348,12 +359,50 @@ static WebWindowWatcher *_windowWatcher = nil; core(_private)->setOriginalURLString(newURLString); } - core(_private)->setVisitCount([dict _webkit_intForKey:WebVisitCountKey]); + int visitCount = [dict _webkit_intForKey:visitCountKey]; + + // Can't trust data on disk, and we've had at least one report of this (<rdar://6572300>). + if (visitCount < 0) { + LOG_ERROR("visit count for history item \"%@\" is negative (%d), will be reset to 1", URLString, visitCount); + visitCount = 1; + } + core(_private)->setVisitCount(visitCount); + + if ([dict _webkit_boolForKey:lastVisitWasFailureKey]) + core(_private)->setLastVisitWasFailure(true); + + BOOL lastVisitWasHTTPNonGet = [dict _webkit_boolForKey:lastVisitWasHTTPNonGetKey]; + NSString *tempURLString = [URLString lowercaseString]; + if (lastVisitWasHTTPNonGet && ([tempURLString hasPrefix:@"http:"] || [tempURLString hasPrefix:@"https:"])) + core(_private)->setLastVisitWasHTTPNonGet(lastVisitWasHTTPNonGet); + + if (NSArray *redirectURLs = [dict _webkit_arrayForKey:redirectURLsKey]) { + NSUInteger size = [redirectURLs count]; + std::auto_ptr<Vector<String> > redirectURLsVector(new Vector<String>(size)); + for (NSUInteger i = 0; i < size; ++i) + (*redirectURLsVector)[i] = String([redirectURLs _webkit_stringAtIndex:i]); + core(_private)->setRedirectURLs(redirectURLsVector); + } - NSArray *childDicts = [dict objectForKey:WebChildrenKey]; + NSArray *dailyCounts = [dict _webkit_arrayForKey:dailyVisitCountKey]; + NSArray *weeklyCounts = [dict _webkit_arrayForKey:weeklyVisitCountKey]; + if (dailyCounts || weeklyCounts) { + Vector<int> coreDailyCounts([dailyCounts count]); + Vector<int> coreWeeklyCounts([weeklyCounts count]); + + // Daily and weekly counts < 0 are errors in the data read from disk, so reset to 0. + for (size_t i = 0; i < coreDailyCounts.size(); ++i) + coreDailyCounts[i] = max([[dailyCounts _webkit_numberAtIndex:i] intValue], 0); + for (size_t i = 0; i < coreWeeklyCounts.size(); ++i) + coreWeeklyCounts[i] = max([[weeklyCounts _webkit_numberAtIndex:i] intValue], 0); + + core(_private)->adoptVisitCounts(coreDailyCounts, coreWeeklyCounts); + } + + NSArray *childDicts = [dict objectForKey:childrenKey]; if (childDicts) { - for (int i = [childDicts count]; i >= 0; i--) { - WebHistoryItem *child = [[WebHistoryItem alloc] initFromDictionaryRepresentation: [childDicts objectAtIndex:i]]; + for (int i = [childDicts count] - 1; i >= 0; i--) { + WebHistoryItem *child = [[WebHistoryItem alloc] initFromDictionaryRepresentation:[childDicts objectAtIndex:i]]; core(_private)->addChildItem(core(child->_private)); [child release]; } @@ -368,6 +417,21 @@ static WebWindowWatcher *_windowWatcher = nil; return core(_private)->scrollPoint(); } +- (void)_visitedWithTitle:(NSString *)title +{ + core(_private)->visited(title, [NSDate timeIntervalSinceReferenceDate]); +} + +- (void)_setVisitCount:(int)count +{ + core(_private)->setVisitCount(count); +} + +- (void)_recordInitialVisit +{ + core(_private)->recordInitialVisit(); +} + @end @implementation WebHistoryItem (WebPrivate) @@ -380,34 +444,64 @@ static WebWindowWatcher *_windowWatcher = nil; - (NSDictionary *)dictionaryRepresentation { ASSERT_MAIN_THREAD(); - NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:6]; + NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:8]; HistoryItem* coreItem = core(_private); - if (!coreItem->urlString().isEmpty()) { + if (!coreItem->urlString().isEmpty()) [dict setObject:(NSString*)coreItem->urlString() forKey:@""]; - } - if (!coreItem->title().isEmpty()) { - [dict setObject:(NSString*)coreItem->title() forKey:WebTitleKey]; - } - if (!coreItem->alternateTitle().isEmpty()) { - [dict setObject:(NSString*)coreItem->alternateTitle() forKey:WebDisplayTitleKey]; - } + if (!coreItem->title().isEmpty()) + [dict setObject:(NSString*)coreItem->title() forKey:titleKey]; + if (!coreItem->alternateTitle().isEmpty()) + [dict setObject:(NSString*)coreItem->alternateTitle() forKey:displayTitleKey]; if (coreItem->lastVisitedTime() != 0.0) { - // store as a string to maintain backward compatibility (see 3245793) + // Store as a string to maintain backward compatibility. (See 3245793) [dict setObject:[NSString stringWithFormat:@"%.1lf", coreItem->lastVisitedTime()] - forKey:WebLastVisitedTimeIntervalKey]; + forKey:lastVisitedTimeIntervalKey]; + } + if (coreItem->visitCount()) + [dict setObject:[NSNumber numberWithInt:coreItem->visitCount()] forKey:visitCountKey]; + if (coreItem->lastVisitWasFailure()) + [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasFailureKey]; + if (coreItem->lastVisitWasHTTPNonGet()) { + ASSERT(coreItem->urlString().startsWith("http:", false) || coreItem->urlString().startsWith("https:", false)); + [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasHTTPNonGetKey]; } - if (coreItem->visitCount()) { - [dict setObject:[NSNumber numberWithInt:coreItem->visitCount()] forKey:WebVisitCountKey]; + if (Vector<String>* redirectURLs = coreItem->redirectURLs()) { + size_t size = redirectURLs->size(); + ASSERT(size); + NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:size]; + for (size_t i = 0; i < size; ++i) + [result addObject:(NSString*)redirectURLs->at(i)]; + [dict setObject:result forKey:redirectURLsKey]; + [result release]; } + + const Vector<int>& dailyVisitCounts = coreItem->dailyVisitCounts(); + if (dailyVisitCounts.size()) { + NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:13]; + for (size_t i = 0; i < dailyVisitCounts.size(); ++i) + [array addObject:[NSNumber numberWithInt:dailyVisitCounts[i]]]; + [dict setObject:array forKey:dailyVisitCountKey]; + [array release]; + } + + const Vector<int>& weeklyVisitCounts = coreItem->weeklyVisitCounts(); + if (weeklyVisitCounts.size()) { + NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:5]; + for (size_t i = 0; i < weeklyVisitCounts.size(); ++i) + [array addObject:[NSNumber numberWithInt:weeklyVisitCounts[i]]]; + [dict setObject:array forKey:weeklyVisitCountKey]; + [array release]; + } + if (coreItem->children().size()) { const HistoryItemVector& children = coreItem->children(); NSMutableArray *childDicts = [NSMutableArray arrayWithCapacity:children.size()]; - for (int i = children.size(); i >= 0; i--) + for (int i = children.size() - 1; i >= 0; i--) [childDicts addObject:[kit(children[i].get()) dictionaryRepresentation]]; - [dict setObject: childDicts forKey:WebChildrenKey]; + [dict setObject: childDicts forKey:childrenKey]; } return dict; @@ -432,12 +526,12 @@ static WebWindowWatcher *_windowWatcher = nil; - (NSString *)RSSFeedReferrer { - return nsStringNilIfEmpty(core(_private)->rssFeedReferrer()); + return nsStringNilIfEmpty(core(_private)->referrer()); } - (void)setRSSFeedReferrer:(NSString *)referrer { - core(_private)->setRSSFeedReferrer(referrer); + core(_private)->setReferrer(referrer); } - (NSArray *)children @@ -509,6 +603,49 @@ static WebWindowWatcher *_windowWatcher = nil; core(_private)->setTransientProperty(key, property); } +- (BOOL)lastVisitWasFailure +{ + return core(_private)->lastVisitWasFailure(); +} + +- (void)_setLastVisitWasFailure:(BOOL)failure +{ + core(_private)->setLastVisitWasFailure(failure); +} + +- (BOOL)_lastVisitWasHTTPNonGet +{ + return core(_private)->lastVisitWasHTTPNonGet(); +} + +- (NSArray *)_redirectURLs +{ + Vector<String>* redirectURLs = core(_private)->redirectURLs(); + if (!redirectURLs) + return nil; + + size_t size = redirectURLs->size(); + ASSERT(size); + NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:size]; + for (size_t i = 0; i < size; ++i) + [result addObject:(NSString*)redirectURLs->at(i)]; + return [result autorelease]; +} + +- (size_t)_getDailyVisitCounts:(const int**)counts +{ + HistoryItem* coreItem = core(_private); + *counts = coreItem->dailyVisitCounts().data(); + return coreItem->dailyVisitCounts().size(); +} + +- (size_t)_getWeeklyVisitCounts:(const int**)counts +{ + HistoryItem* coreItem = core(_private); + *counts = coreItem->weeklyVisitCounts().data(); + return coreItem->weeklyVisitCounts().size(); +} + @end diff --git a/WebKit/mac/History/WebHistoryItemInternal.h b/WebKit/mac/History/WebHistoryItemInternal.h index 2592ff8..74a8074 100644 --- a/WebKit/mac/History/WebHistoryItemInternal.h +++ b/WebKit/mac/History/WebHistoryItemInternal.h @@ -26,9 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import "WebBackForwardList.h" #import "WebHistoryItemPrivate.h" - -#import <wtf/PassRefPtr.h> +#import <wtf/Forward.h> namespace WebCore { class HistoryItem; @@ -51,6 +51,9 @@ extern void WKNotifyHistoryItemChanged(); - (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem; - (void)setTitle:(NSString *)title; +- (void)_visitedWithTitle:(NSString *)title; +- (void)_setVisitCount:(int)count; +- (void)_recordInitialVisit; @end diff --git a/WebKit/mac/History/WebHistoryItemPrivate.h b/WebKit/mac/History/WebHistoryItemPrivate.h index bc75d1b..0c079a7 100644 --- a/WebKit/mac/History/WebHistoryItemPrivate.h +++ b/WebKit/mac/History/WebHistoryItemPrivate.h @@ -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 @@ -26,23 +26,27 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import <Cocoa/Cocoa.h> - -#import <WebKit/WebBackForwardList.h> #import <WebKit/WebHistoryItem.h> @interface WebHistoryItem (WebPrivate) + + (void)_releaseAllPendingPageCaches; - (id)initWithURL:(NSURL *)URL title:(NSString *)title; - (NSURL *)URL; - (int)visitCount; +- (BOOL)lastVisitWasFailure; +- (void)_setLastVisitWasFailure:(BOOL)failure; + +- (BOOL)_lastVisitWasHTTPNonGet; - (NSString *)RSSFeedReferrer; - (void)setRSSFeedReferrer:(NSString *)referrer; - (NSCalendarDate *)_lastVisitedDate; +- (NSArray *)_redirectURLs; + - (WebHistoryItem *)targetItem; - (NSString *)target; - (BOOL)isTargetItem; @@ -57,4 +61,7 @@ - (id)_transientPropertyForKey:(NSString *)key; - (void)_setTransientProperty:(id)property forKey:(NSString *)key; +- (size_t)_getDailyVisitCounts:(const int**)counts; +- (size_t)_getWeeklyVisitCounts:(const int**)counts; + @end diff --git a/WebKit/mac/History/WebHistoryPrivate.h b/WebKit/mac/History/WebHistoryPrivate.h index 587783c..c7d6a1b 100644 --- a/WebKit/mac/History/WebHistoryPrivate.h +++ b/WebKit/mac/History/WebHistoryPrivate.h @@ -41,4 +41,10 @@ extern NSString *WebHistoryItemsDiscardedWhileLoadingNotification; // FIXME: The following SPI is used by Safari. Should it be made into public API? - (WebHistoryItem *)_itemForURLString:(NSString *)URLString; +/*! + @method allItems + @result Returns an array of all WebHistoryItems in WebHistory, in an undefined order. +*/ +- (NSArray *)allItems; + @end diff --git a/WebKit/mac/Info.plist b/WebKit/mac/Info.plist index e72ea0d..849742c 100644 --- a/WebKit/mac/Info.plist +++ b/WebKit/mac/Info.plist @@ -7,7 +7,7 @@ <key>CFBundleExecutable</key> <string>${PRODUCT_NAME}</string> <key>CFBundleGetInfoString</key> - <string>${BUNDLE_VERSION}, Copyright 2003-2007 Apple Inc.</string> + <string>${BUNDLE_VERSION}, Copyright 2003-2009 Apple Inc.</string> <key>CFBundleIdentifier</key> <string>com.apple.${PRODUCT_NAME}</string> <key>CFBundleInfoDictionaryVersion</key> diff --git a/WebKit/mac/Misc/WebCache.mm b/WebKit/mac/Misc/WebCache.mm index d3dfbdb..a60159f 100644 --- a/WebKit/mac/Misc/WebCache.mm +++ b/WebKit/mac/Misc/WebCache.mm @@ -78,6 +78,26 @@ #endif [NSNumber numberWithInt:s.scripts.decodedSize], @"JavaScript", nil], + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:s.images.purgeableSize], @"Images", + [NSNumber numberWithInt:s.cssStyleSheets.purgeableSize] ,@"CSS", +#if ENABLE(XSLT) + [NSNumber numberWithInt:s.xslStyleSheets.purgeableSize], @"XSL", +#else + [NSNumber numberWithInt:0], @"XSL", +#endif + [NSNumber numberWithInt:s.scripts.purgeableSize], @"JavaScript", + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:s.images.purgedSize], @"Images", + [NSNumber numberWithInt:s.cssStyleSheets.purgedSize] ,@"CSS", +#if ENABLE(XSLT) + [NSNumber numberWithInt:s.xslStyleSheets.purgedSize], @"XSL", +#else + [NSNumber numberWithInt:0], @"XSL", +#endif + [NSNumber numberWithInt:s.scripts.purgedSize], @"JavaScript", + nil], nil]; } diff --git a/WebKit/mac/Misc/WebCoreStatistics.h b/WebKit/mac/Misc/WebCoreStatistics.h index 392f31b..a7f3fa5 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.h +++ b/WebKit/mac/Misc/WebCoreStatistics.h @@ -61,6 +61,9 @@ + (void)startIgnoringWebCoreNodeLeaks; + (void)stopIgnoringWebCoreNodeLeaks; ++ (NSDictionary *)memoryStatistics; ++ (void)returnFreeMemoryToSystem; + // Deprecated, but used by older versions of Safari. + (void)emptyCache; + (void)setCacheDisabled:(BOOL)disabled; diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm index ecbfe9d..05c2659 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.mm +++ b/WebKit/mac/Misc/WebCoreStatistics.mm @@ -54,7 +54,7 @@ using namespace WebCore; + (size_t)javaScriptObjectsCount { JSLock lock(false); - return JSDOMWindow::commonJSGlobalData()->heap.size(); + return JSDOMWindow::commonJSGlobalData()->heap.objectCount(); } + (size_t)javaScriptGlobalObjectsCount @@ -122,17 +122,17 @@ using namespace WebCore; + (size_t)cachedFontDataCount { - return FontCache::fontDataCount(); + return fontCache()->fontDataCount(); } + (size_t)cachedFontDataInactiveCount { - return FontCache::inactiveFontDataCount(); + return fontCache()->inactiveFontDataCount(); } + (void)purgeInactiveFontData { - FontCache::purgeInactiveFontData(); + fontCache()->purgeInactiveFontData(); } + (size_t)glyphPageCount @@ -167,11 +167,31 @@ using namespace WebCore; WebCore::Node::startIgnoringLeaks(); } -+ (void)stopIgnoringWebCoreNodeLeaks; ++ (void)stopIgnoringWebCoreNodeLeaks { WebCore::Node::stopIgnoringLeaks(); } ++ (NSDictionary *)memoryStatistics +{ + WTF::FastMallocStatistics fastMallocStatistics = WTF::fastMallocStatistics(); + JSLock lock(false); + Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics(); + return [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:fastMallocStatistics.heapSize], @"FastMallocHeapSize", + [NSNumber numberWithInt:fastMallocStatistics.freeSizeInHeap], @"FastMallocFreeSizeInHeap", + [NSNumber numberWithInt:fastMallocStatistics.freeSizeInCaches], @"FastMallocFreeSizeInCaches", + [NSNumber numberWithInt:fastMallocStatistics.returnedSize], @"FastMallocReturnedSize", + [NSNumber numberWithInt:jsHeapStatistics.size], @"JavaScriptHeapSize", + [NSNumber numberWithInt:jsHeapStatistics.free], @"JavaScriptFreeSize", + nil]; +} + ++ (void)returnFreeMemoryToSystem +{ + WTF::releaseFastMallocFreeMemory(); +} + // Deprecated + (size_t)javaScriptNoGCAllowedObjectsCount { diff --git a/WebKit/mac/Misc/WebElementDictionary.mm b/WebKit/mac/Misc/WebElementDictionary.mm index b987525..db7b5f4 100644 --- a/WebKit/mac/Misc/WebElementDictionary.mm +++ b/WebKit/mac/Misc/WebElementDictionary.mm @@ -41,6 +41,7 @@ #import <WebCore/WebCoreObjCExtras.h> #import <WebKit/DOMCore.h> #import <WebKit/DOMExtensions.h> +#import <runtime/InitializeThreading.h> using namespace WebCore; @@ -59,12 +60,13 @@ static void cacheValueForKey(const void *key, const void *value, void *self) @implementation WebElementDictionary -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} + (void)initializeLookupTable { diff --git a/WebKit/mac/Misc/WebIconDatabase.mm b/WebKit/mac/Misc/WebIconDatabase.mm index d911f0c..3b42406 100644 --- a/WebKit/mac/Misc/WebIconDatabase.mm +++ b/WebKit/mac/Misc/WebIconDatabase.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,7 +37,6 @@ #import "WebNSURLExtras.h" #import "WebPreferences.h" #import "WebTypesInternal.h" -#import <WebCore/FoundationExtras.h> #import <WebCore/IconDatabase.h> #import <WebCore/Image.h> #import <WebCore/IntSize.h> @@ -71,7 +70,6 @@ static WebIconDatabaseClient* defaultClient() } @interface WebIconDatabase (WebReallyInternal) -- (BOOL)_isEnabled; - (void)_sendNotificationForURL:(NSString *)URL; - (void)_sendDidRemoveAllIconsNotification; - (NSImage *)_iconForFileURL:(NSString *)fileURL withSize:(NSSize)size; @@ -109,37 +107,8 @@ static WebIconDatabaseClient* defaultClient() [initialDefaults release]; BOOL enabled = [defaults boolForKey:WebIconDatabaseEnabledDefaultsKey]; iconDatabase()->setEnabled(enabled); - if (!enabled) - return self; - iconDatabase()->setClient(defaultClient()); - - // Figure out the directory we should be using for the icon.db - NSString *databaseDirectory = [self _databaseDirectory]; - - // Rename legacy icon database files to the new icon database name - BOOL isDirectory = NO; - NSString *legacyDB = [databaseDirectory stringByAppendingPathComponent:@"icon.db"]; - NSFileManager *defaultManager = [NSFileManager defaultManager]; - if ([defaultManager fileExistsAtPath:legacyDB isDirectory:&isDirectory] && !isDirectory) { - NSString *newDB = [databaseDirectory stringByAppendingPathComponent:iconDatabase()->defaultDatabaseFilename()]; - if (![defaultManager fileExistsAtPath:newDB]) - rename([legacyDB fileSystemRepresentation], [newDB fileSystemRepresentation]); - } - - // Set the private browsing pref then open the WebCore icon database - iconDatabase()->setPrivateBrowsingEnabled([[WebPreferences standardPreferences] privateBrowsingEnabled]); - if (!iconDatabase()->open(databaseDirectory)) - LOG_ERROR("Unable to open icon database"); - - // Register for important notifications - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(_applicationWillTerminate:) - name:NSApplicationWillTerminateNotification - object:NSApp]; - [[NSNotificationCenter defaultCenter] - addObserver:self selector:@selector(_resetCachedWebPreferences:) - name:WebPreferencesChangedNotification object:nil]; - + if (enabled) + [self _startUpIconDatabase]; return self; } @@ -149,7 +118,7 @@ static WebIconDatabaseClient* defaultClient() ASSERT(size.width); ASSERT(size.height); - if (!URL || ![self _isEnabled]) + if (!URL || ![self isEnabled]) return [self defaultIconForURL:URL withSize:size]; // FIXME - <rdar://problem/4697934> - Move the handling of FileURLs to WebCore and implement in ObjC++ @@ -169,7 +138,7 @@ static WebIconDatabaseClient* defaultClient() - (NSString *)iconURLForURL:(NSString *)URL { - if (![self _isEnabled]) + if (![self isEnabled]) return nil; ASSERT_MAIN_THREAD(); @@ -197,7 +166,7 @@ static WebIconDatabaseClient* defaultClient() { ASSERT_MAIN_THREAD(); ASSERT(URL); - if (![self _isEnabled]) + if (![self isEnabled]) return; iconDatabase()->retainIconForPageURL(URL); @@ -207,7 +176,7 @@ static WebIconDatabaseClient* defaultClient() { ASSERT_MAIN_THREAD(); ASSERT(pageURL); - if (![self _isEnabled]) + if (![self isEnabled]) return; iconDatabase()->releaseIconForPageURL(pageURL); @@ -243,10 +212,27 @@ static WebIconDatabaseClient* defaultClient() @implementation WebIconDatabase (WebPendingPublic) +- (BOOL)isEnabled +{ + return iconDatabase()->isEnabled(); +} + +- (void)setEnabled:(BOOL)flag +{ + BOOL currentlyEnabled = [self isEnabled]; + if (currentlyEnabled && !flag) { + iconDatabase()->setEnabled(false); + [self _shutDownIconDatabase]; + } else if (!currentlyEnabled && flag) { + iconDatabase()->setEnabled(true); + [self _startUpIconDatabase]; + } +} + - (void)removeAllIcons { ASSERT_MAIN_THREAD(); - if (![self _isEnabled]) + if (![self isEnabled]) return; // Via the IconDatabaseClient interface, removeAllIcons() will send the WebIconDatabaseDidRemoveAllIconsNotification @@ -266,11 +252,6 @@ static WebIconDatabaseClient* defaultClient() @implementation WebIconDatabase (WebInternal) -- (BOOL)_isEnabled -{ - return iconDatabase()->isEnabled(); -} - - (void)_sendNotificationForURL:(NSString *)URL { ASSERT(URL); @@ -290,6 +271,50 @@ static WebIconDatabaseClient* defaultClient() userInfo:nil]; } +- (void)_startUpIconDatabase +{ + iconDatabase()->setClient(defaultClient()); + + // Figure out the directory we should be using for the icon.db + NSString *databaseDirectory = [self _databaseDirectory]; + + // Rename legacy icon database files to the new icon database name + BOOL isDirectory = NO; + NSString *legacyDB = [databaseDirectory stringByAppendingPathComponent:@"icon.db"]; + NSFileManager *defaultManager = [NSFileManager defaultManager]; + if ([defaultManager fileExistsAtPath:legacyDB isDirectory:&isDirectory] && !isDirectory) { + NSString *newDB = [databaseDirectory stringByAppendingPathComponent:iconDatabase()->defaultDatabaseFilename()]; + if (![defaultManager fileExistsAtPath:newDB]) + rename([legacyDB fileSystemRepresentation], [newDB fileSystemRepresentation]); + } + + // Set the private browsing pref then open the WebCore icon database + iconDatabase()->setPrivateBrowsingEnabled([[WebPreferences standardPreferences] privateBrowsingEnabled]); + if (!iconDatabase()->open(databaseDirectory)) + LOG_ERROR("Unable to open icon database"); + + // Register for important notifications + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(_applicationWillTerminate:) + name:NSApplicationWillTerminateNotification + object:NSApp]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(_resetCachedWebPreferences:) + name:WebPreferencesChangedNotification + object:nil]; +} + +- (void)_shutDownIconDatabase +{ + // Unregister for important notifications + [[NSNotificationCenter defaultCenter] removeObserver:self + name:NSApplicationWillTerminateNotification + object:NSApp]; + [[NSNotificationCenter defaultCenter] removeObserver:self + name:WebPreferencesChangedNotification + object:nil]; +} + - (void)_applicationWillTerminate:(NSNotification *)notification { iconDatabase()->close(); diff --git a/WebKit/mac/Misc/WebIconDatabaseInternal.h b/WebKit/mac/Misc/WebIconDatabaseInternal.h index b7b01ec..6c0ae50 100644 --- a/WebKit/mac/Misc/WebIconDatabaseInternal.h +++ b/WebKit/mac/Misc/WebIconDatabaseInternal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +43,8 @@ namespace WebCore { @interface WebIconDatabase (WebInternal) - (void)_sendNotificationForURL:(NSString *)URL; - (void)_sendDidRemoveAllIconsNotification; +- (void)_shutDownIconDatabase; +- (void)_startUpIconDatabase; @end extern bool importToWebCoreFormat(); diff --git a/WebKit/mac/Misc/WebIconDatabasePrivate.h b/WebKit/mac/Misc/WebIconDatabasePrivate.h index aff923e..8fba88b 100644 --- a/WebKit/mac/Misc/WebIconDatabasePrivate.h +++ b/WebKit/mac/Misc/WebIconDatabasePrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,7 +43,21 @@ extern NSString *WebIconDatabaseImportDirectoryDefaultsKey; @interface WebIconDatabase (WebPendingPublic) /*! - @method removeAllIcons: + @method isEnabled + @discussion Returns true if the icon database is currently enabled, or false if it + is disabled. +*/ +- (BOOL)isEnabled; + +/*! + @method setEnabled: + @discussion Enables or disables the icon database based on the flag passed in. + @param flag Pass true to enable the icon database, or false to disable it. +*/ +- (void)setEnabled:(BOOL)flag; + +/*! + @method removeAllIcons @discussion Causes the icon database to delete all of the images that it has stored, and to send out the notification WebIconDatabaseDidRemoveAllIconsNotification. */ diff --git a/WebKit/mac/Misc/WebKitErrors.m b/WebKit/mac/Misc/WebKitErrors.m index fc739ba..5985d9a 100644 --- a/WebKit/mac/Misc/WebKitErrors.m +++ b/WebKit/mac/Misc/WebKitErrors.m @@ -41,14 +41,14 @@ NSString * const WebKitErrorPlugInNameKey = @"WebKitErrorPlugInNameK NSString * const WebKitErrorPlugInPageURLStringKey = @"WebKitErrorPlugInPageURLStringKey"; // Policy errors -#define WebKitErrorDescriptionCannotShowMIMEType UI_STRING("Cannot show content with specified mime type", "WebKitErrorCannotShowMIMEType description") -#define WebKitErrorDescriptionCannotShowURL UI_STRING("Cannot show URL", "WebKitErrorCannotShowURL description") +#define WebKitErrorDescriptionCannotShowMIMEType UI_STRING("Content with specified MIME type can’t be shown", "WebKitErrorCannotShowMIMEType description") +#define WebKitErrorDescriptionCannotShowURL UI_STRING("The URL can’t be shown", "WebKitErrorCannotShowURL description") #define WebKitErrorDescriptionFrameLoadInterruptedByPolicyChange UI_STRING("Frame load interrupted", "WebKitErrorFrameLoadInterruptedByPolicyChange description") #define WebKitErrorDescriptionCannotUseRestrictedPort UI_STRING("Not allowed to use restricted network port", "WebKitErrorCannotUseRestrictedPort description") // Plug-in and java errors -#define WebKitErrorDescriptionCannotFindPlugin UI_STRING("Cannot find plug-in", "WebKitErrorCannotFindPlugin description") -#define WebKitErrorDescriptionCannotLoadPlugin UI_STRING("Cannot load plug-in", "WebKitErrorCannotLoadPlugin description") +#define WebKitErrorDescriptionCannotFindPlugin UI_STRING("The plug-in can’t be found", "WebKitErrorCannotFindPlugin description") +#define WebKitErrorDescriptionCannotLoadPlugin UI_STRING("The plug-in can’t be loaded", "WebKitErrorCannotLoadPlugin description") #define WebKitErrorDescriptionJavaUnavailable UI_STRING("Java is unavailable", "WebKitErrorJavaUnavailable description") #define WebKitErrorDescriptionPlugInCancelledConnection UI_STRING("Plug-in cancelled", "WebKitErrorPlugInCancelledConnection description") #define WebKitErrorDescriptionPlugInWillHandleLoad UI_STRING("Plug-in handled load", "WebKitErrorPlugInWillHandleLoad description") diff --git a/WebKit/mac/Misc/WebKitLogging.h b/WebKit/mac/Misc/WebKitLogging.h index dc37dbf..f71f730 100644 --- a/WebKit/mac/Misc/WebKitLogging.h +++ b/WebKit/mac/Misc/WebKitLogging.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2007 Apple 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 @@ -63,13 +63,11 @@ extern WTFLogChannel WebKitLogTextInput; void WebKitInitializeLoggingChannelsIfNecessary(void); -BOOL WebKitRunningOnMainThread(void); - -// The ASSERT_MAIN_THREAD() check should be on by default in DEBUG builds -// To disable it, even in a debug build, define DISABLE_THREAD_CHECK in your project file (or elsewhere globally) +// FIXME: Why is this in the "logging" header file? +// Use WebCoreThreadViolationCheck instead for checks that throw an exception even in production builds. #if !defined(NDEBUG) && !defined(DISABLE_THREAD_CHECK) #define ASSERT_MAIN_THREAD() do \ - if (!WebKitRunningOnMainThread()) { \ + if (!pthread_main_np()) { \ WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "<not running on main thread>"); \ CRASH(); \ } \ diff --git a/WebKit/mac/Misc/WebKitLogging.m b/WebKit/mac/Misc/WebKitLogging.m index 4e4294f..72a822f 100644 --- a/WebKit/mac/Misc/WebKitLogging.m +++ b/WebKit/mac/Misc/WebKitLogging.m @@ -99,11 +99,6 @@ void WebKitInitializeLoggingChannelsIfNecessary() initializeLogChannel(&WebKitLogTextInput); } -BOOL WebKitRunningOnMainThread() -{ - return pthread_main_np() != 0; -} - void ReportDiscardedDelegateException(SEL delegateSelector, id exception) { if ([exception isKindOfClass:[NSException class]]) diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.m b/WebKit/mac/Misc/WebKitNSStringExtras.m index 157069a..2e75e9e 100644 --- a/WebKit/mac/Misc/WebKitNSStringExtras.m +++ b/WebKit/mac/Misc/WebKitNSStringExtras.m @@ -140,58 +140,12 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length) + (NSStringEncoding)_web_encodingForResource:(Handle)resource { - short resRef = HomeResFile(resource); - if (ResError() != noErr) { - return NSMacOSRomanStringEncoding; - } - - // Get the FSRef for the current resource file - FSRef fref; - OSStatus error = FSGetForkCBInfo(resRef, 0, NULL, NULL, NULL, &fref, NULL); - if (error != noErr) { - return NSMacOSRomanStringEncoding; - } - - CFURLRef URL = CFURLCreateFromFSRef(NULL, &fref); - if (URL == NULL) { - return NSMacOSRomanStringEncoding; - } - - NSString *path = [(NSURL *)URL path]; - CFRelease(URL); - - // Get the lproj directory name - path = [path stringByDeletingLastPathComponent]; - if (![[path pathExtension] _webkit_isCaseInsensitiveEqualToString:@"lproj"]) { - return NSMacOSRomanStringEncoding; - } - - NSString *directoryName = [[path stringByDeletingPathExtension] lastPathComponent]; - CFStringRef locale = CFLocaleCreateCanonicalLocaleIdentifierFromString(NULL, (CFStringRef)directoryName); - if (locale == NULL) { - return NSMacOSRomanStringEncoding; - } - - LangCode lang; - RegionCode region; - error = LocaleStringToLangAndRegionCodes([(NSString *)locale UTF8String], &lang, ®ion); - CFRelease(locale); - if (error != noErr) { - return NSMacOSRomanStringEncoding; - } - - TextEncoding encoding; - error = UpgradeScriptInfoToTextEncoding(kTextScriptDontCare, lang, region, NULL, &encoding); - if (error != noErr) { - return NSMacOSRomanStringEncoding; - } - - return CFStringConvertEncodingToNSStringEncoding(encoding); + return CFStringConvertEncodingToNSStringEncoding(stringEncodingForResource(resource)); } - (BOOL)_webkit_isCaseInsensitiveEqualToString:(NSString *)string { - return [self compare:string options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame; + return stringIsCaseInsensitiveEqualToString(self, string); } -(BOOL)_webkit_hasCaseInsensitivePrefix:(NSString *)prefix diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h index 33dc38b..6c60d6a 100644 --- a/WebKit/mac/Misc/WebKitVersionChecks.h +++ b/WebKit/mac/Misc/WebKitVersionChecks.h @@ -48,6 +48,9 @@ #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 +#define WEBKIT_FIRST_VERSION_WITH_RELOAD_FROM_ORIGIN 0x02100700 // 528.7.0 +#define WEBKIT_FIRST_VERSION_WITHOUT_MAIL_THREAD_WORKAROUND 0x02100700 // 528.7.0 +#define WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND 0x02100700 // 528.7.0 #ifdef __cplusplus extern "C" { diff --git a/WebKit/mac/Misc/WebNSArrayExtras.h b/WebKit/mac/Misc/WebNSArrayExtras.h index 5e3294d..a69a694 100644 --- a/WebKit/mac/Misc/WebNSArrayExtras.h +++ b/WebKit/mac/Misc/WebNSArrayExtras.h @@ -26,8 +26,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import "WebTypesInternal.h" #import <Cocoa/Cocoa.h> +@interface NSArray (WebNSArrayExtras) + +-(NSNumber *)_webkit_numberAtIndex:(NSUInteger)index; +-(NSString *)_webkit_stringAtIndex:(NSUInteger)index; + +@end @interface NSMutableArray (WebNSArrayExtras) diff --git a/WebKit/mac/Misc/WebNSArrayExtras.m b/WebKit/mac/Misc/WebNSArrayExtras.m index b8b9af3..6377010 100644 --- a/WebKit/mac/Misc/WebNSArrayExtras.m +++ b/WebKit/mac/Misc/WebNSArrayExtras.m @@ -30,7 +30,23 @@ #import <wtf/Assertions.h> -@implementation NSMutableArray (WebExtras) +@implementation NSArray (WebNSArrayExtras) + +-(NSNumber *)_webkit_numberAtIndex:(NSUInteger)index +{ + id object = [self objectAtIndex:index]; + return [object isKindOfClass:[NSNumber class]] ? object : nil; +} + +-(NSString *)_webkit_stringAtIndex:(NSUInteger)index +{ + id object = [self objectAtIndex:index]; + return [object isKindOfClass:[NSString class]] ? object : nil; +} + +@end + +@implementation NSMutableArray (WebNSArrayExtras) - (void)_webkit_removeUselessMenuItemSeparators { diff --git a/WebKit/mac/Misc/WebNSDataExtras.h b/WebKit/mac/Misc/WebNSDataExtras.h index d6ce829..689077c 100644 --- a/WebKit/mac/Misc/WebNSDataExtras.h +++ b/WebKit/mac/Misc/WebNSDataExtras.h @@ -28,11 +28,15 @@ #import <Foundation/Foundation.h> +#import "WebTypesInternal.h" + #define WEB_GUESS_MIME_TYPE_PEEK_LENGTH 1024 @interface NSData (WebNSDataExtras) -(BOOL)_web_isCaseInsensitiveEqualToCString:(const char *)string; -(NSMutableDictionary *)_webkit_parseRFC822HeaderFields; +- (BOOL)_web_startsWithBlankLine; +- (NSInteger)_web_locationAfterFirstBlankLine; @end diff --git a/WebKit/mac/Misc/WebNSDataExtras.m b/WebKit/mac/Misc/WebNSDataExtras.m index 0bd4555..e446661 100644 --- a/WebKit/mac/Misc/WebNSDataExtras.m +++ b/WebKit/mac/Misc/WebNSDataExtras.m @@ -392,4 +392,39 @@ static const UInt8 *_findEOL(const UInt8 *bytes, CFIndex len) { return headerFields; } +- (BOOL)_web_startsWithBlankLine +{ + return [self length] > 0 && ((const char *)[self bytes])[0] == '\n'; +} + +- (NSInteger)_web_locationAfterFirstBlankLine +{ + const char *bytes = (const char *)[self bytes]; + unsigned length = [self length]; + + unsigned i; + for (i = 0; i < length - 4; i++) { + + // Support for Acrobat. It sends "\n\n". + if (bytes[i] == '\n' && bytes[i+1] == '\n') { + return i+2; + } + + // Returns the position after 2 CRLF's or 1 CRLF if it is the first line. + if (bytes[i] == '\r' && bytes[i+1] == '\n') { + i += 2; + if (i == 2) { + return i; + } else if (bytes[i] == '\n') { + // Support for Director. It sends "\r\n\n" (3880387). + return i+1; + } else if (bytes[i] == '\r' && bytes[i+1] == '\n') { + // Support for Flash. It sends "\r\n\r\n" (3758113). + return i+2; + } + } + } + return NSNotFound; +} + @end diff --git a/WebKit/mac/Misc/WebNSDictionaryExtras.h b/WebKit/mac/Misc/WebNSDictionaryExtras.h index 57d868a..95445f8 100644 --- a/WebKit/mac/Misc/WebNSDictionaryExtras.h +++ b/WebKit/mac/Misc/WebNSDictionaryExtras.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 @@ -29,8 +29,10 @@ #import <Foundation/Foundation.h> @interface NSDictionary (WebNSDictionaryExtras) +- (BOOL)_webkit_boolForKey:(id)key; - (int)_webkit_intForKey:(id)key; - (NSString *)_webkit_stringForKey:(id)key; // Returns nil if the value is not an NSString. +- (NSArray *)_webkit_arrayForKey:(id)key; // Returns nil if the value is not an NSArray. // Searches for the full MIME type, then the prefix (e.g., "text/" for "text/html") - (id)_webkit_objectForMIMEType:(NSString *)MIMEType; @@ -43,4 +45,3 @@ - (void)_webkit_setBool:(BOOL)value forKey:(id)key; - (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key; @end - diff --git a/WebKit/mac/Misc/WebNSDictionaryExtras.m b/WebKit/mac/Misc/WebNSDictionaryExtras.m index 665db22..a47fd0b 100644 --- a/WebKit/mac/Misc/WebNSDictionaryExtras.m +++ b/WebKit/mac/Misc/WebNSDictionaryExtras.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 @@ -49,6 +49,12 @@ return [object isKindOfClass:[NSString class]] ? object : nil; } +-(NSArray *)_webkit_arrayForKey:(id)key +{ + id object = [self objectForKey:key]; + return [object isKindOfClass:[NSArray class]] ? object : nil; +} + -(id)_webkit_objectForMIMEType:(NSString *)MIMEType { id result; @@ -67,6 +73,12 @@ return [self objectForKey:[MIMEType substringToIndex:slashRange.location + 1]]; } +- (BOOL)_webkit_boolForKey:(id)key +{ + NSNumber *number = [self _webkit_numberForKey:key]; + return number && [number boolValue]; +} + @end @implementation NSMutableDictionary (WebNSDictionaryExtras) diff --git a/WebKit/mac/Misc/WebNSObjectExtras.h b/WebKit/mac/Misc/WebNSObjectExtras.h index 8029825..f327966 100644 --- a/WebKit/mac/Misc/WebNSObjectExtras.h +++ b/WebKit/mac/Misc/WebNSObjectExtras.h @@ -52,3 +52,7 @@ static inline IMP method_setImplementation(Method m, IMP i) } #endif + +@interface NSObject (WebNSObjectExtras) +- (id)_webkit_invokeOnMainThread; +@end diff --git a/WebKit/mac/Misc/WebNSObjectExtras.mm b/WebKit/mac/Misc/WebNSObjectExtras.mm new file mode 100644 index 0000000..2d682b9 --- /dev/null +++ b/WebKit/mac/Misc/WebNSObjectExtras.mm @@ -0,0 +1,93 @@ +/* + * 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 "WebNSObjectExtras.h" + + +@interface WebMainThreadInvoker : NSProxy +{ + id target; + id exception; +} +@end + +@implementation WebMainThreadInvoker + +- (id)initWithTarget:(id)theTarget +{ + target = theTarget; + return self; +} + +- (void)forwardInvocation:(NSInvocation *)invocation +{ + [invocation setTarget:target]; + [invocation retainArguments]; + [invocation performSelectorOnMainThread:@selector(_webkit_invokeAndHandleException:) withObject:self waitUntilDone:YES]; + if (exception) { + id exceptionToThrow = [exception autorelease]; + exception = nil; + @throw exceptionToThrow; + } +} + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector +{ + return [target methodSignatureForSelector:selector]; +} + +- (void)handleException:(id)e +{ + exception = [e retain]; +} + +@end + + +@implementation NSInvocation (WebMainThreadInvoker) + +- (void)_webkit_invokeAndHandleException:(WebMainThreadInvoker *)exceptionHandler +{ + @try { + [self invoke]; + } @catch (id e) { + [exceptionHandler handleException:e]; + } +} + +@end + + +@implementation NSObject (WebNSObjectExtras) + +- (id)_webkit_invokeOnMainThread +{ + return [[[WebMainThreadInvoker alloc] initWithTarget:self] autorelease]; +} + +@end diff --git a/WebKit/mac/Misc/WebNSPasteboardExtras.mm b/WebKit/mac/Misc/WebNSPasteboardExtras.mm index b84542a..34c39dd 100644 --- a/WebKit/mac/Misc/WebNSPasteboardExtras.mm +++ b/WebKit/mac/Misc/WebNSPasteboardExtras.mm @@ -41,6 +41,7 @@ #import <WebKit/DOMExtensions.h> #import <WebKit/DOMPrivate.h> #import <wtf/Assertions.h> +#import <wtf/StdLibExtras.h> #import <wtf/RetainPtr.h> #import <WebKitSystemInterface.h> @@ -58,37 +59,40 @@ NSString *WebURLNamePboardType = @"public.url-name"; + (NSArray *)_web_writableTypesForURL { - static RetainPtr<NSArray> types; - if (!types) { - types = [[NSArray alloc] initWithObjects: - WebURLsWithTitlesPboardType, - NSURLPboardType, - WebURLPboardType, - WebURLNamePboardType, - NSStringPboardType, - nil]; - } + DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, ([[NSArray alloc] initWithObjects: + WebURLsWithTitlesPboardType, + NSURLPboardType, + WebURLPboardType, + WebURLNamePboardType, + NSStringPboardType, + nil])); return types.get(); } +static inline NSArray *_createWritableTypesForImageWithoutArchive() +{ + NSMutableArray *types = [[NSMutableArray alloc] initWithObjects:NSTIFFPboardType, nil]; + [types addObjectsFromArray:[NSPasteboard _web_writableTypesForURL]]; + return types; +} + static NSArray *_writableTypesForImageWithoutArchive (void) { - static RetainPtr<NSMutableArray> types; - if (types == nil) { - types = [[NSMutableArray alloc] initWithObjects:NSTIFFPboardType, nil]; - [types.get() addObjectsFromArray:[NSPasteboard _web_writableTypesForURL]]; - } + DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, (_createWritableTypesForImageWithoutArchive())); return types.get(); } +static inline NSArray *_createWritableTypesForImageWithArchive() +{ + NSMutableArray *types = [_writableTypesForImageWithoutArchive() mutableCopy]; + [types addObject:NSRTFDPboardType]; + [types addObject:WebArchivePboardType]; + return types; +} + static NSArray *_writableTypesForImageWithArchive (void) { - static RetainPtr<NSMutableArray> types; - if (types == nil) { - types = [_writableTypesForImageWithoutArchive() mutableCopy]; - [types.get() addObject:NSRTFDPboardType]; - [types.get() addObject:WebArchivePboardType]; - } + DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, (_createWritableTypesForImageWithArchive())); return types.get(); } @@ -207,7 +211,7 @@ static NSArray *_writableTypesForImageWithArchive (void) } -CachedImage* imageFromElement(DOMElement *domElement) { +static CachedImage* imageFromElement(DOMElement *domElement) { Element* element = core(domElement); if (!element) return 0; @@ -259,18 +263,23 @@ CachedImage* imageFromElement(DOMElement *domElement) { { ASSERT(self == [NSPasteboard pasteboardWithName:NSDragPboard]); + NSString *extension = @""; + if (RenderObject* renderer = core(element)->renderer()) { + if (renderer->isImage()) { + if (CachedImage* image = static_cast<RenderImage*>(renderer)->cachedImage()) { + extension = image->image()->filenameExtension(); + if (![extension length]) + return 0; + } + } + } + NSMutableArray *types = [[NSMutableArray alloc] initWithObjects:NSFilesPromisePboardType, nil]; [types addObjectsFromArray:[NSPasteboard _web_writableTypesForImageIncludingArchive:(archive != nil)]]; [self declareTypes:types owner:source]; [self _web_writeImage:nil element:element URL:URL title:title archive:archive types:types source:source]; [types release]; - NSString *extension = @""; - if (RenderObject* renderer = core(element)->renderer()) - if (renderer->isImage()) - if (CachedImage* image = static_cast<RenderImage*>(renderer)->cachedImage()) - extension = WKGetPreferredExtensionForMIMEType(image->response().mimeType()); - NSArray *extensions = [[NSArray alloc] initWithObjects:extension, nil]; [self setPropertyList:extensions forType:NSFilesPromisePboardType]; [extensions release]; diff --git a/WebKit/mac/Misc/WebStringTruncator.m b/WebKit/mac/Misc/WebStringTruncator.m index c395e7a..fb31bbb 100644 --- a/WebKit/mac/Misc/WebStringTruncator.m +++ b/WebKit/mac/Misc/WebStringTruncator.m @@ -33,6 +33,7 @@ #import <WebCore/FontPlatformData.h> #import <WebCore/PlatformString.h> #import <WebCore/StringTruncator.h> +#import <wtf/StdLibExtras.h> using namespace WebCore; @@ -49,7 +50,7 @@ static NSFont *defaultMenuFont() static Font& fontFromNSFont(NSFont *font) { static NSFont *currentFont; - static Font currentRenderer; + DEFINE_STATIC_LOCAL(Font, currentRenderer, ()); if ([font isEqual:currentFont]) return currentRenderer; diff --git a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib deleted file mode 100644 index 87a7210..0000000 --- a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib +++ /dev/null @@ -1,38 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {cancel = id; logIn = id; }; - CLASS = IFAuthenticationPanel; - LANGUAGE = ObjC; - OUTLETS = { - imageView = id; - mainLabel = id; - panel = id; - password = id; - remember = id; - smallLabel = id; - username = id; - }; - SUPERCLASS = NSObject; - }, - {CLASS = NonBlockingPanel; LANGUAGE = ObjC; SUPERCLASS = NSPanel; }, - { - ACTIONS = {cancel = id; logIn = id; }; - CLASS = WebAuthenticationPanel; - LANGUAGE = ObjC; - OUTLETS = { - callback = id; - imageView = id; - mainLabel = id; - panel = id; - password = id; - remember = id; - smallLabel = id; - username = id; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -}
\ No newline at end of file diff --git a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib new file mode 100644 index 0000000..31b269a --- /dev/null +++ b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib @@ -0,0 +1,1182 @@ +<?xml version="1.0" encoding="UTF-8"?> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02"> + <data> + <int key="IBDocument.SystemTarget">1050</int> + <string key="IBDocument.SystemVersion">9G55</string> + <string key="IBDocument.InterfaceBuilderVersion">672</string> + <string key="IBDocument.AppKitVersion">949.43</string> + <string key="IBDocument.HIToolboxVersion">353.00</string> + <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> + <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="6"/> + </object> + <object class="NSArray" key="IBDocument.PluginDependencies"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + </object> + <object class="NSMutableArray" key="IBDocument.RootObjects" id="563121920"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSCustomObject" id="238662661"> + <string key="NSClassName">IFAuthenticationPanel</string> + </object> + <object class="NSCustomObject" id="729335755"> + <string key="NSClassName">FirstResponder</string> + </object> + <object class="NSCustomObject" id="239643893"> + <string key="NSClassName">NSApplication</string> + </object> + <object class="NSWindowTemplate" id="118512579"> + <int key="NSWindowStyleMask">1</int> + <int key="NSWindowBacking">2</int> + <string key="NSWindowRect">{{93, 112}, {424, 239}}</string> + <int key="NSWTFlags">1886912512</int> + <string key="NSWindowTitle">Log In</string> + <string key="NSWindowClass">NonBlockingPanel</string> + <object class="NSMutableString" key="NSViewClass"> + <characters key="NS.bytes">View</characters> + </object> + <string key="NSWindowContentMaxSize">{500, 202}</string> + <string key="NSWindowContentMinSize">{300, 100}</string> + <object class="NSView" key="NSWindowView" id="327235052"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">256</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSTextField" id="705333610"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">266</int> + <string key="NSFrame">{{101, 185}, {306, 34}}</string> + <reference key="NSSuperview" ref="327235052"/> + <int key="NSTag">1</int> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="240004773"> + <int key="NSCellFlags">69336577</int> + <int key="NSCellFlags2">4194304</int> + <string type="base64-UTF8" key="NSContents">VG8gdmlldyB0aGlzIHBhZ2UsIHlvdSBuZWVkIHRvIGxvZyBpbiB0byBhcmVhIOKAnFNvbWUgUmVhbG3i +gJ0gb24gd3d3LnNlcnZlci5jb20uCi4uA</string> + <object class="NSFont" key="NSSupport" id="897649771"> + <string key="NSName">LucidaGrande</string> + <double key="NSSize">1.300000e+01</double> + <int key="NSfFlags">1044</int> + </object> + <int key="NSTag">1</int> + <reference key="NSControlView" ref="705333610"/> + <object class="NSColor" key="NSBackgroundColor" id="475108766"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">controlColor</string> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes> + </object> + </object> + <object class="NSColor" key="NSTextColor" id="644083014"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">controlTextColor</string> + <object class="NSColor" key="NSColor" id="170747205"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MAA</bytes> + </object> + </object> + </object> + </object> + <object class="NSTextField" id="199018347"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">290</int> + <string key="NSFrame">{{101, 157}, {291, 20}}</string> + <reference key="NSSuperview" ref="327235052"/> + <int key="NSTag">2</int> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="213641065"> + <int key="NSCellFlags">69336577</int> + <int key="NSCellFlags2">4194304</int> + <string key="NSContents">Your password will be sent unencrypted.</string> + <object class="NSFont" key="NSSupport"> + <string key="NSName">LucidaGrande</string> + <double key="NSSize">1.100000e+01</double> + <int key="NSfFlags">3100</int> + </object> + <int key="NSTag">2</int> + <reference key="NSControlView" ref="199018347"/> + <reference key="NSBackgroundColor" ref="475108766"/> + <reference key="NSTextColor" ref="644083014"/> + </object> + </object> + <object class="NSButton" id="305175176"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">289</int> + <string key="NSFrame">{{326, 12}, {84, 32}}</string> + <reference key="NSSuperview" ref="327235052"/> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="568224179"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">137887744</int> + <string key="NSContents">Log In</string> + <reference key="NSSupport" ref="897649771"/> + <reference key="NSControlView" ref="305175176"/> + <int key="NSButtonFlags">-2038284033</int> + <int key="NSButtonFlags2">1</int> + <object class="NSFont" key="NSAlternateImage" id="784044296"> + <string key="NSName">Helvetica</string> + <double key="NSSize">1.300000e+01</double> + <int key="NSfFlags">16</int> + </object> + <string key="NSAlternateContents"/> + <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + </object> + <object class="NSButton" id="494193237"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">289</int> + <string key="NSFrame">{{242, 12}, {84, 32}}</string> + <reference key="NSSuperview" ref="327235052"/> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="55525334"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">137887744</int> + <string key="NSContents">Cancel</string> + <reference key="NSSupport" ref="897649771"/> + <reference key="NSControlView" ref="494193237"/> + <int key="NSButtonFlags">-2038284033</int> + <int key="NSButtonFlags2">1</int> + <reference key="NSAlternateImage" ref="784044296"/> + <string key="NSAlternateContents"/> + <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + </object> + <object class="NSTextField" id="71972597"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">290</int> + <string key="NSFrame">{{174, 127}, {210, 22}}</string> + <reference key="NSSuperview" ref="327235052"/> + <int key="NSTag">3</int> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="439646453"> + <int key="NSCellFlags">-1804468671</int> + <int key="NSCellFlags2">4195328</int> + <string key="NSContents"/> + <reference key="NSSupport" ref="897649771"/> + <int key="NSTag">3</int> + <reference key="NSControlView" ref="71972597"/> + <bool key="NSDrawsBackground">YES</bool> + <object class="NSColor" key="NSBackgroundColor" id="301231121"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">textBackgroundColor</string> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MQA</bytes> + </object> + </object> + <object class="NSColor" key="NSTextColor" id="577315227"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">textColor</string> + <reference key="NSColor" ref="170747205"/> + </object> + </object> + </object> + <object class="NSTextField" id="368270689"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">290</int> + <string key="NSFrame">{{174, 97}, {210, 22}}</string> + <reference key="NSSuperview" ref="327235052"/> + <int key="NSTag">4</int> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="743913118"> + <int key="NSCellFlags">-1804468671</int> + <int key="NSCellFlags2">4195328</int> + <string key="NSContents"/> + <reference key="NSSupport" ref="897649771"/> + <int key="NSTag">4</int> + <reference key="NSControlView" ref="368270689"/> + <bool key="NSDrawsBackground">YES</bool> + <reference key="NSBackgroundColor" ref="301231121"/> + <reference key="NSTextColor" ref="577315227"/> + </object> + </object> + <object class="NSTextField" id="477300420"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">289</int> + <string key="NSFrame">{{101, 129}, {71, 17}}</string> + <reference key="NSSuperview" ref="327235052"/> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="159596654"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">4194304</int> + <string type="base64-UTF8" key="NSContents">TmFtZToKA</string> + <reference key="NSSupport" ref="897649771"/> + <reference key="NSControlView" ref="477300420"/> + <reference key="NSBackgroundColor" ref="475108766"/> + <reference key="NSTextColor" ref="644083014"/> + </object> + </object> + <object class="NSTextField" id="833115728"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">289</int> + <string key="NSFrame">{{101, 94}, {68, 22}}</string> + <reference key="NSSuperview" ref="327235052"/> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="766878508"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">4194304</int> + <string type="base64-UTF8" key="NSContents">UGFzc3dvcmQ6Cg</string> + <reference key="NSSupport" ref="897649771"/> + <reference key="NSControlView" ref="833115728"/> + <reference key="NSBackgroundColor" ref="475108766"/> + <reference key="NSTextColor" ref="644083014"/> + </object> + </object> + <object class="NSImageView" id="285173040"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">256</int> + <object class="NSMutableSet" key="NSDragTypes"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="set.sortedObjects"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>Apple PDF pasteboard type</string> + <string>Apple PICT pasteboard type</string> + <string>Apple PNG pasteboard type</string> + <string>NSFilenamesPboardType</string> + <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string> + <string>NeXT TIFF v4.0 pasteboard type</string> + </object> + </object> + <string key="NSFrame">{{20, 155}, {64, 64}}</string> + <reference key="NSSuperview" ref="327235052"/> + <bool key="NSEnabled">YES</bool> + <object class="NSImageCell" key="NSCell" id="375502905"> + <int key="NSCellFlags">130560</int> + <int key="NSCellFlags2">33554432</int> + <int key="NSAlign">0</int> + <int key="NSScale">0</int> + <int key="NSStyle">0</int> + <bool key="NSAnimates">NO</bool> + </object> + <bool key="NSEditable">YES</bool> + </object> + <object class="NSButton" id="657854151"> + <reference key="NSNextResponder" ref="327235052"/> + <int key="NSvFlags">289</int> + <string key="NSFrame">{{102, 58}, {280, 18}}</string> + <reference key="NSSuperview" ref="327235052"/> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="358614001"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">0</int> + <string key="NSContents">Remember this password in my keychain</string> + <reference key="NSSupport" ref="897649771"/> + <reference key="NSControlView" ref="657854151"/> + <int key="NSButtonFlags">1211912703</int> + <int key="NSButtonFlags2">2</int> + <object class="NSButtonImageSource" key="NSAlternateImage"> + <string key="NSImageName">NSSwitch</string> + </object> + <string key="NSAlternateContents"/> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + </object> + </object> + <string key="NSFrameSize">{424, 239}</string> + <reference key="NSSuperview"/> + </object> + <string key="NSScreenRect">{{0, 0}, {2560, 1578}}</string> + <string key="NSMinSize">{300, 122}</string> + <string key="NSMaxSize">{500, 224}</string> + <string key="NSFrameAutosaveName">Authentication Panel</string> + </object> + </object> + <object class="IBObjectContainer" key="IBDocument.Objects"> + <object class="NSMutableArray" key="connectionRecords"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">initialFirstResponder</string> + <reference key="source" ref="118512579"/> + <reference key="destination" ref="71972597"/> + </object> + <int key="connectionID">26</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">panel</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="118512579"/> + </object> + <int key="connectionID">27</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">username</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="71972597"/> + </object> + <int key="connectionID">28</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">password</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="368270689"/> + </object> + <int key="connectionID">29</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">logIn:</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="305175176"/> + </object> + <int key="connectionID">30</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">cancel:</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="494193237"/> + </object> + <int key="connectionID">31</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">mainLabel</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="705333610"/> + </object> + <int key="connectionID">34</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">smallLabel</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="199018347"/> + </object> + <int key="connectionID">35</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="71972597"/> + <reference key="destination" ref="368270689"/> + </object> + <int key="connectionID">36</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">imageView</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="285173040"/> + </object> + <int key="connectionID">38</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">remember</string> + <reference key="source" ref="238662661"/> + <reference key="destination" ref="657854151"/> + </object> + <int key="connectionID">40</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="368270689"/> + <reference key="destination" ref="657854151"/> + </object> + <int key="connectionID">41</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="657854151"/> + <reference key="destination" ref="494193237"/> + </object> + <int key="connectionID">42</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="494193237"/> + <reference key="destination" ref="305175176"/> + </object> + <int key="connectionID">43</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="305175176"/> + <reference key="destination" ref="705333610"/> + </object> + <int key="connectionID">100042</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="705333610"/> + <reference key="destination" ref="199018347"/> + </object> + <int key="connectionID">100045</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="199018347"/> + <reference key="destination" ref="71972597"/> + </object> + <int key="connectionID">100046</int> + </object> + </object> + <object class="IBMutableOrderedSet" key="objectRecords"> + <object class="NSArray" key="orderedObjects"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBObjectRecord"> + <int key="objectID">0</int> + <object class="NSArray" key="object" id="0"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <reference key="children" ref="563121920"/> + <nil key="parent"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-2</int> + <reference key="object" ref="238662661"/> + <reference key="parent" ref="0"/> + <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-1</int> + <reference key="object" ref="729335755"/> + <reference key="parent" ref="0"/> + <string key="objectName">First Responder</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-3</int> + <reference key="object" ref="239643893"/> + <reference key="parent" ref="0"/> + <string key="objectName">Application</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">5</int> + <reference key="object" ref="118512579"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="327235052"/> + </object> + <reference key="parent" ref="0"/> + <string key="objectName">Panel</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">6</int> + <reference key="object" ref="327235052"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="705333610"/> + <reference ref="199018347"/> + <reference ref="305175176"/> + <reference ref="494193237"/> + <reference ref="71972597"/> + <reference ref="368270689"/> + <reference ref="477300420"/> + <reference ref="833115728"/> + <reference ref="285173040"/> + <reference ref="657854151"/> + </object> + <reference key="parent" ref="118512579"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">10</int> + <reference key="object" ref="705333610"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="240004773"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">11</int> + <reference key="object" ref="199018347"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="213641065"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">12</int> + <reference key="object" ref="305175176"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="568224179"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">13</int> + <reference key="object" ref="494193237"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="55525334"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">14</int> + <reference key="object" ref="71972597"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="439646453"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">15</int> + <reference key="object" ref="368270689"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="743913118"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">16</int> + <reference key="object" ref="477300420"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="159596654"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">17</int> + <reference key="object" ref="833115728"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="766878508"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">19</int> + <reference key="object" ref="285173040"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="375502905"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">39</int> + <reference key="object" ref="657854151"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="358614001"/> + </object> + <reference key="parent" ref="327235052"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100010</int> + <reference key="object" ref="240004773"/> + <reference key="parent" ref="705333610"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100011</int> + <reference key="object" ref="213641065"/> + <reference key="parent" ref="199018347"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100012</int> + <reference key="object" ref="568224179"/> + <reference key="parent" ref="305175176"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100013</int> + <reference key="object" ref="55525334"/> + <reference key="parent" ref="494193237"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100014</int> + <reference key="object" ref="439646453"/> + <reference key="parent" ref="71972597"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100015</int> + <reference key="object" ref="743913118"/> + <reference key="parent" ref="368270689"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100016</int> + <reference key="object" ref="159596654"/> + <reference key="parent" ref="477300420"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100017</int> + <reference key="object" ref="766878508"/> + <reference key="parent" ref="833115728"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100019</int> + <reference key="object" ref="375502905"/> + <reference key="parent" ref="285173040"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">100039</int> + <reference key="object" ref="358614001"/> + <reference key="parent" ref="657854151"/> + </object> + </object> + </object> + <object class="NSMutableDictionary" key="flattenedProperties"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>-1.IBPluginDependency</string> + <string>-2.IBPluginDependency</string> + <string>-3.IBPluginDependency</string> + <string>-3.ImportedFromIB2</string> + <string>10.IBPluginDependency</string> + <string>10.ImportedFromIB2</string> + <string>11.IBPluginDependency</string> + <string>11.ImportedFromIB2</string> + <string>12.IBPluginDependency</string> + <string>12.ImportedFromIB2</string> + <string>13.IBPluginDependency</string> + <string>13.ImportedFromIB2</string> + <string>14.IBPluginDependency</string> + <string>14.ImportedFromIB2</string> + <string>15.CustomClassName</string> + <string>15.IBPluginDependency</string> + <string>15.ImportedFromIB2</string> + <string>16.IBPluginDependency</string> + <string>16.ImportedFromIB2</string> + <string>17.IBPluginDependency</string> + <string>17.ImportedFromIB2</string> + <string>19.IBPluginDependency</string> + <string>19.ImportedFromIB2</string> + <string>39.IBPluginDependency</string> + <string>39.ImportedFromIB2</string> + <string>5.IBEditorWindowLastContentRect</string> + <string>5.IBPluginDependency</string> + <string>5.IBWindowTemplateEditedContentRect</string> + <string>5.ImportedFromIB2</string> + <string>5.windowTemplate.hasMaxSize</string> + <string>5.windowTemplate.hasMinSize</string> + <string>5.windowTemplate.maxSize</string> + <string>5.windowTemplate.minSize</string> + <string>6.IBPluginDependency</string> + <string>6.ImportedFromIB2</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <integer value="1" id="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>NSSecureTextField</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + <string>{{0, 1306}, {424, 239}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{0, 1306}, {424, 239}}</string> + <reference ref="5"/> + <reference ref="5"/> + <reference ref="5"/> + <string>{500, 202}</string> + <string>{300, 100}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="5"/> + </object> + </object> + <object class="NSMutableDictionary" key="unlocalizedProperties"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <nil key="activeLocalization"/> + <object class="NSMutableDictionary" key="localizations"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <nil key="sourceID"/> + <int key="maxID">100046</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"> + <object class="NSMutableArray" key="referencedPartialClassDescriptions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBPartialClassDescription"> + <string key="className">FirstResponder</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IFAuthenticationPanel</string> + <string key="superclassName">NSObject</string> + <object class="NSMutableDictionary" key="actions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>cancel:</string> + <string>logIn:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + </object> + </object> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>imageView</string> + <string>mainLabel</string> + <string>panel</string> + <string>password</string> + <string>remember</string> + <string>smallLabel</string> + <string>username</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Misc/WebNSControlExtras.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSControl</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Misc/WebDownload.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Misc/WebIconDatabaseDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Misc/WebNSObjectExtras.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Plugins/WebJavaPlugIn.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Plugins/WebPlugin.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Plugins/WebPluginContainer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Plugins/WebPluginContainerPrivate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Plugins/WebPluginDatabase.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Plugins/WebPluginPrivate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebInspector/WebNodeHighlight.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebEditingDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebEditingDelegatePrivate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebFrameInternal.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebFrameLoadDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebPolicyDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebPolicyDelegatePrivate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebResourceLoadDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebResourceLoadDelegatePrivate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebScriptDebugDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="NSMutableDictionary" key="actions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>webViewClose:</string> + <string>webViewFocus:</string> + <string>webViewRunModal:</string> + <string>webViewShow:</string> + <string>webViewUnfocus:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>WebView</string> + <string>WebView</string> + <string>WebView</string> + <string>WebView</string> + <string>WebView</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebUIDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebUIDelegatePrivate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="153972132"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebViewPrivate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Misc/WebNSViewExtras.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <string key="superclassName">NSResponder</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Misc/WebNSWindowExtras.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <string key="superclassName">NSResponder</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NonBlockingPanel</string> + <string key="superclassName">NSPanel</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/Panels/WebAuthenticationPanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NonBlockingPanel</string> + <string key="superclassName">NSPanel</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">WebView</string> + <string key="superclassName">NSView</string> + <object class="NSMutableDictionary" key="actions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>alignCenter:</string> + <string>alignJustified:</string> + <string>alignLeft:</string> + <string>alignRight:</string> + <string>changeAttributes:</string> + <string>changeColor:</string> + <string>changeDocumentBackgroundColor:</string> + <string>changeFont:</string> + <string>checkSpelling:</string> + <string>copy:</string> + <string>copyFont:</string> + <string>cut:</string> + <string>delete:</string> + <string>goBack:</string> + <string>goForward:</string> + <string>makeTextLarger:</string> + <string>makeTextSmaller:</string> + <string>makeTextStandardSize:</string> + <string>moveToBeginningOfSentence:</string> + <string>moveToBeginningOfSentenceAndModifySelection:</string> + <string>moveToEndOfSentence:</string> + <string>moveToEndOfSentenceAndModifySelection:</string> + <string>paste:</string> + <string>pasteAsPlainText:</string> + <string>pasteAsRichText:</string> + <string>pasteFont:</string> + <string>performFindPanelAction:</string> + <string>reload:</string> + <string>reloadFromOrigin:</string> + <string>selectSentence:</string> + <string>showGuessPanel:</string> + <string>startSpeaking:</string> + <string>stopLoading:</string> + <string>stopSpeaking:</string> + <string>takeStringURLFrom:</string> + <string>toggleContinuousSpellChecking:</string> + <string>toggleSmartInsertDelete:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">WebView</string> + <object class="NSMutableDictionary" key="actions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>_openFrameInNewWindowFromMenu:</string> + <string>_searchWithGoogleFromMenu:</string> + <string>_searchWithSpotlightFromMenu:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>NSMenuItem</string> + <string>id</string> + <string>id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">mac/WebView/WebViewInternal.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">WebView</string> + <object class="NSMutableDictionary" key="actions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>outdent:</string> + <string>resetPageZoom:</string> + <string>toggleGrammarChecking:</string> + <string>zoomPageIn:</string> + <string>zoomPageOut:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + </object> + </object> + <reference key="sourceIdentifier" ref="153972132"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">WebView</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBUserSource</string> + <string key="minorKey"/> + </object> + </object> + </object> + </object> + <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.LastKnownRelativeProjectPath">../../../WebKit.xcodeproj</string> + <int key="IBDocument.defaultPropertyAccessControl">3</int> + </data> +</archive> diff --git a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/info.nib b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/info.nib deleted file mode 100644 index eb229b0..0000000 --- a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IBDocumentLocation</key> - <string>773 144 356 240 0 0 1280 778 </string> - <key>IBFramework Version</key> - <string>446.1</string> - <key>IBOpenObjects</key> - <array> - <integer>5</integer> - </array> - <key>IBSystem Version</key> - <string>8N1106</string> -</dict> -</plist> diff --git a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib Binary files differnew file mode 100644 index 0000000..207cdb3 --- /dev/null +++ b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib diff --git a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib Binary files differdeleted file mode 100644 index 59196ff..0000000 --- a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib +++ /dev/null diff --git a/WebKit/mac/Panels/WebAuthenticationPanel.m b/WebKit/mac/Panels/WebAuthenticationPanel.m index 4e17536..e0efef7 100644 --- a/WebKit/mac/Panels/WebAuthenticationPanel.m +++ b/WebKit/mac/Panels/WebAuthenticationPanel.m @@ -31,6 +31,7 @@ #import <Foundation/NSURLAuthenticationChallenge.h> #import <Foundation/NSURLProtectionSpace.h> #import <Foundation/NSURLCredential.h> +#import <WebKit/WebKitNSStringExtras.h> #import <WebKit/WebLocalizableStrings.h> #import <WebKit/WebNSURLExtras.h> #import <wtf/Assertions.h> @@ -132,21 +133,21 @@ if ([chall previousFailureCount] == 0) { if ([space isProxy]) { - message = [NSString stringWithFormat:UI_STRING("To view this page, you need to log in to the %@ proxy server %@.", + message = [NSString stringWithFormat:UI_STRING("To view this page, you must log in to the %@ proxy server %@.", "prompt string in authentication panel"), [space proxyType], host]; } else { - message = [NSString stringWithFormat:UI_STRING("To view this page, you need to log in to area “%@” on %@.", + message = [NSString stringWithFormat:UI_STRING("To view this page, you must log in to area “%@” on %@.", "prompt string in authentication panel"), realm, host]; } } else { if ([space isProxy]) { - message = [NSString stringWithFormat:UI_STRING("The name or password entered for the %@ proxy server %@ was incorrect. Please try again.", + message = [NSString stringWithFormat:UI_STRING("The user name or password you entered for the %@ proxy server %@ was incorrect. Make sure you’re entering them correctly, and then try again.", "prompt string in authentication panel"), [space proxyType], host]; } else { - message = [NSString stringWithFormat:UI_STRING("The name or password entered for area “%@” on %@ was incorrect. Please try again.", + message = [NSString stringWithFormat:UI_STRING("The user name or password you entered for area “%@” on %@ was incorrect. Make sure you’re entering them correctly, and then try again.", "prompt string in authentication panel"), realm, host]; } @@ -155,13 +156,15 @@ [mainLabel setStringValue:message]; [mainLabel sizeToFitAndAdjustWindowHeight]; - if ([space receivesCredentialSecurely]) { + if ([space receivesCredentialSecurely] || [[space protocol] _webkit_isCaseInsensitiveEqualToString:@"https"]) { [smallLabel setStringValue: - UI_STRING("Your log-in information will be sent securely.", + UI_STRING("Your login information will be sent securely.", "message in authentication panel")]; } else { + // Use this scary-sounding phrase only when using basic auth with non-https servers. In this case the password + // could be sniffed by intercepting the network traffic. [smallLabel setStringValue: - UI_STRING("Your password will be sent in the clear.", + UI_STRING("Your password will be sent unencrypted.", "message in authentication panel")]; } diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h index c2e8a21..a28793a 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h @@ -32,20 +32,19 @@ #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" +#import "WebNetscapePluginView.h" namespace WebCore { class FrameLoader; class NetscapePlugInStreamLoader; } -@class WebBaseNetscapePluginView; +@class WebNetscapePluginView; @class NSURLResponse; class WebNetscapePluginStream : public RefCounted<WebNetscapePluginStream> @@ -113,7 +112,7 @@ private: BOOL m_sendNotification; void *m_notifyData; char *m_headers; - RetainPtr<WebBaseNetscapePluginView> m_pluginView; + RetainPtr<WebNetscapePluginView> m_pluginView; NPReason m_reason; bool m_isTerminated; bool m_newStreamSuccessful; diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm index 246a3ca..a29be2d 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm @@ -29,7 +29,7 @@ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebBaseNetscapePluginStream.h" -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" #import "WebFrameInternal.h" #import "WebKitErrorsPrivate.h" #import "WebKitLogging.h" @@ -45,6 +45,7 @@ #import <WebCore/WebCoreObjCExtras.h> #import <WebKitSystemInterface.h> #import <wtf/HashMap.h> +#import <wtf/StdLibExtras.h> using namespace WebCore; @@ -55,7 +56,7 @@ static NSString *CarbonPathFromPOSIXPath(NSString *posixPath); typedef HashMap<NPStream*, NPP> StreamMap; static StreamMap& streams() { - static StreamMap staticStreams; + DEFINE_STATIC_LOCAL(StreamMap, staticStreams, ()); return staticStreams; } @@ -134,7 +135,7 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug { memset(&m_stream, 0, sizeof(NPStream)); - WebBaseNetscapePluginView *view = (WebBaseNetscapePluginView *)plugin->ndata; + WebNetscapePluginView *view = (WebNetscapePluginView *)plugin->ndata; // This check has already been done by the plug-in view. ASSERT(FrameLoader::canLoad([request URL], String(), core([view webFrame])->document())); @@ -148,9 +149,6 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug 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); } WebNetscapePluginStream::~WebNetscapePluginStream() @@ -173,13 +171,13 @@ void WebNetscapePluginStream::setPlugin(NPP plugin) { if (plugin) { m_plugin = plugin; - m_pluginView = static_cast<WebBaseNetscapePluginView *>(m_plugin->ndata); + m_pluginView = static_cast<WebNetscapePluginView *>(m_plugin->ndata); WebNetscapePluginPackage *pluginPackage = [m_pluginView.get() pluginPackage]; m_pluginFuncs = [pluginPackage pluginFuncs]; } else { - WebBaseNetscapePluginView *view = m_pluginView.get(); + WebNetscapePluginView *view = m_pluginView.get(); m_plugin = 0; m_pluginFuncs = 0; @@ -256,6 +254,10 @@ void WebNetscapePluginStream::start() { ASSERT(m_request); ASSERT(!m_frameLoader); + ASSERT(!m_loader); + + m_loader = NetscapePlugInStreamLoader::create(core([m_pluginView.get() webFrame]), this); + m_loader->setShouldBufferData(false); m_loader->documentLoader()->addPlugInStreamLoader(m_loader.get()); m_loader->load(m_request.get()); @@ -434,6 +436,8 @@ void WebNetscapePluginStream::destroyStreamWithReason(NPReason reason) // There is more data to be streamed, don't destroy the stream now. return; } + + RefPtr<WebNetscapePluginStream> protect(this); destroyStream(); ASSERT(!m_stream.ndata); } diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h index 909196b..b2ea2b1 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h @@ -29,118 +29,37 @@ #if ENABLE(NETSCAPE_PLUGIN_API) #import <Cocoa/Cocoa.h> -#import <WebKit/npfunctions.h> -#import <WebKit/npapi.h> -#import <WebKit/WebBasePluginPackage.h> -#import <wtf/HashMap.h> -#import <wtf/HashSet.h> +#import "WebNetscapePluginPackage.h" + +#import <wtf/RetainPtr.h> @class DOMElement; @class WebDataSource; @class WebFrame; -@class WebNetscapePluginPackage; @class WebView; -class PluginTimer; -class WebNetscapePluginStream; -class WebNetscapePluginEventHandler; - -typedef union PluginPort { -#ifndef NP_NO_QUICKDRAW - NP_Port qdPort; -#endif - NP_CGContext cgPort; -} PluginPort; - -typedef struct _NPPluginTextInputFuncs NPPluginTextInputFuncs; - -// Because the Adobe 7.x Acrobat plug-in has a hard coded check for a view named -// "WebNetscapePluginDocumentView", this class must retain the old name in order -// for the plug-in to function correctly. (rdar://problem/4699455) -#define WebBaseNetscapePluginView WebNetscapePluginDocumentView - -@interface WebBaseNetscapePluginView : NSView <WebPluginManualLoader, NSTextInput> +@interface WebBaseNetscapePluginView : NSView { - WebNetscapePluginPackage *pluginPackage; + RetainPtr<WebNetscapePluginPackage> _pluginPackage; - NSURL *sourceURL; WebFrame *_webFrame; - BOOL _loadManually; - RefPtr<WebNetscapePluginStream> _manualStream; -#ifndef BUILDING_ON_TIGER - CALayer *_layer; -#endif - unsigned _dataLengthReceived; - NSError *_error; - - int mode; - - unsigned argsCount; - char **cAttributes; - char **cValues; - - NPP plugin; - NPWindow window; - NPWindow lastSetWindow; - PluginPort nPort; - PluginPort lastSetPort; - NPDrawingModel drawingModel; - NPEventModel eventModel; + int _mode; - -#ifndef NP_NO_QUICKDRAW - // This is only valid when drawingModel is NPDrawingModelQuickDraw - GWorldPtr offscreenGWorld; -#endif - - WebNetscapePluginEventHandler *eventHandler; - - BOOL isStarted; - BOOL inSetWindow; - BOOL hasFocus; - BOOL isTransparent; - BOOL isCompletelyObscured; - BOOL shouldStopSoon; - - BOOL shouldFireTimers; - uint32 currentTimerID; - HashMap<uint32, PluginTimer*>* timers; - - unsigned pluginFunctionCallDepth; - - DOMElement *element; - - int32 specifiedHeight; - int32 specifiedWidth; - - NSString *MIMEType; - NSURL *baseURL; - NSTrackingRectTag trackingTag; - - HashSet<RefPtr<WebNetscapePluginStream> > streams; - NSMutableDictionary *pendingFrameLoads; + BOOL _loadManually; + BOOL _shouldFireTimers; + BOOL _isStarted; + BOOL _hasFocus; + BOOL _isCompletelyObscured; - NPPluginTextInputFuncs *textInputFuncs; + RetainPtr<DOMElement> _element; + RetainPtr<NSString> _MIMEType; + RetainPtr<NSURL> _baseURL; + RetainPtr<NSURL> _sourceURL; - NPP_NewProcPtr NPP_New; - NPP_DestroyProcPtr NPP_Destroy; - NPP_SetWindowProcPtr NPP_SetWindow; - NPP_NewStreamProcPtr NPP_NewStream; - NPP_DestroyStreamProcPtr NPP_DestroyStream; - NPP_StreamAsFileProcPtr NPP_StreamAsFile; - NPP_WriteReadyProcPtr NPP_WriteReady; - NPP_WriteProcPtr NPP_Write; - NPP_PrintProcPtr NPP_Print; - NPP_HandleEventProcPtr NPP_HandleEvent; - NPP_URLNotifyProcPtr NPP_URLNotify; - NPP_GetValueProcPtr NPP_GetValue; - NPP_SetValueProcPtr NPP_SetValue; + NSTrackingRectTag _trackingTag; } -+ (WebBaseNetscapePluginView *)currentPluginView; - - - (id)initWithFrame:(NSRect)r pluginPackage:(WebNetscapePluginPackage *)thePluginPackage URL:(NSURL *)URL @@ -151,74 +70,31 @@ typedef struct _NPPluginTextInputFuncs NPPluginTextInputFuncs; loadManually:(BOOL)loadManually DOMElement:(DOMElement *)anElement; +- (WebNetscapePluginPackage *)pluginPackage; -- (BOOL)start; -- (BOOL)isStarted; -- (void)stop; -- (void)stopTimers; -- (void)restartTimers; +- (NSMutableURLRequest *)requestWithURLCString:(const char *)URLCString; + +// Subclasses must override these. +- (void)handleMouseMoved:(NSEvent *)event; +- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values; +- (void)focusChanged; - (WebFrame *)webFrame; - (WebDataSource *)dataSource; - (WebView *)webView; - (NSWindow *)currentWindow; -- (NPP)plugin; +- (void)removeTrackingRect; +- (void)resetTrackingRect; -- (WebNetscapePluginPackage *)pluginPackage; -- (void)setPluginPackage:(WebNetscapePluginPackage *)thePluginPackage; -- (void)setMIMEType:(NSString *)theMIMEType; -- (void)setBaseURL:(NSURL *)theBaseURL; -- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values; -- (void)setMode:(int)theMode; -- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow; -- (void)viewDidMoveToHostWindow; -- (void)disconnectStream:(WebNetscapePluginStream*)stream; - -// Returns the NPObject that represents the plugin interface. -// The return value is expected to be retained. -- (NPObject *)createPluginScriptableObject; - -// -willCallPlugInFunction must be called before calling any of the NPP_* functions for this view's plugin. -// This is necessary to ensure that plug-ins are not destroyed while WebKit calls into them. Some plug-ins (Flash -// at least) are written with the assumption that nothing they do in their plug-in functions can cause NPP_Destroy() -// to be called. Unfortunately, this is not true, especially if the plug-in uses NPN_Invoke() to execute a -// document.write(), which clears the document and destroys the plug-in. -// See <rdar://problem/4480737>. -- (void)willCallPlugInFunction; - -// -didCallPlugInFunction should be called after returning from a plug-in function. It should be called exactly -// once for every call to -willCallPlugInFunction. -// See <rdar://problem/4480737>. -- (void)didCallPlugInFunction; - -- (void)handleMouseMoved:(NSEvent *)event; - -@end +- (void)stopTimers; +- (void)startTimers; +- (void)restartTimers; -@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; +- (void)stop; +- (void)addWindowObservers; +- (void)removeWindowObservers; @end #endif diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index 2097673..a2a8b50 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.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 @@ -30,1100 +30,250 @@ #import "WebBaseNetscapePluginView.h" -#import "WebDataSourceInternal.h" -#import "WebDefaultUIDelegate.h" -#import "WebFrameInternal.h" -#import "WebFrameView.h" -#import "WebGraphicsExtras.h" +#import "WebFrameInternal.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebKitSystemInterface.h" -#import "WebNSDataExtras.h" -#import "WebNSDictionaryExtras.h" -#import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" -#import "WebNSViewExtras.h" -#import "WebNetscapePluginPackage.h" -#import "WebBaseNetscapePluginStream.h" -#import "WebNetscapePluginEventHandler.h" -#import "WebNullPluginView.h" -#import "WebPreferences.h" +#import "WebView.h" #import "WebViewInternal.h" -#import "WebUIDelegatePrivate.h" -#import <Carbon/Carbon.h> -#import <runtime/JSLock.h> -#import <WebCore/npruntime_impl.h> + +#import <WebCore/WebCoreObjCExtras.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 <WebCore/Frame.h> +#import <WebCore/FrameLoader.h> +#import <WebCore/Page.h> #import <WebKit/DOMPrivate.h> -#import <WebKit/WebUIDelegate.h> +#import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> -#import <objc/objc-runtime.h> - -using namespace WebCore; #define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification" #define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification" -static inline bool isDrawingModelQuickDraw(NPDrawingModel drawingModel) -{ -#ifndef NP_NO_QUICKDRAW - return drawingModel == NPDrawingModelQuickDraw; -#else - return false; -#endif -}; - -@interface WebBaseNetscapePluginView (Internal) -- (void)_viewHasMoved; -- (NPError)_createPlugin; -- (void)_destroyPlugin; -- (NSBitmapImageRep *)_printedPluginBitmap; -- (void)_redeliverStream; -@end - -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 - -typedef struct { - GrafPtr oldPort; - GDHandle oldDevice; - Point oldOrigin; - RgnHandle oldClipRegion; - RgnHandle oldVisibleRegion; - RgnHandle clipRegion; - BOOL forUpdate; -} PortState_QD; - -#endif /* NP_NO_QUICKDRAW */ - -typedef struct { - CGContextRef context; -} PortState_CG; - -@class NSTextInputContext; -@interface NSResponder (AppKitDetails) -- (NSTextInputContext *)inputContext; -@end - -@interface WebPluginRequest : NSObject -{ - NSURLRequest *_request; - NSString *_frameName; - void *_notifyData; - BOOL _didStartFromUserGesture; - BOOL _sendNotification; -} - -- (id)initWithRequest:(NSURLRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData sendNotification:(BOOL)sendNotification didStartFromUserGesture:(BOOL)currentEventIsUserGesture; - -- (NSURLRequest *)request; -- (NSString *)frameName; -- (void *)notifyData; -- (BOOL)isCurrentEventUserGesture; -- (BOOL)sendNotification; - -@end - -@interface NSData (WebPluginDataExtras) -- (BOOL)_web_startsWithBlankLine; -- (NSInteger)_web_locationAfterFirstBlankLine; -@end - -@interface WebBaseNetscapePluginView (ForwardDeclarations) -- (void)setWindowIfNecessary; -- (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification; -@end +using namespace WebCore; @implementation WebBaseNetscapePluginView + (void)initialize { + JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif WKSendUserChangeNotifications(); } -#pragma mark EVENTS - -- (BOOL)superviewsHaveSuperviews -{ - NSView *contentView = [[self window] contentView]; - NSView *view; - for (view = self; view != nil; view = [view superview]) { - if (view == contentView) { - return YES; - } - } - return NO; -} - - -// 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 +- (id)initWithFrame:(NSRect)frame + pluginPackage:(WebNetscapePluginPackage *)pluginPackage + URL:(NSURL *)URL + baseURL:(NSURL *)baseURL + MIMEType:(NSString *)MIME + attributeKeys:(NSArray *)keys + attributeValues:(NSArray *)values + loadManually:(BOOL)loadManually + DOMElement:(DOMElement *)anElement { -#ifndef NP_NO_QUICKDRAW - ASSERT(isDrawingModelQuickDraw(drawingModel)); - - NSWindow *currentWindow = [self currentWindow]; - if ([currentWindow isKindOfClass:objc_getClass("NSCarbonWindow")]) - return; + self = [super initWithFrame:frame]; + if (!self) + return nil; - float windowHeight = [currentWindow frame].size.height; - NSView *contentView = [currentWindow contentView]; - NSRect contentRect = [contentView convertRect:[contentView frame] toView:nil]; // convert to window-relative coordinates + _pluginPackage = pluginPackage; + _element = anElement; + _sourceURL.adoptNS([URL copy]); + _baseURL.adoptNS([baseURL copy]); + _MIMEType.adoptNS([MIME copy]); - CGrafPtr oldPort; - GetPort(&oldPort); - SetPort(GetWindowPort((WindowRef)[currentWindow windowRef])); + [self setAttributeKeys:keys andValues:values]; + if (loadManually) + _mode = NP_FULL; + else + _mode = NP_EMBED; - MovePortTo(static_cast<short>(contentRect.origin.x), /* Flip Y */ static_cast<short>(windowHeight - NSMaxY(contentRect))); - PortSize(static_cast<short>(contentRect.size.width), static_cast<short>(contentRect.size.height)); + _loadManually = loadManually; - SetPort(oldPort); -#endif + return self; } -#ifndef NP_NO_QUICKDRAW -static UInt32 getQDPixelFormatForBitmapContext(CGContextRef context) +- (void)dealloc { - UInt32 byteOrder = CGBitmapContextGetBitmapInfo(context) & kCGBitmapByteOrderMask; - if (byteOrder == kCGBitmapByteOrderDefault) - switch (CGBitmapContextGetBitsPerPixel(context)) { - case 16: - byteOrder = kCGBitmapByteOrder16Host; - break; - case 32: - byteOrder = kCGBitmapByteOrder32Host; - break; - } - switch (byteOrder) { - case kCGBitmapByteOrder16Little: - return k16LE555PixelFormat; - case kCGBitmapByteOrder32Little: - return k32BGRAPixelFormat; - case kCGBitmapByteOrder16Big: - return k16BE555PixelFormat; - case kCGBitmapByteOrder32Big: - return k32ARGBPixelFormat; - } - ASSERT_NOT_REACHED(); - return 0; -} + ASSERT(!_isStarted); -static inline void getNPRect(const CGRect& cgr, NPRect& npr) -{ - npr.top = static_cast<uint16>(cgr.origin.y); - npr.left = static_cast<uint16>(cgr.origin.x); - npr.bottom = static_cast<uint16>(CGRectGetMaxY(cgr)); - npr.right = static_cast<uint16>(CGRectGetMaxX(cgr)); + [super dealloc]; } -#endif - -static inline void getNPRect(const NSRect& nr, NPRect& npr) +- (void)finalize { - npr.top = static_cast<uint16>(nr.origin.y); - npr.left = static_cast<uint16>(nr.origin.x); - npr.bottom = static_cast<uint16>(NSMaxY(nr)); - npr.right = static_cast<uint16>(NSMaxX(nr)); -} + ASSERT_MAIN_THREAD(); + ASSERT(!_isStarted); -- (NSRect)visibleRect -{ - // WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch - // that clip now. - return NSIntersectionRect([self convertRect:[element _windowClipRect] fromView:nil], [super visibleRect]); + [super finalize]; } -- (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate +- (WebNetscapePluginPackage *)pluginPackage { - ASSERT(drawingModel != NPDrawingModelCoreAnimation); - ASSERT([self currentWindow] != nil); - - // 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 (isDrawingModelQuickDraw(drawingModel)) - [self fixWindowPort]; - - // 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]; - - // Flip Y to convert NSWindow coordinates to top-left-based window coordinates. - float borderViewHeight = [[self currentWindow] frame].size.height; - boundsInWindow.origin.y = borderViewHeight - NSMaxY(boundsInWindow); - 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 (isDrawingModelQuickDraw(drawingModel)) { - ::Rect portBounds; - CGrafPtr port = GetWindowPort(windowRef); - GetPortBounds(port, &portBounds); - - PixMap *pix = *GetPortPixMap(port); - boundsInWindow.origin.x += pix->bounds.left - portBounds.left; - boundsInWindow.origin.y += pix->bounds.top - portBounds.top; - visibleRectInWindow.origin.x += pix->bounds.left - portBounds.left; - visibleRectInWindow.origin.y += pix->bounds.top - portBounds.top; - } -#endif - - window.x = (int32)boundsInWindow.origin.x; - window.y = (int32)boundsInWindow.origin.y; - window.width = static_cast<uint32>(NSWidth(boundsInWindow)); - window.height = static_cast<uint32>(NSHeight(boundsInWindow)); - - // "Clip-out" the plug-in when: - // 1) it's not really in a window or off-screen or has no height or width. - // 2) window.x is a "big negative number" which is how WebCore expresses off-screen widgets. - // 3) the window is miniaturized or the app is hidden - // 4) we're inside of viewWillMoveToWindow: with a nil window. In this case, superviews may already have nil - // superviews and nil windows and results from convertRect:toView: are incorrect. - NSWindow *realWindow = [self window]; - if (window.width <= 0 || window.height <= 0 || window.x < -100000 - || realWindow == nil || [realWindow isMiniaturized] - || [NSApp isHidden] - || ![self superviewsHaveSuperviews] - || [self isHiddenOrHasHiddenAncestor]) { - - // The following code tries to give plug-ins the same size they will eventually have. - // The specifiedWidth and specifiedHeight variables are used to predict the size that - // WebCore will eventually resize us to. - - // The QuickTime plug-in has problems if you give it a width or height of 0. - // Since other plug-ins also might have the same sort of trouble, we make sure - // to always give plug-ins a size other than 0,0. - - if (window.width <= 0) - window.width = specifiedWidth > 0 ? specifiedWidth : 100; - if (window.height <= 0) - window.height = specifiedHeight > 0 ? specifiedHeight : 100; - - window.clipRect.bottom = window.clipRect.top; - window.clipRect.left = window.clipRect.right; - } else { - getNPRect(visibleRectInWindow, window.clipRect); - } - - // Save the port state, set up the port for entry into the plugin - PortState portState; - switch (drawingModel) { -#ifndef NP_NO_QUICKDRAW - case NPDrawingModelQuickDraw: { - // Set up NS_Port. - ::Rect portBounds; - CGrafPtr port = GetWindowPort(windowRef); - GetPortBounds(port, &portBounds); - nPort.qdPort.port = port; - nPort.qdPort.portx = (int32)-boundsInWindow.origin.x; - nPort.qdPort.porty = (int32)-boundsInWindow.origin.y; - window.window = &nPort; - - PortState_QD *qdPortState = (PortState_QD*)malloc(sizeof(PortState_QD)); - portState = (PortState)qdPortState; - - GetGWorld(&qdPortState->oldPort, &qdPortState->oldDevice); - - qdPortState->oldOrigin.h = portBounds.left; - qdPortState->oldOrigin.v = portBounds.top; - - qdPortState->oldClipRegion = NewRgn(); - GetPortClipRegion(port, qdPortState->oldClipRegion); - - qdPortState->oldVisibleRegion = NewRgn(); - GetPortVisibleRegion(port, qdPortState->oldVisibleRegion); - - RgnHandle clipRegion = NewRgn(); - qdPortState->clipRegion = clipRegion; - - CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - if (currentContext && WKCGContextIsBitmapContext(currentContext)) { - // We use WKCGContextIsBitmapContext here, because if we just called CGBitmapContextGetData - // on any context, we'd log to the console every time. But even if WKCGContextIsBitmapContext - // returns true, it still might not be a context we need to create a GWorld for; for example - // transparency layers will return true, but return 0 for CGBitmapContextGetData. - void* offscreenData = CGBitmapContextGetData(currentContext); - if (offscreenData) { - // If the current context is an offscreen bitmap, then create a GWorld for it. - ::Rect offscreenBounds; - offscreenBounds.top = 0; - offscreenBounds.left = 0; - offscreenBounds.right = CGBitmapContextGetWidth(currentContext); - offscreenBounds.bottom = CGBitmapContextGetHeight(currentContext); - GWorldPtr newOffscreenGWorld; - QDErr err = NewGWorldFromPtr(&newOffscreenGWorld, - getQDPixelFormatForBitmapContext(currentContext), &offscreenBounds, 0, 0, 0, - static_cast<char*>(offscreenData), CGBitmapContextGetBytesPerRow(currentContext)); - ASSERT(newOffscreenGWorld && !err); - if (!err) { - if (offscreenGWorld) - DisposeGWorld(offscreenGWorld); - offscreenGWorld = newOffscreenGWorld; - - SetGWorld(offscreenGWorld, NULL); - - port = offscreenGWorld; - - nPort.qdPort.port = port; - boundsInWindow = [self bounds]; - - // Generate a QD origin based on the current affine transform for currentContext. - CGAffineTransform offscreenMatrix = CGContextGetCTM(currentContext); - CGPoint origin = {0,0}; - CGPoint axisFlip = {1,1}; - origin = CGPointApplyAffineTransform(origin, offscreenMatrix); - axisFlip = CGPointApplyAffineTransform(axisFlip, offscreenMatrix); - - // Quartz bitmaps have origins at the bottom left, but the axes may be inverted, so handle that. - origin.x = offscreenBounds.left - origin.x * (axisFlip.x - origin.x); - origin.y = offscreenBounds.bottom + origin.y * (axisFlip.y - origin.y); - - nPort.qdPort.portx = static_cast<int32>(-boundsInWindow.origin.x + origin.x); - nPort.qdPort.porty = static_cast<int32>(-boundsInWindow.origin.y - origin.y); - window.x = 0; - window.y = 0; - window.window = &nPort; - - // Use the clip bounds from the context instead of the bounds we created - // from the window above. - getNPRect(CGRectOffset(CGContextGetClipBoundingBox(currentContext), -origin.x, origin.y), window.clipRect); - } - } - } - - MacSetRectRgn(clipRegion, - 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 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); - } - } - - // Switch to the port and set it up. - SetPort(port); - PenNormal(); - ForeColor(blackColor); - BackColor(whiteColor); - SetOrigin(nPort.qdPort.portx, nPort.qdPort.porty); - SetPortClipRegion(nPort.qdPort.port, clipRegion); - - if (forUpdate) { - // AppKit may have tried to help us by doing a BeginUpdate. - // But the invalid region at that level didn't include AppKit's notion of what was not valid. - // We reset the port's visible region to counteract what BeginUpdate did. - SetPortVisibleRegion(nPort.qdPort.port, clipRegion); - InvalWindowRgn(windowRef, clipRegion); - } - - qdPortState->forUpdate = forUpdate; - break; - } -#endif /* NP_NO_QUICKDRAW */ - - case NPDrawingModelCoreGraphics: { - ASSERT([NSView focusView] == self); - - CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); - - PortState_CG *cgPortState = (PortState_CG *)malloc(sizeof(PortState_CG)); - portState = (PortState)cgPortState; - cgPortState->context = context; - - // Update the plugin's window/context -#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); - - // 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; - } - - default: - ASSERT_NOT_REACHED(); - portState = NULL; - break; - } - - return portState; + return _pluginPackage.get(); } - -- (PortState)saveAndSetNewPortState + +- (BOOL)isFlipped { - return [self saveAndSetNewPortStateForUpdate:NO]; + return YES; } -- (void)restorePortState:(PortState)portState +- (NSMutableURLRequest *)requestWithURLCString:(const char *)URLCString { - if (drawingModel == NPDrawingModelCoreAnimation) - return; - - ASSERT([self currentWindow]); - ASSERT(portState); + if (!URLCString) + return nil; - switch (drawingModel) { -#ifndef NP_NO_QUICKDRAW - case NPDrawingModelQuickDraw: { - PortState_QD *qdPortState = (PortState_QD *)portState; - WindowRef windowRef = (WindowRef)[[self currentWindow] windowRef]; - CGrafPtr port = GetWindowPort(windowRef); - - SetPort(port); - - if (qdPortState->forUpdate) - ValidWindowRgn(windowRef, qdPortState->clipRegion); - - SetOrigin(qdPortState->oldOrigin.h, qdPortState->oldOrigin.v); - - SetPortClipRegion(port, qdPortState->oldClipRegion); - if (qdPortState->forUpdate) - SetPortVisibleRegion(port, qdPortState->oldVisibleRegion); - - DisposeRgn(qdPortState->oldClipRegion); - DisposeRgn(qdPortState->oldVisibleRegion); - DisposeRgn(qdPortState->clipRegion); - - SetGWorld(qdPortState->oldPort, qdPortState->oldDevice); - break; - } -#endif /* NP_NO_QUICKDRAW */ - - case NPDrawingModelCoreGraphics: - ASSERT([NSView focusView] == self); - ASSERT(((PortState_CG *)portState)->context == nPort.cgPort.context); - CGContextRestoreGState(nPort.cgPort.context); - break; - - default: - ASSERT_NOT_REACHED(); - break; - } -} - -- (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect -{ - if (![self window]) - return NO; - ASSERT(event); - - if (!isStarted) - return NO; - - ASSERT(NPP_HandleEvent); + CFStringRef string = CFStringCreateWithCString(kCFAllocatorDefault, URLCString, kCFStringEncodingISOLatin1); + ASSERT(string); // All strings should be representable in ISO Latin 1 - // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow. - // We probably don't want more general reentrancy protection; we are really - // protecting only against this one case, which actually comes up when - // you first install the SVG viewer plug-in. - if (inSetWindow) - return NO; - + NSString *URLString = [(NSString *)string _web_stringByStrippingReturnCharacters]; + NSURL *URL = [NSURL _web_URLWithDataAsString:URLString relativeToURL:_baseURL.get()]; + CFRelease(string); + if (!URL) + return nil; + + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL]; Frame* frame = core([self webFrame]); if (!frame) - return NO; - Page* page = frame->page(); - if (!page) - return NO; - - bool wasDeferring = page->defersLoading(); - if (!wasDeferring) - page->setDefersLoading(true); - - // Can only send drawRect (updateEvt) to CoreGraphics plugins when actually drawing - ASSERT((drawingModel != NPDrawingModelCoreGraphics) || !eventIsDrawRect || [NSView focusView] == self); - - 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]; - } - -#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 (isDrawingModelQuickDraw(drawingModel) && !isTransparent && eventIsDrawRect) { - ForeColor(greenColor); - const ::Rect bigRect = { -10000, -10000, 10000, 10000 }; - PaintRect(&bigRect); - ForeColor(blackColor); - } -#endif - - // Temporarily retain self in case the plug-in view is released while sending an event. - [[self retain] autorelease]; - - BOOL acceptedEvent; - [self willCallPlugInFunction]; - { - JSC::JSLock::DropAllLocks dropAllLocks(false); - acceptedEvent = NPP_HandleEvent(plugin, event); - } - [self didCallPlugInFunction]; - - if (portState) { - if ([self currentWindow]) - [self restorePortState:portState]; - free(portState); - } - - if (!wasDeferring) - page->setDefersLoading(false); - - return acceptedEvent; + return nil; + [request _web_setHTTPReferrer:frame->loader()->outgoingReferrer()]; + return request; } -- (void)sendActivateEvent:(BOOL)activate +// Methods that subclasses must override +- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values { - if (!isStarted) - return; - - eventHandler->windowFocusChanged(activate); + ASSERT_NOT_REACHED(); } -- (void)sendDrawRectEvent:(NSRect)rect +- (void)handleMouseMoved:(NSEvent *)event { - ASSERT(eventHandler); - - eventHandler->drawRect(rect); + ASSERT_NOT_REACHED(); } -- (void)stopTimers +- (void)focusChanged { - if (eventHandler) - eventHandler->stopTimers(); - - shouldFireTimers = NO; - - 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; - timer->stop(); - } + ASSERT_NOT_REACHED(); } -- (void)restartTimers +- (void)windowFocusChanged:(BOOL)hasFocus { - ASSERT([self window]); - - if (shouldFireTimers) - [self stopTimers]; - - if (!isStarted || [[self window] isMiniaturized]) - return; - - shouldFireTimers = YES; - - // If the plugin is completely obscured (scrolled out of view, for example), then we will - // send null events at a reduced rate. - 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); - } + ASSERT_NOT_REACHED(); } -- (BOOL)acceptsFirstResponder +- (BOOL)createPlugin { - return YES; + ASSERT_NOT_REACHED(); + return NO; } -- (void)setHasFocus:(BOOL)flag +- (void)loadStream { - 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); + ASSERT_NOT_REACHED(); } -- (BOOL)becomeFirstResponder +- (BOOL)shouldStop { - [self setHasFocus:YES]; + ASSERT_NOT_REACHED(); return YES; } -- (BOOL)resignFirstResponder +- (void)destroyPlugin { - [self setHasFocus:NO]; - return YES; + ASSERT_NOT_REACHED(); } -// AppKit doesn't call mouseDown or mouseUp on right-click. Simulate control-click -// mouseDown and mouseUp so plug-ins get the right-click event as they do in Carbon (3125743). -- (void)rightMouseDown:(NSEvent *)theEvent +- (void)updateAndSetWindow { - [self mouseDown:theEvent]; + ASSERT_NOT_REACHED(); } -- (void)rightMouseUp:(NSEvent *)theEvent +- (void)removeTrackingRect { - [self mouseUp:theEvent]; + if (_trackingTag) { + [self removeTrackingRect:_trackingTag]; + _trackingTag = 0; + + // Do the following after setting trackingTag to 0 so we don't re-enter. + + // Balance the retain in resetTrackingRect. Use autorelease in case we hold + // the last reference to the window during tear-down, to avoid crashing AppKit. + [[self window] autorelease]; + } } -- (void)mouseDown:(NSEvent *)theEvent +- (void)resetTrackingRect { - if (!isStarted) - return; - - eventHandler->mouseDown(theEvent); + [self removeTrackingRect]; + if (_isStarted) { + // Retain the window so that removeTrackingRect can work after the window is closed. + [[self window] retain]; + _trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO]; + } } -- (void)mouseUp:(NSEvent *)theEvent +- (void)stopTimers { - if (!isStarted) - return; - - eventHandler->mouseUp(theEvent); + _shouldFireTimers = NO; } -- (void)mouseEntered:(NSEvent *)theEvent +- (void)startTimers { - if (!isStarted) - return; - - eventHandler->mouseEntered(theEvent); + _shouldFireTimers = YES; } -- (void)mouseExited:(NSEvent *)theEvent +- (void)restartTimers { - if (!isStarted) - return; - - eventHandler->mouseExited(theEvent); + ASSERT([self window]); - // 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]; -} - -// 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); -} + [self stopTimers]; -- (void)mouseDragged:(NSEvent *)theEvent -{ - if (!isStarted) + if (!_isStarted || [[self window] isMiniaturized]) return; - - eventHandler->mouseDragged(theEvent); -} - -- (void)scrollWheel:(NSEvent *)theEvent -{ - if (!isStarted) { - [super scrollWheel:theEvent]; - return; - } - - if (!eventHandler->scrollWheel(theEvent)) - [super scrollWheel:theEvent]; -} - -- (void)keyUp:(NSEvent *)theEvent -{ - if (!isStarted) - return; - - eventHandler->keyUp(theEvent); -} - -- (void)keyDown:(NSEvent *)theEvent -{ - if (!isStarted) - return; - - eventHandler->keyDown(theEvent); -} - -- (void)flagsChanged:(NSEvent *)theEvent -{ - if (!isStarted) - return; - - eventHandler->flagsChanged(theEvent); -} - -- (void)cut:(id)sender -{ - if (!isStarted) - return; - - eventHandler->keyDown([NSApp currentEvent]); -} - -- (void)copy:(id)sender -{ - if (!isStarted) - return; - - eventHandler->keyDown([NSApp currentEvent]); -} - -- (void)paste:(id)sender -{ - if (!isStarted) - return; - - eventHandler->keyDown([NSApp currentEvent]); + + [self startTimers]; } -- (void)selectAll:(id)sender +- (NSRect)visibleRect { - if (!isStarted) - return; - - eventHandler->keyDown([NSApp currentEvent]); + // WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch + // that clip now. + return NSIntersectionRect([self convertRect:[_element.get() _windowClipRect] fromView:nil], [super visibleRect]); } -#pragma mark WEB_NETSCAPE_PLUGIN - -- (BOOL)isNewWindowEqualToOldWindow +- (BOOL)acceptsFirstResponder { - ASSERT(drawingModel != NPDrawingModelCoreAnimation); - - if (window.x != lastSetWindow.x) - return NO; - if (window.y != lastSetWindow.y) - return NO; - if (window.width != lastSetWindow.width) - return NO; - if (window.height != lastSetWindow.height) - return NO; - if (window.clipRect.top != lastSetWindow.clipRect.top) - return NO; - if (window.clipRect.left != lastSetWindow.clipRect.left) - return NO; - if (window.clipRect.bottom != lastSetWindow.clipRect.bottom) - return NO; - if (window.clipRect.right != lastSetWindow.clipRect.right) - return NO; - if (window.type != lastSetWindow.type) - return NO; - - switch (drawingModel) { -#ifndef NP_NO_QUICKDRAW - case NPDrawingModelQuickDraw: - if (nPort.qdPort.portx != lastSetPort.qdPort.portx) - return NO; - if (nPort.qdPort.porty != lastSetPort.qdPort.porty) - return NO; - if (nPort.qdPort.port != lastSetPort.qdPort.port) - return NO; - break; -#endif /* NP_NO_QUICKDRAW */ - - case NPDrawingModelCoreGraphics: - if (nPort.cgPort.window != lastSetPort.cgPort.window) - return NO; - if (nPort.cgPort.context != lastSetPort.cgPort.context) - return NO; - break; - - default: - ASSERT_NOT_REACHED(); - break; - } - return YES; } -- (void)updateAndSetWindow +- (void)sendActivateEvent:(BOOL)activate { - 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 - // excpetion to rule (3) because they manually must be told when to stop writing - // bits to the window backing store, thus to do so requires a new call to - // NPP_SetWindow() with an empty NPWindow struct. - if (!isStarted) - return; -#ifdef NP_NO_QUICKDRAW - if (![self canDraw]) - return; -#else - if (drawingModel != NPDrawingModelQuickDraw && ![self canDraw]) + if (!_isStarted) 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]; - [self restorePortState:portState]; - free(portState); - } - if (didLockFocus) - [self unlockFocus]; + [self windowFocusChanged:activate]; } -- (void)setWindowIfNecessary +- (void)setHasFocus:(BOOL)flag { - ASSERT(drawingModel != NPDrawingModelCoreAnimation); - - if (!isStarted) { + if (!_isStarted) return; - } - if (![self isNewWindowEqualToOldWindow]) { - // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow. - // We probably don't want more general reentrancy protection; we are really - // protecting only against this one case, which actually comes up when - // you first install the SVG viewer plug-in. - NPError npErr; - ASSERT(!inSetWindow); - - inSetWindow = YES; - - // A CoreGraphics plugin's window may only be set while the plugin is being updated - ASSERT((drawingModel != NPDrawingModelCoreGraphics) || [NSView focusView] == self); - - [self willCallPlugInFunction]; - { - JSC::JSLock::DropAllLocks dropAllLocks(false); - npErr = NPP_SetWindow(plugin, &window); - } - [self didCallPlugInFunction]; - inSetWindow = NO; - -#ifndef NDEBUG - switch (drawingModel) { -#ifndef NP_NO_QUICKDRAW - case NPDrawingModelQuickDraw: - LOG(Plugins, "NPP_SetWindow (QuickDraw): %d, port=0x%08x, window.x:%d window.y:%d window.width:%d window.height:%d", - npErr, (int)nPort.qdPort.port, (int)window.x, (int)window.y, (int)window.width, (int)window.height); - break; -#endif /* NP_NO_QUICKDRAW */ - - case NPDrawingModelCoreGraphics: - LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d", - npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height); - break; - - default: - ASSERT_NOT_REACHED(); - break; - } -#endif /* !defined(NDEBUG) */ - - lastSetWindow = window; - lastSetPort = nPort; - } -} - -- (void)removeTrackingRect -{ - if (trackingTag) { - [self removeTrackingRect:trackingTag]; - trackingTag = 0; - - // Do the following after setting trackingTag to 0 so we don't re-enter. - - // Balance the retain in resetTrackingRect. Use autorelease in case we hold - // the last reference to the window during tear-down, to avoid crashing AppKit. - [[self window] autorelease]; - } -} - -- (void)resetTrackingRect -{ - [self removeTrackingRect]; - if (isStarted) { - // Retain the window so that removeTrackingRect can work after the window is closed. - [[self window] retain]; - trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO]; - } -} - -+ (void)setCurrentPluginView:(WebBaseNetscapePluginView *)view -{ - currentPluginView = view; -} - -+ (WebBaseNetscapePluginView *)currentPluginView -{ - return currentPluginView; -} - -- (BOOL)canStart -{ - return YES; -} - -- (void)didStart -{ - if (_loadManually) { - [self _redeliverStream]; + if (_hasFocus == flag) return; - } - // If the OBJECT/EMBED tag has no SRC, the URL is passed to us as "". - // Check for this and don't start a load in this case. - if (sourceURL != nil && ![sourceURL _web_isEmpty]) { - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:sourceURL]; - [request _web_setHTTPReferrer:core([self webFrame])->loader()->outgoingReferrer()]; - [self loadRequest:request inTarget:nil withNotifyData:nil sendNotification:NO]; - } + _hasFocus = flag; + + [self focusChanged]; } - (void)addWindowObservers { ASSERT([self window]); - + NSWindow *theWindow = [self window]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; @@ -1156,106 +306,42 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) [notificationCenter removeObserver:self name:LoginWindowDidSwitchToUserNotification object:nil]; } -- (BOOL)start +- (void)start { ASSERT([self currentWindow]); - if (isStarted) - return YES; - - if (![self canStart]) - return NO; + if (_isStarted) + return; ASSERT([self webView]); if (![[[self webView] preferences] arePlugInsEnabled]) - return NO; - - // Open the plug-in package so it remains loaded while our plugin uses it - [pluginPackage open]; - - // 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; - - NPError npErr = [self _createPlugin]; - if (npErr != NPERR_NO_ERROR) { - LOG_ERROR("NPP_New failed with error: %d", npErr); - [self _destroyPlugin]; - [pluginPackage close]; - return NO; - } + return; + + Frame* frame = core([self webFrame]); + if (!frame) + return; + Page* page = frame->page(); + if (!page) + return; - if (drawingModel == (NPDrawingModel)-1) { -#ifndef NP_NO_QUICKDRAW - // 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. 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 - } + bool wasDeferring = page->defersLoading(); + if (!wasDeferring) + page->setDefersLoading(true); -#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 + BOOL result = [self createPlugin]; -#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); - } + if (!wasDeferring) + page->setDefersLoading(false); - ASSERT(_layer); - } -#endif + if (!result) + return; - // Create the event handler - eventHandler = WebNetscapePluginEventHandler::create(self); + _isStarted = YES; + [[self webView] addPluginInstanceView: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]; - } + [self updateAndSetWindow]; - isStarted = YES; - [[self webView] addPluginInstanceView:self]; - - if (drawingModel == NPDrawingModelCoreGraphics || isDrawingModelQuickDraw(drawingModel)) - [self updateAndSetWindow]; - if ([self window]) { [self addWindowObservers]; if ([[self window] isKeyWindow]) { @@ -1263,353 +349,37 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) } [self restartTimers]; } - - [self resetTrackingRect]; - [self didStart]; + [self resetTrackingRect]; - return YES; + [self loadStream]; } - (void)stop { - // If we're already calling a plug-in function, do not call NPP_Destroy(). The plug-in function we are calling - // may assume that its instance->pdata, or other memory freed by NPP_Destroy(), is valid and unchanged until said - // plugin-function returns. - // See <rdar://problem/4480737>. - if (pluginFunctionCallDepth > 0) { - shouldStopSoon = YES; + if (![self shouldStop]) return; - } [self removeTrackingRect]; - - if (!isStarted) + + if (!_isStarted) return; - isStarted = NO; + _isStarted = NO; [[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 timers [self stopTimers]; // Stop notifications and callbacks. [self removeWindowObservers]; - [[pendingFrameLoads allKeys] makeObjectsPerformSelector:@selector(_setInternalLoadDelegate:) withObject:nil]; - [NSObject cancelPreviousPerformRequestsWithTarget:self]; - - // Setting the window type to 0 ensures that NPP_SetWindow will be called if the plug-in is restarted. - lastSetWindow.type = (NPWindowType)0; - - [self _destroyPlugin]; - [pluginPackage close]; - - delete eventHandler; - eventHandler = 0; - - textInputFuncs = 0; -} - -- (BOOL)isStarted -{ - return isStarted; -} - -- (NPEventModel)eventModel -{ - return eventModel; -} - -- (WebDataSource *)dataSource -{ - WebFrame *webFrame = kit(core(element)->document()->frame()); - return [webFrame _dataSource]; -} - -- (WebFrame *)webFrame -{ - return [[self dataSource] webFrame]; -} - -- (WebView *)webView -{ - return [[self webFrame] webView]; -} - -- (NSWindow *)currentWindow -{ - return [self window] ? [self window] : [[self webView] hostWindow]; -} - -- (NPP)plugin -{ - return plugin; -} - -- (WebNetscapePluginPackage *)pluginPackage -{ - return pluginPackage; -} - -- (void)setPluginPackage:(WebNetscapePluginPackage *)thePluginPackage; -{ - [thePluginPackage retain]; - [pluginPackage release]; - pluginPackage = thePluginPackage; - - NPP_New = [pluginPackage NPP_New]; - NPP_Destroy = [pluginPackage NPP_Destroy]; - NPP_SetWindow = [pluginPackage NPP_SetWindow]; - 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_HandleEvent = [pluginPackage NPP_HandleEvent]; - NPP_URLNotify = [pluginPackage NPP_URLNotify]; - NPP_GetValue = [pluginPackage NPP_GetValue]; - NPP_SetValue = [pluginPackage NPP_SetValue]; - NPP_Print = [pluginPackage NPP_Print]; -} - -- (void)setMIMEType:(NSString *)theMIMEType -{ - NSString *type = [theMIMEType copy]; - [MIMEType release]; - MIMEType = type; -} - -- (void)setBaseURL:(NSURL *)theBaseURL -{ - [theBaseURL retain]; - [baseURL release]; - baseURL = theBaseURL; -} - -- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values; -{ - ASSERT([keys count] == [values count]); - - // Convert the attributes to 2 C string arrays. - // These arrays are passed to NPP_New, but the strings need to be - // modifiable and live the entire life of the plugin. - - // The Java plug-in requires the first argument to be the base URL - if ([MIMEType isEqualToString:@"application/x-java-applet"]) { - cAttributes = (char **)malloc(([keys count] + 1) * sizeof(char *)); - cValues = (char **)malloc(([values count] + 1) * sizeof(char *)); - cAttributes[0] = strdup("DOCBASE"); - cValues[0] = strdup([baseURL _web_URLCString]); - argsCount++; - } else { - cAttributes = (char **)malloc([keys count] * sizeof(char *)); - cValues = (char **)malloc([values count] * sizeof(char *)); - } - - BOOL isWMP = [[[pluginPackage bundle] bundleIdentifier] isEqualToString:@"com.microsoft.WMP.defaultplugin"]; - - unsigned i; - unsigned count = [keys count]; - for (i = 0; i < count; i++) { - NSString *key = [keys objectAtIndex:i]; - NSString *value = [values objectAtIndex:i]; - if ([key _webkit_isCaseInsensitiveEqualToString:@"height"]) { - specifiedHeight = [value intValue]; - } else if ([key _webkit_isCaseInsensitiveEqualToString:@"width"]) { - specifiedWidth = [value intValue]; - } - // Avoid Window Media Player crash when these attributes are present. - if (isWMP && ([key _webkit_isCaseInsensitiveEqualToString:@"SAMIStyle"] || [key _webkit_isCaseInsensitiveEqualToString:@"SAMILang"])) { - continue; - } - cAttributes[argsCount] = strdup([key UTF8String]); - cValues[argsCount] = strdup([value UTF8String]); - LOG(Plugins, "%@ = %@", key, value); - argsCount++; - } -} - -- (void)setMode:(int)theMode -{ - mode = theMode; -} - -#pragma mark NSVIEW - -- (id)initWithFrame:(NSRect)frame - pluginPackage:(WebNetscapePluginPackage *)thePluginPackage - URL:(NSURL *)theURL - baseURL:(NSURL *)theBaseURL - MIMEType:(NSString *)MIME - attributeKeys:(NSArray *)keys - attributeValues:(NSArray *)values - loadManually:(BOOL)loadManually - DOMElement:(DOMElement *)anElement -{ - [super initWithFrame:frame]; - - pendingFrameLoads = [[NSMutableDictionary alloc] init]; - - // load the plug-in if it is not already loaded - if (![thePluginPackage load]) { - [self release]; - return nil; - } - [self setPluginPackage:thePluginPackage]; - - element = [anElement retain]; - sourceURL = [theURL retain]; - - [self setMIMEType:MIME]; - [self setBaseURL:theBaseURL]; - [self setAttributeKeys:keys andValues:values]; - if (loadManually) - [self setMode:NP_FULL]; - else - [self setMode:NP_EMBED]; - - _loadManually = loadManually; - return self; -} - -- (id)initWithFrame:(NSRect)frame -{ - ASSERT_NOT_REACHED(); - return nil; -} - -- (void)fini -{ -#ifndef NP_NO_QUICKDRAW - if (offscreenGWorld) - DisposeGWorld(offscreenGWorld); -#endif - - unsigned i; - for (i = 0; i < argsCount; i++) { - free(cAttributes[i]); - free(cValues[i]); - } - free(cAttributes); - free(cValues); - - ASSERT(!eventHandler); - - if (timers) { - deleteAllValues(*timers); - delete timers; - } -} - -- (void)disconnectStream:(WebNetscapePluginStream*)stream -{ - streams.remove(stream); -} - -- (void)dealloc -{ - ASSERT(!isStarted); - - [sourceURL release]; - [_error release]; - [pluginPackage release]; - [MIMEType release]; - [baseURL release]; - [pendingFrameLoads release]; - [element release]; - - ASSERT(!plugin); - - [self fini]; - - [super dealloc]; -} - -- (void)finalize -{ - ASSERT_MAIN_THREAD(); - ASSERT(!isStarted); - - [self fini]; - - [super finalize]; -} - -- (void)drawRect:(NSRect)rect -{ - if (drawingModel == NPDrawingModelCoreAnimation) - return; - - if (!isStarted) - return; - - if ([NSGraphicsContext currentContextDrawingToScreen]) - [self sendDrawRectEvent:rect]; - else { - NSBitmapImageRep *printedPluginBitmap = [self _printedPluginBitmap]; - if (printedPluginBitmap) { - // Flip the bitmap before drawing because the QuickDraw port 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); - [printedPluginBitmap drawInRect:bounds]; - CGContextRestoreGState(cgContext); - } - } -} - -- (BOOL)isFlipped -{ - return YES; -} - -- (void)renewGState -{ - [super renewGState]; - - // -renewGState is called whenever the view's geometry changes. It's a little hacky to override this method, but - // much safer than walking up the view hierarchy and observing frame/bounds changed notifications, since you don't - // have to track subsequent changes to the view hierarchy and add/remove notification observers. - // NSOpenGLView uses the exact same technique to reshape its OpenGL surface. - [self _viewHasMoved]; -} - --(void)tellQuickTimeToChill -{ -#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]; - if (!windowRef) { - return; - } - CGrafPtr port = GetWindowPort(windowRef); - ::Rect bounds; - GetPortBounds(port, &bounds); - WKCallDrawingNotification(port, &bounds); -#endif /* NP_NO_QUICKDRAW */ + [self destroyPlugin]; } - (void)viewWillMoveToWindow:(NSWindow *)newWindow { - if (isDrawingModelQuickDraw(drawingModel)) - [self tellQuickTimeToChill]; - // 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. [self removeTrackingRect]; @@ -1617,7 +387,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) // Workaround for: <rdar://problem/3822871> resignFirstResponder is not sent to first responder view when it is removed from the window [self setHasFocus:NO]; - + if (!newWindow) { if ([[self webView] hostWindow]) { // View will be moved out of the actual window but it still has a host window. @@ -1625,7 +395,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) } else { // View will have no associated windows. [self stop]; - + // Stop observing WebPreferencesChangedNotification -- we only need to observe this when installed in the view hierarchy. // When not in the view hierarchy, -viewWillMoveToWindow: and -viewDidMoveToWindow will start/stop the plugin as needed. [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; @@ -1655,10 +425,10 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) // While in the view hierarchy, observe WebPreferencesChangedNotification so that we can start/stop depending // on whether plugins are enabled. [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(preferencesHaveChanged:) - name:WebPreferencesChangedNotification - object:nil]; - + selector:@selector(preferencesHaveChanged:) + name:WebPreferencesChangedNotification + object:nil]; + // View moved to an actual window. Start it if not already started. [self start]; [self restartTimers]; @@ -1676,7 +446,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) if (!hostWindow && ![self window]) { // View will have no associated windows. [self stop]; - + // Remove WebPreferencesChangedNotification observer -- we will observe once again when we move back into the window [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; } @@ -1702,9 +472,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) [self sendActivateEvent:YES]; [self setNeedsDisplay:YES]; [self restartTimers]; -#ifndef NP_NO_CARBON - SetUserFocusWindow((WindowRef)[[self window] windowRef]); -#endif // NP_NO_CARBON } - (void)windowResignedKey:(NSNotification *)notification @@ -1721,7 +488,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) - (void)windowDidDeminiaturize:(NSNotification *)notification { - [self stopTimers]; + [self restartTimers]; } - (void)loginWindowDidSwitchFromUser:(NSNotification *)notification @@ -1739,7 +506,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) WebPreferences *preferences = [[self webView] preferences]; BOOL arePlugInsEnabled = [preferences arePlugInsEnabled]; - if ([notification object] == preferences && isStarted != arePlugInsEnabled) { + if ([notification object] == preferences && _isStarted != arePlugInsEnabled) { if (arePlugInsEnabled) { if ([self currentWindow]) { [self start]; @@ -1751,1198 +518,100 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) } } -- (NPObject *)createPluginScriptableObject -{ - if (!NPP_GetValue || ![self isStarted]) - return NULL; - - NPObject *value = NULL; - NPError error; - [self willCallPlugInFunction]; - { - JSC::JSLock::DropAllLocks dropAllLocks(false); - error = NPP_GetValue(plugin, NPPVpluginScriptableNPObject, &value); - } - [self didCallPlugInFunction]; - if (error != NPERR_NO_ERROR) - return NULL; - - return value; -} - -- (void)willCallPlugInFunction -{ - ASSERT(plugin); - - // Could try to prevent infinite recursion here, but it's probably not worth the effort. - pluginFunctionCallDepth++; -} - -- (void)didCallPlugInFunction -{ - ASSERT(pluginFunctionCallDepth > 0); - pluginFunctionCallDepth--; - - // If -stop was called while we were calling into a plug-in function, and we're no longer - // inside a plug-in function, stop now. - if (pluginFunctionCallDepth == 0 && shouldStopSoon) { - shouldStopSoon = NO; - [self stop]; - } -} - --(void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response -{ - ASSERT(_loadManually); - ASSERT(!_manualStream); - - _manualStream = WebNetscapePluginStream::create(core([self webFrame])->loader()); -} - -- (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data -{ - ASSERT(_loadManually); - ASSERT(_manualStream); - - _dataLengthReceived += [data length]; - - if (![self isStarted]) - return; - - 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->didReceiveData(0, static_cast<const char *>([data bytes]), [data length]); -} - -- (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error -{ - ASSERT(_loadManually); - - [error retain]; - [_error release]; - _error = error; - - if (![self isStarted]) { - return; - } - - _manualStream->destroyStreamWithError(error); -} - -- (void)pluginViewFinishedLoading:(NSView *)pluginView -{ - ASSERT(_loadManually); - ASSERT(_manualStream); - - if ([self isStarted]) - _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) - -- (NSMutableURLRequest *)requestWithURLCString:(const char *)URLCString -{ - if (!URLCString) - return nil; - - CFStringRef string = CFStringCreateWithCString(kCFAllocatorDefault, URLCString, kCFStringEncodingISOLatin1); - ASSERT(string); // All strings should be representable in ISO Latin 1 - - NSString *URLString = [(NSString *)string _web_stringByStrippingReturnCharacters]; - NSURL *URL = [NSURL _web_URLWithDataAsString:URLString relativeToURL:baseURL]; - CFRelease(string); - if (!URL) - return nil; - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL]; - Frame* frame = core([self webFrame]); - if (!frame) - return nil; - [request _web_setHTTPReferrer:frame->loader()->outgoingReferrer()]; - return request; -} - -- (void)evaluateJavaScriptPluginRequest:(WebPluginRequest *)JSPluginRequest +- (void)renewGState { - // FIXME: Is this isStarted check needed here? evaluateJavaScriptPluginRequest should not be called - // if we are stopped since this method is called after a delay and we call - // cancelPreviousPerformRequestsWithTarget inside of stop. - if (!isStarted) { - return; - } - - NSURL *URL = [[JSPluginRequest request] URL]; - NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; - ASSERT(JSString); + [super renewGState]; - NSString *result = [[self webFrame] _stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:[JSPluginRequest isCurrentEventUserGesture]]; + // -renewGState is called whenever the view's geometry changes. It's a little hacky to override this method, but + // much safer than walking up the view hierarchy and observing frame/bounds changed notifications, since you don't + // have to track subsequent changes to the view hierarchy and add/remove notification observers. + // NSOpenGLView uses the exact same technique to reshape its OpenGL surface. - // Don't continue if stringByEvaluatingJavaScriptFromString caused the plug-in to stop. - if (!isStarted) { + // All of the work this method does may safely be skipped if the view is not in a window. When the view + // is moved back into a window, everything should be set up correctly. + if (![self window]) return; - } - - if ([JSPluginRequest frameName] != nil) { - // FIXME: If the result is a string, we probably want to put that string into the frame. - if ([JSPluginRequest sendNotification]) { - [self willCallPlugInFunction]; - { - JSC::JSLock::DropAllLocks dropAllLocks(false); - NPP_URLNotify(plugin, [URL _web_URLCString], NPRES_DONE, [JSPluginRequest notifyData]); - } - [self didCallPlugInFunction]; - } - } 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]; - - 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); - } -} - -- (void)webFrame:(WebFrame *)webFrame didFinishLoadWithReason:(NPReason)reason -{ - ASSERT(isStarted); - WebPluginRequest *pluginRequest = [pendingFrameLoads objectForKey:webFrame]; - ASSERT(pluginRequest != nil); - ASSERT([pluginRequest sendNotification]); - - [self willCallPlugInFunction]; - { - JSC::JSLock::DropAllLocks dropAllLocks(false); - NPP_URLNotify(plugin, [[[pluginRequest request] URL] _web_URLCString], reason, [pluginRequest notifyData]); - } - [self didCallPlugInFunction]; + [self updateAndSetWindow]; - [pendingFrameLoads removeObjectForKey:webFrame]; - [webFrame _setInternalLoadDelegate:nil]; -} - -- (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error -{ - NPReason reason = NPRES_DONE; - if (error != nil) - reason = WebNetscapePluginStream::reasonForError(error); - [self webFrame:webFrame didFinishLoadWithReason:reason]; -} - -- (void)loadPluginRequest:(WebPluginRequest *)pluginRequest -{ - NSURLRequest *request = [pluginRequest request]; - NSString *frameName = [pluginRequest frameName]; - WebFrame *frame = nil; - - NSURL *URL = [request URL]; - NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; - - ASSERT(frameName || JSString); - - if (frameName) { - // FIXME - need to get rid of this window creation which - // bypasses normal targeted link handling - frame = kit(core([self webFrame])->loader()->findFrameForNavigation(frameName)); - if (frame == nil) { - WebView *currentWebView = [self webView]; - NSDictionary *features = [[NSDictionary alloc] init]; - WebView *newWebView = [[currentWebView _UIDelegateForwarder] webView:currentWebView - createWebViewWithRequest:nil - windowFeatures:features]; - [features release]; - - if (!newWebView) { - if ([pluginRequest sendNotification]) { - [self willCallPlugInFunction]; - { - JSC::JSLock::DropAllLocks dropAllLocks(false); - NPP_URLNotify(plugin, [[[pluginRequest request] URL] _web_URLCString], NPERR_GENERIC_ERROR, [pluginRequest notifyData]); - } - [self didCallPlugInFunction]; - } - return; - } - - frame = [newWebView mainFrame]; - core(frame)->tree()->setName(frameName); - [[newWebView _UIDelegateForwarder] webViewShow:newWebView]; - } - } - - if (JSString) { - ASSERT(frame == nil || [self webFrame] == frame); - [self evaluateJavaScriptPluginRequest:pluginRequest]; - } else { - [frame loadRequest:request]; - if ([pluginRequest sendNotification]) { - // Check if another plug-in view or even this view is waiting for the frame to load. - // If it is, tell it that the load was cancelled because it will be anyway. - WebBaseNetscapePluginView *view = [frame _internalLoadDelegate]; - if (view != nil) { - ASSERT([view isKindOfClass:[WebBaseNetscapePluginView class]]); - [view webFrame:frame didFinishLoadWithReason:NPRES_USER_BREAK]; - } - [pendingFrameLoads _webkit_setObject:pluginRequest forUncopiedKey:frame]; - [frame _setInternalLoadDelegate:self]; - } - } -} - -- (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification -{ - NSURL *URL = [request URL]; - - 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 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] != core([self webFrame])->loader()->activeDocumentLoader() && - (!cTarget || [frame findFrameNamed:target] != frame)) { - return NPERR_GENERIC_ERROR; - } - - NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; - if (JSString != nil) { - if (![[[self webView] preferences] isJavaScriptEnabled]) { - // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does. - return NPERR_GENERIC_ERROR; - } else if (cTarget == NULL && mode == NP_FULL) { - // Don't allow a JavaScript request from a standalone plug-in that is self-targetted - // 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 && target && [frame findFrameNamed:target] != frame) { - // For security reasons, only allow JS requests to be made on the frame that contains the plug-in. - return NPERR_INVALID_PARAM; - } - - 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]; - } else { - RefPtr<WebNetscapePluginStream> stream = WebNetscapePluginStream::create(request, plugin, sendNotification, notifyData); - - streams.add(stream.get()); - stream->start(); - } - - return NPERR_NO_ERROR; -} - --(NPError)getURLNotify:(const char *)URLCString target:(const char *)cTarget notifyData:(void *)notifyData -{ - LOG(Plugins, "NPN_GetURLNotify: %s target: %s", URLCString, cTarget); - - NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; - return [self loadRequest:request inTarget:cTarget withNotifyData:notifyData sendNotification:YES]; -} - --(NPError)getURL:(const char *)URLCString target:(const char *)cTarget -{ - LOG(Plugins, "NPN_GetURL: %s target: %s", URLCString, cTarget); - - NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; - return [self loadRequest:request inTarget:cTarget withNotifyData:NULL sendNotification:NO]; -} - -- (NPError)_postURL:(const char *)URLCString - target:(const char *)target - len:(UInt32)len - buf:(const char *)buf - file:(NPBool)file - notifyData:(void *)notifyData - sendNotification:(BOOL)sendNotification - allowHeaders:(BOOL)allowHeaders -{ - if (!URLCString || !len || !buf) { - return NPERR_INVALID_PARAM; - } - - NSData *postData = nil; - - if (file) { - // If we're posting a file, buf is either a file URL or a path to the file. - NSString *bufString = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1); - if (!bufString) { - return NPERR_INVALID_PARAM; - } - NSURL *fileURL = [NSURL _web_URLWithDataAsString:bufString]; - NSString *path; - if ([fileURL isFileURL]) { - path = [fileURL path]; - } else { - path = bufString; - } - postData = [NSData dataWithContentsOfFile:[path _webkit_fixedCarbonPOSIXPath]]; - CFRelease(bufString); - if (!postData) { - return NPERR_FILE_NOT_FOUND; - } - } else { - postData = [NSData dataWithBytes:buf length:len]; - } - - if ([postData length] == 0) { - return NPERR_INVALID_PARAM; - } - - NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; - [request setHTTPMethod:@"POST"]; - - if (allowHeaders) { - if ([postData _web_startsWithBlankLine]) { - postData = [postData subdataWithRange:NSMakeRange(1, [postData length] - 1)]; - } else { - NSInteger location = [postData _web_locationAfterFirstBlankLine]; - if (location != NSNotFound) { - // If the blank line is somewhere in the middle of postData, everything before is the header. - NSData *headerData = [postData subdataWithRange:NSMakeRange(0, location)]; - NSMutableDictionary *header = [headerData _webkit_parseRFC822HeaderFields]; - unsigned dataLength = [postData length] - location; - - // Sometimes plugins like to set Content-Length themselves when they post, - // but WebFoundation does not like that. So we will remove the header - // and instead truncate the data to the requested length. - NSString *contentLength = [header objectForKey:@"Content-Length"]; - - if (contentLength != nil) - dataLength = MIN((unsigned)[contentLength intValue], dataLength); - [header removeObjectForKey:@"Content-Length"]; - - if ([header count] > 0) { - [request setAllHTTPHeaderFields:header]; - } - // Everything after the blank line is the actual content of the POST. - postData = [postData subdataWithRange:NSMakeRange(location, dataLength)]; - - } - } - if ([postData length] == 0) { - return NPERR_INVALID_PARAM; - } - } - - // Plug-ins expect to receive uncached data when doing a POST (3347134). - [request setCachePolicy:NSURLRequestReloadIgnoringCacheData]; - [request setHTTPBody:postData]; - - return [self loadRequest:request inTarget:target withNotifyData:notifyData sendNotification:sendNotification]; -} - -- (NPError)postURLNotify:(const char *)URLCString - target:(const char *)target - len:(UInt32)len - buf:(const char *)buf - file:(NPBool)file - notifyData:(void *)notifyData -{ - LOG(Plugins, "NPN_PostURLNotify: %s", URLCString); - return [self _postURL:URLCString target:target len:len buf:buf file:file notifyData:notifyData sendNotification:YES allowHeaders:YES]; -} - --(NPError)postURL:(const char *)URLCString - target:(const char *)target - len:(UInt32)len - buf:(const char *)buf - file:(NPBool)file -{ - LOG(Plugins, "NPN_PostURL: %s", URLCString); - // As documented, only allow headers to be specified via NPP_PostURL when using a file. - return [self _postURL:URLCString target:target len:len buf:buf file:file notifyData:NULL sendNotification:NO allowHeaders:file]; -} - --(NPError)newStream:(NPMIMEType)type target:(const char *)target stream:(NPStream**)stream -{ - LOG(Plugins, "NPN_NewStream"); - return NPERR_GENERIC_ERROR; -} - --(NPError)write:(NPStream*)stream len:(SInt32)len buffer:(void *)buffer -{ - LOG(Plugins, "NPN_Write"); - return NPERR_GENERIC_ERROR; -} - --(NPError)destroyStream:(NPStream*)stream reason:(NPReason)reason -{ - LOG(Plugins, "NPN_DestroyStream"); - // 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 || WebNetscapePluginStream::ownerForStream(stream) != plugin) { - LOG(Plugins, "Invalid NPStream passed to NPN_DestroyStream: %p", stream); - return NPERR_INVALID_INSTANCE_ERROR; - } - - WebNetscapePluginStream* browserStream = static_cast<WebNetscapePluginStream*>(stream->ndata); - browserStream->cancelLoadAndDestroyStreamWithError(browserStream->errorForReason(reason)); - - return NPERR_NO_ERROR; -} - -- (const char *)userAgent -{ - return [[[self webView] userAgentForURL:baseURL] UTF8String]; -} - --(void)status:(const char *)message -{ - if (!message) { - LOG_ERROR("NPN_Status passed a NULL status message"); - return; - } - - CFStringRef status = CFStringCreateWithCString(NULL, message, kCFStringEncodingUTF8); - if (!status) { - LOG_ERROR("NPN_Status: the message was not valid UTF-8"); - return; - } + [self resetTrackingRect]; - LOG(Plugins, "NPN_Status: %@", status); - WebView *wv = [self webView]; - [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status]; - CFRelease(status); -} - --(void)invalidateRect:(NPRect *)invalidRect -{ - LOG(Plugins, "NPN_InvalidateRect"); - [self setNeedsDisplayInRect:NSMakeRect(invalidRect->left, invalidRect->top, - (float)invalidRect->right - invalidRect->left, (float)invalidRect->bottom - invalidRect->top)]; + // Check to see if the plugin view is completely obscured (scrolled out of view, for example). + // For performance reasons, we send null events at a lower rate to plugins which are obscured. + BOOL oldIsObscured = _isCompletelyObscured; + _isCompletelyObscured = NSIsEmptyRect([self visibleRect]); + if (_isCompletelyObscured != oldIsObscured) + [self restartTimers]; } --(BOOL)isOpaque +- (BOOL)becomeFirstResponder { + [self setHasFocus:YES]; return YES; } -- (void)invalidateRegion:(NPRegion)invalidRegion -{ - LOG(Plugins, "NPN_InvalidateRegion"); - NSRect invalidRect = NSZeroRect; - switch (drawingModel) { -#ifndef NP_NO_QUICKDRAW - case NPDrawingModelQuickDraw: - { - ::Rect qdRect; - GetRegionBounds((NPQDRegion)invalidRegion, &qdRect); - invalidRect = NSMakeRect(qdRect.left, qdRect.top, qdRect.right - qdRect.left, qdRect.bottom - qdRect.top); - } - break; -#endif /* NP_NO_QUICKDRAW */ - - case NPDrawingModelCoreGraphics: - { - CGRect cgRect = CGPathGetBoundingBox((NPCGRegion)invalidRegion); - invalidRect = *(NSRect*)&cgRect; - break; - } - default: - ASSERT_NOT_REACHED(); - break; - } - - [self setNeedsDisplayInRect:invalidRect]; -} - --(void)forceRedraw -{ - LOG(Plugins, "forceRedraw"); - [self setNeedsDisplay:YES]; - [[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->script()->windowScriptNPObject() : 0; - - // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess> - if (windowScriptObject) - _NPN_RetainObject(windowScriptObject); - - void **v = (void **)value; - *v = windowScriptObject; - - return NPERR_NO_ERROR; - } - - case NPNVPluginElementNPObject: - { - if (!element) - return NPERR_GENERIC_ERROR; - - NPObject *plugInScriptObject = (NPObject *)[element _NPObject]; - - // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess> - if (plugInScriptObject) - _NPN_RetainObject(plugInScriptObject); - - void **v = (void **)value; - *v = plugInScriptObject; - - return NPERR_NO_ERROR; - } - - case NPNVpluginDrawingModel: - { - *(NPDrawingModel *)value = drawingModel; - return NPERR_NO_ERROR; - } - -#ifndef NP_NO_QUICKDRAW - case NPNVsupportsQuickDrawBool: - { - *(NPBool *)value = TRUE; - return NPERR_NO_ERROR; - } -#endif /* NP_NO_QUICKDRAW */ - - case NPNVsupportsCoreGraphicsBool: - { - *(NPBool *)value = TRUE; - return NPERR_NO_ERROR; - } - - case NPNVsupportsOpenGLBool: - { - *(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; - } - - return NPERR_GENERIC_ERROR; -} - -- (NPError)setVariable:(NPPVariable)variable value:(void *)value -{ - switch (variable) { - case NPPVpluginWindowBool: - { - NPWindowType newWindowType = (value ? NPWindowTypeWindow : NPWindowTypeDrawable); - - // Redisplay if window type is changing (some drawing models can only have their windows set while updating). - if (newWindowType != window.type) - [self setNeedsDisplay:YES]; - - window.type = newWindowType; - } - - case NPPVpluginTransparentBool: - { - BOOL newTransparent = (value != 0); - - // Redisplay if transparency is changing - if (isTransparent != newTransparent) - [self setNeedsDisplay:YES]; - - isTransparent = newTransparent; - - return NPERR_NO_ERROR; - } - - case NPPVpluginDrawingModel: - { - // Can only set drawing model inside NPP_New() - if (self != [[self class] currentPluginView]) - return NPERR_GENERIC_ERROR; - - // Check for valid, supported drawing model - NPDrawingModel newDrawingModel = (NPDrawingModel)(uintptr_t)value; - switch (newDrawingModel) { - // Supported drawing models: -#ifndef NP_NO_QUICKDRAW - case NPDrawingModelQuickDraw: -#endif - case NPDrawingModelCoreGraphics: - 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); - return NPERR_GENERIC_ERROR; - } - } - - 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 +- (BOOL)resignFirstResponder { - 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; + [self setHasFocus:NO]; + return YES; } -@end - -@implementation WebPluginRequest - -- (id)initWithRequest:(NSURLRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData sendNotification:(BOOL)sendNotification didStartFromUserGesture:(BOOL)currentEventIsUserGesture +- (WebDataSource *)dataSource { - [super init]; - _didStartFromUserGesture = currentEventIsUserGesture; - _request = [request retain]; - _frameName = [frameName retain]; - _notifyData = notifyData; - _sendNotification = sendNotification; - return self; + WebFrame *webFrame = kit(core(_element.get())->document()->frame()); + return [webFrame _dataSource]; } -- (void)dealloc +- (WebFrame *)webFrame { - [_request release]; - [_frameName release]; - [super dealloc]; + return [[self dataSource] webFrame]; } -- (NSURLRequest *)request +- (WebView *)webView { - return _request; + return [[self webFrame] webView]; } -- (NSString *)frameName +- (NSWindow *)currentWindow { - return _frameName; + return [self window] ? [self window] : [[self webView] hostWindow]; } -- (BOOL)isCurrentEventUserGesture -{ - return _didStartFromUserGesture; -} +// We want to treat these as regular keyboard events. -- (BOOL)sendNotification +- (void)cut:(id)sender { - return _sendNotification; + [self keyDown:[NSApp currentEvent]]; } -- (void *)notifyData +- (void)copy:(id)sender { - return _notifyData; + [self keyDown:[NSApp currentEvent]]; } -@end - -@implementation WebBaseNetscapePluginView (Internal) - -- (NPError)_createPlugin -{ - plugin = (NPP)calloc(1, sizeof(NPP_t)); - plugin->ndata = self; - - ASSERT(NPP_New); - - // 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 +- (void)paste:(id)sender { - PluginMainThreadScheduler::scheduler().unregisterPlugin(plugin); - - NPError npErr; - npErr = NPP_Destroy(plugin, NULL); - LOG(Plugins, "NPP_Destroy: %d", npErr); - - if (Frame* frame = core([self webFrame])) - frame->script()->cleanupScriptObjectsForPlugin(self); - - free(plugin); - plugin = NULL; + [self keyDown:[NSApp currentEvent]]; } -- (void)_viewHasMoved +- (void)selectAll:(id)sender { - // All of the work this method does may safely be skipped if the view is not in a window. When the view - // is moved back into a window, everything should be set up correctly. - if (![self window]) - return; - - if (isDrawingModelQuickDraw(drawingModel)) - [self tellQuickTimeToChill]; - - 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). - // For performance reasons, we send null events at a lower rate to plugins which are obscured. - BOOL oldIsObscured = isCompletelyObscured; - isCompletelyObscured = NSIsEmptyRect([self visibleRect]); - if (isCompletelyObscured != oldIsObscured) - [self restartTimers]; + [self keyDown:[NSApp currentEvent]]; } -- (NSBitmapImageRep *)_printedPluginBitmap +// AppKit doesn't call mouseDown or mouseUp on right-click. Simulate control-click +// mouseDown and mouseUp so plug-ins get the right-click event as they do in Carbon (3125743). +- (void)rightMouseDown:(NSEvent *)theEvent { -#ifdef NP_NO_QUICKDRAW - return nil; -#else - // Cannot print plugins that do not implement NPP_Print - if (!NPP_Print) - return nil; - - // This NSBitmapImageRep will share its bitmap buffer with a GWorld that the plugin will draw into. - // The bitmap is created in 32-bits-per-pixel ARGB format, which is the default GWorld pixel format. - NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL - pixelsWide:window.width - pixelsHigh:window.height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSDeviceRGBColorSpace - bitmapFormat:NSAlphaFirstBitmapFormat - bytesPerRow:0 - bitsPerPixel:0] autorelease]; - ASSERT(bitmap); - - // Create a GWorld with the same underlying buffer into which the plugin can draw - ::Rect printGWorldBounds; - SetRect(&printGWorldBounds, 0, 0, window.width, window.height); - GWorldPtr printGWorld; - if (NewGWorldFromPtr(&printGWorld, - k32ARGBPixelFormat, - &printGWorldBounds, - NULL, - NULL, - 0, - (Ptr)[bitmap bitmapData], - [bitmap bytesPerRow]) != noErr) { - LOG_ERROR("Could not create GWorld for printing"); - return nil; - } - - /// Create NPWindow for the GWorld - NPWindow printNPWindow; - printNPWindow.window = &printGWorld; // Normally this is an NP_Port, but when printing it is the actual CGrafPtr - printNPWindow.x = 0; - printNPWindow.y = 0; - printNPWindow.width = window.width; - printNPWindow.height = window.height; - printNPWindow.clipRect.top = 0; - printNPWindow.clipRect.left = 0; - printNPWindow.clipRect.right = window.width; - printNPWindow.clipRect.bottom = window.height; - printNPWindow.type = NPWindowTypeDrawable; // Offscreen graphics port as opposed to a proper window - - // Create embed-mode NPPrint - NPPrint npPrint; - npPrint.mode = NP_EMBED; - npPrint.print.embedPrint.window = printNPWindow; - npPrint.print.embedPrint.platformPrint = printGWorld; - - // Tell the plugin to print into the GWorld - [self willCallPlugInFunction]; - { - JSC::JSLock::DropAllLocks dropAllLocks(false); - NPP_Print(plugin, &npPrint); - } - [self didCallPlugInFunction]; - - // Don't need the GWorld anymore - DisposeGWorld(printGWorld); - - return bitmap; -#endif + [self mouseDown:theEvent]; } -- (void)_redeliverStream +- (void)rightMouseUp:(NSEvent *)theEvent { - if ([self dataSource] && [self isStarted]) { - // Deliver what has not been passed to the plug-in up to this point. - if (_dataLengthReceived > 0) { - NSData *data = [[[self dataSource] data] subdataWithRange:NSMakeRange(0, _dataLengthReceived)]; - _dataLengthReceived = 0; - [self pluginView:self receivedData:data]; - if (![[self dataSource] isLoading]) { - if (_error) - [self pluginView:self receivedError:_error]; - else - [self pluginViewFinishedLoading:self]; - } - } - } + [self mouseUp:theEvent]; } @end -@implementation NSData (PluginExtras) +#endif // ENABLE(NETSCAPE_PLUGIN_API) -- (BOOL)_web_startsWithBlankLine -{ - return [self length] > 0 && ((const char *)[self bytes])[0] == '\n'; -} - - -- (NSInteger)_web_locationAfterFirstBlankLine -{ - const char *bytes = (const char *)[self bytes]; - unsigned length = [self length]; - - unsigned i; - for (i = 0; i < length - 4; i++) { - - // Support for Acrobat. It sends "\n\n". - if (bytes[i] == '\n' && bytes[i+1] == '\n') { - return i+2; - } - - // Returns the position after 2 CRLF's or 1 CRLF if it is the first line. - if (bytes[i] == '\r' && bytes[i+1] == '\n') { - i += 2; - if (i == 2) { - return i; - } else if (bytes[i] == '\n') { - // Support for Director. It sends "\r\n\n" (3880387). - return i+1; - } else if (bytes[i] == '\r' && bytes[i+1] == '\n') { - // Support for Flash. It sends "\r\n\r\n" (3758113). - return i+2; - } - } - } - return NSNotFound; -} - -@end -#endif diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.m b/WebKit/mac/Plugins/WebBasePluginPackage.mm index 03d438b..7b5ef8e 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.m +++ b/WebKit/mac/Plugins/WebBasePluginPackage.mm @@ -33,6 +33,7 @@ #import <WebKit/WebNSObjectExtras.h> #import <WebKit/WebPluginPackage.h> #import <WebCore/WebCoreObjCExtras.h> +#import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> #import <wtf/Vector.h> @@ -59,12 +60,13 @@ @implementation WebBasePluginPackage -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} + (WebBasePluginPackage *)pluginWithPath:(NSString *)pluginPath { diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h index 54402bb..d00796f 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h @@ -26,18 +26,18 @@ #ifndef WebNetscapePluginEventHandler_h #define WebNetscapePluginEventHandler_h -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" #if ENABLE(NETSCAPE_PLUGIN_API) @class NSEvent; -@class WebBaseNetscapePluginView; +@class WebNetscapePluginView; struct CGRect; class WebNetscapePluginEventHandler { public: - static WebNetscapePluginEventHandler* create(WebBaseNetscapePluginView*); + static WebNetscapePluginEventHandler* create(WebNetscapePluginView*); virtual ~WebNetscapePluginEventHandler() { } virtual void drawRect(const NSRect&) = 0; @@ -65,13 +65,13 @@ public: bool currentEventIsUserGesture() const { return m_currentEventIsUserGesture; } protected: - WebNetscapePluginEventHandler(WebBaseNetscapePluginView* pluginView) + WebNetscapePluginEventHandler(WebNetscapePluginView* pluginView) : m_pluginView(pluginView) , m_currentEventIsUserGesture(false) { } - WebBaseNetscapePluginView* m_pluginView; + WebNetscapePluginView* m_pluginView; bool m_currentEventIsUserGesture; }; diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm index e8e6d8a..c886d7b 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm @@ -28,11 +28,11 @@ #import "WebNetscapePluginEventHandler.h" #import <wtf/Assertions.h> -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" #import "WebNetscapePluginEventHandlerCarbon.h" #import "WebNetscapePluginEventHandlerCocoa.h" -WebNetscapePluginEventHandler* WebNetscapePluginEventHandler::create(WebBaseNetscapePluginView* pluginView) +WebNetscapePluginEventHandler* WebNetscapePluginEventHandler::create(WebNetscapePluginView* pluginView) { switch ([pluginView eventModel]) { #ifndef NP_NO_CARBON diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h index cf26276..b01922a 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h @@ -35,7 +35,7 @@ class WebNetscapePluginEventHandlerCarbon : public WebNetscapePluginEventHandler { public: - WebNetscapePluginEventHandlerCarbon(WebBaseNetscapePluginView*); + WebNetscapePluginEventHandlerCarbon(WebNetscapePluginView*); virtual void drawRect(const NSRect&); diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm index bfdd91c..7612322 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm @@ -27,7 +27,7 @@ #import "WebNetscapePluginEventHandlerCarbon.h" -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" #import "WebKitLogging.h" #import "WebKitSystemInterface.h" @@ -35,7 +35,7 @@ #define NullEventIntervalActive 0.02 #define NullEventIntervalNotActive 0.25 -WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon(WebBaseNetscapePluginView* pluginView) +WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon(WebNetscapePluginView* pluginView) : WebNetscapePluginEventHandler(pluginView) , m_keyEventHandler(0) , m_suspendKeyUpEvents(false) @@ -265,11 +265,14 @@ void WebNetscapePluginEventHandlerCarbon::focusChanged(bool hasFocus) void WebNetscapePluginEventHandlerCarbon::windowFocusChanged(bool hasFocus) { + WindowRef windowRef = (WindowRef)[[m_pluginView window] windowRef]; + + SetUserFocusWindow(windowRef); + EventRecord event; getCarbonEvent(&event); event.what = activateEvt; - WindowRef windowRef = (WindowRef)[[m_pluginView window] windowRef]; event.message = (unsigned long)windowRef; if (hasFocus) event.modifiers |= activeFlag; diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h index e22ff3d..8b6f6e7 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h @@ -33,7 +33,7 @@ class WebNetscapePluginEventHandlerCocoa : public WebNetscapePluginEventHandler { public: - WebNetscapePluginEventHandlerCocoa(WebBaseNetscapePluginView*); + WebNetscapePluginEventHandlerCocoa(WebNetscapePluginView*); virtual void drawRect(const NSRect&); diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm index fb13a12..288a356 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm @@ -27,9 +27,9 @@ #import "WebNetscapePluginEventHandlerCocoa.h" -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" -WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa(WebBaseNetscapePluginView* pluginView) +WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa(WebNetscapePluginView* pluginView) : WebNetscapePluginEventHandler(pluginView) { } diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.h b/WebKit/mac/Plugins/WebNetscapePluginPackage.h index 6ccbfdb..010956d 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginPackage.h +++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.h @@ -52,26 +52,16 @@ typedef enum { ResFileRefNum resourceRef; - NPP_NewProcPtr NPP_New; - NPP_DestroyProcPtr NPP_Destroy; - NPP_SetWindowProcPtr NPP_SetWindow; - NPP_NewStreamProcPtr NPP_NewStream; - NPP_DestroyStreamProcPtr NPP_DestroyStream; - NPP_StreamAsFileProcPtr NPP_StreamAsFile; - NPP_WriteReadyProcPtr NPP_WriteReady; - NPP_WriteProcPtr NPP_Write; - NPP_PrintProcPtr NPP_Print; - NPP_HandleEventProcPtr NPP_HandleEvent; - NPP_URLNotifyProcPtr NPP_URLNotify; - NPP_GetValueProcPtr NPP_GetValue; - NPP_SetValueProcPtr NPP_SetValue; - NPP_ShutdownProcPtr NPP_Shutdown; - NPP_GetJavaClassProcPtr NPP_GetJavaClass; + NPP_ShutdownProcPtr NP_Shutdown; BOOL isLoaded; BOOL needsUnload; unsigned int instanceCount; - + +#if USE(PLUGIN_HOST_PROCESS) + cpu_type_t pluginHostArchitecture; +#endif + #ifdef SUPPORT_CFM BOOL isBundle; BOOL isCFM; @@ -85,21 +75,11 @@ typedef enum { - (void)close; - (WebExecutableType)executableType; - -- (NPP_NewProcPtr)NPP_New; -- (NPP_DestroyProcPtr)NPP_Destroy; -- (NPP_SetWindowProcPtr)NPP_SetWindow; -- (NPP_NewStreamProcPtr)NPP_NewStream; -- (NPP_WriteReadyProcPtr)NPP_WriteReady; -- (NPP_WriteProcPtr)NPP_Write; -- (NPP_StreamAsFileProcPtr)NPP_StreamAsFile; -- (NPP_DestroyStreamProcPtr)NPP_DestroyStream; -- (NPP_HandleEventProcPtr)NPP_HandleEvent; -- (NPP_URLNotifyProcPtr)NPP_URLNotify; -- (NPP_GetValueProcPtr)NPP_GetValue; -- (NPP_SetValueProcPtr)NPP_SetValue; -- (NPP_PrintProcPtr)NPP_Print; - (NPPluginFuncs *)pluginFuncs; +#if USE(PLUGIN_HOST_PROCESS) +- (cpu_type_t)pluginHostArchitecture; +#endif + @end #endif diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.m b/WebKit/mac/Plugins/WebNetscapePluginPackage.m index 0767c1d..b3ad0bd 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginPackage.m +++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.m @@ -236,9 +236,20 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); if (hasCFMHeader) return NO; #endif + +#if USE(PLUGIN_HOST_PROCESS) + NSArray *archs = [bundle executableArchitectures]; + if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]]) + pluginHostArchitecture = CPU_TYPE_X86_64; + else if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]]) + pluginHostArchitecture = CPU_TYPE_X86; + else + return NO; +#else if (![self isNativeLibraryData:data]) return NO; +#endif } if (![self getPluginInfoFromPLists] && ![self getPluginInfoFromResources]) @@ -272,6 +283,13 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); return WebMachOExecutableType; } +#if USE(PLUGIN_HOST_PROCESS) +- (cpu_type_t)pluginHostArchitecture +{ + return pluginHostArchitecture; +} +#endif + - (void)launchRealPlayer { CFURLRef appURL = NULL; @@ -346,8 +364,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); #endif NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Initialize")); NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_GetEntryPoints")); - NPP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Shutdown")); - if (!NP_Initialize || !NP_GetEntryPoints || !NPP_Shutdown) + NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Shutdown")); + if (!NP_Initialize || !NP_GetEntryPoints || !NP_Shutdown) goto abort; #ifdef SUPPORT_CFM } @@ -439,9 +457,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); browserFuncs.createobject = (NPN_CreateObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_CreateObject); browserFuncs.retainobject = (NPN_RetainObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_RetainObject); browserFuncs.releaseobject = (NPN_ReleaseObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_ReleaseObject); + browserFuncs.hasmethod = (NPN_HasMethodProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_HasProperty); browserFuncs.invoke = (NPN_InvokeProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Invoke); browserFuncs.invokeDefault = (NPN_InvokeDefaultProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_InvokeDefault); browserFuncs.evaluate = (NPN_EvaluateProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Evaluate); + browserFuncs.hasproperty = (NPN_HasPropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_HasProperty); browserFuncs.getproperty = (NPN_GetPropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetProperty); browserFuncs.setproperty = (NPN_SetPropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_SetProperty); browserFuncs.removeproperty = (NPN_RemovePropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_RemoveProperty); @@ -457,7 +477,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); LOG(Plugins, "%f main timing started", mainStart); NPP_ShutdownProcPtr shutdownFunction; npErr = pluginMainFunc(&browserFuncs, &pluginFuncs, &shutdownFunction); - NPP_Shutdown = (NPP_ShutdownProcPtr)functionPointerForTVector((TransitionVector)shutdownFunction); + NP_Shutdown = (NPP_ShutdownProcPtr)functionPointerForTVector((TransitionVector)shutdownFunction); if (!isBundle) // Don't free pluginMainFunc if we got it from a bundle because it is owned by CFBundle in that case. free(pluginMainFunc); @@ -479,24 +499,24 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); pluginVersion = pluginFuncs.version; LOG(Plugins, "pluginMainFunc: %d, size=%d, version=%d", npErr, pluginSize, pluginVersion); - NPP_New = (NPP_NewProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.newp); - NPP_Destroy = (NPP_DestroyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.destroy); - NPP_SetWindow = (NPP_SetWindowProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setwindow); - NPP_NewStream = (NPP_NewStreamProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.newstream); - NPP_DestroyStream = (NPP_DestroyStreamProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.destroystream); - NPP_StreamAsFile = (NPP_StreamAsFileProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.asfile); - NPP_WriteReady = (NPP_WriteReadyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.writeready); - NPP_Write = (NPP_WriteProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.write); - NPP_Print = (NPP_PrintProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.print); - NPP_HandleEvent = (NPP_HandleEventProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.event); - NPP_URLNotify = (NPP_URLNotifyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.urlnotify); - NPP_GetValue = (NPP_GetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.getvalue); - NPP_SetValue = (NPP_SetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setvalue); + pluginFuncs.newp = (NPP_NewProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.newp); + pluginFuncs.destroy = (NPP_DestroyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.destroy); + pluginFuncs.setwindow = (NPP_SetWindowProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setwindow); + pluginFuncs.newstream = (NPP_NewStreamProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.newstream); + pluginFuncs.destroystream = (NPP_DestroyStreamProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.destroystream); + pluginFuncs.asfile = (NPP_StreamAsFileProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.asfile); + pluginFuncs.writeready = (NPP_WriteReadyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.writeready); + pluginFuncs.write = (NPP_WriteProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.write); + pluginFuncs.print = (NPP_PrintProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.print); + pluginFuncs.event = (NPP_HandleEventProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.event); + pluginFuncs.urlnotify = (NPP_URLNotifyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.urlnotify); + pluginFuncs.getvalue = (NPP_GetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.getvalue); + pluginFuncs.setvalue = (NPP_SetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setvalue); // LiveConnect support - NPP_GetJavaClass = (NPP_GetJavaClassProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass); - if (NPP_GetJavaClass) { - LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", [self name], NPP_GetJavaClass); + pluginFuncs.javaClass = (NPP_GetJavaClassProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass); + if (pluginFuncs.javaClass) { + LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass); } else { LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]); } @@ -546,9 +566,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); browserFuncs.createobject = _NPN_CreateObject; browserFuncs.retainobject = _NPN_RetainObject; browserFuncs.releaseobject = _NPN_ReleaseObject; + browserFuncs.hasmethod = _NPN_HasMethod; browserFuncs.invoke = _NPN_Invoke; browserFuncs.invokeDefault = _NPN_InvokeDefault; browserFuncs.evaluate = _NPN_Evaluate; + browserFuncs.hasproperty = _NPN_HasProperty; browserFuncs.getproperty = _NPN_GetProperty; browserFuncs.setproperty = _NPN_SetProperty; browserFuncs.removeproperty = _NPN_RemoveProperty; @@ -580,27 +602,10 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); pluginSize = pluginFuncs.size; pluginVersion = pluginFuncs.version; - NPP_New = pluginFuncs.newp; - NPP_Destroy = pluginFuncs.destroy; - NPP_SetWindow = pluginFuncs.setwindow; - NPP_NewStream = pluginFuncs.newstream; - NPP_DestroyStream = pluginFuncs.destroystream; - NPP_StreamAsFile = pluginFuncs.asfile; - NPP_WriteReady = pluginFuncs.writeready; - NPP_Write = pluginFuncs.write; - NPP_Print = pluginFuncs.print; - NPP_HandleEvent = pluginFuncs.event; - NPP_URLNotify = pluginFuncs.urlnotify; - NPP_GetValue = pluginFuncs.getvalue; - NPP_SetValue = pluginFuncs.setvalue; - - // LiveConnect support - NPP_GetJavaClass = pluginFuncs.javaClass; - if (NPP_GetJavaClass){ - LOG(LiveConnect, "%@: mach-o entry point for NPP_GetJavaClass = %p", [self name], NPP_GetJavaClass); - } else { + if (pluginFuncs.javaClass) + LOG(LiveConnect, "%@: mach-o entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass); + else LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]); - } #ifdef SUPPORT_CFM } @@ -619,69 +624,6 @@ abort: return NO; } -- (NPP_SetWindowProcPtr)NPP_SetWindow -{ - return NPP_SetWindow; -} - -- (NPP_NewProcPtr)NPP_New -{ - return NPP_New; -} - -- (NPP_DestroyProcPtr)NPP_Destroy -{ - return NPP_Destroy; -} - -- (NPP_NewStreamProcPtr)NPP_NewStream -{ - return NPP_NewStream; -} - -- (NPP_StreamAsFileProcPtr)NPP_StreamAsFile -{ - return NPP_StreamAsFile; -} -- (NPP_DestroyStreamProcPtr)NPP_DestroyStream -{ - return NPP_DestroyStream; -} - -- (NPP_WriteReadyProcPtr)NPP_WriteReady -{ - return NPP_WriteReady; -} -- (NPP_WriteProcPtr)NPP_Write -{ - return NPP_Write; -} - -- (NPP_HandleEventProcPtr)NPP_HandleEvent -{ - return NPP_HandleEvent; -} - --(NPP_URLNotifyProcPtr)NPP_URLNotify -{ - return NPP_URLNotify; -} - --(NPP_GetValueProcPtr)NPP_GetValue -{ - return NPP_GetValue; -} - --(NPP_SetValueProcPtr)NPP_SetValue -{ - return NPP_SetValue; -} - --(NPP_PrintProcPtr)NPP_Print -{ - return NPP_Print; -} - - (NPPluginFuncs *)pluginFuncs { return &pluginFuncs; @@ -775,8 +717,8 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer fp) return; } - if (shutdown && NPP_Shutdown) - NPP_Shutdown(); + if (shutdown && NP_Shutdown) + NP_Shutdown(); if (resourceRef != -1) [self closeResourceFile:resourceRef]; diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.h b/WebKit/mac/Plugins/WebNetscapePluginView.h new file mode 100644 index 0000000..9d2555b --- /dev/null +++ b/WebKit/mac/Plugins/WebNetscapePluginView.h @@ -0,0 +1,174 @@ +/* + * Copyright (C) 2005, 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. + */ + +#if ENABLE(NETSCAPE_PLUGIN_API) + +#import "WebBaseNetscapePluginView.h" + +#import <WebKit/npfunctions.h> +#import <WebKit/npapi.h> +#import <wtf/HashMap.h> +#import <wtf/HashSet.h> +#import <wtf/OwnPtr.h> + +@class WebDataSource; +@class WebFrame; +@class WebNetscapePluginPackage; +@class WebView; + +class PluginTimer; +class WebNetscapePluginStream; +class WebNetscapePluginEventHandler; + +typedef union PluginPort { +#ifndef NP_NO_QUICKDRAW + NP_Port qdPort; +#endif + NP_CGContext cgPort; +} PluginPort; + +typedef struct _NPPluginTextInputFuncs NPPluginTextInputFuncs; + +// Because the Adobe 7.x Acrobat plug-in has a hard coded check for a view named +// "WebNetscapePluginDocumentView", this class must retain the old name in order +// for the plug-in to function correctly. (rdar://problem/4699455) +#define WebNetscapePluginView WebNetscapePluginDocumentView + +@interface WebNetscapePluginView : WebBaseNetscapePluginView<WebPluginManualLoader, NSTextInput> +{ + RefPtr<WebNetscapePluginStream> _manualStream; +#ifndef BUILDING_ON_TIGER + RetainPtr<CALayer> _pluginLayer; +#endif + unsigned _dataLengthReceived; + RetainPtr<NSError> _error; + + unsigned argsCount; + char **cAttributes; + char **cValues; + + NPP plugin; + NPWindow window; + NPWindow lastSetWindow; + PluginPort nPort; + PluginPort lastSetPort; + NPDrawingModel drawingModel; + NPEventModel eventModel; + +#ifndef NP_NO_QUICKDRAW + // This is only valid when drawingModel is NPDrawingModelQuickDraw + GWorldPtr offscreenGWorld; +#endif + + OwnPtr<WebNetscapePluginEventHandler> _eventHandler; + + BOOL inSetWindow; + BOOL shouldStopSoon; + + uint32 currentTimerID; + HashMap<uint32, PluginTimer*>* timers; + + unsigned pluginFunctionCallDepth; + + int32 specifiedHeight; + int32 specifiedWidth; + + HashSet<RefPtr<WebNetscapePluginStream> > streams; + RetainPtr<NSMutableDictionary> _pendingFrameLoads; + + BOOL _isSilverlight; + + NPPluginTextInputFuncs *textInputFuncs; +} + ++ (WebNetscapePluginView *)currentPluginView; + + +- (id)initWithFrame:(NSRect)r + pluginPackage:(WebNetscapePluginPackage *)thePluginPackage + URL:(NSURL *)URL + baseURL:(NSURL *)baseURL + MIMEType:(NSString *)MIME + attributeKeys:(NSArray *)keys + attributeValues:(NSArray *)values + loadManually:(BOOL)loadManually + DOMElement:(DOMElement *)anElement; + + +- (NPP)plugin; + +- (void)disconnectStream:(WebNetscapePluginStream*)stream; + +// Returns the NPObject that represents the plugin interface. +// The return value is expected to be retained. +- (NPObject *)createPluginScriptableObject; + +// -willCallPlugInFunction must be called before calling any of the NPP_* functions for this view's plugin. +// This is necessary to ensure that plug-ins are not destroyed while WebKit calls into them. Some plug-ins (Flash +// at least) are written with the assumption that nothing they do in their plug-in functions can cause NPP_Destroy() +// to be called. Unfortunately, this is not true, especially if the plug-in uses NPN_Invoke() to execute a +// document.write(), which clears the document and destroys the plug-in. +// See <rdar://problem/4480737>. +- (void)willCallPlugInFunction; + +// -didCallPlugInFunction should be called after returning from a plug-in function. It should be called exactly +// once for every call to -willCallPlugInFunction. +// See <rdar://problem/4480737>. +- (void)didCallPlugInFunction; + +- (void)handleMouseMoved:(NSEvent *)event; + +@end + +@interface WebNetscapePluginView (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/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm new file mode 100644 index 0000000..a792e21 --- /dev/null +++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm @@ -0,0 +1,2338 @@ +/* + * 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. + */ + +#if ENABLE(NETSCAPE_PLUGIN_API) + +#import "WebNetscapePluginView.h" + +#import "WebDataSourceInternal.h" +#import "WebDefaultUIDelegate.h" +#import "WebFrameInternal.h" +#import "WebFrameView.h" +#import "WebGraphicsExtras.h" +#import "WebKitLogging.h" +#import "WebKitNSStringExtras.h" +#import "WebKitSystemInterface.h" +#import "WebNSDataExtras.h" +#import "WebNSDictionaryExtras.h" +#import "WebNSObjectExtras.h" +#import "WebNSURLExtras.h" +#import "WebNSURLRequestExtras.h" +#import "WebNSViewExtras.h" +#import "WebNetscapePluginPackage.h" +#import "WebBaseNetscapePluginStream.h" +#import "WebNetscapePluginEventHandler.h" +#import "WebNullPluginView.h" +#import "WebPreferences.h" +#import "WebPluginRequest.h" +#import "WebViewInternal.h" +#import "WebUIDelegatePrivate.h" +#import <Carbon/Carbon.h> +#import <runtime/JSLock.h> +#import <WebCore/npruntime_impl.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 <runtime/InitializeThreading.h> +#import <wtf/Assertions.h> +#import <objc/objc-runtime.h> + +#define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification" +#define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification" + +using namespace WebCore; + +static inline bool isDrawingModelQuickDraw(NPDrawingModel drawingModel) +{ +#ifndef NP_NO_QUICKDRAW + return drawingModel == NPDrawingModelQuickDraw; +#else + return false; +#endif +}; + +@interface WebNetscapePluginView (Internal) +- (NPError)_createPlugin; +- (void)_destroyPlugin; +- (NSBitmapImageRep *)_printedPluginBitmap; +- (void)_redeliverStream; +@end + +static WebNetscapePluginView *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 = m_interval / 1000.0; + + if (throttle) + timeInterval = max(timeInterval, ThrottledTimerInterval); + + 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 + +typedef struct { + GrafPtr oldPort; + GDHandle oldDevice; + Point oldOrigin; + RgnHandle oldClipRegion; + RgnHandle oldVisibleRegion; + RgnHandle clipRegion; + BOOL forUpdate; +} PortState_QD; + +#endif /* NP_NO_QUICKDRAW */ + +typedef struct { + CGContextRef context; +} PortState_CG; + +@class NSTextInputContext; +@interface NSResponder (AppKitDetails) +- (NSTextInputContext *)inputContext; +@end + +@interface WebNetscapePluginView (ForwardDeclarations) +- (void)setWindowIfNecessary; +- (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification; +@end + +@implementation WebNetscapePluginView + ++ (void)initialize +{ + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER + WebCoreObjCFinalizeOnMainThread(self); +#endif + WKSendUserChangeNotifications(); +} + +#pragma mark EVENTS + +- (BOOL)superviewsHaveSuperviews +{ + NSView *contentView = [[self window] contentView]; + NSView *view; + for (view = self; view != nil; view = [view superview]) { + if (view == contentView) { + return YES; + } + } + return NO; +} + + +// 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 +{ +#ifndef NP_NO_QUICKDRAW + ASSERT(isDrawingModelQuickDraw(drawingModel)); + + NSWindow *currentWindow = [self currentWindow]; + if ([currentWindow isKindOfClass:objc_getClass("NSCarbonWindow")]) + return; + + float windowHeight = [currentWindow frame].size.height; + NSView *contentView = [currentWindow contentView]; + NSRect contentRect = [contentView convertRect:[contentView frame] toView:nil]; // convert to window-relative coordinates + + CGrafPtr oldPort; + GetPort(&oldPort); + SetPort(GetWindowPort((WindowRef)[currentWindow windowRef])); + + MovePortTo(static_cast<short>(contentRect.origin.x), /* Flip Y */ static_cast<short>(windowHeight - NSMaxY(contentRect))); + 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; + if (byteOrder == kCGBitmapByteOrderDefault) + switch (CGBitmapContextGetBitsPerPixel(context)) { + case 16: + byteOrder = kCGBitmapByteOrder16Host; + break; + case 32: + byteOrder = kCGBitmapByteOrder32Host; + break; + } + switch (byteOrder) { + case kCGBitmapByteOrder16Little: + return k16LE555PixelFormat; + case kCGBitmapByteOrder32Little: + return k32BGRAPixelFormat; + case kCGBitmapByteOrder16Big: + return k16BE555PixelFormat; + case kCGBitmapByteOrder32Big: + return k32ARGBPixelFormat; + } + ASSERT_NOT_REACHED(); + return 0; +} + +static inline void getNPRect(const CGRect& cgr, NPRect& npr) +{ + npr.top = static_cast<uint16>(cgr.origin.y); + npr.left = static_cast<uint16>(cgr.origin.x); + npr.bottom = static_cast<uint16>(CGRectGetMaxY(cgr)); + npr.right = static_cast<uint16>(CGRectGetMaxX(cgr)); +} + +#endif + +static inline void getNPRect(const NSRect& nr, NPRect& npr) +{ + npr.top = static_cast<uint16>(nr.origin.y); + npr.left = static_cast<uint16>(nr.origin.x); + npr.bottom = static_cast<uint16>(NSMaxY(nr)); + npr.right = static_cast<uint16>(NSMaxX(nr)); +} + +- (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate +{ + ASSERT([self currentWindow] != nil); + + // 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]; + + // Flip Y to convert NSWindow coordinates to top-left-based window coordinates. + float borderViewHeight = [[self currentWindow] frame].size.height; + boundsInWindow.origin.y = borderViewHeight - NSMaxY(boundsInWindow); + 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 (isDrawingModelQuickDraw(drawingModel)) { + // 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. + [self fixWindowPort]; + + ::Rect portBounds; + CGrafPtr port = GetWindowPort(windowRef); + GetPortBounds(port, &portBounds); + + PixMap *pix = *GetPortPixMap(port); + boundsInWindow.origin.x += pix->bounds.left - portBounds.left; + boundsInWindow.origin.y += pix->bounds.top - portBounds.top; + visibleRectInWindow.origin.x += pix->bounds.left - portBounds.left; + visibleRectInWindow.origin.y += pix->bounds.top - portBounds.top; + } +#endif + + window.type = NPWindowTypeWindow; + window.x = (int32)boundsInWindow.origin.x; + window.y = (int32)boundsInWindow.origin.y; + window.width = static_cast<uint32>(NSWidth(boundsInWindow)); + window.height = static_cast<uint32>(NSHeight(boundsInWindow)); + + // "Clip-out" the plug-in when: + // 1) it's not really in a window or off-screen or has no height or width. + // 2) window.x is a "big negative number" which is how WebCore expresses off-screen widgets. + // 3) the window is miniaturized or the app is hidden + // 4) we're inside of viewWillMoveToWindow: with a nil window. In this case, superviews may already have nil + // superviews and nil windows and results from convertRect:toView: are incorrect. + NSWindow *realWindow = [self window]; + if (window.width <= 0 || window.height <= 0 || window.x < -100000 + || realWindow == nil || [realWindow isMiniaturized] + || [NSApp isHidden] + || ![self superviewsHaveSuperviews] + || [self isHiddenOrHasHiddenAncestor]) { + + // The following code tries to give plug-ins the same size they will eventually have. + // The specifiedWidth and specifiedHeight variables are used to predict the size that + // WebCore will eventually resize us to. + + // The QuickTime plug-in has problems if you give it a width or height of 0. + // Since other plug-ins also might have the same sort of trouble, we make sure + // to always give plug-ins a size other than 0,0. + + if (window.width <= 0) + window.width = specifiedWidth > 0 ? specifiedWidth : 100; + if (window.height <= 0) + window.height = specifiedHeight > 0 ? specifiedHeight : 100; + + window.clipRect.bottom = window.clipRect.top; + window.clipRect.left = window.clipRect.right; + } else { + getNPRect(visibleRectInWindow, window.clipRect); + } + + // Save the port state, set up the port for entry into the plugin + PortState portState; + switch (drawingModel) { +#ifndef NP_NO_QUICKDRAW + case NPDrawingModelQuickDraw: { + // Set up NS_Port. + ::Rect portBounds; + CGrafPtr port = GetWindowPort(windowRef); + GetPortBounds(port, &portBounds); + nPort.qdPort.port = port; + nPort.qdPort.portx = (int32)-boundsInWindow.origin.x; + nPort.qdPort.porty = (int32)-boundsInWindow.origin.y; + window.window = &nPort; + + PortState_QD *qdPortState = (PortState_QD*)malloc(sizeof(PortState_QD)); + portState = (PortState)qdPortState; + + GetGWorld(&qdPortState->oldPort, &qdPortState->oldDevice); + + qdPortState->oldOrigin.h = portBounds.left; + qdPortState->oldOrigin.v = portBounds.top; + + qdPortState->oldClipRegion = NewRgn(); + GetPortClipRegion(port, qdPortState->oldClipRegion); + + qdPortState->oldVisibleRegion = NewRgn(); + GetPortVisibleRegion(port, qdPortState->oldVisibleRegion); + + RgnHandle clipRegion = NewRgn(); + qdPortState->clipRegion = clipRegion; + + CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; + if (currentContext && WKCGContextIsBitmapContext(currentContext)) { + // We use WKCGContextIsBitmapContext here, because if we just called CGBitmapContextGetData + // on any context, we'd log to the console every time. But even if WKCGContextIsBitmapContext + // returns true, it still might not be a context we need to create a GWorld for; for example + // transparency layers will return true, but return 0 for CGBitmapContextGetData. + void* offscreenData = CGBitmapContextGetData(currentContext); + if (offscreenData) { + // If the current context is an offscreen bitmap, then create a GWorld for it. + ::Rect offscreenBounds; + offscreenBounds.top = 0; + offscreenBounds.left = 0; + offscreenBounds.right = CGBitmapContextGetWidth(currentContext); + offscreenBounds.bottom = CGBitmapContextGetHeight(currentContext); + GWorldPtr newOffscreenGWorld; + QDErr err = NewGWorldFromPtr(&newOffscreenGWorld, + getQDPixelFormatForBitmapContext(currentContext), &offscreenBounds, 0, 0, 0, + static_cast<char*>(offscreenData), CGBitmapContextGetBytesPerRow(currentContext)); + ASSERT(newOffscreenGWorld && !err); + if (!err) { + if (offscreenGWorld) + DisposeGWorld(offscreenGWorld); + offscreenGWorld = newOffscreenGWorld; + + SetGWorld(offscreenGWorld, NULL); + + port = offscreenGWorld; + + nPort.qdPort.port = port; + boundsInWindow = [self bounds]; + + // Generate a QD origin based on the current affine transform for currentContext. + CGAffineTransform offscreenMatrix = CGContextGetCTM(currentContext); + CGPoint origin = {0,0}; + CGPoint axisFlip = {1,1}; + origin = CGPointApplyAffineTransform(origin, offscreenMatrix); + axisFlip = CGPointApplyAffineTransform(axisFlip, offscreenMatrix); + + // Quartz bitmaps have origins at the bottom left, but the axes may be inverted, so handle that. + origin.x = offscreenBounds.left - origin.x * (axisFlip.x - origin.x); + origin.y = offscreenBounds.bottom + origin.y * (axisFlip.y - origin.y); + + nPort.qdPort.portx = static_cast<int32>(-boundsInWindow.origin.x + origin.x); + nPort.qdPort.porty = static_cast<int32>(-boundsInWindow.origin.y - origin.y); + window.x = 0; + window.y = 0; + window.window = &nPort; + + // Use the clip bounds from the context instead of the bounds we created + // from the window above. + getNPRect(CGRectOffset(CGContextGetClipBoundingBox(currentContext), -origin.x, origin.y), window.clipRect); + } + } + } + + MacSetRectRgn(clipRegion, + 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 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); + } + } + + // Switch to the port and set it up. + SetPort(port); + PenNormal(); + ForeColor(blackColor); + BackColor(whiteColor); + SetOrigin(nPort.qdPort.portx, nPort.qdPort.porty); + SetPortClipRegion(nPort.qdPort.port, clipRegion); + + if (forUpdate) { + // AppKit may have tried to help us by doing a BeginUpdate. + // But the invalid region at that level didn't include AppKit's notion of what was not valid. + // We reset the port's visible region to counteract what BeginUpdate did. + SetPortVisibleRegion(nPort.qdPort.port, clipRegion); + InvalWindowRgn(windowRef, clipRegion); + } + + qdPortState->forUpdate = forUpdate; + break; + } +#endif /* NP_NO_QUICKDRAW */ + + case NPDrawingModelCoreGraphics: { + ASSERT([NSView focusView] == self); + + CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); + + PortState_CG *cgPortState = (PortState_CG *)malloc(sizeof(PortState_CG)); + portState = (PortState)cgPortState; + cgPortState->context = context; + + // Update the plugin's window/context +#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); + + // 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; + } + + case NPDrawingModelCoreAnimation: + window.window = [self currentWindow]; + // Just set the port state to a dummy value. + portState = (PortState)1; + break; + + default: + ASSERT_NOT_REACHED(); + portState = NULL; + break; + } + + return portState; +} + +- (PortState)saveAndSetNewPortState +{ + return [self saveAndSetNewPortStateForUpdate:NO]; +} + +- (void)restorePortState:(PortState)portState +{ + ASSERT([self currentWindow]); + ASSERT(portState); + + switch (drawingModel) { +#ifndef NP_NO_QUICKDRAW + case NPDrawingModelQuickDraw: { + PortState_QD *qdPortState = (PortState_QD *)portState; + WindowRef windowRef = (WindowRef)[[self currentWindow] windowRef]; + CGrafPtr port = GetWindowPort(windowRef); + + SetPort(port); + + if (qdPortState->forUpdate) + ValidWindowRgn(windowRef, qdPortState->clipRegion); + + SetOrigin(qdPortState->oldOrigin.h, qdPortState->oldOrigin.v); + + SetPortClipRegion(port, qdPortState->oldClipRegion); + if (qdPortState->forUpdate) + SetPortVisibleRegion(port, qdPortState->oldVisibleRegion); + + DisposeRgn(qdPortState->oldClipRegion); + DisposeRgn(qdPortState->oldVisibleRegion); + DisposeRgn(qdPortState->clipRegion); + + SetGWorld(qdPortState->oldPort, qdPortState->oldDevice); + break; + } +#endif /* NP_NO_QUICKDRAW */ + + case NPDrawingModelCoreGraphics: + ASSERT([NSView focusView] == self); + ASSERT(((PortState_CG *)portState)->context == nPort.cgPort.context); + CGContextRestoreGState(nPort.cgPort.context); + break; + + case NPDrawingModelCoreAnimation: + ASSERT(portState == (PortState)1); + break; + default: + ASSERT_NOT_REACHED(); + break; + } +} + +- (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect +{ + if (![self window]) + return NO; + ASSERT(event); + + if (!_isStarted) + return NO; + + ASSERT([_pluginPackage.get() pluginFuncs]->event); + + // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow. + // We probably don't want more general reentrancy protection; we are really + // protecting only against this one case, which actually comes up when + // you first install the SVG viewer plug-in. + if (inSetWindow) + return NO; + + Frame* frame = core([self webFrame]); + if (!frame) + return NO; + Page* page = frame->page(); + if (!page) + return NO; + + bool wasDeferring = page->defersLoading(); + if (!wasDeferring) + page->setDefersLoading(true); + + // Can only send drawRect (updateEvt) to CoreGraphics plugins when actually drawing + ASSERT((drawingModel != NPDrawingModelCoreGraphics) || !eventIsDrawRect || [NSView focusView] == self); + + 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]; + } + +#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 (isDrawingModelQuickDraw(drawingModel) && eventIsDrawRect) { + ForeColor(greenColor); + const ::Rect bigRect = { -10000, -10000, 10000, 10000 }; + PaintRect(&bigRect); + ForeColor(blackColor); + } +#endif + + // Temporarily retain self in case the plug-in view is released while sending an event. + [[self retain] autorelease]; + + BOOL acceptedEvent; + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + acceptedEvent = ![_pluginPackage.get() pluginFuncs]->event(plugin, event); + } + [self didCallPlugInFunction]; + + if (portState) { + if ([self currentWindow]) + [self restorePortState:portState]; + if (portState != (PortState)1) + free(portState); + } + + if (!wasDeferring) + page->setDefersLoading(false); + + return acceptedEvent; +} + +- (void)windowFocusChanged:(BOOL)hasFocus +{ + _eventHandler->windowFocusChanged(hasFocus); +} + +- (void)sendDrawRectEvent:(NSRect)rect +{ + ASSERT(_eventHandler); + + _eventHandler->drawRect(rect); +} + +- (void)stopTimers +{ + [super stopTimers]; + + if (_eventHandler) + _eventHandler->stopTimers(); + + 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; + timer->stop(); + } +} + +- (void)startTimers +{ + [super startTimers]; + + // If the plugin is completely obscured (scrolled out of view, for example), then we will + // send null events at a reduced rate. + _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); + } +} + +- (void)focusChanged +{ + // 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); +} + +- (void)mouseDown:(NSEvent *)theEvent +{ + if (!_isStarted) + return; + + _eventHandler->mouseDown(theEvent); +} + +- (void)mouseUp:(NSEvent *)theEvent +{ + if (!_isStarted) + return; + + _eventHandler->mouseUp(theEvent); +} + +- (void)mouseEntered:(NSEvent *)theEvent +{ + if (!_isStarted) + return; + + _eventHandler->mouseEntered(theEvent); +} + +- (void)mouseExited:(NSEvent *)theEvent +{ + 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]; +} + +// 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 +{ + if (!_isStarted) + return; + + _eventHandler->mouseDragged(theEvent); +} + +- (void)scrollWheel:(NSEvent *)theEvent +{ + if (!_isStarted) { + [super scrollWheel:theEvent]; + return; + } + + if (!_eventHandler->scrollWheel(theEvent)) + [super scrollWheel:theEvent]; +} + +- (void)keyUp:(NSEvent *)theEvent +{ + if (!_isStarted) + return; + + _eventHandler->keyUp(theEvent); +} + +- (void)keyDown:(NSEvent *)theEvent +{ + if (!_isStarted) + return; + + _eventHandler->keyDown(theEvent); +} + +- (void)flagsChanged:(NSEvent *)theEvent +{ + if (!_isStarted) + return; + + _eventHandler->flagsChanged(theEvent); +} + +#pragma mark WEB_NETSCAPE_PLUGIN + +- (BOOL)isNewWindowEqualToOldWindow +{ + if (window.x != lastSetWindow.x) + return NO; + if (window.y != lastSetWindow.y) + return NO; + if (window.width != lastSetWindow.width) + return NO; + if (window.height != lastSetWindow.height) + return NO; + if (window.clipRect.top != lastSetWindow.clipRect.top) + return NO; + if (window.clipRect.left != lastSetWindow.clipRect.left) + return NO; + if (window.clipRect.bottom != lastSetWindow.clipRect.bottom) + return NO; + if (window.clipRect.right != lastSetWindow.clipRect.right) + return NO; + if (window.type != lastSetWindow.type) + return NO; + + switch (drawingModel) { +#ifndef NP_NO_QUICKDRAW + case NPDrawingModelQuickDraw: + if (nPort.qdPort.portx != lastSetPort.qdPort.portx) + return NO; + if (nPort.qdPort.porty != lastSetPort.qdPort.porty) + return NO; + if (nPort.qdPort.port != lastSetPort.qdPort.port) + return NO; + break; +#endif /* NP_NO_QUICKDRAW */ + + case NPDrawingModelCoreGraphics: + if (nPort.cgPort.window != lastSetPort.cgPort.window) + return NO; + if (nPort.cgPort.context != lastSetPort.cgPort.context) + return NO; + break; + + case NPDrawingModelCoreAnimation: + if (window.window != lastSetWindow.window) + return NO; + break; + default: + ASSERT_NOT_REACHED(); + break; + } + + return YES; +} + +-(void)tellQuickTimeToChill +{ +#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]; + if (!windowRef) { + return; + } + CGrafPtr port = GetWindowPort(windowRef); + ::Rect bounds; + GetPortBounds(port, &bounds); + WKCallDrawingNotification(port, &bounds); +#endif /* NP_NO_QUICKDRAW */ +} + +- (void)updateAndSetWindow +{ + // A plug-in can only update if it's (1) already been started (2) isn't stopped + // and (3) is able to draw on-screen. To meet condition (3) the plug-in must not + // be hidden and be attached to a window. QuickDraw plug-ins are an important + // excpetion to rule (3) because they manually must be told when to stop writing + // bits to the window backing store, thus to do so requires a new call to + // NPP_SetWindow() with an empty NPWindow struct. + if (!_isStarted) + return; + +#ifdef NP_NO_QUICKDRAW + if (![self canDraw]) + return; +#else + if (drawingModel == NPDrawingModelQuickDraw) + [self tellQuickTimeToChill]; + else if (drawingModel == NPDrawingModelCoreGraphics && ![self canDraw]) + return; + +#endif // NP_NO_QUICKDRAW + + BOOL didLockFocus = [NSView focusView] != self && [self lockFocusIfCanDraw]; + + PortState portState = [self saveAndSetNewPortState]; + if (portState) { + [self setWindowIfNecessary]; + [self restorePortState:portState]; + if (portState != (PortState)1) + free(portState); + } + if (didLockFocus) + [self unlockFocus]; +} + +- (void)setWindowIfNecessary +{ + if (!_isStarted) + return; + + if (![self isNewWindowEqualToOldWindow]) { + // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow. + // We probably don't want more general reentrancy protection; we are really + // protecting only against this one case, which actually comes up when + // you first install the SVG viewer plug-in. + NPError npErr; + ASSERT(!inSetWindow); + + inSetWindow = YES; + + // A CoreGraphics plugin's window may only be set while the plugin is being updated + ASSERT((drawingModel != NPDrawingModelCoreGraphics) || [NSView focusView] == self); + + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + npErr = [_pluginPackage.get() pluginFuncs]->setwindow(plugin, &window); + } + [self didCallPlugInFunction]; + inSetWindow = NO; + +#ifndef NDEBUG + switch (drawingModel) { +#ifndef NP_NO_QUICKDRAW + case NPDrawingModelQuickDraw: + LOG(Plugins, "NPP_SetWindow (QuickDraw): %d, port=0x%08x, window.x:%d window.y:%d window.width:%d window.height:%d", + npErr, (int)nPort.qdPort.port, (int)window.x, (int)window.y, (int)window.width, (int)window.height); + break; +#endif /* NP_NO_QUICKDRAW */ + + case NPDrawingModelCoreGraphics: + LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d", + npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height); + break; + + case NPDrawingModelCoreAnimation: + LOG(Plugins, "NPP_SetWindow (CoreAnimation): %d, window=%p window.x:%d window.y:%d window.width:%d window.height:%d", + npErr, window.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height); + break; + + default: + ASSERT_NOT_REACHED(); + break; + } +#endif /* !defined(NDEBUG) */ + + lastSetWindow = window; + lastSetPort = nPort; + } +} + ++ (void)setCurrentPluginView:(WebNetscapePluginView *)view +{ + currentPluginView = view; +} + ++ (WebNetscapePluginView *)currentPluginView +{ + return currentPluginView; +} + +- (BOOL)createPlugin +{ + // Open the plug-in package so it remains loaded while our plugin uses it + [_pluginPackage.get() open]; + + // 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; + + NPError npErr = [self _createPlugin]; + if (npErr != NPERR_NO_ERROR) { + LOG_ERROR("NPP_New failed with error: %d", npErr); + [self _destroyPlugin]; + [_pluginPackage.get() close]; + return NO; + } + + if (drawingModel == (NPDrawingModel)-1) { +#ifndef NP_NO_QUICKDRAW + // 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. 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.get()); + [self _destroyPlugin]; + [_pluginPackage.get() close]; + + return NO; + } +#endif // NP_NO_CARBON + +#ifndef BUILDING_ON_TIGER + if (drawingModel == NPDrawingModelCoreAnimation) { + void *value = 0; + if ([_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginCoreAnimationLayer, &value) == NPERR_NO_ERROR && value) { + + // The plug-in gives us a retained layer. + _pluginLayer.adoptNS((CALayer *)value); + [self setWantsLayer:YES]; + LOG(Plugins, "%@ is using Core Animation drawing model with layer %@", _pluginPackage.get(), _pluginLayer.get()); + } + + ASSERT(_pluginLayer); + } +#endif + + // Create the event handler + _eventHandler.set(WebNetscapePluginEventHandler::create(self)); + + // Get the text input vtable + if (eventModel == NPEventModelCocoa) { + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + NPPluginTextInputFuncs *value = 0; + if (![_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginTextInputFuncs, &value) == NPERR_NO_ERROR && value) + textInputFuncs = value; + } + [self didCallPlugInFunction]; + } + + return YES; +} + +#ifndef BUILDING_ON_TIGER +- (void)setLayer:(CALayer *)newLayer +{ + [super setLayer:newLayer]; + + if (_pluginLayer) + [newLayer addSublayer:_pluginLayer.get()]; +} +#endif + +- (void)loadStream +{ + if (_loadManually) { + [self _redeliverStream]; + return; + } + + // If the OBJECT/EMBED tag has no SRC, the URL is passed to us as "". + // Check for this and don't start a load in this case. + if (_sourceURL && ![_sourceURL.get() _web_isEmpty]) { + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_sourceURL.get()]; + [request _web_setHTTPReferrer:core([self webFrame])->loader()->outgoingReferrer()]; + [self loadRequest:request inTarget:nil withNotifyData:nil sendNotification:NO]; + } +} + +- (BOOL)shouldStop +{ + // If we're already calling a plug-in function, do not call NPP_Destroy(). The plug-in function we are calling + // may assume that its instance->pdata, or other memory freed by NPP_Destroy(), is valid and unchanged until said + // plugin-function returns. + // See <rdar://problem/4480737>. + if (pluginFunctionCallDepth > 0) { + shouldStopSoon = YES; + return NO; + } + + return YES; +} + +- (void)destroyPlugin +{ + // 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(); + + [[_pendingFrameLoads.get() allKeys] makeObjectsPerformSelector:@selector(_setInternalLoadDelegate:) withObject:nil]; + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + + // Setting the window type to 0 ensures that NPP_SetWindow will be called if the plug-in is restarted. + lastSetWindow.type = (NPWindowType)0; + +#ifndef BUILDING_ON_TIGER + _pluginLayer = 0; +#endif + + [self _destroyPlugin]; + [_pluginPackage.get() close]; + + _eventHandler.clear(); + + textInputFuncs = 0; +} + +- (NPEventModel)eventModel +{ + return eventModel; +} + +- (NPP)plugin +{ + return plugin; +} + +- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values; +{ + ASSERT([keys count] == [values count]); + + // Convert the attributes to 2 C string arrays. + // These arrays are passed to NPP_New, but the strings need to be + // modifiable and live the entire life of the plugin. + + // The Java plug-in requires the first argument to be the base URL + if ([_MIMEType.get() isEqualToString:@"application/x-java-applet"]) { + cAttributes = (char **)malloc(([keys count] + 1) * sizeof(char *)); + cValues = (char **)malloc(([values count] + 1) * sizeof(char *)); + cAttributes[0] = strdup("DOCBASE"); + cValues[0] = strdup([_baseURL.get() _web_URLCString]); + argsCount++; + } else { + cAttributes = (char **)malloc([keys count] * sizeof(char *)); + cValues = (char **)malloc([values count] * sizeof(char *)); + } + + BOOL isWMP = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.WMP.defaultplugin"]; + + unsigned i; + unsigned count = [keys count]; + for (i = 0; i < count; i++) { + NSString *key = [keys objectAtIndex:i]; + NSString *value = [values objectAtIndex:i]; + if ([key _webkit_isCaseInsensitiveEqualToString:@"height"]) { + specifiedHeight = [value intValue]; + } else if ([key _webkit_isCaseInsensitiveEqualToString:@"width"]) { + specifiedWidth = [value intValue]; + } + // Avoid Window Media Player crash when these attributes are present. + if (isWMP && ([key _webkit_isCaseInsensitiveEqualToString:@"SAMIStyle"] || [key _webkit_isCaseInsensitiveEqualToString:@"SAMILang"])) { + continue; + } + cAttributes[argsCount] = strdup([key UTF8String]); + cValues[argsCount] = strdup([value UTF8String]); + LOG(Plugins, "%@ = %@", key, value); + argsCount++; + } +} + +#pragma mark NSVIEW + +- (id)initWithFrame:(NSRect)frame + pluginPackage:(WebNetscapePluginPackage *)pluginPackage + URL:(NSURL *)URL + baseURL:(NSURL *)baseURL + MIMEType:(NSString *)MIME + attributeKeys:(NSArray *)keys + attributeValues:(NSArray *)values + loadManually:(BOOL)loadManually + DOMElement:(DOMElement *)element +{ + self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually DOMElement:element]; + if (!self) + return nil; + + _pendingFrameLoads.adoptNS([[NSMutableDictionary alloc] init]); + + // load the plug-in if it is not already loaded + if (![pluginPackage load]) { + [self release]; + return nil; + } + + return self; +} + +- (id)initWithFrame:(NSRect)frame +{ + ASSERT_NOT_REACHED(); + return nil; +} + +- (void)fini +{ +#ifndef NP_NO_QUICKDRAW + if (offscreenGWorld) + DisposeGWorld(offscreenGWorld); +#endif + + for (unsigned i = 0; i < argsCount; i++) { + free(cAttributes[i]); + free(cValues[i]); + } + free(cAttributes); + free(cValues); + + ASSERT(!_eventHandler); + + if (timers) { + deleteAllValues(*timers); + delete timers; + } +} + +- (void)disconnectStream:(WebNetscapePluginStream*)stream +{ + streams.remove(stream); +} + +- (void)dealloc +{ + ASSERT(!_isStarted); + ASSERT(!plugin); + + [self fini]; + + [super dealloc]; +} + +- (void)finalize +{ + ASSERT_MAIN_THREAD(); + ASSERT(!_isStarted); + + [self fini]; + + [super finalize]; +} + +- (void)drawRect:(NSRect)rect +{ + if (drawingModel == NPDrawingModelCoreAnimation) + return; + + if (!_isStarted) + return; + + if ([NSGraphicsContext currentContextDrawingToScreen]) + [self sendDrawRectEvent:rect]; + else { + NSBitmapImageRep *printedPluginBitmap = [self _printedPluginBitmap]; + if (printedPluginBitmap) { + // Flip the bitmap before drawing because the QuickDraw port 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); + [printedPluginBitmap drawInRect:bounds]; + CGContextRestoreGState(cgContext); + } + } +} + +- (NPObject *)createPluginScriptableObject +{ + if (![_pluginPackage.get() pluginFuncs]->getvalue || !_isStarted) + return NULL; + + NPObject *value = NULL; + NPError error; + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + error = [_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginScriptableNPObject, &value); + } + [self didCallPlugInFunction]; + if (error != NPERR_NO_ERROR) + return NULL; + + return value; +} + +- (void)willCallPlugInFunction +{ + ASSERT(plugin); + + // Could try to prevent infinite recursion here, but it's probably not worth the effort. + pluginFunctionCallDepth++; +} + +- (void)didCallPlugInFunction +{ + ASSERT(pluginFunctionCallDepth > 0); + pluginFunctionCallDepth--; + + // If -stop was called while we were calling into a plug-in function, and we're no longer + // inside a plug-in function, stop now. + if (pluginFunctionCallDepth == 0 && shouldStopSoon) { + shouldStopSoon = NO; + [self stop]; + } +} + +-(void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response +{ + ASSERT(_loadManually); + ASSERT(!_manualStream); + + _manualStream = WebNetscapePluginStream::create(core([self webFrame])->loader()); +} + +- (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data +{ + ASSERT(_loadManually); + ASSERT(_manualStream); + + _dataLengthReceived += [data length]; + + if (!_isStarted) + return; + + 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->didReceiveData(0, static_cast<const char *>([data bytes]), [data length]); +} + +- (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error +{ + ASSERT(_loadManually); + + _error = error; + + if (!_isStarted) { + return; + } + + _manualStream->destroyStreamWithError(error); +} + +- (void)pluginViewFinishedLoading:(NSView *)pluginView +{ + ASSERT(_loadManually); + ASSERT(_manualStream); + + if (_isStarted) + _manualStream->didFinishLoading(0); +} + +#pragma mark NSTextInput implementation + +- (NSTextInputContext *)inputContext +{ +#ifndef NP_NO_CARBON + if (!_isStarted || eventModel == NPEventModelCarbon) + return nil; +#endif + + return [super inputContext]; +} + +- (BOOL)hasMarkedText +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->hasMarkedText) + return textInputFuncs->hasMarkedText(plugin); + + return NO; +} + +- (void)insertText:(id)aString +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->insertText) + textInputFuncs->insertText(plugin, aString); +} + +- (NSRange)markedRange +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->markedRange) + return textInputFuncs->markedRange(plugin); + + return NSMakeRange(NSNotFound, 0); +} + +- (NSRange)selectedRange +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->selectedRange) + return textInputFuncs->selectedRange(plugin); + + return NSMakeRange(NSNotFound, 0); +} + +- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->setMarkedText) + textInputFuncs->setMarkedText(plugin, aString, selRange); +} + +- (void)unmarkText +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->unmarkText) + textInputFuncs->unmarkText(plugin); +} + +- (NSArray *)validAttributesForMarkedText +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->validAttributesForMarkedText) + return textInputFuncs->validAttributesForMarkedText(plugin); + + return [NSArray array]; +} + +- (NSAttributedString *)attributedSubstringFromRange:(NSRange)theRange +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->attributedSubstringFromRange) + return textInputFuncs->attributedSubstringFromRange(plugin, theRange); + + return nil; +} + +- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->characterIndexForPoint) { + // Convert the point to window coordinates + NSPoint point = [[self window] convertScreenToBase:thePoint]; + + // And view coordinates + point = [self convertPoint:point fromView:nil]; + + return textInputFuncs->characterIndexForPoint(plugin, point); + } + + return NSNotFound; +} + +- (void)doCommandBySelector:(SEL)aSelector +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->doCommandBySelector) + textInputFuncs->doCommandBySelector(plugin, aSelector); +} + +- (NSRect)firstRectForCharacterRange:(NSRange)theRange +{ + ASSERT(eventModel == NPEventModelCocoa); + ASSERT(_isStarted); + + if (textInputFuncs && textInputFuncs->firstRectForCharacterRange) { + NSRect rect = textInputFuncs->firstRectForCharacterRange(plugin, theRange); + + // Convert the rect to window coordinates + rect = [self convertRect:rect toView:nil]; + + // Convert the rect location to screen coordinates + rect.origin = [[self window] convertBaseToScreen:rect.origin]; + + return rect; + } + + return NSZeroRect; +} + +// test for 10.4 because of <rdar://problem/4243463> +#ifdef BUILDING_ON_TIGER +- (long)conversationIdentifier +{ + return (long)self; +} +#else +- (NSInteger)conversationIdentifier +{ + return (NSInteger)self; +} +#endif + +@end + +@implementation WebNetscapePluginView (WebNPPCallbacks) + +- (void)evaluateJavaScriptPluginRequest:(WebPluginRequest *)JSPluginRequest +{ + // FIXME: Is this isStarted check needed here? evaluateJavaScriptPluginRequest should not be called + // if we are stopped since this method is called after a delay and we call + // cancelPreviousPerformRequestsWithTarget inside of stop. + if (!_isStarted) { + return; + } + + NSURL *URL = [[JSPluginRequest request] URL]; + NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; + ASSERT(JSString); + + NSString *result = [[self webFrame] _stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:[JSPluginRequest isCurrentEventUserGesture]]; + + // Don't continue if stringByEvaluatingJavaScriptFromString caused the plug-in to stop. + if (!_isStarted) { + return; + } + + if ([JSPluginRequest frameName] != nil) { + // FIXME: If the result is a string, we probably want to put that string into the frame. + if ([JSPluginRequest sendNotification]) { + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + [_pluginPackage.get() pluginFuncs]->urlnotify(plugin, [URL _web_URLCString], NPRES_DONE, [JSPluginRequest notifyData]); + } + [self didCallPlugInFunction]; + } + } 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]; + + 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); + } +} + +- (void)webFrame:(WebFrame *)webFrame didFinishLoadWithReason:(NPReason)reason +{ + ASSERT(_isStarted); + + WebPluginRequest *pluginRequest = [_pendingFrameLoads.get() objectForKey:webFrame]; + ASSERT(pluginRequest != nil); + ASSERT([pluginRequest sendNotification]); + + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + [_pluginPackage.get() pluginFuncs]->urlnotify(plugin, [[[pluginRequest request] URL] _web_URLCString], reason, [pluginRequest notifyData]); + } + [self didCallPlugInFunction]; + + [_pendingFrameLoads.get() removeObjectForKey:webFrame]; + [webFrame _setInternalLoadDelegate:nil]; +} + +- (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error +{ + NPReason reason = NPRES_DONE; + if (error != nil) + reason = WebNetscapePluginStream::reasonForError(error); + [self webFrame:webFrame didFinishLoadWithReason:reason]; +} + +- (void)loadPluginRequest:(WebPluginRequest *)pluginRequest +{ + NSURLRequest *request = [pluginRequest request]; + NSString *frameName = [pluginRequest frameName]; + WebFrame *frame = nil; + + NSURL *URL = [request URL]; + NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; + + ASSERT(frameName || JSString); + + if (frameName) { + // FIXME - need to get rid of this window creation which + // bypasses normal targeted link handling + frame = kit(core([self webFrame])->loader()->findFrameForNavigation(frameName)); + if (frame == nil) { + WebView *currentWebView = [self webView]; + NSDictionary *features = [[NSDictionary alloc] init]; + WebView *newWebView = [[currentWebView _UIDelegateForwarder] webView:currentWebView + createWebViewWithRequest:nil + windowFeatures:features]; + [features release]; + + if (!newWebView) { + if ([pluginRequest sendNotification]) { + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + [_pluginPackage.get() pluginFuncs]->urlnotify(plugin, [[[pluginRequest request] URL] _web_URLCString], NPERR_GENERIC_ERROR, [pluginRequest notifyData]); + } + [self didCallPlugInFunction]; + } + return; + } + + frame = [newWebView mainFrame]; + core(frame)->tree()->setName(frameName); + [[newWebView _UIDelegateForwarder] webViewShow:newWebView]; + } + } + + if (JSString) { + ASSERT(frame == nil || [self webFrame] == frame); + [self evaluateJavaScriptPluginRequest:pluginRequest]; + } else { + [frame loadRequest:request]; + if ([pluginRequest sendNotification]) { + // Check if another plug-in view or even this view is waiting for the frame to load. + // If it is, tell it that the load was cancelled because it will be anyway. + WebNetscapePluginView *view = [frame _internalLoadDelegate]; + if (view != nil) { + ASSERT([view isKindOfClass:[WebNetscapePluginView class]]); + [view webFrame:frame didFinishLoadWithReason:NPRES_USER_BREAK]; + } + [_pendingFrameLoads.get() _webkit_setObject:pluginRequest forUncopiedKey:frame]; + [frame _setInternalLoadDelegate:self]; + } + } +} + +- (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification +{ + NSURL *URL = [request URL]; + + 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 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] != core([self webFrame])->loader()->activeDocumentLoader() && + (!cTarget || [frame findFrameNamed:target] != frame)) { + return NPERR_GENERIC_ERROR; + } + + NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; + if (JSString != nil) { + if (![[[self webView] preferences] isJavaScriptEnabled]) { + // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does. + return NPERR_GENERIC_ERROR; + } else if (cTarget == NULL && _mode == NP_FULL) { + // Don't allow a JavaScript request from a standalone plug-in that is self-targetted + // 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 && target && [frame findFrameNamed:target] != frame) { + // For security reasons, only allow JS requests to be made on the frame that contains the plug-in. + return NPERR_INVALID_PARAM; + } + + 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]; + } else { + RefPtr<WebNetscapePluginStream> stream = WebNetscapePluginStream::create(request, plugin, sendNotification, notifyData); + + streams.add(stream.get()); + stream->start(); + } + + return NPERR_NO_ERROR; +} + +-(NPError)getURLNotify:(const char *)URLCString target:(const char *)cTarget notifyData:(void *)notifyData +{ + LOG(Plugins, "NPN_GetURLNotify: %s target: %s", URLCString, cTarget); + + NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; + return [self loadRequest:request inTarget:cTarget withNotifyData:notifyData sendNotification:YES]; +} + +-(NPError)getURL:(const char *)URLCString target:(const char *)cTarget +{ + LOG(Plugins, "NPN_GetURL: %s target: %s", URLCString, cTarget); + + NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; + return [self loadRequest:request inTarget:cTarget withNotifyData:NULL sendNotification:NO]; +} + +- (NPError)_postURL:(const char *)URLCString + target:(const char *)target + len:(UInt32)len + buf:(const char *)buf + file:(NPBool)file + notifyData:(void *)notifyData + sendNotification:(BOOL)sendNotification + allowHeaders:(BOOL)allowHeaders +{ + if (!URLCString || !len || !buf) { + return NPERR_INVALID_PARAM; + } + + NSData *postData = nil; + + if (file) { + // If we're posting a file, buf is either a file URL or a path to the file. + NSString *bufString = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1); + if (!bufString) { + return NPERR_INVALID_PARAM; + } + NSURL *fileURL = [NSURL _web_URLWithDataAsString:bufString]; + NSString *path; + if ([fileURL isFileURL]) { + path = [fileURL path]; + } else { + path = bufString; + } + postData = [NSData dataWithContentsOfFile:[path _webkit_fixedCarbonPOSIXPath]]; + CFRelease(bufString); + if (!postData) { + return NPERR_FILE_NOT_FOUND; + } + } else { + postData = [NSData dataWithBytes:buf length:len]; + } + + if ([postData length] == 0) { + return NPERR_INVALID_PARAM; + } + + NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; + [request setHTTPMethod:@"POST"]; + + if (allowHeaders) { + if ([postData _web_startsWithBlankLine]) { + postData = [postData subdataWithRange:NSMakeRange(1, [postData length] - 1)]; + } else { + NSInteger location = [postData _web_locationAfterFirstBlankLine]; + if (location != NSNotFound) { + // If the blank line is somewhere in the middle of postData, everything before is the header. + NSData *headerData = [postData subdataWithRange:NSMakeRange(0, location)]; + NSMutableDictionary *header = [headerData _webkit_parseRFC822HeaderFields]; + unsigned dataLength = [postData length] - location; + + // Sometimes plugins like to set Content-Length themselves when they post, + // but WebFoundation does not like that. So we will remove the header + // and instead truncate the data to the requested length. + NSString *contentLength = [header objectForKey:@"Content-Length"]; + + if (contentLength != nil) + dataLength = MIN((unsigned)[contentLength intValue], dataLength); + [header removeObjectForKey:@"Content-Length"]; + + if ([header count] > 0) { + [request setAllHTTPHeaderFields:header]; + } + // Everything after the blank line is the actual content of the POST. + postData = [postData subdataWithRange:NSMakeRange(location, dataLength)]; + + } + } + if ([postData length] == 0) { + return NPERR_INVALID_PARAM; + } + } + + // Plug-ins expect to receive uncached data when doing a POST (3347134). + [request setCachePolicy:NSURLRequestReloadIgnoringCacheData]; + [request setHTTPBody:postData]; + + return [self loadRequest:request inTarget:target withNotifyData:notifyData sendNotification:sendNotification]; +} + +- (NPError)postURLNotify:(const char *)URLCString + target:(const char *)target + len:(UInt32)len + buf:(const char *)buf + file:(NPBool)file + notifyData:(void *)notifyData +{ + LOG(Plugins, "NPN_PostURLNotify: %s", URLCString); + return [self _postURL:URLCString target:target len:len buf:buf file:file notifyData:notifyData sendNotification:YES allowHeaders:YES]; +} + +-(NPError)postURL:(const char *)URLCString + target:(const char *)target + len:(UInt32)len + buf:(const char *)buf + file:(NPBool)file +{ + LOG(Plugins, "NPN_PostURL: %s", URLCString); + // As documented, only allow headers to be specified via NPP_PostURL when using a file. + return [self _postURL:URLCString target:target len:len buf:buf file:file notifyData:NULL sendNotification:NO allowHeaders:file]; +} + +-(NPError)newStream:(NPMIMEType)type target:(const char *)target stream:(NPStream**)stream +{ + LOG(Plugins, "NPN_NewStream"); + return NPERR_GENERIC_ERROR; +} + +-(NPError)write:(NPStream*)stream len:(SInt32)len buffer:(void *)buffer +{ + LOG(Plugins, "NPN_Write"); + return NPERR_GENERIC_ERROR; +} + +-(NPError)destroyStream:(NPStream*)stream reason:(NPReason)reason +{ + LOG(Plugins, "NPN_DestroyStream"); + // 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 || WebNetscapePluginStream::ownerForStream(stream) != plugin) { + LOG(Plugins, "Invalid NPStream passed to NPN_DestroyStream: %p", stream); + return NPERR_INVALID_INSTANCE_ERROR; + } + + WebNetscapePluginStream* browserStream = static_cast<WebNetscapePluginStream*>(stream->ndata); + browserStream->cancelLoadAndDestroyStreamWithError(browserStream->errorForReason(reason)); + + return NPERR_NO_ERROR; +} + +- (const char *)userAgent +{ + NSString *userAgent = [[self webView] userAgentForURL:_baseURL.get()]; + + if (_isSilverlight) { + // Silverlight has a workaround for a leak in Safari 2. This workaround is + // applied when the user agent does not contain "Version/3" so we append it + // at the end of the user agent. + userAgent = [userAgent stringByAppendingString:@" Version/3.2.1"]; + } + + return [userAgent UTF8String]; +} + +-(void)status:(const char *)message +{ + if (!message) { + LOG_ERROR("NPN_Status passed a NULL status message"); + return; + } + + CFStringRef status = CFStringCreateWithCString(NULL, message, kCFStringEncodingUTF8); + if (!status) { + LOG_ERROR("NPN_Status: the message was not valid UTF-8"); + return; + } + + LOG(Plugins, "NPN_Status: %@", status); + WebView *wv = [self webView]; + [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status]; + CFRelease(status); +} + +-(void)invalidateRect:(NPRect *)invalidRect +{ + LOG(Plugins, "NPN_InvalidateRect"); + [self setNeedsDisplayInRect:NSMakeRect(invalidRect->left, invalidRect->top, + (float)invalidRect->right - invalidRect->left, (float)invalidRect->bottom - invalidRect->top)]; +} + +-(BOOL)isOpaque +{ + return YES; +} + +- (void)invalidateRegion:(NPRegion)invalidRegion +{ + LOG(Plugins, "NPN_InvalidateRegion"); + NSRect invalidRect = NSZeroRect; + switch (drawingModel) { +#ifndef NP_NO_QUICKDRAW + case NPDrawingModelQuickDraw: + { + ::Rect qdRect; + GetRegionBounds((NPQDRegion)invalidRegion, &qdRect); + invalidRect = NSMakeRect(qdRect.left, qdRect.top, qdRect.right - qdRect.left, qdRect.bottom - qdRect.top); + } + break; +#endif /* NP_NO_QUICKDRAW */ + + case NPDrawingModelCoreGraphics: + { + CGRect cgRect = CGPathGetBoundingBox((NPCGRegion)invalidRegion); + invalidRect = *(NSRect*)&cgRect; + break; + } + default: + ASSERT_NOT_REACHED(); + break; + } + + [self setNeedsDisplayInRect:invalidRect]; +} + +-(void)forceRedraw +{ + LOG(Plugins, "forceRedraw"); + [self setNeedsDisplay:YES]; + [[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->script()->windowScriptNPObject() : 0; + + // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess> + if (windowScriptObject) + _NPN_RetainObject(windowScriptObject); + + void **v = (void **)value; + *v = windowScriptObject; + + return NPERR_NO_ERROR; + } + + case NPNVPluginElementNPObject: + { + if (!_element) + return NPERR_GENERIC_ERROR; + + NPObject *plugInScriptObject = (NPObject *)[_element.get() _NPObject]; + + // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess> + if (plugInScriptObject) + _NPN_RetainObject(plugInScriptObject); + + void **v = (void **)value; + *v = plugInScriptObject; + + return NPERR_NO_ERROR; + } + + case NPNVpluginDrawingModel: + { + *(NPDrawingModel *)value = drawingModel; + return NPERR_NO_ERROR; + } + +#ifndef NP_NO_QUICKDRAW + case NPNVsupportsQuickDrawBool: + { + *(NPBool *)value = TRUE; + return NPERR_NO_ERROR; + } +#endif /* NP_NO_QUICKDRAW */ + + case NPNVsupportsCoreGraphicsBool: + { + *(NPBool *)value = TRUE; + return NPERR_NO_ERROR; + } + + case NPNVsupportsOpenGLBool: + { + *(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; + } + + return NPERR_GENERIC_ERROR; +} + +- (NPError)setVariable:(NPPVariable)variable value:(void *)value +{ + switch (variable) { + case NPPVpluginDrawingModel: + { + // Can only set drawing model inside NPP_New() + if (self != [[self class] currentPluginView]) + return NPERR_GENERIC_ERROR; + + // Check for valid, supported drawing model + NPDrawingModel newDrawingModel = (NPDrawingModel)(uintptr_t)value; + switch (newDrawingModel) { + // Supported drawing models: +#ifndef NP_NO_QUICKDRAW + case NPDrawingModelQuickDraw: +#endif + case NPDrawingModelCoreGraphics: +#ifndef BUILDING_ON_TIGER + case NPDrawingModelCoreAnimation: +#endif + drawingModel = newDrawingModel; + return NPERR_NO_ERROR; + + + // Unsupported (or unknown) drawing models: + default: + LOG(Plugins, "Plugin %@ uses unsupported drawing model: %d", _eventHandler.get(), drawingModel); + return NPERR_GENERIC_ERROR; + } + } + + 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", _eventHandler.get(), 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; + + do { + timerID = ++currentTimerID; + } while (timers->contains(timerID) || timerID == 0); + + PluginTimer* timer = new PluginTimer(plugin, timerID, interval, repeat, timerFunc); + timers->set(timerID, timer); + + if (_shouldFireTimers) + timer->start(_isCompletelyObscured); + + return timerID; +} + +- (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 WebNetscapePluginView (Internal) + +- (NPError)_createPlugin +{ + plugin = (NPP)calloc(1, sizeof(NPP_t)); + plugin->ndata = self; + + ASSERT([_pluginPackage.get() pluginFuncs]->newp); + + // NPN_New(), which creates the plug-in instance, should never be called while calling a plug-in function for that instance. + ASSERT(pluginFunctionCallDepth == 0); + + PluginMainThreadScheduler::scheduler().registerPlugin(plugin); + + _isSilverlight = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.SilverlightPlugin"]; + + [[self class] setCurrentPluginView:self]; + NPError npErr = [_pluginPackage.get() pluginFuncs]->newp((char *)[_MIMEType.get() cString], plugin, _mode, argsCount, cAttributes, cValues, NULL); + [[self class] setCurrentPluginView:nil]; + LOG(Plugins, "NPP_New: %d", npErr); + return npErr; +} + +- (void)_destroyPlugin +{ + PluginMainThreadScheduler::scheduler().unregisterPlugin(plugin); + + NPError npErr; + npErr = ![_pluginPackage.get() pluginFuncs]->destroy(plugin, NULL); + LOG(Plugins, "NPP_Destroy: %d", npErr); + + if (Frame* frame = core([self webFrame])) + frame->script()->cleanupScriptObjectsForPlugin(self); + + free(plugin); + plugin = NULL; +} + +- (NSBitmapImageRep *)_printedPluginBitmap +{ +#ifdef NP_NO_QUICKDRAW + return nil; +#else + // Cannot print plugins that do not implement NPP_Print + if (![_pluginPackage.get() pluginFuncs]->print) + return nil; + + // This NSBitmapImageRep will share its bitmap buffer with a GWorld that the plugin will draw into. + // The bitmap is created in 32-bits-per-pixel ARGB format, which is the default GWorld pixel format. + NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL + pixelsWide:window.width + pixelsHigh:window.height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bitmapFormat:NSAlphaFirstBitmapFormat + bytesPerRow:0 + bitsPerPixel:0] autorelease]; + ASSERT(bitmap); + + // Create a GWorld with the same underlying buffer into which the plugin can draw + ::Rect printGWorldBounds; + SetRect(&printGWorldBounds, 0, 0, window.width, window.height); + GWorldPtr printGWorld; + if (NewGWorldFromPtr(&printGWorld, + k32ARGBPixelFormat, + &printGWorldBounds, + NULL, + NULL, + 0, + (Ptr)[bitmap bitmapData], + [bitmap bytesPerRow]) != noErr) { + LOG_ERROR("Could not create GWorld for printing"); + return nil; + } + + /// Create NPWindow for the GWorld + NPWindow printNPWindow; + printNPWindow.window = &printGWorld; // Normally this is an NP_Port, but when printing it is the actual CGrafPtr + printNPWindow.x = 0; + printNPWindow.y = 0; + printNPWindow.width = window.width; + printNPWindow.height = window.height; + printNPWindow.clipRect.top = 0; + printNPWindow.clipRect.left = 0; + printNPWindow.clipRect.right = window.width; + printNPWindow.clipRect.bottom = window.height; + printNPWindow.type = NPWindowTypeDrawable; // Offscreen graphics port as opposed to a proper window + + // Create embed-mode NPPrint + NPPrint npPrint; + npPrint.mode = NP_EMBED; + npPrint.print.embedPrint.window = printNPWindow; + npPrint.print.embedPrint.platformPrint = printGWorld; + + // Tell the plugin to print into the GWorld + [self willCallPlugInFunction]; + { + JSC::JSLock::DropAllLocks dropAllLocks(false); + [_pluginPackage.get() pluginFuncs]->print(plugin, &npPrint); + } + [self didCallPlugInFunction]; + + // Don't need the GWorld anymore + DisposeGWorld(printGWorld); + + return bitmap; +#endif +} + +- (void)_redeliverStream +{ + if ([self dataSource] && _isStarted) { + // Deliver what has not been passed to the plug-in up to this point. + if (_dataLengthReceived > 0) { + NSData *data = [[[self dataSource] data] subdataWithRange:NSMakeRange(0, _dataLengthReceived)]; + _dataLengthReceived = 0; + [self pluginView:self receivedData:data]; + if (![[self dataSource] isLoading]) { + if (_error) + [self pluginView:self receivedError:_error.get()]; + else + [self pluginViewFinishedLoading:self]; + } + } + } +} + +@end + +#endif diff --git a/WebKit/mac/Plugins/WebPluginController.mm b/WebKit/mac/Plugins/WebPluginController.mm index d892d4a..b618bd6 100644 --- a/WebKit/mac/Plugins/WebPluginController.mm +++ b/WebKit/mac/Plugins/WebPluginController.mm @@ -335,7 +335,7 @@ static void cancelOutstandingCheck(const void *item, void *context) LOG_ERROR("could not load URL %@", [request URL]); return; } - core(frame)->loader()->load(request, target); + core(frame)->loader()->load(request, target, false); } } diff --git a/WebKit/mac/Plugins/WebPluginDatabase.mm b/WebKit/mac/Plugins/WebPluginDatabase.mm index 531214e..4f2bdd8 100644 --- a/WebKit/mac/Plugins/WebPluginDatabase.mm +++ b/WebKit/mac/Plugins/WebPluginDatabase.mm @@ -28,20 +28,20 @@ #import "WebPluginDatabase.h" +#import "WebBaseNetscapePluginView.h" #import "WebBasePluginPackage.h" #import "WebDataSourcePrivate.h" #import "WebFrame.h" #import "WebFrameViewInternal.h" #import "WebHTMLRepresentation.h" #import "WebHTMLView.h" +#import "WebHTMLView.h" #import "WebKitLogging.h" -#import "WebNetscapePluginPackage.h" #import "WebNSFileManagerExtras.h" +#import "WebNetscapePluginPackage.h" #import "WebPluginController.h" -#import "WebBaseNetscapePluginView.h" #import "WebPluginPackage.h" #import "WebViewPrivate.h" -#import "WebHTMLView.h" #import <WebKitSystemInterface.h> #import <wtf/Assertions.h> diff --git a/WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h b/WebKit/mac/Plugins/WebPluginRequest.h index c21fe4c..5336dcb 100644 --- a/WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h +++ b/WebKit/mac/Plugins/WebPluginRequest.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2005, 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 @@ -26,23 +26,25 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@class NSURLResponse; -@class NSError; -@class NSData; +#if ENABLE(NETSCAPE_PLUGIN_API) -@protocol WebPlugInStreamLoaderDelegate +@interface WebPluginRequest : NSObject +{ + NSURLRequest *_request; + NSString *_frameName; + void *_notifyData; + BOOL _didStartFromUserGesture; + BOOL _sendNotification; +} -- (void)startStreamWithResponse:(NSURLResponse *)r; +- (id)initWithRequest:(NSURLRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData sendNotification:(BOOL)sendNotification didStartFromUserGesture:(BOOL)currentEventIsUserGesture; -// destroyStreamWithError tells the plug-in that the load is completed (error == nil) or ended in error. -- (void)destroyStreamWithError:(NSError *)error; - -// cancelLoadAndDestoryStreamWithError calls cancelLoadWithError: then destroyStreamWithError:. -- (void)cancelLoadAndDestroyStreamWithError:(NSError *)error; - -- (void)receivedData:(NSData *)data; -- (void)finishedLoading; - -- (BOOL)wantsAllStreams; +- (NSURLRequest *)request; +- (NSString *)frameName; +- (void *)notifyData; +- (BOOL)isCurrentEventUserGesture; +- (BOOL)sendNotification; @end + +#endif // ENABLE(NETSCAPE_PLUGIN_API) diff --git a/WebKit/mac/Plugins/WebPluginRequest.m b/WebKit/mac/Plugins/WebPluginRequest.m new file mode 100644 index 0000000..df36d40 --- /dev/null +++ b/WebKit/mac/Plugins/WebPluginRequest.m @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2005, 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. + */ + +#if ENABLE(NETSCAPE_PLUGIN_API) + +#import "WebPluginRequest.h" + +@implementation WebPluginRequest + +- (id)initWithRequest:(NSURLRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData sendNotification:(BOOL)sendNotification didStartFromUserGesture:(BOOL)currentEventIsUserGesture +{ + [super init]; + _didStartFromUserGesture = currentEventIsUserGesture; + _request = [request retain]; + _frameName = [frameName retain]; + _notifyData = notifyData; + _sendNotification = sendNotification; + return self; +} + +- (void)dealloc +{ + [_request release]; + [_frameName release]; + [super dealloc]; +} + +- (NSURLRequest *)request +{ + return _request; +} + +- (NSString *)frameName +{ + return _frameName; +} + +- (BOOL)isCurrentEventUserGesture +{ + return _didStartFromUserGesture; +} + +- (BOOL)sendNotification +{ + return _sendNotification; +} + +- (void *)notifyData +{ + return _notifyData; +} + +@end + +#endif // ENABLE(NETSCAPE_PLUGIN_API) diff --git a/WebKit/mac/Plugins/npapi.mm b/WebKit/mac/Plugins/npapi.mm index f85ec9f..eb32c2b 100644 --- a/WebKit/mac/Plugins/npapi.mm +++ b/WebKit/mac/Plugins/npapi.mm @@ -30,13 +30,13 @@ #import <WebKit/npapi.h> #import <WebKit/nptextinput.h> -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" #import "WebKitLogging.h" #import <WebCore/PluginMainThreadScheduler.h> using namespace WebCore; -WebBaseNetscapePluginView *pluginViewForInstance(NPP instance); +WebNetscapePluginView *pluginViewForInstance(NPP instance); // general plug-in to browser functions @@ -70,14 +70,14 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) // instance-specific functions // The plugin view is always the ndata of the instance. Sometimes, plug-ins will call an instance-specific function // with a NULL instance. To workaround this, call the last plug-in view that made a call to a plug-in. -// Currently, the current plug-in view is only set before NPP_New in [WebBaseNetscapePluginView start]. +// Currently, the current plug-in view is only set before NPP_New in [WebNetscapePluginView start]. // This specifically works around Flash and Shockwave. When we call NPP_New, they call NPN_UserAgent with a NULL instance. -WebBaseNetscapePluginView *pluginViewForInstance(NPP instance) +WebNetscapePluginView *pluginViewForInstance(NPP instance) { if (instance && instance->ndata) - return (WebBaseNetscapePluginView *)instance->ndata; + return (WebNetscapePluginView *)instance->ndata; else - return [WebBaseNetscapePluginView currentPluginView]; + return [WebNetscapePluginView currentPluginView]; } NPError NPN_GetURLNotify(NPP instance, const char* URL, const char* target, void* notifyData) @@ -194,14 +194,14 @@ NPError NPN_PopUpContextMenu(NPP instance, NPMenu *menu) void NPN_MarkedTextAbandoned(NPP instance) { - WebBaseNetscapePluginView *pluginView = pluginViewForInstance(instance); + WebNetscapePluginView *pluginView = pluginViewForInstance(instance); [[NSInputManager currentInputManager] markedTextAbandoned:pluginView]; } void NPN_MarkedTextSelectionChanged(NPP instance, NSRange newSel) { - WebBaseNetscapePluginView *pluginView = pluginViewForInstance(instance); + WebNetscapePluginView *pluginView = pluginViewForInstance(instance); [[NSInputManager currentInputManager] markedTextSelectionChanged:newSel client:pluginView]; } diff --git a/WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h b/WebKit/mac/WebCoreSupport/WebCachedFramePlatformData.h index 3b0ab32..6c3f166 100644 --- a/WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h +++ b/WebKit/mac/WebCoreSupport/WebCachedFramePlatformData.h @@ -27,12 +27,12 @@ */ #import <objc/objc-runtime.h> -#import <WebCore/CachedPagePlatformData.h> +#import <WebCore/CachedFramePlatformData.h> #import <wtf/RetainPtr.h> -class WebCachedPagePlatformData : public WebCore::CachedPagePlatformData { +class WebCachedFramePlatformData : public WebCore::CachedFramePlatformData { public: - WebCachedPagePlatformData(id webDocumentView) : m_webDocumentView(webDocumentView) { } + WebCachedFramePlatformData(id webDocumentView) : m_webDocumentView(webDocumentView) { } virtual void clear() { objc_msgSend(m_webDocumentView.get(), @selector(closeIfNotCurrentView)); } diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index f6a6efb..29a4c25 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -94,7 +94,9 @@ public: virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const; virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const; virtual PlatformWidget platformWindow() const; - + virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const; + virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; + virtual void setStatusbarText(const WebCore::String&); virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); @@ -131,6 +133,7 @@ public: virtual void enableSuddenTermination(); virtual void disableSuddenTermination(); + virtual void formStateDidChange(const WebCore::Node*) { } private: WebView *m_webView; diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index f864367..6b5d138 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -55,6 +55,7 @@ #import <WebCore/PlatformScreen.h> #import <WebCore/PlatformString.h> #import <WebCore/ResourceRequest.h> +#import <WebCore/ScrollView.h> #import <WebCore/Widget.h> #import <WebCore/WindowFeatures.h> #import <wtf/PassRefPtr.h> @@ -449,6 +450,30 @@ PlatformWidget WebChromeClient::platformWindow() const return 0; return m_webView; } + +void WebChromeClient::contentsSizeChanged(Frame*, const IntSize&) const +{ +} + +void WebChromeClient::scrollRectIntoView(const IntRect& r, const ScrollView* scrollView) const +{ + // FIXME: This scrolling behavior should be under the control of the embedding client (rather than something + // we just do ourselves). + + // We have to convert back to document view coordinates in order to let the flipping conversion take place. It just + // doesn't make sense for the scrollRectIntoView API to take document view coordinates. + IntRect scrollRect = r; + scrollRect.move(scrollView->scrollOffset()); + NSRect rect = scrollRect; + for (NSView *view = [[[m_webView mainFrame] frameView] documentView]; view; view = [view superview]) { + if ([view isKindOfClass:[NSClipView class]]) { + NSClipView *clipView = (NSClipView *)view; + NSView *documentView = [clipView documentView]; + [documentView scrollRectToVisible:[documentView convertRect:rect fromView:[[[m_webView mainFrame] frameView] documentView]]]; + } + } +} + // End host window methods. void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags) diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h index 245e575..2845b97 100644 --- a/WebKit/mac/WebCoreSupport/WebEditorClient.h +++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h @@ -48,6 +48,7 @@ public: virtual int spellCheckerDocumentTag(); virtual bool smartInsertDeleteEnabled(); + virtual bool isSelectTrailingWhitespaceEnabled(); virtual bool isEditable(); virtual bool shouldDeleteRange(WebCore::Range*); diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm index f2ed480..67d3cc2 100644 --- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm +++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm @@ -53,6 +53,7 @@ #import <WebCore/PlatformKeyboardEvent.h> #import <WebCore/PlatformString.h> #import <WebCore/WebCoreObjCExtras.h> +#import <runtime/InitializeThreading.h> #import <wtf/PassRefPtr.h> using namespace WebCore; @@ -89,12 +90,13 @@ WebViewInsertAction kit(EditorInsertAction coreAction) @implementation WebEditCommand -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - (id)initWithEditCommand:(PassRefPtr<EditCommand>)command { @@ -222,6 +224,11 @@ bool WebEditorClient::smartInsertDeleteEnabled() return [m_webView smartInsertDeleteEnabled]; } +bool WebEditorClient::isSelectTrailingWhitespaceEnabled() +{ + return [m_webView isSelectTrailingWhitespaceEnabled]; +} + bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration* style, Range* range) { return [[m_webView _editingDelegateForwarder] webView:m_webView @@ -447,6 +454,9 @@ void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) void WebEditorClient::textFieldDidBeginEditing(Element* element) { + if (!element->isHTMLElement()) + return; + DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element]; FormDelegateLog(inputElement); CallFormDelegate(m_webView, @selector(textFieldDidBeginEditing:inFrame:), inputElement, kit(element->document()->frame())); @@ -454,6 +464,9 @@ void WebEditorClient::textFieldDidBeginEditing(Element* element) void WebEditorClient::textFieldDidEndEditing(Element* element) { + if (!element->isHTMLElement()) + return; + DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element]; FormDelegateLog(inputElement); CallFormDelegate(m_webView, @selector(textFieldDidEndEditing:inFrame:), inputElement, kit(element->document()->frame())); @@ -461,6 +474,9 @@ void WebEditorClient::textFieldDidEndEditing(Element* element) void WebEditorClient::textDidChangeInTextField(Element* element) { + if (!element->isHTMLElement()) + return; + DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element]; FormDelegateLog(inputElement); CallFormDelegate(m_webView, @selector(textDidChangeInTextField:inFrame:), inputElement, kit(element->document()->frame())); @@ -491,6 +507,9 @@ static SEL selectorForKeyEvent(KeyboardEvent* event) bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event) { + if (!element->isHTMLElement()) + return NO; + DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element]; FormDelegateLog(inputElement); if (SEL commandSelector = selectorForKeyEvent(event)) @@ -500,6 +519,9 @@ bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEven void WebEditorClient::textWillBeDeletedInTextField(Element* element) { + if (!element->isHTMLElement()) + return; + DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element]; FormDelegateLog(inputElement); // We're using the deleteBackward selector for all deletion operations since the autofill code treats all deletions the same way. @@ -508,6 +530,9 @@ void WebEditorClient::textWillBeDeletedInTextField(Element* element) void WebEditorClient::textDidChangeInTextArea(Element* element) { + if (!element->isHTMLElement()) + return; + DOMHTMLTextAreaElement* textAreaElement = [DOMHTMLTextAreaElement _wrapHTMLTextAreaElement:(HTMLTextAreaElement*)element]; FormDelegateLog(textAreaElement); CallFormDelegate(m_webView, @selector(textDidChangeInTextArea:inFrame:), textAreaElement, kit(element->document()->frame())); diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h index 2730765..03c00ee 100644 --- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h +++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h @@ -40,7 +40,7 @@ namespace WebCore { class AuthenticationChallenge; - class CachedPage; + class CachedFrame; class HistoryItem; class String; class ResourceLoader; @@ -76,6 +76,7 @@ private: virtual void assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&); virtual void dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse); + virtual bool shouldUseCredentialStorage(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); @@ -100,6 +101,7 @@ private: virtual void dispatchDidFinishDocumentLoad(); virtual void dispatchDidFinishLoad(); virtual void dispatchDidFirstLayout(); + virtual void dispatchDidFirstVisuallyNonEmptyLayout(); virtual WebCore::Frame* dispatchCreatePage(); virtual void dispatchShow(); @@ -136,7 +138,9 @@ private: virtual void committedLoad(WebCore::DocumentLoader*, const char*, int); virtual void finishedLoading(WebCore::DocumentLoader*); - virtual void updateGlobalHistory(const WebCore::KURL&); + virtual void updateGlobalHistory(); + virtual void updateGlobalHistoryForRedirectWithoutHistoryItem(); + virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&); @@ -152,8 +156,8 @@ private: virtual WebCore::String userAgent(const WebCore::KURL&); - virtual void savePlatformDataToCachedPage(WebCore::CachedPage*); - virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*); + virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); + virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm index eb538e0..6f02729 100644 --- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm +++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,7 +35,7 @@ #import "DOMElementInternal.h" #import "WebBackForwardList.h" -#import "WebCachedPagePlatformData.h" +#import "WebCachedFramePlatformData.h" #import "WebChromeClient.h" #import "WebDataSourceInternal.h" #import "WebDocumentInternal.h" @@ -56,7 +56,7 @@ #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebNSURLExtras.h" -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" #import "WebNetscapePluginPackage.h" #import "WebNullPluginView.h" #import "WebPanelAuthenticationHandler.h" @@ -67,14 +67,13 @@ #import "WebPolicyDelegatePrivate.h" #import "WebPreferences.h" #import "WebResourceLoadDelegate.h" -#import "WebResourcePrivate.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> +#import <WebCore/CachedFrame.h> #import <WebCore/Chrome.h> #import <WebCore/Document.h> #import <WebCore/DocumentLoader.h> @@ -85,6 +84,7 @@ #import <WebCore/FrameLoaderTypes.h> #import <WebCore/FrameTree.h> #import <WebCore/FrameView.h> +#import <WebCore/HTMLHeadElement.h> #import <WebCore/HTMLFormElement.h> #import <WebCore/HTMLFrameElement.h> #import <WebCore/HTMLFrameOwnerElement.h> @@ -107,12 +107,17 @@ #import <WebCore/Widget.h> #import <WebKit/DOMElement.h> #import <WebKit/DOMHTMLFormElement.h> +#import <runtime/InitializeThreading.h> #import <wtf/PassRefPtr.h> #if ENABLE(MAC_JAVA_BRIDGE) #import "WebJavaPlugIn.h" #endif +#if USE(PLUGIN_HOST_PROCESS) +#import "WebHostedNetscapePluginView.h" +#endif + using namespace WebCore; using namespace HTMLNames; @@ -143,6 +148,48 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) return loader ? static_cast<WebDocumentLoaderMac*>(loader)->dataSource() : nil; } +// Quirk for the Apple Dictionary application. +// +// If a top level frame has a <script> element in its <head> for a script named MainPageJavaScript.js, +// then for that frame's document, ignore changes to the scrolling attribute of frames. That script +// has a bug in it where it sets the scrolling attribute on frames, and that erroneous scrolling +// attribute needs to be ignored to avoid showing extra scroll bars in the window. +// This quirk can be removed when Apple Dictionary is fixed (see <rdar://problem/6471058>). + +static void applyAppleDictionaryApplicationQuirkNonInlinePart(WebFrameLoaderClient* client, const ResourceRequest& request) +{ + if (!request.url().isLocalFile()) + return; + if (!request.url().string().endsWith("MainPageJavaScript.js")) + return; + Frame* frame = core(client->webFrame()); + if (!frame) + return; + if (frame->tree()->parent()) + return; + Document* document = frame->document(); + if (!document) + return; + HTMLHeadElement* head = document->head(); + if (!head) + return; + for (Node* c = head->firstChild(); c; c = c->nextSibling()) { + if (c->hasTagName(scriptTag) && static_cast<Element*>(c)->getAttribute(srcAttr) == "MainPageJavaScript.js") { + document->setFrameElementsShouldIgnoreScrolling(true); + return; + } + } +} + +static inline void applyAppleDictionaryApplicationQuirk(WebFrameLoaderClient* client, const ResourceRequest& request) +{ + // Use a one-time-initialized global variable so we can quickly determine there's nothing to do in + // all applications other than Apple Dictionary. + static bool isAppleDictionary = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Dictionary"]; + if (isAppleDictionary) + applyAppleDictionaryApplicationQuirkNonInlinePart(client, request); +} + WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame) : m_webFrame(webFrame) , m_policyFunction(0) @@ -275,6 +322,8 @@ void WebFrameLoaderClient::setOriginalURLForDownload(WebDownload *download, cons bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length) { + applyAppleDictionaryApplicationQuirk(this, request); + WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (!implementations->didLoadResourceFromMemoryCacheFunc) @@ -306,6 +355,8 @@ void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identi void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) { + applyAppleDictionaryApplicationQuirk(this, request); + WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); @@ -316,6 +367,19 @@ void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsig request = (NSURLRequest *)CallResourceLoadDelegate(implementations->willSendRequestFunc, webView, @selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:), [webView _objectForIdentifier:identifier], request.nsURLRequest(), redirectResponse.nsURLResponse(), dataSource(loader)); } +bool WebFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader* loader, unsigned long identifier) +{ + WebView *webView = getWebView(m_webFrame.get()); + WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); + + if (implementations->shouldUseCredentialStorageFunc) { + if (id resource = [webView _objectForIdentifier:identifier]) + return CallResourceLoadDelegateReturningBoolean(NO, implementations->shouldUseCredentialStorageFunc, webView, @selector(webView:resource:shouldUseCredentialStorageForDataSource:), resource, dataSource(loader)); + } + + return true; +} + void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge& challenge) { WebView *webView = getWebView(m_webFrame.get()); @@ -553,6 +617,14 @@ void WebFrameLoaderClient::dispatchDidFirstLayout() CallFrameLoadDelegate(implementations->didFirstLayoutInFrameFunc, webView, @selector(webView:didFirstLayoutInFrame:), m_webFrame.get()); } +void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() +{ + WebView *webView = getWebView(m_webFrame.get()); + WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); + if (implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc) + CallFrameLoadDelegate(implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc, webView, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:), m_webFrame.get()); +} + Frame* WebFrameLoaderClient::dispatchCreatePage() { WebView *currentWebView = getWebView(m_webFrame.get()); @@ -711,13 +783,44 @@ void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader) [dataSource(loader) _finishedLoading]; } -void WebFrameLoaderClient::updateGlobalHistory(const KURL& url) +void WebFrameLoaderClient::updateGlobalHistory() +{ + DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader(); + + if (loader->urlForHistoryReflectsServerRedirect()) { + [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() + withTitle:loader->title() + method:loader->request().httpMethod() + wasFailure:loader->urlForHistoryReflectsFailure() + serverRedirectURL:loader->url() + isClientRedirect:NO]; + return; + } + + if (loader->urlForHistoryReflectsClientRedirect()) { + [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() + withTitle:loader->title() + method:loader->request().httpMethod() + wasFailure:loader->urlForHistoryReflectsFailure() + serverRedirectURL:nil + isClientRedirect:YES]; + return; + } + + [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() + withTitle:loader->title() + method:loader->request().httpMethod() + wasFailure:loader->urlForHistoryReflectsFailure() + serverRedirectURL:nil + isClientRedirect:NO]; +} + +void WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem() { - NSURL *cocoaURL = url; - const String& pageTitle = core(m_webFrame.get())->loader()->documentLoader()->title(); - [[WebHistory optionalSharedHistory] _addItemForURL:cocoaURL title:pageTitle]; + DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader(); + [[WebHistory optionalSharedHistory] _visitedURLForRedirectWithoutHistoryItem:loader->url()]; } - + bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const { WebView* view = getWebView(m_webFrame.get()); @@ -800,11 +903,13 @@ String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLSche void WebFrameLoaderClient::frameLoadCompleted() { // Note: Can be called multiple times. + + // See WebFrameLoaderClient::provisionalLoadStarted. + if ([getWebView(m_webFrame.get()) drawsBackground]) + [[m_webFrame->_private->webFrameView _scrollView] setDrawsBackground:YES]; + // Even if already complete, we might have set a previous item on a frame that // didn't do any data loading on the past transaction. Make sure to clear these out. - NSScrollView *sv = [m_webFrame->_private->webFrameView _scrollView]; - if ([getWebView(m_webFrame.get()) drawsBackground]) - [sv setDrawsBackground:YES]; core(m_webFrame.get())->loader()->setPreviousHistoryItem(0); } @@ -846,9 +951,15 @@ void WebFrameLoaderClient::restoreViewState() void WebFrameLoaderClient::provisionalLoadStarted() { - // FIXME: This is OK as long as no one resizes the window, - // but in the case where someone does, it means garbage outside - // the occupied part of the scroll view. + // Tell the scroll view not to draw a background so we can leave the contents of + // the old page showing during the beginning of the loading process. + + // This will stay set to NO until: + // 1) The load gets far enough along: WebFrameLoader::frameLoadCompleted. + // 2) The window is resized: -[WebFrameView setFrameSize:]. + // or 3) The view is moved out of the window: -[WebFrameView viewDidMoveToWindow]. + // Please keep the comments in these four functions in agreement with each other. + [[m_webFrame->_private->webFrameView _scrollView] setDrawsBackground:NO]; } @@ -906,19 +1017,19 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& URL) [[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:titleNSString]; } -void WebFrameLoaderClient::savePlatformDataToCachedPage(CachedPage* cachedPage) +void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame) { - WebCachedPagePlatformData* webPlatformData = new WebCachedPagePlatformData([m_webFrame->_private->webFrameView documentView]); - cachedPage->setCachedPagePlatformData(webPlatformData); + WebCachedFramePlatformData* webPlatformData = new WebCachedFramePlatformData([m_webFrame->_private->webFrameView documentView]); + cachedFrame->setCachedFramePlatformData(webPlatformData); } -void WebFrameLoaderClient::transitionToCommittedFromCachedPage(CachedPage* cachedPage) +void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame* cachedFrame) { - WebCachedPagePlatformData* platformData = reinterpret_cast<WebCachedPagePlatformData*>(cachedPage->cachedPagePlatformData()); + WebCachedFramePlatformData* platformData = reinterpret_cast<WebCachedFramePlatformData*>(cachedFrame->cachedFramePlatformData()); NSView <WebDocumentView> *cachedView = platformData->webDocumentView(); ASSERT(cachedView != nil); - ASSERT(cachedPage->documentLoader()); - [cachedView setDataSource:dataSource(cachedPage->documentLoader())]; + ASSERT(cachedFrame->documentLoader()); + [cachedView setDataSource:dataSource(cachedFrame->documentLoader())]; // clean up webkit plugin instances before WebHTMLView gets freed. WebView *webView = getWebView(m_webFrame.get()); @@ -1279,6 +1390,15 @@ public: #endif // ENABLE(NETSCAPE_PLUGIN_API) +static Class netscapePluginViewClass() +{ +#if USE(PLUGIN_HOST_PROCESS) + return [WebHostedNetscapePluginView class]; +#else + return [WebNetscapePluginView class]; +#endif +} + Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) { @@ -1341,7 +1461,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element #if ENABLE(NETSCAPE_PLUGIN_API) else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) { - WebBaseNetscapePluginView *embeddedView = [[[WebBaseNetscapePluginView alloc] + WebBaseNetscapePluginView *pluginView = [[[netscapePluginViewClass() alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height()) pluginPackage:(WebNetscapePluginPackage *)pluginPackage URL:URL @@ -1352,7 +1472,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element loadManually:loadManually DOMElement:kit(element)] autorelease]; - return new NetscapePluginWidget(embeddedView); + return new NetscapePluginWidget(pluginView); } #endif } else @@ -1390,8 +1510,8 @@ void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) NSView *pluginView = pluginWidget->platformWidget(); #if ENABLE(NETSCAPE_PLUGIN_API) - if ([pluginView isKindOfClass:[WebBaseNetscapePluginView class]]) - [representation _redirectDataToManualLoader:(WebBaseNetscapePluginView *)pluginView forPluginView:pluginView]; + if ([pluginView isKindOfClass:[WebNetscapePluginView class]]) + [representation _redirectDataToManualLoader:(WebNetscapePluginView *)pluginView forPluginView:pluginView]; else { #else { @@ -1434,7 +1554,7 @@ Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, Elemen } #if ENABLE(NETSCAPE_PLUGIN_API) else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) { - view = [[[WebBaseNetscapePluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height()) + view = [[[netscapePluginViewClass() alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height()) pluginPackage:(WebNetscapePluginPackage *)pluginPackage URL:nil baseURL:baseURL @@ -1525,12 +1645,13 @@ jobject WebFrameLoaderClient::javaApplet(NSView* view) @implementation WebFramePolicyListener -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - (id)initWithWebCoreFrame:(Frame*)frame { diff --git a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm index 43202b0..dc9ae6d 100644 --- a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm +++ b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm @@ -30,7 +30,6 @@ #import "WebIconDatabaseInternal.h" -#import <WebCore/FoundationExtras.h> #import <WebCore/PlatformString.h> diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm index 2da6654..274045f 100644 --- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm +++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm @@ -33,6 +33,7 @@ #import <WebCore/DOMDocumentFragment.h> #import <WebCore/PlatformString.h> #import <wtf/RetainPtr.h> +#import <wtf/StdLibExtras.h> using namespace WebCore; @@ -90,10 +91,12 @@ DOMDocumentFragment *WebPasteboardHelper::fragmentFromPasteboard(const NSPastebo } NSArray *WebPasteboardHelper::insertablePasteboardTypes() const -{ - static RetainPtr<NSArray> types = [[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, - NSFilenamesPboardType, NSTIFFPboardType, NSPICTPboardType, NSURLPboardType, - NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, nil]; - +{ + DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, ([[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) + NSPICTPboardType, +#endif + NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, nil])); + return types.get(); } diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.m b/WebKit/mac/WebCoreSupport/WebSystemInterface.m index 417f668..52f5583 100644 --- a/WebKit/mac/WebCoreSupport/WebSystemInterface.m +++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.m @@ -47,15 +47,8 @@ void InitWebCoreSystemInterface(void) INIT(DrawBezeledTextArea); INIT(DrawBezeledTextFieldCell); INIT(DrawFocusRing); - INIT(DrawMediaFullscreenButton); - INIT(DrawMediaMuteButton); - INIT(DrawMediaPauseButton); - INIT(DrawMediaPlayButton); - INIT(DrawMediaSeekBackButton); - INIT(DrawMediaSeekForwardButton); + INIT(DrawMediaUIPart); INIT(DrawMediaSliderTrack); - INIT(DrawMediaSliderThumb); - INIT(DrawMediaUnMuteButton); INIT(DrawTextFieldCellFocusRing); INIT(GetExtensionsForMIMEType); INIT(GetFontInLanguageForCharacter); @@ -65,6 +58,8 @@ void InitWebCoreSystemInterface(void) INIT(GetNSURLResponseLastModifiedDate); INIT(GetPreferredExtensionForMIMEType); INIT(GetWheelEventDeltas); + INIT(HitTestMediaUIPart); + INIT(MeasureMediaUIPart); INIT(PopupMenu); INIT(SetCGFontRenderingMode); INIT(SetDragImage); diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm index e9cd746..9ccdfff 100644 --- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm +++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm @@ -344,6 +344,11 @@ return UI_STRING("Writing Direction", "Writing direction context sub-menu item"); } +- (NSString *)contextMenuItemTagTextDirectionMenu +{ + return UI_STRING("Text Direction", "Text direction context sub-menu item"); +} + - (NSString *)contextMenuItemTagDefaultDirection { return UI_STRING("Default", "Default writing direction context menu item"); @@ -417,6 +422,18 @@ return WKCreateAXUIElementRef(element); } +- (CGRect)accessibilityConvertScreenRect:(CGRect)bounds +{ + NSArray *screens = [NSScreen screens]; + if ([screens count]) { + CGFloat screenHeight = NSHeight([[screens objectAtIndex:0] frame]); + bounds.origin.y = (screenHeight - (bounds.origin.y + bounds.size.height)); + } else + bounds = CGRectZero; + + return bounds; +} + - (void)unregisterUniqueIdForUIElement:(id)element { WKUnregisterUniqueIdForElement(element); diff --git a/WebKit/mac/WebKit.exp b/WebKit/mac/WebKit.exp index c284ffa..d166894 100644 --- a/WebKit/mac/WebKit.exp +++ b/WebKit/mac/WebKit.exp @@ -28,6 +28,7 @@ .objc_class_name_WebScriptCallFrame .objc_class_name_WebSecurityOrigin .objc_class_name_WebStringTruncator +.objc_class_name_WebTextIterator .objc_class_name_WebURLsWithTitles .objc_class_name_WebView _HIWebViewCreate diff --git a/WebKit/mac/WebKit.order b/WebKit/mac/WebKit.order index 6bb0178..b39330e 100644 --- a/WebKit/mac/WebKit.order +++ b/WebKit/mac/WebKit.order @@ -1,7 +1,8 @@ +[WebPreferences initialize] -_contains -_WebKitLinkedOnOrAfter -_WebKitLinkTimeVersion +__ZL23cacheModelForMainBundlev +__ZL8containsPKPKciS0_ +WebKitLinkedOnOrAfter +WebKitLinkTimeVersion +[WebPreferences standardPreferences] -[WebPreferences initWithIdentifier:] +[WebPreferences(WebInternal) _IBCreatorID] @@ -10,10 +11,12 @@ _WebKitLinkTimeVersion -[WebPreferences(WebPrivate) _postPreferencesChangesNotification] -[WebPreferences setAutosaves:] +[WebIconDatabase delayDatabaseCleanup] ++[NSString(WebKitExtras) _webkit_localCacheDirectoryWithBundleIdentifier:] -[NSString(WebKitExtras) _web_stringByAbbreviatingWithTildeInPath] +[WebIconDatabase sharedIconDatabase] -[WebIconDatabase init] -__Z13defaultClientv +-[WebIconDatabase(WebInternal) _startUpIconDatabase] +__ZL13defaultClientv -[WebIconDatabase(WebInternal) _databaseDirectory] -[WebPreferences privateBrowsingEnabled] -[WebPreferences _boolValueForKey:] @@ -29,49 +32,82 @@ __Z13defaultClientv +[WebHTMLView(WebPrivate) _selectionPasteboardTypes] +[WebHTMLView(WebPrivate) supportedNonImageMIMETypes] +[WebHTMLRepresentation supportedNonImageMIMETypes] -__Z11stringArrayRKN3WTF7HashSetIN7WebCore6StringENS1_10StringHashENS_10HashTraitsIS2_EEEE +__ZN21WebIconDatabaseClient13performImportEv +__Z21importToWebCoreFormatv ++[ThreadEnabler enableThreading] +__ZL20objectFromPathForKeyP8NSStringP11objc_object +-[ThreadEnabler threadEnablingSelector:] +__ZL11stringArrayRKN3WTF7HashSetIN7WebCore6StringENS1_10StringHashENS_10HashTraitsIS2_EEEE +[WebPDFView supportedMIMETypes] +[WebPDFRepresentation supportedMIMETypes] +[WebPDFRepresentation postScriptMIMETypes] +[WebDataSource(WebInternal) _repTypesAllowImageTypeOmission:] -+[WebView registerURLSchemeAsLocal:] +WebLocalizedString +-[NSURL(WebNSURLExtras) _web_originalDataAsString] +-[NSURL(WebNSURLExtras) _web_originalData] -[WebIconDatabase retainIconForURL:] --[WebIconDatabase(WebInternal) _isEnabled] -_WebLocalizedString --[WebView initWithFrame:frameName:groupName:] +-[WebIconDatabase(WebPendingPublic) isEnabled] ++[NSURL(WebNSURLExtras) _web_URLWithDataAsString:] ++[NSURL(WebNSURLExtras) _web_URLWithDataAsString:relativeToURL:] +-[NSString(WebKitExtras) _webkit_stringByTrimmingWhitespace] ++[NSURL(WebNSURLExtras) _web_URLWithData:relativeToURL:] +-[WebHistory init] ++[WebHistoryPrivate initialize] +-[WebHistoryPrivate init] +-[WebHistory setHistoryAgeInDaysLimit:] +-[WebHistoryPrivate setHistoryAgeInDaysLimit:] +-[WebHistory setHistoryItemLimit:] +-[WebHistoryPrivate setHistoryItemLimit:] +-[WebHistory loadFromURL:error:] +-[WebHistoryPrivate loadFromURL:collectDiscardedItemsInto:error:] +-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:] ++[WebHistory setOptionalSharedHistory:] +-[WebHistory(WebPrivate) _itemForURLString:] +-[WebHistoryPrivate itemForURLString:] ++[WebView registerURLSchemeAsLocal:] +-[NSURL(WebNSURLExtras) _webkit_canonicalize] +WKNSURLProtocolClassForRequest +-[NSString(WebKitExtras) _webkit_isCaseInsensitiveEqualToString:] +-[WebView(WebPrivate) _initWithFrame:frameName:groupName:usesDocumentViews:] +[WebViewPrivate initialize] +-[WebViewPrivate .cxx_construct] -[WebViewPrivate init] --[WebView _commonInitializationWithFrameName:groupName:] +-[WebView(WebPrivate) _commonInitializationWithFrameName:groupName:usesDocumentViews:] -[WebPreferences(WebPrivate) willAddToWebView] -[WebFrameView initWithFrame:] -_InitWebCoreSystemInterface +InitWebCoreSystemInterface +[WebViewFactory createSharedFactory] +[WebKeyGenerator createSharedGenerator] -_WKDisableCGDeferredUpdates --[WebFrameViewPrivate init] +WKDisableCGDeferredUpdates -[WebClipView initWithFrame:] -_WebKitInitializeLoggingChannelsIfNecessary -_initializeLogChannel +-[WebFrameView visibleRect] +-[WebFrameView webFrame] +WebKitInitializeLoggingChannelsIfNecessary +initializeLogChannel +[WebHistoryItem initialize] +[WebHistoryItem(WebInternal) initWindowWatcherIfNecessary] __Z36WebKitInitializeDatabasesIfNecessaryv __ZN24WebDatabaseTrackerClient30sharedWebDatabaseTrackerClientEv -__ZN24WebDatabaseTrackerClientC1Ev -__ZN15WebChromeClientC2EP7WebView -__ZN20WebContextMenuClientC2EP7WebView -__ZN15WebEditorClientC2EP7WebView -__ZN13WebDragClientC2EP7WebView -__ZN18WebInspectorClientC2EP7WebView -+[WebFrameBridge initialize] --[WebFrameBridge initMainFrameWithPage:frameName:frameView:] --[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:] +__ZN24WebDatabaseTrackerClientC2Ev +__ZL47WebKitInitializeApplicationCachePathIfNecessaryv +WKAppVersionCheckLessThan +__ZN15WebChromeClientC1EP7WebView +__ZN20WebContextMenuClientC1EP7WebView +__ZN15WebEditorClientC1EP7WebView +__ZN13WebDragClientC1EP7WebView +__ZN18WebInspectorClientC1EP7WebView +-[WebView preferences] +-[WebPreferences(WebPrivate) _localStorageDatabasePath] +-[WebPreferences _stringValueForKey:] ++[WebFrame(WebInternal) _createMainFrameWithPage:frameName:frameView:] ++[WebFrame(WebInternal) _createFrameWithPage:frameName:frameView:ownerElement:] __Z3kitPN7WebCore4PageE --[WebFrame(WebInternal) _initWithWebFrameView:webView:bridge:] +-[WebFrame(WebInternal) _initWithWebFrameView:webView:] -[WebFramePrivate setWebFrameView:] -[WebFrameView(WebInternal) _setWebFrame:] -__ZN20WebFrameLoaderClientC2EP8WebFrame +__ZN20WebFrameLoaderClientC1EP8WebFrame __ZN20WebFrameLoaderClient20createDocumentLoaderERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE -__ZN20WebDocumentLoaderMacC2ERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE +__ZN20WebDocumentLoaderMacC1ERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE -[WebDataSource(WebInternal) _initWithDocumentLoader:] +[WebDataSourcePrivate initialize] __Z10getWebViewP8WebFrame @@ -88,16 +124,16 @@ __ZN20WebFrameLoaderClient25setMainFrameDocumentReadyEb __ZN20WebFrameLoaderClient17setCopiesOnScrollEv __ZN20WebFrameLoaderClient31prepareForDataSourceReplacementEv -[WebFrame(WebInternal) _dataSource] --[WebFrame(WebInternal) _frameLoader] __ZN20WebFrameLoaderClient31transitionToCommittedForNewPageEv __ZNK20WebDocumentLoaderMac10dataSourceEv -[WebDataSource(WebPrivate) _responseMIMEType] -[WebDataSource response] --[WebDataSource(WebFileInternal) _MIMETypeOfResponse:] +[WebFrameView(WebInternal) _viewClassForMIMEType:] +[WebView(WebPrivate) _viewClass:andRepresentationClass:forMIMEType:] -[NSDictionary(WebNSDictionaryExtras) _webkit_objectForMIMEType:] +[WebHTMLView(WebPrivate) unsupportedTextMIMETypes] +-[WebView removePluginInstanceViewsFor:] +-[WebView(WebPrivate) _usesDocumentViews] -[WebFrameView(WebInternal) _makeDocumentViewForDataSource:] -[WebDataSource representation] -[WebHTMLView initWithFrame:] @@ -108,31 +144,26 @@ __ZNK20WebDocumentLoaderMac10dataSourceEv -[WebFrame webView] __Z4coreP7WebView -[WebView(WebPrivate) page] --[WebDynamicScrollBarsView setSuppressLayout:] +-[WebDynamicScrollBarsView(WebInternal) setSuppressLayout:] -[WebHTMLView viewWillMoveToSuperview:] -[WebHTMLView removeSuperviewObservers] -[WebHTMLView setNeedsDisplay:] -[WebHTMLView visibleRect] -[WebClipView hasAdditionalClip] +-[WebFrame(WebInternal) _getVisibleRect:] -[WebHTMLView viewDidMoveToSuperview] --[WebHTMLView(WebHTMLViewFileInternal) _updateTextSizeMultiplier] --[WebHTMLView(WebHTMLViewFileInternal) _bridge] --[WebHTMLView(WebHTMLViewFileInternal) _webView] -[WebHTMLView addSuperviewObservers] -[WebHTMLView isFlipped] --[WebDynamicScrollBarsView reflectScrolledClipView:] --[WebHTMLView respondsToSelector:] --[WebFrameView(WebInternal) _marginHeight] --[WebFrameView(WebInternal) _marginWidth] --[WebFrame(WebInternal) _updateBackground] +-[WebDynamicScrollBarsView(WebInternal) reflectScrolledClipView:] +-[WebFrame(WebInternal) _updateBackgroundAndUpdatesWhileOffscreen] -[WebView drawsBackground] -[WebView(WebPrivate) backgroundColor] --[WebFrameBridge webFrame] +__Z3kitPN7WebCore5FrameE -[WebFrame frameView] -[WebFrameView documentView] --[WebDynamicScrollBarsView horizontalScrollingMode] --[WebDynamicScrollBarsView setScrollingMode:] --[WebDynamicScrollBarsView setScrollingMode:andLock:] +-[WebView shouldUpdateWhileOffscreen] +-[WebFrameView(WebInternal) _install] +-[WebDynamicScrollBarsView(WebInternal) scrollingModes:vertical:] -[WebHTMLView setDataSource:] -[WebPluginController setDataSource:] -[WebHTMLView addMouseMovedObserver] @@ -141,12 +172,12 @@ __Z4coreP7WebView -[WebDataSource(WebInternal) _webView] -[WebDataSource webFrame] -[WebView mainFrame] -__Z3kitPN7WebCore5FrameE +-[WebHTMLView(WebHTMLViewFileInternal) _webView] -[WebView(WebPrivate) _dashboardBehavior:] __ZN15WebEditorClient23clearUndoRedoOperationsEv __ZN15WebChromeClient16setStatusbarTextERKN7WebCore6StringE __Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_object -__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_ +__ZL12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_ __ZN20WebFrameLoaderClient15finishedLoadingEPN7WebCore14DocumentLoaderE -[WebDataSource(WebInternal) _finishedLoading] __ZN20WebFrameLoaderClient18frameLoadCompletedEv @@ -156,26 +187,27 @@ __ZN20WebFrameLoaderClient21forceLayoutForNonHTMLEv +[WebFrameView(WebInternal) _canShowMIMETypeAsHTML:] __ZNK20WebFrameLoaderClient17overrideMediaTypeEv -[WebView mediaStyle] --[WebView textSizeMultiplier] +__ZNK15WebChromeClient19contentsSizeChangedEPN7WebCore5FrameERKNS0_7IntSizeE +-[WebView _realZoomMultiplierIsTextOnly] +-[WebView _realZoomMultiplier] +-[WebView _setZoomMultiplier:isTextOnly:] +-[WebView(WebPendingPublic) scheduleInRunLoop:forMode:] -[WebView(AllWebViews) _addToAllWebViewsSet] -[WebView setGroupName:] --[WebView _registerDraggedTypes] +-[WebView(WebPrivate) _registerDraggedTypes] +[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 +WKCopyFoundationCacheDirectory +WebMemorySize +initCapabilities +WebVolumeFreeSize -[WebView(WebPrivate) _preferencesChangedNotification:] -[WebPreferences(WebPrivate) _useSiteSpecificSpoofing] -[WebPreferences cursiveFontFamily] --[WebPreferences _stringValueForKey:] -[WebPreferences defaultFixedFontSize] -[WebPreferences defaultFontSize] -[WebPreferences defaultTextEncodingName] @@ -189,6 +221,8 @@ _WebVolumeFreeSize -[WebPreferences minimumFontSize] -[WebPreferences minimumLogicalFontSize] -[WebPreferences arePlugInsEnabled] +-[WebPreferences(WebPrivate) databasesEnabled] +-[WebPreferences(WebPrivate) localStorageEnabled] -[WebPreferences sansSerifFontFamily] -[WebPreferences serifFontFamily] -[WebPreferences standardFontFamily] @@ -198,26 +232,32 @@ _WebVolumeFreeSize -[WebPreferences(WebPrivate) shrinksStandaloneImagesToFit] -[WebPreferences(WebPrivate) editableLinkBehavior] __Z4core26WebKitEditableLinkBehavior +-[WebPreferences(WebPrivate) textDirectionSubmenuInclusionBehavior] +__Z4core40WebTextDirectionSubmenuInclusionBehavior -[WebPreferences(WebPrivate) isDOMPasteAllowed] -[WebView(WebPrivate) usesPageCache] -[WebPreferences usesPageCache] -[WebPreferences(WebPrivate) showsURLsInToolTips] -[WebPreferences(WebPrivate) developerExtrasEnabled] -[WebPreferences(WebPrivate) authorAndUserStylesEnabled] +-[WebPreferences(WebPrivate) applicationChromeModeEnabled] -[WebPreferences userStyleSheetEnabled] -[WebView(WebPrivate) _needsAdobeFrameReloadingQuirk] -_WKAppVersionCheckLessThan -[WebView(WebPrivate) _needsKeyboardEventDisambiguationQuirks] +-[WebPreferences(WebPrivate) webArchiveDebugModeEnabled] +-[WebPreferences(WebPrivate) offlineWebApplicationCacheEnabled] +-[WebPreferences(WebPrivate) zoomsTextOnly] -[WebView setMaintainsBackForwardList:] -[WebView setUIDelegate:] +-[WebView(WebPrivate) setMemoryCacheDelegateCallsEnabled:] -[WebView backForwardList] __Z3kitPN7WebCore15BackForwardListE -__Z16backForwardListsv +__ZL16backForwardListsv +__ZN3WTF7HashMapIPN7WebCore15BackForwardListEP18WebBackForwardListNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3setERKS3_RKS5_ +[WebBackForwardList initialize] -[WebBackForwardList(WebBackForwardListInternal) initWithBackForwardList:] __Z4coreP18WebBackForwardList -__ZNK3WTF7HashMapIPN7WebCore15BackForwardListEP18WebBackForwardListNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3getERKS3_ -__ZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E47removeAndInvalidateWithoutEntryConsistencyCheckEPS2_ +__ZN3WTF9HashTableIPN7WebCore15BackForwardListESt4pairIS3_P18WebBackForwardListENS_18PairFirstExtractorIS7_EENS_7PtrHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSD_IS6_EEEESE_E6expandEv -[WebBackForwardList setCapacity:] -[WebView setFrameLoadDelegate:] -[WebView(WebPrivate) _cacheFrameLoadDelegateImplementations] @@ -230,30 +270,22 @@ __ZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14 -[WebView setApplicationNameForUserAgent:] -[WebView setHostWindow:] -[WebView(WebPrivate) _setFormDelegate:] -+[WebStringTruncator initialize] -+[WebStringTruncator centerTruncateString:toWidth:withFont:] -__Z14fontFromNSFontP6NSFont -_WKGetCGFontFromNSFont -_WKGetNSFontATSUFontId -_WKGetATSStyleGroup -_WKGetFontMetrics -_WKInitializeGlyphVector -_WKConvertCharToGlyphs -_WKGetGlyphVectorNumGlyphs -_WKGetGlyphVectorFirstRecord -_WKGetGlyphVectorRecordSize -_WKClearGlyphVector -_WKGetGlyphTransformedAdvances +-[WebView setShouldUpdateWhileOffscreen:] -[WebIconDatabase defaultIconWithSize:] +-[WebView viewWillMoveToSuperview:] +-[WebView removeSizeObservers] +-[WebView viewDidMoveToSuperview] +-[WebView addSizeObservers] -[WebFrameView setFrameSize:] --[WebFrameView webFrame] +-[WebView(WebPrivate) isFlipped] -[WebFrame provisionalDataSource] -[WebFrame dataSource] -[WebView viewWillMoveToWindow:] -_WKSetNSWindowShouldPostEventNotifications +WKSetNSWindowShouldPostEventNotifications +-[WebView removeWindowObservers] -[WebHTMLView viewWillMoveToWindow:] -[WebHTMLView removeMouseMovedObserverUnconditionally] -_WKMouseMovedNotification +WKMouseMovedNotification -[WebHTMLView removeWindowObservers] -[WebHTMLView(WebHTMLViewFileInternal) _cancelUpdateMouseoverTimer] -[WebHTMLView(WebHTMLViewFileInternal) _cancelUpdateFocusedAndActiveStateTimer] @@ -262,59 +294,57 @@ _WKMouseMovedNotification -[WebHTMLView viewDidMoveToWindow] -[WebHTMLView(WebPrivate) _stopAutoscrollTimer] -[WebHTMLView addWindowObservers] +WKWindowWillOrderOnScreenNotification -[WebHTMLView(WebPrivate) _frameOrBoundsChanged] -[WebHTMLView setNeedsLayout:] -[WebPluginController startAllPlugins] +-[WebFrameView viewDidMoveToWindow] +-[WebView viewDidMoveToWindow] +-[WebView addWindowObservers] +-[NSString(WebKitExtras) _web_widthWithFont:] +canUseFastRenderer +WKGetGlyphsForCharacters +WKGetGlyphTransformedAdvances -[WebIconDatabase iconForURL:withSize:] -[WebIconDatabase iconForURL:withSize:cache:] -[NSString(WebNSURLExtras) _webkit_isFileURL] --[WebIconDatabase defaultIconForURL:withSize:] +__Z13webGetNSImagePN7WebCore5ImageE7_NSSize ++[WebStringTruncator initialize] ++[WebStringTruncator centerTruncateString:toWidth:withFont:] +__ZL14fontFromNSFontP6NSFont -[WebView setNextKeyView:] -[WebFrameView setNextKeyView:] --[NSString(WebKitExtras) _webkit_hasCaseInsensitivePrefix:] -+[NSURL(WebNSURLExtras) _web_URLWithUserTypedString:] -+[NSURL(WebNSURLExtras) _web_URLWithUserTypedString:relativeToURL:] --[NSString(WebKitExtras) _webkit_stringByTrimmingWhitespace] -__Z12mapHostNamesP8NSStringa -+[NSURL(WebNSURLExtras) _web_URLWithData:relativeToURL:] --[NSURL(WebNSURLExtras) _webkit_canonicalize] -_WKNSURLProtocolClassForRequest --[NSURL(WebNSURLExtras) _web_originalDataAsString] -+[NSURL(WebNSURLExtras) _web_URLWithDataAsString:] -+[NSURL(WebNSURLExtras) _web_URLWithDataAsString:relativeToURL:] -[NSView(WebExtras) _web_superviewOfClass:] -[WebFrame loadRequest:] __ZN20WebFrameLoaderClient9userAgentERKN7WebCore4KURLE -[WebView(WebViewInternal) _userAgentForURL:] --[WebView(WebViewInternal) _userAgentWithApplicationName:andWebKitVersion:] ++[WebView(WebPrivate) _standardUserAgentWithApplicationName:] +[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_preferredLanguageCode] +[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_ensureAndLockPreferredLanguageLock] -_makeLock +makeLock -[NSString(WebNSUserDefaultsPrivate) _webkit_HTTPStyleLanguageCode] -_WKCopyCFLocalizationPreferredName +WKCopyCFLocalizationPreferredName +[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_addDefaultsChangeObserver] -_addDefaultsChangeObserver +addDefaultsChangeObserver __ZN20WebFrameLoaderClient17cancelPolicyCheckEv -__ZN20WebFrameLoaderClient39dispatchDecidePolicyForNavigationActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestE +__ZN20WebFrameLoaderClient39dispatchDecidePolicyForNavigationActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestEN3WTF10PassRefPtrINS0_9FormStateEEE -[WebView(WebPrivate) _policyDelegateForwarder] +[WebDefaultPolicyDelegate sharedPolicyDelegate] -[_WebSafeForwarder initWithTarget:defaultTarget:catchExceptions:] __ZN20WebFrameLoaderClient19setUpPolicyListenerEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEE +[WebFramePolicyListener initialize] -[WebFramePolicyListener initWithWebCoreFrame:] -_WKSupportsMultipartXMixedReplace -__ZNK20WebFrameLoaderClient16actionDictionaryERKN7WebCore16NavigationActionE +__ZNK20WebFrameLoaderClient16actionDictionaryERKN7WebCore16NavigationActionEN3WTF10PassRefPtrINS0_9FormStateEEE -[_WebSafeForwarder methodSignatureForSelector:] -[_WebSafeForwarder forwardInvocation:] +[WebView(WebPrivate) _canHandleRequest:] ++[WebView(WebPrivate) _canHandleRequest:forMainFrame:] -[WebFramePolicyListener use] -[WebFramePolicyListener receivedPolicyDecision:] __ZN20WebFrameLoaderClient21receivedPolicyDecisonEN7WebCore12PolicyActionE __ZNK20WebFrameLoaderClient16canHandleRequestERKN7WebCore15ResourceRequestE __ZN15WebChromeClient30canRunBeforeUnloadConfirmPanelEv -[WebView UIDelegate] -__ZN20WebFrameLoaderClient22clearArchivedResourcesEv -__ZN3WTF9HashTableIiSt4pairIiNS_9RetainPtrI11WebResourceEEENS_18PairFirstExtractorIS5_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEENSB_IS4_EEEESC_E47removeAndInvalidateWithoutEntryConsistencyCheckEPS5_ __ZN20WebFrameLoaderClient27willChangeEstimatedProgressEv -[WebView(WebPrivate) _willChangeValueForKey:] -[WebView(WebPrivate) observationInfo] @@ -326,7 +356,7 @@ __ZN20WebFrameLoaderClient31dispatchDidStartProvisionalLoadEv -[WebView(WebPrivate) _willChangeBackForwardKeys] __Z42WebViewGetFrameLoadDelegateImplementationsP7WebView __Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_ -__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_ +__ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_ -[WebDataSource isLoading] -[WebDataSource request] -[NSURL(WebNSURLExtras) _web_hostString] @@ -337,84 +367,145 @@ __Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_ -[NSString(WebNSURLExtras) _web_decodeHostName] -[NSString(WebNSURLExtras) _web_mapHostNameWithRange:encode:makeString:] -[WebDataSource unreachableURL] --[NSString(WebKitExtras) _webkit_isCaseInsensitiveEqualToString:] +-[WebView mainFrameURL] +-[WebBackForwardList currentItem] +__Z3kitPN7WebCore11HistoryItemE __ZN20WebFrameLoaderClient32assignIdentifierToInitialRequestEmPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestE __Z45WebViewGetResourceLoadDelegateImplementationsP7WebView +__ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_ -[WebView(WebViewInternal) _addObject:forIdentifier:] -__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_ +__ZNK3WTF7HashMapImNS_9RetainPtrIP11objc_objectEENS_7IntHashImEENS_10HashTraitsImEENS7_IS4_EEE3getERKm __ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE __ZN20WebDocumentLoaderMac17increaseLoadCountEm __ZNK3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E8containsImNS_22IdentityHashTranslatorImmS4_EEEEbRKT_ __ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE3addERKm -__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E3addImmNS_17HashSetTranslatorILb1EmS6_S6_S4_EEEESt4pairINS_17HashTableIteratorImmS2_S4_S6_S6_EEbERKT_RKT0_ -__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E6expandEv +__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E47removeAndInvalidateWithoutEntryConsistencyCheckEPm -[WebView(WebViewInternal) _objectForIdentifier:] -__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_ +__Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_ +__ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_S0_S0_ +__ZN3WTF9HashTableIN7WebCore12AtomicStringESt4pairIS2_NS1_6StringEENS_18PairFirstExtractorIS5_EENS1_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS2_EENSA_IS4_EEEESB_EaSERKSE_ +__ZN3WTF6VectorIN7WebCore6StringELm0EEaSERKS3_ +__ZN3WTF6VectorIN7WebCore6StringELm0EE6shrinkEm __ZNK20WebFrameLoaderClient32representationExistsForURLSchemeERKN7WebCore6StringE +[WebView(WebPrivate) _representationExistsForURLScheme:] -_WKCreateNSURLConnectionDelegateProxy +WKCreateNSURLConnectionDelegateProxy -[WebFramePolicyListener dealloc] +-[WebView(WebIBActions) canGoBack] +-[WebView(WebIBActions) canGoForward] -[WebFrameView isOpaque] +-[WebHTMLView windowWillOrderOnScreen:] +-[WebView(WebPrivate) viewWillDraw] -[WebFrameView drawRect:] -[WebHTMLView(WebPrivate) _recursiveDisplayAllDirtyWithLockFocus:visRect:] -[WebHTMLView(WebPrivate) _setAsideSubviews] -[WebHTMLView(WebPrivate) _restoreSubviews] --[WebFrame(WebInternal) _viewWillMoveToHostWindow:] -[WebHTMLView viewWillMoveToHostWindow:] -[NSArray(WebHTMLView) _web_makePluginViewsPerformSelector:withObject:] --[WebFrame(WebInternal) _viewDidMoveToHostWindow] -[WebHTMLView viewDidMoveToHostWindow] +-[WebDynamicScrollBarsView(WebInternal) updateScrollers] ++[WebView(WebFileInternal) _cacheModel] +-[WebBackForwardList dealloc] +__ZN3WTF9HashTableIPN7WebCore15BackForwardListESt4pairIS3_P18WebBackForwardListENS_18PairFirstExtractorIS7_EENS_7PtrHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSD_IS6_EEEESE_E4findIS3_NS_22IdentityHashTranslatorIS3_S7_SB_EEEENS_17HashTableIteratorIS3_S7_S9_SB_SG_SE_EERKT_ -[WebPreferences(WebPrivate) setRespectStandardStyleKeyEquivalents:] -[WebPreferences _setBoolValue:forKey:] +-[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setBool:forKey:] ++[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_defaultsDidChange] -[WebPreferences setPrivateBrowsingEnabled:] -[WebPreferences(WebPrivate) setDOMPasteAllowed:] -+[WebPreferences(WebPrivate) _setInitialDefaultTextEncodingToSystemEncoding] -+[WebPreferences(WebPrivate) _systemCFStringEncoding] -_WKGetWebDefaultCFStringEncoding -+[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_defaultsDidChange] --[WebHistory init] -+[WebHistoryPrivate initialize] --[WebHistoryPrivate init] --[WebHistory setHistoryAgeInDaysLimit:] --[WebHistoryPrivate setHistoryAgeInDaysLimit:] --[WebHistory setHistoryItemLimit:] --[WebHistoryPrivate setHistoryItemLimit:] --[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] -__ZN3WTF9HashTableIiSt4pairIiiENS_18PairFirstExtractorIS2_EENS_7IntHashIiEENS_14PairHashTraitsINS_10HashTraitsIiEES9_EES9_E4findIiNS_22IdentityHashTranslatorIiS2_S6_EEEENS_17HashTableIteratorIiS2_S4_S6_SA_S9_EERKT_ -__ZN20WebFrameLoaderClient31dispatchDecidePolicyForMIMETypeEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_6StringERKNS0_15ResourceRequestE -+[WebView canShowMIMEType:] +-[WebPreferences setCacheModel:] +-[WebPreferences _setIntegerValue:forKey:] +-[WebPreferences(WebPrivate) setAutomaticallyDetectsCacheModel:] ++[WebHistoryItem(WebPrivate) _releaseAllPendingPageCaches] +-[WebView initWithFrame:] +-[WebView initWithFrame:frameName:groupName:] +__ZL32needsWebViewInitThreadWorkaroundv +-[WebView stringByEvaluatingJavaScriptFromString:] +-[WebFrame(WebInternal) _stringByEvaluatingJavaScriptFromString:] +-[WebFrame(WebInternal) _stringByEvaluatingJavaScriptFromString:forceUserGesture:] +__ZN20WebFrameLoaderClient19windowObjectClearedEv +-[WebView(WebPendingPublic) scriptDebugDelegate] +-[WebView dealloc] +-[WebView close] +-[WebView(WebPrivate) _close] +-[WebPreferences(WebPrivate) fullDocumentTeardownEnabled] +__ZN20WebFrameLoaderClient19detachedFromParent2Ev +-[WebHTMLView(WebPrivate) close] +-[WebHTMLView(WebPrivate) _clearLastHitViewIfSelf] +-[WebPluginController destroyAllPlugins] +-[WebPluginController _cancelOutstandingChecks] +-[WebHTMLViewPrivate clear] +-[WebPluginController dealloc] +__ZN20WebDocumentLoaderMac15detachFromFrameEv +__ZN20WebDocumentLoaderMac17releaseDataSourceEv +-[WebDataSource dealloc] +-[WebDataSourcePrivate dealloc] +__ZN20WebDocumentLoaderMac16detachDataSourceEv +__ZN20WebFrameLoaderClient19detachedFromParent3Ev +-[WebDynamicScrollBarsView(WebInternal) setScrollBarsSuppressed:repaintOnUnsuppress:] +-[WebView(AllWebViews) _removeFromAllWebViewsSet] +-[WebView(WebPendingPublic) setScriptDebugDelegate:] +-[WebView(WebPrivate) _detachScriptDebuggerFromAllFrames] +-[WebFrame(WebInternal) _detachScriptDebugger] +-[WebView removeDragCaret] +__ZN15WebEditorClient13pageDestroyedEv +__ZN15WebEditorClientD1Ev +__ZN18WebInspectorClient18inspectorDestroyedEv +__ZN20WebContextMenuClient20contextMenuDestroyedEv +__ZN13WebDragClient23dragControllerDestroyedEv +__ZN13WebDragClientD1Ev +__ZN15WebChromeClient15chromeDestroyedEv +-[WebView preferencesIdentifier] +-[WebPreferences identifier] ++[WebPreferences(WebPrivate) _removeReferenceForIdentifier:] +-[WebPreferences(WebPrivate) didRemoveFromWebView] +-[WebView(WebPrivate) _closePluginDatabases] +-[WebViewPrivate dealloc] +-[WebViewPrivate .cxx_destruct] +-[WebFrameView dealloc] +-[WebFrameViewPrivate dealloc] +-[WebHTMLView dealloc] +-[WebHTMLViewPrivate dealloc] +__ZN20WebFrameLoaderClient14shouldFallBackERKN7WebCore13ResourceErrorE +__ZN20WebFrameLoaderClient20setMainDocumentErrorEPN7WebCore14DocumentLoaderERKNS0_13ResourceErrorE +-[WebDataSource(WebInternal) _setMainDocumentError:] +__ZN20WebFrameLoaderClient27dispatchDidLoadMainResourceEPN7WebCore14DocumentLoaderE +__ZN20WebFrameLoaderClient30dispatchDidFailProvisionalLoadERKN7WebCore13ResourceErrorE +-[WebView(WebPrivate) _didFailProvisionalLoadWithError:forFrame:] +-[WebView(WebPrivate) _didChangeBackForwardKeys] +__Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_ +-[NSURL(WebNSURLExtras) _web_userVisibleString] +__ZL10isHexDigitc +__ZL13hexDigitValuec +__ZL12mapHostNamesP8NSStringa +__ZN3WTF6VectorItLm2048EE6shrinkEm +-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:] +-[WebFrame _loadHTMLString:baseURL:unreachableURL:] +-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:] +__ZN20WebFrameLoaderClient22dispatchDidFailLoadingEPN7WebCore14DocumentLoaderEmRKNS0_13ResourceErrorE +__ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_S0_ +-[WebView(WebViewInternal) _removeObjectForIdentifier:] +__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E4findImNS_22IdentityHashTranslatorImS6_SA_EEEENS_17HashTableIteratorImS6_S8_SA_SF_SD_EERKT_ +__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E6expandEv +__ZN20WebDocumentLoaderMac17decreaseLoadCountEm +__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E4findImNS_22IdentityHashTranslatorImmS4_EEEENS_17HashTableIteratorImmS2_S4_S6_S6_EERKT_ +__ZN20WebDocumentLoaderMacD1Ev +-[WebView estimatedProgress] +-[WebIconDatabase(WebInternal) _iconForFileURL:withSize:] +-[WebIconDatabase(WebInternal) _scaleIcon:toSize:] +__ZL29_updateMouseoverTimerCallbackP16__CFRunLoopTimerPv +-[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent] +-[WebHTMLView(WebPrivate) _updateMouseoverWithEvent:] +-[WebHTMLView(WebPrivate) hitTest:] +__ZL41_updateFocusedAndActiveStateTimerCallbackP16__CFRunLoopTimerPv +-[WebHTMLView(WebPrivate) _updateFocusedAndActiveState] +-[WebHTMLView(WebInternal) _frame] +-[WebView _updateFocusedAndActiveStateForFrame:] +__ZN20WebFrameLoaderClient20frameLoaderDestroyedEv +-[WebFrame(WebInternal) _clearCoreFrame] +-[WebFrame dealloc] +-[WebFramePrivate dealloc] __ZNK20WebFrameLoaderClient15canShowMIMETypeERKN7WebCore6StringE ++[WebView canShowMIMEType:] __ZN20WebFrameLoaderClient26dispatchDidReceiveResponseEPN7WebCore14DocumentLoaderEmRKNS0_16ResourceResponseE __ZN20WebFrameLoaderClient17dispatchWillCloseEv __ZN20WebFrameLoaderClient18makeRepresentationEPN7WebCore14DocumentLoaderE @@ -423,266 +514,301 @@ __ZN20WebFrameLoaderClient18makeRepresentationEPN7WebCore14DocumentLoaderE -[WebHTMLRepresentation init] -[WebDataSource(WebFileInternal) _setRepresentation:] -[WebHTMLRepresentation setDataSource:] --[WebFrame(WebInternal) _bridge] -__ZN20WebDocumentLoaderMac15detachFromFrameEv -__ZN20WebDocumentLoaderMac17releaseDataSourceEv -__ZN20WebFrameLoaderClient34updateGlobalHistoryForStandardLoadERKN7WebCore4KURLE +__Z26WKNotifyHistoryItemChangedv +__ZN20WebFrameLoaderClient19updateGlobalHistoryEv +[WebHistory optionalSharedHistory] --[WebHistory addItemForURL:] --[WebHistoryItem(WebPrivate) initWithURL:title:] +-[WebHistory(WebInternal) _visitedURL:withTitle:method:wasFailure:] +-[WebHistoryPrivate visitedURL:withTitle:] -[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:] --[WebHistoryItem(WebPrivate) _setLastVisitedTimeInterval:] --[WebHistory addItem:] --[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] +-[WebHistoryItem(WebInternal) initWithWebCoreHistoryItem:] +__ZL19historyItemWrappersv +__ZN3WTF9HashTableIPN7WebCore11HistoryItemESt4pairIS3_P14WebHistoryItemENS_18PairFirstExtractorIS7_EENS_7PtrHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSD_IS6_EEEESE_E6expandEv +-[WebHistoryItem(WebInternal) _setVisitCount:] +-[WebHistoryPrivate addItemToDateCaches:] +-[WebHistoryItem lastVisitedTimeInterval] +-[WebHistoryPrivate findKey:forDay:] +__ZNK3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E8containsIxNS_22IdentityHashTranslatorIxS5_S9_EEEEbRKT_ +__Z4coreP14WebHistoryItem -[WebHistory _sendNotification:entries:] -__Z26WKNotifyHistoryItemChangedv --[WebDynamicScrollBarsView setScrollBarsSuppressed:repaintOnUnsuppress:] --[WebDataSource dealloc] --[WebDataSourcePrivate dealloc] -__ZN20WebDocumentLoaderMac16detachDataSourceEv +-[WebHistoryItem URLString] +-[NSString(WebKitExtras) _webkit_hasCaseInsensitivePrefix:] __ZNK20WebFrameLoaderClient11hasHTMLViewEv __ZN20WebFrameLoaderClient13committedLoadEPN7WebCore14DocumentLoaderEPKci -[WebDataSource(WebInternal) _receivedData:] -[WebHTMLRepresentation receivedData:withDataSource:] --[WebHTMLRepresentation _isDisplayingWebArchive] +-[WebFrame(WebInternal) _receivedData:textEncodingName:] +__ZNK7WebCore17FrameLoaderClient23shouldUsePluginDocumentERKNS_6StringE __ZN20WebFrameLoaderClient21dispatchDidCommitLoadEv -[WebView(WebPrivate) _didCommitLoadForFrame:] -[WebDataSource pageTitle] -[WebHTMLRepresentation title] -[WebDataSource(WebInternal) _documentLoader] --[WebBackForwardList currentItem] -__Z3kitPN7WebCore11HistoryItemE --[WebHistoryItem(WebPrivate) _transientPropertyForKey:] +__ZN3WTF7HashMapIPN7WebCore11HistoryItemEP14WebHistoryItemNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3setERKS3_RKS5_ -[WebFrameView becomeFirstResponder] -[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 --[WebHistory itemForURL:] +-[WebFrame(WebInternal) _addData:] -[WebHistoryPrivate itemForURL:] --[WebHistoryPrivate itemForURLString:] -[WebHistoryItem(WebInternal) setTitle:] __ZN20WebFrameLoaderClient23dispatchDidReceiveTitleERKN7WebCore6StringE -__Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_ -__ZN20WebFrameLoaderClient22dispatchDidFailLoadingEPN7WebCore14DocumentLoaderEmRKNS0_13ResourceErrorE +-[WebHTMLView dataSourceUpdated:] +__ZN20WebFrameLoaderClient39postProgressEstimateChangedNotificationEv +__ZN20WebFrameLoaderClient31dispatchDidReceiveContentLengthEPN7WebCore14DocumentLoaderEmi +__Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_iS0_ +__ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_iS0_ +-[WebHTMLRepresentation finishedLoadingWithDataSource:] +-[WebHTMLRepresentation _isDisplayingWebArchive] +-[WebView(WebViewEditing) isEditable] +__ZN20WebFrameLoaderClient29dispatchDidFinishDocumentLoadEv +__ZN20WebFrameLoaderClient24dispatchDidFinishLoadingEPN7WebCore14DocumentLoaderEm +-[WebHistoryPrivate insertItem:forDateKey:] +__ZN3WTF7HashMapIxNS_9RetainPtrI14NSMutableArrayEENS_7IntHashIyEENS_10HashTraitsIxEENS6_IS3_EEE3setERKxRKS3_ __ZN20WebFrameLoaderClient29dispatchDidHandleOnloadEventsEv --[WebDynamicScrollBarsView verticalScrollingMode] --[WebDynamicScrollBarsView setVerticalScrollingMode:] --[WebDynamicScrollBarsView setVerticalScrollingMode:andLock:] --[WebDynamicScrollBarsView updateScrollers] --[WebDynamicScrollBarsView setHorizontalScrollingMode:] --[WebDynamicScrollBarsView setHorizontalScrollingMode:andLock:] +-[WebDynamicScrollBarsView(WebInternal) setScrollingModes:vertical:andLock:] __ZN15WebEditorClient10isEditableEv +-[WebView(WebPendingPublic) isHoverFeedbackSuspended] +__ZN15WebChromeClient23mouseDidMoveOverElementERKN7WebCore13HitTestResultEj ++[WebElementDictionary initialize] +-[WebElementDictionary initWithHitTestResult:] ++[WebElementDictionary initializeLookupTable] +__ZL12addLookupKeyP8NSStringP13objc_selector +-[WebView(WebPrivate) _mouseDidMoveOverElement:modifierFlags:] +__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectj +__ZL12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_j +-[WebElementDictionary objectForKey:] +-[WebElementDictionary _absoluteLinkURL] +-[WebElementDictionary dealloc] +__ZN15WebChromeClient10setToolTipERKN7WebCore6StringE +-[WebHTMLView(WebPrivate) _setToolTip:] +-[WebView(WebPrivate) _globalHistoryItem] +-[WebHistoryItem originalURLString] +-[WebHistory orderedLastVisitedDays] +-[WebHistoryPrivate orderedLastVisitedDays] +__ZN3WTF6VectorIiLm0EE15reserveCapacityEm +__ZSt16__introsort_loopIPiiEvT_S1_T0_ +__ZSt22__final_insertion_sortIPiEvT_S1_ +__ZSt16__insertion_sortIPiEvT_S1_ +__ZN3WTF6VectorIiLm0EE6shrinkEm +-[WebHistory orderedItemsLastVisitedOnDay:] +-[WebHistoryPrivate orderedItemsLastVisitedOnDay:] +-[WebHistoryItem title] +-[WebHTMLView shouldDelayWindowOrderingForEvent:] +-[WebHTMLView(WebHTMLViewFileInternal) _hitViewForEvent:] +-[WebHTMLView _isSelectionEvent:] +-[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:allowShadowContent:] +-[WebElementDictionary _isSelected] +-[WebHTMLView needsPanelToBecomeKey] +-[WebHTMLView _windowChangedKeyState] +-[WebHTMLView windowDidBecomeKey:] +-[WebHTMLView acceptsFirstMouse:] +-[WebHTMLView(WebHTMLViewFileInternal) _setMouseDownEvent:] +__ZL9setCursorP8NSWindowP13objc_selector8_NSPoint +-[NSWindow(BorderViewAccess) _web_borderView] +-[WebElementDictionary _domNode] +__Z3kitPN7WebCore4NodeE +-[WebHTMLView mouseMovedNotification:] +-[WebBackForwardList forwardListCount] +-[WebBackForwardList backListCount] +-[WebBackForwardList itemAtIndex:] +-[WebView(WebPendingPublic) shouldClose] +-[WebWindowWatcher windowWillClose:] +-[WebView _windowWillClose:] +-[WebView shouldCloseWithWindow] +-[WebHTMLView windowWillClose:] +-[WebHTMLView windowDidResignKey:] +-[WebHTMLView removeMouseMovedObserver] +-[WebView(WebPrivate) _isClosed] +-[WebView(WebPrivate) _clearUndoRedoOperations] +__ZN20WebFrameLoaderClient19saveViewStateToItemEPN7WebCore11HistoryItemE +-[WebHTMLRepresentation dealloc] +-[WebHistoryItem dealloc] +__ZN3WTF9HashTableIPN7WebCore11HistoryItemESt4pairIS3_P14WebHistoryItemENS_18PairFirstExtractorIS7_EENS_7PtrHashIS3_EENS_14PairHashTraitsINS_10HashTraitsIS3_EENSD_IS6_EEEESE_E4findIS3_NS_22IdentityHashTranslatorIS3_S7_SB_EEEENS_17HashTableIteratorIS3_S7_S9_SB_SG_SE_EERKT_ +-[WebHistory saveToURL:error:] +-[WebHistoryPrivate saveToURL:error:] +-[WebHistoryPrivate saveHistoryGuts:URL:error:] +-[WebHistoryPrivate arrayRepresentation] +-[WebHistoryItem(WebPrivate) dictionaryRepresentation] ++[WebView(WebFileInternal) _preferencesRemovedNotification:] ++[WebView(WebFileInternal) _maxCacheModelInAnyInstance] +-[WebHistoryPrivate historyItemLimit] +-[WebHistoryPrivate ageLimitDate] +-[WebHistoryPrivate historyAgeInDaysLimit] +-[WebHistoryItem(WebInternal) initFromDictionaryRepresentation:] +-[NSDictionary(WebNSDictionaryExtras) _webkit_stringForKey:] +-[WebHistoryItem(WebInternal) initWithURLString:title:displayTitle:lastVisitedTimeInterval:] +-[NSDictionary(WebNSDictionaryExtras) _webkit_intForKey:] +-[NSDictionary(WebNSDictionaryExtras) _webkit_numberForKey:] +-[NSDictionary(WebNSDictionaryExtras) _webkit_boolForKey:] +-[WebHistoryPrivate addItem:] +-[WebHistory itemForURL:] +-[WebHistory(WebPrivate) allItems] +-[WebHistoryPrivate allItems] +-[WebHistoryItem(WebPrivate) visitCount] ++[NSURL(WebNSURLExtras) _web_URLWithUserTypedString:] ++[NSURL(WebNSURLExtras) _web_URLWithUserTypedString:relativeToURL:] +-[WebHistoryItem(WebInternal) _visitedWithTitle:] +-[WebHistoryPrivate removeItemFromDateCaches:] +__ZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsINS_10HashTraitsIxEENSB_IS4_EEEESC_E4findIxNS_22IdentityHashTranslatorIxS5_S9_EEEENS_17HashTableIteratorIxS5_S7_S9_SE_SC_EERKT_ -[WebHTMLView layout] -[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:] -[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] +-[WebFrame(WebInternal) _needsLayout] -[NSView(WebHTMLViewFileInternal) _web_addDescendantWebHTMLViewsToArray:] -[WebHTMLView isOpaque] -[WebHTMLView drawRect:] +-[WebView(WebPrivate) _mustDrawUnionedRect:singleRects:count:] -[WebHTMLView drawSingleRect:] -[WebClipView setAdditionalClip:] -[WebHTMLView(WebPrivate) _transparentBackground] --[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] +-[WebFrame(WebInternal) _drawRect:contentsOnly:] +-[WebView(WebPrivate) _UIDelegateForwarder] ++[WebDefaultUIDelegate sharedUIDelegate] +-[WebView currentNodeHighlight] +-[WebClipView resetAdditionalClip] +-[WebHTMLView(WebPrivate) _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] +__ZN15WebChromeClient20populateVisitedLinksEv +-[WebHistory(WebInternal) _addVisitedLinksToPageGroup:] +-[WebHistoryPrivate addVisitedLinksToPageGroup:] +__ZN3WTF6VectorItLm512EE6shrinkEm +WKSetUpFontCache +__ZN20WebFrameLoaderClient38dispatchDidFirstVisuallyNonEmptyLayoutEv +WKCGContextGetShouldSmoothFonts +WKSetCGFontRenderingMode +__ZNK20WebFrameLoaderClient29generatedMIMETypeForURLSchemeERKN7WebCore6StringE +__ZN20WebFrameLoaderClient31dispatchDecidePolicyForMIMETypeEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_6StringERKNS0_15ResourceRequestE +-[WebHistoryItem(WebPrivate) _lastVisitWasHTTPNonGet] +-[WebHistoryItem(WebPrivate) lastVisitWasFailure] +-[WebHistory removeItems:] +-[WebHistoryPrivate removeItems:] +-[WebHistoryPrivate removeItem:] +-[WebHistoryPrivate removeItemForURLString:] ++[WebView(WebPrivate) _shouldUseFontSmoothing] ++[WebView(WebPrivate) _setShouldUseFontSmoothing:] ++[WebIconDatabase(WebPrivate) _checkIntegrityBeforeOpening] +-[WebView(WebPrivate) setDefersCallbacks:] ++[WebPreferences(WebPrivate) _setInitialDefaultTextEncodingToSystemEncoding] ++[WebPreferences(WebPrivate) _systemCFStringEncoding] +WKGetWebDefaultCFStringEncoding ++[WebIconDatabase allowDatabaseCleanup] +-[WebIconDatabase defaultIconForURL:withSize:] __ZNK20WebFrameLoaderClient17willCacheResponseEPN7WebCore14DocumentLoaderEmP19NSCachedURLResponse +__ZN20WebFrameLoaderClient15willChangeTitleEPN7WebCore14DocumentLoaderE +__ZN20WebFrameLoaderClient14didChangeTitleEPN7WebCore14DocumentLoaderE +__ZN20WebFrameLoaderClient8setTitleERKN7WebCore6StringERKNS0_4KURLE ++[NSError(WebKitExtras) _webkit_errorWithDomain:code:URL:] +-[NSError(WebKitExtras) _webkit_initWithDomain:code:URL:] __ZN21WebIconDatabaseClient28dispatchDidAddIconForPageURLERKN7WebCore6StringE -[WebIconDatabase(WebInternal) _sendNotificationForURL:] -[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:] -[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:waitUntilDone:] -__ZN20WebFrameLoaderClient27registerForIconNotificationEb +__ZN20WebFrameLoaderClient22dispatchDidReceiveIconEv +-[WebView(WebViewInternal) _dispatchDidReceiveIconFromWebFrame:] -[WebView(WebViewInternal) _registerForIconNotification:] --[WebBasePluginPackage isNativeLibraryData:] --[WebBasePluginPackage getPluginInfoFromPLists] +__ZN20WebFrameLoaderClient19dispatchDidFailLoadERKN7WebCore13ResourceErrorE +-[WebView(WebPrivate) _didFailLoadWithError:forFrame:] +-[WebFrame DOMDocument] +__Z3kitPN7WebCore8DocumentE +__ZN20WebFrameLoaderClient32postProgressFinishedNotificationEv ++[NSNotificationCenter(WebNSNotificationCenterExtras) _postNotificationName:] +-[WebNetscapePluginPackage getPluginInfoFromResources] +-[WebNetscapePluginPackage openResourceFile] -[WebNetscapePluginPackage stringForStringListID:andIndex:] +[NSString(WebKitExtras) _web_encodingForResource:] -[WebNetscapePluginPackage closeResourceFile:] +-[WebNetscapePluginPackage(Internal) _unloadWithShutdown:] -[WebBasePluginPackage pListForPath:createFile:] +-[WebPluginPackage load] -[WebBasePluginPackage load] +-[WebBasePluginPackage unload] ++[WebBasePluginPackage preferredLocalizationName] -[WebPluginDatabase(Internal) _addPlugin:] -[WebBasePluginPackage path] -[WebBasePluginPackage wasAddedToPluginDatabase:] -[WebBasePluginPackage MIMETypeEnumerator] -[WebPluginDatabase pluginForMIMEType:] -[WebPluginDatabase pluginForKey:withEnumeratorSelector:] +__ZL14checkCandidatePP20WebBasePluginPackageS1_ -[WebNetscapePluginPackage executableType] -_checkCandidate -[WebBasePluginPackage isQuickTimePlugIn] -[WebBasePluginPackage bundle] -[WebBasePluginPackage isJavaPlugIn] +[WebHTMLView(WebPrivate) supportedImageMIMETypes] +[WebHTMLRepresentation supportedImageMIMETypes] __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_ +__ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E6expandEv +__ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E4findIS2_NS_22IdentityHashTranslatorIS2_S2_S5_EEEENS_17HashTableIteratorIS2_S2_S4_S5_S7_S7_EERKT_ +-[WebBasePluginPackage versionNumber] -[WebPluginDatabase plugins] -[WebBasePluginPackage name] -[WebBasePluginPackage pluginDescription] -[WebBasePluginPackage extensionsForMIMEType:] -[WebBasePluginPackage descriptionForMIMEType:] --[WebView estimatedProgress] -_WKSetNSURLRequestShouldContentSniff --[WebHistoryItem isEqual:] -__ZN20WebFrameLoaderClient17objectContentTypeERKN7WebCore4KURLERKNS0_6StringE --[WebFrameBridge determineObjectFromMIMEType:URL:] --[WebFrameBridge webView] --[WebView _pluginForMIMEType:] -__ZN20WebFrameLoaderClient12createPluginERKN7WebCore7IntSizeEPNS0_7ElementERKNS0_4KURLERKN3WTF6VectorINS0_6StringELm0EEESE_RKSB_b -__Z7nsArrayRKN3WTF6VectorIN7WebCore6StringELm0EEE --[WebFrameBridge viewForPluginWithFrame:URL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:] -+[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] --[WebNetscapePluginPackage NPP_SetWindow] --[WebNetscapePluginPackage NPP_NewStream] --[WebNetscapePluginPackage NPP_WriteReady] --[WebNetscapePluginPackage NPP_Write] --[WebNetscapePluginPackage NPP_StreamAsFile] --[WebNetscapePluginPackage NPP_DestroyStream] --[WebNetscapePluginPackage NPP_HandleEvent] --[WebNetscapePluginPackage NPP_URLNotify] --[WebNetscapePluginPackage NPP_GetValue] --[WebNetscapePluginPackage NPP_SetValue] --[WebNetscapePluginPackage NPP_Print] --[WebBaseNetscapePluginView setMIMEType:] --[WebBaseNetscapePluginView setBaseURL:] --[WebBaseNetscapePluginView setAttributeKeys:andValues:] --[WebBaseNetscapePluginView setMode:] +__ZN20WebFrameLoaderClient21dispatchDidFinishLoadEv +-[WebView(WebPrivate) _didFinishLoadForFrame:] +-[WebHistoryItem(WebPrivate) _transientPropertyForKey:] +-[WebHTMLView(WebDocumentPrivateProtocols) selectionView] +-[WebHTMLView(WebPrivate) _recursive:displayRectIgnoringOpacity:inContext:topView:] +-[WebHTMLView(WebNSTextInputSupport) validAttributesForMarkedText] +-[WebFrame(WebPrivate) _isFrameSet] +-[WebHTMLView(WebDocumentPrivateProtocols) string] +-[WebHTMLView(WebHTMLViewFileInternal) _documentRange] +-[DOMDocument(WebDOMDocumentOperationsPrivate) _documentRange] +-[DOMDocument(WebDOMDocumentOperationsPrivate) _createRangeWithNode:] +-[WebFrame(WebInternal) _stringForRange:] +-[NSEvent(WebExtras) _web_isOptionTabKeyEvent] +-[WebFrame(WebPrivate) _isDisplayingStandaloneImage] +-[WebView(WebPendingPublic) markAllMatchesForText:caseSensitive:highlight:limit:] +-[WebHTMLView(WebDocumentInternalProtocols) setMarkedTextMatchesAreHighlighted:] +-[WebHTMLView(WebDocumentInternalProtocols) markAllMatchesForText:caseSensitive:limit:] +__ZL14incrementFrameP8WebFrameaa +-[WebView(WebPendingPublic) unmarkAllTextMatches] +-[WebHTMLView(WebDocumentInternalProtocols) unmarkAllTextMatches] +-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:] ++[NSPasteboard(WebExtras) _web_setFindPasteboardString:withOwner:] +__ZN20WebFrameLoaderClient50dispatchDidReceiveServerRedirectForProvisionalLoadEv +__ZNK20WebFrameLoaderClient12canCachePageEv +__ZN20WebFrameLoaderClient29savePlatformDataToCachedFrameEPN7WebCore11CachedFrameE +__ZNK20WebFrameLoaderClient25didPerformFirstNavigationEv +-[WebPreferences(WebPrivate) automaticallyDetectsCacheModel] +WKGetFontInLanguageForRange +WKDrawBezeledTextFieldCell +-[WebHTMLView(WebPrivate) addTrackingRect:owner:userData:assumeInside:] +-[WebHTMLView(WebPrivate) _sendToolTipMouseEntered] +-[WebHTMLView(WebPrivate) _sendToolTipMouseExited] +-[WebElementDictionary _webFrame] +-[DOMDocument(WebDOMDocumentOperations) webFrame] +__Z4coreP11DOMDocument +-[WebElementDictionary _targetWebFrame] +-[NSURL(WebNSURLExtras) _webkit_URLByRemovingFragment] +-[NSURL(WebNSURLExtras) _webkit_URLByRemovingComponent:] +-[WebHTMLView mouseDown:] +__ZN15WebChromeClient14firstResponderEv +-[WebHTMLView mouseUp:] +WKSetNSURLConnectionDefersCallbacks +haltTimerFired +resumeTimerFired +-[WebHTMLView(WebPrivate) _removeTrackingRects:count:] +-[WebHTMLView(WebPrivate) _addTrackingRect:owner:userData:assumeInside:useTrackingNum:] +__ZN20WebFrameLoaderClient11createFrameERKN7WebCore4KURLERKNS0_6StringEPNS0_21HTMLFrameOwnerElementES6_bii ++[WebFrame(WebInternal) _createSubframeWithOwnerElement:frameName:frameView:] -[WebHTMLView addSubview:] --[WebBaseNetscapePluginView viewWillMoveToSuperview:] --[WebBaseNetscapePluginView visibleRect] --[WebBaseNetscapePluginView isFlipped] --[WebBaseNetscapePluginView viewWillMoveToWindow:] --[WebBaseNetscapePluginView tellQuickTimeToChill] --[WebBaseNetscapePluginView removeTrackingRect] --[WebBaseNetscapePluginView removeWindowObservers] --[WebBaseNetscapePluginView setHasFocus:] --[WebBaseNetscapePluginView viewDidMoveToWindow] --[WebBaseNetscapePluginView resetTrackingRect] --[WebBaseNetscapePluginView start] --[WebBaseNetscapePluginView canStart] --[WebBaseNetscapePluginView webView] --[WebBaseNetscapePluginView webFrame] --[WebBaseNetscapePluginView dataSource] -__Z4coreP10DOMElement --[WebNetscapePluginPackage open] --[WebBaseNetscapePluginView(Internal) _createPlugin] -+[WebBaseNetscapePluginView setCurrentPluginView:] -_NPN_UserAgent -_pluginViewForInstance -+[WebBaseNetscapePluginView currentPluginView] --[WebBaseNetscapePluginView(WebNPPCallbacks) userAgent] --[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 currentWindow] --[WebBaseNetscapePluginView superviewsHaveSuperviews] --[WebBaseNetscapePluginView(WebNPPCallbacks) isOpaque] -__ZN3WTF6VectorI6CGRectLm16EE6resizeEm --[WebBaseNetscapePluginView setWindowIfNecessary] --[WebBaseNetscapePluginView isNewWindowEqualToOldWindow] --[WebBaseNetscapePluginView willCallPlugInFunction] --[WebBaseNetscapePluginView didCallPlugInFunction] --[WebBaseNetscapePluginView restorePortState:] --[WebBaseNetscapePluginView addWindowObservers] --[WebBaseNetscapePluginView sendActivateEvent:] --[WebBaseNetscapePluginView getCarbonEvent:] -+[WebBaseNetscapePluginView getCarbonEvent:] --[WebBaseNetscapePluginView sendEvent:] -_WKSetNSURLConnectionDefersCallbacks -__ZN20WebFrameLoaderClient16setDefersLoadingEb -__ZNK20WebFrameLoaderClient34deliverArchivedResourcesAfterDelayEv --[WebBaseNetscapePluginView restartNullEvents] --[WebBaseNetscapePluginView didStart] --[NSURL(WebNSURLExtras) _web_isEmpty] --[NSMutableURLRequest(WebNSURLRequestExtras) _web_setHTTPReferrer:] --[WebBaseNetscapePluginView(WebNPPCallbacks) loadRequest:inTarget:withNotifyData:sendNotification:] --[NSURL(WebNSURLExtras) _webkit_scriptIfJavaScriptURL] -+[WebBaseNetscapePluginStream initialize] -+[WebNetscapePluginStream initialize] --[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:] --[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:] --[WebBaseNetscapePluginStream setRequestURL:] --[WebBaseNetscapePluginStream setPlugin:] --[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] --[WebFrameBridge firstResponder] +-[WebFrame parentFrame] +-[WebClipView additionalClip] +-[WebHTMLView willRemoveSubview:] __ZN15WebEditorClient19setInputMethodStateEb +__ZN15WebEditorClient25shouldChangeSelectedRangeEPN7WebCore5RangeES2_NS0_9EAffinityEb +__Z3kitPN7WebCore5RangeE +-[WebView(WebViewEditing) _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:] +-[WebView(WebPrivate) _editingDelegateForwarder] ++[WebDefaultEditingDelegate sharedEditingDelegate] +-[WebDefaultEditingDelegate webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:] __ZN15WebEditorClient32isContinuousSpellCheckingEnabledEv -[WebView(WebViewEditing) isContinuousSpellCheckingEnabled] -[WebView(WebFileInternal) _continuousCheckingAllowed] @@ -691,107 +817,55 @@ __ZN15WebEditorClient24isGrammarCheckingEnabledEv __ZN15WebEditorClient25respondToChangedSelectionEv -[WebView selectedFrame] -[WebView(WebFileInternal) _focusedFrame] -__Z19containingFrameViewP6NSView +__ZL19containingFrameViewP6NSView -[WebHTMLView(WebInternal) _selectionChanged] -[WebHTMLView(WebNSTextInputSupport) _updateSelectionForInputManager] --[WebClipView additionalClip] --[WebBaseNetscapePluginView drawRect:] --[WebBaseNetscapePluginView sendUpdateEvent] -__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] -__ZN35WebNetscapePlugInStreamLoaderClient16didFinishLoadingEPN7WebCore26NetscapePlugInStreamLoaderE --[WebBaseNetscapePluginStream finishedLoading] --[WebBaseNetscapePluginStream _destroyStreamWithReason:] --[WebBaseNetscapePluginStream _destroyStream] --[WebBaseNetscapePluginView disconnectStream:] --[WebNetscapePluginStream dealloc] -__ZN35WebNetscapePlugInStreamLoaderClientD1Ev --[WebBaseNetscapePluginStream dealloc] -__ZN20WebFrameLoaderClient14cancelledErrorERKN7WebCore15ResourceRequestE -+[NSError(WebKitExtras) _webKitErrorWithDomain:code:URL:] -+[NSError(WebKitExtras) _registerWebKitErrors] -_registerErrors -+[NSError(WebKitExtras) _webkit_addErrorsWithCodesAndDescriptions:inDomain:] -+[NSError(WebKitExtras) _webkit_errorWithDomain:code:URL:] --[NSError(WebKitExtras) _webkit_initWithDomain:code:URL:] -__ZN20WebFrameLoaderClient20setMainDocumentErrorEPN7WebCore14DocumentLoaderERKNS0_13ResourceErrorE --[WebDataSource(WebInternal) _setMainDocumentError:] -__ZN20WebFrameLoaderClient24cancelPendingArchiveLoadEPN7WebCore14ResourceLoaderE -__ZN15WebEditorClient22textFieldDidEndEditingEPN7WebCore7ElementE -__Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_ --[WebView hostWindow] --[WebBaseNetscapePluginView stop] --[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 -_WKDrawFocusRing -__Z41_updateFocusedAndActiveStateTimerCallbackP16__CFRunLoopTimerPv --[WebHTMLView(WebHTMLViewFileInternal) _frameView] --[WebHTMLView keyDown:] +__ZN15WebEditorClient33isSelectTrailingWhitespaceEnabledEv +-[WebView(WebPrivate) isSelectTrailingWhitespaceEnabled] ++[WebHTMLView(WebPrivate) _postFlagsChangedEvent:] +-[WebHTMLView flagsChanged:] __ZN15WebEditorClient24handleInputMethodKeydownEPN7WebCore13KeyboardEventE -[WebHTMLView(WebInternal) _interceptEditingKeyEvent:shouldSaveCommand:] --[WebHTMLView(WebNSTextInputSupport) hasMarkedText] --[WebHTMLView(WebNSTextInputSupport) insertText:] -__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEmPKS2_ -__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEm -__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE15reserveCapacityEm __ZN15WebEditorClient27doTextFieldCommandFromEventEPN7WebCore7ElementEPNS0_13KeyboardEventE __ZN15WebEditorClient19handleKeyboardEventEPN7WebCore13KeyboardEventE +-[WebHTMLView validateUserInterfaceItem:] +-[WebHTMLView validateUserInterfaceItemWithoutDelegate:] -[WebHTMLView coreCommandBySelector:] -__ZN15WebEditorClient16shouldInsertTextEN7WebCore6StringEPNS0_5RangeENS0_18EditorInsertActionE --[WebView(WebPrivate) _editingDelegateForwarder] -+[WebDefaultEditingDelegate sharedEditingDelegate] +__ZL3kitN7WebCore8TriStateE +__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objecta +__ZL28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selectorS2_a +-[WebHTMLView performKeyEquivalent:] +-[WebHTMLView _handleStyleKeyEquivalent:] +-[WebPreferences(WebPrivate) respectStandardStyleKeyEquivalents] +-[WebHTMLView(WebNSTextInputSupport) doCommandBySelector:] +-[WebHTMLView copy:] +-[WebHTMLView executeCoreCommandBySelector:] +-[WebHTMLView callDelegateDoCommandBySelectorIfNeeded:] +-[WebDefaultEditingDelegate webView:doCommandBySelector:] +__ZN15WebEditorClient24smartInsertDeleteEnabledEv +-[WebView(WebViewEditing) smartInsertDeleteEnabled] +-[WebView textSizeMultiplier] +__ZN15WebEditorClient33didSetSelectionTypesForPasteboardEv +-[WebDefaultEditingDelegate webView:didSetSelectionTypesForPasteboard:] +__ZN15WebEditorClient29didWriteSelectionToPasteboardEv +-[WebDefaultEditingDelegate webView:didWriteSelectionToPasteboard:] +-[WebHTMLView keyUp:] +__ZN15WebEditorClient22textFieldDidEndEditingEPN7WebCore7ElementE +__Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_ +WKDrawFocusRing +-[WebHTMLView(WebInternal) paste:] +__ZN15WebEditorClient16shouldInsertTextERKN7WebCore6StringEPNS0_5RangeENS0_18EditorInsertActionE __Z3kitN7WebCore18EditorInsertActionE -__Z3kitPN7WebCore5RangeE -[WebDefaultEditingDelegate webView:shouldInsertText:replacingDOMRange:givenAction:] __ZN15WebEditorClient24textFieldDidBeginEditingEPN7WebCore7ElementE -[WebHTMLRepresentation formForElement:] +__ZL26inputElementFromDOMElementP10DOMElement +__Z3kitPN7WebCore11HTMLElementE -[WebHTMLRepresentation controlsInForm:] +__ZL25formElementFromDOMElementP10DOMElement -[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:] __ZN15WebEditorClient22registerCommandForUndoEN3WTF10PassRefPtrIN7WebCore11EditCommandEEE __ZN15WebEditorClient28registerCommandForUndoOrRedoEN3WTF10PassRefPtrIN7WebCore11EditCommandEEEb -[WebView(WebViewEditing) undoManager] @@ -799,341 +873,542 @@ __ZN15WebEditorClient28registerCommandForUndoOrRedoEN3WTF10PassRefPtrIN7WebCore1 +[WebEditCommand commandWithEditCommand:] -[WebEditCommand initWithEditCommand:] __ZN15WebEditorClient24respondToChangedContentsEv --[WebHTMLView keyUp:] -__ZN15WebEditorClient21checkSpellingOfStringEPKtiPiS2_ -__ZN15WebEditorClient23spellCheckerDocumentTagEv --[WebView(WebViewEditing) spellCheckerDocumentTag] +__ZNK15WebChromeClient18scrollRectIntoViewERKN7WebCore7IntRectEPKNS0_10ScrollViewE -[WebHTMLRepresentation matchLabels:againstElement:] +__Z4coreP10DOMElement -[WebHTMLRepresentation searchForLabels:beforeElement:] --[WebHTMLView(WebNSTextInputSupport) doCommandBySelector:] --[WebDefaultEditingDelegate webView:doCommandBySelector:] -__ZN15WebEditorClient17shouldDeleteRangeEPN7WebCore5RangeE --[WebDefaultEditingDelegate webView:shouldDeleteDOMRange:] -__ZN15WebEditorClient28textWillBeDeletedInTextFieldEPN7WebCore7ElementE +-[WebHTMLView keyDown:] +__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEmPKS2_ +__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEm +__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE15reserveCapacityEm __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 +__ZN15WebEditorClient21checkSpellingOfStringEPKtiPiS2_ +__ZN15WebEditorClient23spellCheckerDocumentTagEv +-[WebView(WebViewEditing) spellCheckerDocumentTag] +-[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:] +-[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:xHysteresis:yHysteresis:] +-[WebEditCommand dealloc] +__ZN26WebCachedFramePlatformData5clearEv +-[WebHTMLView(WebInternal) closeIfNotCurrentView] +-[WebHTMLView(WebPrivate) removeTrackingRect:] +__ZN26WebCachedFramePlatformDataD1Ev +-[NSString(WebNSURLExtras) _webkit_scriptIfJavaScriptURL] +-[NSString(WebNSURLExtras) _webkit_isJavaScriptURL] +-[NSString(WebNSURLExtras) _web_isUserVisibleURL] +__ZNK15WebChromeClient17windowResizerRectEv +-[WebViewFactory inputElementAltText] ++[WebStringTruncator centerTruncateString:toWidth:] +__ZL15defaultMenuFontv +-[WebHTMLView(WebHTMLViewFileInternal) _frameView] __ZN20WebFrameLoaderClient22dispatchWillSubmitFormEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEEN3WTF10PassRefPtrINS0_9FormStateEEE -[WebView(WebPrivate) _formDelegate] -__Z3kitPN7WebCore11HTMLElementE __Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_S4_S4_S4_ --[WebHTMLRepresentation elementWithName:inForm:] -[WebFramePolicyListener continue] -__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:] --[WebElementDictionary _isSelected] --[WebHTMLView mouseDown:] --[WebHTMLView(WebHTMLViewFileInternal) _setMouseDownEvent:] --[WebHTMLView mouseUp:] +-[WebHTMLView menuForEvent:] +-[WebViewFactory contextMenuItemTagOpenLink] +-[WebViewFactory contextMenuItemTagOpenLinkInNewWindow] +-[WebViewFactory contextMenuItemTagDownloadLinkToDisk] +-[WebViewFactory contextMenuItemTagCopyLinkToClipboard] +-[WebViewFactory contextMenuItemTagOpenImageInNewWindow] +-[WebViewFactory contextMenuItemTagDownloadImageToDisk] +-[WebViewFactory contextMenuItemTagCopyImageToClipboard] +-[WebViewFactory contextMenuItemTagSearchInSpotlight] +-[WebViewFactory contextMenuItemTagLookUpInDictionary] +-[WebViewFactory contextMenuItemTagSearchWeb] +-[WebViewFactory contextMenuItemTagCopy] +-[WebViewFactory contextMenuItemTagGoBack] +-[WebViewFactory contextMenuItemTagGoForward] +-[WebViewFactory contextMenuItemTagStop] +-[WebViewFactory contextMenuItemTagReload] +-[WebViewFactory contextMenuItemTagOpenFrameInNewWindow] +-[WebViewFactory contextMenuItemTagNoGuessesFound] +-[WebViewFactory contextMenuItemTagIgnoreSpelling] +-[WebViewFactory contextMenuItemTagLearnSpelling] +-[WebViewFactory contextMenuItemTagIgnoreGrammar] +-[WebViewFactory contextMenuItemTagCut] +-[WebViewFactory contextMenuItemTagPaste] +__ZN20WebContextMenuClient29getCustomMenuFromDefaultItemsEPN7WebCore11ContextMenuE +__ZL19isPreVersion3Clientv +__ZL28isPreInspectElementTagClientv +__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_ +__ZL12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_ +-[WebDataSource(WebPrivate) _fileWrapperForURL:] +-[WebDataSource subresourceForURL:] +-[WebView(WebPrivate) _cachedResponseForURL:] +-[WebView userAgentForURL:] +-[NSMutableURLRequest(WebNSURLRequestExtras) _web_setHTTPUserAgent:] +-[WebElementDictionary _absoluteImageURL] +-[WebHTMLView accessibilityAttributeValue:] +-[WebFrame(WebInternal) _accessibilityTree] +-[WebView(WebIBActions) validateUserInterfaceItem:] +-[WebView(WebIBActions) validateUserInterfaceItemWithoutDelegate:] +__ZN13WebDragClient28dragSourceActionMaskForPointERKN7WebCore8IntPointE +-[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:] +__ZN15WebEditorClient17userVisibleStringEP5NSURL +-[WebViewFactory unregisterUniqueIdForUIElement:] +WKUnregisterUniqueIdForElement +-[WebFrame childFrames] +-[WebHistoryItem alternateTitle] +-[WebHistoryItem setAlternateTitle:] +-[WebView(WebPendingPublic) canResetPageZoom] +-[WebView _canResetZoom:] +-[WebView _zoomMultiplier:] +-[WebView(WebIBActions) canMakeTextStandardSize] +-[WebView(WebPendingPublic) canZoomPageIn] +-[WebView _canZoomIn:] +-[WebView(WebPendingPublic) canZoomPageOut] +-[WebView _canZoomOut:] +-[WebHTMLRepresentation canProvideDocumentSource] +-[WebFrame(WebInternal) _canProvideDocumentSource] +__ZN20WebFrameLoaderClient17objectContentTypeERKN7WebCore4KURLERKNS0_6StringE +WKSetNSURLRequestShouldContentSniff +-[WebIconDatabase(WebInternal) _applicationWillTerminate:] ++[WebView _applicationWillTerminate] +-[WebView(WebPrivate) _closeWithFastTeardown] ++[WebPluginDatabase closeSharedDatabase] +-[WebPluginDatabase close] +-[WebPluginDatabase(Internal) _removePlugin:] ++[WebView(WebPrivate) _unregisterViewClassAndRepresentationClassForMIMEType:] +-[WebBasePluginPackage wasRemovedFromPluginDatabase:] +-[WebNetscapePluginPackage wasRemovedFromPluginDatabase:] +-[NSString(WebKitExtras) _web_drawAtPoint:font:textColor:] +-[WebView supportsTextEncoding] +-[WebIconDatabase(WebInternal) _iconsBySplittingRepresentationsOfIcon:] +-[WebIconDatabase(WebInternal) _iconFromDictionary:forSize:cache:] +-[WebHTMLView updateCell:] +-[WebHTMLView resignFirstResponder] +-[WebHTMLView maintainsInactiveSelection] +-[WebView(WebViewEditing) maintainsInactiveSelection] +-[WebHTMLView(WebDocumentPrivateProtocols) deselectAll] +-[WebHTMLView clearFocus] ++[WebCoreStatistics setShouldPrintExceptions:] ++[WebKitStatistics webViewCount] ++[WebKitStatistics frameCount] ++[WebKitStatistics dataSourceCount] ++[WebKitStatistics viewCount] ++[WebKitStatistics HTMLRepresentationCount] ++[WebKitStatistics bridgeCount] ++[WebCoreStatistics javaScriptProtectedGlobalObjectsCount] +WKDrawBezeledTextArea __ZN20WebFrameLoaderClient33dispatchWillPerformClientRedirectERKN7WebCore4KURLEdd __Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_dS0_S0_ -__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_dS0_S0_ +__ZL12CallDelegatePFP11objc_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 +-[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:] +-[WebBasePluginPackage isNativeLibraryData:] +__ZN3WTF6VectorIhLm512EE6shrinkEm +-[WebBasePluginPackage getPluginInfoFromPLists] +-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:] +-[NSArray(WebPluginExtensions) _web_lowercaseStrings] +-[WebBasePluginPackage setMIMEToExtensionsDictionary:] +-[WebBasePluginPackage setMIMEToDescriptionDictionary:] +-[WebBasePluginPackage filename] +-[WebBasePluginPackage setName:] +-[WebBasePluginPackage setPluginDescription:] __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:] +__ZN20WebFrameLoaderClient22dispatchDidFirstLayoutEv +__ZN15WebChromeClient7repaintERKN7WebCore7IntRectEbbb +-[WebView(WebIBActions) stopLoading:] +-[WebFrame stopLoading] +__ZN15WebChromeClient24disableSuddenTerminationEv +__ZN15WebChromeClient23enableSuddenTerminationEv +-[WebHTMLView mouseDragged:] +__ZN15WebChromeClient18formStateDidChangeEPKN7WebCore4NodeE __ZN15WebChromeClient12createWindowEPN7WebCore5FrameERKNS0_16FrameLoadRequestERKNS0_14WindowFeaturesE -__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_ -__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_ --[WebBaseNetscapePluginView preferencesHaveChanged:] __ZN15WebChromeClient18setToolbarsVisibleEb --[WebView becomeFirstResponder] --[WebFrameView acceptsFirstResponder] __ZN15WebChromeClient19setStatusbarVisibleEb __ZN15WebChromeClient20setScrollbarsVisibleEb +-[WebFrameView setAllowsScrolling:] __ZN15WebChromeClient17setMenubarVisibleEb __ZN15WebChromeClient12setResizableEb +__ZN15WebChromeClient10windowRectEv __ZN15WebChromeClient8pageRectEv __ZN15WebChromeClient13setWindowRectERKN7WebCore9FloatRectE __ZN15WebChromeClient4showEv --[WebFramePolicyListener invalidate] -__ZN20WebFrameLoaderClient29interruptForPolicyChangeErrorERKN7WebCore15ResourceRequestE --[WebFramePolicyListener ignore] -+[NSObject(WebScripting) isKeyExcludedFromWebScript:] --[WebIconDatabase iconURLForURL:] --[WebHistoryItem(WebPrivate) RSSFeedReferrer] --[WebView(WebIBActions) reload:] --[WebFrame reload] -__ZN15WebChromeClient7unfocusEv --[WebDefaultUIDelegate webViewUnfocus:] +__ZN15WebChromeClient18makeFirstResponderEP11NSResponder +-[WebView(WebPrivate) _pushPerformingProgrammaticFocus] +-[WebView(WebPrivate) _popPerformingProgrammaticFocus] +-[WebPreferences setJavaScriptCanOpenWindowsAutomatically:] +__ZL32applyHostNameFunctionToURLStringP8NSStringPFvS0_8_NSRangePvES2_ +__ZL29collectRangesThatNeedEncodingP8NSString8_NSRangePv +__ZL28collectRangesThatNeedMappingP8NSString8_NSRangePva +-[NSString(WebNSURLExtras) _web_hostNameNeedsEncodingWithRange:] +-[WebView _pluginForMIMEType:] +__ZN20WebFrameLoaderClient12createPluginERKN7WebCore7IntSizeEPNS0_7ElementERKNS0_4KURLERKN3WTF6VectorINS0_6StringELm0EEESE_RKSB_b +__ZL23netscapePluginViewClassv ++[WebBaseNetscapePluginView initialize] +WKSendUserChangeNotifications ++[WebNetscapePluginDocumentView initialize] +-[WebBaseNetscapePluginView .cxx_construct] +-[WebNetscapePluginDocumentView .cxx_construct] +__Z3kitPN7WebCore7ElementE +__ZL3kitRKN3WTF6VectorIN7WebCore6StringELm0EEE +-[WebNetscapePluginDocumentView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:] +-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:] +-[WebNetscapePluginDocumentView setAttributeKeys:andValues:] +-[WebNetscapePluginPackage load] +-[WebNetscapePluginPackage _applyDjVuWorkaround] +__ZNK7WebCore6Widget11isFrameViewEv +-[WebBaseNetscapePluginView renewGState] +__ZN7WebCore6Widget16setParentVisibleEb +-[WebBaseNetscapePluginView viewWillMoveToSuperview:] +-[WebBaseNetscapePluginView visibleRect] +-[WebBaseNetscapePluginView isFlipped] +-[WebBaseNetscapePluginView viewWillMoveToWindow:] +-[WebBaseNetscapePluginView removeTrackingRect] +-[WebBaseNetscapePluginView removeWindowObservers] +-[WebBaseNetscapePluginView setHasFocus:] +-[WebBaseNetscapePluginView viewDidMoveToWindow] +-[WebBaseNetscapePluginView resetTrackingRect] +-[WebBaseNetscapePluginView start] +-[WebBaseNetscapePluginView webView] +-[WebBaseNetscapePluginView webFrame] +-[WebBaseNetscapePluginView dataSource] +-[WebNetscapePluginDocumentView createPlugin] +-[WebNetscapePluginPackage open] +-[WebNetscapePluginDocumentView(Internal) _createPlugin] ++[WebNetscapePluginDocumentView setCurrentPluginView:] +-[WebNetscapePluginPackage pluginFuncs] +NPN_UserAgent +__Z21pluginViewForInstanceP4_NPP ++[WebNetscapePluginDocumentView currentPluginView] +-[WebNetscapePluginDocumentView(WebNPPCallbacks) userAgent] +NPN_GetValue +-[WebNetscapePluginDocumentView(WebNPPCallbacks) getVariable:value:] +NPN_SetValue +-[WebNetscapePluginDocumentView(WebNPPCallbacks) setVariable:value:] +__ZN29WebNetscapePluginEventHandler6createEP29WebNetscapePluginDocumentView +-[WebNetscapePluginDocumentView eventModel] +__ZN35WebNetscapePluginEventHandlerCarbonC1EP29WebNetscapePluginDocumentView +-[WebView addPluginInstanceView:] +-[WebPluginDatabase addPluginInstanceView:] +-[WebNetscapePluginDocumentView updateAndSetWindow] +-[WebNetscapePluginDocumentView saveAndSetNewPortState] +-[WebNetscapePluginDocumentView saveAndSetNewPortStateForUpdate:] +-[WebBaseNetscapePluginView currentWindow] +-[WebNetscapePluginDocumentView superviewsHaveSuperviews] +__ZN35WebNetscapePluginEventHandlerCarbon14platformWindowEP8NSWindow +-[WebNetscapePluginDocumentView(WebNPPCallbacks) isOpaque] +__ZN3WTF6VectorI6CGRectLm16EE6resizeEm +-[WebNetscapePluginDocumentView setWindowIfNecessary] +-[WebNetscapePluginDocumentView isNewWindowEqualToOldWindow] +-[WebNetscapePluginDocumentView willCallPlugInFunction] +-[WebNetscapePluginDocumentView didCallPlugInFunction] +-[WebNetscapePluginDocumentView restorePortState:] +-[WebBaseNetscapePluginView addWindowObservers] +-[WebBaseNetscapePluginView sendActivateEvent:] +-[WebNetscapePluginDocumentView windowFocusChanged:] +__ZN35WebNetscapePluginEventHandlerCarbon18windowFocusChangedEb +__ZL14getCarbonEventP11EventRecord +__ZN35WebNetscapePluginEventHandlerCarbon9sendEventEP11EventRecord +-[WebNetscapePluginDocumentView sendEvent:isDrawRect:] +-[WebBaseNetscapePluginView restartTimers] +-[WebNetscapePluginDocumentView stopTimers] +-[WebBaseNetscapePluginView stopTimers] +__ZN35WebNetscapePluginEventHandlerCarbon10stopTimersEv +-[WebNetscapePluginDocumentView startTimers] +-[WebBaseNetscapePluginView startTimers] +__ZN35WebNetscapePluginEventHandlerCarbon11startTimersEb +-[WebNetscapePluginDocumentView loadStream] +-[NSURL(WebNSURLExtras) _web_isEmpty] +-[NSMutableURLRequest(WebNSURLRequestExtras) _web_setHTTPReferrer:] +-[WebNetscapePluginDocumentView(WebNPPCallbacks) loadRequest:inTarget:withNotifyData:sendNotification:] +-[NSURL(WebNSURLExtras) _webkit_scriptIfJavaScriptURL] +__ZN23WebNetscapePluginStreamC1EP12NSURLRequestP4_NPPbPv +__ZN23WebNetscapePluginStream9setPluginEP4_NPP +-[WebBaseNetscapePluginView pluginPackage] +__ZL7streamsv +__ZN3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEE3addERKS2_RKS4_ +__ZN3WTF9HashTableIP9_NPStreamSt4pairIS2_P4_NPPENS_18PairFirstExtractorIS6_EENS_7PtrHashIS2_EENS_14PairHashTraitsINS_10HashTraitsIS2_EENSC_IS5_EEEESD_E6expandEv +__ZN3WTF7HashSetINS_6RefPtrI23WebNetscapePluginStreamEENS_7PtrHashIS3_EENS_10HashTraitsIS3_EEE3addERKS3_ +__ZN3WTF9HashTableINS_6RefPtrI23WebNetscapePluginStreamEES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6expandEv +__ZN23WebNetscapePluginStream5startEv +NPN_InvalidateRect +-[WebNetscapePluginDocumentView(WebNPPCallbacks) invalidateRect:] +-[WebNetscapePluginDocumentView drawRect:] +-[WebNetscapePluginDocumentView sendDrawRectEvent:] +__ZN35WebNetscapePluginEventHandlerCarbon8drawRectERK7_NSRect +__ZN3WTF6VectorI6CGRectLm16EE6shrinkEm +__ZN35WebNetscapePluginEventHandlerCarbon19nullEventTimerFiredEP16__CFRunLoopTimerPv +__ZN35WebNetscapePluginEventHandlerCarbon13sendNullEventEv +__ZN23WebNetscapePluginStream18didReceiveResponseEPN7WebCore26NetscapePlugInStreamLoaderERKNS0_16ResourceResponseE +WKGetNSURLResponseLastModifiedDate +__ZN23WebNetscapePluginStream11startStreamEP5NSURLxP6NSDateP8NSStringP6NSData +-[NSURL(WebNSURLExtras) _web_URLCString] +__ZNK23WebNetscapePluginStream15wantsAllStreamsEv +__ZN23WebNetscapePluginStream14didReceiveDataEPN7WebCore26NetscapePlugInStreamLoaderEPKci +__ZN23WebNetscapePluginStream11deliverDataEv +__ZN23WebNetscapePluginStream16didFinishLoadingEPN7WebCore26NetscapePlugInStreamLoaderE +__ZN23WebNetscapePluginStream23destroyStreamWithReasonEs +__ZN23WebNetscapePluginStream13destroyStreamEv +-[WebNetscapePluginDocumentView disconnectStream:] +__ZN3WTF9HashTableINS_6RefPtrI23WebNetscapePluginStreamEES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E4findIS3_NS_22IdentityHashTranslatorIS3_S3_S7_EEEENS_17HashTableIteratorIS3_S3_S5_S7_S9_S9_EERKT_ +__ZN3WTF9HashTableIP9_NPStreamSt4pairIS2_P4_NPPENS_18PairFirstExtractorIS6_EENS_7PtrHashIS2_EENS_14PairHashTraitsINS_10HashTraitsIS2_EENSC_IS5_EEEESD_E4findIS2_NS_22IdentityHashTranslatorIS2_S6_SA_EEEENS_17HashTableIteratorIS2_S6_S8_SA_SF_SD_EERKT_ +-[WebBaseNetscapePluginView preferencesHaveChanged:] +-[WebBaseNetscapePluginView windowResignedKey:] +NPN_GetURLNotify +-[WebNetscapePluginDocumentView(WebNPPCallbacks) getURLNotify:target:notifyData:] +-[WebBaseNetscapePluginView requestWithURLCString:] +-[NSString(WebKitExtras) _web_stringByStrippingReturnCharacters] +-[NSURL(WebNSURLExtras) _webkit_URLByRemovingResourceSpecifier] +NPN_PostURLNotify +-[WebNetscapePluginDocumentView(WebNPPCallbacks) postURLNotify:target:len:buf:file:notifyData:] +-[WebNetscapePluginDocumentView(WebNPPCallbacks) _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:] +-[NSData(WebNSDataExtras) _web_startsWithBlankLine] +-[NSData(WebNSDataExtras) _web_locationAfterFirstBlankLine] +-[NSData(WebNSDataExtras) _webkit_parseRFC822HeaderFields] +-[NSString(WebNSDataExtrasInternal) _web_capitalizeRFC822HeaderFieldName] +-[WebNetscapePluginDocumentView createPluginScriptableObject] +NPN_MemFree +__ZN15WebChromeClient11scaleFactorEv +-[WebPluginDatabase removePluginInstanceViewsFor:] +-[WebViewFactory imageTitleForFilename:width:height:] +WKGetMIMETypeForExtension +-[WebView _pluginForExtension:] +-[WebPluginDatabase pluginForExtension:] +-[WebBasePluginPackage extensionEnumerator] +-[WebBasePluginPackage MIMETypeForExtension:] __ZN15WebChromeClient15closeWindowSoonEv -[WebView(WebPrivate) _closeWindow] -[WebBaseNetscapePluginView windowWillClose:] --[WebFrameBridge valueForKey:keys:values:] +-[WebBaseNetscapePluginView stop] +-[WebNetscapePluginDocumentView shouldStop] +-[WebView removePluginInstanceView:] +-[WebPluginDatabase removePluginInstanceView:] +-[WebNetscapePluginDocumentView destroyPlugin] +__ZN3WTF6VectorINS_6RefPtrI23WebNetscapePluginStreamEELm0EE6resizeEm +-[WebNetscapePluginDocumentView(Internal) _destroyPlugin] +-[WebNetscapePluginPackage close] +__ZN35WebNetscapePluginEventHandlerCarbonD1Ev +__ZN20NetscapePluginWidgetD1Ev +-[WebPluginDatabase destroyAllPluginInstanceViews] +-[WebPluginDatabase dealloc] +-[WebNetscapePluginDocumentView dealloc] +-[WebNetscapePluginDocumentView fini] +-[WebBaseNetscapePluginView dealloc] +-[WebNetscapePluginDocumentView .cxx_destruct] +-[WebBaseNetscapePluginView .cxx_destruct] +__ZN20WebFrameLoaderClient21fileDoesNotExistErrorERKN7WebCore16ResourceResponseE ++[NSError(WebKitExtras) _webKitErrorWithDomain:code:URL:] ++[NSError(WebKitExtras) _registerWebKitErrors] +registerErrors ++[NSError(WebKitExtras) _webkit_addErrorsWithCodesAndDescriptions:inDomain:] +__ZN23WebNetscapePluginStream7didFailEPN7WebCore26NetscapePlugInStreamLoaderERKNS0_13ResourceErrorE +__ZN23WebNetscapePluginStream22destroyStreamWithErrorEP7NSError +__ZN23WebNetscapePluginStream14reasonForErrorEP7NSError +__ZN20WebFrameLoaderClient14cancelledErrorERKN7WebCore15ResourceRequestE +__ZSt25__unguarded_linear_insertIPiiEvT_T0_ +-[WebHistoryItem(WebInternal) _mergeAutoCompleteHints:] +-[WebHistoryItem(WebPrivate) URL] +__ZN20WebFrameLoaderClient27registerForIconNotificationEb +-[WebView(WebViewInternal) _receivedIconChangedNotification:] +-[WebView(WebPendingPublic) canMarkAllTextMatches] +-[WebView(WebPendingPublic) searchFor:direction:caseSensitive:wrap:startInSelection:] +-[WebView(WebFileInternal) _selectedOrMainFrame] +-[WebFrame(WebInternal) _findFrameWithSelection] +-[WebFrame(WebInternal) _hasSelection] +-[WebHTMLView(WebDocumentPrivateProtocols) searchFor:direction:caseSensitive:wrap:startInSelection:] +-[WebFrameView(WebPrivate) _contentView] +-[WebView(WebPendingPublic) rectsForTextMatches] +-[WebHTMLView(WebDocumentInternalProtocols) rectsForTextMatches] +__ZN3WTF6VectorIN7WebCore7IntRectELm0EE6shrinkEm +-[WebHTMLView(WebDocumentPrivateProtocols) selectionRect] +-[WebHTMLView(WebPrivate) _hasSelection] +-[WebHTMLView(WebDocumentPrivateProtocols) selectionTextRects] +__ZN3WTF6VectorIN7WebCore9FloatRectELm0EE6shrinkEm +-[WebHTMLView(WebDocumentPrivateProtocols) selectionImageForcingBlackText:] +-[WebHTMLView(WebDocumentPrivateProtocols) selectedString] +-[WebFrame(WebInternal) _selectedString] +-[WebHTMLView(WebPrivate) view:stringForToolTip:point:userData:] +-[WebHTMLView scrollWheel:] +WKGetWheelEventDeltas +-[WebClipView scrollWheel:] +-[WebDynamicScrollBarsView(WebInternal) scrollWheel:] +-[WebDynamicScrollBarsView(WebInternal) allowsVerticalScrolling] +-[WebDynamicScrollBarsView(WebInternal) autoforwardsScrollWheelEvents] +-[WebDynamicScrollBarsView(WebInternal) allowsHorizontalScrolling] +-[WebView(WebIBActions) goBack:] +-[WebView goBack] +__ZNK20WebFrameLoaderClient21shouldGoToHistoryItemEPN7WebCore11HistoryItemE +__ZN20WebFrameLoaderClient16restoreViewStateEv +__ZN15WebChromeClient13willPopUpMenuEP6NSMenu +WKPopupMenu +-[WebHTMLView _accessibilityParentForSubview:] +-[WebDynamicScrollBarsView(WebInternal) accessibilityIsIgnored] +-[WebClipView _focusRingVisibleRect] +__ZL10pluginViewP8WebFrameP16WebPluginPackageP7NSArrayS4_P5NSURLP10DOMElementa +-[WebPluginPackage viewFactory] ++[WebPluginController plugInViewWithArguments:fromPluginPackage:] +-[WebPluginController webFrame] +-[WebView(WebPrivate) defersCallbacks] +-[WebPluginController addPlugin:] ++[NSObject(WebScripting) isKeyExcludedFromWebScript:] ++[NSObject(WebScripting) isSelectorExcludedFromWebScript:] +__ZN20WebFrameLoaderClient35dispatchDidChangeLocationWithinPageEv +__ZN20WebFrameLoaderClient13didFinishLoadEv +__ZN7WebCore6Widget11handleEventEPNS_5EventE +-[WebView hostWindow] +-[WebView acceptsFirstResponder] +-[WebFrameView acceptsFirstResponder] +-[WebView becomeFirstResponder] +__ZL14parameterValueRKN3WTF6VectorIN7WebCore6StringELm0EEES5_RKS2_ -[NSError(WebKitExtras) _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:] -[WebNullPluginView initWithFrame:error:DOMElement:] -[WebNullPluginView viewDidMoveToWindow] -[WebNullPluginView reportFailure] --[WebFrameBridge getAppletInView:] --[WebFrameBridge pollForAppletInView:] +-[NSURL(WebNSURLExtras) _web_URLWithLowercasedScheme] +-[WebFramePolicyListener ignore] +__ZN20WebFrameLoaderClient36transitionToCommittedFromCachedFrameEPN7WebCore11CachedFrameE +__ZN20WebFrameLoaderClient11forceLayoutEv +-[WebHTMLView setNeedsToApplyStyles:] -[WebNullPluginView dealloc] -__ZN20WebFrameLoaderClient21fileDoesNotExistErrorERKN7WebCore16ResourceResponseE -__ZN20WebFrameLoaderClient38dispatchDecidePolicyForNewWindowActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestERKNS0_6StringE +__ZN15WebChromeClient5focusEv +-[WebFramePolicyListener download] +__ZN20WebFrameLoaderClient8downloadEPN7WebCore14ResourceHandleERKNS0_15ResourceRequestES5_RKNS0_16ResourceResponseE +-[WebDownload _initWithLoadingConnection:request:response:delegate:proxy:] +-[WebDownload _setRealDelegate:] +-[WebDownloadInternal setRealDelegate:] +-[WebDownload init] +-[WebDownloadInternal respondsToSelector:] +-[WebDownloadInternal downloadDidBegin:] +-[WebDownloadInternal download:didReceiveResponse:] +__ZNK20WebFrameLoaderClient25setOriginalURLForDownloadEP11WebDownloadRKN7WebCore15ResourceRequestE +__ZN20WebFrameLoaderClient29interruptForPolicyChangeErrorERKN7WebCore15ResourceRequestE +-[WebDownloadInternal download:decideDestinationWithSuggestedFilename:] +-[NSFileManager(WebNSFileManagerExtras) _webkit_setMetadataURL:referrer:atPath:] +WKSetMetadataURL +-[WebDownloadInternal download:didCreateDestination:] +-[WebDownloadInternal download:didReceiveDataOfLength:] ++[WebStringTruncator widthOfString:font:] +-[WebDownloadInternal downloadDidFinish:] +-[WebDownload dealloc] +-[WebDownloadInternal dealloc] +-[WebHTMLRepresentation elementWithName:inForm:] +-[WebViewFactory accessibilityHandleFocusChanged] +WKAccessibilityHandleFocusChanged +-[WebHTMLView(WebNSTextInputSupport) hasMarkedText] +-[WebHTMLView(WebNSTextInputSupport) insertText:] +__ZN20NetscapePluginWidget11handleEventEPN7WebCore5EventE +-[WebNetscapePluginDocumentView handleMouseMoved:] +__ZN35WebNetscapePluginEventHandlerCarbon10mouseMovedEP7NSEvent +-[WebBaseNetscapePluginView acceptsFirstResponder] +-[WebBaseNetscapePluginView becomeFirstResponder] +-[WebNetscapePluginDocumentView focusChanged] +__ZN35WebNetscapePluginEventHandlerCarbon12focusChangedEb +__ZN35WebNetscapePluginEventHandlerCarbon22installKeyEventHandlerEv +-[WebNetscapePluginDocumentView mouseDown:] +__ZN35WebNetscapePluginEventHandlerCarbon9mouseDownEP7NSEvent +__ZL14getCarbonEventP11EventRecordP7NSEvent +WKConvertNSEventToCarbonEvent +-[WebNetscapePluginDocumentView inputContext] +-[WebNetscapePluginDocumentView mouseDragged:] +__ZN35WebNetscapePluginEventHandlerCarbon12mouseDraggedEP7NSEvent +-[WebNetscapePluginDocumentView mouseUp:] +__ZN35WebNetscapePluginEventHandlerCarbon7mouseUpEP7NSEvent +-[WebNetscapePluginDocumentView scrollWheel:] +__ZN35WebNetscapePluginEventHandlerCarbon11scrollWheelEP7NSEvent +-[WebNetscapePluginDocumentView mouseExited:] +__ZN35WebNetscapePluginEventHandlerCarbon11mouseExitedEP7NSEvent +-[WebBaseNetscapePluginView resignFirstResponder] +__ZN35WebNetscapePluginEventHandlerCarbon21removeKeyEventHandlerEv +-[WebNetscapePluginDocumentView mouseEntered:] +__ZN35WebNetscapePluginEventHandlerCarbon12mouseEnteredEP7NSEvent +__ZN15WebEditorClient17shouldDeleteRangeEPN7WebCore5RangeE +-[WebDefaultEditingDelegate webView:shouldDeleteDOMRange:] +__ZN15WebEditorClient28textWillBeDeletedInTextFieldEPN7WebCore7ElementE +WKSetPatternPhaseInUserSpace +NPN_GetURL +-[WebNetscapePluginDocumentView(WebNPPCallbacks) getURL:target:] +-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:] +-[WebNetscapePluginDocumentView(WebNPPCallbacks) loadPluginRequest:] +-[WebPluginRequest request] +-[WebPluginRequest frameName] +-[WebPluginRequest sendNotification] +-[WebPluginRequest dealloc] +-[WebNetscapePluginDocumentView flagsChanged:] +__ZN35WebNetscapePluginEventHandlerCarbon12flagsChangedEP7NSEvent +-[WebNetscapePluginDocumentView keyDown:] +__ZN35WebNetscapePluginEventHandlerCarbon7keyDownEP7NSEvent +WKSendKeyEventToTSM +__ZN35WebNetscapePluginEventHandlerCarbon15TSMEventHandlerEP25OpaqueEventHandlerCallRefP14OpaqueEventRefPv +-[WebNetscapePluginDocumentView keyUp:] +__ZN35WebNetscapePluginEventHandlerCarbon5keyUpEP7NSEvent +__ZN3WTF6VectorINS_6RefPtrI23WebNetscapePluginStreamEELm0EE14expandCapacityEm +__ZN3WTF6VectorINS_6RefPtrI23WebNetscapePluginStreamEELm0EE15reserveCapacityEm +__ZN23WebNetscapePluginStream4stopEv +__ZN23WebNetscapePluginStream35cancelLoadAndDestroyStreamWithErrorEP7NSError +__ZN23WebNetscapePluginStream19cancelLoadWithErrorEP7NSError +__ZN3WTF6VectorINS_6RefPtrI23WebNetscapePluginStreamEELm0EE6shrinkEm +-[WebBaseNetscapePluginView windowBecameKey:] +__ZN15WebEditorClient23textDidChangeInTextAreaEPN7WebCore7ElementE +__ZN15WebChromeClient14keyboardUIModeEv +-[WebView(WebViewInternal) _keyboardUIMode] +-[WebView(WebViewInternal) _retrieveKeyboardUIModeFromPreferences:] +-[WebPreferences tabsToLinks] +__ZNK15WebChromeClient11tabsToLinksEv +-[NSString(WebNSURLExtras) _webkit_stringByReplacingValidPercentEscapes] +-[WebFrame findFrameNamed:] +-[WebNetscapePluginDocumentView(WebNPPCallbacks) evaluateJavaScriptPluginRequest:] +-[WebPluginRequest isCurrentEventUserGesture] +__ZN15WebChromeClient16statusbarVisibleEv +__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selector +__ZL28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selector +-[WebFrame(WebPrivate) _isDescendantOfFrame:] +__ZN15WebEditorClient18shouldBeginEditingEPN7WebCore5RangeE +-[WebDefaultEditingDelegate webView:shouldBeginEditingInDOMRange:] +__ZN15WebEditorClient15didBeginEditingEv +__ZN15WebEditorClient16shouldEndEditingEPN7WebCore5RangeE +-[WebDefaultEditingDelegate webView:shouldEndEditingInDOMRange:] +__ZN15WebEditorClient13didEndEditingEv +__ZN15WebEditorClient25shouldShowDeleteInterfaceEPN7WebCore11HTMLElementE +-[WebDefaultEditingDelegate webView:shouldShowDeleteInterfaceForElement:] +__ZN15WebChromeClient20runJavaScriptConfirmEPN7WebCore5FrameERKNS0_6StringE +__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS4_ +__ZL28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selectorS2_S2_ +__ZN20WebFrameLoaderClient38dispatchDecidePolicyForNewWindowActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestEN3WTF10PassRefPtrINS0_9FormStateEEERKNS0_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] --[WebHistory orderedItemsLastVisitedOnDay:] --[WebHistoryPrivate orderedItemsLastVisitedOnDay:] --[WebHistoryItem icon] --[WebView(WebIBActions) goForward:] --[WebView goForward] +WKGetFontInLanguageForCharacter __ZN13WebDragClient24declareAndWriteDragImageEP12NSPasteboardP10DOMElementP5NSURLP8NSStringPN7WebCore5FrameE -__Z14getTopHTMLViewPN7WebCore5FrameE +__ZL14getTopHTMLViewPN7WebCore5FrameE -[DOMNode(WebDOMNodeOperations) webArchive] -+[WebArchiver archiveNode:] -+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:] --[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:] --[WebResource(WebResourcePrivate) _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:] --[WebResource init] --[DOMHTMLImageElement(WebDOMHTMLImageElementOperationsPrivate) _subresourceURLs] --[DOMNode(WebDOMNodeOperations) _URLsFromSelectors:] --[DOMDocument(WebDOMDocumentOperations) URLWithAttributeString:] --[WebDataSource subresourceForURL:] --[WebResource(WebResourcePrivate) _initWithData:URL:response:MIMEType:] --[WebArchive initWithMainResource:subresources:subframeArchives:] --[WebArchive init] +-[WebArchive(WebInternal) _initWithCoreLegacyWebArchive:] ++[WebArchivePrivate initialize] +-[WebArchivePrivate initWithCoreArchive:] -[NSPasteboard(WebExtras) _web_declareAndWriteDragImageForElement:URL:title:archive:source:] +[NSPasteboard(WebExtras) _web_writableTypesForImageIncludingArchive:] -__Z33_writableTypesForImageWithArchivev -__Z36_writableTypesForImageWithoutArchivev +__ZL33_writableTypesForImageWithArchivev +__ZL36_writableTypesForImageWithoutArchivev +[NSPasteboard(WebExtras) _web_writableTypesForURL] -[NSPasteboard(WebExtras) _web_writeImage:element:URL:title:archive:types:source:] -[NSPasteboard(WebExtras) _web_writeURL:andTitle:types:] +[WebURLsWithTitles writeURLs:andTitles:toPasteboard:] +[WebURLsWithTitles arrayWithIFURLsWithTitlesPboardType] -__Z16imageFromElementP10DOMElement -[WebHTMLView(WebInternal) setPromisedDragTIFFDataSource:] -__Z18promisedDataClientv -__ZN7WebCore20CachedResourceClient12imageChangedEPNS_11CachedImageE +__ZL18promisedDataClientv +__ZN7WebCore20CachedResourceClient12imageChangedEPNS_11CachedImageEPKNS_7IntRectE __ZN7WebCore20CachedResourceClient14notifyFinishedEPNS_14CachedResourceE -[WebArchive data] --[WebArchive _propertyListRepresentation] --[WebResource(WebResourcePrivate) _propertyListRepresentation] -+[WebResource(WebResourcePrivate) _propertyListsFromResources:] -_WKGetPreferredExtensionForMIMEType +-[WebArchivePrivate coreArchive] __ZN13WebDragClient27willPerformDragSourceActionEN7WebCore16DragSourceActionERKNS0_8IntPointEPNS0_9ClipboardE -[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:] __ZN13WebDragClient9startDragEN3WTF9RetainPtrI7NSImageEERKN7WebCore8IntPointES7_PNS4_9ClipboardEPNS4_5FrameEb @@ -1150,223 +1425,96 @@ __ZNK19WebPasteboardHelper25insertablePasteboardTypesEv -[WebView draggingUpdated:] -[WebView _shouldAutoscrollForDraggingInfo:] -[WebHTMLView draggedImage:movedTo:] +-[WebFrame(WebInternal) _dragSourceMovedTo:] -[WebView draggingExited:] -[WebHTMLView draggedImage:endedAt:operation:] +-[WebFrame(WebInternal) _dragSourceEndedAt:operation:] -[WebArchive dealloc] -[WebArchivePrivate dealloc] --[WebResource dealloc] --[WebResourcePrivate dealloc] --[WebView acceptsFirstResponder] --[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] +__ZN3WTF6VectorINS_6RefPtrIN7WebCore15ArchiveResourceEEELm0EE6shrinkEm +-[WebHTMLView(WebPrivate) pasteboardChangedOwner:] +__ZN20WebFrameLoaderClient22createJavaAppletWidgetERKN7WebCore7IntSizeEPNS0_7ElementERKNS0_4KURLERKN3WTF6VectorINS0_6StringELm0EEESE_ +__ZN20WebFrameLoaderClient10javaAppletEP6NSView +-[WebPluginController webPlugInContainerShowStatus:] +__ZN3WTF6VectorI6CGRectLm16EE14expandCapacityEm +__ZN3WTF6VectorI6CGRectLm16EE15reserveCapacityEm +-[WebIconDatabase iconURLForURL:] +-[WebHistoryItem(WebPrivate) RSSFeedReferrer] +__ZN15WebChromeClient7unfocusEv +-[WebDefaultUIDelegate webViewUnfocus:] +__ZN15WebChromeClient11canRunModalEv +-[WebViewFactory refreshPlugins] +__ZNK19WebPasteboardHelper17urlFromPasteboardEPK12NSPasteboardPN7WebCore6StringE +-[NSPasteboard(WebExtras) _web_bestURL] +-[WebView windowScriptObject] +-[WebView(WebIBActions) reload:] +-[WebFrame reload] +-[WebFramePolicyListener invalidate] +NPN_PushPopupsEnabledState +NPN_PopPopupsEnabledState +-[WebView(WebIBActions) goForward:] +-[WebView goForward] +__ZNK23WebNetscapePluginStream30pluginCancelledConnectionErrorEv +-[WebBaseNetscapePluginView windowDidMiniaturize:] +-[WebBaseNetscapePluginView windowDidDeminiaturize:] -[WebHTMLView(WebPrivate) pasteboard:provideDataForType:] -[WebHTMLView(WebInternal) promisedDragTIFFDataSource] -[WebArchive initWithData:] --[WebArchive _initWithPropertyList:] --[WebResource(WebResourcePrivate) _initWithPropertyList:] -+[WebResource(WebResourcePrivate) _resourcesFromPropertyLists:] +-[WebArchivePrivate init] +-[WebArchivePrivate setCoreArchive:] -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:] -[WebArchive subresources] +-[WebResource(WebResourceInternal) _initWithCoreResource:] ++[WebResourcePrivate initialize] +-[WebResourcePrivate initWithCoreResource:] -[WebArchive mainResource] -[WebResource MIMEType] -[WebResource(WebResourcePrivate) _fileWrapperRepresentation] +-[WebResource data] +-[WebResource(WebResourcePrivate) _suggestedFilename] -[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:] +-[WebResource dealloc] +-[WebResourcePrivate dealloc] +-[NSView(WebExtras) _web_parentWebFrameView] +-[WebView(WebPrivate) _loadBackForwardListFromOtherView:] +__ZL8hexDigiti +__ZN15WebChromeClient18runJavaScriptAlertEPN7WebCore5FrameERKNS0_6StringE -[WebIconDatabase releaseIconForURL:] -[NSView(WebExtras) _web_dragOperationForDraggingInfo:] --[WebHistory removeAllItems] --[WebHistoryPrivate removeAllItems] +-[WebElementDictionary _image] +-[WebHistoryItem hash] +-[NSEvent(WebExtras) _web_isDeleteKeyEvent] +-[NSEvent(WebExtras) _web_isKeyEvent:] +-[WebFrameView keyDown:] +-[WebFrameView(WebFrameViewFileInternal) _web_frame] +-[WebFrameView allowsScrolling] +-[WebFrameView _scrollLineHorizontally:] +-[WebFrameView _scrollOverflowInDirection:granularity:] +-[WebFrameView(WebPrivate) _hasScrollBars] +-[WebFrameView(WebPrivate) _largestChildWithScrollBars] +-[WebDataSource(WebPrivate) _mainDocumentError] +-[WebBackForwardList backListWithLimit:] +__ZL15vectorToNSArrayRN3WTF6VectorINS_6RefPtrIN7WebCore11HistoryItemEEELm0EEE +__ZN3WTF6VectorINS_6RefPtrIN7WebCore11HistoryItemEEELm0EE6shrinkEm +-[WebHistoryItem(WebPrivate) targetItem] +-[WebHistoryItem icon] +-[WebView goToBackForwardItem:] +-[WebViewFactory fileButtonChooseFileLabel] +[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] --[WebViewFactory contextMenuItemTagDownloadLinkToDisk] --[WebViewFactory contextMenuItemTagCopyLinkToClipboard] --[WebViewFactory contextMenuItemTagOpenImageInNewWindow] --[WebViewFactory contextMenuItemTagDownloadImageToDisk] --[WebViewFactory contextMenuItemTagCopyImageToClipboard] --[WebViewFactory contextMenuItemTagSearchInSpotlight] --[WebViewFactory contextMenuItemTagLookUpInDictionary] --[WebViewFactory contextMenuItemTagSearchWeb] --[WebViewFactory contextMenuItemTagCopy] --[WebViewFactory contextMenuItemTagGoBack] --[WebViewFactory contextMenuItemTagGoForward] --[WebViewFactory contextMenuItemTagStop] --[WebViewFactory contextMenuItemTagReload] --[WebViewFactory contextMenuItemTagOpenFrameInNewWindow] --[WebViewFactory contextMenuItemTagNoGuessesFound] --[WebViewFactory contextMenuItemTagIgnoreSpelling] --[WebViewFactory contextMenuItemTagLearnSpelling] --[WebViewFactory contextMenuItemTagIgnoreGrammar] --[WebViewFactory contextMenuItemTagCut] --[WebViewFactory contextMenuItemTagPaste] -__ZN20WebContextMenuClient29getCustomMenuFromDefaultItemsEPN7WebCore11ContextMenuE -__Z19isPreVersion3Clientv -__Z28isPreInspectElementTagClientv --[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] --[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] -+[NSPasteboard(WebExtras) _web_setFindPasteboardString:withOwner:] --[WebView(WebPendingPublic) searchFor:direction:caseSensitive:wrap:startInSelection:] --[WebView(WebFileInternal) _selectedOrMainFrame] -__Z14incrementFrameP8WebFrameaa --[WebHistory _itemForURLString:] --[WebView(WebPendingPublic) canMarkAllTextMatches] --[WebHistoryItem(WebPrivate) _lastVisitedDate] +-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:] +-[NSFileManager(WebNSFileManagerExtras) _webkit_pathWithUniqueFilenameForPath:] +-[NSString(WebKitExtras) _webkit_filenameByFixingIllegalCharacters] +-[WebView _autoscrollForDraggingInfo:timeDelta:] +WKSetPatternBaseCTM -[WebView prepareForDragOperation:] -[WebView performDragOperation:] __ZN13WebDragClient32willPerformDragDestinationActionEN7WebCore21DragDestinationActionEPNS0_8DragDataE -[WebDefaultUIDelegate webView:willPerformDragDestinationAction:forDraggingInfo:] --[NSString(WebKitExtras) _webkit_filenameByFixingIllegalCharacters] --[WebIconDatabase(WebInternal) _scaleIcon:toSize:] +-[NSEvent(WebExtras) _web_isReturnOrEnterKeyEvent] +-[WebHTMLRepresentation receivedError:withDataSource:] -[WebPDFRepresentation setDataSource:] -[WebPDFView initWithFrame:] +[WebPDFView(FileInternal) _PDFPreviewViewClass] @@ -1396,277 +1544,18 @@ __ZN13WebDragClient32willPerformDragDestinationActionEN7WebCore21DragDestination -[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] +-[WebPDFView selectionView] +-[WebPDFView hitTest:] ++[WebURLsWithTitles URLsFromPasteboard:] ++[WebView(WebPrivate) canShowFile:] ++[WebView(WebPrivate) _MIMETypeForFile:] -[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:] --[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 -__ZN15WebEditorClient25shouldShowDeleteInterfaceEPN7WebCore11HTMLElementE --[WebDefaultEditingDelegate webView:shouldShowDeleteInterfaceForElement:] --[WebDefaultEditingDelegate undoManagerForWebView:] -__ZN15WebEditorClient16shouldEndEditingEPN7WebCore5RangeE --[WebDefaultEditingDelegate webView:shouldEndEditingInDOMRange:] -__ZN15WebEditorClient13didEndEditingEv --[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 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] +__ZN13WebDragClient22createDragImageForLinkERN7WebCore4KURLERKNS0_6StringEPNS0_5FrameE +-[WebHTMLView(WebPrivate) _dragImageForURL:withLabel:] +-[NSString(WebKitExtras) _web_drawDoubledAtPoint:withTopColor:bottomColor:font:] ++[WebURLsWithTitles titlesFromPasteboard:] -[WebFrameView documentViewShouldHandlePrint] -[WebFrameView printOperationWithPrintInfo:] -[WebFrameView canPrintHeadersAndFooters] @@ -1678,25 +1567,92 @@ __ZN18WebInspectorClient11closeWindowEv -[NSPrintOperation(WebKitExtras) _web_pageSetupScaleFactor] -[WebView(WebViewPrintingPrivate) _headerHeight] __Z28CallUIDelegateReturningFloatP7WebViewP13objc_selector -__Z26CallDelegateReturningFloatP7WebViewP11objc_objectP13objc_selector +__ZL26CallDelegateReturningFloatP7WebViewP11objc_objectP13objc_selector -[WebView(WebViewPrintingPrivate) _footerHeight] -[WebHTMLView _scaleFactorForPrintOperation:] -[WebHTMLView(WebHTMLViewFileInternal) _calculatePrintHeight] +-[WebFrame(WebInternal) _computePageRectsWithPrintWidthScaleFactor:printHeight:] -[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 +__ZL12CallDelegateP7WebViewP11objc_objectP13objc_selector7_NSRect -[WebView(WebViewPrintingPrivate) _drawFooterInRect:] -_NPN_MemAlloc --[WebBaseNetscapePluginView fixWindowPort] -_WKCGContextIsBitmapContext -_WKCallDrawingNotification +-[WebHTMLView endDocument] +-[WebHTMLView _endPrintMode] +-[WebFrameView _horizontalKeyboardScrollDistance] +-[WebFrameView _scrollHorizontallyBy:] +-[WebFrameView scrollToEndOfDocument:] +-[WebFrameView _goForward] +-[WebFrameView _goBack] +-[WebHTMLView _wantsKeyDownForEvent:] +-[WebHTMLView(WebPrivate) _isEditable] +-[WebHTMLView(WebInternal) isGrammarCheckingEnabled] +-[WebHTMLView(WebDocumentPrivateProtocols) supportsTextEncoding] +-[WebView customTextEncodingName] +-[WebView _mainFrameOverrideEncoding] +__ZN20WebFrameLoaderClient38dispatchDidLoadResourceFromMemoryCacheEPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestERKNS0_16ResourceResponseEi +__ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_iS0_ +-[NSString(WebNSURLExtras) _webkit_looksLikeAbsoluteURL] +-[NSString(WebNSURLExtras) _webkit_rangeOfURLScheme] +__ZN20WebContextMenuClient18lookUpInDictionaryEPN7WebCore5FrameE +-[WebHTMLView(WebInternal) _lookUpInDictionaryFromMenu:] +-[WebHTMLView(WebDocumentPrivateProtocols) selectedAttributedString] +-[WebHTMLView(WebHTMLViewFileInternal) _selectedRange] +-[WebHTMLView(WebDocumentPrivateProtocols) _attributeStringFromDOMRange:] +-[WebView(WebPendingPublic) setHoverFeedbackSuspended:] +-[WebHTMLView(WebInternal) _hoverFeedbackSuspendedChanged] +-[WebView elementAtPoint:] +-[WebView _elementAtWindowPoint:] +-[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:] +-[WebPreferences userStyleSheetLocation] +-[WebView initWithCoder:] +-[WebFrameView initWithCoder:] +-[WebPreferences initWithCoder:] ++[WebPreferences(WebInternal) _concatenateKeyWithIBCreatorID:] +-[WebView setPreferences:] +-[WebPreferences setMinimumFontSize:] +-[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setInt:forKey:] +-[WebHTMLRepresentation documentSource] +-[WebFrame loadData:MIMEType:textEncodingName:baseURL:] +-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:] +-[WebDefaultEditingDelegate undoManagerForWebView:] ++[WebPreferences(WebPrivate) _checkLastReferenceForIdentifier:] +-[WebPreferences dealloc] +-[WebPreferencesPrivate dealloc] +-[WebHTMLRepresentation canSaveAsWebArchive] +-[WebFrame(WebInternal) _canSaveAsWebArchive] ++[WebView(WebPrivate) suggestedFileExtensionForMIMEType:] +WKGetPreferredExtensionForMIMEType +__ZN3WTF6VectorINS_6RefPtrIN7WebCore7ArchiveEEELm0EE6shrinkEm +-[WebNetscapePluginDocumentView(Internal) _printedPluginBitmap] +-[WebPreferences setShouldPrintBackgrounds:] +WKGetExtensionsForMIMEType +-[WebHistoryItem(WebPrivate) _lastVisitedDate] +-[WebPreferences init] +-[WebPreferences(WebPrivate) setApplicationChromeModeEnabled:] +-[WebPreferences setLoadsImagesAutomatically:] +-[WebPreferences(WebPrivate) setAuthorAndUserStylesEnabled:] +-[WebPreferences setJavaScriptEnabled:] +-[WebPreferences setAllowsAnimatedImages:] +-[WebPreferences setPlugInsEnabled:] +-[WebPreferences setJavaEnabled:] +-[WebPreferences setUserStyleSheetEnabled:] +-[WebPreferences setTabsToLinks:] +-[WebPreferences setMinimumLogicalFontSize:] +-[WebHistoryItem(WebPrivate) _setTransientProperty:forKey:] +-[WebHistoryItem(WebPrivate) _setLastVisitWasFailure:] +-[WebBackForwardList backItem] +-[WebFrame globalContext] +-[WebFrame windowObject] +WKAdvanceDefaultButtonPulseAnimation +-[WKAppKitDrawDecoyWindow isKeyWindow] +-[WebPDFView deselectAll] +-[WebPDFView viewState] +-[WebPDFView dealloc] __ZN20WebFrameLoaderClient41dispatchDidReceiveAuthenticationChallengeEPN7WebCore14DocumentLoaderEmRKNS0_23AuthenticationChallengeE +[WebPanelAuthenticationHandler sharedHandler] -[WebPanelAuthenticationHandler init] @@ -1712,22 +1668,27 @@ __ZN20WebFrameLoaderClient41dispatchDidReceiveAuthenticationChallengeEPN7WebCore -[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:] -[WebAuthenticationPanel dealloc] -[WebPanelAuthenticationHandler tryNextChallengeForWindow:] +-[WebAuthenticationPanel cancel:] ++[WebStringTruncator rightTruncateString:toWidth:withFont:] -[WebDownloadInternal download:shouldDecodeSourceDataOfMIMEType:] -__ZN20WebFrameLoaderClient20redirectDataToPluginEPN7WebCore6WidgetE --[WebFrameBridge redirectDataToPlugin:] --[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:] --[WebPluginController pluginView:receivedResponse:] --[WebPluginController pluginView:receivedError:] --[WebPluginController pluginView:receivedData:] -__ZN15WebChromeClient12canTakeFocusEN7WebCore14FocusDirectionE -__ZN15WebChromeClient9takeFocusEN7WebCore14FocusDirectionE --[WebView(WebViewInternal) _becomingFirstResponderFromOutside] +__ZN20WebFrameLoaderClient25pluginWillHandleLoadErrorERKN7WebCore16ResourceResponseE +WKDrawMediaUIPart +__Z24createCGImageRefFromDataPKhj +__Z14drawMediaImageP9CGContext6CGRectP7CGImage +WKDrawMediaSliderTrack +WKQTMovieMaxTimeLoaded +__ZN20WebContextMenuClient11downloadURLERKN7WebCore4KURLE +-[WebView(WebPrivate) _downloadURL:] +-[WebDownload _initWithRequest:delegate:directory:] +-[WebDownload initWithRequest:delegate:] +-[WebHTMLView validRequestorForSendType:returnType:] +-[WebHTMLView(WebDocumentPrivateProtocols) pasteboardTypesForSelection] +-[WebHTMLView(WebInternal) _canSmartCopyOrDelete] -[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:] @@ -1742,113 +1703,122 @@ __ZN15WebChromeClient9takeFocusEN7WebCore14FocusDirectionE -[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:] +-[WebPluginController destroyPlugin:] -[WebPreferences setStandardFontFamily:] -[WebPreferences _setStringValue:forKey:] -[WebPreferences setDefaultFontSize:] +-[WebPreferences setFixedFontFamily:] +-[WebPreferences setDefaultFixedFontSize:] -[WebPreferences setDefaultTextEncodingName:] +-[WebHTMLRepresentation currentForm] +[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:] -+[WebIconDatabase(WebPrivate) _checkIntegrityBeforeOpening] --[WebPDFRepresentation receivedError:withDataSource:] +-[WebPreferences(WebPrivate) setDeveloperExtrasEnabled:] +-[WebHTMLView(WebInternal) toggleGrammarChecking:] +-[WebView(WebViewGrammarChecking) toggleGrammarChecking:] +-[WebView(WebViewGrammarChecking) setGrammarCheckingEnabled:] +__ZN18WebInspectorClient19inspectedURLChangedERKN7WebCore6StringE +__ZNK18WebInspectorClient17updateWindowTitleEv +-[WebView(WebPendingPublic) zoomPageIn:] +-[WebView _zoomIn:isTextOnly:] +-[WebView(WebPendingPublic) zoomPageOut:] +-[WebView _zoomOut:isTextOnly:] +-[WebPreferences(WebPrivate) setZoomsTextOnly:] +-[WebView(WebIBActions) canMakeTextSmaller] +-[WebView(WebIBActions) makeTextSmaller:] +-[WebView(WebIBActions) canMakeTextLarger] +-[WebView(WebIBActions) makeTextLarger:] +-[WebView(WebPendingPublic) resetPageZoom:] +-[WebView _resetZoom:isTextOnly:] +-[WebView(WebIBActions) makeTextStandardSize:] +-[WebView setCustomTextEncodingName:] +-[WebView(WebPrivate) inspector] +-[WebInspector initWithWebView:] +-[WebInspector isDebuggingJavaScript] +-[WebInspector isProfilingJavaScript] +-[WebView customUserAgent] +-[WebView setCustomUserAgent:] +-[WebFrame reloadFromOrigin] +-[WebView setShouldCloseWithWindow:] +-[WebView(WebPrivate) setProhibitsMainFrameScrolling:] +-[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:] +-[WebFrame(WebPrivate) _setIsDisconnected:] +-[WebDefaultUIDelegate webViewFirstResponder:] +-[WebDefaultUIDelegate webView:didDrawRect:] +__ZN18WebInspectorClient11closeWindowEv +-[WebView(WebIBActions) _responderValidateUserInterfaceItem:] +-[WebView(WebFileInternal) _responderForResponderOperations] +-[NSView(WebExtras) _web_firstResponderIsSelfOrDescendantView] +-[WebViewFactory contextMenuItemTagInspectElement] +__ZN18WebInspectorClient10createPageEv +-[WebInspectorWindowController initWithInspectedWebView:] +-[WebInspectorWindowController init] +-[WebView setDrawsBackground:] +-[WebInspectorWindowController webView] +__ZN18WebInspectorClient19localizedStringsURLEv +__ZN18WebInspectorClient13hideHighlightEv +-[WebInspectorWindowController hideHighlight] +__ZN18WebInspectorClient10showWindowEv +-[WebInspectorWindowController window] +WKNSWindowMakeBottomCornersSquare +-[WebInspectorWindowController showWindow:] +-[WebInspectorWindowController setAttachedWindowHeight:] +__ZN18WebInspectorClient12attachWindowEv +-[WebInspectorWindowController attach] +__ZN18WebInspectorClient9highlightEPN7WebCore4NodeE +-[WebInspectorWindowController highlightNode:] +-[WebNodeHighlight initWithTargetView:inspectorController:] +-[WebNodeHighlight(FileInternal) _computeHighlightWindowFrame] +-[WebNodeHighlightView initWithWebNodeHighlight:] +-[WebNodeHighlightView isFlipped] +-[WebNodeHighlight setDelegate:] +-[WebNodeHighlight attach] +-[WebNodeHighlightView drawRect:] +-[WebNodeHighlight inspectorController] +-[WebInspectorWindowController didAttachWebNodeHighlight:] +-[WebView setCurrentNodeHighlight:] +-[WebView(WebPrivate) drawRect:] +-[WebNodeHighlight targetView] +-[WebNodeHighlight setNeedsUpdateInTargetViewRect:] +-[WebNodeHighlight detach] +-[WebInspectorWindowController willDetachWebNodeHighlight:] +-[WebNodeHighlightView detachFromWebNodeHighlight] +-[WebNodeHighlight dealloc] +-[WebNodeHighlightView dealloc] +-[WebDefaultUIDelegate webView:makeFirstResponder:] +-[WebNodeHighlight highlightView] +__ZN15WebEditorClient20checkGrammarOfStringEPKtiRN3WTF6VectorIN7WebCore13GrammarDetailELm0EEEPiS8_ +__ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EE14expandCapacityEmPKS2_ +__ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EE14expandCapacityEm +__ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EE15reserveCapacityEm +__ZN3WTF6VectorIN7WebCore6StringELm0EEC1ERKS3_ +__ZN18WebInspectorClient12detachWindowEv +-[WebInspectorWindowController detach] +-[WebInspectorWindowController close] +-[WebDefaultUIDelegate webViewFrame:] +-[WebDefaultUIDelegate webView:setFrame:] +-[WebDefaultUIDelegate webView:didScrollDocumentInFrameView:] +-[WebDefaultUIDelegate webViewFocus:] +-[WebInspectorWindowController windowShouldClose:] +-[WebInspector webViewClosed] +-[WebInspectorWindowController dealloc] +-[WebHistory removeAllItems] +-[WebHistoryPrivate removeAllItems] +-[WebIconDatabase(WebPendingPublic) removeAllIcons] +__ZN21WebIconDatabaseClient25dispatchDidRemoveAllIconsEv +-[WebIconDatabase(WebInternal) _sendDidRemoveAllIconsNotification] -[WebViewFactory resetButtonDefaultLabel] -_NPN_GetJavaEnv -_NPN_GetJavaPeer +-[WebViewFactory submitButtonDefaultLabel] +-[WebHTMLView selectAll:] +-[NSURL(WebNSURLExtras) _webkit_isJavaScriptURL] +-[WebViewFactory fileButtonNoFileSelectedLabel] +-[WebBackForwardList removeItem:] +-[WebViewFactory searchableIndexIntroduction] +__ZN15WebEditorClient26shouldMoveRangeAfterDeleteEPN7WebCore5RangeES2_ +-[WebDefaultEditingDelegate webView:shouldMoveRangeAfterDelete:replacingRange:] +__ZN3WTF6VectorIN7WebCore6StringELm0EE14expandCapacityEmPKS2_ +__ZN3WTF6VectorIN7WebCore6StringELm0EE14expandCapacityEm +__ZN3WTF6VectorIN7WebCore6StringELm0EE15reserveCapacityEm __ZNK15WebEditorClient7canUndoEv __ZN15WebEditorClient4undoEv -[WebEditorUndoTarget undoEditing:] @@ -1858,20 +1828,19 @@ __ZN15WebChromeClient5printEPN7WebCore5FrameE __ZNK15WebEditorClient7canRedoEv __ZN15WebEditorClient4redoEv -[WebEditorUndoTarget redoEditing:] --[WebFrameBridge customHighlightRect:forLine:representedNode:] +-[DOMDocument(WebDOMDocumentOperations) URLWithAttributeString:] +__ZN15WebChromeClient19customHighlightRectEPN7WebCore4NodeERKNS0_12AtomicStringERKNS0_9FloatRectE -[WebHTMLView(WebInternal) _highlighterForType:] --[WebFrameBridge paintCustomHighlight:forBox:onLine:behindText:entireLine:representedNode:] -_WKQTMovieViewSetDrawSynchronously --[WebViewFactory searchableIndexIntroduction] -_WKDrawMediaMuteButton -_drawMediaImage -_WKDrawMediaPlayButton -_WKDrawMediaSliderTrack -_WKDrawMediaSliderThumb -_WKDrawMediaSeekBackButton -_WKDrawMediaSeekForwardButton -_WKQTMovieMaxTimeLoaded -__ZN20WebFrameLoaderClient12blockedErrorERKN7WebCore15ResourceRequestE +__ZN15WebChromeClient20paintCustomHighlightEPN7WebCore4NodeERKNS0_12AtomicStringERKNS0_9FloatRectES8_bb +-[WebDefaultUIDelegate webViewClose:] +__ZN15WebChromeClient19runJavaScriptPromptEPN7WebCore5FrameERKNS0_6StringES5_RS3_ +__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_S4_ +__ZL12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_S2_ +-[WebJavaScriptTextInputPanel initWithPrompt:text:] +-[NSWindow(WebExtras) centerOverMainWindow] +-[NonBlockingPanel _blocksActionWhenModal:] +-[WebJavaScriptTextInputPanel pressedOK:] +-[WebJavaScriptTextInputPanel text] __ZN15WebChromeClient21exceededDatabaseQuotaEPN7WebCore5FrameERKNS0_6StringE -[WebSecurityOrigin(WebInternal) _initWithWebCoreSecurityOrigin:] -[WebSecurityOrigin quota] @@ -1881,19 +1850,14 @@ __ZN15WebChromeClient21exceededDatabaseQuotaEPN7WebCore5FrameERKNS0_6StringE __ZN24WebDatabaseTrackerClient23dispatchDidModifyOriginEPN7WebCore14SecurityOriginE -[WebSecurityOrigin dealloc] __ZN24WebDatabaseTrackerClient25dispatchDidModifyDatabaseEPN7WebCore14SecurityOriginERKNS0_6StringE -_WKReleaseStyleGroup --[WebKeyGenerator strengthMenuItemTitles] -__ZN15WebChromeClient20runJavaScriptConfirmEPN7WebCore5FrameERKNS0_6StringE +__ZN15WebChromeClient8runModalEv +__Z14CallUIDelegateP7WebViewP13objc_selector +__ZL12CallDelegateP7WebViewP11objc_objectP13objc_selector +__ZN20WebFrameLoaderClient12blockedErrorERKN7WebCore15ResourceRequestE +__ZN15WebChromeClient17scrollbarsVisibleEv __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:] +-[WebKeyGenerator strengthMenuItemTitles] +__ZN15WebChromeClient12canTakeFocusEN7WebCore14FocusDirectionE +__ZN15WebChromeClient9takeFocusEN7WebCore14FocusDirectionE +-[WebView(WebViewInternal) _becomingFirstResponderFromOutside] diff --git a/WebKit/mac/WebKitPrefix.h b/WebKit/mac/WebKitPrefix.h index da2f2d4..3e26ab4 100644 --- a/WebKit/mac/WebKitPrefix.h +++ b/WebKit/mac/WebKitPrefix.h @@ -77,6 +77,10 @@ typedef float CGFloat; #include "EmptyProtocolDefinitions.h" +#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && defined(__x86_64__) +#define WTF_USE_PLUGIN_HOST_PROCESS 1 +#endif + #include <wtf/Platform.h> /* WebKit has no way to pull settings from WebCore/config.h for now */ diff --git a/WebKit/mac/WebView/WebArchive.mm b/WebKit/mac/WebView/WebArchive.mm index c989a9a..c6cc9b1 100644 --- a/WebKit/mac/WebView/WebArchive.mm +++ b/WebKit/mac/WebView/WebArchive.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 @@ -30,12 +30,13 @@ #import "WebArchiveInternal.h" #import "WebKitLogging.h" +#import "WebNSObjectExtras.h" #import "WebResourceInternal.h" -#import "WebResourcePrivate.h" #import "WebTypesInternal.h" - +#import <JavaScriptCore/InitializeThreading.h> #import <WebCore/ArchiveResource.h> #import <WebCore/LegacyWebArchive.h> +#import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> using namespace WebCore; @@ -46,8 +47,7 @@ static NSString * const WebMainResourceKey = @"WebMainResource"; static NSString * const WebSubresourcesKey = @"WebSubresources"; static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; -@interface WebArchivePrivate : NSObject -{ +@interface WebArchivePrivate : NSObject { @public WebResource *cachedMainResource; NSArray *cachedSubresources; @@ -63,18 +63,20 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; @implementation WebArchivePrivate -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - (id)init { self = [super init]; - if (self) - coreArchive = LegacyWebArchive::create().releaseRef(); + if (!self) + return nil; + coreArchive = LegacyWebArchive::create().releaseRef(); return self; } @@ -85,9 +87,7 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; [self release]; return nil; } - coreArchive = _coreArchive.releaseRef(); - return self; } @@ -100,7 +100,8 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; { ASSERT(coreArchive); ASSERT(newCoreArchive); - coreArchive->deref(); + if (coreArchive) + coreArchive->deref(); coreArchive = newCoreArchive.releaseRef(); } @@ -109,9 +110,10 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; if (WebCoreObjCScheduleDeallocateOnMainThread([WebArchivePrivate class], self)) return; - ASSERT(coreArchive); - coreArchive->deref(); - coreArchive = 0; + if (coreArchive) { + coreArchive->deref(); + coreArchive = 0; + } [cachedMainResource release]; [cachedSubresources release]; @@ -122,9 +124,10 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; - (void)finalize { - ASSERT(coreArchive); - coreArchive->deref(); - coreArchive = 0; + if (coreArchive) { + coreArchive->deref(); + coreArchive = 0; + } [super finalize]; } @@ -135,6 +138,8 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; - (id)init { + WebCoreThreadViolationCheck(); + self = [super init]; if (!self) return nil; @@ -156,6 +161,13 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (id)initWithMainResource:(WebResource *)mainResource subresources:(NSArray *)subresources subframeArchives:(NSArray *)subframeArchives { +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives]; +#endif + + WebCoreThreadViolationCheck(); + self = [super init]; if (!self) return nil; @@ -207,6 +219,8 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (id)initWithData:(NSData *)data { + WebCoreThreadViolationCheck(); + self = [super init]; if (!self) return nil; @@ -216,7 +230,13 @@ static BOOL isArrayOfClass(id object, Class elementClass) #endif _private = [[WebArchivePrivate alloc] init]; - [_private setCoreArchive:LegacyWebArchive::create(SharedBuffer::wrapNSData(data).get())]; + RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::create(SharedBuffer::wrapNSData(data).get()); + if (!coreArchive) { + [self release]; + return nil; + } + + [_private setCoreArchive:coreArchive.release()]; #if !LOG_DISABLED CFAbsoluteTime end = CFAbsoluteTimeGetCurrent(); @@ -271,6 +291,13 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (WebResource *)mainResource { +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] mainResource]; +#endif + + WebCoreThreadViolationCheck(); + // 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) { @@ -284,6 +311,13 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (NSArray *)subresources { +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] subresources]; +#endif + + WebCoreThreadViolationCheck(); + // 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) { @@ -309,6 +343,13 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (NSArray *)subframeArchives { +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] subframeArchives]; +#endif + + WebCoreThreadViolationCheck(); + // 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) { @@ -332,6 +373,8 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (NSData *)data { + WebCoreThreadViolationCheck(); + #if !LOG_DISABLED CFAbsoluteTime start = CFAbsoluteTimeGetCurrent(); #endif @@ -353,6 +396,8 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (id)_initWithCoreLegacyWebArchive:(PassRefPtr<WebCore::LegacyWebArchive>)coreLegacyWebArchive { + WebCoreThreadViolationCheck(); + self = [super init]; if (!self) return nil; @@ -368,6 +413,8 @@ static BOOL isArrayOfClass(id object, Class elementClass) - (WebCore::LegacyWebArchive *)_coreLegacyWebArchive { + WebCoreThreadViolationCheck(); + return [_private coreArchive]; } diff --git a/WebKit/mac/WebView/WebDataSource.mm b/WebKit/mac/WebView/WebDataSource.mm index aeff7d7..12afcb3 100644 --- a/WebKit/mac/WebView/WebDataSource.mm +++ b/WebKit/mac/WebView/WebDataSource.mm @@ -46,7 +46,6 @@ #import "WebPDFRepresentation.h" #import "WebResourceInternal.h" #import "WebResourceLoadDelegate.h" -#import "WebResourcePrivate.h" #import "WebViewInternal.h" #import <WebCore/ApplicationCacheStorage.h> #import <WebCore/FrameLoader.h> @@ -59,6 +58,7 @@ #import <WebCore/WebCoreURLResponse.h> #import <WebKit/DOMHTML.h> #import <WebKit/DOMPrivate.h> +#import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> using namespace WebCore; @@ -75,12 +75,13 @@ using namespace WebCore; @implementation WebDataSourcePrivate -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - (void)dealloc { diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.m b/WebKit/mac/WebView/WebDynamicScrollBarsView.m index 1eb2d80..de19ef6 100644 --- a/WebKit/mac/WebView/WebDynamicScrollBarsView.m +++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.m @@ -224,6 +224,12 @@ const int WebCoreScrollbarAlwaysOn = ScrollbarAlwaysOn; [self setScrollingModes:[self horizontalScrollingMode] vertical:verticalMode andLock:lock]; } +// Mail uses this method, so we cannot remove it. +- (void)setVerticalScrollingMode:(ScrollbarMode)verticalMode +{ + [self setScrollingModes:[self horizontalScrollingMode] vertical:verticalMode andLock:NO]; +} + - (void)setScrollingModes:(ScrollbarMode)horizontalMode vertical:(ScrollbarMode)verticalMode andLock:(BOOL)lock { BOOL update = NO; diff --git a/WebKit/mac/WebView/WebFrame.h b/WebKit/mac/WebView/WebFrame.h index e435087..a6cdebb 100644 --- a/WebKit/mac/WebView/WebFrame.h +++ b/WebKit/mac/WebView/WebFrame.h @@ -165,10 +165,17 @@ /*! @method reload + @discussion Performs HTTP/1.1 end-to-end revalidation using cache-validating conditionals if possible. */ - (void)reload; /*! + @method reloadFromOrigin + @discussion Performs HTTP/1.1 end-to-end reload. +*/ +- (void)reloadFromOrigin; + +/*! @method findFrameNamed: @discussion This method returns a frame with the given name. findFrameNamed returns self for _self and _current, the parent frame for _parent and the main frame for _top. diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm index 13a6ad4..0ac300e 100644 --- a/WebKit/mac/WebView/WebFrame.mm +++ b/WebKit/mac/WebView/WebFrame.mm @@ -45,11 +45,13 @@ #import "WebHTMLViewInternal.h" #import "WebIconFetcherInternal.h" #import "WebKitStatisticsPrivate.h" +#import "WebKitVersionChecks.h" #import "WebNSURLExtras.h" #import "WebScriptDebugger.h" #import "WebViewInternal.h" #import <JavaScriptCore/APICast.h> #import <WebCore/AccessibilityObject.h> +#import <WebCore/AnimationController.h> #import <WebCore/AXObjectCache.h> #import <WebCore/ColorMac.h> #import <WebCore/DOMImplementation.h> @@ -71,14 +73,16 @@ #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/ScriptValue.h> #import <WebCore/markup.h> #import <WebCore/visible_units.h> #import <runtime/JSLock.h> +#import <runtime/JSValue.h> +#include <wtf/CurrentTime.h> using namespace std; using namespace WebCore; @@ -86,7 +90,7 @@ using namespace HTMLNames; using JSC::JSGlobalObject; using JSC::JSLock; -using JSC::JSValue; +using JSC::JSValuePtr; /* Here is the current behavior matrix for four types of navigations: @@ -184,11 +188,6 @@ DOMNode *kit(Node* node) return [DOMNode _wrapNode:node]; } -DOMNode *kit(PassRefPtr<Node> node) -{ - return [DOMNode _wrapNode:node.get()]; -} - Document* core(DOMDocument *document) { return [document _document]; @@ -247,6 +246,20 @@ EditableLinkBehavior core(WebKitEditableLinkBehavior editableLinkBehavior) return EditableLinkDefaultBehavior; } +TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior behavior) +{ + switch (behavior) { + case WebTextDirectionSubmenuNeverIncluded: + return TextDirectionSubmenuNeverIncluded; + case WebTextDirectionSubmenuAutomaticallyIncluded: + return TextDirectionSubmenuAutomaticallyIncluded; + case WebTextDirectionSubmenuAlwaysIncluded: + return TextDirectionSubmenuAlwaysIncluded; + } + ASSERT_NOT_REACHED(); + return TextDirectionSubmenuNeverIncluded; +} + @implementation WebFrame (WebInternal) Frame* core(WebFrame *frame) @@ -373,8 +386,8 @@ WebView *getWebView(WebFrame *webFrame) Frame* coreFrame = _private->coreFrame; for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { 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. + // Don't call setDrawsBackground:YES here because it may be NO because of a load + // in progress; WebFrameLoaderClient keeps it set to NO during the load process. if (!drawsBackground) [[[webFrame frameView] _scrollView] setDrawsBackground:NO]; [[[webFrame frameView] _scrollView] setBackgroundColor:backgroundColor]; @@ -536,25 +549,17 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (NSString *)_selectedString { - String text = _private->coreFrame->selectedText(); - text.replace('\\', _private->coreFrame->backslashAsCurrencySymbol()); - return text; + return _private->coreFrame->displayStringModifiedByEncoding(_private->coreFrame->selectedText()); } - (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); + UChar* buf = plainTextToMallocAllocatedBuffer([range _range], length, true); 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]; @@ -639,7 +644,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) { ASSERT(_private->coreFrame->document()); - JSValue* result = _private->coreFrame->loader()->executeScript(string, forceUserGesture); + JSValuePtr result = _private->coreFrame->loader()->executeScript(string, forceUserGesture).jsValue(); if (!_private->coreFrame) // In case the script removed our frame from the page. return @""; @@ -647,17 +652,17 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) // 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()) + if (!result || !result.isBoolean() && !result.isString() && !result.isNumber()) return @""; JSLock lock(false); - return String(result->toString(_private->coreFrame->script()->globalObject()->globalExec())); + 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(); + return visiblePosition.absoluteCaretBounds(); } - (NSRect)_firstRectForDOMRange:(DOMRange *)range @@ -684,6 +689,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (id)_accessibilityTree { +#if HAVE(ACCESSIBILITY) if (!AXObjectCache::accessibilityEnabled()) { AXObjectCache::enableAccessibility(); if ([[NSApp accessibilityAttributeValue:NSAccessibilityEnhancedUserInterfaceAttribute] boolValue]) @@ -696,6 +702,9 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) if (!root) return nil; return _private->coreFrame->document()->axObjectCache()->get(root)->wrapper(); +#else + return nil; +#endif } - (DOMRange *)_rangeByAlteringCurrentSelection:(SelectionController::EAlteration)alteration direction:(SelectionController::EDirection)direction granularity:(TextGranularity)granularity @@ -760,11 +769,23 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) return TextIterator::rangeFromLocationAndLength(scope, nsrange.location, nsrange.length); } +- (DOMRange *)convertNSRangeToDOMRange:(NSRange)nsrange +{ + // This method exists to maintain compatibility with Leopard's Dictionary.app. <rdar://problem/6002160> + return [self _convertNSRangeToDOMRange:nsrange]; +} + - (DOMRange *)_convertNSRangeToDOMRange:(NSRange)nsrange { return [DOMRange _wrapRange:[self _convertToDOMRange:nsrange].get()]; } +- (NSRange)convertDOMRangeToNSRange:(DOMRange *)range +{ + // This method exists to maintain compatibility with Leopard's Dictionary.app. <rdar://problem/6002160> + return [self _convertDOMRangeToNSRange:range]; +} + - (NSRange)_convertDOMRangeToNSRange:(DOMRange *)range { return [self _convertToNSRange:[range _range]]; @@ -1008,13 +1029,15 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (BOOL)_canProvideDocumentSource { - String mimeType = _private->coreFrame->loader()->responseMIMEType(); - + Frame* frame = _private->coreFrame; + String mimeType = frame->loader()->responseMIMEType(); + PluginData* pluginData = frame->page() ? frame->page()->pluginData() : 0; + if (WebCore::DOMImplementation::isTextMIMEType(mimeType) || Image::supportsType(mimeType) || - (_private->coreFrame->page() && _private->coreFrame->page()->pluginData()->supportsMimeType(mimeType))) + (pluginData && pluginData->supportsMimeType(mimeType))) return NO; - + return YES; } @@ -1147,6 +1170,53 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) } #endif +- (BOOL)_pauseAnimation:(NSString*)name onNode:(DOMNode *)node atTime:(NSTimeInterval)time +{ + Frame* frame = core(self); + if (!frame) + return false; + + AnimationController* controller = frame->animation(); + if (!controller) + return false; + + Node* coreNode = [node _node]; + if (!coreNode || !coreNode->renderer()) + return false; + + return controller->pauseAnimationAtTime(coreNode->renderer(), name, time); +} + +- (BOOL)_pauseTransitionOfProperty:(NSString*)name onNode:(DOMNode*)node atTime:(NSTimeInterval)time +{ + Frame* frame = core(self); + if (!frame) + return false; + + AnimationController* controller = frame->animation(); + if (!controller) + return false; + + Node* coreNode = [node _node]; + if (!coreNode || !coreNode->renderer()) + return false; + + return controller->pauseTransitionAtTime(coreNode->renderer(), name, time); +} + +- (unsigned) _numberOfActiveAnimations +{ + Frame* frame = core(self); + if (!frame) + return false; + + AnimationController* controller = frame->animation(); + if (!controller) + return false; + + return controller->numberOfActiveAnimations(); +} + @end @implementation WebFrame @@ -1238,7 +1308,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (void)loadRequest:(NSURLRequest *)request { - _private->coreFrame->loader()->load(request); + _private->coreFrame->loader()->load(request, false); } static NSURL *createUniqueWebDataURL() @@ -1266,7 +1336,7 @@ static NSURL *createUniqueWebDataURL() SubstituteData substituteData(WebCore::SharedBuffer::wrapNSData(data), MIMEType, encodingName, [unreachableURL absoluteURL], responseURL); - _private->coreFrame->loader()->load(request, substituteData); + _private->coreFrame->loader()->load(request, substituteData, false); } @@ -1308,7 +1378,16 @@ static NSURL *createUniqueWebDataURL() - (void)reload { - _private->coreFrame->loader()->reload(); + if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_RELOAD_FROM_ORIGIN) && + [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Safari"]) + _private->coreFrame->loader()->reload(GetCurrentKeyModifiers() & shiftKey); + else + _private->coreFrame->loader()->reload(false); +} + +- (void)reloadFromOrigin +{ + _private->coreFrame->loader()->reload(true); } - (WebFrame *)findFrameNamed:(NSString *)name diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h index 5cf7690..fa17ed9 100644 --- a/WebKit/mac/WebView/WebFrameInternal.h +++ b/WebKit/mac/WebView/WebFrameInternal.h @@ -91,6 +91,7 @@ WebCore::Page* core(WebView *); WebView *kit(WebCore::Page*); WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior); +WebCore::TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior); WebView *getWebView(WebFrame *webFrame); diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h index 428c142..2ea686e 100644 --- a/WebKit/mac/WebView/WebFramePrivate.h +++ b/WebKit/mac/WebView/WebFramePrivate.h @@ -35,6 +35,7 @@ #define ENABLE_NETSCAPE_PLUGIN_API 1 #endif +@class DOMNode; @class WebIconFetcher; @class WebScriptObject; @@ -51,8 +52,9 @@ typedef enum { WebFrameLoadTypeReload, WebFrameLoadTypeReloadAllowingStaleData, WebFrameLoadTypeSame, // user loads same URL again (but not reload button) - WebFrameLoadTypeInternal, // maps to WebCore::FrameLoadTypeRedirectWithLockedHistory - WebFrameLoadTypeReplace + WebFrameLoadTypeInternal, // maps to WebCore::FrameLoadTypeRedirectWithLockedBackForwardList + WebFrameLoadTypeReplace, + WebFrameLoadTypeReloadFromOrigin } WebFrameLoadType; @interface WebFrame (WebPrivate) @@ -84,4 +86,13 @@ typedef enum { - (void)_recursive_pauseNullEventsForAllNetscapePlugins; #endif +// Pause a given CSS animation or transition on the target node at a specific time. +// If the animation or transition is already paused, it will update its pause time. +// This method is only intended to be used for testing the CSS animation and transition system. +- (BOOL)_pauseAnimation:(NSString*)name onNode:(DOMNode *)node atTime:(NSTimeInterval)time; +- (BOOL)_pauseTransitionOfProperty:(NSString*)name onNode:(DOMNode*)node atTime:(NSTimeInterval)time; + +// Returns the total number of currently running animations (includes both CSS transitions and CSS animations). +- (unsigned) _numberOfActiveAnimations; + @end diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm index e9c0aae..132fb93 100644 --- a/WebKit/mac/WebView/WebFrameView.mm +++ b/WebKit/mac/WebView/WebFrameView.mm @@ -189,11 +189,10 @@ enum { - (WebDynamicScrollBarsView *)_scrollView { - // this can be called by [super dealloc] when cleaning up the keyview loop, + // This can be called by [super dealloc] when cleaning up the key view loop, // after _private has been nilled out. - if (_private == nil) { + if (_private == nil) return nil; - } return _private->frameScrollView; } @@ -300,9 +299,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl didFirstTimeInitialization = true; InitWebCoreSystemInterface(); - // Need to tell WebCore what function to call for the - // "History Item has Changed" notification - // Note: We also do this in WebHistoryItem's init method + // Need to tell WebCore what function to call for the "History Item has Changed" notification. + // Note: We also do this in WebHistoryItem's init method. WebCore::notifyHistoryItemChanged = WKNotifyHistoryItemChanged; [WebViewFactory createSharedFactory]; @@ -310,9 +308,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set - // to NO, or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are OFF by - // default. + // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is NO + // or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are off by default. if (![defaults boolForKey:WebKitEnableDeferredUpdatesPreferenceKey]) WKDisableCGDeferredUpdates(); @@ -322,7 +319,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl _private = [[WebFrameViewPrivate alloc] init]; - WebDynamicScrollBarsView *scrollView = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, frame.size.width, frame.size.height)]; + WebDynamicScrollBarsView *scrollView = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, frame.size.width, frame.size.height)]; _private->frameScrollView = scrollView; [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]]; [scrollView setDrawsBackground:NO]; @@ -331,9 +328,10 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [scrollView setLineScroll:40.0f]; [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. + + // Don't call our overridden version of setNextKeyView 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]; ++WebFrameViewCount; @@ -396,29 +394,22 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl // the key loop similar to the way NSScrollView does this. Note that // WebView has similar code. - // If the scrollView won't accept first-responderness now, then we just become - // the first responder ourself like a normal view. This lets us be the first - // responder in cases where no page has yet been loaded (see 3469791). - if ([[self _scrollView] acceptsFirstResponder]) { - NSWindow *window = [self window]; - if ([window keyViewSelectionDirection] == NSSelectingPrevious) { - NSView *previousValidKeyView = [self previousValidKeyView]; - // If we couldn't find a previous valid key view, ask the webview. This handles frameset - // cases like 3748628. Note that previousValidKeyView should never be self but can be - // due to AppKit oddness (mentioned in 3748628). - if (previousValidKeyView == nil || previousValidKeyView == self) { - previousValidKeyView = [[[self webFrame] webView] previousValidKeyView]; - } - // I don't know if the following cases ever occur anymore, but I'm leaving in the old test for - // now to avoid causing trouble just before shipping Tiger. - ASSERT((previousValidKeyView != self) && (previousValidKeyView != [self _scrollView])); - if ((previousValidKeyView != self) && (previousValidKeyView != [self _scrollView])) { - [window makeFirstResponder:previousValidKeyView]; - } - } else { + NSWindow *window = [self window]; + if ([window keyViewSelectionDirection] == NSSelectingPrevious) { + NSView *previousValidKeyView = [self previousValidKeyView]; + // If we couldn't find a previous valid key view, ask the WebView. This handles frameset + // cases (one is mentioned in Radar bug 3748628). Note that previousValidKeyView should + // never be self but can be due to AppKit oddness (mentioned in Radar bug 3748628). + if (previousValidKeyView == nil || previousValidKeyView == self) + previousValidKeyView = [[[self webFrame] webView] previousValidKeyView]; + [window makeFirstResponder:previousValidKeyView]; + } else { + // If the scroll view won't accept first-responderness now, then just become + // the first responder ourself like a normal view. This lets us be the first + // responder in cases where no page has yet been loaded. + if ([[self _scrollView] acceptsFirstResponder]) [window makeFirstResponder:[self _scrollView]]; - } - } + } return YES; } @@ -491,12 +482,21 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl - (void)setFrameSize:(NSSize)size { - if (!NSEqualSizes(size, [self frame].size) && [[[self webFrame] webView] drawsBackground]) { + // See WebFrameLoaderClient::provisionalLoadStarted. + if (!NSEqualSizes(size, [self frame].size) && [[[self webFrame] webView] drawsBackground]) [[self _scrollView] setDrawsBackground:YES]; - } [super setFrameSize:size]; } +- (void)viewDidMoveToWindow +{ + // See WebFrameLoaderClient::provisionalLoadStarted. + // Need to check _private for nil because this can be called inside -[WebView initWithCoder:]. + if (_private && [[[self webFrame] webView] drawsBackground]) + [[self _scrollView] setDrawsBackground:YES]; + [super viewDidMoveToWindow]; +} + - (BOOL)_scrollOverflowInDirection:(ScrollDirection)direction granularity:(ScrollGranularity)granularity { // scrolling overflows is only applicable if we're dealing with an WebHTMLView diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm index 4b4d11e..604a17a 100644 --- a/WebKit/mac/WebView/WebHTMLRepresentation.mm +++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm @@ -39,7 +39,6 @@ #import "WebKitStatisticsPrivate.h" #import "WebNSAttributedStringExtras.h" #import "WebNSObjectExtras.h" -#import "WebResourcePrivate.h" #import "WebView.h" #import <Foundation/NSURLResponse.h> #import <WebCore/Document.h> @@ -55,6 +54,7 @@ #import <WebCore/TextResourceDecoder.h> #import <WebKit/DOMHTMLInputElement.h> #import <wtf/Assertions.h> +#import <wtf/StdLibExtras.h> using namespace WebCore; using namespace HTMLNames; @@ -92,22 +92,19 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second) + (NSArray *)supportedMIMETypes { - static RetainPtr<NSArray> staticSupportedMIMETypes = - concatenateArrays([self supportedNonImageMIMETypes], [self supportedImageMIMETypes]); + DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, staticSupportedMIMETypes, (concatenateArrays([self supportedNonImageMIMETypes], [self supportedImageMIMETypes]))); return staticSupportedMIMETypes.get(); } + (NSArray *)supportedNonImageMIMETypes { - static RetainPtr<NSArray> staticSupportedNonImageMIMETypes = - stringArray(MIMETypeRegistry::getSupportedNonImageMIMETypes()); + DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, staticSupportedNonImageMIMETypes, (stringArray(MIMETypeRegistry::getSupportedNonImageMIMETypes()))); return staticSupportedNonImageMIMETypes.get(); } + (NSArray *)supportedImageMIMETypes { - static RetainPtr<NSArray> staticSupportedImageMIMETypes = - stringArray(MIMETypeRegistry::getSupportedImageMIMETypes()); + DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, staticSupportedImageMIMETypes, (stringArray(MIMETypeRegistry::getSupportedImageMIMETypes()))); return staticSupportedImageMIMETypes.get(); } diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 4d9b3a8..be4d8db 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -32,7 +32,7 @@ #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebArchive.h" -#import "WebBaseNetscapePluginView.h" +#import "WebNetscapePluginView.h" #import "WebClipView.h" #import "WebDOMOperationsPrivate.h" #import "WebDataSourceInternal.h" @@ -112,6 +112,7 @@ #import <WebKit/DOMPrivate.h> #import <WebKitSystemInterface.h> #import <limits> +#import <runtime/InitializeThreading.h> using namespace WebCore; using namespace HTMLNames; @@ -380,7 +381,7 @@ struct WebHTMLViewInterpretKeyEventsParameters { NSEvent *keyDownEvent; // Kept after handling the event. NSSize lastLayoutSize; - + NSPoint lastScrollPosition; WebPluginController *pluginController; @@ -393,22 +394,23 @@ struct WebHTMLViewInterpretKeyEventsParameters { NSTimer *autoscrollTimer; NSEvent *autoscrollTriggerEvent; - NSArray* pageRects; + NSArray *pageRects; - NSMutableDictionary* highlighters; + NSMutableDictionary *highlighters; - BOOL resigningFirstResponder; +#ifdef BUILDING_ON_TIGER BOOL nextResponderDisabledOnce; +#endif WebTextCompleteController *compController; BOOL transparentBackground; - WebHTMLViewInterpretKeyEventsParameters *interpretKeyEventsParameters; + WebHTMLViewInterpretKeyEventsParameters* interpretKeyEventsParameters; BOOL receivedNOOP; WebDataSource *dataSource; - WebCore::CachedImage *promisedDragTIFFDataSource; + WebCore::CachedImage* promisedDragTIFFDataSource; CFRunLoopTimerRef updateFocusedAndActiveStateTimer; CFRunLoopTimerRef updateMouseoverTimer; @@ -440,6 +442,7 @@ static NSCellStateValue kit(TriState state) + (void)initialize { + JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif @@ -661,13 +664,15 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) subresources:0])) return fragment; +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) if ([types containsObject:NSPICTPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSPICTPboardType inContext:context subresources:0])) return fragment; - +#endif + // 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] && @@ -1018,6 +1023,14 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) userInfo:[NSDictionary dictionaryWithObject:fakeEvent forKey:@"NSEvent"]]; } +- (id)_bridge +{ + // This method exists to maintain compatibility with Leopard's Dictionary.app, since it + // calls _bridge to get access to convertNSRangeToDOMRange: and convertDOMRangeToNSRange:. + // Return the WebFrame, which implements the compatibility methods. <rdar://problem/6002160> + return [self _frame]; +} + - (void)_updateMouseoverWithFakeEvent { [self _cancelUpdateMouseoverTimer]; @@ -1464,10 +1477,11 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) { static NSArray *types = nil; if (!types) { - types = [[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, - NSFilenamesPboardType, NSTIFFPboardType, NSPICTPboardType, NSURLPboardType, - NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, - kUTTypePNG, nil]; + types = [[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) + NSPICTPboardType, +#endif + NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, kUTTypePNG, nil]; CFRetain(types); } return types; @@ -1517,7 +1531,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease]; [dragImage lockFocus]; - [[NSColor colorWithCalibratedRed: 0.7f green: 0.7f blue: 0.7f alpha: 0.8f] set]; + [[NSColor colorWithDeviceRed: 0.7f green: 0.7f blue: 0.7f alpha: 0.8f] set]; // Drag a rectangle with rounded corners/ NSBezierPath *path = [NSBezierPath bezierPath]; @@ -1531,8 +1545,8 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) [path appendBezierPathWithRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS - 20.0f, DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 20.0f, imageSize.height - 2.0f * DRAG_LABEL_RADIUS)]; [path fill]; - NSColor *topColor = [NSColor colorWithCalibratedWhite:0.0f alpha:0.75f]; - NSColor *bottomColor = [NSColor colorWithCalibratedWhite:1.0f alpha:0.5f]; + NSColor *topColor = [NSColor colorWithDeviceWhite:0.0f alpha:0.75f]; + NSColor *bottomColor = [NSColor colorWithDeviceWhite:1.0f alpha:0.5f]; if (drawURLString) { if (clipURLString) urlString = [WebStringTruncator centerTruncateString: urlString toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2.0f) withFont:urlFont]; @@ -1931,6 +1945,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) [resource release]; return fragment; } +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) if (pboardType == NSPICTPboardType) { WebResource *resource = [[WebResource alloc] initWithData:[pasteboard dataForType:NSPICTPboardType] URL:uniqueURLWithRelativePart(@"image.pict") @@ -1941,6 +1956,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) [resource release]; return fragment; } +#endif // 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]) { @@ -2071,6 +2087,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) { [NSApp registerServicesMenuSendTypes:[[self class] _selectionPasteboardTypes] returnTypes:[[self class] _insertablePasteboardTypes]]; + JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif @@ -2219,6 +2236,9 @@ WEBCORE_COMMAND(insertNewlineIgnoringFieldEditor) WEBCORE_COMMAND(insertParagraphSeparator) WEBCORE_COMMAND(insertTab) WEBCORE_COMMAND(insertTabIgnoringFieldEditor) +WEBCORE_COMMAND(makeTextWritingDirectionLeftToRight) +WEBCORE_COMMAND(makeTextWritingDirectionNatural) +WEBCORE_COMMAND(makeTextWritingDirectionRightToLeft) WEBCORE_COMMAND(moveBackward) WEBCORE_COMMAND(moveBackwardAndModifySelection) WEBCORE_COMMAND(moveDown) @@ -2383,10 +2403,20 @@ WEBCORE_COMMAND(yankAndSelect) return [self _canEdit]; } - if (action == @selector(changeBaseWritingDirection:)) { - NSWritingDirection writingDirection = static_cast<NSWritingDirection>([item tag]); - if (writingDirection == NSWritingDirectionNatural) - return NO; + if (action == @selector(changeBaseWritingDirection:) + || action == @selector(makeBaseWritingDirectionLeftToRight:) + || action == @selector(makeBaseWritingDirectionRightToLeft:)) { + NSWritingDirection writingDirection; + + if (action == @selector(changeBaseWritingDirection:)) { + writingDirection = static_cast<NSWritingDirection>([item tag]); + if (writingDirection == NSWritingDirectionNatural) + return NO; + } else if (action == @selector(makeBaseWritingDirectionLeftToRight:)) + writingDirection = NSWritingDirectionLeftToRight; + else + writingDirection = NSWritingDirectionRightToLeft; + NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) { RefPtr<CSSStyleDeclaration> style = CSSMutableStyleDeclaration::create(); @@ -2421,7 +2451,7 @@ WEBCORE_COMMAND(yankAndSelect) || action == @selector(lowercaseWord:) || action == @selector(uppercaseWord:)) return [self _hasSelection] && [self _isEditable]; - + if (action == @selector(centerSelectionInVisibleArea:) || action == @selector(jumpToSelection:) || action == @selector(copyFont:)) @@ -2744,12 +2774,13 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v double start = CFAbsoluteTimeGetCurrent(); #endif - 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(); + if (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 LOG_TIMES double thisTime = CFAbsoluteTimeGetCurrent() - start; @@ -3208,9 +3239,9 @@ done: NSFileWrapper *wrapper = nil; NSURL *draggingImageURL = nil; - if (WebCore::CachedResource* tiffResource = [self promisedDragTIFFDataSource]) { + if (WebCore::CachedImage* tiffResource = [self promisedDragTIFFDataSource]) { - SharedBuffer *buffer = tiffResource->data(); + SharedBuffer *buffer = static_cast<CachedResource*>(tiffResource)->data(); if (!buffer) goto noPromisedData; @@ -3218,7 +3249,11 @@ done: NSURLResponse *response = tiffResource->response().nsURLResponse(); draggingImageURL = [response URL]; wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease]; - [wrapper setPreferredFilename:[response suggestedFilename]]; + NSString* filename = [response suggestedFilename]; + String trueExtension = tiffResource->image()->filenameExtension(); + if (![filename hasSuffix:trueExtension]) + filename = [[filename stringByAppendingString:@"."] stringByAppendingString:trueExtension]; + [wrapper setPreferredFilename:filename]; } noPromisedData: @@ -3322,14 +3357,12 @@ noPromisedData: BOOL resign = [super resignFirstResponder]; if (resign) { [_private->compController endRevertingChange:NO moveLeft:NO]; - _private->resigningFirstResponder = YES; if (![self maintainsInactiveSelection]) { [self deselectAll]; if (![[self _webView] _isPerformingProgrammaticFocus]) [self clearFocus]; } [self _updateFocusedAndActiveState]; - _private->resigningFirstResponder = NO; } return resign; } @@ -3744,7 +3777,7 @@ noPromisedData: - (NSString *)_colorAsString:(NSColor *)color { - NSColor *rgbColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; + NSColor *rgbColor = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace]; // FIXME: If color is non-nil and rgbColor is nil, that means we got some kind // of fancy color that can't be converted to RGB. Changing that to "transparent" // might not be great, but it's probably OK. @@ -4373,8 +4406,12 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co static BOOL writingDirectionKeyBindingsEnabled() { +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + return YES; +#else NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; return [defaults boolForKey:@"NSAllowsBaseWritingDirectionKeyBindings"] || [defaults boolForKey:@"AppleTextDirection"]; +#endif } - (void)_changeBaseWritingDirectionTo:(NSWritingDirection)direction @@ -4393,20 +4430,32 @@ static BOOL writingDirectionKeyBindingsEnabled() coreFrame->editor()->setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection); } -- (void)changeBaseWritingDirectionToLTR:(id)sender +- (void)makeBaseWritingDirectionLeftToRight:(id)sender { COMMAND_PROLOGUE [self _changeBaseWritingDirectionTo:NSWritingDirectionLeftToRight]; } -- (void)changeBaseWritingDirectionToRTL:(id)sender +- (void)makeBaseWritingDirectionRightToLeft:(id)sender { COMMAND_PROLOGUE [self _changeBaseWritingDirectionTo:NSWritingDirectionRightToLeft]; } +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) +- (void)changeBaseWritingDirectionToLTR:(id)sender +{ + [self makeBaseWritingDirectionLeftToRight:sender]; +} + +- (void)changeBaseWritingDirectionToRTL:(id)sender +{ + [self makeBaseWritingDirectionRightToLeft:sender]; +} +#endif + #if 0 // CSS does not have a way to specify an outline font, which may make this difficult to implement. @@ -4430,8 +4479,19 @@ static BOOL writingDirectionKeyBindingsEnabled() #endif +#ifndef BUILDING_ON_TIGER + +// Override this so that AppKit will send us arrow keys as key down events so we can +// support them via the key bindings mechanism. +- (BOOL)_wantsKeyDownForEvent:(NSEvent *)event +{ + return YES; +} + +#else + // Super-hack alert. -// Workaround for bug 3789278. +// All this code accomplishes the same thing as the _wantsKeyDownForEvent method above. // Returns a selector only if called while: // 1) first responder is self @@ -4497,6 +4557,8 @@ static BOOL writingDirectionKeyBindingsEnabled() return [super nextResponder]; } +#endif + // Despite its name, this is called at different times than windowDidBecomeKey is. // It takes into account all the other factors that determine when NSCell draws // with different tints, so it's the right call to use for control tints. We'd prefer @@ -4541,7 +4603,7 @@ static BOOL writingDirectionKeyBindingsEnabled() { #if ENABLE(NETSCAPE_PLUGIN_API) NSEnumerator *enumerator = [self objectEnumerator]; - WebBaseNetscapePluginView *view; + WebNetscapePluginView *view; while ((view = [enumerator nextObject]) != nil) if ([view isKindOfClass:[WebBaseNetscapePluginView class]]) [view performSelector:selector withObject:object]; @@ -4746,7 +4808,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) // FIXME: the dictionary API expects the rect for the first line of selection. Passing // the rect for the entire selection, as we do here, positions the pop-up window near // the bottom of the selection rather than at the selected word. - NSRect rect = [self convertRect:coreFrame->selectionRect() toView:nil]; + NSRect rect = [self convertRect:coreFrame->selectionBounds() toView:nil]; rect.origin = [[self window] convertBaseToScreen:rect.origin]; NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil]; dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0); @@ -4754,7 +4816,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) // The HIDictionaryWindowShow function requires the origin, in CG screen coordinates, of the first character of text in the selection. // FIXME 4945808: We approximate this in a way that works well when a single word is selected, and less well in some other cases // (but no worse than we did in Tiger) - NSRect rect = coreFrame->selectionRect(); + NSRect rect = coreFrame->selectionBounds(); NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)]; NSFont *font = [attributes objectForKey:NSFontAttributeName]; @@ -5160,11 +5222,18 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde Editor::Command command = [self coreCommandBySelector:selector]; if (command.isSupported()) eventWasHandled = command.execute(event); - else { + else if ([self _canEdit]) { + // If the command is unsupported and the WebHTMLView is editable, then pass the + // selector to super and say that the event was handled. If the WebHTMLView is + // not editable, then do not say that the event was handled. This is important + // because of selectors like scrollPageDown:, which come as input method events + // when editing is enabled but keyboard events when it is not. These events are + // handled by the next responder in the responder chain. _private->selectorForDoCommandBySelector = selector; [super doCommandBySelector:selector]; _private->selectorForDoCommandBySelector = 0; - } + } else + eventWasHandled = false; } if (parameters) @@ -5225,7 +5294,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde String eventText = text; eventText.replace(NSBackTabCharacter, NSTabCharacter); // same thing is done in KeyEventMac.mm in WebCore - if (coreFrame) { + if (coreFrame && coreFrame->editor()->canEdit()) { if (!coreFrame->editor()->hasComposition()) eventHandled = coreFrame->editor()->insertText(eventText, event); else { @@ -5563,7 +5632,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (NSRect)selectionRect { if ([self _hasSelection]) - return core([self _frame])->selectionRect(); + return core([self _frame])->selectionBounds(); return NSZeroRect; } @@ -5599,7 +5668,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (NSRect)selectionImageRect { if ([self _hasSelection]) - return core([self _frame])->selectionRect(); + return core([self _frame])->selectionBounds(); return NSZeroRect; } diff --git a/WebKit/mac/WebView/WebPDFView.mm b/WebKit/mac/WebView/WebPDFView.mm index 1009cdd..2cb5374 100644 --- a/WebKit/mac/WebView/WebPDFView.mm +++ b/WebKit/mac/WebView/WebPDFView.mm @@ -950,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. - core([dataSource webFrame])->loader()->loadFrameRequestWithFormAndValues(ResourceRequest(URL), false, event.get(), 0, HashMap<String, String>()); + core([dataSource webFrame])->loader()->loadFrameRequestWithFormAndValues(ResourceRequest(URL), false, false, event.get(), 0, HashMap<String, String>()); } - (void)PDFViewOpenPDFInNativeApplication:(PDFView *)sender diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h index bcb17db..98daec0 100644 --- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h +++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h @@ -50,6 +50,8 @@ #define WebKitJavaScriptEnabledPreferenceKey @"WebKitJavaScriptEnabled" #define WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey @"WebKitJavaScriptCanOpenWindowsAutomatically" #define WebKitPluginsEnabledPreferenceKey @"WebKitPluginsEnabled" +#define WebKitDatabasesEnabledPreferenceKey @"WebKitDatabasesEnabledPreferenceKey" +#define WebKitLocalStorageEnabledPreferenceKey @"WebKitLocalStorageEnabledPreferenceKey" #define WebKitAllowAnimatedImagesPreferenceKey @"WebKitAllowAnimatedImagesPreferenceKey" #define WebKitAllowAnimatedImageLoopingPreferenceKey @"WebKitAllowAnimatedImageLoopingPreferenceKey" #define WebKitDisplayImagesKey @"WebKitDisplayImagesKey" @@ -80,6 +82,7 @@ #define WebKitUseSiteSpecificSpoofingPreferenceKey @"WebKitUseSiteSpecificSpoofing" #define WebKitEditableLinkBehaviorPreferenceKey @"WebKitEditableLinkBehavior" #define WebKitCacheModelPreferenceKey @"WebKitCacheModelPreferenceKey" +#define WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey @"WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey" // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set // to NO, or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are OFF by diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm index 8b2f43e..e595861 100644 --- a/WebKit/mac/WebView/WebPreferences.mm +++ b/WebKit/mac/WebView/WebPreferences.mm @@ -315,6 +315,8 @@ static WebCacheModel cacheModelForMainBundle(void) [NSNumber numberWithBool:YES], WebKitJavaScriptEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey, [NSNumber numberWithBool:YES], WebKitPluginsEnabledPreferenceKey, + [NSNumber numberWithBool:YES], WebKitDatabasesEnabledPreferenceKey, + [NSNumber numberWithBool:YES], WebKitLocalStorageEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitAllowAnimatedImagesPreferenceKey, [NSNumber numberWithBool:YES], WebKitAllowAnimatedImageLoopingPreferenceKey, [NSNumber numberWithBool:YES], WebKitDisplayImagesKey, @@ -327,6 +329,12 @@ static WebCacheModel cacheModelForMainBundle(void) @"0", WebKitPDFScaleFactorPreferenceKey, @"0", WebKitUseSiteSpecificSpoofingPreferenceKey, [NSNumber numberWithInt:WebKitEditableLinkDefaultBehavior], WebKitEditableLinkBehaviorPreferenceKey, +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + [NSNumber numberWithInt:WebTextDirectionSubmenuAutomaticallyIncluded], +#else + [NSNumber numberWithInt:WebTextDirectionSubmenuNeverIncluded], +#endif + WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey, [NSNumber numberWithBool:NO], WebKitDOMPasteAllowedPreferenceKey, [NSNumber numberWithBool:YES], WebKitUsesPageCachePreferenceKey, [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey, @@ -905,6 +913,23 @@ static WebCacheModel cacheModelForMainBundle(void) [self _setIntegerValue:behavior forKey:WebKitEditableLinkBehaviorPreferenceKey]; } +- (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior +{ + WebTextDirectionSubmenuInclusionBehavior value = static_cast<WebTextDirectionSubmenuInclusionBehavior>([self _integerValueForKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey]); + if (value != WebTextDirectionSubmenuNeverIncluded && + value != WebTextDirectionSubmenuAutomaticallyIncluded && + value != WebTextDirectionSubmenuAlwaysIncluded) { + // Ensure that a valid result is returned. + value = WebTextDirectionSubmenuNeverIncluded; + } + return value; +} + +- (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior +{ + [self _setIntegerValue:behavior forKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey]; +} + - (BOOL)_useSiteSpecificSpoofing { return [self _boolValueForKey:WebKitUseSiteSpecificSpoofingPreferenceKey]; @@ -915,6 +940,26 @@ static WebCacheModel cacheModelForMainBundle(void) [self _setBoolValue:newValue forKey:WebKitUseSiteSpecificSpoofingPreferenceKey]; } +- (BOOL)databasesEnabled +{ + return [self _boolValueForKey:WebKitDatabasesEnabledPreferenceKey]; +} + +- (void)setDatabasesEnabled:(BOOL)databasesEnabled +{ + [self _setBoolValue:databasesEnabled forKey:WebKitDatabasesEnabledPreferenceKey]; +} + +- (BOOL)localStorageEnabled +{ + return [self _boolValueForKey:WebKitLocalStorageEnabledPreferenceKey]; +} + +- (void)setLocalStorageEnabled:(BOOL)localStorageEnabled +{ + [self _setBoolValue:localStorageEnabled forKey:WebKitLocalStorageEnabledPreferenceKey]; +} + + (WebPreferences *)_getInstanceForIdentifier:(NSString *)ident { LOG(Encoding, "requesting for %@\n", ident); diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h index 1981290..99ff49c 100644 --- a/WebKit/mac/WebView/WebPreferencesPrivate.h +++ b/WebKit/mac/WebView/WebPreferencesPrivate.h @@ -37,6 +37,12 @@ typedef enum { WebKitEditableLinkNeverLive } WebKitEditableLinkBehavior; +typedef enum { + WebTextDirectionSubmenuNeverIncluded, + WebTextDirectionSubmenuAutomaticallyIncluded, + WebTextDirectionSubmenuAlwaysIncluded +} WebTextDirectionSubmenuInclusionBehavior; + extern NSString *WebPreferencesChangedNotification; extern NSString *WebPreferencesRemovedNotification; @@ -77,6 +83,12 @@ extern NSString *WebPreferencesRemovedNotification; - (BOOL)offlineWebApplicationCacheEnabled; - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled; +- (BOOL)databasesEnabled; +- (void)setDatabasesEnabled:(BOOL)databasesEnabled; + +- (BOOL)localStorageEnabled; +- (void)setLocalStorageEnabled:(BOOL)localStorageEnabled; + - (BOOL)zoomsTextOnly; - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly; @@ -87,6 +99,9 @@ extern NSString *WebPreferencesRemovedNotification; - (WebKitEditableLinkBehavior)editableLinkBehavior; - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior; +- (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior; +- (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior; + // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in // the future when there's no more need for it. diff --git a/WebKit/mac/WebView/WebRenderNode.mm b/WebKit/mac/WebView/WebRenderNode.mm index c34ac34..65ee13c 100644 --- a/WebKit/mac/WebView/WebRenderNode.mm +++ b/WebKit/mac/WebView/WebRenderNode.mm @@ -32,6 +32,7 @@ #import "WebFrameView.h" #import "WebHTMLView.h" #import <WebCore/Frame.h> +#import <WebCore/RenderText.h> #import <WebCore/RenderWidget.h> #import <WebCore/RenderView.h> #import <WebCore/Widget.h> @@ -86,10 +87,30 @@ static WebRenderNode *copyRenderNode(RenderObject* node) Widget* widget = renderWidget ? renderWidget->widget() : 0; NSView *view = widget ? widget->platformWidget() : nil; - int nx, ny; - node->absolutePosition(nx, ny); + // FIXME: broken with transforms + FloatPoint absPos = node->localToAbsolute(FloatPoint()); + int x = 0; + int y = 0; + int width = 0; + int height = 0; + if (node->isBox()) { + RenderBox* box = toRenderBox(node); + x = box->x(); + y = box->y(); + width = box->width(); + height = box->height(); + } else if (node->isText()) { + // FIXME: Preserve old behavior even though it's strange. + RenderText* text = toRenderText(node); + x = text->firstRunX(); + y = text->firstRunY(); + IntRect box = text->linesBoundingBox(); + width = box.width(); + height = box.height(); + } + WebRenderNode *result = [[WebRenderNode alloc] initWithName:name - position:NSMakePoint(nx, ny) rect:NSMakeRect(node->xPos(), node->yPos(), node->width(), node->height()) + position:absPos rect:NSMakeRect(x, y, width, height) view:view children:children]; [name release]; diff --git a/WebKit/mac/WebView/WebResource.mm b/WebKit/mac/WebView/WebResource.mm index 6e0c9f0..a5caa41 100644 --- a/WebKit/mac/WebView/WebResource.mm +++ b/WebKit/mac/WebView/WebResource.mm @@ -26,20 +26,23 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebResourcePrivate.h" +#import "WebResourceInternal.h" #import "WebFrameInternal.h" +#import "WebKitLogging.h" +#import "WebKitVersionChecks.h" #import "WebNSDictionaryExtras.h" +#import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" - +#import <JavaScriptCore/InitializeThreading.h> +#import <JavaScriptCore/PassRefPtr.h> #import <WebCore/ArchiveResource.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/TextEncoding.h> +#import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebCoreURLResponse.h> -#import <wtf/PassRefPtr.h> - using namespace WebCore; static NSString * const WebResourceDataKey = @"WebResourceData"; @@ -49,25 +52,22 @@ static NSString * const WebResourceURLKey = @"WebResourceURL"; static NSString * const WebResourceTextEncodingNameKey = @"WebResourceTextEncodingName"; static NSString * const WebResourceResponseKey = @"WebResourceResponse"; -#define WebResourceVersion 1 - -@interface WebResourcePrivate : NSObject -{ +@interface WebResourcePrivate : NSObject { @public ArchiveResource* coreResource; } - - (id)initWithCoreResource:(PassRefPtr<ArchiveResource>)coreResource; @end @implementation WebResourcePrivate -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - (id)init { @@ -78,11 +78,9 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" { self = [super init]; if (!self) - return self; - + return nil; // Acquire the PassRefPtr<>'s ref as our own manual ref coreResource = passedResource.releaseRef(); - return self; } @@ -123,6 +121,8 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" - (id)initWithCoder:(NSCoder *)decoder { + WebCoreThreadViolationCheck(); + self = [super init]; if (!self) return nil; @@ -200,29 +200,78 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" - (NSData *)data { - if (_private->coreResource && _private->coreResource->data()) - return [_private->coreResource->data()->createNSData() autorelease]; - return 0; +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] data]; +#endif + + WebCoreThreadViolationCheck(); + + if (!_private->coreResource) + return nil; + if (!_private->coreResource->data()) + return nil; + return [_private->coreResource->data()->createNSData() autorelease]; } - (NSURL *)URL { - return _private->coreResource ? (NSURL *)_private->coreResource->url() : 0; +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] URL]; +#endif + + WebCoreThreadViolationCheck(); + + if (!_private->coreResource) + return nil; + NSURL *url = _private->coreResource->url(); + return url; } - (NSString *)MIMEType { - return _private->coreResource ? (NSString *)_private->coreResource->mimeType() : 0; +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] MIMEType]; +#endif + + WebCoreThreadViolationCheck(); + + if (!_private->coreResource) + return nil; + NSString *mimeType = _private->coreResource->mimeType(); + return mimeType; } - (NSString *)textEncodingName { - return _private->coreResource ? (NSString *)_private->coreResource->textEncoding() : 0; +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] textEncodingName]; +#endif + + WebCoreThreadViolationCheck(); + + if (!_private->coreResource) + return nil; + NSString *textEncodingName = _private->coreResource->textEncoding(); + return textEncodingName; } - (NSString *)frameName { - return _private->coreResource ? (NSString *)_private->coreResource->frameName() : 0; +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] frameName]; +#endif + + WebCoreThreadViolationCheck(); + + if (!_private->coreResource) + return nil; + NSString *frameName = _private->coreResource->frameName(); + return frameName; } - (id)description @@ -267,8 +316,18 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" // FIXME: This "ignoreWhenUnarchiving" concept is an ugly one - can we find a cleaner solution for those who need this SPI? - (void)_ignoreWhenUnarchiving { - if (_private->coreResource) - _private->coreResource->ignoreWhenUnarchiving(); +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) { + [[self _webkit_invokeOnMainThread] _ignoreWhenUnarchiving]; + return; + } +#endif + + WebCoreThreadViolationCheck(); + + if (!_private->coreResource) + return; + _private->coreResource->ignoreWhenUnarchiving(); } - (id)_initWithData:(NSData *)data @@ -279,6 +338,13 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" response:(NSURLResponse *)response copyData:(BOOL)copyData { +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:response copyData:copyData]; +#endif + + WebCoreThreadViolationCheck(); + self = [super init]; if (!self) return nil; @@ -287,9 +353,9 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" [self release]; return nil; } - + _private = [[WebResourcePrivate alloc] initWithCoreResource:ArchiveResource::create(SharedBuffer::wrapNSData(copyData ? [[data copy] autorelease] : data), URL, MIMEType, textEncodingName, frameName, response)]; - + return self; } @@ -303,44 +369,81 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" textEncodingName:[response textEncodingName] frameName:nil response:response - copyData:NO]; + copyData:NO]; +} + +- (NSString *)_suggestedFilename +{ +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] _suggestedFilename]; +#endif + + WebCoreThreadViolationCheck(); + + if (!_private->coreResource) + return nil; + NSString *suggestedFilename = _private->coreResource->response().suggestedFilename(); + return suggestedFilename; } - (NSFileWrapper *)_fileWrapperRepresentation { - SharedBuffer* coreData = _private->coreResource ? _private->coreResource->data() : 0; - NSData *data = coreData ? [coreData->createNSData() autorelease] : nil; - - 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]; - } - - [wrapper setPreferredFilename:preferredFilename]; + NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:[self data]] autorelease]; + NSString *filename = [self _suggestedFilename]; + if (!filename || ![filename length]) + filename = [[self URL] _webkit_suggestedFilenameWithMIMEType:[self MIMEType]]; + [wrapper setPreferredFilename:filename]; return wrapper; } - (NSURLResponse *)_response { +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] _response]; +#endif + + WebCoreThreadViolationCheck(); + NSURLResponse *response = nil; if (_private->coreResource) response = _private->coreResource->response().nsURLResponse(); - return response ? response : [[[NSURLResponse alloc] init] autorelease]; } - (NSString *)_stringValue { - WebCore::TextEncoding encoding(_private->coreResource ? (NSString *)_private->coreResource->textEncoding() : nil); +#ifdef MAIL_THREAD_WORKAROUND + if (needMailThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] _stringValue]; +#endif + + WebCoreThreadViolationCheck(); + + WebCore::TextEncoding encoding; + if (_private->coreResource) + encoding = _private->coreResource->textEncoding(); 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 + +#ifdef MAIL_THREAD_WORKAROUND + +@implementation WebResource (WebMailThreadWorkaround) + ++ (BOOL)_needMailThreadWorkaroundIfCalledOffMainThread +{ + static BOOL isOldMail = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_MAIL_THREAD_WORKAROUND) + && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mail"]; + return isOldMail; +} + +@end + +#endif diff --git a/WebKit/mac/WebView/WebResourceInternal.h b/WebKit/mac/WebView/WebResourceInternal.h index 84f6aba..d135197 100644 --- a/WebKit/mac/WebView/WebResourceInternal.h +++ b/WebKit/mac/WebView/WebResourceInternal.h @@ -26,17 +26,31 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebResource.h" - +#import "WebResourcePrivate.h" #import <wtf/PassRefPtr.h> +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) +#define MAIL_THREAD_WORKAROUND 1 +#endif + namespace WebCore { class ArchiveResource; } @interface WebResource (WebResourceInternal) +- (id)_initWithCoreResource:(PassRefPtr<WebCore::ArchiveResource>)coreResource; +- (WebCore::ArchiveResource*)_coreResource; +@end -- (id)_initWithCoreResource:(WTF::PassRefPtr<WebCore::ArchiveResource>)coreResource; -- (WebCore::ArchiveResource *)_coreResource; +#ifdef MAIL_THREAD_WORKAROUND +@interface WebResource (WebMailThreadWorkaround) ++ (BOOL)_needMailThreadWorkaroundIfCalledOffMainThread; @end + +inline bool needMailThreadWorkaround() +{ + return !pthread_main_np() && [WebResource _needMailThreadWorkaroundIfCalledOffMainThread]; +} + +#endif diff --git a/WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h b/WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h index 5fd13ee..6dc3f2d 100644 --- a/WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h +++ b/WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h @@ -41,6 +41,7 @@ @interface NSObject (WebResourceLoadDelegatePrivate) - (void)webView:(WebView *)webView didLoadResourceFromMemoryCache:(NSURLRequest *)request response:(NSURLResponse *)response length:(WebNSInteger)length fromDataSource:(WebDataSource *)dataSource; +- (BOOL)webView:(WebView *)webView resource:(id)identifier shouldUseCredentialStorageForDataSource:(WebDataSource *)dataSource; @end diff --git a/WebKit/mac/WebView/WebScriptDebugDelegate.h b/WebKit/mac/WebView/WebScriptDebugDelegate.h index fba48f6..7334127 100644 --- a/WebKit/mac/WebView/WebScriptDebugDelegate.h +++ b/WebKit/mac/WebView/WebScriptDebugDelegate.h @@ -34,6 +34,12 @@ #define WebNSUInteger NSUInteger #endif +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) +typedef int WebSourceId; +#else +typedef int WebSourceId; // FIXME <rdar://problem/6263293>: Turn this int into an intptr_t once <rdar://problem/6263297> is fixed. +#endif + @class WebView; @class WebFrame; @class WebScriptCallFrame; @@ -56,14 +62,14 @@ enum { // this delegate method is deprecated, please switch to the new version below - (void)webView:(WebView *)webView didParseSource:(NSString *)source fromURL:(NSString *)url - sourceId:(int)sid + sourceId:(WebSourceId)sid forWebFrame:(WebFrame *)webFrame; // some source was parsed, establishing a "source ID" (>= 0) for future reference - (void)webView:(WebView *)webView didParseSource:(NSString *)source baseLineNumber:(WebNSUInteger)lineNumber fromURL:(NSURL *)url - sourceId:(int)sid + sourceId:(WebSourceId)sid forWebFrame:(WebFrame *)webFrame; // some source failed to parse @@ -75,25 +81,25 @@ enum { // just entered a stack frame (i.e. called a function, or started global scope) - (void)webView:(WebView *)webView didEnterCallFrame:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; // about to execute some code - (void)webView:(WebView *)webView willExecuteStatement:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; // about to leave a stack frame (i.e. return from a function) - (void)webView:(WebView *)webView willLeaveCallFrame:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; // exception is being thrown - (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame - sourceId:(int)sid + sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; @end @@ -135,3 +141,4 @@ enum { @end #undef WebNSUInteger + diff --git a/WebKit/mac/WebView/WebScriptDebugDelegate.mm b/WebKit/mac/WebView/WebScriptDebugDelegate.mm index be0a0d5..0b47e26 100644 --- a/WebKit/mac/WebView/WebScriptDebugDelegate.mm +++ b/WebKit/mac/WebView/WebScriptDebugDelegate.mm @@ -26,22 +26,24 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebScriptDebugger.h" #import "WebDataSource.h" #import "WebDataSourceInternal.h" #import "WebFrameInternal.h" #import "WebScriptDebugDelegate.h" +#import "WebScriptDebugger.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/WebScriptObjectPrivate.h> #import <WebCore/ScriptController.h> +#import <WebCore/WebScriptObjectPrivate.h> #import <WebCore/runtime_root.h> +#import <debugger/Debugger.h> +#import <debugger/DebuggerActivation.h> +#import <debugger/DebuggerCallFrame.h> +#import <interpreter/CallFrame.h> +#import <runtime/Completion.h> +#import <runtime/JSFunction.h> +#import <runtime/JSGlobalObject.h> +#import <runtime/JSLock.h> using namespace JSC; using namespace WebCore; @@ -53,7 +55,7 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; @interface WebScriptCallFrame (WebScriptDebugDelegateInternal) -- (id)_convertValueToObjcValue:(JSValue*)value; +- (id)_convertValueToObjcValue:(JSValuePtr)value; @end @@ -62,6 +64,7 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; WebScriptObject *globalObject; // the global object's proxy (not retained) WebScriptCallFrame *caller; // previous stack frame DebuggerCallFrame* debuggerCallFrame; + WebScriptDebugger* debugger; } @end @@ -85,12 +88,13 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; @implementation WebScriptCallFrame (WebScriptDebugDelegateInternal) -- (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame +- (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj debugger:(WebScriptDebugger *)debugger caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame { if ((self = [super init])) { _private = [[WebScriptCallFramePrivate alloc] init]; _private->globalObject = globalObj; _private->caller = [caller retain]; + _private->debugger = debugger; } return self; } @@ -109,7 +113,7 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; _private->debuggerCallFrame = 0; } -- (id)_convertValueToObjcValue:(JSValue*)value +- (id)_convertValueToObjcValue:(JSValuePtr)value { if (!value) return nil; @@ -177,8 +181,12 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; NSMutableArray *scopes = [[NSMutableArray alloc] init]; ScopeChainIterator end = scopeChain->end(); - for (ScopeChainIterator it = scopeChain->begin(); it != end; ++it) - [scopes addObject:[self _convertValueToObjcValue:(*it)]]; + for (ScopeChainIterator it = scopeChain->begin(); it != end; ++it) { + JSObject* object = *it; + if (object->isActivationObject()) + object = new (scopeChain->globalData) DebuggerActivation(object); + [scopes addObject:[self _convertValueToObjcValue:object]]; + } NSArray *result = [NSArray arrayWithArray:scopes]; [scopes release]; @@ -204,7 +212,7 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; if (!_private->debuggerCallFrame) return nil; - JSValue* exception = _private->debuggerCallFrame->exception(); + JSValuePtr exception = _private->debuggerCallFrame->exception(); return exception ? [self _convertValueToObjcValue:exception] : nil; } @@ -221,8 +229,25 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; JSLock lock(false); - JSValue* exception = noValue(); - JSValue* result = _private->debuggerCallFrame->evaluate(String(script), exception); + // If this is the global call frame and there is no dynamic global object, + // Dashcode is attempting to execute JS in the evaluator using a stale + // WebScriptCallFrame. Instead, we need to set the dynamic global object + // and evaluate the JS in the global object's global call frame. + JSGlobalObject* globalObject = _private->debugger->globalObject(); + if (self == _private->debugger->globalCallFrame() && !globalObject->globalData()->dynamicGlobalObject) { + JSGlobalObject* globalObject = _private->debugger->globalObject(); + + DynamicGlobalObjectScope globalObjectScope(globalObject->globalExec(), globalObject); + + JSValuePtr exception = noValue(); + JSValuePtr result = evaluateInGlobalCallFrame(String(script), exception, globalObject); + if (exception) + return [self _convertValueToObjcValue:exception]; + return result ? [self _convertValueToObjcValue:result] : nil; + } + + JSValuePtr exception = noValue(); + JSValuePtr result = _private->debuggerCallFrame->evaluate(String(script), exception); if (exception) return [self _convertValueToObjcValue:exception]; return result ? [self _convertValueToObjcValue:result] : nil; diff --git a/WebKit/mac/WebView/WebScriptDebugger.h b/WebKit/mac/WebView/WebScriptDebugger.h index caec994..1213ab2 100644 --- a/WebKit/mac/WebView/WebScriptDebugger.h +++ b/WebKit/mac/WebView/WebScriptDebugger.h @@ -30,6 +30,7 @@ #define WebScriptDebugger_h #include <debugger/Debugger.h> +#include <runtime/Protect.h> #include <wtf/RetainPtr.h> @@ -50,6 +51,8 @@ class WebScriptDebugger : public JSC::Debugger { public: WebScriptDebugger(JSC::JSGlobalObject*); + void initGlobalCallFrame(const JSC::DebuggerCallFrame&); + 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); @@ -59,9 +62,15 @@ public: virtual void didExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno); virtual void didReachBreakpoint(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno); + JSC::JSGlobalObject* globalObject() const { return m_globalObject.get(); } + WebScriptCallFrame *globalCallFrame() const { return m_globalCallFrame.get(); } + private: bool m_callingDelegate; RetainPtr<WebScriptCallFrame> m_topCallFrame; + + JSC::ProtectedPtr<JSC::JSGlobalObject> m_globalObject; + RetainPtr<WebScriptCallFrame> m_globalCallFrame; }; #endif // WebScriptDebugger_h diff --git a/WebKit/mac/WebView/WebScriptDebugger.mm b/WebKit/mac/WebView/WebScriptDebugger.mm index 0dd6b0e..d97cbcf 100644 --- a/WebKit/mac/WebView/WebScriptDebugger.mm +++ b/WebKit/mac/WebView/WebScriptDebugger.mm @@ -43,7 +43,7 @@ using namespace JSC; using namespace WebCore; @interface WebScriptCallFrame (WebScriptDebugDelegateInternal) -- (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame; +- (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj debugger:(WebScriptDebugger *)debugger caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame; - (void)_setDebuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame; - (void)_clearDebuggerCallFrame; @end @@ -55,7 +55,7 @@ NSString *toNSString(const UString& s) return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.size()]; } -NSString *toNSString(const SourceCode& s) +static NSString *toNSString(const SourceCode& s) { if (!s.length()) return nil; @@ -78,9 +78,25 @@ static WebFrame *toWebFrame(JSGlobalObject* globalObject) WebScriptDebugger::WebScriptDebugger(JSGlobalObject* globalObject) : m_callingDelegate(false) + , m_globalObject(globalObject) { attach(globalObject); - callEvent(globalObject->globalExec(), 0, -1); + initGlobalCallFrame(globalObject->globalExec()); +} + +void WebScriptDebugger::initGlobalCallFrame(const DebuggerCallFrame& debuggerCallFrame) +{ + m_callingDelegate = true; + + WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject()); + + m_topCallFrame.adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script()->windowScriptObject() debugger:this caller:m_topCallFrame.get() debuggerCallFrame:debuggerCallFrame]); + m_globalCallFrame = m_topCallFrame; + + WebView *webView = [webFrame webView]; + [[webView _scriptDebugDelegateForwarder] webView:webView didEnterCallFrame:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(0) line:-1 forWebFrame:webFrame]; + + m_callingDelegate = false; } // callbacks - relay to delegate @@ -97,8 +113,8 @@ void WebScriptDebugger::sourceParsed(ExecState* exec, const SourceCode& source, 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 + [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:nsSource baseLineNumber:source.firstLine() fromURL:nsURL sourceId:static_cast<WebSourceId>(source.provider()->asID()) forWebFrame:webFrame]; + [[webView _scriptDebugDelegateForwarder] webView:webView didParseSource:nsSource fromURL:[nsURL absoluteString] sourceId:static_cast<WebSourceId>(source.provider()->asID()) forWebFrame:webFrame]; // deprecated delegate method } else { NSString* nsErrorMessage = toNSString(errorMsg); NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:nsErrorMessage, WebScriptErrorDescriptionKey, [NSNumber numberWithUnsignedInt:errorLine], WebScriptErrorLineNumberKey, nil]; @@ -120,10 +136,10 @@ void WebScriptDebugger::callEvent(const DebuggerCallFrame& debuggerCallFrame, in WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject()); - m_topCallFrame.adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script()->windowScriptObject() caller:m_topCallFrame.get() debuggerCallFrame:debuggerCallFrame]); + m_topCallFrame.adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script()->windowScriptObject() debugger:this caller:m_topCallFrame.get() debuggerCallFrame:debuggerCallFrame]); WebView *webView = [webFrame webView]; - [[webView _scriptDebugDelegateForwarder] webView:webView didEnterCallFrame:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame]; + [[webView _scriptDebugDelegateForwarder] webView:webView didEnterCallFrame:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame]; m_callingDelegate = false; } @@ -139,7 +155,7 @@ void WebScriptDebugger::atStatement(const DebuggerCallFrame& debuggerCallFrame, WebView *webView = [webFrame webView]; [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame]; - [[webView _scriptDebugDelegateForwarder] webView:webView willExecuteStatement:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame]; + [[webView _scriptDebugDelegateForwarder] webView:webView willExecuteStatement:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame]; m_callingDelegate = false; } @@ -155,7 +171,7 @@ void WebScriptDebugger::returnEvent(const DebuggerCallFrame& debuggerCallFrame, WebView *webView = [webFrame webView]; [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame]; - [[webView _scriptDebugDelegateForwarder] webView:webView willLeaveCallFrame:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame]; + [[webView _scriptDebugDelegateForwarder] webView:webView willLeaveCallFrame:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame]; [m_topCallFrame.get() _clearDebuggerCallFrame]; m_topCallFrame = [m_topCallFrame.get() caller]; @@ -174,7 +190,7 @@ void WebScriptDebugger::exception(const DebuggerCallFrame& debuggerCallFrame, in WebView *webView = [webFrame webView]; [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame]; - [[webView _scriptDebugDelegateForwarder] webView:webView exceptionWasRaised:m_topCallFrame.get() sourceId:static_cast<int>(sourceID) line:lineNumber forWebFrame:webFrame]; + [[webView _scriptDebugDelegateForwarder] webView:webView exceptionWasRaised:m_topCallFrame.get() sourceId:static_cast<WebSourceId>(sourceID) line:lineNumber forWebFrame:webFrame]; m_callingDelegate = false; } diff --git a/WebKit/mac/WebView/WebTextIterator.h b/WebKit/mac/WebView/WebTextIterator.h index e6f77ac..ab5ca4e 100644 --- a/WebKit/mac/WebView/WebTextIterator.h +++ b/WebKit/mac/WebView/WebTextIterator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,13 +25,17 @@ #import <Foundation/Foundation.h> +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 +#define WebNSUInteger unsigned int +#else +#define WebNSUInteger NSUInteger +#endif @class DOMRange; @class DOMNode; @class WebTextIteratorPrivate; -@interface WebTextIterator : NSObject -{ +@interface WebTextIterator : NSObject { @private WebTextIteratorPrivate *_private; } @@ -39,28 +43,53 @@ - (id)initWithRange:(DOMRange *)range; /*! - @method advance: + @method advance @abstract Makes the WebTextIterator iterate to the next visible text element. */ - (void)advance; /*! - @method currentNode: - @result The current DOMNode in the WebTextIterator. + @method atEnd + @result YES if the WebTextIterator has reached the end of the DOMRange. */ -- (DOMNode *)currentNode; +- (BOOL)atEnd; /*! - @method currentText: - @result The current text in the WebTextIterator. + @method currentRange + @result A range, indicating the position within the document of the current text. */ -- (NSString *)currentText; +- (DOMRange *)currentRange; /*! - @method atEnd: - @result YES if the WebTextIterator has reached the end of the DOMRange. + @method currentTextPointer + @result A pointer to the current text. The pointer becomes invalid after any modification is made to the document; it must be used right away. */ -- (BOOL)atEnd; +- (const unichar *)currentTextPointer; + +/*! + @method currentTextLength + @result lengthPtr Length of the current text. + */ +- (WebNSUInteger)currentTextLength; + +@end + +@interface WebTextIterator (WebTextIteratorDeprecated) +/*! + @method currentNode + @abstract A convenience method that finds the first node in currentRange; it's almost always better to use currentRange instead. + @result The current DOMNode in the WebTextIterator + */ +- (DOMNode *)currentNode; + +/*! + @method currentText + @abstract A convenience method that makes an NSString out of the current text; it's almost always better to use currentTextPointer and currentTextLength instead. + @result The current text in the WebTextIterator. + */ +- (NSString *)currentText; @end + +#undef WebNSUInteger diff --git a/WebKit/mac/WebView/WebTextIterator.mm b/WebKit/mac/WebView/WebTextIterator.mm index 86db6d3..15eeb5f 100644 --- a/WebKit/mac/WebView/WebTextIterator.mm +++ b/WebKit/mac/WebView/WebTextIterator.mm @@ -27,30 +27,27 @@ #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" +#import "WebTypesInternal.h" +#import <JavaScriptCore/Vector.h> #import <WebCore/TextIterator.h> -#import <wtf/Vector.h> +#import <WebCore/WebCoreObjCExtras.h> +using namespace JSC; using namespace WebCore; -@interface WebTextIteratorPrivate : NSObject -{ +@interface WebTextIteratorPrivate : NSObject { @public - TextIterator* m_textIterator; + OwnPtr<TextIterator> _textIterator; } @end @implementation WebTextIteratorPrivate -- (void)dealloc -{ - delete m_textIterator; - [super dealloc]; -} - -- (void)finalize ++ (void)initialize { - delete m_textIterator; - [super finalize]; +#ifndef BUILDING_ON_TIGER + WebCoreObjCFinalizeOnMainThread(self); +#endif } @end @@ -70,39 +67,47 @@ using namespace WebCore; return self; _private = [[WebTextIteratorPrivate alloc] init]; - _private->m_textIterator = new TextIterator([range _range], true, false); + _private->_textIterator.set(new TextIterator([range _range], true, false)); return self; } - (void)advance { - ASSERT(_private->m_textIterator); - - if (_private->m_textIterator->atEnd()) - return; - - _private->m_textIterator->advance(); + _private->_textIterator->advance(); } -- (DOMNode *)currentNode +- (BOOL)atEnd { - ASSERT(_private->m_textIterator); - - return [DOMNode _wrapNode:_private->m_textIterator->node()]; + return _private->_textIterator->atEnd(); } -- (NSString *)currentText +- (DOMRange *)currentRange { - ASSERT(_private->m_textIterator); - - return [NSString stringWithCharacters:_private->m_textIterator->characters() length:_private->m_textIterator->length()]; + return [DOMRange _wrapRange:_private->_textIterator->range().get()]; } -- (BOOL)atEnd +- (const unichar *)currentTextPointer { - ASSERT(_private->m_textIterator); - - return _private->m_textIterator->atEnd(); + return _private->_textIterator->characters(); +} + +- (NSUInteger)currentTextLength +{ + return _private->_textIterator->length(); +} + +@end + +@implementation WebTextIterator (WebTextIteratorDeprecated) + +- (DOMNode *)currentNode +{ + return [DOMNode _wrapNode:_private->_textIterator->node()]; +} + +- (NSString *)currentText +{ + return [NSString stringWithCharacters:_private->_textIterator->characters() length:_private->_textIterator->length()]; } @end diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h index 6a3c32f..bb4d780 100644 --- a/WebKit/mac/WebView/WebUIDelegatePrivate.h +++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h @@ -68,6 +68,10 @@ enum { WebMenuItemPDFSinglePageScrolling, WebMenuItemPDFFacingPagesScrolling, WebMenuItemTagInspectElement, + WebMenuItemTagTextDirectionMenu, + WebMenuItemTagTextDirectionDefault, + WebMenuItemTagTextDirectionLeftToRight, + WebMenuItemTagTextDirectionRightToLeft, WebMenuItemTagBaseApplication = 10000 }; @class WebSecurityOrigin; diff --git a/WebKit/mac/WebView/WebView.h b/WebKit/mac/WebView/WebView.h index 30aa7bd..17efb5e 100644 --- a/WebKit/mac/WebView/WebView.h +++ b/WebKit/mac/WebView/WebView.h @@ -670,6 +670,7 @@ extern NSString *WebViewProgressFinishedNotification; - (IBAction)takeStringURLFrom:(id)sender; - (IBAction)stopLoading:(id)sender; - (IBAction)reload:(id)sender; +- (IBAction)reloadFromOrigin:(id)sender; - (BOOL)canGoBack; - (IBAction)goBack:(id)sender; - (BOOL)canGoForward; diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index a52d3b5..d3bbf4e 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2006 David Smith (catfish.man@gmail.com) * * Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ #import "DOMRangeInternal.h" #import "WebBackForwardListInternal.h" -#import "WebBaseNetscapePluginView.h" +#import "WebCache.h" #import "WebChromeClient.h" #import "WebContextMenuClient.h" #import "WebDOMOperationsPrivate.h" @@ -107,6 +107,7 @@ #import <WebCore/GCController.h> #import <WebCore/HTMLNames.h> #import <WebCore/HistoryItem.h> +#import <WebCore/IconDatabase.h> #import <WebCore/Logging.h> #import <WebCore/MIMETypeRegistry.h> #import <WebCore/Page.h> @@ -115,9 +116,11 @@ #import <WebCore/PlatformMouseEvent.h> #import <WebCore/ProgressTracker.h> #import <WebCore/ScriptController.h> +#import <WebCore/ScriptValue.h> #import <WebCore/SelectionController.h> #import <WebCore/Settings.h> #import <WebCore/TextResourceDecoder.h> +#import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebCoreTextRenderer.h> #import <WebCore/WebCoreView.h> @@ -129,13 +132,16 @@ #import <runtime/DateInstance.h> #import <runtime/InitializeThreading.h> #import <runtime/JSLock.h> +#import <runtime/JSValue.h> #import <mach-o/dyld.h> #import <objc/objc-auto.h> #import <objc/objc-runtime.h> +#import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> #import <wtf/HashTraits.h> #import <wtf/RefCountedLeakCounter.h> #import <wtf/RefPtr.h> +#import <wtf/StdLibExtras.h> #if ENABLE(DASHBOARD_SUPPORT) #import <WebKit/WebDashboardRegion.h> @@ -193,6 +199,11 @@ macro(insertParagraphSeparator) \ macro(insertTab) \ macro(insertTabIgnoringFieldEditor) \ macro(lowercaseWord) \ +macro(makeBaseWritingDirectionLeftToRight) \ +macro(makeBaseWritingDirectionRightToLeft) \ +macro(makeTextWritingDirectionLeftToRight) \ +macro(makeTextWritingDirectionNatural) \ +macro(makeTextWritingDirectionRightToLeft) \ macro(moveBackward) \ macro(moveBackwardAndModifySelection) \ macro(moveDown) \ @@ -337,7 +348,6 @@ static const char webViewIsOpen[] = "At least one WebView is still open."; BOOL allowsUndo; float zoomMultiplier; - BOOL zoomMultiplierIsTextOnly; NSString *applicationNameForUserAgent; String userAgent; @@ -375,6 +385,7 @@ static const char webViewIsOpen[] = "At least one WebView is still open."; NSInteger spellCheckerDocumentTag; BOOL smartInsertDeleteEnabled; + BOOL selectTrailingWhitespaceEnabled; #if ENABLE(DASHBOARD_SUPPORT) BOOL dashboardBehaviorAlwaysSendMouseEventsToAllWindows; @@ -411,6 +422,8 @@ static const char webViewIsOpen[] = "At least one WebView is still open."; @interface WebView (WebCallDelegateFunctions) @end +static void patchMailRemoveAttributesMethod(); + NSString *WebElementDOMNodeKey = @"WebElementDOMNode"; NSString *WebElementFrameKey = @"WebElementFrame"; NSString *WebElementImageKey = @"WebElementImage"; @@ -470,12 +483,13 @@ static BOOL grammarCheckingEnabled; @implementation WebViewPrivate -#ifndef BUILDING_ON_TIGER + (void)initialize { + JSC::initializeThreading(); +#ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); -} #endif +} - init { @@ -485,7 +499,6 @@ static BOOL grammarCheckingEnabled; JSC::initializeThreading(); allowsUndo = YES; zoomMultiplier = 1; - zoomMultiplierIsTextOnly = YES; #if ENABLE(DASHBOARD_SUPPORT) dashboardBehaviorAllowWheelScrolling = YES; #endif @@ -665,6 +678,8 @@ static void WebKitInitializeApplicationCachePathIfNecessary() - (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews { + WebCoreThreadViolationCheck(); + #ifndef NDEBUG WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen); #endif @@ -689,12 +704,17 @@ static void WebKitInitializeApplicationCachePathIfNecessary() [frameView release]; } - WebKitInitializeLoggingChannelsIfNecessary(); - WebCore::InitializeLoggingChannelsIfNecessary(); - [WebHistoryItem initWindowWatcherIfNecessary]; - WebKitInitializeDatabasesIfNecessary(); - WebKitInitializeApplicationCachePathIfNecessary(); - + static bool didOneTimeInitialization = false; + if (!didOneTimeInitialization) { + WebKitInitializeLoggingChannelsIfNecessary(); + WebCore::InitializeLoggingChannelsIfNecessary(); + [WebHistoryItem initWindowWatcherIfNecessary]; + WebKitInitializeDatabasesIfNecessary(); + WebKitInitializeApplicationCachePathIfNecessary(); + patchMailRemoveAttributesMethod(); + didOneTimeInitialization = true; + } + _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]); @@ -1067,8 +1087,10 @@ static void WebKitInitializeApplicationCachePathIfNecessary() #ifndef NDEBUG // Need this to make leak messages accurate. - if (applicationIsTerminating) + if (applicationIsTerminating) { gcController().garbageCollectNow(); + [WebCache empty]; + } #endif } @@ -1285,6 +1307,8 @@ static void WebKitInitializeApplicationCachePathIfNecessary() settings->setMinimumFontSize([preferences minimumFontSize]); settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]); settings->setPluginsEnabled([preferences arePlugInsEnabled]); + settings->setDatabasesEnabled([preferences databasesEnabled]); + settings->setLocalStorageEnabled([preferences localStorageEnabled]); settings->setPrivateBrowsingEnabled([preferences privateBrowsingEnabled]); settings->setSansSerifFontFamily([preferences sansSerifFontFamily]); settings->setSerifFontFamily([preferences serifFontFamily]); @@ -1294,6 +1318,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary() settings->setTextAreasAreResizable([preferences textAreasAreResizable]); settings->setShrinksStandaloneImagesToFit([preferences shrinksStandaloneImagesToFit]); settings->setEditableLinkBehavior(core([preferences editableLinkBehavior])); + settings->setTextDirectionSubmenuInclusionBehavior(core([preferences textDirectionSubmenuInclusionBehavior])); settings->setDOMPasteAllowed([preferences isDOMPasteAllowed]); settings->setUsesPageCache([self usesPageCache]); settings->setShowsURLsInToolTips([preferences showsURLsInToolTips]); @@ -1313,6 +1338,9 @@ static void WebKitInitializeApplicationCachePathIfNecessary() settings->setOfflineWebApplicationCacheEnabled([preferences offlineWebApplicationCacheEnabled]); settings->setZoomsTextOnly([preferences zoomsTextOnly]); settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1)); +#ifdef BUILDING_ON_LEOPARD + settings->setNeedsIChatMemoryCacheCallsQuirk([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.iChat"]); +#endif } static inline IMP getMethod(id o, SEL s) @@ -1341,6 +1369,7 @@ static inline IMP getMethod(id o, SEL s) cache->plugInFailedWithErrorFunc = getMethod(delegate, @selector(webView:plugInFailedWithError:dataSource:)); cache->willCacheResponseFunc = getMethod(delegate, @selector(webView:resource:willCacheResponse:fromDataSource:)); cache->willSendRequestFunc = getMethod(delegate, @selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:)); + cache->shouldUseCredentialStorageFunc = getMethod(delegate, @selector(webView:resource:shouldUseCredentialStorageForDataSource:)); } WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *webView) @@ -1370,6 +1399,7 @@ WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementa cache->didFinishDocumentLoadForFrameFunc = getMethod(delegate, @selector(webView:didFinishDocumentLoadForFrame:)); cache->didFinishLoadForFrameFunc = getMethod(delegate, @selector(webView:didFinishLoadForFrame:)); cache->didFirstLayoutInFrameFunc = getMethod(delegate, @selector(webView:didFirstLayoutInFrame:)); + cache->didFirstVisuallyNonEmptyLayoutInFrameFunc = getMethod(delegate, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:)); cache->didHandleOnloadEventsForFrameFunc = getMethod(delegate, @selector(webView:didHandleOnloadEventsForFrame:)); cache->didReceiveIconForFrameFunc = getMethod(delegate, @selector(webView:didReceiveIcon:forFrame:)); cache->didReceiveServerRedirectForProvisionalLoadForFrameFunc = getMethod(delegate, @selector(webView:didReceiveServerRedirectForProvisionalLoadForFrame:)); @@ -1948,6 +1978,13 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati [[self preferences] _postPreferencesChangesNotification]; } +- (WebHistoryItem *)_globalHistoryItem +{ + if (!_private->page) + return nil; + return kit(_private->page->globalHistoryItem()); +} + - (WebTextIterator *)textIteratorForRect:(NSRect)rect { IntPoint rectStart(rect.origin.x, rect.origin.y); @@ -2012,6 +2049,28 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati _private->page->mainFrame()->tree()->clearName(); } +- (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag +{ + _private->selectTrailingWhitespaceEnabled = flag; + if (flag) + [self setSmartInsertDeleteEnabled:false]; +} + +- (BOOL)isSelectTrailingWhitespaceEnabled +{ + return _private->selectTrailingWhitespaceEnabled; +} + +- (void)setMemoryCacheDelegateCallsEnabled:(BOOL)enabled +{ + _private->page->setMemoryCacheClientCallsEnabled(enabled); +} + +- (BOOL)areMemoryCacheDelegateCallsEnabled +{ + return _private->page->areMemoryCacheClientCallsEnabled(); +} + @end @implementation _WebSafeForwarder @@ -2192,6 +2251,30 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati FrameLoader::registerURLSchemeAsLocal(protocol); } +- (id)_initWithArguments:(NSDictionary *) arguments +{ + NSCoder *decoder = [arguments objectForKey:@"decoder"]; + if (decoder) { + self = [self initWithCoder:decoder]; + } else { + ASSERT([arguments objectForKey:@"frame"]); + NSValue *frameValue = [arguments objectForKey:@"frame"]; + NSRect frame = (frameValue ? [frameValue rectValue] : NSZeroRect); + NSString *frameName = [arguments objectForKey:@"frameName"]; + NSString *groupName = [arguments objectForKey:@"groupName"]; + self = [self initWithFrame:frame frameName:frameName groupName:groupName]; + } + + return self; +} + +static bool needsWebViewInitThreadWorkaround() +{ + static BOOL isOldInstaller = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND) + && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.installer"]; + return isOldInstaller && !pthread_main_np(); +} + - (id)initWithFrame:(NSRect)f { return [self initWithFrame:f frameName:nil groupName:nil]; @@ -2199,11 +2282,19 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati - (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName { + if (needsWebViewInitThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] initWithFrame:f frameName:frameName groupName:groupName]; + + WebCoreThreadViolationCheck(); return [self _initWithFrame:f frameName:frameName groupName:groupName usesDocumentViews:YES]; } - (id)initWithCoder:(NSCoder *)decoder { + if (needsWebViewInitThreadWorkaround()) + return [[self _webkit_invokeOnMainThread] initWithCoder:decoder]; + + WebCoreThreadViolationCheck(); WebView *result = nil; @try { @@ -2447,7 +2538,10 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati BOOL windowIsKey = [window isKeyWindow]; BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow]; - page->focusController()->setActive(windowIsKey); + NSResponder *firstResponder = [window firstResponder]; + if ([firstResponder isKindOfClass:[NSView class]] + && [(NSView*)firstResponder isDescendantOf:[[self mainFrame] frameView]]) + page->focusController()->setActive(windowIsKey); Frame* focusedFrame = page->focusController()->focusedOrMainFrame(); frame->selection()->setFocused(frame == focusedFrame && windowOrSheetIsKey); @@ -2661,14 +2755,19 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati - (float)textSizeMultiplier { - return _private->zoomMultiplierIsTextOnly ? _private->zoomMultiplier : 1.0f; + return [self _realZoomMultiplierIsTextOnly] ? _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>) _private->zoomMultiplier = m; - _private->zoomMultiplierIsTextOnly = isTextOnly; + ASSERT(_private->page); + if (_private->page) + _private->page->settings()->setZoomsTextOnly(isTextOnly); + + // FIXME: it would be nice to rework this code so that _private->zoomMultiplier doesn't exist and callers + // all access _private->page->settings(). Frame* coreFrame = core([self mainFrame]); if (coreFrame) coreFrame->setZoomFactor(m, isTextOnly); @@ -2676,7 +2775,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati - (float)_zoomMultiplier:(BOOL)isTextOnly { - if (isTextOnly != _private->zoomMultiplierIsTextOnly) + if (isTextOnly != [self _realZoomMultiplierIsTextOnly]) return 1.0f; return _private->zoomMultiplier; } @@ -2688,7 +2787,10 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati - (BOOL)_realZoomMultiplierIsTextOnly { - return _private->zoomMultiplierIsTextOnly; + if (!_private->page) + return NO; + + return _private->page->settings()->zoomsTextOnly(); } #define MinimumZoomMultiplier 0.5f @@ -2825,7 +2927,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) return; if (Frame* mainFrame = core([self mainFrame])) - mainFrame->loader()->reloadAllowingStaleData(encoding); + mainFrame->loader()->reloadWithOverrideEncoding(encoding); } - (NSString *)_mainFrameOverrideEncoding @@ -3223,7 +3325,9 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag) - (BOOL)drawsBackground { - return _private->drawsBackground; + // This method can be called beneath -[NSView dealloc] after we have cleared _private, + // indirectly via -[WebFrameView viewDidMoveToWindow]. + return !_private || _private->drawsBackground; } - (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen @@ -3298,6 +3402,11 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag) [[self mainFrame] reload]; } +- (IBAction)reloadFromOrigin:(id)sender +{ + [[self mainFrame] reloadFromOrigin]; +} + // 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 @@ -3572,22 +3681,22 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag) return coreFrame->shouldClose(); } -static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsValue) +static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValuePtr 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(); + if (jsValue.isBoolean()) + return [NSAppleEventDescriptor descriptorWithBoolean:jsValue.getBoolean()]; + if (jsValue.isString()) + return [NSAppleEventDescriptor descriptorWithString:String(jsValue.getString())]; + if (jsValue.isNumber()) { + double value = jsValue.uncheckedGetNumber(); 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 (jsValue.isObject()) { + JSObject* object = jsValue.getObject(); if (object->inherits(&DateInstance::info)) { DateInstance* date = static_cast<DateInstance*>(object); double ms = 0; @@ -3600,7 +3709,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal } } else if (object->inherits(&JSArray::info)) { - static HashSet<JSObject*> visitedElems; + DEFINE_STATIC_LOCAL(HashSet<JSObject*>, visitedElems, ()); if (!visitedElems.contains(object)) { visitedElems.add(object); @@ -3614,16 +3723,16 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal return aeDesc; } } - JSValue* primitive = object->toPrimitive(exec); + JSValuePtr primitive = object->toPrimitive(exec); if (exec->hadException()) { exec->clearException(); return [NSAppleEventDescriptor nullDescriptor]; } return aeDescFromJSValue(exec, primitive); } - if (jsValue->isUndefined()) + if (jsValue.isUndefined()) return [NSAppleEventDescriptor descriptorWithTypeCode:cMissingValue]; - ASSERT(jsValue->isNull()); + ASSERT(jsValue.isNull()); return [NSAppleEventDescriptor nullDescriptor]; } @@ -3634,7 +3743,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal return nil; if (!coreFrame->document()) return nil; - JSValue* result = coreFrame->loader()->executeScript(script, true); + JSValuePtr result = coreFrame->loader()->executeScript(script, true).jsValue(); if (!result) // FIXME: pass errors return 0; JSLock lock(false); @@ -3749,7 +3858,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal - (float)pageSizeMultiplier { - return !_private->zoomMultiplierIsTextOnly ? _private->zoomMultiplier : 1.0f; + return ![self _realZoomMultiplierIsTextOnly] ? _private->zoomMultiplier : 1.0f; } - (BOOL)canZoomPageIn @@ -3782,6 +3891,20 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal return [self _resetZoom:sender isTextOnly:NO]; } +- (void)setMediaVolume:(float)volume +{ + if (_private->page) + _private->page->setMediaVolume(volume); +} + +- (float)mediaVolume +{ + if (!_private->page) + return 0; + + return _private->page->mediaVolume(); +} + @end @implementation WebView (WebViewPrintingPrivate) @@ -4023,6 +4146,8 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal - (void)setSmartInsertDeleteEnabled:(BOOL)flag { _private->smartInsertDeleteEnabled = flag; + if (flag) + [self setSelectTrailingWhitespaceEnabled:false]; } - (BOOL)smartInsertDeleteEnabled @@ -4298,15 +4423,13 @@ static WebFrameView *containingFrameView(NSView *view) // Object cache capacities (in bytes) if (memSize >= 2048) - cacheTotalCapacity = 128 * 1024 * 1024; + cacheTotalCapacity = 96 * 1024 * 1024; else if (memSize >= 1536) - cacheTotalCapacity = 86 * 1024 * 1024; - else if (memSize >= 1024) cacheTotalCapacity = 64 * 1024 * 1024; - else if (memSize >= 512) + else if (memSize >= 1024) cacheTotalCapacity = 32 * 1024 * 1024; - else if (memSize >= 256) - cacheTotalCapacity = 16 * 1024 * 1024; + else if (memSize >= 512) + cacheTotalCapacity = 16 * 1024 * 1024; cacheMinDeadCapacity = 0; cacheMaxDeadCapacity = 0; @@ -4332,15 +4455,13 @@ static WebFrameView *containingFrameView(NSView *view) // Object cache capacities (in bytes) if (memSize >= 2048) - cacheTotalCapacity = 128 * 1024 * 1024; + cacheTotalCapacity = 96 * 1024 * 1024; else if (memSize >= 1536) - cacheTotalCapacity = 86 * 1024 * 1024; - else if (memSize >= 1024) cacheTotalCapacity = 64 * 1024 * 1024; - else if (memSize >= 512) + else if (memSize >= 1024) cacheTotalCapacity = 32 * 1024 * 1024; - else if (memSize >= 256) - cacheTotalCapacity = 16 * 1024 * 1024; + else if (memSize >= 512) + cacheTotalCapacity = 16 * 1024 * 1024; cacheMinDeadCapacity = cacheTotalCapacity / 8; cacheMaxDeadCapacity = cacheTotalCapacity / 4; @@ -4386,15 +4507,13 @@ static WebFrameView *containingFrameView(NSView *view) // browsing pattern. Even growth above 128MB can have substantial // value / MB for some content / browsing patterns.) if (memSize >= 2048) - cacheTotalCapacity = 256 * 1024 * 1024; + cacheTotalCapacity = 128 * 1024 * 1024; else if (memSize >= 1536) - cacheTotalCapacity = 172 * 1024 * 1024; + cacheTotalCapacity = 96 * 1024 * 1024; else if (memSize >= 1024) - cacheTotalCapacity = 128 * 1024 * 1024; - else if (memSize >= 512) cacheTotalCapacity = 64 * 1024 * 1024; - else if (memSize >= 256) - cacheTotalCapacity = 32 * 1024 * 1024; + else if (memSize >= 512) + cacheTotalCapacity = 32 * 1024 * 1024; cacheMinDeadCapacity = cacheTotalCapacity / 4; cacheMaxDeadCapacity = cacheTotalCapacity / 2; @@ -5172,6 +5291,18 @@ id CallResourceLoadDelegate(IMP implementation, WebView *self, SEL selector, id return CallDelegate(implementation, self, self->_private->resourceProgressDelegate, selector, object1, object2, integer, object3); } +BOOL CallResourceLoadDelegateReturningBoolean(BOOL result, IMP implementation, WebView *self, SEL selector, id object1, id object2) +{ + if (!self->_private->catchesDelegateExceptions) + return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, id)>(objc_msgSend)(self->_private->resourceProgressDelegate, selector, self, object1, object2); + @try { + return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, id)>(objc_msgSend)(self->_private->resourceProgressDelegate, selector, self, object1, object2); + } @catch(id exception) { + ReportDiscardedDelegateException(selector, exception); + } + return result; +} + // The form delegate needs to have it's own implementation, because the first argument is never the WebView id CallFormDelegate(WebView *self, SEL selector, id object1, id object2) @@ -5220,3 +5351,39 @@ BOOL CallFormDelegateReturningBoolean(BOOL result, WebView *self, SEL selector, } @end + +#ifdef BUILDING_ON_LEOPARD + +static IMP originalRecursivelyRemoveMailAttributesImp; + +static id objectElementDataAttribute(DOMHTMLObjectElement *self, SEL) +{ + return [self getAttribute:@"data"]; +} + +static void recursivelyRemoveMailAttributes(DOMNode *self, SEL selector, BOOL a, BOOL b, BOOL c) +{ + // While inside this Mail function, change the behavior of -[DOMHTMLObjectElement data] back to what it used to be + // before we fixed a bug in it (see http://trac.webkit.org/changeset/30044 for that change). + + // It's a little bit strange to patch a method defined by WebKit, but it helps keep this workaround self-contained. + + Method methodToPatch = class_getInstanceMethod(objc_getRequiredClass("DOMHTMLObjectElement"), @selector(data)); + IMP originalDataImp = method_setImplementation(methodToPatch, reinterpret_cast<IMP>(objectElementDataAttribute)); + originalRecursivelyRemoveMailAttributesImp(self, selector, a, b, c); + method_setImplementation(methodToPatch, originalDataImp); +} + +#endif + +static void patchMailRemoveAttributesMethod() +{ +#ifdef BUILDING_ON_LEOPARD + if (!WKAppVersionCheckLessThan(@"com.apple.mail", -1, 4.0)) + return; + Method methodToPatch = class_getInstanceMethod(objc_getRequiredClass("DOMNode"), @selector(recursivelyRemoveMailAttributes:convertObjectsToImages:convertEditableElements:)); + if (!methodToPatch) + return; + originalRecursivelyRemoveMailAttributesImp = method_setImplementation(methodToPatch, reinterpret_cast<IMP>(recursivelyRemoveMailAttributes)); +#endif +} diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h index 39b3ef5..25afb64 100644 --- a/WebKit/mac/WebView/WebViewInternal.h +++ b/WebKit/mac/WebView/WebViewInternal.h @@ -159,6 +159,7 @@ typedef struct _WebResourceDelegateImplementationCache { IMP didLoadResourceFromMemoryCacheFunc; IMP willCacheResponseFunc; IMP plugInFailedWithErrorFunc; + IMP shouldUseCredentialStorageFunc; } WebResourceDelegateImplementationCache; typedef struct _WebFrameLoadDelegateImplementationCache { @@ -177,6 +178,7 @@ typedef struct _WebFrameLoadDelegateImplementationCache { IMP didFailLoadWithErrorForFrameFunc; IMP didFinishLoadForFrameFunc; IMP didFirstLayoutInFrameFunc; + IMP didFirstVisuallyNonEmptyLayoutInFrameFunc; IMP didReceiveIconForFrameFunc; IMP didFinishDocumentLoadForFrameFunc; } WebFrameLoadDelegateImplementationCache; @@ -216,4 +218,6 @@ id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id, id); id CallResourceLoadDelegate(IMP, WebView *, SEL, id, NSInteger, id); id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, NSInteger, id); +BOOL CallResourceLoadDelegateReturningBoolean(BOOL, IMP, WebView *, SEL, id, id); + #endif diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h index 3a33bf9..95e1249 100644 --- a/WebKit/mac/WebView/WebViewPrivate.h +++ b/WebKit/mac/WebView/WebViewPrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -177,6 +177,10 @@ typedef enum { - (BOOL)canResetPageZoom; - (IBAction)resetPageZoom:(id)sender; +// Sets a master volume control for all media elements in the WebView. Valid values are 0..1. +- (void)setMediaVolume:(float)volume; +- (float)mediaVolume; + @end @interface WebView (WebPrivate) @@ -362,6 +366,8 @@ Could be worth adding to the API. - (BOOL)usesPageCache; - (void)setUsesPageCache:(BOOL)usesPageCache; +- (WebHistoryItem *)_globalHistoryItem; + /*! @method textIteratorForRect: @param rectangle from which we want the WebTextIterator to load text from @@ -394,6 +400,12 @@ Could be worth adding to the API. - (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews; - (BOOL)_usesDocumentViews; +- (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag; +- (BOOL)isSelectTrailingWhitespaceEnabled; + +- (void)setMemoryCacheDelegateCallsEnabled:(BOOL)suspend; +- (BOOL)areMemoryCacheDelegateCallsEnabled; + @end @interface WebView (WebViewPrintingPrivate) @@ -446,6 +458,8 @@ Could be worth adding to the API. // Addresses 4192534. SPI for now. - (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame; +- (void)webView:(WebView *)sender didFirstVisuallyNonEmptyLayoutInFrame:(WebFrame *)frame; + @end @interface NSObject (WebResourceLoadDelegatePrivate) |