auto import from //depot/cupcake/@136594
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b44c423..457e527 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,207 @@
+2009-01-26  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Sam Weinig.
+
+        Clean up after r40240.
+
+        * WebKit.xcodeproj/project.pbxproj: Reinstate WebKitPluginHost.defs.
+
+2009-01-25  Darin Adler  <darin@apple.com>
+
+        Try to fix full build on Mac Leopard.
+
+        * WebKit.xcodeproj/project.pbxproj: Removed WebKitPluginClient.defs from the WebKit target.
+        Maybe this is temporary, but I had to do it to get the full build to succeed.
+
+2009-01-25  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Dan Bernstein.
+
+        Improve the consistency of settings in our .xcconfig files.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2009-01-23  Brady Eidson  <beidson@apple.com>
+
+        Rubberstamped by Darin Adler
+
+        Rename CachedPagePlatformData to CachedFramePlatformData to more accurately reflect its true role.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2009-01-20  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add ProxyInstance files.
+        
+        * WebKit.xcodeproj/project.pbxproj:
+
+2009-01-04  David Kilzer  <ddkilzer@apple.com>
+
+        Don't install internal headers in WebKit framework
+
+        Reviewed by Darin Adler.
+
+        * WebKit.xcodeproj/project.pbxproj: Remove roles from internal
+        headers so they're not installed.
+
+2009-01-02  Darin Adler  <darin@apple.com>
+
+        * StringsNotToBeLocalized.txt: Updated.
+
+2008-12-23  Darin Adler  <darin@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        - fix https://bugs.webkit.org/show_bug.cgi?id=22976
+          crash due to Mail's use of WebArchive and WebResource on non-main thread
+
+        * StringsNotToBeLocalized.txt: Updated.
+
+        * WebKit.xcodeproj/project.pbxproj: Added new file WebNSObjectExtras.mm and
+        existing file WebResourceInternal.h.
+
+2008-12-08  David Kilzer  <ddkilzer@apple.com>
+
+        Bug 22555: Sort "children" sections in Xcode project files
+
+        <https://bugs.webkit.org/show_bug.cgi?id=22555>
+
+        Reviewed by Eric Seidel.
+
+        * WebKit.xcodeproj/project.pbxproj: Sorted.
+
+2008-12-08  Darin Adler  <darin@apple.com>
+
+        * StringsNotToBeLocalized.txt: Updated for recent changes.
+
+2008-12-05  Dan Bernstein  <mitz@apple.com>
+
+        Mac build fix.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-12-05  Dan Bernstein  <mitz@apple.com>
+
+        Mac build fix.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-12-04  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add HostedNetscapePluginStream.
+        
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-12-03  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+        
+        Move WebPluginRequest to its own file.
+        
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-12-03  Steve Falkenburg  <sfalken@apple.com>
+
+        Update strings not to be localized.
+
+        Reviewed by Adam Roben.
+
+        * StringsNotToBeLocalized.txt:
+
+2008-11-26  Mark Rowe  <mrowe@apple.com>
+
+        Build fix.
+
+        Fix up the references to files under WebKit/mac/Plugins/Hosted.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-11-26  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Add plug-in host related files to the Xcode project.
+        
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-11-14  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - part of <rdar://problem/6234337> Add a Text Direction menu to the default context menu when appropriate
+
+        * English.lproj/Localizable.strings: Added the Text Direction submenu
+        title.
+
+2008-11-13  John Sullivan  <sullivan@apple.com>
+
+        fixed <rdar://problem/6361578> Web Kit UI strings: a few edits
+
+        Reviewed by Tim Hatcher
+
+        * English.lproj/Localizable.strings:
+        updated for these changes
+        
+        * StringsNotToBeLocalized.txt:
+        removed unused exception
+
+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
+
+        * English.lproj/Localizable.strings:
+        * StringsNotToBeLocalized.txt:
+        updated for this change
+
+2008-11-10  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Kevin Decker.
+        
+        Add WebHostedNetscapePluginView to the project.
+        
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-11-10  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Kevin Decker.
+
+        Add a new WebBaseNetscapePluginView class.
+        
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-11-10  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Adam Roben.
+                
+        Rename WebBaseNetscapePluginView to WebNetscapePluginView.
+
+        * StringsNotToBeLocalized.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-11-05  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Kevin Decker.
+
+        Remove WebPlugInStreamLoaderDelegate.h
+        
+        * WebKit.xcodeproj/project.pbxproj:
+
+2008-11-03  Darin Adler  <darin@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        - https://bugs.webkit.org/show_bug.cgi?id=22061
+          create script to check for exit-time destructors
+
+        * WebKit.xcodeproj/project.pbxproj: Added a script
+        phase that runs the check-for-exit-time-destructors script.
+
 2008-10-31  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Kevin Decker.
diff --git a/WebKit/English.lproj/Localizable.strings b/WebKit/English.lproj/Localizable.strings
index f243968..c1584f9 100644
--- a/WebKit/English.lproj/Localizable.strings
+++ b/WebKit/English.lproj/Localizable.strings
Binary files differ
diff --git a/WebKit/StringsNotToBeLocalized.txt b/WebKit/StringsNotToBeLocalized.txt
index 183c16b..2cc5d69 100644
--- a/WebKit/StringsNotToBeLocalized.txt
+++ b/WebKit/StringsNotToBeLocalized.txt
@@ -103,6 +103,9 @@
 "BEGIN:VCARD"
 "BP_CreatePluginMIMETypesPreferences"
 "CFDictionaryPropertyBag"
+"CFNetwork"
+"CFNetwork_debug"
+"CFURLCacheCopySharedURLCache"
 "CSS"
 "Content-Encoding"
 "Content-Length"
@@ -118,6 +121,10 @@
 "DeleteWordBackward"
 "DeleteWordForward"
 "FD3B2381-0BB6-4B59-AF09-0E599C8901CF"
+"FastMallocFreeSizeInCaches"
+"FastMallocFreeSizeInHeap"
+"FastMallocHeapSize"
+"FastMallocReturnedSize"
 "FrameName"
 "GEN_DOMObject"
 "GroupName"
@@ -143,6 +150,8 @@
 "InsertTab"
 "Intel"
 "JavaScript"
+"JavaScriptFreeSize"
+"JavaScriptHeapSize"
 "Joy!peff"
 "KWQScrollBar"
 "LTR"
@@ -150,7 +159,9 @@
 "Library/Internet Plug-Ins"
 "LresultFromObject"
 "Lucida Grande"
+"MIMEType"
 "MIME\\Database\\Content Type"
+"MainPageJavaScript.js"
 "MemoryStream"
 "MoveDown"
 "MoveDownAndModifySelection"
@@ -302,6 +313,7 @@
 "WebKitOriginalTopMargin"
 "WebKitPDFs-XXXXXX"
 "WebKitPlugInStreamXXXXXX"
+"WebKitPluginHost.app"
 "WebKitPreferences.plist"
 "WebKitStatistics"
 "WebLoginWindowDidSwitchFromUserNotification"
@@ -402,8 +414,11 @@
 "application/x-java-applet"
 "application/x-webarchive"
 "application/xhtml+xml"
+"attributeKeys"
+"attributeValues"
 "b"
 "basefont"
+"bundlePath"
 "c"
 "canGoBack"
 "canGoForward"
@@ -420,6 +435,7 @@
 "com.adobe.dreamweaver-9.0"
 "com.apple.Aperture"
 "com.apple.AppKit"
+"com.apple.Dictionary"
 "com.apple.HIWebView"
 "com.apple.JavaAppletPlugin"
 "com.apple.JavaPluginCocoa"
@@ -428,6 +444,7 @@
 "com.apple.Safari"
 "com.apple.WebCore"
 "com.apple.WebKit"
+"com.apple.WebKit.PluginAgent"
 "com.apple.hiview"
 "com.apple.iWeb"
 "com.apple.mail"
@@ -436,6 +453,8 @@
 "com.lizardtech.NPDjVu"
 "com.macromedia.fireworks"
 "com.microsoft.WMP.defaultplugin"
+"copyData"
+"cpuType"
 "dir"
 "displayTitle"
 "doctype"
@@ -443,11 +462,13 @@
 "estimatedProgress"
 "eval"
 "file:"
+"frameName"
 "ftp:"
 "htm"
 "html"
 "http://"
 "http://www.google.com/search?q="
+"https"
 "i"
 "icon.db"
 "image.pict"
@@ -464,21 +485,24 @@
 "isindex"
 "javascript:"
 "js"
+"lastVisitWasFailure"
 "lastVisitedDate"
 "line-through"
 "lineNumber"
 "localhost"
 "localized string not found"
 "localizedStrings"
-"lproj"
 "mailto:"
 "mainFrameDocument"
 "mainFrameIcon"
 "mainFrameTitle"
 "mainFrameURL"
+"mainResource"
+"mimeType"
 "name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@"
 "nullplugin"
 "oleacc.dll"
+"pluginHostPath"
 "pluginspage"
 "r"
 "r+b"
@@ -488,6 +512,8 @@
 "sourceURL"
 "src"
 "sub"
+"subframeArchives"
+"subresources"
 "text/calendar"
 "text/directory"
 "text/html"
@@ -504,9 +530,11 @@
 "text/x-vcalendar"
 "text/x-vcard"
 "text/x-vcf"
+"textEncodingName"
 "tiff"
 "txt"
 "u"
+"userAgent"
 "utf-16"
 "vImagePermuteChannels_ARGB8888"
 "visitCount"
@@ -527,17 +555,24 @@
 WebKit/mac/Misc/WebKitLogging.h:"<not running on main thread>"
 WebKit/mac/Misc/WebKitVersionChecks.m:"WebKit"
 WebKit/mac/Misc/WebNSNotificationCenterExtras.m
+WebKit/mac/Misc/WebNSObjectExtras.mm:"object"
+WebKit/mac/Misc/WebNSObjectExtras.mm:"selector"
+WebKit/mac/Misc/WebNSObjectExtras.mm:"result"
 WebKit/mac/Misc/WebNSPasteboardExtras.mm
 WebKit/mac/Misc/WebNSURLExtras.mm:"file"
+WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:" OK\n"
+WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:": "
+WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:"HTTP "
+WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:"identity"
 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:" OK\n"
 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:": "
 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:"HTTP "
 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:"identity"
-WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"height"
-WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"width"
-WebKit/mac/Plugins/WebBasePluginPackage.m:"Java Applet Plugin Enabler"
+WebKit/mac/Plugins/WebBasePluginPackage.mm:"Java Applet Plugin Enabler"
 WebKit/mac/Plugins/WebNetscapePluginPackage.m:"RealPlayer Plugin"
 WebKit/mac/Plugins/WebNetscapePluginPackage.m:"main"
+WebKit/mac/Plugins/WebNetscapePluginView.mm:"height"
+WebKit/mac/Plugins/WebNetscapePluginView.mm:"width"
 WebKit/mac/Plugins/nptextinput.h
 WebKit/mac/WebCoreSupport/WebChromeClient.mm:"dialog"
 WebKit/mac/WebCoreSupport/WebChromeClient.mm:"fullscreen"
@@ -557,6 +592,7 @@
 WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:"width"
 WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"Web Inspector 2"
 WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"inspector"
+WebKit/mac/WebView/WebArchive.mm:"result"
 WebKit/mac/WebView/WebHTMLView.mm:"'%@'"
 WebKit/mac/WebView/WebHTMLView.mm:"Version:"
 WebKit/mac/WebView/WebHTMLView.mm:"applet"
@@ -583,6 +619,10 @@
 WebKit/mac/WebView/WebHTMLView.mm:"white"
 WebKit/mac/WebView/WebPreferenceKeysPrivate.h
 WebKit/mac/WebView/WebPreferences.mm
+WebKit/mac/WebView/WebResource.mm:"URL"
+WebKit/mac/WebView/WebResource.mm:"data"
+WebKit/mac/WebView/WebResource.mm:"response"
+WebKit/mac/WebView/WebResource.mm:"result"
 WebKit/mac/WebView/WebView.mm:"At least one WebView is still open."
 WebKit/mac/WebView/WebView.mm:"At least one WebView was closed with fast teardown."
 WebKit/mac/WebView/WebView.mm:"Preferences"
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index 5acf785..698deb2 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -13,10 +13,38 @@
 		06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */; };
 		14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D8252D0AF955090004F057 /* WebChromeClient.h */; };
 		14D825300AF955090004F057 /* WebChromeClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14D8252E0AF955090004F057 /* WebChromeClient.mm */; };
+		1A20D08B0ED384F20043FA9F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A20D08A0ED384F20043FA9F /* QuartzCore.framework */; };
 		1A2D754D0DE480B900F0A648 /* WebIconFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D754B0DE480B900F0A648 /* WebIconFetcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D754C0DE480B900F0A648 /* WebIconFetcher.mm */; };
 		1A2D75500DE4810E00F0A648 /* WebIconFetcherInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D754F0DE4810E00F0A648 /* WebIconFetcherInternal.h */; };
+		1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */; };
+		1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */; };
+		1A4DF5220EC8C74D006BD4B4 /* WebNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */; };
+		1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+		1A4DF5E40EC8D104006BD4B4 /* WebBaseNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */; };
+		1A4DF5E50EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */; };
+		1A77B02E0EE7730500C8A1F9 /* WebPluginRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */; };
+		1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */; };
 		1A7F9C4C0DD3DDEA0028F8A5 /* nptextinput.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7F9C4B0DD3DDEA0028F8A5 /* nptextinput.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */; };
+		1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */; };
+		1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; settings = {ATTRIBUTES = (Private, ); }; };
+		1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */; settings = {ATTRIBUTES = (Private, ); }; };
+		1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */; settings = {ATTRIBUTES = (Private, ); }; };
+		1AAF58970EDCCF15008D883D /* WebKitPluginHost.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */; settings = {ATTRIBUTES = (Private, ); }; };
+		1AAF58980EDCCF15008D883D /* WebKitPluginHostTypes.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588E0EDCCEA3008D883D /* WebKitPluginHostTypes.defs */; settings = {ATTRIBUTES = (Private, ); }; };
+		1AAF5CEA0EDDE1FE008D883D /* NetscapePluginHostManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5CE40EDDE1FE008D883D /* NetscapePluginHostManager.h */; };
+		1AAF5CEB0EDDE1FE008D883D /* NetscapePluginHostManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5CE50EDDE1FE008D883D /* NetscapePluginHostManager.mm */; };
+		1AAF5CEC0EDDE1FE008D883D /* NetscapePluginHostProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5CE60EDDE1FE008D883D /* NetscapePluginHostProxy.h */; };
+		1AAF5CED0EDDE1FE008D883D /* NetscapePluginHostProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5CE70EDDE1FE008D883D /* NetscapePluginHostProxy.mm */; };
+		1AAF5CEE0EDDE1FE008D883D /* NetscapePluginInstanceProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5CE80EDDE1FE008D883D /* NetscapePluginInstanceProxy.h */; };
+		1AAF5CEF0EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */; };
+		1AAF5CF10EDDE586008D883D /* WebKitPluginHost.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */; };
+		1AAF5D000EDDE604008D883D /* WebKitPluginClient.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */; settings = {ATTRIBUTES = (Server, ); }; };
+		1AAF5D090EDDE71D008D883D /* WebKitPluginHostTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; };
+		1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */; };
+		1AAF5FC00EDE3A92008D883D /* WebHostedNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */; };
 		1AEA66D40DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */; };
 		1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEA66D30DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm */; };
 		1AEA66D80DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA66D60DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h */; };
@@ -40,7 +68,7 @@
 		226E9E6A09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */; };
 		226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */ = {isa = PBXBuildFile; fileRef = 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
 		22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */; };
 		4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; };
 		4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; };
 		51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51079D140CED11B00077247D /* WebSecurityOrigin.mm */; };
@@ -57,12 +85,11 @@
 		51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */; };
 		51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */; };
 		51C714FB0B20F79F00E5E33C /* WebBackForwardListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */; };
-		51CBFCAD0D10E6C5002DBF51 /* WebCachedPagePlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CBFCAC0D10E6C5002DBF51 /* WebCachedPagePlatformData.h */; };
+		51CBFCAD0D10E6C5002DBF51 /* WebCachedFramePlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */; };
 		51FDC4D30B0AF5C100F84EB3 /* WebHistoryItemPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5241ADF50B1BC48A004012BD /* WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5241ADF30B1BC48A004012BD /* WebCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5241ADF40B1BC48A004012BD /* WebCache.mm */; };
 		5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */; };
-		5D4ADD690D1620350064BBB0 /* WebPlugInStreamLoaderDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D4ADD680D1620350064BBB0 /* WebPlugInStreamLoaderDelegate.h */; };
 		5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */; };
 		5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */; };
@@ -90,6 +117,8 @@
 		931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */; };
 		931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */; };
 		934C11670D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C11660D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h */; };
+		934C4A910F01406C009372C0 /* WebNSObjectExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934C4A900F01406C009372C0 /* WebNSObjectExtras.mm */; };
+		934C4AA00F0141F7009372C0 /* WebResourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */; };
 		939810110824BF01008DF038 /* WebBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		939810120824BF01008DF038 /* WebHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F520FB190221DEFD01C1A525 /* WebHistory.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		939810130824BF01008DF038 /* WebHistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -113,7 +142,6 @@
 		939810290824BF01008DF038 /* WebAuthenticationPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */; };
 		9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9398102B0824BF01008DF038 /* WebBaseNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */; };
-		9398102C0824BF01008DF038 /* WebBaseNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = F5EBC45502134BC301CA1520 /* WebBaseNetscapePluginView.h */; };
 		9398102E0824BF01008DF038 /* WebBasePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E4AF46036652150000E506 /* WebBasePluginPackage.h */; };
 		939810310824BF01008DF038 /* WebNetscapePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */; };
 		939810340824BF01008DF038 /* WebNullPluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = F5883BE0025E5E9D01000102 /* WebNullPluginView.h */; };
@@ -145,7 +173,7 @@
 		9398105E0824BF01008DF038 /* WebPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9398105F0824BF01008DF038 /* WebRenderNode.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F81C3902B67C26018635CA /* WebRenderNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		939810600824BF01008DF038 /* WebResourceLoadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		939810630824BF01008DF038 /* WebHistoryItemInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 516F296F03A6C45A00CA2D3A /* WebHistoryItemInternal.h */; settings = {ATTRIBUTES = (); }; };
+		939810630824BF01008DF038 /* WebHistoryItemInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 516F296F03A6C45A00CA2D3A /* WebHistoryItemInternal.h */; };
 		939810640824BF01008DF038 /* WebFormDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */; };
 		939810650824BF01008DF038 /* CarbonWindowAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBEE9003F9DBA103CA0DE6 /* CarbonWindowAdapter.h */; };
 		939810660824BF01008DF038 /* CarbonWindowContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBEE9203F9DBA103CA0DE6 /* CarbonWindowContentView.h */; };
@@ -213,8 +241,7 @@
 		939810CF0824BF01008DF038 /* WebAuthenticationPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */; };
 		939810D00824BF01008DF038 /* WebPanelAuthenticationHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */; };
 		939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.mm */; };
-		939810D20824BF01008DF038 /* WebBaseNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5EBC45602134BC301CA1520 /* WebBaseNetscapePluginView.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
-		939810D30824BF01008DF038 /* WebBasePluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF47036652150000E506 /* WebBasePluginPackage.m */; };
+		939810D30824BF01008DF038 /* WebBasePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF47036652150000E506 /* WebBasePluginPackage.mm */; };
 		939810D60824BF01008DF038 /* WebNetscapePluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */; };
 		939810D90824BF01008DF038 /* WebNullPluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */; };
 		939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8467275D0367158500CA2ACA /* WebPluginController.mm */; };
@@ -235,7 +262,7 @@
 		939810F80824BF01008DF038 /* WebPreferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5AEBB3D024A527601C1A526 /* WebPreferences.mm */; };
 		939810F90824BF01008DF038 /* WebRenderNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F81C3A02B67C26018635CA /* WebRenderNode.mm */; };
 		939810FC0824BF01008DF038 /* WebFormDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */; };
-		939810FD0824BF01008DF038 /* CarbonWindowAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.m */; };
+		939810FD0824BF01008DF038 /* CarbonWindowAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.mm */; };
 		939810FE0824BF01008DF038 /* CarbonWindowContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9303F9DBA103CA0DE6 /* CarbonWindowContentView.m */; };
 		939810FF0824BF01008DF038 /* CarbonWindowFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9503F9DBA103CA0DE6 /* CarbonWindowFrame.m */; };
 		939811000824BF01008DF038 /* HIViewAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9B03F9DBA103CA0DE6 /* HIViewAdapter.m */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
@@ -280,7 +307,7 @@
 		BCDFA9130C10B93E00D3A10C /* WebKitPluginContainerView.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */; };
 		C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */; };
 		C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0167BF70D7F5DD00028696E /* WebScriptDebugger.mm */; };
-		DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
 		DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; };
 		DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; };
 		ED6BE2E7088C32B50044DEDC /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */; };
@@ -299,10 +326,35 @@
 		06693DDB0BFBA85200216072 /* WebInspectorClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorClient.mm; sourceTree = "<group>"; };
 		14D8252D0AF955090004F057 /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = "<group>"; };
 		14D8252E0AF955090004F057 /* WebChromeClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebChromeClient.mm; sourceTree = "<group>"; };
+		1A20D08A0ED384F20043FA9F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
 		1A2D754B0DE480B900F0A648 /* WebIconFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconFetcher.h; sourceTree = "<group>"; };
 		1A2D754C0DE480B900F0A648 /* WebIconFetcher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebIconFetcher.mm; sourceTree = "<group>"; };
 		1A2D754F0DE4810E00F0A648 /* WebIconFetcherInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconFetcherInternal.h; sourceTree = "<group>"; };
+		1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyInstance.h; sourceTree = "<group>"; };
+		1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProxyInstance.mm; sourceTree = "<group>"; };
+		1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginView.h; sourceTree = "<group>"; };
+		1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginView.mm; sourceTree = "<group>"; };
+		1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginView.h; sourceTree = "<group>"; };
+		1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebBaseNetscapePluginView.mm; sourceTree = "<group>"; };
+		1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginRequest.h; sourceTree = "<group>"; };
+		1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginRequest.m; sourceTree = "<group>"; };
 		1A7F9C4B0DD3DDEA0028F8A5 /* nptextinput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nptextinput.h; sourceTree = "<group>"; };
+		1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HostedNetscapePluginStream.h; sourceTree = "<group>"; };
+		1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HostedNetscapePluginStream.mm; sourceTree = "<group>"; };
+		1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgent.defs; sourceTree = "<group>"; };
+		1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgentReply.defs; sourceTree = "<group>"; };
+		1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginClient.defs; sourceTree = "<group>"; };
+		1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginHost.defs; sourceTree = "<group>"; };
+		1AAF588E0EDCCEA3008D883D /* WebKitPluginHostTypes.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginHostTypes.defs; sourceTree = "<group>"; };
+		1AAF5CE40EDDE1FE008D883D /* NetscapePluginHostManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginHostManager.h; sourceTree = "<group>"; };
+		1AAF5CE50EDDE1FE008D883D /* NetscapePluginHostManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginHostManager.mm; sourceTree = "<group>"; };
+		1AAF5CE60EDDE1FE008D883D /* NetscapePluginHostProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginHostProxy.h; sourceTree = "<group>"; };
+		1AAF5CE70EDDE1FE008D883D /* NetscapePluginHostProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginHostProxy.mm; sourceTree = "<group>"; };
+		1AAF5CE80EDDE1FE008D883D /* NetscapePluginInstanceProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginInstanceProxy.h; sourceTree = "<group>"; };
+		1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginInstanceProxy.mm; sourceTree = "<group>"; };
+		1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPluginHostTypes.h; sourceTree = "<group>"; };
+		1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHostedNetscapePluginView.h; sourceTree = "<group>"; };
+		1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHostedNetscapePluginView.mm; sourceTree = "<group>"; };
 		1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandler.h; sourceTree = "<group>"; };
 		1AEA66D30DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginEventHandler.mm; sourceTree = "<group>"; };
 		1AEA66D60DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandlerCarbon.h; sourceTree = "<group>"; };
@@ -389,7 +441,7 @@
 		51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManagerInternal.h; sourceTree = "<group>"; };
 		51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseDelegate.h; sourceTree = "<group>"; };
 		51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardListInternal.h; sourceTree = "<group>"; };
-		51CBFCAC0D10E6C5002DBF51 /* WebCachedPagePlatformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCachedPagePlatformData.h; sourceTree = "<group>"; };
+		51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCachedFramePlatformData.h; sourceTree = "<group>"; };
 		51E94C3406C0321200A9B09E /* WebPDFView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		51E94C3506C0321200A9B09E /* WebPDFView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPDFView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		51E94C6806C0347500A9B09E /* WebPDFRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -398,7 +450,6 @@
 		5241ADF30B1BC48A004012BD /* WebCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCache.h; sourceTree = "<group>"; };
 		5241ADF40B1BC48A004012BD /* WebCache.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCache.mm; sourceTree = "<group>"; };
 		5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyProtocolDefinitions.h; sourceTree = "<group>"; };
-		5D4ADD680D1620350064BBB0 /* WebPlugInStreamLoaderDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPlugInStreamLoaderDelegate.h; sourceTree = "<group>"; };
 		5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; };
 		5D7BF8130C2A1D90008CE06D /* WebInspector.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspector.mm; sourceTree = "<group>"; };
 		5DE83A750D0F7F9400CAD12A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/WebJavaScriptTextInputPanel.nib; sourceTree = SOURCE_ROOT; };
@@ -439,7 +490,7 @@
 		8398847A03426FB000BC5F5E /* WebNSImageExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSImageExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		8398847B03426FB000BC5F5E /* WebNSImageExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSImageExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		83E4AF46036652150000E506 /* WebBasePluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBasePluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-		83E4AF47036652150000E506 /* WebBasePluginPackage.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebBasePluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+		83E4AF47036652150000E506 /* WebBasePluginPackage.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebBasePluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		83E4AF4B036659440000E506 /* WebPluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		83E4AF4C036659440000E506 /* WebPluginPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactoryPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -476,6 +527,8 @@
 		9345DDB20365FFD0008635CE /* WebNSControlExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSControlExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		9345DDB30365FFD0008635CE /* WebNSControlExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSControlExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		934C11660D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDynamicScrollBarsViewInternal.h; sourceTree = "<group>"; };
+		934C4A900F01406C009372C0 /* WebNSObjectExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSObjectExtras.mm; sourceTree = "<group>"; };
+		934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceInternal.h; sourceTree = "<group>"; };
 		939811320824BF01008DF038 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 1; };
 		939811330824BF01008DF038 /* WebKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		93AEB17D032C1735008635CE /* WebKitLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitLogging.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -555,8 +608,6 @@
 		F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
 		F5E0A76E02B8FEE401C1A525 /* WebURLsWithTitles.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebURLsWithTitles.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F5E0A76F02B8FEE401C1A525 /* WebURLsWithTitles.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebURLsWithTitles.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-		F5EBC45502134BC301CA1520 /* WebBaseNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-		F5EBC45602134BC301CA1520 /* WebBaseNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebBaseNetscapePluginView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F5F717200288493C018635CA /* WebPluginDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginDatabase.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -572,7 +623,7 @@
 		F79B974804019934036909D2 /* CarbonUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonUtils.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F79B974904019934036909D2 /* CarbonUtils.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CarbonUtils.m; sourceTree = "<group>"; usesTabs = 0; };
 		F7EBEE9003F9DBA103CA0DE6 /* CarbonWindowAdapter.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonWindowAdapter.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-		F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = CarbonWindowAdapter.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+		F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CarbonWindowAdapter.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F7EBEE9203F9DBA103CA0DE6 /* CarbonWindowContentView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonWindowContentView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F7EBEE9303F9DBA103CA0DE6 /* CarbonWindowContentView.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = CarbonWindowContentView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F7EBEE9403F9DBA103CA0DE6 /* CarbonWindowFrame.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonWindowFrame.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -595,6 +646,7 @@
 				939811290824BF01008DF038 /* Carbon.framework in Frameworks */,
 				9398112A0824BF01008DF038 /* Cocoa.framework in Frameworks */,
 				9398112B0824BF01008DF038 /* JavaScriptCore.framework in Frameworks */,
+				1A20D08B0ED384F20043FA9F /* QuartzCore.framework in Frameworks */,
 				9398112F0824BF01008DF038 /* Security.framework in Frameworks */,
 				9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */,
 				9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */,
@@ -644,10 +696,11 @@
 			children = (
 				F5C2869402846DCD018635CA /* Carbon.framework */,
 				F5C2869502846DCD018635CA /* Cocoa.framework */,
-				830E81E005853AC000AD0891 /* Security.framework */,
-				93D623DD051E791F002F47DD /* libicucore.dylib */,
 				F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */,
+				1A20D08A0ED384F20043FA9F /* QuartzCore.framework */,
+				830E81E005853AC000AD0891 /* Security.framework */,
 				F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */,
+				93D623DD051E791F002F47DD /* libicucore.dylib */,
 			);
 			name = "Frameworks and Libraries";
 			sourceTree = "<group>";
@@ -657,15 +710,15 @@
 		089C1665FE841158C02AAC07 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */,
 				939811320824BF01008DF038 /* Info.plist */,
 				5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */,
 				ED3B48DE0CC51F7E00DFF1EB /* StringsNotToBeLocalized.txt */,
-				F5883BDE025E5C6A01000102 /* nullplugin.tiff */,
-				F5B67130023EDF8901C1A525 /* url_icon.tiff */,
-				9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */,
 				5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */,
 				5DE83A760D0F7F9400CAD12A /* WebViewEditingContextMenu.nib */,
 				5DE83A780D0F7F9400CAD12A /* WebViewEditingContextMenuOld.nib */,
+				F5883BDE025E5C6A01000102 /* nullplugin.tiff */,
+				F5B67130023EDF8901C1A525 /* url_icon.tiff */,
 			);
 			name = Resources;
 			path = mac/Resources;
@@ -673,6 +726,31 @@
 			tabWidth = 4;
 			usesTabs = 0;
 		};
+		1A1F91430ECBB16F006351DA /* Hosted */ = {
+			isa = PBXGroup;
+			children = (
+				1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */,
+				1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */,
+				1AAF5CE40EDDE1FE008D883D /* NetscapePluginHostManager.h */,
+				1AAF5CE50EDDE1FE008D883D /* NetscapePluginHostManager.mm */,
+				1AAF5CE60EDDE1FE008D883D /* NetscapePluginHostProxy.h */,
+				1AAF5CE70EDDE1FE008D883D /* NetscapePluginHostProxy.mm */,
+				1AAF5CE80EDDE1FE008D883D /* NetscapePluginInstanceProxy.h */,
+				1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */,
+				1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */,
+				1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */,
+				1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */,
+				1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */,
+				1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */,
+				1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */,
+				1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */,
+				1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */,
+				1AAF588E0EDCCEA3008D883D /* WebKitPluginHostTypes.defs */,
+				1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */,
+			);
+			path = Hosted;
+			sourceTree = "<group>";
+		};
 		1A9C78030EBBC455008599D4 /* Events */ = {
 			isa = PBXGroup;
 			children = (
@@ -707,8 +785,8 @@
 			children = (
 				1C904FD50BA9DD0F0081E9D0 /* Base.xcconfig */,
 				1C904FD40BA9DD0F0081E9D0 /* DebugRelease.xcconfig */,
-				1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */,
 				1C904FD30BA9DD0F0081E9D0 /* Version.xcconfig */,
+				1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */,
 			);
 			name = Configurations;
 			path = mac/Configurations;
@@ -720,6 +798,7 @@
 			isa = PBXGroup;
 			children = (
 				5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */,
+				1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */,
 				5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */,
 				5241ADF30B1BC48A004012BD /* WebCache.h */,
 				5241ADF40B1BC48A004012BD /* WebCache.mm */,
@@ -730,8 +809,8 @@
 				ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */,
 				DD89681E09AA87240097E7F0 /* WebElementDictionary.h */,
 				DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */,
-				1CA57D600AED6A470009BDD0 /* WebGraphicsExtras.h */,
 				1CA57D610AED6A470009BDD0 /* WebGraphicsExtras.c */,
+				1CA57D600AED6A470009BDD0 /* WebGraphicsExtras.h */,
 				F528E3E9031E91AD01CA2ACA /* WebIconDatabase.h */,
 				F528E3EA031E91AD01CA2ACA /* WebIconDatabase.mm */,
 				51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */,
@@ -749,8 +828,8 @@
 				7082F56F038EADAA00A80180 /* WebKitNSStringExtras.h */,
 				7082F570038EADAA00A80180 /* WebKitNSStringExtras.m */,
 				F53444CE02E87CBA018635CA /* WebKitStatistics.h */,
-				F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */,
 				F53444CF02E87CBA018635CA /* WebKitStatistics.m */,
+				F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */,
 				BEE52D4A0473032500CA289C /* WebKitSystemBits.h */,
 				BEE52D4B0473032500CA289C /* WebKitSystemBits.m */,
 				1C0D40850AC1C8F40009C113 /* WebKitVersionChecks.h */,
@@ -777,6 +856,7 @@
 				51494D220C7EC1B6004178C5 /* WebNSNotificationCenterExtras.h */,
 				51494D230C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m */,
 				93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */,
+				934C4A900F01406C009372C0 /* WebNSObjectExtras.mm */,
 				ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */,
 				ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.mm */,
 				EDD1A5C605C83987008E3150 /* WebNSPrintOperationExtras.h */,
@@ -794,7 +874,6 @@
 				F59668C802AD2923018635CA /* WebStringTruncator.h */,
 				F59668C902AD2923018635CA /* WebStringTruncator.m */,
 				DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */,
-				1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */,
 			);
 			name = Misc;
 			path = mac/Misc;
@@ -809,8 +888,8 @@
 				3944607E020F50ED0ECA1767 /* WebBackForwardList.mm */,
 				51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */,
 				22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */,
-				65DA2608052CC18700A97B31 /* WebHistory.mm */,
 				F520FB190221DEFD01C1A525 /* WebHistory.h */,
+				65DA2608052CC18700A97B31 /* WebHistory.mm */,
 				93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */,
 				3944607F020F50ED0ECA1767 /* WebHistoryItem.h */,
 				39446080020F50ED0ECA1767 /* WebHistoryItem.mm */,
@@ -877,18 +956,21 @@
 			isa = PBXGroup;
 			children = (
 				1A9C78030EBBC455008599D4 /* Events */,
-				F5F717230288493C018635CA /* npapi.mm */,
-				1A7F9C4B0DD3DDEA0028F8A5 /* nptextinput.h */,
+				1A1F91430ECBB16F006351DA /* Hosted */,
 				F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */,
 				F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.mm */,
-				F5EBC45502134BC301CA1520 /* WebBaseNetscapePluginView.h */,
-				F5EBC45602134BC301CA1520 /* WebBaseNetscapePluginView.mm */,
-				BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */,
-				BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */,
+				1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */,
+				1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */,
+				226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */,
+				226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */,
 				F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */,
 				F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */,
-				226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */,
-				226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */,
+				1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */,
+				1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */,
+				1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */,
+				1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */,
+				F5F717230288493C018635CA /* npapi.mm */,
+				1A7F9C4B0DD3DDEA0028F8A5 /* nptextinput.h */,
 			);
 			name = "Netscape Plug-ins";
 			sourceTree = "<group>";
@@ -896,19 +978,21 @@
 		848DFF430365F71500CA2ACA /* WebKit Plug-ins */ = {
 			isa = PBXGroup;
 			children = (
+				51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */,
+				BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */,
+				BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */,
 				848DFF840365FE6A00CA2ACA /* WebPlugin.h */,
-				225F881409F97E8A00423A40 /* WebPluginPrivate.h */,
 				848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */,
-				65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */,
 				65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */,
 				65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.mm */,
+				65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */,
 				8467275C0367158500CA2ACA /* WebPluginController.h */,
 				8467275D0367158500CA2ACA /* WebPluginController.mm */,
 				83E4AF4B036659440000E506 /* WebPluginPackage.h */,
 				83E4AF4C036659440000E506 /* WebPluginPackage.m */,
+				225F881409F97E8A00423A40 /* WebPluginPrivate.h */,
 				848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */,
 				83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */,
-				51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */,
 			);
 			name = "WebKit Plug-ins";
 			sourceTree = "<group>";
@@ -916,64 +1000,65 @@
 		9C7CABBB0190A37C0ECA16EA /* WebView */ = {
 			isa = PBXGroup;
 			children = (
-				F834AAD50E64B1C700E2737C /* WebTextIterator.h */,
-				F834AAD60E64B1C700E2737C /* WebTextIterator.mm */,
 				F52CA6BD02DF9D0F018635CA /* HTML */,
 				51E94C0706C02CA300A9B09E /* PDF */,
 				8373435A0624EE0D00F3B289 /* WebArchive.h */,
+				8373435B0624EE0D00F3B289 /* WebArchive.mm */,
 				933D659903413FF2008635CE /* WebClipView.h */,
+				933D659A03413FF2008635CE /* WebClipView.m */,
 				39446070020F50ED0ECA1767 /* WebDataSource.h */,
+				39446071020F50ED0ECA1767 /* WebDataSource.mm */,
 				658A40950A14853B005E6987 /* WebDataSourceInternal.h */,
 				39446072020F50ED0ECA1767 /* WebDataSourcePrivate.h */,
 				35081DAE02B6D4F50ACA2ACA /* WebDocument.h */,
 				ED21B9810528F7AA003299AC /* WebDocumentInternal.h */,
 				65FFB7FA0AD0B7D30048CD05 /* WebDocumentLoaderMac.h */,
+				65FFB7FB0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm */,
 				833987810543012D00EE146E /* WebDocumentPrivate.h */,
 				3944606B020F50ED0ECA1767 /* WebDynamicScrollBarsView.h */,
+				3944606C020F50ED0ECA1767 /* WebDynamicScrollBarsView.m */,
 				934C11660D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h */,
 				BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */,
 				1C8CB0790AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h */,
 				2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */,
+				2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */,
 				2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */,
 				39446074020F50ED0ECA1767 /* WebFrame.h */,
+				F5143A370221DCCE01A80181 /* WebFrame.mm */,
 				930D02BD06275F710076701E /* WebFrameInternal.h */,
 				5152FAE5033FC52200CA2ACD /* WebFrameLoadDelegate.h */,
 				9CF0E249021361B00ECA16EA /* WebFramePrivate.h */,
 				51A8B52E04282B5900CA2D3A /* WebFrameView.h */,
+				51A8B52F04282B5900CA2D3A /* WebFrameView.mm */,
 				51A8B53204282BD200CA2D3A /* WebFrameViewInternal.h */,
 				93C6F14507920B93002449CD /* WebFrameViewPrivate.h */,
 				51443F9A0429392B00CA2D3A /* WebPolicyDelegate.h */,
+				51443F9B0429392B00CA2D3A /* WebPolicyDelegate.mm */,
 				51443F9C0429392B00CA2D3A /* WebPolicyDelegatePrivate.h */,
 				EDE850CD06ECC79E005FAB05 /* WebPreferenceKeysPrivate.h */,
 				3944606E020F50ED0ECA1767 /* WebPreferences.h */,
+				F5AEBB3D024A527601C1A526 /* WebPreferences.mm */,
 				9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */,
 				F5F81C3902B67C26018635CA /* WebRenderNode.h */,
 				F5F81C3A02B67C26018635CA /* WebRenderNode.mm */,
 				84311A1205EAAAF00088EDA4 /* WebResource.h */,
-				84311AF105EAB12B0088EDA4 /* WebResourcePrivate.h */,
+				84311A1305EAAAF00088EDA4 /* WebResource.mm */,
+				934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */,
 				513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */,
 				656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */,
+				84311AF105EAB12B0088EDA4 /* WebResourcePrivate.h */,
 				7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */,
+				7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */,
 				C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */,
 				C0167BF70D7F5DD00028696E /* WebScriptDebugger.mm */,
+				F834AAD50E64B1C700E2737C /* WebTextIterator.h */,
+				F834AAD60E64B1C700E2737C /* WebTextIterator.mm */,
 				515E27CC0458C86500CA2D3A /* WebUIDelegate.h */,
 				65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */,
 				51A8B579042834F700CA2D3A /* WebView.h */,
+				51A8B57A042834F700CA2D3A /* WebView.mm */,
 				930D02BB06275F640076701E /* WebViewInternal.h */,
 				51A8B57D0428353A00CA2D3A /* WebViewPrivate.h */,
-				8373435B0624EE0D00F3B289 /* WebArchive.mm */,
-				933D659A03413FF2008635CE /* WebClipView.m */,
-				39446071020F50ED0ECA1767 /* WebDataSource.mm */,
-				65FFB7FB0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm */,
-				3944606C020F50ED0ECA1767 /* WebDynamicScrollBarsView.m */,
-				2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */,
-				F5143A370221DCCE01A80181 /* WebFrame.mm */,
-				51A8B52F04282B5900CA2D3A /* WebFrameView.mm */,
-				51443F9B0429392B00CA2D3A /* WebPolicyDelegate.mm */,
-				F5AEBB3D024A527601C1A526 /* WebPreferences.mm */,
-				84311A1305EAAAF00088EDA4 /* WebResource.mm */,
-				7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */,
-				51A8B57A042834F700CA2D3A /* WebView.mm */,
 			);
 			name = WebView;
 			path = mac/WebView;
@@ -1000,8 +1085,8 @@
 			isa = PBXGroup;
 			children = (
 				846171F90624AE5B0071A4A3 /* WebDOMOperations.h */,
-				84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */,
 				846171FA0624AE5B0071A4A3 /* WebDOMOperations.mm */,
+				84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */,
 			);
 			name = DOM;
 			path = mac/DOM;
@@ -1012,7 +1097,7 @@
 		F5B36B400281DE87018635CB /* WebCoreSupport */ = {
 			isa = PBXGroup;
 			children = (
-				51CBFCAC0D10E6C5002DBF51 /* WebCachedPagePlatformData.h */,
+				51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */,
 				14D8252D0AF955090004F057 /* WebChromeClient.h */,
 				14D8252E0AF955090004F057 /* WebChromeClient.mm */,
 				065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */,
@@ -1027,18 +1112,18 @@
 				51494CD50C7EBDE0004178C5 /* WebIconDatabaseClient.mm */,
 				9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
 				06693DDA0BFBA85200216072 /* WebInspectorClient.h */,
-				1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */,
 				06693DDB0BFBA85200216072 /* WebInspectorClient.mm */,
+				1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */,
 				9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */,
 				9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */,
 				84723BE3056D719E0044BFEA /* WebKeyGenerator.h */,
 				84723BE4056D719E0044BFEA /* WebKeyGenerator.m */,
+				A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */,
+				A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */,
 				93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
 				93EB178C09F88D460091F8FF /* WebSystemInterface.m */,
 				F5F7174C02885C5B018635CA /* WebViewFactory.h */,
 				F5F7174D02885C5B018635CA /* WebViewFactory.mm */,
-				A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */,
-				A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */,
 			);
 			name = WebCoreSupport;
 			path = mac/WebCoreSupport;
@@ -1049,17 +1134,16 @@
 		F5EBC45202134BB601CA1520 /* Plugins */ = {
 			isa = PBXGroup;
 			children = (
-				224100F2091818D900D2D266 /* WebPluginsPrivate.h */,
-				224100F80918190100D2D266 /* WebPluginsPrivate.m */,
 				848DFF410365F6FB00CA2ACA /* Netscape Plug-ins */,
 				848DFF430365F71500CA2ACA /* WebKit Plug-ins */,
 				83E4AF46036652150000E506 /* WebBasePluginPackage.h */,
-				83E4AF47036652150000E506 /* WebBasePluginPackage.m */,
+				83E4AF47036652150000E506 /* WebBasePluginPackage.mm */,
 				F5883BE0025E5E9D01000102 /* WebNullPluginView.h */,
 				F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */,
 				F5F717200288493C018635CA /* WebPluginDatabase.h */,
 				F5F717210288493C018635CA /* WebPluginDatabase.mm */,
-				5D4ADD680D1620350064BBB0 /* WebPlugInStreamLoaderDelegate.h */,
+				224100F2091818D900D2D266 /* WebPluginsPrivate.h */,
+				224100F80918190100D2D266 /* WebPluginsPrivate.m */,
 			);
 			name = Plugins;
 			path = mac/Plugins;
@@ -1071,8 +1155,8 @@
 			isa = PBXGroup;
 			children = (
 				F7EBEECF03F9DBBD03CA0DE6 /* AppKit Overrides */,
-				F7EBEED203F9DBFE03CA0DE6 /* Glue */,
 				F7EBEED103F9DBEB03CA0DE6 /* C API */,
+				F7EBEED203F9DBFE03CA0DE6 /* Glue */,
 			);
 			name = Carbon;
 			path = mac/Carbon;
@@ -1084,7 +1168,7 @@
 			isa = PBXGroup;
 			children = (
 				F7EBEE9003F9DBA103CA0DE6 /* CarbonWindowAdapter.h */,
-				F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.m */,
+				F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.mm */,
 				F7EBEE9203F9DBA103CA0DE6 /* CarbonWindowContentView.h */,
 				F7EBEE9303F9DBA103CA0DE6 /* CarbonWindowContentView.m */,
 				F7EBEE9403F9DBA103CA0DE6 /* CarbonWindowFrame.h */,
@@ -1118,9 +1202,9 @@
 			children = (
 				F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */,
 				F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */,
+				9345D17B0365BF35008635CE /* WebAuthenticationPanel.nib */,
 				93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */,
 				93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */,
-				9345D17B0365BF35008635CE /* WebAuthenticationPanel.nib */,
 			);
 			name = Panels;
 			path = mac/Panels;
@@ -1139,8 +1223,13 @@
 				939810650824BF01008DF038 /* CarbonWindowAdapter.h in Headers */,
 				939810660824BF01008DF038 /* CarbonWindowContentView.h in Headers */,
 				939810670824BF01008DF038 /* CarbonWindowFrame.h in Headers */,
+				5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */,
 				939810680824BF01008DF038 /* HIViewAdapter.h in Headers */,
 				939810690824BF01008DF038 /* HIWebView.h in Headers */,
+				1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */,
+				1AAF5CEA0EDDE1FE008D883D /* NetscapePluginHostManager.h in Headers */,
+				1AAF5CEC0EDDE1FE008D883D /* NetscapePluginHostProxy.h in Headers */,
+				1AAF5CEE0EDDE1FE008D883D /* NetscapePluginInstanceProxy.h in Headers */,
 				9398109A0824BF01008DF038 /* WebArchive.h in Headers */,
 				5DE92FEF0BD7017E0059A5FD /* WebAssertions.h in Headers */,
 				939810290824BF01008DF038 /* WebAuthenticationPanel.h in Headers */,
@@ -1148,10 +1237,10 @@
 				51C714FB0B20F79F00E5E33C /* WebBackForwardListInternal.h in Headers */,
 				22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */,
 				9398102B0824BF01008DF038 /* WebBaseNetscapePluginStream.h in Headers */,
-				9398102C0824BF01008DF038 /* WebBaseNetscapePluginView.h in Headers */,
+				1A4DF5E40EC8D104006BD4B4 /* WebBaseNetscapePluginView.h in Headers */,
 				9398102E0824BF01008DF038 /* WebBasePluginPackage.h in Headers */,
 				5241ADF50B1BC48A004012BD /* WebCache.h in Headers */,
-				51CBFCAD0D10E6C5002DBF51 /* WebCachedPagePlatformData.h in Headers */,
+				51CBFCAD0D10E6C5002DBF51 /* WebCachedFramePlatformData.h in Headers */,
 				14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */,
 				939810490824BF01008DF038 /* WebClipView.h in Headers */,
 				065AD5A30B0C32C7005A2B1D /* WebContextMenuClient.h in Headers */,
@@ -1177,6 +1266,7 @@
 				ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */,
 				A70936AF0B5608DC00CDB48E /* WebDragClient.h in Headers */,
 				939810510824BF01008DF038 /* WebDynamicScrollBarsView.h in Headers */,
+				934C11670D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h in Headers */,
 				9398109E0824BF01008DF038 /* WebEditingDelegate.h in Headers */,
 				1C8CB07A0AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h in Headers */,
 				4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */,
@@ -1199,15 +1289,19 @@
 				939810A10824BF01008DF038 /* WebHTMLViewInternal.h in Headers */,
 				939810580824BF01008DF038 /* WebHTMLViewPrivate.h in Headers */,
 				939810120824BF01008DF038 /* WebHistory.h in Headers */,
+				93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */,
 				939810130824BF01008DF038 /* WebHistoryItem.h in Headers */,
 				939810630824BF01008DF038 /* WebHistoryItemInternal.h in Headers */,
 				51FDC4D30B0AF5C100F84EB3 /* WebHistoryItemPrivate.h in Headers */,
 				939810140824BF01008DF038 /* WebHistoryPrivate.h in Headers */,
+				1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */,
 				939810180824BF01008DF038 /* WebIconDatabase.h in Headers */,
 				51494CD60C7EBDE0004178C5 /* WebIconDatabaseClient.h in Headers */,
 				51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */,
 				9304B3000B02341500F7850D /* WebIconDatabaseInternal.h in Headers */,
 				939810190824BF01008DF038 /* WebIconDatabasePrivate.h in Headers */,
+				1A2D754D0DE480B900F0A648 /* WebIconFetcher.h in Headers */,
+				1A2D75500DE4810E00F0A648 /* WebIconFetcherInternal.h in Headers */,
 				5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */,
 				06693DDC0BFBA85200216072 /* WebInspectorClient.h in Headers */,
 				939810A00824BF01008DF038 /* WebJavaPlugIn.h in Headers */,
@@ -1218,7 +1312,13 @@
 				9398106D0824BF01008DF038 /* WebKitErrorsPrivate.h in Headers */,
 				9398101D0824BF01008DF038 /* WebKitLogging.h in Headers */,
 				9398101E0824BF01008DF038 /* WebKitNSStringExtras.h in Headers */,
+				1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */,
+				1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */,
+				1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */,
 				BCDFA8F90C10B6F500D3A10C /* WebKitPluginContainerView.h in Headers */,
+				1AAF58970EDCCF15008D883D /* WebKitPluginHost.defs in Headers */,
+				1AAF58980EDCCF15008D883D /* WebKitPluginHostTypes.defs in Headers */,
+				1AAF5D090EDDE71D008D883D /* WebKitPluginHostTypes.h in Headers */,
 				939810470824BF01008DF038 /* WebKitPrefix.h in Headers */,
 				9398101F0824BF01008DF038 /* WebKitStatistics.h in Headers */,
 				939810200824BF01008DF038 /* WebKitStatisticsPrivate.h in Headers */,
@@ -1244,7 +1344,11 @@
 				939810240824BF01008DF038 /* WebNSViewExtras.h in Headers */,
 				939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */,
 				226E9E6A09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h in Headers */,
+				1AEA66D40DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h in Headers */,
+				1AEA66D80DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h in Headers */,
+				1AEA6A500DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.h in Headers */,
 				939810310824BF01008DF038 /* WebNetscapePluginPackage.h in Headers */,
+				1A4DF5220EC8C74D006BD4B4 /* WebNetscapePluginView.h in Headers */,
 				1C68F66F095B5FC100C2984E /* WebNodeHighlight.h in Headers */,
 				1C68F671095B5FC100C2984E /* WebNodeHighlightView.h in Headers */,
 				939810340824BF01008DF038 /* WebNullPluginView.h in Headers */,
@@ -1252,7 +1356,6 @@
 				939810A40824BF01008DF038 /* WebPDFView.h in Headers */,
 				9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */,
 				A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */,
-				5D4ADD690D1620350064BBB0 /* WebPlugInStreamLoaderDelegate.h in Headers */,
 				939810350824BF01008DF038 /* WebPlugin.h in Headers */,
 				939810360824BF01008DF038 /* WebPluginContainer.h in Headers */,
 				939810B10824BF01008DF038 /* WebPluginContainerCheck.h in Headers */,
@@ -1261,6 +1364,7 @@
 				939810380824BF01008DF038 /* WebPluginDatabase.h in Headers */,
 				939810390824BF01008DF038 /* WebPluginPackage.h in Headers */,
 				225F881509F97E8A00423A40 /* WebPluginPrivate.h in Headers */,
+				1A77B02E0EE7730500C8A1F9 /* WebPluginRequest.h in Headers */,
 				9398103A0824BF01008DF038 /* WebPluginViewFactory.h in Headers */,
 				939810AC0824BF01008DF038 /* WebPluginViewFactoryPrivate.h in Headers */,
 				224100F3091818D900D2D266 /* WebPluginsPrivate.h in Headers */,
@@ -1271,14 +1375,17 @@
 				9398105E0824BF01008DF038 /* WebPreferencesPrivate.h in Headers */,
 				9398105F0824BF01008DF038 /* WebRenderNode.h in Headers */,
 				939810880824BF01008DF038 /* WebResource.h in Headers */,
+				934C4AA00F0141F7009372C0 /* WebResourceInternal.h in Headers */,
 				939810600824BF01008DF038 /* WebResourceLoadDelegate.h in Headers */,
 				656D333E0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h in Headers */,
 				939810890824BF01008DF038 /* WebResourcePrivate.h in Headers */,
 				7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */,
+				C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */,
 				51079D180CED11B00077247D /* WebSecurityOriginInternal.h in Headers */,
 				51079D190CED11B00077247D /* WebSecurityOriginPrivate.h in Headers */,
 				939810270824BF01008DF038 /* WebStringTruncator.h in Headers */,
 				93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */,
+				F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */,
 				DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */,
 				939810750824BF01008DF038 /* WebUIDelegate.h in Headers */,
 				939810830824BF01008DF038 /* WebUIDelegatePrivate.h in Headers */,
@@ -1287,17 +1394,8 @@
 				939810460824BF01008DF038 /* WebViewFactory.h in Headers */,
 				9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */,
 				939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
-				93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */,
-				C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */,
-				934C11670D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h in Headers */,
-				1AEA66D40DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h in Headers */,
-				1AEA66D80DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h in Headers */,
-				1AEA6A500DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.h in Headers */,
 				1A7F9C4C0DD3DDEA0028F8A5 /* nptextinput.h in Headers */,
-				1A2D754D0DE480B900F0A648 /* WebIconFetcher.h in Headers */,
-				1A2D75500DE4810E00F0A648 /* WebIconFetcherInternal.h in Headers */,
-				5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */,
-				F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */,
+				1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1315,6 +1413,7 @@
 				939810B20824BF01008DF038 /* Resources */,
 				939810BB0824BF01008DF038 /* Sources */,
 				939D054F09DA02D500984996 /* Check For Global Initializers */,
+				9337D6540EBFE54D00DA3CB5 /* Check For Exit Time Destructors */,
 				5D0D54210E98631D0029E223 /* Check For Weak VTables */,
 				939811270824BF01008DF038 /* Frameworks */,
 				1C395DE20C6BE8E0000D1E52 /* Generate 64-bit Export File */,
@@ -1436,6 +1535,20 @@
 			shellPath = /bin/sh;
 			shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\ntouch \"$PROJECT_DIR/mac/Info.plist\"\n";
 		};
+		9337D6540EBFE54D00DA3CB5 /* Check For Exit Time Destructors */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			name = "Check For Exit Time Destructors";
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "if [ -f ../WebKitTools/Scripts/check-for-exit-time-destructors ]; then\n    ../WebKitTools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
+		};
 		939811300824BF01008DF038 /* Make Frameworks Symbolic Link */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 8;
@@ -1474,18 +1587,22 @@
 			buildActionMask = 2147483647;
 			files = (
 				939811010824BF01008DF038 /* CarbonUtils.m in Sources */,
-				939810FD0824BF01008DF038 /* CarbonWindowAdapter.m in Sources */,
+				939810FD0824BF01008DF038 /* CarbonWindowAdapter.mm in Sources */,
 				939810FE0824BF01008DF038 /* CarbonWindowContentView.m in Sources */,
 				939810FF0824BF01008DF038 /* CarbonWindowFrame.m in Sources */,
 				939811000824BF01008DF038 /* HIViewAdapter.m in Sources */,
 				939811020824BF01008DF038 /* HIWebView.m in Sources */,
+				1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */,
+				1AAF5CEB0EDDE1FE008D883D /* NetscapePluginHostManager.mm in Sources */,
+				1AAF5CED0EDDE1FE008D883D /* NetscapePluginHostProxy.mm in Sources */,
+				1AAF5CEF0EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm in Sources */,
 				1CCFFD130B1F81F2002EE926 /* OldWebAssertions.c in Sources */,
 				9398111D0824BF01008DF038 /* WebArchive.mm in Sources */,
 				939810CF0824BF01008DF038 /* WebAuthenticationPanel.m in Sources */,
 				939810BC0824BF01008DF038 /* WebBackForwardList.mm in Sources */,
 				939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.mm in Sources */,
-				939810D20824BF01008DF038 /* WebBaseNetscapePluginView.mm in Sources */,
-				939810D30824BF01008DF038 /* WebBasePluginPackage.m in Sources */,
+				1A4DF5E50EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm in Sources */,
+				939810D30824BF01008DF038 /* WebBasePluginPackage.mm in Sources */,
 				5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */,
 				14D825300AF955090004F057 /* WebChromeClient.mm in Sources */,
 				939810EB0824BF01008DF038 /* WebClipView.m in Sources */,
@@ -1515,17 +1632,23 @@
 				939810F40824BF01008DF038 /* WebHTMLView.mm in Sources */,
 				939811130824BF01008DF038 /* WebHistory.mm in Sources */,
 				939810BD0824BF01008DF038 /* WebHistoryItem.mm in Sources */,
+				1AAF5FC00EDE3A92008D883D /* WebHostedNetscapePluginView.mm in Sources */,
 				939810C10824BF01008DF038 /* WebIconDatabase.mm in Sources */,
 				51494CD70C7EBDE0004178C5 /* WebIconDatabaseClient.mm in Sources */,
+				1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */,
 				939810E30824BF01008DF038 /* WebImageRendererFactory.m in Sources */,
 				5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */,
 				06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */,
+				1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */,
 				939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */,
 				939811170824BF01008DF038 /* WebKeyGenerator.m in Sources */,
 				939811030824BF01008DF038 /* WebKitErrors.m in Sources */,
 				939810C30824BF01008DF038 /* WebKitLogging.m in Sources */,
 				939810C40824BF01008DF038 /* WebKitNSStringExtras.m in Sources */,
+				1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */,
+				1AAF5D000EDDE604008D883D /* WebKitPluginClient.defs in Sources */,
 				BCDFA9130C10B93E00D3A10C /* WebKitPluginContainerView.mm in Sources */,
+				1AAF5CF10EDDE586008D883D /* WebKitPluginHost.defs in Sources */,
 				939810C50824BF01008DF038 /* WebKitStatistics.m in Sources */,
 				9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */,
 				1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */,
@@ -1539,6 +1662,7 @@
 				65EEDE58084FFC9E0002DB25 /* WebNSFileManagerExtras.m in Sources */,
 				939810C70824BF01008DF038 /* WebNSImageExtras.m in Sources */,
 				51494D250C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m in Sources */,
+				934C4A910F01406C009372C0 /* WebNSObjectExtras.mm in Sources */,
 				939810C80824BF01008DF038 /* WebNSPasteboardExtras.mm in Sources */,
 				939811190824BF01008DF038 /* WebNSPrintOperationExtras.m in Sources */,
 				939811120824BF01008DF038 /* WebNSURLExtras.mm in Sources */,
@@ -1547,7 +1671,11 @@
 				939810C90824BF01008DF038 /* WebNSViewExtras.m in Sources */,
 				939810CA0824BF01008DF038 /* WebNSWindowExtras.m in Sources */,
 				226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */,
+				1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */,
+				1AEA66D90DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm in Sources */,
+				1AEA6A510DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm in Sources */,
 				939810D60824BF01008DF038 /* WebNetscapePluginPackage.m in Sources */,
+				1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */,
 				1C68F670095B5FC100C2984E /* WebNodeHighlight.m in Sources */,
 				1C68F672095B5FC100C2984E /* WebNodeHighlightView.m in Sources */,
 				939810D90824BF01008DF038 /* WebNullPluginView.mm in Sources */,
@@ -1559,26 +1687,23 @@
 				939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */,
 				939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */,
 				939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */,
+				1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */,
 				224100F90918190100D2D266 /* WebPluginsPrivate.m in Sources */,
 				939811080824BF01008DF038 /* WebPolicyDelegate.mm in Sources */,
 				939810F80824BF01008DF038 /* WebPreferences.mm in Sources */,
 				939810F90824BF01008DF038 /* WebRenderNode.mm in Sources */,
 				9398111A0824BF01008DF038 /* WebResource.mm in Sources */,
 				7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.mm in Sources */,
+				C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */,
 				51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */,
 				939810CC0824BF01008DF038 /* WebStringTruncator.m in Sources */,
 				93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */,
+				F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */,
 				939810BE0824BF01008DF038 /* WebURLsWithTitles.m in Sources */,
 				939811070824BF01008DF038 /* WebView.mm in Sources */,
 				939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */,
 				939810DD0824BF01008DF038 /* npapi.mm in Sources */,
-				C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */,
-				1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */,
-				1AEA66D90DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm in Sources */,
-				1AEA6A510DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm in Sources */,
-				1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */,
-				F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */,
-				1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */,
+				1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit/android/TimeCounter.cpp b/WebKit/android/TimeCounter.cpp
index 0dc0f3e..96fb180 100644
--- a/WebKit/android/TimeCounter.cpp
+++ b/WebKit/android/TimeCounter.cpp
@@ -31,11 +31,19 @@
 #include "CString.h"
 #include "Cache.h"
 #include "KURL.h"
+#include "GCController.h"
+#include "JSDOMWindow.h"
+#include "Node.h"
+#include "Nodes.h"
 #include "SystemTime.h"
+#include "StyleBase.h"
 #include <runtime/JSGlobalObject.h>
+#include <runtime/JSLock.h>
 #include <utils/Log.h>
 
+using namespace JSC;
 using namespace WebCore;
+using namespace WTF;
 
 namespace android {
 
@@ -86,7 +94,7 @@
         LOGW("***** %s() used %d ms\n", functionName, elapsed);
 }
 
-void TimeCounter::report(const KURL& url, int live, int dead)
+void TimeCounter::report(const KURL& url, int live, int dead, size_t arenaSize)
 {
     String urlString = url;
     int totalTime = static_cast<int>((currentTime() - sStartTotalTime) * 1000);
@@ -103,6 +111,14 @@
         LOGD("%s", scratch);
     }
     LOGD("Current cache has %d bytes live and %d bytes dead", live, dead);
+    LOGD("Current render arena takes %d bytes", arenaSize);
+    JSLock lock(false);
+    Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics();
+    LOGD("Current JavaScript heap size is %d and has %d bytes free",
+            jsHeapStatistics.size, jsHeapStatistics.free);
+    LOGD("Current JavaScript nodes use %d bytes", JSC::Node::reportJavaScriptNodesSize());
+    LOGD("Current CSS styles use %d bytes", StyleBase::reportStyleSize());
+    LOGD("Current DOM nodes use %d bytes", WebCore::Node::reportDOMNodesSize());
 }
 
 void TimeCounter::reportNow()
diff --git a/WebKit/android/TimeCounter.h b/WebKit/android/TimeCounter.h
index d1b2dff..f15deef 100644
--- a/WebKit/android/TimeCounter.h
+++ b/WebKit/android/TimeCounter.h
@@ -28,7 +28,7 @@
 
 #ifdef ANDROID_INSTRUMENT
 
-#include "SystemTime.h"
+#include <wtf/CurrentTime.h>
 
 namespace WebCore {
 
@@ -61,7 +61,7 @@
 
     static void record(enum Type type, const char* functionName);
     static void recordNoCounter(enum Type type, const char* functionName);
-    static void report(const WebCore::KURL& , int live, int dead);
+    static void report(const WebCore::KURL& , int live, int dead, size_t arenaSize);
     static void reportNow();
     static void reset();
     static void start(enum Type type);
@@ -80,9 +80,9 @@
 class TimeCounterAuto {
 public:
     TimeCounterAuto(TimeCounter::Type type) : 
-        m_type(type), m_startTime(WebCore::get_thread_msec()) {}
+        m_type(type), m_startTime(WTF::get_thread_msec()) {}
     ~TimeCounterAuto() {
-        uint32_t time = WebCore::get_thread_msec();
+        uint32_t time = WTF::get_thread_msec();
         TimeCounter::sEndWebCoreThreadTime = time;
         TimeCounter::sTotalTimeUsed[m_type] += time - m_startTime;
         TimeCounter::sCounter[m_type]++;
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
index abc6a32..714a7d8 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
@@ -245,6 +245,18 @@
     return viewBridge;
 }
 
+// new to webkit4 (Feb 27, 2009)
+void ChromeClientAndroid::contentsSizeChanged(Frame*, const IntSize&) const
+{
+    notImplemented();
+}
+
+// new to webkit4 (Feb 27, 2009)
+void ChromeClientAndroid::formStateDidChange(const Node*)
+{
+    notImplemented();
+}
+
 void ChromeClientAndroid::mouseDidMoveOverElement(const HitTestResult&, unsigned int) {}
 void ChromeClientAndroid::setToolTip(const String&) {}
 void ChromeClientAndroid::print(Frame*) {}
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
index 60b3a8f..7343c88 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
@@ -97,6 +97,7 @@
         virtual IntPoint screenToWindow(const IntPoint&) const;
         virtual IntRect windowToScreen(const IntRect&) const;
         virtual PlatformWidget platformWindow() const;
+        virtual void contentsSizeChanged(Frame*, const IntSize&) const;
         // End methods used by HostWindow.
 
         virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned int);
@@ -109,6 +110,10 @@
         
         virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
 
+        // Notification that the given form element has changed. This function
+        // will be called frequently, so handling should be very fast.
+        virtual void formStateDidChange(const Node*);
+
     // Android-specific
         void setWebFrame(android::WebFrame* webframe);
     private:
diff --git a/WebKit/android/WebCoreSupport/EditorClientAndroid.cpp b/WebKit/android/WebCoreSupport/EditorClientAndroid.cpp
index fb71fa2..780ea53 100644
--- a/WebKit/android/WebCoreSupport/EditorClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/EditorClientAndroid.cpp
@@ -46,6 +46,7 @@
 bool EditorClientAndroid::shouldDeleteRange(Range*) { return true; }
 bool EditorClientAndroid::shouldShowDeleteInterface(HTMLElement*) { notImplemented(); return false; }
 bool EditorClientAndroid::smartInsertDeleteEnabled() { notImplemented(); return false; } 
+bool EditorClientAndroid::isSelectTrailingWhitespaceEnabled(){ notImplemented(); return false; }
 bool EditorClientAndroid::isContinuousSpellCheckingEnabled() { notImplemented(); return false; }
 void EditorClientAndroid::toggleContinuousSpellChecking() { notImplemented(); }
 bool EditorClientAndroid::isGrammarCheckingEnabled() { notImplemented(); return false; }
diff --git a/WebKit/android/WebCoreSupport/EditorClientAndroid.h b/WebKit/android/WebCoreSupport/EditorClientAndroid.h
index fc35761..42e9c43 100644
--- a/WebKit/android/WebCoreSupport/EditorClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/EditorClientAndroid.h
@@ -41,6 +41,7 @@
     virtual bool shouldDeleteRange(Range*);
     virtual bool shouldShowDeleteInterface(HTMLElement*);
     virtual bool smartInsertDeleteEnabled(); 
+    virtual bool isSelectTrailingWhitespaceEnabled();
     virtual bool isContinuousSpellCheckingEnabled();
     virtual void toggleContinuousSpellChecking();
     virtual bool isGrammarCheckingEnabled();
@@ -58,6 +59,7 @@
     virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
 //  virtual bool shouldChangeTypingStyle(CSSStyleDeclaration* fromStyle, CSSStyleDeclaration* toStyle);
 //  virtual bool doCommandBySelector(SEL selector);
+    virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
 
     virtual void didBeginEditing();
     virtual void respondToChangedContents();
@@ -79,6 +81,9 @@
     virtual void undo();
     virtual void redo();
 
+    virtual void handleKeyboardEvent(KeyboardEvent*);
+    virtual void handleInputMethodKeydown(KeyboardEvent*);
+
     virtual void textFieldDidBeginEditing(Element*);
     virtual void textFieldDidEndEditing(Element*);
     virtual void textDidChangeInTextField(Element*);
@@ -95,11 +100,8 @@
     virtual void showSpellingUI(bool show);
     virtual bool spellingUIIsShowing();
     virtual void getGuessesForWord(const String&, Vector<String>& guesses);
-    virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
     virtual void setInputMethodState(bool);
 
-    virtual void handleKeyboardEvent(KeyboardEvent*);
-    virtual void handleInputMethodKeydown(KeyboardEvent*);
     // Android specific:
     void setPage(Page* page) { m_page = page; }
     void setFromClick(bool fromClick) { m_notFromClick = !fromClick; }
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index 8782132..95a9cf6 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -29,6 +29,7 @@
 #include "android_graphics.h"
 #include "CString.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClientAndroid.h"
 #include "FrameTree.h"
@@ -77,20 +78,6 @@
 
 static const int EXTRA_LAYOUT_DELAY = 1000;
 
-// FIXME: Need some data for how big this should be.
-#define MAX_SESSION_HISTORY 50
-static WTF::Vector<KURL> gSessionHistory;
-
-bool historyContains(const UChar* chars, unsigned len) {
-    const KURL url(String(chars, len));
-    WTF::Vector<KURL>::const_iterator end = gSessionHistory.end();
-    for (WTF::Vector<KURL>::const_iterator i = gSessionHistory.begin(); i != end; ++i) {
-        if (equalIgnoringRef(url, *i))
-            return true;
-    }
-    return false;
-}
-
 FrameLoaderClientAndroid::FrameLoaderClientAndroid(WebFrame* webframe)
     : m_frame(NULL)
     , m_webFrame(webframe) {
@@ -116,18 +103,6 @@
     return true;
 }
 
-bool FrameLoaderClientAndroid::hasFrameView() const {
-    // FIXME,
-    // need to revisit for sub-frame case
-    return true;
-}
-
-bool FrameLoaderClientAndroid::privateBrowsingEnabled() const {
-    // FIXME, are we going to support private browsing?
-    notImplemented();
-    return false;
-}
-
 void FrameLoaderClientAndroid::makeRepresentation(DocumentLoader*) {
     // don't use representation
     verifiedOk();
@@ -160,16 +135,6 @@
     notImplemented();
 }
 
-void FrameLoaderClientAndroid::detachedFromParent4() {
-    // FIXME, ready to release view
-    notImplemented();
-}
-
-void FrameLoaderClientAndroid::loadedFromPageCache() {
-    // don't support page cache
-    verifiedOk();
-}
-
 // This function is responsible for associating the "id" with a given
 // subresource load.  The following functions that accept an "id" are
 // called for each subresource, so they should not be dispatched to the m_frame.
@@ -183,6 +148,12 @@
     lowPriority_notImplemented();
 }
 
+bool FrameLoaderClientAndroid::shouldUseCredentialStorage(DocumentLoader*, unsigned long  identifier)
+{
+    notImplemented();
+    return false;
+}
+
 void FrameLoaderClientAndroid::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*,
                             unsigned long id, const AuthenticationChallenge&) {
     lowPriority_notImplemented();
@@ -289,14 +260,17 @@
     WebViewCore::getWebViewCore(m_frame->view())->updateFrameGeneration(m_frame);
 }
 
-static void loadDataIntoFrame(Frame* frame, const String& url,
+static void loadDataIntoFrame(Frame* frame, KURL baseUrl, const String& url,
         const String& data) {
-    ResourceRequest request(url);
+    if (baseUrl.isEmpty()) {
+        baseUrl = blankURL();
+    }
+    ResourceRequest request(baseUrl);
     CString cstr = data.utf8();
     RefPtr<WebCore::SharedBuffer> buf = WebCore::SharedBuffer::create(cstr.data(), cstr.length());
     SubstituteData subData(buf, String("text/html"), String("utf-8"),
-            request.url());
-    frame->loader()->load(request, subData);
+            KURL(KURL(), url));
+    frame->loader()->load(request, subData, false);
 }
 
 void FrameLoaderClientAndroid::dispatchDidFailProvisionalLoad(const ResourceError& error) {
@@ -359,7 +333,8 @@
     
     // Create the request and the substitute data and tell the FrameLoader to
     // load with the replacement data.
-    loadDataIntoFrame(m_frame, error.failingURL(), s);
+    loadDataIntoFrame(m_frame, m_frame->loader()->baseURL(),
+            error.failingURL(), s);
 
     // Delete the asset.
     delete a;
@@ -382,14 +357,19 @@
 void FrameLoaderClientAndroid::dispatchDidFirstLayout() {
     ASSERT(m_frame);
     m_frame->document()->setExtraLayoutDelay(EXTRA_LAYOUT_DELAY);
-    // FIXME: Need to figure out if we need didLayout or didFirstLayout
-    // see WebViewCore::didLayout
+    // we need to do this here instead of dispatchDidFirstVisuallyNonEmptyLayout
+    // so that about:blank will update the screen.
     if (!m_frame->tree()->parent()) {
         // Only need to notify Java side for the top frame
         WebViewCore::getWebViewCore(m_frame->view())->didFirstLayout();
     }
 }
 
+void FrameLoaderClientAndroid::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+    notImplemented();
+}
+
 Frame* FrameLoaderClientAndroid::dispatchCreatePage() {
     ASSERT(m_frame);
 #ifdef ANDROID_MULTIPLE_WINDOWS
@@ -526,10 +506,6 @@
                 error.localizedDescription(), error.failingURL());
 }
 
-void FrameLoaderClientAndroid::clearUnarchivingState(DocumentLoader*) {
-    notImplemented();
-}
-
 // This function is called right before the progress is updated.
 void FrameLoaderClientAndroid::willChangeEstimatedProgress() {
     verifiedOk();
@@ -589,24 +565,16 @@
     committedLoad(docLoader, 0, 0);
 }
 
-void FrameLoaderClientAndroid::finalSetupForReplace(DocumentLoader*) {
-    notImplemented();
+void FrameLoaderClientAndroid::updateGlobalHistory() {
+    ASSERT(m_frame);
+    ASSERT(m_frame->loader()->documentLoader());
+    m_webFrame->updateVisitedHistory(m_frame->loader()->documentLoader()->urlForHistory(), false);
 }
 
-void FrameLoaderClientAndroid::updateGlobalHistoryForStandardLoad(const KURL& url) {
-    ASSERT(m_frame);
-    const String& str = url.string();
-    if (!historyContains(str.characters(), str.length())) {
-        if (gSessionHistory.size() == MAX_SESSION_HISTORY)
-            gSessionHistory.remove(0);
-        gSessionHistory.append(url);
-    }
-    m_webFrame->updateVisitedHistory(url, false);
-}
-
-void FrameLoaderClientAndroid::updateGlobalHistoryForReload(const KURL& url) {
-    ASSERT(m_frame);
-    m_webFrame->updateVisitedHistory(url, true);
+void FrameLoaderClientAndroid::updateGlobalHistoryForRedirectWithoutHistoryItem() {
+    // Note, do we need to do anything where there is no HistoryItem? If we call
+    // updateGlobalHistory(), we will add bunch of "data:xxx" urls for gmail.com
+    // which is not what we want. Opt to do nothing now.
 }
 
 bool FrameLoaderClientAndroid::shouldGoToHistoryItem(HistoryItem* item) const {
@@ -629,27 +597,27 @@
 }
 
 ResourceError FrameLoaderClientAndroid::cancelledError(const ResourceRequest& request) {
-    return ResourceError(String(), InternalErrorCancelled, String(), String());
+    return ResourceError(String(), InternalErrorCancelled, request.url(), String());
 }
 
 ResourceError FrameLoaderClientAndroid::cannotShowURLError(const ResourceRequest& request) {
-    return ResourceError(String(), InternalErrorCannotShowUrl, String(), String());
+    return ResourceError(String(), InternalErrorCannotShowUrl, request.url(), String());
 }
 
 ResourceError FrameLoaderClientAndroid::interruptForPolicyChangeError(const ResourceRequest& request) {
-    return ResourceError(String(), InternalErrorInterrupted, String(), String());
+    return ResourceError(String(), InternalErrorInterrupted, request.url(), String());
 }
 
 ResourceError FrameLoaderClientAndroid::cannotShowMIMETypeError(const ResourceResponse& request) {
-    return ResourceError(String(), InternalErrorCannotShowMimeType, String(), String());
+    return ResourceError(String(), InternalErrorCannotShowMimeType, request.url(), String());
 }
 
 ResourceError FrameLoaderClientAndroid::fileDoesNotExistError(const ResourceResponse& request) {
-    return ResourceError(String(), InternalErrorFileDoesNotExist, String(), String());
+    return ResourceError(String(), InternalErrorFileDoesNotExist, request.url(), String());
 }
 
 ResourceError FrameLoaderClientAndroid::pluginWillHandleLoadError(const ResourceResponse& request) {
-    return ResourceError(String(), InternalErrorPluginWillHandleLoadError, String(), String());
+    return ResourceError(String(), InternalErrorPluginWillHandleLoadError, request.url(), String());
 }
 
 bool FrameLoaderClientAndroid::shouldFallBack(const ResourceError&) {
@@ -657,29 +625,6 @@
     return false;
 }
 
-void FrameLoaderClientAndroid::setDefersLoading(bool) {
-    notImplemented();
-}
-
-bool FrameLoaderClientAndroid::willUseArchive(ResourceLoader*, const ResourceRequest&,
-                                const KURL& originalURL) const {
-    lowPriority_notImplemented();
-    return false;
-}
-
-bool FrameLoaderClientAndroid::isArchiveLoadPending(ResourceLoader*) const {
-    lowPriority_notImplemented();
-    return false;
-}
-
-void FrameLoaderClientAndroid::cancelPendingArchiveLoad(ResourceLoader*) {
-    notImplemented();
-}
-
-void FrameLoaderClientAndroid::clearArchivedResources() {
-    notImplemented();
-}
-
 bool FrameLoaderClientAndroid::canHandleRequest(const ResourceRequest& request) const {
     ASSERT(m_frame);
     // Don't allow hijacking of intrapage navigation
@@ -811,6 +756,49 @@
     return m_webFrame->userAgentForURL(&u);
 }
 
+void FrameLoaderClientAndroid::savePlatformDataToCachedFrame(WebCore::CachedFrame*) {
+    notImplemented();
+}
+
+void FrameLoaderClientAndroid::transitionToCommittedFromCachedFrame(WebCore::CachedFrame*) {
+    notImplemented();
+}
+
+void FrameLoaderClientAndroid::transitionToCommittedForNewPage() {
+    ASSERT(m_frame);
+    if (m_frame->settings() && !m_frame->settings()->usesPageCache()) {
+        m_webFrame->transitionToCommitted(m_frame);
+        return;
+    }
+
+    // Remember the old WebFrameView
+    WebFrameView* webFrameView = static_cast<WebFrameView*> (
+            m_frame->view()->platformWidget());
+    Retain(webFrameView);
+
+    // Remove the old FrameView
+    m_frame->setView(NULL);
+
+    // Create a new FrameView and associate it with the saved webFrameView
+    FrameView* view = new FrameView(m_frame);
+    webFrameView->setView(view);
+
+    Release(webFrameView);
+
+    // Give the new FrameView to the Frame
+    m_frame->setView(view);
+
+    // Deref since FrameViews are created with a ref of 1
+    view->deref();
+
+    if (m_frame->ownerRenderer())
+        m_frame->ownerRenderer()->setWidget(view);
+
+    m_frame->view()->initScrollbars();
+
+    m_webFrame->transitionToCommitted(m_frame);
+}
+
 bool FrameLoaderClientAndroid::canCachePage() const {
     return true;
 }
@@ -880,7 +868,7 @@
     for (unsigned int i = sizeof(slash_v_slash); i < len; i++) {
         char c = data[i];
         // Check for alpha-numeric characters only.
-        if (WTF::isASCIIAlphanumeric(c))
+        if (WTF::isASCIIAlphanumeric(c) || c == '_' || c == '-')
             continue;
         // The url can have more parameters such as &hl=en after the video id.
         // Once we start seeing extra parameters we can return true.
@@ -891,7 +879,10 @@
 
 static bool isYouTubeUrl(const KURL& url, const String& mimeType)
 {
-    return url.host().endsWith("youtube.com") && isValidYouTubeVideo(url.path())
+    String host = url.host();
+    bool youtube = host.endsWith("youtube.com")
+            || host.endsWith("youtube-nocookie.com");
+    return youtube && isValidYouTubeVideo(url.path())
             && equalIgnoringCase(mimeType, "application/x-shockwave-flash");
 }
 
@@ -905,7 +896,7 @@
         bool loadManually) {
     // Create an iframe for youtube urls.
     if (isYouTubeUrl(url, mimeType)) {
-        RefPtr<Frame> frame = createFrame(KURL(), String(),
+        RefPtr<Frame> frame = createFrame(blankURL(), String(),
                 static_cast<HTMLFrameOwnerElement*>(element),
                 String(), false, 0, 0);
         if (frame) {
@@ -928,7 +919,7 @@
             s = s.replace("VIDEO_ID", videoId);
             delete a;
             loadDataIntoFrame(frame.get(),
-                    "file:///android_asset/webkit/", s);
+                    KURL("file:///android_asset/webkit/"), String(), s);
             return frame->view();
         }
         return NULL;
@@ -1046,61 +1037,4 @@
         dispatchDidReceiveIcon();
     }
 }
-
-// functions new to Feb-19 tip of tree merge:
-// According to the changelog:
-// The very Mac-centric "makeDocumentView", "setDocumentViewFromCachedPage",
-// and "saveDocumentViewToCachedPage" become "transitionToCommittedForNewPage", 
-// "transitionToCommittedFromCachedPage", and "savePlatformDataToCachedPage" 
-// accordingly
-void FrameLoaderClientAndroid::savePlatformDataToCachedPage(CachedPage*) {
-    // don't support page cache
-    verifiedOk();
-}
-
-void FrameLoaderClientAndroid::transitionToCommittedFromCachedPage(CachedPage*) {
-    // don't support page cache
-    verifiedOk();
-}
-
-void FrameLoaderClientAndroid::transitionToCommittedForNewPage() {
-    ASSERT(m_frame);
-    if (m_frame->settings() && !m_frame->settings()->usesPageCache()) {
-        m_webFrame->transitionToCommitted(m_frame);
-        return;
-    }
-
-    // Remember the old WebFrameView
-    WebFrameView* webFrameView = static_cast<WebFrameView*> (
-            m_frame->view()->platformWidget());
-    Retain(webFrameView);
-
-    // Remove the old FrameView
-    m_frame->setView(NULL);
-
-    // Create a new FrameView and associate it with the saved webFrameView
-    FrameView* view = new FrameView(m_frame);
-    webFrameView->setView(view);
-
-    Release(webFrameView);
-
-    // Give the new FrameView to the Frame
-    m_frame->setView(view);
-
-    // Deref since FrameViews are created with a ref of 1
-    view->deref();
-
-    if (m_frame->ownerRenderer())
-        m_frame->ownerRenderer()->setWidget(view);
-
-    m_frame->view()->initScrollbars();
-
-    m_webFrame->transitionToCommitted(m_frame);
-}
-
-// new as of webkit 34152
-void FrameLoaderClientAndroid::updateGlobalHistory(const KURL& url) {
-    m_webFrame->updateVisitedHistory(url, false);
-}
-
 }
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
index 58b296e..9d71c9d 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
@@ -50,9 +50,6 @@
         virtual void frameLoaderDestroyed();
         
         virtual bool hasWebView() const; // mainly for assertions
-        virtual bool hasFrameView() const; // ditto
-
-        virtual bool privateBrowsingEnabled() const;
 
         virtual void makeRepresentation(DocumentLoader*);
         virtual void forceLayout();
@@ -62,13 +59,11 @@
 
         virtual void detachedFromParent2();
         virtual void detachedFromParent3();
-        virtual void detachedFromParent4();
-
-        virtual void loadedFromPageCache();
 
         virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
 
         virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
+        virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier);
         virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
         virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);        
         virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
@@ -92,6 +87,7 @@
         virtual void dispatchDidFinishDocumentLoad();
         virtual void dispatchDidFinishLoad();
         virtual void dispatchDidFirstLayout();
+        virtual void dispatchDidFirstVisuallyNonEmptyLayout();
 
         virtual Frame* dispatchCreatePage();
         virtual void dispatchShow();
@@ -108,7 +104,6 @@
         virtual void dispatchDidLoadMainResource(DocumentLoader*);
         virtual void revertToProvisionalState(DocumentLoader*);
         virtual void setMainDocumentError(DocumentLoader*, const ResourceError&);
-        virtual void clearUnarchivingState(DocumentLoader*);
 
         virtual void willChangeEstimatedProgress();
         virtual void didChangeEstimatedProgress();
@@ -125,11 +120,10 @@
 
         virtual void committedLoad(DocumentLoader*, const char*, int);
         virtual void finishedLoading(DocumentLoader*);
-        virtual void finalSetupForReplace(DocumentLoader*);
         
-        virtual void updateGlobalHistory(const KURL&);
-        virtual void updateGlobalHistoryForStandardLoad(const KURL&);
-        virtual void updateGlobalHistoryForReload(const KURL&);
+        virtual void updateGlobalHistory();
+        virtual void updateGlobalHistoryForRedirectWithoutHistoryItem();
+
         virtual bool shouldGoToHistoryItem(HistoryItem*) const;
 #ifdef ANDROID_HISTORY_CLIENT
         virtual void dispatchDidAddHistoryItem(HistoryItem*) const;
@@ -148,13 +142,6 @@
 
         virtual bool shouldFallBack(const ResourceError&);
 
-        virtual void setDefersLoading(bool);
-
-        virtual bool willUseArchive(ResourceLoader*, const ResourceRequest&, const KURL& originalURL) const;
-        virtual bool isArchiveLoadPending(ResourceLoader*) const;
-        virtual void cancelPendingArchiveLoad(ResourceLoader*);
-        virtual void clearArchivedResources();
-
         virtual bool canHandleRequest(const ResourceRequest&) const;
         virtual bool canShowMIMEType(const String& MIMEType) const;
         virtual bool representationExistsForURLScheme(const String& URLScheme) const;
@@ -172,6 +159,10 @@
 
         virtual String userAgent(const KURL&);
         
+        virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*);
+        virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
+        virtual void transitionToCommittedForNewPage();
+
         virtual bool canCachePage() const;
         virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
 
@@ -188,14 +179,10 @@
         virtual String overrideMediaType() const;
 
         virtual void windowObjectCleared();
-
         virtual void didPerformFirstNavigation() const;
+        
         virtual void registerForIconNotification(bool listen = true);
 
-        virtual void savePlatformDataToCachedPage(CachedPage*);
-        virtual void transitionToCommittedFromCachedPage(CachedPage*);
-        virtual void transitionToCommittedForNewPage();
-
         // WebIconDatabaseClient api
         virtual void didAddIconForPageUrl(const String& pageUrl);
         
diff --git a/WebKit/android/jni/PictureSet.cpp b/WebKit/android/jni/PictureSet.cpp
index 65aac8f..50b2a27 100644
--- a/WebKit/android/jni/PictureSet.cpp
+++ b/WebKit/android/jni/PictureSet.cpp
@@ -36,7 +36,7 @@
 #include "SkRect.h"
 #include "SkRegion.h"
 #include "SkStream.h"
-#include "SystemTime.h"
+#include <wtf/CurrentTime.h>
 
 #define MAX_DRAW_TIME 100
 #define MIN_SPLITTABLE 400
@@ -270,9 +270,9 @@
         }
         canvas->translate(pathBounds.fLeft, pathBounds.fTop);
         canvas->save();
-        uint32_t startTime = WebCore::get_thread_msec();
+        uint32_t startTime = WTF::get_thread_msec();
         canvas->drawPicture(*working->mPicture);
-        size_t elapsed = working->mElapsed = WebCore::get_thread_msec() - startTime;
+        size_t elapsed = working->mElapsed = WTF::get_thread_msec() - startTime;
         working->mWroteElapsed = true;
         if (maxElapsed < elapsed && (pathBounds.width() >= MIN_SPLITTABLE ||
                 pathBounds.height() >= MIN_SPLITTABLE))
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index e14a534..5ec70c6 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -69,6 +69,7 @@
 #include "RenderView.h"
 #include "ResourceHandle.h"
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include "SelectionController.h"
 #include "Settings.h"
 #include "SubstituteData.h"
@@ -96,6 +97,7 @@
 
 #ifdef ANDROID_INSTRUMENT
 #include "TimeCounter.h"
+#include <runtime/JSLock.h>
 #endif
 
 namespace android {
@@ -385,7 +387,7 @@
 
     if (loadType == WebCore::FrameLoadTypeReplace ||
             loadType == WebCore::FrameLoadTypeSame ||
-            (loadType == WebCore::FrameLoadTypeRedirectWithLockedHistory &&
+            (loadType == WebCore::FrameLoadTypeRedirectWithLockedBackForwardList &&
              !isMainFrame))
         return;
 
@@ -787,7 +789,7 @@
     WebCore::String webcoreUrl = to_string(env, url);
     WebCore::ResourceRequest request(webcoreUrl);
     LOGV("LoadUrl %s", webcoreUrl.latin1().data());
-    pFrame->loader()->load(request);
+    pFrame->loader()->load(request, false);
 }
 
 
@@ -816,7 +818,7 @@
             WebCore::KURL(to_string(env, failUrl)));
 
     // Perform the load
-    pFrame->loader()->load(request, substituteData);
+    pFrame->loader()->load(request, substituteData, false);
 }
 
 static void StopLoading(JNIEnv *env, jobject obj)
@@ -876,10 +878,15 @@
     LOG_ASSERT(pFrame, "nativeReload must take a valid frame pointer!");
 
     WebCore::FrameLoader* loader = pFrame->loader();
-    if (allowStale)
-        loader->reloadAllowingStaleData(loader->documentLoader()->overrideEncoding());
-    else
-        loader->reload();
+    if (allowStale) {
+        // load the current page with FrameLoadTypeIndexedBackForward so that it
+        // will use cache when it is possible
+        WebCore::Page* page = pFrame->page();
+        WebCore::HistoryItem* item = page->backForwardList()->currentItem();
+        if (item)
+            page->goToItem(item, FrameLoadTypeIndexedBackForward);
+    } else
+        loader->reload(true);
 }
 
 static void GoBackOrForward(JNIEnv *env, jobject obj, jint pos)
@@ -906,15 +913,11 @@
     WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
     LOG_ASSERT(pFrame, "stringByEvaluatingJavaScriptFromString must take a valid frame pointer!");
 
-    JSC::JSValue* r =
+    WebCore::ScriptValue value =
             pFrame->loader()->executeScript(to_string(env, script), true);
     WebCore::String result = WebCore::String();
-    if (r) {
-        // note: r->getString() returns a UString.
-        result = WebCore::String(r->isString() ? r->getString() : 
-                r->toString(pFrame->script()->globalObject()->globalExec()));
-    }
-
+    if (!value.getString(result))
+        return NULL;
     unsigned len = result.length();
     if (len == 0)
         return NULL;
@@ -942,13 +945,17 @@
         JSC::Bindings::setJavaVM(vm);
         // Add the binding to JS environment
         JSC::ExecState* exec = window->globalExec();
-        JSC::JSObject *addedObject = JSC::Bindings::Instance::createRuntimeObject(
-                exec, JSC::Bindings::JavaInstance::create(javascriptObj, root));
-        // Add the binding name to the window's table of child objects.
-        JSC::PutPropertySlot slot;
-        window->put(exec,
-                JSC::Identifier(exec, to_string(env, interfaceName)),
-                addedObject, slot);
+        JSC::JSObject *addedObject = JSC::Bindings::JavaInstance::create(javascriptObj, 
+                root)->createRuntimeObject(exec);
+        const jchar* s = env->GetStringChars(interfaceName, NULL);
+        if (s) {
+            // Add the binding name to the window's table of child objects.
+            JSC::PutPropertySlot slot;
+            window->put(exec, JSC::Identifier(exec, (const UChar *)s, 
+                    env->GetStringLength(interfaceName)), addedObject, slot);
+            env->ReleaseStringChars(interfaceName, s);
+            checkException(env);
+        }
     }
 }
 
@@ -972,6 +979,13 @@
 {
 #ifdef ANDROID_INSTRUMENT
     TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
+
+    JSC::JSLock lock(false);
+    JSC::Heap::Statistics jsHeapStatistics = WebCore::JSDOMWindow::commonJSGlobalData()->heap.statistics();
+    LOGD("About to gc and JavaScript heap size is %d and has %d bytes free",
+            jsHeapStatistics.size, jsHeapStatistics.free);
+    LOGD("About to clear cache and current cache has %d bytes live and %d bytes dead", 
+            cache()->getLiveSize(), cache()->getDeadSize());
 #endif
     if (!WebCore::cache()->disabled()) {
         // Disabling the cache will remove all resources from the cache.  They may
@@ -1182,7 +1196,7 @@
         (void*) CreateFrame },
     { "nativeDestroyFrame", "()V",
         (void*) DestroyFrame },
-    { "stopLoading", "()V",
+    { "nativeStopLoading", "()V",
         (void*) StopLoading },
     { "nativeLoadUrl", "(Ljava/lang/String;)V",
         (void*) LoadUrl },
diff --git a/WebKit/android/jni/WebHistory.cpp b/WebKit/android/jni/WebHistory.cpp
index 8a75230..cd6e0f1 100644
--- a/WebKit/android/jni/WebHistory.cpp
+++ b/WebKit/android/jni/WebHistory.cpp
@@ -39,6 +39,7 @@
 #include "FrameLoaderClientAndroid.h"
 #include "FrameTree.h"
 #include "HistoryItem.h"
+#include "IconDatabase.h"
 #include "Page.h"
 #include "TextEncoding.h"
 #include "WebCoreFrameBridge.h"
@@ -142,9 +143,10 @@
 {
     LOG_ASSERT(frame, "RestoreState needs a valid Frame pointer!");
     WebCore::Frame* pFrame = (WebCore::Frame*)frame;
+    WebCore::Page* page = pFrame->page();
 
     // Set the current index in the list.
-    WebCore::BackForwardList* list = pFrame->page()->backForwardList();
+    WebCore::BackForwardList* list = page->backForwardList();
     WebCore::HistoryItem* currentItem = list->entries()[index].get();
     list->goToItem(currentItem);
 
@@ -153,12 +155,9 @@
     loader->setCurrentHistoryItem(currentItem);
     loader->setPreviousHistoryItem(list->backItem());
 
-    // Update the request with the current item's info.
-    WebCore::ResourceRequest& request = loader->documentLoader()->request();
-    request.setURL(currentItem->url());
-    request.setMainDocumentURL(currentItem->url());
-    // Reload the current page
-    loader->reloadAllowingStaleData(loader->documentLoader()->overrideEncoding());
+    // load the current page with FrameLoadTypeIndexedBackForward so that it
+    // will use cache when it is possible
+    page->goToItem(currentItem, FrameLoadTypeIndexedBackForward);
 }
 
 static void WebHistoryInflate(JNIEnv* env, jobject obj, jint frame, jbyteArray data)
@@ -200,13 +199,13 @@
 #endif
 }
 
-// 7 empty strings + no document state + children count = 9 unsigned values
+// 6 empty strings + no document state + children count = 8 unsigned values
 // 1 char for isTargetItem
 // ANDROID_HISTORY_CLIENT adds 1 int for scale.
 #ifdef ANDROID_HISTORY_CLIENT
-#define HISTORY_MIN_SIZE ((int)(sizeof(unsigned) * 10 + sizeof(char)))
-#else
 #define HISTORY_MIN_SIZE ((int)(sizeof(unsigned) * 9 + sizeof(char)))
+#else
+#define HISTORY_MIN_SIZE ((int)(sizeof(unsigned) * 8 + sizeof(char)))
 #endif
 
 jbyteArray WebHistory::Flatten(JNIEnv* env, WTF::Vector<char>& v, WebCore::HistoryItem* item)
@@ -420,9 +419,6 @@
     // Form content type
     write_string(v, item->formContentType());
 
-    // Form referrer
-    write_string(v, item->formReferrer());
-
     // Form data
     const WebCore::FormData* formData = item->formData();
     if (formData)
@@ -552,7 +548,6 @@
 
     // Generate a new ResourceRequest object for populating form information.
     WebCore::String formContentType;
-    WebCore::String formReferrer;
     WTF::PassRefPtr<WebCore::FormData> formData = NULL;
 
     // Read the form content type
@@ -569,20 +564,6 @@
     if (end - data < sizeofUnsigned)
         return false;
 
-    // Read the form referrer
-    memcpy(&l, data, sizeofUnsigned);
-    data += sizeofUnsigned;
-    if (l) {
-        LOGV("Referrer        %d %.*s", l, l, data);
-        if (data + l < end)
-            formReferrer = e.decode(data, l);
-        else
-            return false;
-        data += l;
-    }
-    if (end - data < sizeofUnsigned)
-        return false;
-
     // Read the form data
     memcpy(&l, data, sizeofUnsigned);
     data += sizeofUnsigned;
@@ -602,7 +583,6 @@
         WebCore::ResourceRequest r;
         r.setHTTPMethod("POST");
         r.setHTTPContentType(formContentType);
-        r.setHTTPReferrer(formReferrer);
         r.setHTTPBody(formData);
         newItem->setFormInfoFromRequest(r);
     }
@@ -756,12 +736,6 @@
     ptr = (const char*)test3;
     *(int*)(test3 + offset) = 4000;
     LOG_ASSERT(!read_item_recursive(testItem, &ptr, HISTORY_MIN_SIZE), "4000 length contentType should fail!");
-    // Form referrer
-    offset += 4;
-    memset(test3, 0, HISTORY_MIN_SIZE);
-    ptr = (const char*)test3;
-    *(int*)(test3 + offset) = 4000;
-    LOG_ASSERT(!read_item_recursive(testItem, &ptr, HISTORY_MIN_SIZE), "4000 length referrer should fail!");
     // Form data
     offset += 4;
     memset(test3, 0, HISTORY_MIN_SIZE);
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index d9f9cec..0da3974 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -82,7 +82,6 @@
 #include "SkPicture.h"
 #include "SkUtils.h"
 #include "StringImpl.h"
-#include "SystemTime.h"
 #include "Text.h"
 #include "TypingCommand.h"
 #include "WebCoreFrameBridge.h"
@@ -91,6 +90,7 @@
 #include "android_graphics.h"
 #include <ui/KeycodeLabels.h>
 #include "jni_utility.h"
+#include <wtf/CurrentTime.h>
 
 #if DEBUG_NAV_UI
 #include "SkTime.h"
@@ -299,8 +299,8 @@
         return true;
 
     if (v->needsLayout())
-        v->layout();
-
+        v->layout(f->tree()->parent());
+    
     WebCore::Frame* child = f->tree()->firstChild();
     bool success = true;
     while (child) {
@@ -401,7 +401,12 @@
         m_lastFocusedBounds.x(), m_lastFocusedBounds.y(), 
         m_lastFocusedBounds.width(), m_lastFocusedBounds.height(),
         oldBounds.x(), oldBounds.y(), oldBounds.width(), oldBounds.height());
-    unsigned latestVersion = m_mainFrame->document()->domTreeVersion();
+    unsigned latestVersion = 0;
+    // as domTreeVersion only increment, we can just check the sum to see whether
+    // we need to update the frame cache
+    for (Frame* frame = m_mainFrame; frame; frame = frame->tree()->traverseNext()) {
+        latestVersion += frame->document()->domTreeVersion();
+    }
     if (m_lastFocused != oldFocusNode || m_lastFocusedBounds != oldBounds
             || m_findIsUp || latestVersion != m_domtree_version) {
         m_lastFocused = oldFocusNode;
@@ -827,7 +832,7 @@
                 }
             }
             r->setNeedsLayoutAndPrefWidthsRecalc();
-            m_mainFrame->forceLayout(true);
+            m_mainFrame->forceLayout();
             // scroll to restore current screen center
             if (!node)
                 return;
@@ -1164,7 +1169,7 @@
     // a valid frame.  Do not want to make a call on frame unless it is valid.
     WebCore::PlatformMouseEvent mouseEvent(m_mousePos, m_mousePos,
         WebCore::NoButton, WebCore::MouseEventMoved, 1, false, false, false,
-        false, WebCore::currentTime());
+        false, WTF::currentTime());
     frame->eventHandler()->handleMouseMoveEvent(mouseEvent);
     bool valid = builder.validNode(frame, node);
     if (!donotChangeDOMFocus) {
@@ -1259,8 +1264,7 @@
         DBG_NAV_LOGD("node=%p pt=(%d,%d) renderText=0", node, pt.x(), pt.y());
         return -3; // error
     }
-    int renderX, renderY;
-    renderText->absolutePosition(renderX, renderY);
+    FloatPoint absPt = renderText->localToAbsolute();
     WebCore::InlineTextBox *textBox = renderText->firstTextBox();
     int globalX, globalY;
     CacheBuilder::GetGlobalOffset(node, &globalX, &globalY);
@@ -1271,11 +1275,11 @@
         int textBoxEnd = textBoxStart + textBox->len();
         if (textBoxEnd <= textBoxStart)
             continue;
-        WebCore::IntRect bounds = textBox->selectionRect(renderX, renderY,
+        WebCore::IntRect bounds = textBox->selectionRect(absPt.x(), absPt.y(),
             textBoxStart, textBoxEnd);
         if (!bounds.contains(x, y))
             continue;
-        int offset = textBox->offsetForPosition(x - renderX);
+        int offset = textBox->offsetForPosition(x - absPt.x());
 #if DEBUG_NAV_UI
         int prior = offset > 0 ? textBox->positionForOffset(offset - 1) : -1;
         int current = textBox->positionForOffset(offset);
@@ -1283,7 +1287,7 @@
         DBG_NAV_LOGD(
             "offset=%d pt.x=%d globalX=%d renderX=%d x=%d "
             "textBox->x()=%d textBox->start()=%d prior=%d current=%d next=%d",
-            offset, pt.x(), globalX, renderX, x,
+            offset, pt.x(), globalX, absPt.x(), x,
             textBox->xPos(), textBox->start(), prior, current, next
             );
 #endif
@@ -1785,7 +1789,7 @@
             for (int i = 0; i < size; i++) {
                 if (listItems[i]->hasTagName(WebCore::HTMLNames::optionTag)) {
                     WebCore::HTMLOptionElement* option = static_cast<WebCore::HTMLOptionElement*>(listItems[i]);
-                    *names.append() = stringConverter(option->optionText());
+                    *names.append() = stringConverter(option->text());
                     *enabledArray.append() = option->disabled() ? 0 : 1;
                     if (multiple && option->selected())
                         *selectedArray.append() = i;
@@ -1810,12 +1814,12 @@
     DBG_NAV_LOGD("m_mousePos={%d,%d}", m_mousePos.x(), m_mousePos.y());
     WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton,
             WebCore::MouseEventPressed, 1, false, false, false, false,
-            WebCore::currentTime());
+            WTF::currentTime());
     // ignore the return from as it will return true if the hit point can trigger selection change
     framePtr->eventHandler()->handleMousePressEvent(mouseDown);
     WebCore::PlatformMouseEvent mouseUp(m_mousePos, m_mousePos, WebCore::LeftButton,
             WebCore::MouseEventReleased, 1, false, false, false, false,
-            WebCore::currentTime());
+            WTF::currentTime());
     bool handled = framePtr->eventHandler()->handleMouseReleaseEvent(mouseUp);
     webFrame->setUserInitiatedClick(false);
     return handled;
@@ -1953,9 +1957,8 @@
 {
     if (m_snapAnchorNode) {
         if (m_snapAnchorNode->inDocument()) {
-            int rx, ry;
-            m_snapAnchorNode->renderer()->absolutePosition(rx, ry);
-            scrollTo(rx, ry);
+            FloatPoint pt = m_snapAnchorNode->renderer()->localToAbsolute();
+            scrollTo(pt.x(), pt.y());
         } else {
             m_snapAnchorNode = 0;
         }
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 9150830..8c350bf 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -113,39 +113,6 @@
     print(", ");
 }
 
-int CacheBuilder::Debug::flowBoxes(RenderFlow* flow, int ifIndex, int indent) {
-    char scratch[256];
-    const InlineFlowBox* box = flow->firstLineBox();
-    if (box == NULL)
-        return ifIndex;
-    do {
-        newLine();
-        int i = snprintf(scratch, sizeof(scratch), "// render flow:%p"
-            " box:%p%.*s", flow, box, indent, "        ");
-        for (; box; box = box->nextFlowBox()) {
-            i += snprintf(&scratch[i], sizeof(scratch) - i, 
-                " [%d]:{%d, %d, %d, %d}", ++ifIndex,
-                box->xPos(), box->yPos(), box->width(), box->height());
-            if (ifIndex % 4 == 0)
-                break;
-        }
-        print(scratch);
-    } while (box);
-    RenderObject const * const end = flow->lastChild();
-    if (end == NULL)
-        return ifIndex;
-    indent += 2;
-    if (indent > 8)
-        indent = 8;
-    for (const RenderObject* renderer = flow->firstChild(); renderer != end; 
-            renderer = renderer->nextSibling())
-    {
-        if (renderer->isInlineFlow())
-            ifIndex = flowBoxes((RenderFlow*) renderer, ifIndex, indent);
-    }
-    return ifIndex;
-}
-
 void CacheBuilder::Debug::flush() {
     int len;
     do {
@@ -542,16 +509,16 @@
                     InlineTextBox* textBox = renderText->firstTextBox();
                     unsigned rectIndex = 0;
                     while (textBox) {
-                        int renderX, renderY;
-                        renderText->absolutePosition(renderX, renderY);
-                        IntRect rect = textBox->selectionRect(renderX, renderY, 0, INT_MAX);
+                        FloatPoint pt = renderText->localToAbsolute();
+                        IntRect rect = textBox->selectionRect((int) pt.x(), (int) pt.y(), 0, INT_MAX);
                         mIndex = 0;
                         mIndex += snprintf(&mBuffer[mIndex], mBufferSize - mIndex, "{ %d, %d, %d, %d, %d", 
                             nodeIndex, rect.x(), rect.y(), rect.width(), rect.height());
                         mIndex += snprintf(&mBuffer[mIndex], mBufferSize - mIndex, ", %d, %d, %d", 
-                            textBox->len(), textBox->selectionHeight(), textBox->selectionTop());
+                            textBox->len(), 0 /*textBox->selectionHeight()*/, 
+                            0 /*textBox->selectionTop()*/);
                         mIndex += snprintf(&mBuffer[mIndex], mBufferSize - mIndex, ", %d, %d, %d", 
-                            textBox->spaceAdd(), textBox->start(), textBox->textPos());
+                            0 /*textBox->spaceAdd()*/, textBox->start(), 0 /*textBox->textPos()*/);
                         mIndex += snprintf(&mBuffer[mIndex], mBufferSize - mIndex, ", %d, %d, %d, %d", 
                             textBox->xPos(), textBox->yPos(), textBox->width(), textBox->height());
                         mIndex += snprintf(&mBuffer[mIndex], mBufferSize - mIndex, ", %d }, // %d ", 
@@ -711,29 +678,24 @@
             " hasBackground:%s isInlineFlow:%s isBlockFlow:%s"
             " textOverflow:%s",
             vis == VISIBLE ? "visible" : vis == HIDDEN ? "hidden" : "collapse", 
-            style->opacity(), renderer->width(), renderer->height(),
+            style->opacity(), 0 /*renderer->width()*/, 0 /*renderer->height()*/,
             style->hasBackground() ? "true" : "false",
-            renderer->isInlineFlow() ? "true" : "false",
+            0 /*renderer->isInlineFlow()*/ ? "true" : "false",
             renderer->isBlockFlow() ? "true" : "false",
             style->textOverflow() ? "true" : "false"
             );
         print(scratch);
         newLine(indent);
-        const IntRect& oRect = renderer->overflowRect(true);
+        const IntRect& oRect = renderer->absoluteClippedOverflowRect();
         const IntRect& cRect = renderer->getOverflowClipRect(0,0);
         snprintf(scratch, sizeof(scratch), 
             "// render xPos:%d yPos:%d overflowRect:{%d, %d, %d, %d} "
             " getOverflowClipRect:{%d, %d, %d, %d} ", 
-            renderer->xPos(), renderer->yPos(),
+            0 /*renderer->xPos()*/, 0 /*renderer->yPos()*/,
             oRect.x(), oRect.y(), oRect.width(), oRect.height(),
             cRect.x(), cRect.y(), cRect.width(), cRect.height()
             );
         print(scratch);
-        if (renderer->isInlineFlow()) {
-            RenderFlow* renderFlow = (RenderFlow*) renderer;
-            int ifIndex = 0;
-            flowBoxes(renderFlow, ifIndex, 0);
-        }
     }
 tryParent:
     RenderObject* parent = renderer->parent();
@@ -1141,7 +1103,7 @@
             clip.mHasClip = hasClip;
             clip.mDirection = direction;
             if (columns != NULL) {
-                const IntRect& oRect = nodeRenderer->overflowRect(true);
+                const IntRect& oRect = ((RenderBox*)nodeRenderer)->overflowRect(true);
                 clip.mBounds.move(oRect.x(), oRect.y());
             }
         }
@@ -1249,13 +1211,13 @@
             }
             bounds = node->getRect();
             // For Bank of America site
-            if (isTextField && nodeRenderer->paddingLeft() > 100) {
-                int paddingLeft = nodeRenderer->paddingLeft();
-                int paddingTop = nodeRenderer->paddingTop();
+            if (isTextField && ((RenderBox*)nodeRenderer)->paddingLeft() > 100) {
+                int paddingLeft = ((RenderBox*)nodeRenderer)->paddingLeft();
+                int paddingTop = ((RenderBox*)nodeRenderer)->paddingTop();
                 int x = bounds.x() + paddingLeft;
                 int y = bounds.y() + paddingTop;
-                int width = bounds.width() - paddingLeft - nodeRenderer->paddingRight();
-                int height = bounds.height() - paddingTop - nodeRenderer->paddingBottom();
+                int width = bounds.width() - paddingLeft - ((RenderBox*)nodeRenderer)->paddingRight();
+                int height = bounds.height() - paddingTop - ((RenderBox*)nodeRenderer)->paddingBottom();
                 bounds.setLocation(IntPoint(x, y));
                 bounds.setSize(IntSize(width, height));
             }
@@ -2964,14 +2926,14 @@
             if (renderer->hasOverflowClip() == false) {
                 if (nodeIsAnchor && test->hasTagName(HTMLNames::divTag)) {
                     IntRect bounds = renderer->absoluteBoundingBoxRect();  // x, y fixup done by AddPartRect
-                    int left = bounds.x() + renderer->paddingLeft() 
-                        + renderer->borderLeft();
-                    int top = bounds.y() + renderer->paddingTop() 
-                        + renderer->borderTop();
-                    int right = bounds.right() - renderer->paddingRight() 
-                        - renderer->borderRight();
-                    int bottom = bounds.bottom() - renderer->paddingBottom() 
-                        - renderer->borderBottom();
+                    int left = bounds.x() + ((RenderBox*)renderer)->paddingLeft() 
+                        + ((RenderBox*)renderer)->borderLeft();
+                    int top = bounds.y() + ((RenderBox*)renderer)->paddingTop() 
+                        + ((RenderBox*)renderer)->borderTop();
+                    int right = bounds.right() - ((RenderBox*)renderer)->paddingRight() 
+                        - ((RenderBox*)renderer)->borderRight();
+                    int bottom = bounds.bottom() - ((RenderBox*)renderer)->paddingBottom() 
+                        - ((RenderBox*)renderer)->borderBottom();
                     if (left >= right || top >= bottom)
                         continue;
                     bounds = IntRect(left, top, right - left, bottom - top);
@@ -3016,8 +2978,7 @@
     EVisibility vis = renderText->style()->visibility();
     StringImpl* string = textNode->string();
     const UChar* chars = string->characters();
-    int renderX, renderY;
-    renderText->absolutePosition(renderX, renderY);
+    FloatPoint pt = renderText->localToAbsolute();
     do {
         int textBoxStart = textBox->start();
         int textBoxEnd = textBoxStart + textBox->len();
@@ -3025,7 +2986,7 @@
             continue;
         if (textBoxEnd > relEnd)
             textBoxEnd = relEnd;
-        IntRect bounds = textBox->selectionRect(renderX, renderY, 
+        IntRect bounds = textBox->selectionRect((int) pt.x(), (int) pt.y(), 
             start, textBoxEnd);
         bounds.intersect(clipBounds);
         if (bounds.isEmpty())
diff --git a/WebKit/android/nav/CacheBuilder.h b/WebKit/android/nav/CacheBuilder.h
index 07040e2..32ae0af 100644
--- a/WebKit/android/nav/CacheBuilder.h
+++ b/WebKit/android/nav/CacheBuilder.h
@@ -243,7 +243,6 @@
 private:
         void attr(const AtomicString& name, const AtomicString& value);
         void comma(const char* str);
-        int flowBoxes(RenderFlow* flow, int ifIndex, int indent);
         void flush();
         Frame* frameAnd() const;
         void frames();
diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp
index 4db9e40..0eefad1 100644
--- a/WebKit/android/nav/CachedFrame.cpp
+++ b/WebKit/android/nav/CachedFrame.cpp
@@ -330,8 +330,8 @@
 }
 #endif
 
-const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, 
-    int* best, const CachedNode** directHit, const CachedFrame** framePtr, int* x, int* y) const
+const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, int* best,
+    bool* inside, const CachedNode** directHit, const CachedFrame** framePtr, int* x, int* y) const
 {
     const CachedNode* result = NULL;
     int rectWidth = rect.width();
@@ -387,13 +387,17 @@
                 both.intersect(testRect);
                 if (both.isEmpty())
                     continue;
+                bool testInside = testRect.contains(center);
+                if (*inside && !testInside)
+                    continue;
                 WebCore::IntPoint testCenter = WebCore::IntPoint(testRect.x() + 
                     (testRect.width() >> 1), testRect.y() + (testRect.height() >> 1));
                 int dx = testCenter.x() - center.x();
                 int dy = testCenter.y() - center.y();
                 int distance = dx * dx + dy * dy;
-                if (*best > distance) {
+                if ((!*inside && testInside) || *best > distance) {
                     *best = distance;
+                    *inside = testInside;
                     result = test;
                     *framePtr = this;
                     *x = both.x() + (both.width() >> 1);
@@ -404,7 +408,7 @@
     }
     for (const CachedFrame* frame = mCachedFrames.begin(); 
             frame != mCachedFrames.end(); frame++) {
-        const CachedNode* frameResult = frame->findBestAt(rect, best, directHit,
+        const CachedNode* frameResult = frame->findBestAt(rect, best, inside, directHit,
             framePtr, x, y);
         if (NULL != frameResult)
             result = frameResult;
diff --git a/WebKit/android/nav/CachedFrame.h b/WebKit/android/nav/CachedFrame.h
index 8e77470..dc20e15 100644
--- a/WebKit/android/nav/CachedFrame.h
+++ b/WebKit/android/nav/CachedFrame.h
@@ -71,7 +71,7 @@
     bool directionChange() const;
     const CachedNode* document() const { return mCachedNodes.begin(); }
     bool empty() const { return mCachedNodes.size() < 2; } // must have 1 past doc
-    const CachedNode* findBestAt(const WebCore::IntRect& , int* best,
+    const CachedNode* findBestAt(const WebCore::IntRect& , int* best, bool* inside,
         const CachedNode** , const CachedFrame** , int* x, int* y) const;
     const CachedFrame* findBestFrameAt(int x, int y) const;
     const CachedNode* findBestHitAt(const WebCore::IntRect& , 
diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp
index 4a50c80..a123e55 100644
--- a/WebKit/android/nav/CachedRoot.cpp
+++ b/WebKit/android/nav/CachedRoot.cpp
@@ -595,9 +595,10 @@
     const CachedFrame** framePtr, int* x, int* y) const
 {
     int best = INT_MAX;
+    bool inside = false;
     (const_cast<CachedRoot*>(this))->resetClippedOut();
     const CachedNode* directHit = NULL;
-    const CachedNode* node = findBestAt(rect, &best, &directHit, framePtr, x, y);
+    const CachedNode* node = findBestAt(rect, &best, &inside, &directHit, framePtr, x, y);
     DBG_NAV_LOGD("node=%d (%p)", node == NULL ? 0 : node->index(), 
         node == NULL ? NULL : node->nodePointer());
     if (node == NULL) {
diff --git a/WebKit/android/plugins/ANPTypefaceInterface.cpp b/WebKit/android/plugins/ANPTypefaceInterface.cpp
index 5878f3f..17b3067 100644
--- a/WebKit/android/plugins/ANPTypefaceInterface.cpp
+++ b/WebKit/android/plugins/ANPTypefaceInterface.cpp
@@ -28,7 +28,7 @@
 #include "SkANP.h"
 
 static ANPTypeface* anp_createFromName(const char name[], ANPTypefaceStyle s) {
-    SkTypeface* tf = SkTypeface::Create(name,
+    SkTypeface* tf = SkTypeface::CreateFromName(name,
                                         static_cast<SkTypeface::Style>(s));
     return reinterpret_cast<ANPTypeface*>(tf);
 }
@@ -53,7 +53,7 @@
 }
 
 static ANPTypefaceStyle anp_getStyle(const ANPTypeface* tf) {
-    SkTypeface::Style s = tf ? tf->getStyle() : SkTypeface::kNormal;
+    SkTypeface::Style s = tf ? tf->style() : SkTypeface::kNormal;
     return static_cast<ANPTypefaceStyle>(s);
 }
 
diff --git a/WebKit/android/stl/algorithm b/WebKit/android/stl/algorithm
index 8255def..33968ab 100644
--- a/WebKit/android/stl/algorithm
+++ b/WebKit/android/stl/algorithm
@@ -58,6 +58,7 @@
 #include <float.h>
 #include <math.h>
 #include <stdint.h>
+#include <stddef.h>
 
 #ifndef WCHAR_MAX
 	#define WCHAR_MAX	0xFFFF
@@ -182,7 +183,7 @@
 #endif
 //--------------------------------------------------------------------------------------
 
-typedef int ptrdiff_t;
+using ::ptrdiff_t;
 
 typedef bool (* Comparator)(const void*, const void*);
 extern void sort(const void** start, const void** end, Comparator comp);
diff --git a/WebKit/cf/ChangeLog b/WebKit/cf/ChangeLog
index 3e06358..d651266 100644
--- a/WebKit/cf/ChangeLog
+++ b/WebKit/cf/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-09  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Fix bustage.
+
+        * WebCoreSupport/WebInspectorClientCF.cpp:
+
 2008-10-24  Adam Roben  <aroben@apple.com>
 
         Windows build fix
diff --git a/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp b/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
index a4cb934..443a35d 100644
--- a/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
+++ b/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
@@ -25,14 +25,18 @@
 
 // FIXME: On Windows, we require all WebKit source files to include config.h
 // before including any other files. Failing to include config.h will leave
-// WTF_PLATFORM_CF undefined, causing build failures in this file. But Mac
-// doesn't have a config.h for WebKit, so we can't include the Windows one
-// here. For now we can just define WTF_PLATFORM_CF manually, but we need a
-// better long-term solution.
+// WTF_PLATFORM_CF and WTF_USE_JSC undefined, causing build failures in this 
+// file. But Mac doesn't have a config.h for WebKit, so we can't include the 
+// Windows one here. For now we can just define WTF_PLATFORM_CF and WTF_USE_JSC
+// manually, but we need a better long-term solution.
 #ifndef WTF_PLATFORM_CF
 #define WTF_PLATFORM_CF 1
 #endif
 
+#ifndef WTF_USE_JSC
+#define WTF_USE_JSC 1
+#endif
+
 #include "WebInspectorClient.h"
 
 #include <CoreFoundation/CoreFoundation.h>
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 166be63..e6dc216 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,695 @@
+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.
+
+        Keep GTK building.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::createFrame):
+        (WebKit::FrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40436.
+
+    2009-01-30  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::createFrame):
+
+2009-01-27  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Dan Bernstein
+
+        Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::savePlatformDataToCachedFrame):
+        (WebKit::FrameLoaderClient::transitionToCommittedFromCachedFrame):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2009-01-25  Darin Adler  <darin@apple.com>
+
+        Try to fix GTK build.
+
+        * webkit/webkitwebview.cpp: Added include of FloatQuad.h.
+
+2009-01-13  Alexander V. Butenko  <alex@digiqube.com>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23279
+
+        Fix crash on WebView dispose stage.
+
+        Add null checks to webkit_web_view_set_scroll_adjustments  and
+        webkit_web_view_get_accessible as they get called from within
+        the dispose.
+
+        * webkit/webkitwebview.cpp:
+
+2009-01-11  Xan Lopez  <xan@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        Use NULL instead of 0 when dealing with pointers, as agreed for
+        the coding style of the WebKit GTK port for its GTK+ specific
+        files.
+
+        * webkit/webkitwebview.cpp:
+
+2009-01-11  Xan Lopez  <xan@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        Add padding to the class structs to avoid breaking ABI each time
+        we add stuff there.
+
+        * webkit/webkitnetworkrequest.h:
+        * webkit/webkitwebbackforwardlist.h:
+        * webkit/webkitwebhistoryitem.h:
+        * webkit/webkitwebnavigationaction.h:
+        * webkit/webkitwebpolicydecision.h:
+        * webkit/webkitwebview.h:
+
+2009-01-09  Benjamin Otte  <otte@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23194
+
+        make the finalize function the dispose function. Not releasing held
+        objects in dispose can cause crashers later.
+
+        * webkit/webkitwebview.cpp:
+
+2009-01-09  Benjamin Otte  <otte@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23194
+
+        Remove broken code that uses a fallback. The previous code did 2
+        policy decisions which caused crashes.
+        Download is still notImplemented();
+
+        * webkit/webkitwebpolicydecision.cpp:
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_download):
+
+2009-01-03  Xan Lopez  <xan@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        [GTK] Need a public method to reload view bypassing cache
+        https://bugs.webkit.org/show_bug.cgi?id=19815
+
+        * webkit/webkitwebview.cpp:
+        * webkit/webkitwebview.h:
+
+        Add webkit_web_view_reload_bypass_cache.
+
+2009-01-07  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Add private API to get the number of active animations of
+        a frame. This is required by the DumpRenderTree utility.
+
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebframe.cpp:
+
+2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
+
+        Fix build
+
+        * WebCoreSupport/ChromeClientGtk.h:
+
+2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Build fix for contentsSizeChanged
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::contentsSizeChanged):
+        * WebCoreSupport/ChromeClientGtk.h:
+
+2009-01-04  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Make the gtk port build with the new fixedLayoutSize feature
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
+
+2009-01-03  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Darin Adler.
+
+        [GTK] Fix the reference counting of WebKitWebFrames
+        
+        The ownership is the following: WebKitWebView owns a WebCore::Page.
+        WebKitWebView is creating one WebKitWebFrame which will be the
+        mainFrame of the WebCore::Page (having the reference on the Frame).
+        
+        The FrameLoaderClient has the reference of the WebKitWebFrame for
+        the main frame and also any other frame. This means when the
+        WebCore::Frame goes away the FrameLoaderClient will go away which
+        will normally remove the last reference of the WebKitWebFrame. Because
+        an API user might have g_object_ref'ed the WebKitWebFrame null
+        checks had to be added to WebKitWebFrame.
+        
+        For WebCore::Frames created by the FrameLoaderClient the ownership
+        will be passed down to the FrameTree, the WebKitWebFrame is not holding
+        a reference to the WebCore::Frame.
+        
+        Do not g_object_unref the mainFrame in the destructor of the
+        WebKitWebFrame as this will happen from within the WebCore::Page
+        destruction. Do not hold a reference to the WebCore::Frame (circle) in
+        WebKitWebFrame, add null checks as the WebCore::Frame might have gone
+        away. Do not keep track of the FrameLoaderClient in the private
+        structures as it was mostly unusued.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=21837
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::frameLoaderDestroyed):
+        (WebKit::FrameLoaderClient::createFrame):
+        * tests/main.c: Add test case.
+        (test_webkit_web_frame_create_destroy):
+        (test_webkit_web_frame_lifetime):
+        (main):
+        * webkit/webkitprivate.cpp:
+        (WebKit::core):
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebframe.cpp:
+        * webkit/webkitwebview.cpp:
+
+2009-01-02  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Unreviewed build fix.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+
+2008-12-31  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=17045
+
+        Add section information for View, Frame, Settings, HistoryItem, BackForwardList, WindowFeatures and Inspector
+
+        Add section information and informal examples for WebKitWebView,
+        WebKitWebFrame, WebKitWebSettings, WebKitWebNetworkRequest,
+        WebKitWebWindowFeatures, WebKitWebHistoryItem,
+        WebKitWebBackForwardList and WebKitWebInspector.
+
+        * docs/webkitgtk-sections.txt: Decide to not document some bits
+        * webkit/webkitnetworkrequest.cpp:
+        * webkit/webkitwebbackforwardlist.cpp:
+        * webkit/webkitwebframe.cpp:
+        * webkit/webkitwebhistoryitem.cpp:
+        * webkit/webkitwebhistoryitem.h:
+        * webkit/webkitwebinspector.cpp:
+        * webkit/webkitwebsettings.cpp:
+        * webkit/webkitwebsettings.h:
+        * webkit/webkitwebview.cpp:
+        * webkit/webkitwebwindowfeatures.cpp:
+
+2008-12-21  Xan Lopez  <xan@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=16092
+        [GTK] Middle-mouse click should allow opening a URL in a new tab
+
+        Add mouse button and keyboard state modifiers info to navigation action.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+        * webkit/webkitwebnavigationaction.cpp:
+        (_WebKitWebNavigationActionPrivate::):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_property):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_set_property):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_class_init):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_button):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_modifier_state):
+        * webkit/webkitwebnavigationaction.h:
+
+2008-12-19  Marco Barisione  <marco.barisione@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16562
+        [gtk] Implement WebPolicyDelegate methods
+
+        Original work by Pierre-Luc Beaudoin. Final touches by Gustavo
+        Noronha.
+
+        This implements the delegates methods of WebPolicyDelegate.
+        Since Gtk+/C doesn't have delegate methods, they are replaced with
+        signals.
+
+        A new object WebKitWebPolicyDecision allows the browser to delay its
+        response in certain cases. WebKitWebNavigationAction contains the
+        information about what caused a navigation request.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::FrameLoaderClient):
+        (WebKit::FrameLoaderClient::~FrameLoaderClient):
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType):
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+        (WebKit::FrameLoaderClient::cancelPolicyCheck):
+        (WebKit::FrameLoaderClient::canShowMIMEType):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+        * webkit/webkit.h:
+        * webkit/webkitdefines.h:
+        * webkit/webkitprivate.cpp:
+        (WebKit::kit):
+        (WebKit::core):
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebnavigationaction.cpp: Added.
+        (_WebKitWebNavigationActionPrivate::):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_property):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_set_property):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_init):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_finalize):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_class_init):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_reason):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_set_reason):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_original_uri):
+        (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_set_original_uri):
+        * webkit/webkitwebnavigationaction.h: Added.
+        * webkit/webkitwebpolicydecision.cpp: Added.
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_class_init):
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_init):
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_new):
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_use):
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_ignore):
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_download):
+        (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_cancel):
+        * webkit/webkitwebpolicydecision.h: Added.
+        * webkit/webkitwebview.cpp:
+        * webkit/webkitwebview.h:
+
+2008-12-18  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - stub out FrameLoaderClient::shouldUseCredentialStorage().
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::shouldUseCredentialStorage):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2008-12-18  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by John Sullivan.
+
+        Stub out FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2008-12-13  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Cameron Zwarich.
+
+        [GTK] Fix crash with LayoutTests/fast/loader/frame-creation-removal.html
+
+        Call WebCore::Frame::init after the frame has been given
+        a name and been added to the FrameTree of the parent.
+
+        Removing the call to init is fine as FrameLoaderClientGtk::createFrame
+        is the only user of webkit_web_frame_init_with_web_view and is already
+        calling WebCore::Frame::init.
+
+        * webkit/webkitwebframe.cpp:
+
+2008-12-13  Adam Bergkvist <adam.bergkvist@ericsson.com>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22779
+
+        Check for GTK version >= 2.14.0 before using gtk_test_init.
+
+        * tests/main.c:
+        (main):
+
+2008-12-13  Zan Dobersek  <zandobersek@gmail.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22039
+
+        Implement animation and transition pausing as needed by DumpRenderTree.
+
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebframe.cpp:
+
+2008-11-29  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Rubber-stamped by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22574
+
+        Make webkit_web_view_set_window_features internal
+
+        Calling this method will not result in a notify::window-features
+        signal being emitted. This would allow replacing a
+        WebKitWebWindowFeature on a WebKitWebView without anyone noticing
+        and the client code would monitor the wrong object.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::createWindow):
+        * webkit/webkitwebview.cpp:
+        * webkit/webkitwebview.h:
+
+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/ChromeClientGtk.h:
+        (WebKit::ChromeClient::formStateDidChange):
+
+2008-12-07  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Eric Seidel.
+
+        [Gtk+] Use glib's unit test facilities to test the WebKit/Gtk+ API
+
+        https://bugs.webkit.org/show_bug.cgi?id=22491
+
+        Add the skeleton to WebKit/gtk/tests and integrate that into the
+        buildsystem. Testing support was added in glib 2.16. For versions
+        using glib < 2.16 we compile an empty application.
+
+        * tests/main.c: Added. https://bugs.webkit.org/show_bug.cgi?id=21837
+        will be the first consumer.
+        (main):
+
+2008-12-06  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dave Hyatt
+
+        https://bugs.webkit.org/show_bug.cgi?id=15671
+
+        Renderer::caretRect() is now localCaretRect(), which needs
+        converting to absolute coordinates (taking transforms into account).
+        
+        * webkit/webkitwebview.cpp:
+
+2008-12-01  Xan Lopez  <xan@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        http://bugs.webkit.org/show_bug.cgi?id=22553
+        Remove unneeded GObject casts.
+
+        Remove unneeded casts to GObject in functions that take a gpointer
+        argument.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::setWindowRect):
+        (WebKit::ChromeClient::createWindow):
+        (WebKit::ChromeClient::setToolbarsVisible):
+        (WebKit::ChromeClient::toolbarsVisible):
+        (WebKit::ChromeClient::setStatusbarVisible):
+        (WebKit::ChromeClient::statusbarVisible):
+        (WebKit::ChromeClient::setScrollbarsVisible):
+        (WebKit::ChromeClient::scrollbarsVisible):
+        (WebKit::ChromeClient::setMenubarVisible):
+        (WebKit::ChromeClient::menubarVisible):
+        (WebKit::ChromeClient::setToolTip):
+        * WebCoreSupport/InspectorClientGtk.cpp:
+        (WebKit::InspectorClient::createPage):
+        * webkit/webkitwebframe.cpp:
+        * webkit/webkitwebview.cpp:
+        * webkit/webkitwebwindowfeatures.cpp:
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_new_from_core_features):
+
+2008-11-29  Christian Dywan  <christian@twotoasts.de>
+
+        Reviewed by Holger Freyther.
+
+        http://bugs.webkit.org/show_bug.cgi?id=17122
+        [GTK] Bad font default settings
+
+        Implement a property "enforce-96-dpi" in WebKitWebSettings
+        that can be enabled to force the view to assume 96 DPI.
+
+        * webkit/webkitwebsettings.cpp:
+        (_WebKitWebSettingsPrivate::):
+        (_WebKitWebSettingsPrivate::webkit_web_settings_class_init):
+        (_WebKitWebSettingsPrivate::webkit_web_settings_set_property):
+        (_WebKitWebSettingsPrivate::webkit_web_settings_get_property):
+        * webkit/webkitwebview.cpp:
+
+2008-11-28  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Simplify the code. There is no reason to have code like
+        if (true) return false; which is using temporary variables.
+
+        * webkit/webkitwebview.cpp:
+
+2008-11-28  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Remove bogus null checks. The WebKitWebView own's a WebCore::Page
+        which is owning a WebCore::ChromeClient. There is no way that a
+        WebCore::ChromeClient is still around when the WebKitWebView is gone.
+
+        m_webView can only be null when a ChromeClient gets constructed with
+        a null WebKitWebView which is not allowed.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::ChromeClient):
+        (WebKit::ChromeClient::windowRect):
+        (WebKit::ChromeClient::setWindowRect):
+        (WebKit::ChromeClient::pageRect):
+        (WebKit::ChromeClient::focus):
+        (WebKit::ChromeClient::unfocus):
+        (WebKit::ChromeClient::show):
+        (WebKit::ChromeClient::setToolbarsVisible):
+        (WebKit::ChromeClient::toolbarsVisible):
+        (WebKit::ChromeClient::setStatusbarVisible):
+        (WebKit::ChromeClient::statusbarVisible):
+        (WebKit::ChromeClient::setScrollbarsVisible):
+        (WebKit::ChromeClient::setMenubarVisible):
+        (WebKit::ChromeClient::menubarVisible):
+        (WebKit::ChromeClient::canTakeFocus):
+        (WebKit::ChromeClient::repaint):
+        (WebKit::ChromeClient::scroll):
+        (WebKit::ChromeClient::platformWindow):
+
+2008-11-28  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Reviewed and slightly modified by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=19130
+
+        ChromeClient::createWindow and friends need to be implemented
+
+        Code from Gustavo Noronha and Marco Barisione
+        <marco.barisione@collabora.co.uk> in this change set.
+
+        Implemented all the ChromeClient interfaces needed to have new
+        window creation functioning and exposed to client code. We
+        implemented a mirror GObject to the WindowFeatures object provided
+        by WebCore.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::windowRect):
+        (WebKit::ChromeClient::setWindowRect):
+        (WebKit::ChromeClient::unfocus):
+        (WebKit::ChromeClient::createWindow):
+        (WebKit::ChromeClient::show):
+        (WebKit::ChromeClient::setToolbarsVisible):
+        (WebKit::ChromeClient::toolbarsVisible):
+        (WebKit::ChromeClient::setStatusbarVisible):
+        (WebKit::ChromeClient::statusbarVisible):
+        (WebKit::ChromeClient::setScrollbarsVisible):
+        (WebKit::ChromeClient::scrollbarsVisible):
+        (WebKit::ChromeClient::setMenubarVisible):
+        (WebKit::ChromeClient::menubarVisible):
+        (WebKit::ChromeClient::setResizable):
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+        (WebKit::FrameLoaderClient::dispatchShow):
+        (WebKit::FrameLoaderClient::dispatchCreatePage):
+        * webkit/webkit.h:
+        * webkit/webkitdefines.h:
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebview.cpp:
+        * webkit/webkitwebview.h:
+        * webkit/webkitwebwindowfeatures.cpp: Added.
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_class_init):
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_init):
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_finalize):
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_set_property):
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_get_property):
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_new):
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_new_from_core_features):
+        (_WebKitWebWindowFeaturesPrivate::webkit_web_window_features_equal):
+        * webkit/webkitwebwindowfeatures.h: Added.
+
+2008-11-24  Darin Fisher  <darin@chromium.org>
+
+        Fix bustage.
+
+        http://bugs.webkit.org/show_bug.cgi?id=15643
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::EditorClient::isSelectTrailingWhitespaceEnabled):
+        * WebCoreSupport/EditorClientGtk.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/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::updateGlobalHistory): Remove argument.
+        * WebCoreSupport/FrameLoaderClientGtk.h: Ditto.
+
+2008-11-24  Christian Dywan  <christian@twotoasts.de>
+
+        Reviewed by Holger Freyther.
+
+        http://bugs.webkit.org/show_bug.cgi?id=17122
+        [GTK] Bad font default settings
+
+        * webkit/webkitwebsettings.cpp:
+        (_WebKitWebSettingsPrivate::webkit_web_settings_class_init):
+        Use default font size 12 instead of 10
+
+2008-11-24  Zan Dobersek  <zandobersek@gmail.com>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22039
+
+        Implement a semi-private function for adding a directory to
+        PluginDatabase's paths.
+
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebsettings.cpp:
+        (_WebKitWebSettingsPrivate::webkit_web_settings_add_extra_plugin_directory):
+
+2008-11-23  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Rubber-stamped by Sam Weinig.
+
+        Add gtk-doc configuration/source for the WebKit/Gtk+ Reference Manual
+
+        These files will be used by gtk-doc to generate the documentation. They
+        contain information how to group the symbols of our API, which objects
+        to inspect during the generation of the manual and how to display the
+        manual.
+
+        * docs/webkitgtk-docs.sgml: Added.
+        * docs/webkitgtk-overrides.txt: Added.
+        * docs/webkitgtk-sections.txt: Added.
+        * docs/webkitgtk.types: Added.
+
+2008-11-23  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Sam Weinig.
+
+        Make gtk-doc happy with the existing API documentation
+
+        - Mark the *Private pointers in the struct private
+        - Use Returns: where gtk-doc wants us to
+        - Fix the parameters to make gtk-doc happy
+        - Fix signal references
+
+        * webkit/webkitnetworkrequest.h:
+        * webkit/webkitwebbackforwardlist.cpp:
+        * webkit/webkitwebbackforwardlist.h:
+        * webkit/webkitwebframe.h:
+        * webkit/webkitwebhistoryitem.cpp:
+        * webkit/webkitwebinspector.cpp:
+        (_WebKitWebInspectorPrivate::webkit_web_inspector_class_init):
+        * webkit/webkitwebview.cpp:
+        * webkit/webkitwebview.h:
+
+2008-11-19  Darin Fisher  <darin@chromium.org>
+
+        Bustage fix.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22373
+        Ports busted by addition of ScriptValue.{h,cpp}
+
+        * webkit/webkitwebview.cpp:
+
+2008-11-18  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        Attempt to share transitionToCommittedForNewPage of FrameLoaderClient with the different ports
+
+        After Hyatt's work on Widget and ScrollView there is little difference
+        between the implementation of Qt, Gtk+ and Win. In fact any kind of
+        difference is mostly a bug. Alp has fixed two of such errors for the Gtk+
+        port and the Qt port has at least one of them left.
+
+        The only difference between the implementations is in getting the the
+        IntSize for the new FrameView, the background color to be applied and
+        eventually some post processing.
+
+        Unify the implementations by providing a static helper function that
+        takes a Frame, IntSize, color and transparency bit and calling it from
+        the Gtk+, the Qt and the Windows port.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
+
+2008-11-16  Christian Dywan  <christian@twoasts.de>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22207
+        [Gtk] Font sizes are not handled properly when updated at runtime
+
+        * webkit/webkitwebview.cpp: Move the DPI/ conversion into a
+        helper function and apply the logic in the notification callback.
+
+2008-11-06  Alp Toker  <alp@nuanti.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22047
+        GTK: Add support for multiple file selection in the file upload control
+
+        Implemented with GtkFileChooser.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::runOpenPanel):
+
 2008-11-03  Cameron Zwarich  <zwarich@apple.com>
 
         Rubber-stamped by Maciej Stachowiak.
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 18ca5b3..3557a3f 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -1,7 +1,9 @@
 /*
- * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007, 2008 Holger Hans Peter Freyther
  * Copyright (C) 2007, 2008 Christian Dywan <christian@imendio.com>
  * Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org>
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -24,12 +26,14 @@
 #include "FileSystem.h"
 #include "FileChooser.h"
 #include "FloatRect.h"
+#include "FrameLoadRequest.h"
 #include "IntRect.h"
 #include "PlatformString.h"
 #include "CString.h"
 #include "HitTestResult.h"
 #include "KURL.h"
 #include "webkitwebview.h"
+#include "webkitnetworkrequest.h"
 #include "webkitprivate.h"
 #include "NotImplemented.h"
 #include "WindowFeatures.h"
@@ -48,6 +52,7 @@
 ChromeClient::ChromeClient(WebKitWebView* webView)
     : m_webView(webView)
 {
+    ASSERT(m_webView);
 }
 
 void ChromeClient::chromeDestroyed()
@@ -57,10 +62,8 @@
 
 FloatRect ChromeClient::windowRect()
 {
-    if (!m_webView)
-        return FloatRect();
     GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
-    if (window) {
+    if (GTK_WIDGET_TOPLEVEL(window)) {
         gint left, top, width, height;
         gtk_window_get_position(GTK_WINDOW(window), &left, &top);
         gtk_window_get_size(GTK_WINDOW(window), &width, &height);
@@ -69,15 +72,21 @@
     return FloatRect();
 }
 
-void ChromeClient::setWindowRect(const FloatRect& r)
+void ChromeClient::setWindowRect(const FloatRect& rect)
 {
-    notImplemented();
+    IntRect intrect = IntRect(rect);
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+
+    g_object_set(webWindowFeatures,
+                 "x", intrect.x(),
+                 "y", intrect.y(),
+                 "width", intrect.width(),
+                 "height", intrect.height(),
+                 NULL);
 }
 
 FloatRect ChromeClient::pageRect()
 {
-    if (!m_webView)
-        return FloatRect();
     GtkAllocation allocation = GTK_WIDGET(m_webView)->allocation;
     return IntRect(allocation.x, allocation.y, allocation.width, allocation.height);
 }
@@ -90,39 +99,38 @@
 
 void ChromeClient::focus()
 {
-    if (!m_webView)
-        return;
     gtk_widget_grab_focus(GTK_WIDGET(m_webView));
 }
 
 void ChromeClient::unfocus()
 {
-    if (!m_webView)
-        return;
     GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
-    if (window)
+    if (GTK_WIDGET_TOPLEVEL(window))
         gtk_window_set_focus(GTK_WINDOW(window), NULL);
 }
 
-Page* ChromeClient::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features)
+Page* ChromeClient::createWindow(Frame* frame, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& coreFeatures)
 {
-    if (features.dialog) {
-        notImplemented();
-        return 0;
-    } else {
-        /* TODO: FrameLoadRequest is not used */
-        WebKitWebView* webView = WEBKIT_WEB_VIEW_GET_CLASS(m_webView)->create_web_view(m_webView);
-        if (!webView)
-            return 0;
+    WebKitWebView* webView = 0;
 
-        WebKitWebViewPrivate* privateData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
-        return privateData->corePage;
-    }
+    g_signal_emit_by_name(m_webView, "create-web-view", kit(frame), &webView);
+
+    if (!webView)
+        return 0;
+
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_window_features_new_from_core_features(coreFeatures);
+    g_object_set(webView, "window-features", webWindowFeatures, NULL);
+    g_object_unref(webWindowFeatures);
+
+    if (!frameLoadRequest.isEmpty())
+        webkit_web_view_open(webView, frameLoadRequest.resourceRequest().url().string().utf8().data());
+
+    return core(webView);
 }
 
 void ChromeClient::show()
 {
-    notImplemented();
+    webkit_web_view_notify_ready(m_webView);
 }
 
 bool ChromeClient::canRunModal()
@@ -136,52 +144,72 @@
     notImplemented();
 }
 
-void ChromeClient::setToolbarsVisible(bool)
+void ChromeClient::setToolbarsVisible(bool visible)
 {
-    notImplemented();
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+
+    g_object_set(webWindowFeatures, "toolbar-visible", visible, NULL);
 }
 
 bool ChromeClient::toolbarsVisible()
 {
-    notImplemented();
-    return false;
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+    gboolean visible;
+
+    g_object_get(webWindowFeatures, "toolbar-visible", &visible, NULL);
+    return visible;
 }
 
-void ChromeClient::setStatusbarVisible(bool)
+void ChromeClient::setStatusbarVisible(bool visible)
 {
-    notImplemented();
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+
+    g_object_set(webWindowFeatures, "statusbar-visible", visible, NULL);
 }
 
 bool ChromeClient::statusbarVisible()
 {
-    notImplemented();
-    return false;
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+    gboolean visible;
+
+    g_object_get(webWindowFeatures, "statusbar-visible", &visible, NULL);
+    return visible;
 }
 
-void ChromeClient::setScrollbarsVisible(bool)
+void ChromeClient::setScrollbarsVisible(bool visible)
 {
-    notImplemented();
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+
+    g_object_set(webWindowFeatures, "scrollbar-visible", visible, NULL);
 }
 
 bool ChromeClient::scrollbarsVisible() {
-    notImplemented();
-    return false;
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+    gboolean visible;
+
+    g_object_get(webWindowFeatures, "scrollbar-visible", &visible, NULL);
+    return visible;
 }
 
-void ChromeClient::setMenubarVisible(bool)
+void ChromeClient::setMenubarVisible(bool visible)
 {
-    notImplemented();
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+
+    g_object_set(webWindowFeatures, "menubar-visible", visible, NULL);
 }
 
 bool ChromeClient::menubarVisible()
 {
-    notImplemented();
-    return false;
+    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_view_get_window_features(m_webView);
+    gboolean visible;
+
+    g_object_get(webWindowFeatures, "menubar-visible", &visible, NULL);
+    return visible;
 }
 
 void ChromeClient::setResizable(bool)
 {
-    notImplemented();
+    // Ignored for now
 }
 
 void ChromeClient::closeWindowSoon()
@@ -191,8 +219,6 @@
 
 bool ChromeClient::canTakeFocus(FocusDirection)
 {
-    if (!m_webView)
-        return false;
     return GTK_WIDGET_CAN_FOCUS(m_webView);
 }
 
@@ -269,9 +295,6 @@
 
 void ChromeClient::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
 {
-    if (!m_webView)
-        return;
-
     GdkRectangle rect = windowRect;
     GdkWindow* window = GTK_WIDGET(m_webView)->window;
 
@@ -286,9 +309,6 @@
 
 void ChromeClient::scroll(const IntSize& delta, const IntRect& rectToScroll, const IntRect& clipRect)
 {
-    if (!m_webView)
-        return;
-
     GdkWindow* window = GTK_WIDGET(m_webView)->window;
     if (!window)
         return;
@@ -328,7 +348,12 @@
 
 PlatformWidget ChromeClient::platformWindow() const
 {
-    return m_webView ? GTK_WIDGET(m_webView) : 0;
+    return GTK_WIDGET(m_webView);
+}
+
+void ChromeClient::contentsSizeChanged(Frame*, const IntSize&) const
+{
+    notImplemented();
 }
 
 void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags)
@@ -353,7 +378,7 @@
 {
 #if GTK_CHECK_VERSION(2,12,0)
     if (toolTip.isEmpty())
-        g_object_set(G_OBJECT(m_webView), "has-tooltip", FALSE, NULL);
+        g_object_set(m_webView, "has-tooltip", FALSE, NULL);
     else
         gtk_widget_set_tooltip_text(GTK_WIDGET(m_webView), toolTip.utf8().data());
 #else
@@ -381,9 +406,7 @@
 
 void ChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
 {
-    // FIXME: Support multiple files.
-
-    RefPtr<FileChooser> fileChooser = prpFileChooser;
+    RefPtr<FileChooser> chooser = prpFileChooser;
 
     GtkWidget* dialog = gtk_file_chooser_dialog_new(_("Upload File"),
                                                     GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(platformWindow()))),
@@ -392,11 +415,26 @@
                                                     GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
                                                     NULL);
 
+    gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), chooser->allowsMultipleFiles());
+
     if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
-        gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
-        if (filename)
-            fileChooser->chooseFile(filenameToString(filename));
-        g_free(filename);
+        if (gtk_file_chooser_get_select_multiple(GTK_FILE_CHOOSER(dialog))) {
+            GSList* filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog));
+            Vector<String> names;
+            for (GSList* item = filenames ; item ; item = item->next) {
+                if (!item->data)
+                    continue;
+                names.append(filenameToString(static_cast<char*>(item->data)));
+                g_free(item->data);
+            }
+            g_slist_free(filenames);
+            chooser->chooseFiles(names);
+        } else {
+            gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+            if (filename)
+                chooser->chooseFile(filenameToString(filename));
+            g_free(filename);
+        }
     }
     gtk_widget_destroy(dialog);
 }
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
index 04b3a26..299d023 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
@@ -89,6 +89,7 @@
         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 mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
 
@@ -100,6 +101,8 @@
 
         virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
 
+        virtual void formStateDidChange(const WebCore::Node*) { }
+
     private:
         WebKitWebView* m_webView;
         WebCore::KURL m_hoveredLinkURL;
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 62f1f27..e09178e 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -301,6 +301,12 @@
     return false;
 }
 
+bool EditorClient::isSelectTrailingWhitespaceEnabled()
+{
+    notImplemented();
+    return false;
+}
+
 void EditorClient::toggleContinuousSpellChecking()
 {
     notImplemented();
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
index de31842..14514f5 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
@@ -53,6 +53,7 @@
         virtual bool shouldDeleteRange(WebCore::Range*);
         virtual bool shouldShowDeleteInterface(WebCore::HTMLElement*);
         virtual bool smartInsertDeleteEnabled();
+        virtual bool isSelectTrailingWhitespaceEnabled();
         virtual bool isContinuousSpellCheckingEnabled();
         virtual void toggleContinuousSpellChecking();
         virtual bool isGrammarCheckingEnabled();
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 8cea58f..55d5024 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -22,7 +22,9 @@
 #include "config.h"
 #include "FrameLoaderClientGtk.h"
 
+#include "Color.h"
 #include "DocumentLoader.h"
+#include "FormState.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
 #include "FrameTree.h"
@@ -33,6 +35,7 @@
 #include "JSDOMWindow.h"
 #include "Language.h"
 #include "MIMETypeRegistry.h"
+#include "MouseEvent.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
 #include "PluginDatabase.h"
@@ -43,7 +46,10 @@
 #include "JSDOMBinding.h"
 #include "ScriptController.h"
 #include "webkitwebview.h"
+#include "webkitnetworkrequest.h"
 #include "webkitwebframe.h"
+#include "webkitwebnavigationaction.h"
+#include "webkitwebpolicydecision.h"
 #include "webkitprivate.h"
 
 #include <JavaScriptCore/APICast.h>
@@ -59,12 +65,19 @@
 FrameLoaderClient::FrameLoaderClient(WebKitWebFrame* frame)
     : m_frame(frame)
     , m_userAgent("")
+    , m_policyDecision(0)
     , m_pluginView(0)
     , m_hasSentResponseToPlugin(false)
 {
     ASSERT(m_frame);
 }
 
+FrameLoaderClient::~FrameLoaderClient()
+{
+    if (m_policyDecision)
+        g_object_unref(m_policyDecision);
+}
+
 static String agentPlatform()
 {
 #ifdef GDK_WINDOWING_X11
@@ -188,6 +201,13 @@
     }
 }
 
+bool
+FrameLoaderClient::shouldUseCredentialStorage(DocumentLoader*, unsigned long  identifier)
+{
+    notImplemented();
+    return false;
+}
+
 void FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long  identifier, const AuthenticationChallenge&)
 {
     notImplemented();
@@ -231,6 +251,7 @@
 
 void FrameLoaderClient::frameLoaderDestroyed()
 {
+    webkit_web_frame_core_frame_gone(m_frame);
     g_object_unref(m_frame);
     m_frame = 0;
     delete this;
@@ -241,23 +262,42 @@
     m_response = response;
 }
 
-void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String&, const ResourceRequest&)
+void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String& mimeType, const ResourceRequest& resourceRequest)
 {
-    // FIXME: we need to call directly here (comment copied from Qt version)
     ASSERT(policyFunction);
     if (!policyFunction)
         return;
-    (core(m_frame)->loader()->*policyFunction)(PolicyUse);
+
+    WebKitWebView* page = getViewFromFrame(m_frame);
+    WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data());
+
+    WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction);
+    if (m_policyDecision)
+        g_object_unref(m_policyDecision);
+    m_policyDecision = policyDecision;
+
+    gboolean isHandled = false;
+    g_signal_emit_by_name(page, "mime-type-policy-decision-requested", m_frame, request, mimeType.utf8().data(), policyDecision, &isHandled);
+
+    g_object_unref(request);
+
+    if (isHandled)
+        return;
+
+    if (canShowMIMEType(mimeType))
+        webkit_web_policy_decision_use (policyDecision);
+    else
+        webkit_web_policy_decision_download (policyDecision);
 }
 
-void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String&)
+void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>, const String& s)
 {
     ASSERT(policyFunction);
     if (!policyFunction)
         return;
     // FIXME: I think Qt version marshals this to another thread so when we
     // have multi-threaded download, we might need to do the same
-    (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+    (core(m_frame)->loader()->*policyFunction)(PolicyUse);
 }
 
 void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction policyFunction, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>)
@@ -269,17 +309,65 @@
     WebKitWebView* webView = getViewFromFrame(m_frame);
     WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data());
     WebKitNavigationResponse response;
-
+    /*
+     * We still support the deprecated navigation-requested signal, if the
+     * application doesn't ignore the navigation then the new signal is
+     * emitted.
+     * navigation-policy-decision-requested must be emitted after
+     * navigation-requested as the policy decision can be async.
+     */
     g_signal_emit_by_name(webView, "navigation-requested", m_frame, request, &response);
 
-    g_object_unref(request);
-
     if (response == WEBKIT_NAVIGATION_RESPONSE_IGNORE) {
         (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+        g_object_unref(request);
         return;
     }
 
-    (core(m_frame)->loader()->*policyFunction)(PolicyUse);
+    WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction);
+    if (m_policyDecision)
+        g_object_unref(m_policyDecision);
+    m_policyDecision = policyDecision;
+
+    gint button = -1;
+    gint modifierFlags = 0;
+
+    const Event* event = action.event();
+    if (event && event->isMouseEvent()) {
+        const MouseEvent* mouseEvent = static_cast<const MouseEvent*>(event);
+        // DOM button values are 0, 1 and 2 for left, middle and right buttons.
+        // GTK+ uses 1, 2 and 3, so let's add 1 to remain consistent.
+        button = mouseEvent->button() + 1;
+    }
+
+    UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(event));
+    if (keyStateEvent) {
+        if (keyStateEvent->shiftKey())
+            modifierFlags |= GDK_SHIFT_MASK;
+        if (keyStateEvent->ctrlKey())
+            modifierFlags |= GDK_CONTROL_MASK;
+        if (keyStateEvent->altKey())
+            modifierFlags |= GDK_MOD1_MASK;
+        if (keyStateEvent->metaKey())
+            modifierFlags |= GDK_MOD2_MASK;
+    }
+
+    GObject* navigationAction = G_OBJECT(g_object_new(WEBKIT_TYPE_WEB_NAVIGATION_ACTION,
+                                                     "reason", kit(action.type()),
+                                                      "original-uri", action.url().string().utf8().data(),
+                                                      "button", button,
+                                                      "modifier-state", modifierFlags,
+                                                      NULL));
+
+    gboolean isHandled = false;
+    g_signal_emit_by_name(webView, "navigation-policy-decision-requested", m_frame, request, navigationAction, policyDecision, &isHandled);
+
+    g_object_unref(navigationAction);
+    g_object_unref(request);
+
+    // FIXME Implement default behavior when we can query the backend what protocols it supports
+    if (!isHandled)
+        webkit_web_policy_decision_use(m_policyDecision);
 }
 
 Widget* FrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
@@ -298,14 +386,14 @@
     Frame* coreFrame = core(webFrame());
 
     ASSERT(core(getViewFromFrame(webFrame())) == coreFrame->page());
-    WebKitWebFrame* gtkFrame = WEBKIT_WEB_FRAME(webkit_web_frame_init_with_web_view(getViewFromFrame(webFrame()), ownerElement));
-    RefPtr<Frame> childFrame(adoptRef(core(gtkFrame)));
+
+    RefPtr<Frame> childFrame = webkit_web_frame_init_with_web_view(getViewFromFrame(webFrame()), ownerElement);
 
     coreFrame->tree()->appendChild(childFrame);
 
     childFrame->tree()->setName(name);
     childFrame->init();
-    childFrame->loader()->loadURL(url, referrer, String(), FrameLoadTypeRedirectWithLockedHistory, 0, 0);
+    childFrame->loader()->loadURL(url, referrer, String(), FrameLoadTypeRedirectWithLockedBackForwardList, 0, 0);
 
     // The frame's onload handler may have removed it from the document.
     if (!childFrame->tree()->parent())
@@ -459,11 +547,6 @@
     notImplemented();
 }
 
-void FrameLoaderClient::loadedFromCachedPage()
-{
-    notImplemented();
-}
-
 void FrameLoaderClient::dispatchDidHandleOnloadEvents()
 {
     notImplemented();
@@ -540,14 +623,22 @@
     notImplemented();
 }
 
-void FrameLoaderClient::dispatchShow()
+void FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
 {
     notImplemented();
 }
 
+void FrameLoaderClient::dispatchShow()
+{
+    WebKitWebView* webView = getViewFromFrame(m_frame);
+    webkit_web_view_notify_ready(webView);
+}
+
 void FrameLoaderClient::cancelPolicyCheck()
 {
-    notImplemented();
+    //FIXME Add support for more than one policy decision at once
+    if (m_policyDecision)
+        webkit_web_policy_decision_cancel(m_policyDecision);
 }
 
 void FrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader*)
@@ -576,10 +667,10 @@
     return true;
 }
 
-bool FrameLoaderClient::canShowMIMEType(const String&) const
+bool FrameLoaderClient::canShowMIMEType(const String& type) const
 {
-    notImplemented();
-    return true;
+    return MIMETypeRegistry::isSupportedImageMIMEType(type) || MIMETypeRegistry::isSupportedNonImageMIMEType(type) ||
+        PluginDatabase::installedPlugins()->isMIMETypeRegistered(type);
 }
 
 bool FrameLoaderClient::representationExistsForURLScheme(const String&) const
@@ -715,8 +806,16 @@
 
 Frame* FrameLoaderClient::dispatchCreatePage()
 {
-    notImplemented();
-    return 0;
+    WebKitWebView* webView = getViewFromFrame(m_frame);
+    WebKitWebView* newWebView = 0;
+
+    g_signal_emit_by_name(webView, "create-web-view", m_frame, &newWebView);
+
+    if (!newWebView)
+        return 0;
+
+    WebKitWebViewPrivate* privateData = WEBKIT_WEB_VIEW_GET_PRIVATE(newWebView);
+    return core(privateData->mainFrame);
 }
 
 void FrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&)
@@ -738,57 +837,42 @@
     notImplemented();
 }
 
-void FrameLoaderClient::updateGlobalHistory(const KURL&)
+void FrameLoaderClient::updateGlobalHistory()
 {
     notImplemented();
 }
 
-void FrameLoaderClient::savePlatformDataToCachedPage(CachedPage*)
+void FrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem()
+{
+    notImplemented();
+}
+
+void FrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*)
 {
 }
 
-void FrameLoaderClient::transitionToCommittedFromCachedPage(CachedPage*)
+void FrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*)
 {
 }
 
 void FrameLoaderClient::transitionToCommittedForNewPage()
 {
+    WebKitWebView* containingWindow = getViewFromFrame(m_frame);
+    IntSize size = IntSize(GTK_WIDGET(containingWindow)->allocation.width,
+                           GTK_WIDGET(containingWindow)->allocation.height);
+    bool transparent = webkit_web_view_get_transparent(containingWindow);
+    Color backgroundColor = transparent ? WebCore::Color::transparent : WebCore::Color::white;
     Frame* frame = core(m_frame);
     ASSERT(frame);
 
-    Page* page = frame->page();
-    ASSERT(page);
+    WebCore::FrameLoaderClient::transitionToCommittedForNewPage(frame, size, backgroundColor, transparent, IntSize(), false);
 
-    WebKitWebView* containingWindow = getViewFromFrame(m_frame);
-    bool isMainFrame = frame == page->mainFrame();
+    // We need to do further manipulation on the FrameView if it was the mainFrame
+    if (frame != frame->page()->mainFrame())
+        return;
 
-    if (isMainFrame && frame->view())
-        frame->view()->setParentVisible(false);
-
-    frame->setView(0);
-
-    FrameView* frameView;
-    if (isMainFrame) {
-        IntSize size = IntSize(GTK_WIDGET(containingWindow)->allocation.width,
-                               GTK_WIDGET(containingWindow)->allocation.height);
-        frameView = new FrameView(frame, size);
-        WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(containingWindow);
-        frameView->setGtkAdjustments(priv->horizontalAdjustment, priv->verticalAdjustment);
-    } else
-        frameView = new FrameView(frame);
-
-    frame->setView(frameView);
-    // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
-    frameView->deref();
-
-    if (isMainFrame)
-        frameView->setParentVisible(true);
-
-    if (frame->ownerRenderer())
-        frame->ownerRenderer()->setWidget(frameView);
-
-    if (HTMLFrameOwnerElement* owner = frame->ownerElement())
-        frame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
+    WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(containingWindow);
+    frame->view()->setGtkAdjustments(priv->horizontalAdjustment, priv->verticalAdjustment);
 }
 
 }
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
index 8f63b53..82286e8 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
@@ -33,6 +33,7 @@
 #include "FrameLoaderClient.h"
 #include "ResourceResponse.h"
 #include "PluginView.h"
+#include "webkitwebpolicydecision.h"
 
 typedef struct _WebKitWebFrame WebKitWebFrame;
 
@@ -41,7 +42,7 @@
     class FrameLoaderClient : public WebCore::FrameLoaderClient {
     public:
         FrameLoaderClient(WebKitWebFrame*);
-        virtual ~FrameLoaderClient() { }
+        virtual ~FrameLoaderClient();
         virtual void frameLoaderDestroyed();
 
         WebKitWebFrame*  webFrame() const { return m_frame; }
@@ -57,11 +58,10 @@
         virtual void detachedFromParent2();
         virtual void detachedFromParent3();
 
-        virtual void loadedFromCachedPage();
-
         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&);
@@ -85,6 +85,7 @@
         virtual void dispatchDidFinishDocumentLoad();
         virtual void dispatchDidFinishLoad();
         virtual void dispatchDidFirstLayout();
+        virtual void dispatchDidFirstVisuallyNonEmptyLayout();
 
         virtual WebCore::Frame* dispatchCreatePage();
         virtual void dispatchShow();
@@ -129,7 +130,8 @@
         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&);
@@ -160,8 +162,8 @@
 
         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 canCachePage() const;
@@ -170,6 +172,7 @@
         WebKitWebFrame* m_frame;
         WebCore::ResourceResponse m_response;
         WebCore::String m_userAgent;
+        WebKitWebPolicyDecision* m_policyDecision;
 
         // Plugin view to redirect data to
         WebCore::PluginView* m_pluginView;
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index 210995a..ba3721a 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -77,7 +77,7 @@
     // close-window and destroy signals still need to be
     // emitted.
     WebKitWebInspector* webInspector;
-    g_object_get(G_OBJECT(m_inspectedWebView), "web-inspector", &webInspector, NULL);
+    g_object_get(m_inspectedWebView, "web-inspector", &webInspector, NULL);
     m_webInspector = webInspector;
 
     g_signal_emit_by_name(m_webInspector, "inspect-web-view", m_inspectedWebView, &m_webView);
@@ -89,7 +89,7 @@
 
     webkit_web_inspector_set_web_view(m_webInspector, m_webView);
 
-    g_signal_connect(G_OBJECT(m_webView), "destroy",
+    g_signal_connect(m_webView, "destroy",
                      G_CALLBACK(notifyWebViewDestroyed), (gpointer)this);
 
     webkit_web_view_open(m_webView, "file://"DATA_DIR"/webkit-1.0/webinspector/inspector.html");
diff --git a/WebKit/gtk/webkit/webkit.h b/WebKit/gtk/webkit/webkit.h
index e19cbc7..8c868a2 100644
--- a/WebKit/gtk/webkit/webkit.h
+++ b/WebKit/gtk/webkit/webkit.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -26,9 +27,12 @@
 #include <webkit/webkitwebframe.h>
 #include <webkit/webkitwebsettings.h>
 #include <webkit/webkitwebinspector.h>
+#include <webkit/webkitwebwindowfeatures.h>
 #include <webkit/webkitwebview.h>
 #include <webkit/webkitwebbackforwardlist.h>
 #include <webkit/webkitwebhistoryitem.h>
+#include <webkit/webkitwebpolicydecision.h>
+#include <webkit/webkitwebnavigationaction.h>
 #include <webkit/webkitenumtypes.h>
 
 #endif /* __WEBKIT_H__ */
diff --git a/WebKit/gtk/webkit/webkitdefines.h b/WebKit/gtk/webkit/webkitdefines.h
index 0c080f4..f94e710 100644
--- a/WebKit/gtk/webkit/webkitdefines.h
+++ b/WebKit/gtk/webkit/webkitdefines.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -52,12 +53,18 @@
 typedef struct _WebKitWebFrame WebKitWebFrame;
 typedef struct _WebKitWebFrameClass WebKitWebFrameClass;
 
+typedef struct _WebKitWebPolicyDecision WebKitWebPolicyDecision;
+typedef struct _WebKitWebPolicyDecisionClass WebKitWebPolicyDecisionClass;
+
 typedef struct _WebKitWebSettings WebKitWebSettings;
 typedef struct _WebKitWebSettingsClass WebKitWebSettingsClass;
 
 typedef struct _WebKitWebInspector WebKitWebInspector;
 typedef struct _WebKitWebInspectorClass WebKitWebInspectorClass;
 
+typedef struct _WebKitWebWindowFeatures WebKitWebWindowFeatures;
+typedef struct _WebKitWebWindowFeaturesClass WebKitWebWindowFeaturesClass;
+
 typedef struct _WebKitWebView WebKitWebView;
 typedef struct _WebKitWebViewClass WebKitWebViewClass;
 
diff --git a/WebKit/gtk/webkit/webkitnetworkrequest.cpp b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
index fab0f88..3ad8b5d 100644
--- a/WebKit/gtk/webkit/webkitnetworkrequest.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007, 2008 Holger Hans Peter Freyther
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -21,6 +21,19 @@
 
 #include "webkitnetworkrequest.h"
 
+/**
+ * SECTION:webkitnetworkrequest
+ * @short_description: The target of a navigation request
+ * @see_also: #WebKitWebView::navigation-requested
+ *
+ * This class represents the network related aspects of a navigation
+ * request. Currently this is only the uri of the target. In the future
+ * the state of the web form might be added.
+ * Currently this object is only used along with the
+ * #WebKitWebView::navigation-requested signal.
+ *
+ */
+
 extern "C" {
 
 G_DEFINE_TYPE(WebKitNetworkRequest, webkit_network_request, G_TYPE_OBJECT);
@@ -77,6 +90,14 @@
     priv->uri = g_strdup(uri);
 }
 
+/**
+ * webkit_network_request_get_uri:
+ * @request: a #WebKitNetworkRequest
+ *
+ * Returns: the uri of the #WebKitNetworkRequest
+ *
+ * Since: 1.0.0
+ */
 G_CONST_RETURN gchar* webkit_network_request_get_uri(WebKitNetworkRequest* request)
 {
     g_return_val_if_fail(WEBKIT_IS_NETWORK_REQUEST(request), NULL);
diff --git a/WebKit/gtk/webkit/webkitnetworkrequest.h b/WebKit/gtk/webkit/webkitnetworkrequest.h
index dfb4d6c..01ab8bb 100644
--- a/WebKit/gtk/webkit/webkitnetworkrequest.h
+++ b/WebKit/gtk/webkit/webkitnetworkrequest.h
@@ -38,11 +38,18 @@
 struct _WebKitNetworkRequest {
     GObject parent_instance;
 
+    /*< private >*/
     WebKitNetworkRequestPrivate *priv;
 };
 
 struct _WebKitNetworkRequestClass {
     GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
 };
 
 WEBKIT_API GType
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
index 07c8174..e801981 100644
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ b/WebKit/gtk/webkit/webkitprivate.cpp
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -51,7 +52,7 @@
         return 0;
 
     WebKitWebFramePrivate* priv = frame->priv;
-    return priv ? priv->coreFrame.get() : 0;
+    return priv ? priv->coreFrame : 0;
 }
 
 WebKitWebFrame* kit(WebCore::Frame* coreFrame)
@@ -83,6 +84,16 @@
     return client ? client->webView() : 0;
 }
 
+WebKitWebNavigationReason kit(WebCore::NavigationType type)
+{
+    return (WebKitWebNavigationReason)type;
+}
+
+WebCore::NavigationType core(WebKitWebNavigationReason type)
+{
+    return (WebCore::NavigationType)type;
+}
+
 } /** end namespace WebKit */
 
 void webkit_init()
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index 3047af4..ace996d 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007, 2008 Holger Hans Peter Freyther
  * Copyright (C) 2008 Jan Michael C. Alonzo
+ * Copyright (C) 2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -29,7 +30,10 @@
 #include <webkit/webkitdefines.h>
 #include <webkit/webkitwebview.h>
 #include <webkit/webkitwebframe.h>
+#include <webkit/webkitwebpolicydecision.h>
+#include <webkit/webkitwebnavigationaction.h>
 #include <webkit/webkitwebsettings.h>
+#include <webkit/webkitwebwindowfeatures.h>
 #include <webkit/webkitwebbackforwardlist.h>
 
 #include "BackForwardList.h"
@@ -39,6 +43,7 @@
 #include "Frame.h"
 #include "InspectorClientGtk.h"
 #include "FrameLoaderClient.h"
+#include "WindowFeatures.h"
 
 #include <glib.h>
 
@@ -55,6 +60,9 @@
     WebKitWebHistoryItem* kit(WebCore::HistoryItem*);
 
     WebCore::BackForwardList* core(WebKitWebBackForwardList*);
+
+    WebKitWebNavigationReason kit(WebCore::NavigationType type);
+    WebCore::NavigationType core(WebKitWebNavigationReason reason);
 }
 
 extern "C" {
@@ -69,6 +77,7 @@
         WebCore::Page* corePage;
         WebKitWebSettings* webSettings;
         WebKitWebInspector* webInspector;
+        WebKitWebWindowFeatures* webWindowFeatures;
 
         WebKitWebFrame* mainFrame;
         WebCore::String applicationNameForUserAgent;
@@ -97,8 +106,7 @@
     #define WEBKIT_WEB_FRAME_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
     typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
     struct _WebKitWebFramePrivate {
-        WTF::RefPtr<WebCore::Frame> coreFrame;
-        WebCore::FrameLoaderClient* client;
+        WebCore::Frame* coreFrame;
         WebKitWebView* webView;
 
         gchar* name;
@@ -106,9 +114,12 @@
         gchar* uri;
     };
 
-    WebKitWebFrame*
+    PassRefPtr<WebCore::Frame>
     webkit_web_frame_init_with_web_view(WebKitWebView*, WebCore::HTMLFrameOwnerElement*);
 
+    void
+    webkit_web_frame_core_frame_gone(WebKitWebFrame*);
+
     WebKitWebHistoryItem*
     webkit_web_history_item_new_with_core_item(WebCore::HistoryItem*);
 
@@ -121,6 +132,18 @@
     void
     webkit_web_inspector_set_inspected_uri(WebKitWebInspector* web_inspector, const gchar* inspected_uri);
 
+    WebKitWebWindowFeatures*
+    webkit_web_window_features_new_from_core_features (const WebCore::WindowFeatures& features);
+
+    void
+    webkit_web_view_notify_ready (WebKitWebView* web_view);
+
+    WebKitWebPolicyDecision*
+    webkit_web_policy_decision_new (WebKitWebFrame*, WebCore::FramePolicyFunction);
+
+    void
+    webkit_web_policy_decision_cancel (WebKitWebPolicyDecision* decision);
+
     // FIXME: Move these to webkitwebframe.h once their API has been discussed.
 
     WEBKIT_API GSList*
@@ -135,8 +158,20 @@
     WEBKIT_API gchar*
     webkit_web_frame_dump_render_tree (WebKitWebFrame* frame);
 
+    WEBKIT_API bool
+    webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
+
+    WEBKIT_API bool
+    webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
+
+    WEBKIT_API unsigned int
+    webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
+
     WEBKIT_API gchar*
     webkit_web_view_get_selected_text (WebKitWebView* web_view);
+
+    WEBKIT_API void
+    webkit_web_settings_add_extra_plugin_directory (WebKitWebView *web_view, const gchar* directory);
 }
 
 #endif
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
index ff68dad..3899f4b 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
@@ -29,6 +29,26 @@
 #include "BackForwardList.h"
 #include "HistoryItem.h"
 
+/**
+ * SECTION:webkitwebbackforwardlist
+ * @short_description: The history of a #WebKitWebView
+ * @see_also: #WebKitWebView, #WebKitWebHistoryItem
+ *
+ * <informalexample><programlisting>
+ * /<!-- -->* Get the WebKitWebBackForwardList from the WebKitWebView *<!-- -->/
+ * WebKitWebBackForwardList *back_forward_list = webkit_web_view_get_back_forward_list (my_web_view);
+ * WebKitWebHistoryItem *item = webkit_web_back_forward_list_get_current_item (back_forward_list);
+ *
+ * /<!-- -->* Do something with a WebKitWebHistoryItem *<!-- -->/
+ * g_print("%p", item);
+ *
+ * /<!-- -->* Control some parameters *<!-- -->/
+ * WebKitWebBackForwardList *back_forward_list = webkit_web_view_get_back_forward_list (my_web_view);
+ * webkit_web_back_forward_list_set_limit (back_forward_list, 30);
+ * </programlisting></informalexample>
+ *
+ */
+
 using namespace WebKit;
 
 extern "C" {
@@ -53,7 +73,7 @@
 
 /**
  * webkit_web_back_forward_list_new_with_web_view:
- * @webView: the back forward list's #WebKitWebView
+ * @web_view: the back forward list's #WebKitWebView
  *
  * Creates an instance of the back forward list with a controlling #WebKitWebView
  *
@@ -76,7 +96,7 @@
 
 /**
  * webkit_web_back_forward_list_go_forward:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Steps forward in the back forward list
  */
@@ -91,7 +111,7 @@
 
 /**
  * webkit_web_back_forward_list_go_back:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Steps backward in the back forward list
  */
@@ -106,12 +126,12 @@
 
 /**
  * webkit_web_back_forward_list_contains_item:
- * @webBackForwardList: a #WebKitWebBackForwardList
- * @webHistoryItem: the #WebKitWebHistoryItem to check
+ * @web_back_forward_list: a #WebKitWebBackForwardList
+ * @history_item: the #WebKitWebHistoryItem to check
  *
- * Checks if @webHistoryItem is in the back forward list
+ * Checks if @web_history_item is in the back forward list
  *
- * Return: %TRUE if @webHistoryItem is in the back forward list, %FALSE if it doesn't
+ * Return: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't
  */
 gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* webBackForwardList, WebKitWebHistoryItem* webHistoryItem)
 {
@@ -129,10 +149,10 @@
 
 /**
  * webkit_web_back_forward_list_go_to_item:
- * @webBackForwardList: a #WebKitWebBackForwardList
- * @webHistoryItem: the #WebKitWebHistoryItem to go to
+ * @web_back_forward_list: a #WebKitWebBackForwardList
+ * @history_item: the #WebKitWebHistoryItem to go to
  *
- * Go to the specified @webHistoryItem in the back forward list
+ * Go to the specified @web_history_item in the back forward list
  */
 void webkit_web_back_forward_list_go_to_item(WebKitWebBackForwardList* webBackForwardList, WebKitWebHistoryItem* webHistoryItem)
 {
@@ -148,7 +168,7 @@
 
 /**
  * webkit_web_back_forward_list_get_forward_list_with_limit:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  * @limit: the number of items to retrieve
  *
  * Returns a list of items that succeed the current item, limited by @limit
@@ -178,7 +198,7 @@
 
 /**
  * webkit_web_back_forward_list_get_back_list_with_limit:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  * @limit: the number of items to retrieve
  *
  * Returns a list of items that precede the current item, limited by @limit
@@ -207,7 +227,7 @@
 }
 /**
  * webkit_web_back_forward_list_get_back_item:
- * @webBackForwardList: a #WebBackForwardList
+ * @web_back_forward_list: a #WebBackForwardList
  *
  * Returns the item that precedes the current item
  *
@@ -228,7 +248,7 @@
 
 /**
  * webkit_web_back_forward_list_get_current_item:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Returns the current item.
  *
@@ -251,7 +271,7 @@
 
 /**
  * webkit_web_back_forward_list_get_forward_item:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Returns the item that succeeds the current item.
  *
@@ -274,7 +294,7 @@
 
 /**
  * webkit_web_back_forward_list_get_nth_item:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  * @index: the index of the item
  *
  * Returns the item at a given index relative to the current item.
@@ -296,7 +316,7 @@
 
 /**
  * webkit_web_back_forward_list_get_back_length:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Returns the number of items that preced the current item.
  *
@@ -315,7 +335,7 @@
 
 /**
  * webkit_web_back_forward_list_get_forward_length:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Returns the number of items that succeed the current item.
  *
@@ -334,7 +354,7 @@
 
 /**
  * webkit_web_back_forward_list_get_limit:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Returns the maximum limit of the back forward list.
  *
@@ -353,7 +373,7 @@
 
 /**
  * webkit_web_back_forward_list_set_limit:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  * @limit: the limit to set the back forward list to
  *
  * Sets the maximum limit of the back forward list. If the back forward list
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.h b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
index 68e18eb..fb641f0 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.h
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
@@ -40,11 +40,18 @@
 struct _WebKitWebBackForwardList {
     GObject parent_instance;
 
+    /*< private >*/
     WebKitWebBackForwardListPrivate *priv;
 };
 
 struct _WebKitWebBackForwardListClass {
     GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
 };
 
 WEBKIT_API GType
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index 6a4c4d5..38e23a4 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -29,6 +29,7 @@
 #include "webkitmarshal.h"
 #include "webkitprivate.h"
 
+#include "AnimationController.h"
 #include "CString.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClientGtk.h"
@@ -45,6 +46,24 @@
 
 #include <JavaScriptCore/APICast.h>
 
+/**
+ * SECTION:webkitwebframe
+ * @short_description: The content of a #WebKitWebView
+ *
+ * A #WebKitWebView contains a main #WebKitWebFrame. A #WebKitWebFrame
+ * contains the content of one URI. The URI and name of the frame can
+ * be retrieved, the load status and progress can be observed using the
+ * signals and can be controlled using the methods of the #WebKitWebFrame.
+ * A #WebKitWebFrame can have any number of children and one child can
+ * be found by using #webkit_web_frame_find_frame.
+ *
+ * <informalexample><programlisting>
+ * /<!-- -->* Get the frame from the #WebKitWebView *<!-- -->/
+ * WebKitWebFrame *frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW(my_view));
+ * g_print("The URI of this frame is '%s'", webkit_web_frame_get_uri (frame));
+ * </programlisting></informalexample>
+ */
+
 using namespace WebKit;
 using namespace WebCore;
 using namespace std;
@@ -92,13 +111,24 @@
     }
 }
 
+// Called from the FrameLoaderClient when it is destroyed. Normally
+// the unref in the FrameLoaderClient is destroying this object as
+// well but due reference counting a user might have added a reference...
+void webkit_web_frame_core_frame_gone(WebKitWebFrame* frame)
+{
+    ASSERT(WEBKIT_IS_WEB_FRAME(frame));
+    frame->priv->coreFrame = 0;
+}
+
 static void webkit_web_frame_finalize(GObject* object)
 {
     WebKitWebFrame* frame = WEBKIT_WEB_FRAME(object);
     WebKitWebFramePrivate* priv = frame->priv;
 
-    priv->coreFrame->loader()->cancelAndClear();
-    priv->coreFrame = 0;
+    if (priv->coreFrame) {
+        priv->coreFrame->loader()->cancelAndClear();
+        priv->coreFrame = 0;
+    }
 
     g_free(priv->name);
     g_free(priv->title);
@@ -224,25 +254,26 @@
     WebKitWebViewPrivate* viewPriv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
 
     priv->webView = webView;
-    priv->client = new WebKit::FrameLoaderClient(frame);
-    priv->coreFrame = Frame::create(viewPriv->corePage, 0, priv->client).get();
+    WebKit::FrameLoaderClient* client = new WebKit::FrameLoaderClient(frame);
+    priv->coreFrame = Frame::create(viewPriv->corePage, 0, client).get();
     priv->coreFrame->init();
 
     return frame;
 }
 
-WebKitWebFrame* webkit_web_frame_init_with_web_view(WebKitWebView* webView, HTMLFrameOwnerElement* element)
+PassRefPtr<Frame> webkit_web_frame_init_with_web_view(WebKitWebView* webView, HTMLFrameOwnerElement* element)
 {
     WebKitWebFrame* frame = WEBKIT_WEB_FRAME(g_object_new(WEBKIT_TYPE_WEB_FRAME, NULL));
     WebKitWebFramePrivate* priv = frame->priv;
     WebKitWebViewPrivate* viewPriv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
 
     priv->webView = webView;
-    priv->client = new WebKit::FrameLoaderClient(frame);
-    priv->coreFrame = Frame::create(viewPriv->corePage, element, priv->client).releaseRef();
-    priv->coreFrame->init();
+    WebKit::FrameLoaderClient* client = new WebKit::FrameLoaderClient(frame);
 
-    return frame;
+    RefPtr<Frame> coreFrame = Frame::create(viewPriv->corePage, element, client);
+    priv->coreFrame = coreFrame.get();
+
+    return coreFrame.release();
 }
 
 /**
@@ -314,7 +345,8 @@
         return priv->name;
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return "";
 
     String string = coreFrame->tree()->name();
     priv->name = g_strdup(string.utf8().data());
@@ -334,7 +366,8 @@
     g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return NULL;
 
     return kit(coreFrame->tree()->parent());
 }
@@ -356,7 +389,8 @@
     g_return_if_fail(WEBKIT_IS_NETWORK_REQUEST(request));
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return;
 
     // TODO: Use the ResourceRequest carried by WebKitNetworkRequest when it is implemented.
     String string = String::fromUTF8(webkit_network_request_get_uri(request));
@@ -374,7 +408,8 @@
     g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return;
 
     coreFrame->loader()->stopAllLoaders();
 }
@@ -390,7 +425,8 @@
     g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return;
 
     coreFrame->loader()->reload();
 }
@@ -418,7 +454,8 @@
     g_return_val_if_fail(name, NULL);
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return NULL;
 
     String nameString = String::fromUTF8(name);
     return kit(coreFrame->tree()->find(AtomicString(nameString)));
@@ -438,7 +475,8 @@
     g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return NULL;
 
     return toGlobalRef(coreFrame->script()->globalObject()->globalExec());
 }
@@ -454,7 +492,8 @@
     g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return NULL;
 
     GSList* children = NULL;
     for (Frame* child = coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
@@ -478,7 +517,8 @@
     g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return g_strdup("");
 
     FrameView* view = coreFrame->view();
 
@@ -501,7 +541,8 @@
     g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return g_strdup("");
 
     FrameView* view = coreFrame->view();
 
@@ -555,14 +596,15 @@
         topLevel = NULL;
 
     Frame* coreFrame = core(frame);
-    ASSERT(coreFrame);
+    if (!coreFrame)
+        return;
 
     PrintContext printContext(coreFrame);
 
     GtkPrintOperation* op = gtk_print_operation_new();
-    g_signal_connect(G_OBJECT(op), "begin-print", G_CALLBACK(begin_print), &printContext);
-    g_signal_connect(G_OBJECT(op), "draw-page", G_CALLBACK(draw_page), &printContext);
-    g_signal_connect(G_OBJECT(op), "end-print", G_CALLBACK(end_print), &printContext);
+    g_signal_connect(op, "begin-print", G_CALLBACK(begin_print), &printContext);
+    g_signal_connect(op, "draw-page", G_CALLBACK(draw_page), &printContext);
+    g_signal_connect(op, "end-print", G_CALLBACK(end_print), &printContext);
     GError *error = NULL;
     gtk_print_operation_run(op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW(topLevel), &error);
     g_object_unref(op);
@@ -589,4 +631,35 @@
 
 #endif
 
+bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element)
+{
+    ASSERT(core(frame));
+    Element* coreElement = core(frame)->document()->getElementById(AtomicString(element));
+    if (!coreElement || !coreElement->renderer())
+        return false;
+    return core(frame)->animation()->pauseAnimationAtTime(coreElement->renderer(), AtomicString(name), time);
+}
+
+bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element)
+{
+    ASSERT(core(frame));
+    Element* coreElement = core(frame)->document()->getElementById(AtomicString(element));
+    if (!coreElement || !coreElement->renderer())
+        return false;
+    return core(frame)->animation()->pauseTransitionAtTime(coreElement->renderer(), AtomicString(name), time);
+}
+
+unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame)
+{
+    Frame* coreFrame = core(frame);
+    if (!coreFrame)
+        return 0;
+
+    AnimationController* controller = coreFrame->animation();
+    if (!controller)
+        return 0;
+
+    return controller->numberOfActiveAnimations();
+}
+
 }
diff --git a/WebKit/gtk/webkit/webkitwebframe.h b/WebKit/gtk/webkit/webkitwebframe.h
index 827e4b9..fcdace6 100644
--- a/WebKit/gtk/webkit/webkitwebframe.h
+++ b/WebKit/gtk/webkit/webkitwebframe.h
@@ -41,12 +41,14 @@
 struct _WebKitWebFrame {
     GObject parent_instance;
 
+    /*< private >*/
     WebKitWebFramePrivate *priv;
 };
 
 struct _WebKitWebFrameClass {
     GObjectClass parent_class;
 
+    /*< public >*/
     void (*_webkit_reserved1) (void);
     void (*_webkit_reserved2) (void);
     void (*_webkit_reserved3) (void);
diff --git a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
index 150df68..8cdaa90 100644
--- a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
+++ b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
@@ -29,6 +29,25 @@
 #include "HistoryItem.h"
 #include "PlatformString.h"
 
+/**
+ * SECTION:webkitwebhistoryitem
+ * @short_description: One item of the #WebKitWebBackForwardList and or global history
+ * @see_also: #WebKitWebBackForwardList
+ *
+ * A history item consists out of a title and a uri. It can be part of the
+ * #WebKitWebBackForwardList and the global history. The global history is used
+ * for coloring the links of visited sites.  #WebKitHistoryItem's constructed with
+ * #webkit_web_history_item_new and #webkit_web_history_item_new_with_data are
+ * automatically added to the global history.
+ *
+ * <informalexample><programlisting>
+ * /<!-- -->* Inject a visited page into the global history *<!-- -->/
+ * webkit_web_history_item_new_with_data("http://www.gnome.org/", "GNOME: The Free Software Desktop Project");
+ * webkit_web_history_item_new_with_data("http://www.webkit.org/", "The WebKit Open Source Project");
+ * </programlisting></informalexample>
+ *
+ */
+
 using namespace WebKit;
 
 extern "C" {
@@ -312,9 +331,9 @@
 
 /**
  * webkit_web_history_item_get_title:
- * @webHistoryItem: a #WebKitWebHistoryItem
+ * @web_history_item: a #WebKitWebHistoryItem
  *
- * Returns the page title of @webHistoryItem
+ * Returns: the page title of @web_history_item
  */
 G_CONST_RETURN gchar* webkit_web_history_item_get_title(WebKitWebHistoryItem* webHistoryItem)
 {
@@ -332,11 +351,11 @@
 
 /**
  * webkit_web_history_item_get_alternate_title:
- * @webHistoryItem: a #WebKitWebHistoryItem
+ * @web_history_item: a #WebKitWebHistoryItem
  *
- * Returns the alternate title of @webHistoryItem
+ * Returns the alternate title of @web_history_item
  *
- * Return value: the alternate title of @webHistoryItem
+ * Return value: the alternate title of @web_history_item
  */
 G_CONST_RETURN gchar* webkit_web_history_item_get_alternate_title(WebKitWebHistoryItem* webHistoryItem)
 {
@@ -354,10 +373,10 @@
 
 /**
  * webkit_web_history_item_set_alternate_title:
- * @webHistoryItem: a #WebKitWebHistoryItem
+ * @web_history_item: a #WebKitWebHistoryItem
  * @title: the alternate title for @this history item
  *
- * Sets an alternate title for @webHistoryItem
+ * Sets an alternate title for @web_history_item
  */
 void webkit_web_history_item_set_alternate_title(WebKitWebHistoryItem* webHistoryItem, const gchar* title)
 {
@@ -372,11 +391,11 @@
 
 /**
  * webkit_web_history_item_get_uri:
- * @webHistoryItem: a #WebKitWebHistoryItem
+ * @web_history_item: a #WebKitWebHistoryItem
  *
  * Returns the URI of @this
  *
- * Return value: the URI of @webHistoryItem
+ * Return value: the URI of @web_history_item
  */
 G_CONST_RETURN gchar* webkit_web_history_item_get_uri(WebKitWebHistoryItem* webHistoryItem)
 {
@@ -394,11 +413,11 @@
 
 /**
  * webkit_web_history_item_get_original_uri:
- * @webHistoryItem: a #WebKitWebHistoryItem
+ * @web_history_item: a #WebKitWebHistoryItem
  *
- * Returns the original URI of @webHistoryItem.
+ * Returns the original URI of @web_history_item.
  *
- * Return value: the original URI of @webHistoryITem
+ * Return value: the original URI of @web_history_item
  */
 G_CONST_RETURN gchar* webkit_web_history_item_get_original_uri(WebKitWebHistoryItem* webHistoryItem)
 {
@@ -416,11 +435,11 @@
 
 /**
  * webkit_web_history_item_get_last_visisted_time :
- * @webHistoryItem: a #WebKitWebHistoryItem
+ * @web_history_item: a #WebKitWebHistoryItem
  *
- * Returns the last time @webHistoryItem was visited
+ * Returns the last time @web_history_item was visited
  *
- * Return value: the time in seconds this @webHistoryItem was last visited
+ * Return value: the time in seconds this @web_history_item was last visited
  */
 gdouble webkit_web_history_item_get_last_visited_time(WebKitWebHistoryItem* webHistoryItem)
 {
diff --git a/WebKit/gtk/webkit/webkitwebhistoryitem.h b/WebKit/gtk/webkit/webkitwebhistoryitem.h
index dd63f9d..c8a754a 100644
--- a/WebKit/gtk/webkit/webkitwebhistoryitem.h
+++ b/WebKit/gtk/webkit/webkitwebhistoryitem.h
@@ -39,11 +39,18 @@
 struct _WebKitWebHistoryItem {
     GObject parent_instance;
 
+    /*< private >*/
     WebKitWebHistoryItemPrivate *priv;
 };
 
 struct _WebKitWebHistoryItemClass {
     GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
 };
 
 WEBKIT_API GType
diff --git a/WebKit/gtk/webkit/webkitwebinspector.cpp b/WebKit/gtk/webkit/webkitwebinspector.cpp
index 437fe2b..b8f8d9e 100644
--- a/WebKit/gtk/webkit/webkitwebinspector.cpp
+++ b/WebKit/gtk/webkit/webkitwebinspector.cpp
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2008 Gustavo Noronha Silva
+ * Copyright (C) 2008 Holger Hans Peter Freyther
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -24,6 +25,35 @@
 #include "InspectorClientGtk.h"
 #include "webkitprivate.h"
 
+/**
+ * SECTION:webkitwebinspector
+ * @short_description: Access to the WebKit Inspector
+ *
+ * The WebKit Inspector is a graphical tool to inspect and change
+ * the content of a #WebKitWebView. It also includes an interactive
+ * JavaScriptDebugger. Using this class one can get a GtkWidget which
+ * can be embedded into an application to show the inspector.
+ *
+ * The inspector is available when the #WebKitWebSettings of the
+ * #WebKitWebView has set the #WebKitWebSettings:enable-developer-extras
+ * to true otherwise no inspector is available.
+ *
+ * <informalexample><programlisting>
+ * /<!-- -->* Enable the developer extras *<!-- -->/
+ * WebKitWebSettings *setting = webkit_web_view_get_settings (WEBKIT_WEB_VIEW(my_webview));
+ * g_object_set (G_OBJECT(settings), "enable-developer-extras", TRUE, NULL);
+ *
+ * /<!-- -->* load some data or reload to be able to inspect the page*<!-- -->/
+ * webkit_web_view_open (WEBKIT_WEB_VIEW(my_webview), "http://www.gnome.org");
+ *
+ * /<!-- -->* Embed the inspector somewhere *<!-- -->/
+ * WebKitWebInspector *inspector = webkit_web_view_get_inspector (WEBKIT_WEB_VIEW(my_webview));
+ * g_signal_connect (G_OBJECT (inspector), "inspect-web-view", G_CALLBACK(create_gtk_window_around_it), NULL);
+ * g_signal_connect (G_OBJECT (inspector), "show-window", G_CALLBACK(show_inpector_window), NULL));
+ * g_signal_connect (G_OBJECT (inspector), "notify::inspected-uri", G_CALLBACK(inspected_uri_changed_do_stuff), NULL);
+ * </programlisting></informalexample>
+ */
+
 using namespace WebKit;
 
 extern "C" {
@@ -116,7 +146,7 @@
      *
      * Emitted when the inspector window should be displayed. Notice
      * that the window must have been created already by handling
-     * ::inspect-web-view.
+     * #WebKitWebInspector::inspect-web-view.
      *
      * Since: 1.0.3
      */
@@ -173,13 +203,13 @@
      *
      * Emitted when the inspector window should be closed. You can
      * destroy the window or hide it so that it can be displayed again
-     * by handling ::show-window later on.
+     * by handling #WebKitWebInspector::show-window later on.
      *
      * Notice that the inspected #WebKitWebView may no longer exist
      * when this signal is emitted.
      *
      * Notice, too, that if you decide to destroy the window,
-     * ::inspect-web-view will be emmited again, when the user
+     * #WebKitWebInspector::inspect-web-view will be emmited again, when the user
      * inspects an element.
      *
      * Since: 1.0.3
@@ -313,7 +343,7 @@
  *
  * Obtains the #WebKitWebView that is used to render the
  * inspector. The #WebKitWebView instance is created by the
- * application, by handling the ::inspect-web-view signal. This means
+ * application, by handling the #WebKitWebInspector::inspect-web-view signal. This means
  * that this method may return %NULL if the user hasn't inspected
  * anything.
  *
diff --git a/WebKit/gtk/webkit/webkitwebnavigationaction.cpp b/WebKit/gtk/webkit/webkitwebnavigationaction.cpp
new file mode 100644
index 0000000..48e36ac
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitwebnavigationaction.cpp
@@ -0,0 +1,312 @@
+/*
+ * Copyright (C) 2008 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include <wtf/Assertions.h>
+#include "FrameLoaderTypes.h"
+
+#include "webkitwebnavigationaction.h"
+#include "webkitprivate.h"
+#include "webkitenumtypes.h"
+
+#include <string.h>
+
+extern "C" {
+
+struct _WebKitWebNavigationActionPrivate {
+    WebKitWebNavigationReason reason;
+    gchar* originalUri;
+    gint button;
+    gint modifier_state;
+};
+
+#define WEBKIT_WEB_NAVIGATION_ACTION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionPrivate))
+
+enum  {
+    PROP_0,
+
+    PROP_REASON,
+    PROP_ORIGINAL_URI,
+    PROP_BUTTON,
+    PROP_MODIFIER_STATE
+};
+
+G_DEFINE_TYPE(WebKitWebNavigationAction, webkit_web_navigation_action, G_TYPE_OBJECT)
+
+
+static void webkit_web_navigation_action_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
+{
+    WebKitWebNavigationAction* navigationAction = WEBKIT_WEB_NAVIGATION_ACTION(object);
+
+    switch(propertyId) {
+    case PROP_REASON:
+        g_value_set_enum(value, webkit_web_navigation_action_get_reason(navigationAction));
+        break;
+    case PROP_ORIGINAL_URI:
+        g_value_set_string(value, webkit_web_navigation_action_get_original_uri(navigationAction));
+        break;
+    case PROP_BUTTON:
+        g_value_set_int(value, webkit_web_navigation_action_get_button(navigationAction));
+        break;
+    case PROP_MODIFIER_STATE:
+        g_value_set_int(value, webkit_web_navigation_action_get_modifier_state(navigationAction));
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
+        break;
+    }
+}
+
+static void webkit_web_navigation_action_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec)
+{
+    WebKitWebNavigationAction* navigationAction = WEBKIT_WEB_NAVIGATION_ACTION(object);
+    WebKitWebNavigationActionPrivate* priv = navigationAction->priv;
+
+    switch(propertyId) {
+    case PROP_REASON:
+        webkit_web_navigation_action_set_reason(navigationAction, (WebKitWebNavigationReason)g_value_get_enum(value));
+        break;
+    case PROP_ORIGINAL_URI:
+        webkit_web_navigation_action_set_original_uri(navigationAction, g_value_get_string(value));
+        break;
+    case PROP_BUTTON:
+        priv->button = g_value_get_int(value);
+        break;
+    case PROP_MODIFIER_STATE:
+        priv->modifier_state = g_value_get_int(value);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
+        break;
+    }
+}
+
+static void webkit_web_navigation_action_init(WebKitWebNavigationAction* navigationAction)
+{
+    navigationAction->priv = WEBKIT_WEB_NAVIGATION_ACTION_GET_PRIVATE(navigationAction);
+
+    WebKitWebNavigationActionPrivate* priv = navigationAction->priv;
+}
+
+static void webkit_web_navigation_action_finalize(GObject* obj)
+{
+    WebKitWebNavigationAction* navigationAction = WEBKIT_WEB_NAVIGATION_ACTION(obj);
+    WebKitWebNavigationActionPrivate* priv = navigationAction->priv;
+
+    g_free(priv->originalUri);
+
+    G_OBJECT_CLASS(webkit_web_navigation_action_parent_class)->finalize(obj);
+}
+
+static void webkit_web_navigation_action_class_init(WebKitWebNavigationActionClass* requestClass)
+{
+    GObjectClass* objectClass = G_OBJECT_CLASS(requestClass);
+
+    COMPILE_ASSERT(WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED == WebCore::NavigationTypeLinkClicked, navigation_type_link_clicked_enum_match);
+    COMPILE_ASSERT(WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED == WebCore::NavigationTypeFormSubmitted, navigation_type_form_submitted_enum_match);
+    COMPILE_ASSERT(WEBKIT_WEB_NAVIGATION_REASON_BACK_FORWARD == WebCore::NavigationTypeBackForward, navigation_type_back_forward_enum_match);
+    COMPILE_ASSERT(WEBKIT_WEB_NAVIGATION_REASON_RELOAD == WebCore::NavigationTypeReload, navigation_type_reload_enum_match);
+    COMPILE_ASSERT(WEBKIT_WEB_NAVIGATION_REASON_FORM_RESUBMITTED == WebCore::NavigationTypeFormResubmitted, navigation_type_form_resubmitted_enum_match);
+    COMPILE_ASSERT(WEBKIT_WEB_NAVIGATION_REASON_OTHER == WebCore::NavigationTypeOther, navigation_type_other_enum_match);
+
+    objectClass->get_property = webkit_web_navigation_action_get_property;
+    objectClass->set_property = webkit_web_navigation_action_set_property;
+    objectClass->dispose = webkit_web_navigation_action_finalize;
+
+    /**
+     * WebKitWebNavigationAction:reason:
+     *
+     * The reason why this navigation is occuring.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(objectClass, PROP_REASON,
+                                    g_param_spec_enum("reason",
+                                                      "Reason",
+                                                      "The reason why this navigation is occurring",
+                                                      WEBKIT_TYPE_WEB_NAVIGATION_REASON,
+                                                      WEBKIT_WEB_NAVIGATION_REASON_OTHER,
+                                                      (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT)));
+
+    /**
+     * WebKitWebNavigationAction:original-uri:
+     *
+     * The URI that was requested as the target for the navigation.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(objectClass, PROP_ORIGINAL_URI,
+                                    g_param_spec_string("original-uri",
+                                                        "Original URI",
+                                                        "The URI that was requested as the target for the navigation",
+                                                        "",
+                                                        (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT)));
+    /**
+     * WebKitWebNavigationAction:button:
+     *
+     * The button used to click if the action was a mouse event.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(objectClass, PROP_BUTTON,
+                                    g_param_spec_int("button",
+                                                     "Button",
+                                                     "The button used to click",
+                                                     -1,
+                                                     G_MAXINT,
+                                                     -1,
+                                                     (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
+
+    /**
+     * WebKitWebNavigationAction:modifier-state:
+     *
+     * The state of the modifier keys when the action was requested.
+     * 
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(objectClass, PROP_MODIFIER_STATE,
+                                    g_param_spec_int("modifier-state",
+                                                     "Modifier state",
+                                                     "A bitmask representing the state of the modifier keys",
+                                                     0,
+                                                     G_MAXINT,
+                                                     0,
+                                                     (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
+
+
+
+    g_type_class_add_private(requestClass, sizeof(WebKitWebNavigationActionPrivate));
+}
+
+/**
+ * webkit_web_navigation_action_get_reason:
+ * @navigationAction: a #WebKitWebNavigationAction
+ *
+ * Returns the reason why WebKit is requesting a navigation.
+ *
+ * Return value: a #WebKitWebNavigationReason
+ *
+ * Since: 1.0.3
+ */
+WebKitWebNavigationReason webkit_web_navigation_action_get_reason(WebKitWebNavigationAction* navigationAction)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction), WEBKIT_WEB_NAVIGATION_REASON_OTHER);
+
+    return navigationAction->priv->reason;
+}
+
+/**
+ * webkit_web_navigation_action_set_reason:
+ * @navigationAction: a #WebKitWebNavigationAction
+ * @reason: a #WebKitWebNavigationReason
+ *
+ * Sets the reason why WebKit is requesting a navigation.
+ *
+ * Since: 1.0.3
+ */
+void webkit_web_navigation_action_set_reason(WebKitWebNavigationAction* navigationAction, WebKitWebNavigationReason reason)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction));
+
+    if (navigationAction->priv->reason == reason)
+        return;
+
+    navigationAction->priv->reason = reason;
+    g_object_notify(G_OBJECT(navigationAction), "reason");
+}
+
+/**
+ * webkit_web_navigation_action_get_original_uri:
+ * @navigationAction: a #WebKitWebNavigationAction
+ *
+ * Returns the URI that was originally requested. This may differ from the
+ * navigation target, for instance because of a redirect.
+ *
+ * Return value: the originally requested URI
+ *
+ * Since: 1.0.3
+ */
+const gchar* webkit_web_navigation_action_get_original_uri(WebKitWebNavigationAction* navigationAction)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction), NULL);
+
+    return navigationAction->priv->originalUri;
+}
+
+/**
+ * webkit_web_navigation_action_set_original_uri:
+ * @navigationAction: a #WebKitWebNavigationAction
+ * @originalUri: a URI
+ *
+ * Sets the URI that was originally requested. This may differ from the
+ * navigation target, for instance because of a redirect.
+ *
+ * Since: 1.0.3
+ */
+void webkit_web_navigation_action_set_original_uri(WebKitWebNavigationAction* navigationAction, const gchar* originalUri)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction));
+    g_return_if_fail(originalUri);
+
+    if (navigationAction->priv->originalUri &&
+        (!strcmp(navigationAction->priv->originalUri, originalUri)))
+        return;
+
+    g_free(navigationAction->priv->originalUri);
+    navigationAction->priv->originalUri = g_strdup(originalUri);
+    g_object_notify(G_OBJECT(navigationAction), "original-uri");
+}
+
+/**
+ * webkit_web_navigation_action_get_button:
+ * @navigationAction: a #WebKitWebNavigationAction
+ *
+ * Returns the mouse button used to click if the action was a mouse event.
+ * Otherwise returns -1.
+ *
+ * Return value: the mouse button used to click
+ *
+ * Since: 1.0.3
+ */
+gint webkit_web_navigation_action_get_button(WebKitWebNavigationAction* navigationAction)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction), -1);
+
+    return navigationAction->priv->button;
+}
+
+/**
+ * webkit_web_navigation_action_get_modifier_state:
+ * @navigationAction: a #WebKitWebNavigationAction
+ *
+ * Returns a bitmask with the the state of the modifier keys.
+ *
+ * Return value: a bitmask with the state of the modifier keys
+ *
+ * Since: 1.0.3
+ */
+gint webkit_web_navigation_action_get_modifier_state(WebKitWebNavigationAction* navigationAction)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction), 0);
+
+    return navigationAction->priv->modifier_state;
+}
+    
+}
diff --git a/WebKit/gtk/webkit/webkitwebnavigationaction.h b/WebKit/gtk/webkit/webkitwebnavigationaction.h
new file mode 100644
index 0000000..d83e7a0
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitwebnavigationaction.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2008 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WEBKIT_WEB_NAVIGATION_ACTION_H
+#define WEBKIT_WEB_NAVIGATION_ACTION_H
+
+#include <glib-object.h>
+
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+/*
+ * The order of this enum must be the same as NavigationType in
+ * FrameLoaderTypes.h
+ */
+typedef enum {
+    WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED,
+    WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED,
+    WEBKIT_WEB_NAVIGATION_REASON_BACK_FORWARD,
+    WEBKIT_WEB_NAVIGATION_REASON_RELOAD,
+    WEBKIT_WEB_NAVIGATION_REASON_FORM_RESUBMITTED,
+    WEBKIT_WEB_NAVIGATION_REASON_OTHER,
+} WebKitWebNavigationReason;
+
+#define WEBKIT_TYPE_WEB_NAVIGATION_ACTION            (webkit_web_navigation_action_get_type())
+#define WEBKIT_WEB_NAVIGATION_ACTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationAction))
+#define WEBKIT_WEB_NAVIGATION_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionClass))
+#define WEBKIT_IS_WEB_NAVIGATION_ACTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION))
+#define WEBKIT_IS_WEB_NAVIGATION_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_NAVIGATION_ACTION))
+#define WEBKIT_WEB_NAVIGATION_ACTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionClass))
+
+typedef struct _WebKitWebNavigationAction WebKitWebNavigationAction;
+typedef struct _WebKitWebNavigationActionClass WebKitWebNavigationActionClass;
+typedef struct _WebKitWebNavigationActionPrivate WebKitWebNavigationActionPrivate;
+
+struct _WebKitWebNavigationAction {
+    GObject parent_instance;
+
+    /*< private >*/
+    WebKitWebNavigationActionPrivate* priv;
+};
+
+struct _WebKitWebNavigationActionClass {
+    GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+};
+
+WEBKIT_API GType
+webkit_web_navigation_action_get_type(void);
+
+WEBKIT_API WebKitWebNavigationReason
+webkit_web_navigation_action_get_reason(WebKitWebNavigationAction* navigationAction);
+
+WEBKIT_API void
+webkit_web_navigation_action_set_reason(WebKitWebNavigationAction* navigationAction, WebKitWebNavigationReason reason);
+
+WEBKIT_API const gchar*
+webkit_web_navigation_action_get_original_uri(WebKitWebNavigationAction* navigationAction);
+
+WEBKIT_API void
+webkit_web_navigation_action_set_original_uri(WebKitWebNavigationAction* navigationAction, const gchar* originalUri);
+
+WEBKIT_API gint
+webkit_web_navigation_action_get_button(WebKitWebNavigationAction* navigationAction);
+
+WEBKIT_API gint
+webkit_web_navigation_action_get_modifier_state(WebKitWebNavigationAction* navigationAction);
+
+G_END_DECLS
+
+#endif
diff --git a/WebKit/gtk/webkit/webkitwebpolicydecision.cpp b/WebKit/gtk/webkit/webkitwebpolicydecision.cpp
new file mode 100644
index 0000000..db4d10f
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitwebpolicydecision.cpp
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2008 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "webkitwebpolicydecision.h"
+
+#include "FrameLoaderTypes.h"
+#include "webkitprivate.h"
+
+using namespace WebKit;
+using namespace WebCore;
+
+extern "C" {
+
+G_DEFINE_TYPE(WebKitWebPolicyDecision, webkit_web_policy_decision, G_TYPE_OBJECT);
+
+struct _WebKitWebPolicyDecisionPrivate {
+    WebKitWebFrame* frame;
+    FramePolicyFunction framePolicyFunction;
+    gboolean isCancelled;
+};
+
+#define WEBKIT_WEB_POLICY_DECISION_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionPrivate))
+
+static void webkit_web_policy_decision_class_init(WebKitWebPolicyDecisionClass* decisionClass)
+{
+    g_type_class_add_private(decisionClass, sizeof(WebKitWebPolicyDecisionPrivate));
+}
+
+static void webkit_web_policy_decision_init(WebKitWebPolicyDecision* decision)
+{
+    decision->priv = WEBKIT_WEB_POLICY_DECISION_GET_PRIVATE(decision);
+}
+
+WebKitWebPolicyDecision* webkit_web_policy_decision_new(WebKitWebFrame* frame, WebCore::FramePolicyFunction function)
+{
+    g_return_val_if_fail(frame, NULL);
+
+    WebKitWebPolicyDecision* decision = WEBKIT_WEB_POLICY_DECISION(g_object_new(WEBKIT_TYPE_WEB_POLICY_DECISION, NULL));
+    WebKitWebPolicyDecisionPrivate* priv = decision->priv;
+
+    priv->frame = frame;
+    priv->framePolicyFunction = function;
+    priv->isCancelled = FALSE;
+
+    return decision;
+}
+
+/**
+ * webkit_web_policy_decision_use
+ * @decision: a #WebKitWebPolicyDecision
+ *
+ * Will send the USE decision to the policy implementer.
+ *
+ * Since: 1.0.3
+ */
+void webkit_web_policy_decision_use(WebKitWebPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision));
+
+    WebKitWebPolicyDecisionPrivate* priv = decision->priv;
+
+    if (!priv->isCancelled)
+        (core(priv->frame)->loader()->*(priv->framePolicyFunction))(WebCore::PolicyUse);
+}
+
+/**
+ * webkit_web_policy_decision_ignore
+ * @decision: a #WebKitWebPolicyDecision
+ *
+ * Will send the IGNORE decision to the policy implementer.
+ *
+ * Since: 1.0.3
+ */
+void webkit_web_policy_decision_ignore(WebKitWebPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision));
+
+    WebKitWebPolicyDecisionPrivate* priv = decision->priv;
+
+    if (!priv->isCancelled)
+        (core(priv->frame)->loader()->*(priv->framePolicyFunction))(WebCore::PolicyIgnore);
+}
+
+/**
+ * webkit_web_policy_decision_download
+ * @decision: a #WebKitWebPolicyDecision
+ *
+ * Will send the DOWNLOAD decision to the policy implementer.
+ *
+ * Since: 1.0.3
+ */
+void webkit_web_policy_decision_download(WebKitWebPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision));
+
+    WebKitWebPolicyDecisionPrivate* priv = decision->priv;
+
+    if (!priv->isCancelled)
+        (core(priv->frame)->loader()->*(priv->framePolicyFunction))(WebCore::PolicyDownload);
+}
+
+void webkit_web_policy_decision_cancel(WebKitWebPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision));
+
+    WebKitWebPolicyDecisionPrivate* priv = decision->priv;
+
+    priv->isCancelled = TRUE;
+}
+
+}
diff --git a/WebKit/gtk/webkit/webkitwebpolicydecision.h b/WebKit/gtk/webkit/webkitwebpolicydecision.h
new file mode 100644
index 0000000..f1ec963
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitwebpolicydecision.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2008 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WEBKIT_WEB_POLICY_DECISION_H
+#define WEBKIT_WEB_POLICY_DECISION_H
+
+#include <glib-object.h>
+#include <stdint.h>
+#include "webkitdefines.h"
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_WEB_POLICY_DECISION            (webkit_web_policy_decision_get_type())
+#define WEBKIT_WEB_POLICY_DECISION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecision))
+#define WEBKIT_WEB_POLICY_DECISION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionClass))
+#define WEBKIT_IS_WEB_POLICY_DECISION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_POLICY_DECISION))
+#define WEBKIT_IS_WEB_POLICY_DECISION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_WEB_POLICY_DECISION))
+#define WEBKIT_WEB_POLICY_DECISION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionClass))
+
+typedef struct _WebKitWebPolicyDecisionPrivate WebKitWebPolicyDecisionPrivate;
+struct _WebKitWebPolicyDecision {
+    GObject parent_instance;
+
+    /*< private >*/
+    WebKitWebPolicyDecisionPrivate* priv;
+};
+
+struct _WebKitWebPolicyDecisionClass {
+    GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+};
+
+WEBKIT_API GType
+webkit_web_policy_decision_get_type (void);
+
+WEBKIT_API void
+webkit_web_policy_decision_use (WebKitWebPolicyDecision* decision);
+
+WEBKIT_API void
+webkit_web_policy_decision_ignore (WebKitWebPolicyDecision* decision);
+
+WEBKIT_API void
+webkit_web_policy_decision_download (WebKitWebPolicyDecision* decision);
+
+G_END_DECLS
+
+#endif
diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
index 49ab4c6..aa38c6c 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -2,6 +2,7 @@
  * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
  * Copyright (C) 2008 Nuanti Ltd.
  * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2008 Holger Hans Peter Freyther
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -24,6 +25,29 @@
 #include "webkitwebsettings.h"
 #include "webkitprivate.h"
 
+#include "FileSystem.h"
+#include "PluginDatabase.h"
+
+/**
+ * SECTION:webkitwebsettings
+ * @short_description: Control the behaviour of a #WebKitWebView
+ *
+ * #WebKitWebSettings can be applied to a #WebKitWebView to control
+ * the to be used text encoding, color, font sizes, printing mode,
+ * script support, loading of images and various other things.
+ *
+ * <informalexample><programlisting>
+ * /<!-- -->* Create a new websettings and disable java script *<!-- -->/
+ * WebKitWebSettings *settings = webkit_web_settings_new ();
+ * g_object_set (G_OBJECT(settings), "enable-scripts", FALSE, NULL);
+ *
+ * /<!-- -->* Apply the result *<!-- -->/
+ * webkit_web_view_set_settings (WEBKIT_WEB_VIEW(my_webview), settings);
+ * </programlisting></informalexample>
+ */
+
+using namespace WebCore;
+
 extern "C" {
 
 G_DEFINE_TYPE(WebKitWebSettings, webkit_web_settings, G_TYPE_OBJECT)
@@ -40,6 +64,7 @@
     guint default_monospace_font_size;
     guint minimum_font_size;
     guint minimum_logical_font_size;
+    gboolean enforce_96_dpi;
     gboolean auto_load_images;
     gboolean auto_shrink_images;
     gboolean print_backgrounds;
@@ -67,6 +92,7 @@
     PROP_DEFAULT_MONOSPACE_FONT_SIZE,
     PROP_MINIMUM_FONT_SIZE,
     PROP_MINIMUM_LOGICAL_FONT_SIZE,
+    PROP_ENFORCE_96_DPI,
     PROP_AUTO_LOAD_IMAGES,
     PROP_AUTO_SHRINK_IMAGES,
     PROP_PRINT_BACKGROUNDS,
@@ -162,7 +188,7 @@
                                     "default-font-size",
                                     "Default Font Size",
                                     "The default font size used to display text.",
-                                    5, G_MAXINT, 10,
+                                    5, G_MAXINT, 12,
                                     flags));
 
     g_object_class_install_property(gobject_class,
@@ -192,6 +218,26 @@
                                     1, G_MAXINT, 5,
                                     flags));
 
+    /**
+    * WebKitWebSettings:enforce-96-dpi:
+    *
+    * Enforce a resolution of 96 DPI. This is meant for compatibility
+    * with web pages which cope badly with different screen resolutions
+    * and for automated testing.
+    * Web browsers and applications that typically display arbitrary
+    * content from the web should provide a preference for this.
+    *
+    * Since: 1.0.3
+    */
+    g_object_class_install_property(gobject_class,
+                                    PROP_ENFORCE_96_DPI,
+                                    g_param_spec_boolean(
+                                    "enforce-96-dpi",
+                                    "Enforce 96 DPI",
+                                    "Enforce a resolution of 96 DPI",
+                                    FALSE,
+                                    flags));
+
     g_object_class_install_property(gobject_class,
                                     PROP_AUTO_LOAD_IMAGES,
                                     g_param_spec_boolean(
@@ -360,6 +406,9 @@
     case PROP_MINIMUM_LOGICAL_FONT_SIZE:
         priv->minimum_logical_font_size = g_value_get_int(value);
         break;
+    case PROP_ENFORCE_96_DPI:
+        priv->enforce_96_dpi = g_value_get_boolean(value);
+        break;
     case PROP_AUTO_LOAD_IMAGES:
         priv->auto_load_images = g_value_get_boolean(value);
         break;
@@ -433,6 +482,9 @@
     case PROP_MINIMUM_LOGICAL_FONT_SIZE:
         g_value_set_int(value, priv->minimum_logical_font_size);
         break;
+    case PROP_ENFORCE_96_DPI:
+        g_value_set_boolean(value, priv->enforce_96_dpi);
+        break;
     case PROP_AUTO_LOAD_IMAGES:
         g_value_set_boolean(value, priv->auto_load_images);
         break;
@@ -516,4 +568,20 @@
     return copy;
 }
 
+/**
+ * webkit_web_settings_add_extra_plugin_directory:
+ * @web_view: a #WebKitWebView
+ * @directory: the directory to add
+ *
+ * Adds the @directory to paths where @web_view will search for plugins.
+ *
+ * Since: 1.0.3
+ */
+void webkit_web_settings_add_extra_plugin_directory(WebKitWebView* webView, const gchar* directory)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+
+    PluginDatabase::installedPlugins()->addExtraPluginDirectory(filenameToString(directory));
+}
+
 }
diff --git a/WebKit/gtk/webkit/webkitwebsettings.h b/WebKit/gtk/webkit/webkitwebsettings.h
index 33fa54a..5d25fee 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.h
+++ b/WebKit/gtk/webkit/webkitwebsettings.h
@@ -38,6 +38,7 @@
 struct _WebKitWebSettings {
     GObject parent_instance;
 
+    /*< private >*/
     WebKitWebSettingsPrivate *priv;
 };
 
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 2c90b4e..0ea6ed5 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -1,9 +1,10 @@
 /*
- *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *  Copyright (C) 2007, 2008 Holger Hans Peter Freyther
  *  Copyright (C) 2007, 2008 Christian Dywan <christian@imendio.com>
  *  Copyright (C) 2007 Xan Lopez <xan@gnome.org>
  *  Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
  *  Copyright (C) 2008 Jan Alonzo <jmalonzo@unpluggable.com>
+ *  Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org>
  *  Copyright (C) 2008 Nuanti Ltd.
  *  Copyright (C) 2008 Collabora Ltd.
  *
@@ -25,6 +26,7 @@
 #include "config.h"
 
 #include "webkitwebview.h"
+#include "webkitenumtypes.h"
 #include "webkitmarshal.h"
 #include "webkitprivate.h"
 #include "webkitwebinspector.h"
@@ -45,6 +47,7 @@
 #include "Editor.h"
 #include "EditorClientGtk.h"
 #include "EventHandler.h"
+#include "FloatQuad.h"
 #include "FocusController.h"
 #include "FrameLoaderTypes.h"
 #include "HitTestRequest.h"
@@ -57,12 +60,46 @@
 #include "PasteboardHelper.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformWheelEvent.h"
+#include "ScriptValue.h"
 #include "Scrollbar.h"
 #include "SubstituteData.h"
 #include <wtf/GOwnPtr.h>
 
 #include <gdk/gdkkeysyms.h>
 
+/**
+ * SECTION:webkitwebview
+ * @short_description: The central class of the WebKit/Gtk+ API
+ * @see_also: #WebKitWebSettings, #WebKitWebFrame
+ *
+ * #WebKitWebView is the central class of the WebKit/Gtk+ API. It is a
+ * #GtkWidget implementing the scrolling interface which means you can
+ * embed in a #GtkScrolledWindow. It is responsible for managing the
+ * drawing of the content, forwarding of events. You can load any URI
+ * into the #WebKitWebView or any kind of data string. With #WebKitWebSettings
+ * you can control various aspects of the rendering and loading of the content.
+ * Each #WebKitWebView has exactly one #WebKitWebFrame as main frame. A
+ * #WebKitWebFrame can have n children.
+ *
+ * <programlisting>
+ * /<!-- -->* Create the widgets *<!-- -->/
+ * GtkWidget *main_window = gtk_window_new (GTK_WIDGET_TOPLEVEL);
+ * GtkWidget *scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ * GtkWidget *web_view = webkit_web_view_new ();
+ *
+ * /<!-- -->* Place the WebKitWebView in the GtkScrolledWindow *<!-- -->/
+ * gtk_container_add (GTK_CONTAINER (scrolled_window), web_view);
+ * gtk_container_add (GTK_CONTAINER (main_window), scrolled_window);
+ *
+ * /<!-- -->* Open a webpage *<!-- -->/
+ * webkit_web_view_open (WEBKIT_WEB_VIEW (web_view), "http://www.gnome.org");
+ *
+ * /<!-- -->* Show the result *<!-- -->/
+ * gtk_window_set_default_size (GTK_WINDOW (main_window), 800, 600);
+ * gtk_widget_show_all (main_window);
+ * </programlisting>
+ */
+
 static const double defaultDPI = 96.0;
 
 using namespace WebKit;
@@ -73,6 +110,10 @@
 enum {
     /* normal signals */
     NAVIGATION_REQUESTED,
+    NAVIGATION_POLICY_DECISION_REQUESTED,
+    MIME_TYPE_POLICY_DECISION_REQUESTED,
+    CREATE_WEB_VIEW,
+    WEB_VIEW_READY,
     WINDOW_OBJECT_CLEARED,
     LOAD_STARTED,
     LOAD_COMMITTED,
@@ -103,6 +144,7 @@
     PROP_EDITABLE,
     PROP_SETTINGS,
     PROP_WEB_INSPECTOR,
+    PROP_WINDOW_FEATURES,
     PROP_TRANSPARENT,
     PROP_ZOOM_LEVEL,
     PROP_FULL_CONTENT_ZOOM
@@ -113,6 +155,7 @@
 G_DEFINE_TYPE(WebKitWebView, webkit_web_view, GTK_TYPE_CONTAINER)
 
 static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GParamSpec* pspec, WebKitWebView* webView);
+static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures);
 
 static void webkit_web_view_context_menu_position_func(GtkMenu*, gint* x, gint* y, gboolean* pushIn, WebKitWebViewPrivate* data)
 {
@@ -183,18 +226,23 @@
         if (!renderer)
             return FALSE;
 
-        // Calculate the rect of the first line of the selection (cribbed from -[WebCoreFrameBridge firstRectForDOMRange:]).
+        // Calculate the rect of the first line of the selection (cribbed from -[WebCoreFrameBridge firstRectForDOMRange:],
+        // now Frame::firstRectForRange(), which perhaps this should call).
         int extraWidthToEndOfLine = 0;
 
         InlineBox* startInlineBox;
         int startCaretOffset;
         start.getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset);
-        IntRect startCaretRect = renderer->caretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine);
+        IntRect startCaretRect = renderer->localCaretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine);
+        if (startCaretRect != IntRect())
+            startCaretRect = renderer->localToAbsoluteQuad(FloatRect(startCaretRect)).enclosingBoundingBox();
 
         InlineBox* endInlineBox;
         int endCaretOffset;
         end.getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset);
-        IntRect endCaretRect = renderer->caretRect(endInlineBox, endCaretOffset);
+        IntRect endCaretRect = renderer->localCaretRect(endInlineBox, endCaretOffset);
+        if (endCaretRect != IntRect())
+            endCaretRect = renderer->localToAbsoluteQuad(FloatRect(endCaretRect)).enclosingBoundingBox();
 
         IntRect firstRect;
         if (startCaretRect.y() == endCaretRect.y())
@@ -245,6 +293,9 @@
     case PROP_WEB_INSPECTOR:
         g_value_set_object(value, webkit_web_view_get_inspector(webView));
         break;
+    case PROP_WINDOW_FEATURES:
+        g_value_set_object(value, webkit_web_view_get_window_features(webView));
+        break;
     case PROP_TRANSPARENT:
         g_value_set_boolean(value, webkit_web_view_get_transparent(webView));
         break;
@@ -270,6 +321,9 @@
     case PROP_SETTINGS:
         webkit_web_view_set_settings(webView, WEBKIT_WEB_SETTINGS(g_value_get_object(value)));
         break;
+    case PROP_WINDOW_FEATURES:
+        webkit_web_view_set_window_features(webView, WEBKIT_WEB_WINDOW_FEATURES(g_value_get_object(value)));
+        break;
     case PROP_TRANSPARENT:
         webkit_web_view_set_transparent(webView, g_value_get_boolean(value));
         break;
@@ -548,6 +602,9 @@
 
 static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAdjustment* hadj, GtkAdjustment* vadj)
 {
+    if (!core(webView))
+        return;
+
     FrameView* view = core(webkit_web_view_get_main_frame(webView))->view();
 
     if (hadj)
@@ -604,15 +661,18 @@
         (*callback)(*current, callbackData);
 }
 
-static WebKitWebView* webkit_web_view_real_create_web_view(WebKitWebView*)
+static WebKitWebView* webkit_web_view_real_create_web_view(WebKitWebView*, WebKitWebFrame*)
 {
-    notImplemented();
     return 0;
 }
 
-static WebKitNavigationResponse webkit_web_view_real_navigation_requested(WebKitWebView*, WebKitWebFrame* frame, WebKitNetworkRequest*)
+static gboolean webkit_web_view_real_web_view_ready(WebKitWebView*)
 {
-    notImplemented();
+    return FALSE;
+}
+
+static WebKitNavigationResponse webkit_web_view_real_navigation_requested(WebKitWebView*, WebKitWebFrame*, WebKitNetworkRequest*)
+{
     return WEBKIT_NAVIGATION_RESPONSE_ACCEPT;
 }
 
@@ -751,48 +811,85 @@
     frame->editor()->command("Paste").execute();
 }
 
-static void webkit_web_view_finalize(GObject* object)
+static void webkit_web_view_dispose(GObject* object)
 {
     WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
     WebKitWebViewPrivate* priv = webView->priv;
 
-    webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(object));
+    if (priv->corePage) {
+        webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(object));
 
-    core(priv->mainFrame)->loader()->detachChildren();
-    delete priv->corePage;
+        core(priv->mainFrame)->loader()->detachChildren();
+        delete priv->corePage;
+        priv->corePage = NULL;
+    }
 
-    if (priv->horizontalAdjustment)
+    if (priv->horizontalAdjustment) {
         g_object_unref(priv->horizontalAdjustment);
-    if (priv->verticalAdjustment)
-        g_object_unref(priv->verticalAdjustment);
-    g_object_unref(priv->backForwardList);
-    g_signal_handlers_disconnect_by_func(priv->webSettings, (gpointer)webkit_web_view_settings_notify, webView);
-    g_object_unref(priv->webSettings);
-    g_object_unref(priv->webInspector);
-    g_object_unref(priv->mainFrame);
-    g_object_unref(priv->imContext);
-    gtk_target_list_unref(priv->copy_target_list);
-    gtk_target_list_unref(priv->paste_target_list);
-    delete priv->userAgent;
+        priv->horizontalAdjustment = NULL;
+    }
 
-    G_OBJECT_CLASS(webkit_web_view_parent_class)->finalize(object);
+    if (priv->verticalAdjustment) {
+        g_object_unref(priv->verticalAdjustment);
+        priv->verticalAdjustment = NULL;
+    }
+
+    if (priv->backForwardList) {
+        g_object_unref(priv->backForwardList);
+        priv->backForwardList = NULL;
+
+        g_signal_handlers_disconnect_by_func(priv->webSettings, (gpointer)webkit_web_view_settings_notify, webView);
+        g_object_unref(priv->webSettings);
+        priv->webSettings = NULL;
+
+        g_object_unref(priv->webInspector);
+        priv->webInspector = NULL;
+
+        g_object_unref(priv->webWindowFeatures);
+        priv->webWindowFeatures = NULL;
+
+        g_object_unref(priv->imContext);
+        priv->imContext = NULL;
+
+        gtk_target_list_unref(priv->copy_target_list);
+        priv->copy_target_list = NULL;
+
+        gtk_target_list_unref(priv->paste_target_list);
+        priv->paste_target_list = NULL;
+
+        delete priv->userAgent;
+        priv->userAgent = NULL;
+    }
+
+    G_OBJECT_CLASS(webkit_web_view_parent_class)->dispose(object);
+}
+
+static gboolean webkit_create_web_view_request_handled(GSignalInvocationHint* ihint, GValue* returnAccu, const GValue* handlerReturn, gpointer dummy)
+{
+    gpointer newWebView = g_value_get_object(handlerReturn);
+    g_value_set_object(returnAccu, newWebView);
+
+    // Continue if we don't have a newWebView
+    return !newWebView;
 }
 
 static gboolean webkit_navigation_request_handled(GSignalInvocationHint* ihint, GValue* returnAccu, const GValue* handlerReturn, gpointer dummy)
 {
-  gboolean continueEmission = TRUE;
-  int signalHandled = g_value_get_int(handlerReturn);
-  g_value_set_int(returnAccu, signalHandled);
+    WebKitNavigationResponse navigationResponse = (WebKitNavigationResponse)g_value_get_enum(handlerReturn);
+    g_value_set_enum(returnAccu, navigationResponse);
 
-  if (signalHandled != WEBKIT_NAVIGATION_RESPONSE_ACCEPT)
-      continueEmission = FALSE;
+    if (navigationResponse != WEBKIT_NAVIGATION_RESPONSE_ACCEPT)
+        return FALSE;
 
-  return continueEmission;
+    return TRUE;
 }
 
 static AtkObject* webkit_web_view_get_accessible(GtkWidget* widget)
 {
     WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
+    if (!core(webView))
+        return NULL;
+
     AXObjectCache::enableAccessibility();
 
     Frame* coreFrame = core(webView)->mainFrame();
@@ -820,16 +917,145 @@
      * Signals
      */
 
+    /**
+     * WebKitWebView::create-web-view:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the #WebKitWebFrame
+     * @return: a newly allocated #WebKitWebView or %NULL
+     *
+     * Emitted when the creation of a new window is requested.
+     * If this signal is handled the signal handler should return the
+     * newly created #WebKitWebView.
+     *
+     * The new #WebKitWebView should not be displayed to the user
+     * until the #WebKitWebView::web-view-ready signal is emitted.
+     *
+     * The signal handlers should not try to deal with the reference
+     * count for the new #WebKitWebView. The widget to which the
+     * widget is added will handle that.
+     *
+     * Since 1.0.3
+     */
+    webkit_web_view_signals[CREATE_WEB_VIEW] = g_signal_new("create-web-view",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            G_STRUCT_OFFSET (WebKitWebViewClass, create_web_view),
+            webkit_create_web_view_request_handled,
+            NULL,
+            webkit_marshal_OBJECT__OBJECT,
+            WEBKIT_TYPE_WEB_VIEW , 1,
+            WEBKIT_TYPE_WEB_FRAME);
+
+    /**
+     * WebKitWebView::web-view-ready:
+     * @web_view: the object on which the signal is emitted
+     * @return: %TRUE to stop other handlers from being invoked for
+     * the event, %FALSE to propagate the event further
+     *
+     * Emitted after #WebKitWebView::create-web-view when the new #WebKitWebView
+     * should be displayed to the user. When this signal is emitted
+     * all the information about how the window should look, including
+     * size, position, whether the location, status and scroll bars
+     * should be displayed, is already set on the
+     * #WebKitWebWindowFeatures object contained by the #WebKitWebView.
+     *
+     * Notice that some of that information may change during the life
+     * time of the window, so you may want to connect to the ::notify
+     * signal of the #WebKitWebWindowFeatures object to handle those.
+     *
+     * Since 1.0.3
+     */
+    webkit_web_view_signals[WEB_VIEW_READY] = g_signal_new("web-view-ready",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST),
+            G_STRUCT_OFFSET (WebKitWebViewClass, web_view_ready),
+            g_signal_accumulator_true_handled,
+            NULL,
+            webkit_marshal_BOOLEAN__VOID,
+            G_TYPE_BOOLEAN, 0);
+
+    /**
+     * WebKitWebView::navigation-requested:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the #WebKitWebFrame that required the navigation
+     * @request: a #WebKitNetworkRequest
+     * @return: a WebKitNavigationResponse
+     *
+     * Emitted when @frame requests a navigation to another page.
+     *
+     * Deprecated: Use WebKitWebView::navigation-policy-decision-requested
+     * instead
+     */
     webkit_web_view_signals[NAVIGATION_REQUESTED] = g_signal_new("navigation-requested",
             G_TYPE_FROM_CLASS(webViewClass),
             (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
             G_STRUCT_OFFSET (WebKitWebViewClass, navigation_requested),
             webkit_navigation_request_handled,
             NULL,
-            webkit_marshal_INT__OBJECT_OBJECT,
-            G_TYPE_INT, 2,
-            G_TYPE_OBJECT,
-            G_TYPE_OBJECT);
+            webkit_marshal_ENUM__OBJECT_OBJECT,
+            WEBKIT_TYPE_NAVIGATION_RESPONSE, 2,
+            WEBKIT_TYPE_WEB_FRAME,
+            WEBKIT_TYPE_NETWORK_REQUEST);
+
+    /**
+     * WebKitWebView::navigation-policy-decision-requested:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the #WebKitWebFrame that required the navigation
+     * @request: a #WebKitNetworkRequest
+     * @navigation_action: a #WebKitWebNavigation
+     * @policy_decision: a #WebKitWebPolicyDecision
+     * @return: TRUE if the signal will be handled, FALSE to have the
+     *          default behavior apply
+     *
+     * Emitted when @frame requests a navigation to another page.
+     * If this signal is not handled, the default behavior is to allow the
+     * navigation.
+     *
+     * Since: 1.0.3
+     */
+    webkit_web_view_signals[NAVIGATION_POLICY_DECISION_REQUESTED] = g_signal_new("navigation-policy-decision-requested",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            0,
+            g_signal_accumulator_true_handled,
+            NULL,
+            webkit_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT_OBJECT,
+            G_TYPE_BOOLEAN, 4,
+            WEBKIT_TYPE_WEB_FRAME,
+            WEBKIT_TYPE_NETWORK_REQUEST,
+            WEBKIT_TYPE_WEB_NAVIGATION_ACTION,
+            WEBKIT_TYPE_WEB_POLICY_DECISION);
+
+    /**
+     * WebKitWebView::mime-type-policy-decision-requested:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the #WebKitWebFrame that required the policy decision
+     * @request: a WebKitNetworkRequest
+     * @mimetype: the MIME type attempted to load
+     * @policy_decision: a #WebKitWebPolicyDecision
+     * @return: TRUE if the signal will be handled, FALSE to have the
+     *          default behavior apply
+     *
+     * Decide whether or not to display the given MIME type.  If this
+     * signal is not handled, the default behavior is to show the
+     * content of the requested URI if WebKit can show this MIME
+     * type; if WebKit is not able to show the MIME type nothing
+     * happens.
+     *
+     * Since: 1.0.3
+     */
+    webkit_web_view_signals[MIME_TYPE_POLICY_DECISION_REQUESTED] = g_signal_new("mime-type-policy-decision-requested",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            0,
+            g_signal_accumulator_true_handled,
+            NULL,
+            webkit_marshal_BOOLEAN__OBJECT_OBJECT_STRING_OBJECT,
+            G_TYPE_BOOLEAN, 4,
+            WEBKIT_TYPE_WEB_FRAME,
+            WEBKIT_TYPE_NETWORK_REQUEST,
+            G_TYPE_STRING,
+            WEBKIT_TYPE_WEB_POLICY_DECISION);
 
     /**
      * WebKitWebView::window-object-cleared:
@@ -1087,7 +1313,7 @@
      * WebKitWebView::select-all:
      * @web_view: the object which received the signal
      *
-     * The ::select-all signal is a keybinding signal which gets emitted to
+     * The #WebKitWebView::select-all signal is a keybinding signal which gets emitted to
      * select the complete contents of the text view.
      *
      * The default bindings for this signal is Ctrl-a.
@@ -1104,7 +1330,7 @@
      * WebKitWebView::cut-clipboard:
      * @web_view: the object which received the signal
      *
-     * The ::cut-clipboard signal is a keybinding signal which gets emitted to
+     * The #WebKitWebView::cut-clipboard signal is a keybinding signal which gets emitted to
      * cut the selection to the clipboard.
      *
      * The default bindings for this signal are Ctrl-x and Shift-Delete.
@@ -1121,7 +1347,7 @@
      * WebKitWebView::copy-clipboard:
      * @web_view: the object which received the signal
      *
-     * The ::copy-clipboard signal is a keybinding signal which gets emitted to
+     * The #WebKitWebView::copy-clipboard signal is a keybinding signal which gets emitted to
      * copy the selection to the clipboard.
      *
      * The default bindings for this signal are Ctrl-c and Ctrl-Insert.
@@ -1138,7 +1364,7 @@
      * WebKitWebView::paste-clipboard:
      * @web_view: the object which received the signal
      *
-     * The ::paste-clipboard signal is a keybinding signal which gets emitted to
+     * The #WebKitWebView::paste-clipboard signal is a keybinding signal which gets emitted to
      * paste the contents of the clipboard into the Web view.
      *
      * The default bindings for this signal are Ctrl-v and Shift-Insert.
@@ -1155,6 +1381,7 @@
      * implementations of virtual methods
      */
     webViewClass->create_web_view = webkit_web_view_real_create_web_view;
+    webViewClass->web_view_ready = webkit_web_view_real_web_view_ready;
     webViewClass->navigation_requested = webkit_web_view_real_navigation_requested;
     webViewClass->window_object_cleared = webkit_web_view_real_window_object_cleared;
     webViewClass->choose_file = webkit_web_view_real_choose_file;
@@ -1168,7 +1395,7 @@
     webViewClass->paste_clipboard = webkit_web_view_real_paste_clipboard;
 
     GObjectClass* objectClass = G_OBJECT_CLASS(webViewClass);
-    objectClass->finalize = webkit_web_view_finalize;
+    objectClass->dispose = webkit_web_view_dispose;
     objectClass->get_property = webkit_web_view_get_property;
     objectClass->set_property = webkit_web_view_set_property;
 
@@ -1285,6 +1512,20 @@
                                                         WEBKIT_TYPE_WEB_INSPECTOR,
                                                         WEBKIT_PARAM_READABLE));
 
+    /**
+    * WebKitWebView:window-features:
+    *
+    * An associated WebKitWebWindowFeatures instance.
+    *
+    * Since: 1.0.3
+    */
+    g_object_class_install_property(objectClass, PROP_WINDOW_FEATURES,
+                                    g_param_spec_object("window-features",
+                                                        "Window Features",
+                                                        "An associated WebKitWebWindowFeatures instance",
+                                                        WEBKIT_TYPE_WEB_WINDOW_FEATURES,
+                                                        WEBKIT_PARAM_READWRITE));
+
     g_object_class_install_property(objectClass, PROP_EDITABLE,
                                     g_param_spec_boolean("editable",
                                                          "Editable",
@@ -1332,20 +1573,14 @@
     g_type_class_add_private(webViewClass, sizeof(WebKitWebViewPrivate));
 }
 
-static void webkit_web_view_screen_changed(WebKitWebView* webView, GdkScreen* previousScreen, gpointer userdata)
+static gdouble webViewGetDPI(WebKitWebView* webView)
 {
     WebKitWebViewPrivate* priv = webView->priv;
     WebKitWebSettings* webSettings = priv->webSettings;
-    Settings* settings = core(webView)->settings();
-
-    guint defaultFontSize, defaultMonospaceFontSize, minimumFontSize, minimumLogicalFontSize;
-
-    g_object_get(G_OBJECT(webSettings),
-                 "default-font-size", &defaultFontSize,
-                 "default-monospace-font-size", &defaultMonospaceFontSize,
-                 "minimum-font-size", &minimumFontSize,
-                 "minimum-logical-font-size", &minimumLogicalFontSize,
-                 NULL);
+    gboolean enforce96DPI;
+    g_object_get(webSettings, "enforce-96-dpi", &enforce96DPI, NULL);
+    if (enforce96DPI)
+        return 96.0;
 
     gdouble DPI = defaultDPI;
 #if GTK_CHECK_VERSION(2,10,0)
@@ -1358,6 +1593,25 @@
     }
 #endif
     ASSERT(DPI > 0);
+    return DPI;
+}
+
+static void webkit_web_view_screen_changed(WebKitWebView* webView, GdkScreen* previousScreen, gpointer userdata)
+{
+    WebKitWebViewPrivate* priv = webView->priv;
+    WebKitWebSettings* webSettings = priv->webSettings;
+    Settings* settings = core(webView)->settings();
+    gdouble DPI = webViewGetDPI(webView);
+
+    guint defaultFontSize, defaultMonospaceFontSize, minimumFontSize, minimumLogicalFontSize;
+
+    g_object_get(webSettings,
+                 "default-font-size", &defaultFontSize,
+                 "default-monospace-font-size", &defaultMonospaceFontSize,
+                 "minimum-font-size", &minimumFontSize,
+                 "minimum-logical-font-size", &minimumLogicalFontSize,
+                 NULL);
+
     settings->setDefaultFontSize(defaultFontSize / 72.0 * DPI);
     settings->setDefaultFixedFontSize(defaultMonospaceFontSize / 72.0 * DPI);
     settings->setMinimumFontSize(minimumFontSize / 72.0 * DPI);
@@ -1373,7 +1627,7 @@
     gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri;
     gboolean autoLoadImages, autoShrinkImages, printBackgrounds, enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas;
 
-    g_object_get(G_OBJECT(webSettings),
+    g_object_get(webSettings,
                  "default-encoding", &defaultEncoding,
                  "cursive-font-family", &cursiveFontFamily,
                  "default-font-family", &defaultFontFamily,
@@ -1419,6 +1673,12 @@
     webkit_web_view_screen_changed(webView, NULL, NULL);
 }
 
+static inline gint pixelsFromSize(WebKitWebView* webView, gint size)
+{
+    gdouble DPI = webViewGetDPI(webView);
+    return size / 72.0 * DPI;
+}
+
 static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GParamSpec* pspec, WebKitWebView* webView)
 {
     Settings* settings = core(webView)->settings();
@@ -1443,13 +1703,15 @@
     else if (name == g_intern_string("serif-font-family"))
         settings->setSerifFontFamily(g_value_get_string(&value));
     else if (name == g_intern_string("default-font-size"))
-        settings->setDefaultFontSize(g_value_get_int(&value));
+        settings->setDefaultFontSize(pixelsFromSize(webView, g_value_get_int(&value)));
     else if (name == g_intern_string("default-monospace-font-size"))
-        settings->setDefaultFixedFontSize(g_value_get_int(&value));
+        settings->setDefaultFixedFontSize(pixelsFromSize(webView, g_value_get_int(&value)));
     else if (name == g_intern_string("minimum-font-size"))
-        settings->setMinimumFontSize(g_value_get_int(&value));
+        settings->setMinimumFontSize(pixelsFromSize(webView, g_value_get_int(&value)));
     else if (name == g_intern_string("minimum-logical-font-size"))
-        settings->setMinimumLogicalFontSize(g_value_get_int(&value));
+        settings->setMinimumLogicalFontSize(pixelsFromSize(webView, g_value_get_int(&value)));
+    else if (name == g_intern_string("enforce-96-dpi"))
+        webkit_web_view_screen_changed(webView, NULL, NULL);
     else if (name == g_intern_string("auto-load-images"))
         settings->setLoadsImagesAutomatically(g_value_get_boolean(&value));
     else if (name == g_intern_string("auto-shrink-images"))
@@ -1527,6 +1789,8 @@
     webkit_web_view_update_settings(webView);
     g_signal_connect(webView, "screen-changed", G_CALLBACK(webkit_web_view_screen_changed), NULL);
     g_signal_connect(priv->webSettings, "notify", G_CALLBACK(webkit_web_view_settings_notify), webView);
+
+    priv->webWindowFeatures = webkit_web_window_features_new();
 }
 
 GtkWidget* webkit_web_view_new(void)
@@ -1536,6 +1800,16 @@
     return GTK_WIDGET(webView);
 }
 
+// for internal use only
+void webkit_web_view_notify_ready(WebKitWebView* webView)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+
+    gboolean isHandled = FALSE;
+    g_signal_emit(webView, webkit_web_view_signals[WEB_VIEW_READY], 0, &isHandled);
+}
+
+
 void webkit_web_view_set_settings(WebKitWebView* webView, WebKitWebSettings* webSettings)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
@@ -1561,7 +1835,7 @@
 
 /**
  * webkit_web_view_get_inspector:
- * @webView: a #WebKitWebView
+ * @web_view: a #WebKitWebView
  *
  * Obtains the #WebKitWebInspector associated with the
  * #WebKitWebView. Every #WebKitWebView object has a
@@ -1583,9 +1857,41 @@
     return priv->webInspector;
 }
 
+// internal
+static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures)
+{
+    WebKitWebViewPrivate* priv = webView->priv;
+
+    if(webkit_web_window_features_equal(priv->webWindowFeatures, webWindowFeatures))
+      return;
+
+    g_object_unref(priv->webWindowFeatures);
+    g_object_ref(webWindowFeatures);
+    priv->webWindowFeatures = webWindowFeatures;
+}
+
+/**
+ * webkit_web_view_get_window_features
+ * @web_view: a #WebKitWebView
+ *
+ * Returns the instance of #WebKitWebWindowFeatures held by the given
+ * #WebKitWebView.
+ *
+ * Return value: the #WebKitWebWindowFeatures
+ *
+ * Since: 1.0.3
+ */
+WebKitWebWindowFeatures* webkit_web_view_get_window_features(WebKitWebView* webView)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
+
+    WebKitWebViewPrivate* priv = webView->priv;
+    return priv->webWindowFeatures;
+}
+
 /**
  * webkit_web_view_set_maintains_back_forward_list:
- * @webView: a #WebKitWebView
+ * @web_view: a #WebKitWebView
  * @flag: to tell the view to maintain a back or forward list
  *
  * Set the view to maintain a back or forward list of history items.
@@ -1599,7 +1905,7 @@
 
 /**
  * webkit_web_view_get_back_forward_list:
- * @webView: a #WebKitWebView
+ * @web_view: a #WebKitWebView
  *
  * Returns a #WebKitWebBackForwardList
  *
@@ -1619,7 +1925,7 @@
 
 /**
  * webkit_web_view_go_to_back_forward_item:
- * @webView: a #WebKitWebView
+ * @web_view: a #WebKitWebView
  * @item: a #WebKitWebHistoryItem*
  *
  * Go to the specified #WebKitWebHistoryItem
@@ -1758,6 +2064,21 @@
     core(webView)->mainFrame()->loader()->reload();
 }
 
+/**
+ * webkit_web_view_reload_bypass_cache:
+ * @web_view: a #WebKitWebView
+ *
+ * Reloads the @web_view without using any cached data.
+ *
+ * Since: 1.0.3
+ */
+void webkit_web_view_reload_bypass_cache(WebKitWebView* webView)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+
+    core(webView)->mainFrame()->loader()->reload(true);
+}
+
 void webkit_web_view_load_string(WebKitWebView* webView, const gchar* content, const gchar* contentMimeType, const gchar* contentEncoding, const gchar* baseUri)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
@@ -2148,6 +2469,29 @@
 }
 
 /**
+ * webkit_web_view_can_show_mime_type:
+ * @web_view: a #WebKitWebView
+ * @mime_type: a MIME type
+ *
+ * This functions returns whether or not a MIME type can be displayed using this view.
+ *
+ * Return value: a #gboolean indicating if the MIME type can be displayed
+ *
+ * Since: 1.0.3
+ **/
+
+gboolean webkit_web_view_can_show_mime_type(WebKitWebView* webView, const gchar* mimeType)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
+
+    Frame* frame = core(webkit_web_view_get_main_frame(webView));
+    if (FrameLoader* loader = frame->loader())
+        return loader->canShowMIMEType(String::fromUTF8(mimeType));
+    else
+        return FALSE;
+}
+
+/**
  * webkit_web_view_get_transparent:
  * @web_view: a #WebKitWebView
  *
diff --git a/WebKit/gtk/webkit/webkitwebview.h b/WebKit/gtk/webkit/webkitwebview.h
index 7371959..2bb8c61 100644
--- a/WebKit/gtk/webkit/webkitwebview.h
+++ b/WebKit/gtk/webkit/webkitwebview.h
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Holger Hans Peter Freyther
  * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -55,23 +56,22 @@
 struct _WebKitWebView {
     GtkContainer parent_instance;
 
+    /*< private >*/
     WebKitWebViewPrivate *priv;
 };
 
 struct _WebKitWebViewClass {
     GtkContainerClass parent_class;
 
+    /*< public >*/
     /*
      * default handler/virtual methods
-     * DISCUSS: create_web_view needs a request and should we make this a signal with default handler? this would
-     * require someone doing a g_signal_stop_emission_by_name
-     * WebUIDelegate has nothing for create_frame, WebPolicyDelegate as well...
      */
-    WebKitWebView            * (* create_web_view)        (WebKitWebView* web_view);
+    WebKitWebView            * (* create_web_view)        (WebKitWebView        *web_view,
+                                                           WebKitWebFrame       *web_frame);
 
-    /*
-     * TODO: FIXME: Create something like WebPolicyDecisionListener_Protocol instead
-     */
+    gboolean                   (* web_view_ready)          (WebKitWebView* web_view);
+
     WebKitNavigationResponse   (* navigation_requested)   (WebKitWebView        *web_view,
                                                            WebKitWebFrame       *frame,
                                                            WebKitNetworkRequest *request);
@@ -109,6 +109,15 @@
     void                       (* set_scroll_adjustments) (WebKitWebView        *web_view,
                                                            GtkAdjustment        *hadjustment,
                                                            GtkAdjustment        *vadjustment);
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+    void (*_webkit_reserved4) (void);
+    void (*_webkit_reserved5) (void);
+    void (*_webkit_reserved6) (void);
+    void (*_webkit_reserved7) (void);
 };
 
 WEBKIT_API GType
@@ -159,6 +168,9 @@
 webkit_web_view_reload                          (WebKitWebView        *web_view);
 
 WEBKIT_API void
+webkit_web_view_reload_bypass_cache             (WebKitWebView        *web_view);
+
+WEBKIT_API void
 webkit_web_view_load_string                     (WebKitWebView        *web_view,
                                                  const gchar          *content,
                                                  const gchar          *content_mime_type,
@@ -172,7 +184,7 @@
 
 WEBKIT_API gboolean
 webkit_web_view_search_text                     (WebKitWebView        *web_view,
-                                                 const gchar          *string,
+                                                 const gchar          *text,
                                                  gboolean              case_sensitive,
                                                  gboolean              forward,
                                                  gboolean              wrap);
@@ -250,6 +262,13 @@
 WEBKIT_API WebKitWebInspector *
 webkit_web_view_get_inspector                   (WebKitWebView        *web_view);
 
+WEBKIT_API WebKitWebWindowFeatures*
+webkit_web_view_get_window_features             (WebKitWebView        *web_view);
+
+WEBKIT_API gboolean
+webkit_web_view_can_show_mime_type              (WebKitWebView        *web_view,
+                                                 const gchar          *mime_type);
+
 WEBKIT_API gboolean
 webkit_web_view_get_transparent                 (WebKitWebView        *web_view);
 
diff --git a/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
new file mode 100644
index 0000000..7e61b59
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
@@ -0,0 +1,443 @@
+/*
+ * Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org>
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "WindowFeatures.h"
+#include "webkitwebwindowfeatures.h"
+#include "webkitprivate.h"
+
+/**
+ * SECTION:webkitwebwindowfeatures
+ * @short_description: Window properties of a #WebKitWebView
+ * @see_also: #WebKitWebView::web-view-ready
+ *
+ * The content of a #WebKitWebView can request to change certain
+ * properties of a #WebKitWebView. This can include the x, y position
+ * of the window, the width and height but also if a toolbar,
+ * scrollbar, statusbar, locationbar should be visible to the user,
+ * the request to show the #WebKitWebView fullscreen.
+ *
+ * In the normal case one will use #webkit_web_view_get_window_features
+ * to get the #WebKitWebWindowFeatures and then monitor the property
+ * changes. Be aware that the #WebKitWebWindowFeatures might change
+ * change before #WebKitWebView::web-view-ready signal is emitted.
+ * To be safe listen to the notify::window-features signal of the #WebKitWebView
+ * and reconnect the signals whenever the #WebKitWebWindowFeatures of
+ * a #WebKitWebView changes.
+ *
+ * <informalexample><programlisting>
+ * /<!-- -->* Get the current WebKitWebWindowFeatures *<!-- -->/
+ * WebKitWebWindowFeatures *features = webkit_web_view_get_window_features (my_webview);
+ *
+ * /<!-- -->* Connect to the property changes *<!-- -->/
+ * g_signal_connect (G_OBJECT(features), "notify::menubar-visible", G_CALLBACK(make_menu_bar_visible), NULL);
+ * g_signal_connect (G_OBJECT(features), "notify::statusbar-visible", G_CALLBACK(make_status_bar_visible), NULL);
+ *
+ * </programlisting></informalexample>
+ */
+
+extern "C" {
+
+enum {
+    PROP_0,
+
+    PROP_X,
+    PROP_Y,
+    PROP_WIDTH,
+    PROP_HEIGHT,
+    PROP_TOOLBAR_VISIBLE,
+    PROP_STATUSBAR_VISIBLE,
+    PROP_SCROLLBAR_VISIBLE,
+    PROP_MENUBAR_VISIBLE,
+    PROP_LOCATIONBAR_VISIBLE,
+    PROP_FULLSCREEN,
+};
+
+G_DEFINE_TYPE(WebKitWebWindowFeatures, webkit_web_window_features, G_TYPE_OBJECT)
+
+struct _WebKitWebWindowFeaturesPrivate {
+    gint x;
+    gint y;
+    gint width;
+    gint height;
+
+    gboolean toolbar_visible;
+    gboolean statusbar_visible;
+    gboolean scrollbar_visible;
+    gboolean menubar_visible;
+    gboolean locationbar_visible;
+
+    gboolean fullscreen;
+};
+
+#define WEBKIT_WEB_WINDOW_FEATURES_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_WINDOW_FEATURES, WebKitWebWindowFeaturesPrivate))
+
+static void webkit_web_window_features_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec);
+
+static void webkit_web_window_features_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec);
+
+static void webkit_web_window_features_class_init(WebKitWebWindowFeaturesClass* klass)
+{
+    GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
+    gobject_class->set_property = webkit_web_window_features_set_property;
+    gobject_class->get_property = webkit_web_window_features_get_property;
+
+    GParamFlags flags = (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+
+    /**
+     * WebKitWebWindowFeatures:x:
+     *
+     * The starting x position of the window on the screen.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_X,
+                                    g_param_spec_int(
+                                    "x",
+                                    "x",
+                                    "The starting x position of the window on the screen.",
+                                    -1,
+                                    G_MAXINT,
+                                    -1,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:y:
+     *
+     * The starting y position of the window on the screen.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_Y,
+                                    g_param_spec_int(
+                                    "y",
+                                    "y",
+                                    "The starting y position of the window on the screen.",
+                                    -1,
+                                    G_MAXINT,
+                                    -1,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:width:
+     *
+     * The width of the window on the screen.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_WIDTH,
+                                    g_param_spec_int(
+                                    "width",
+                                    "Width",
+                                    "The width of the window on the screen.",
+                                    -1,
+                                    G_MAXINT,
+                                    -1,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:height:
+     *
+     * The height of the window on the screen.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_HEIGHT,
+                                    g_param_spec_int(
+                                    "height",
+                                    "Height",
+                                    "The height of the window on the screen.",
+                                    -1,
+                                    G_MAXINT,
+                                    -1,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:toolbar-visible:
+     *
+     * Controls whether the toolbar should be visible for the window.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_TOOLBAR_VISIBLE,
+                                    g_param_spec_boolean(
+                                    "toolbar-visible",
+                                    "Toolbar Visible",
+                                    "Controls whether the toolbar should be visible for the window.",
+                                    TRUE,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:statusbar-visible:
+     *
+     * Controls whether the statusbar should be visible for the window.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_STATUSBAR_VISIBLE,
+                                    g_param_spec_boolean(
+                                    "statusbar-visible",
+                                    "Statusbar Visible",
+                                    "Controls whether the statusbar should be visible for the window.",
+                                    TRUE,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:scrollbar-visible:
+     *
+     * Controls whether the scrollbars should be visible for the window.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_SCROLLBAR_VISIBLE,
+                                    g_param_spec_boolean(
+                                    "scrollbar-visible",
+                                    "Scrollbar Visible",
+                                    "Controls whether the scrollbars should be visible for the window.",
+                                    TRUE,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:menubar-visible:
+     *
+     * Controls whether the menubar should be visible for the window.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_MENUBAR_VISIBLE,
+                                    g_param_spec_boolean(
+                                    "menubar-visible",
+                                    "Menubar Visible",
+                                    "Controls whether the menubar should be visible for the window.",
+                                    TRUE,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:locationbar-visible:
+     *
+     * Controls whether the locationbar should be visible for the window.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_LOCATIONBAR_VISIBLE,
+                                    g_param_spec_boolean(
+                                    "locationbar-visible",
+                                    "Locationbar Visible",
+                                    "Controls whether the locationbar should be visible for the window.",
+                                    TRUE,
+                                    flags));
+
+    /**
+     * WebKitWebWindowFeatures:fullscreen:
+     *
+     * Controls whether window will be displayed fullscreen.
+     *
+     * Since: 1.0.3
+     */
+    g_object_class_install_property(gobject_class,
+                                    PROP_FULLSCREEN,
+                                    g_param_spec_boolean(
+                                    "fullscreen",
+                                    "Fullscreen",
+                                    "Controls whether window will be displayed fullscreen.",
+                                    FALSE,
+                                    flags));
+
+
+    g_type_class_add_private(klass, sizeof(WebKitWebWindowFeaturesPrivate));
+}
+
+static void webkit_web_window_features_init(WebKitWebWindowFeatures* web_window_features)
+{
+    web_window_features->priv = WEBKIT_WEB_WINDOW_FEATURES_GET_PRIVATE(web_window_features);
+}
+
+static void webkit_web_window_features_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+    WebKitWebWindowFeatures* web_window_features = WEBKIT_WEB_WINDOW_FEATURES(object);
+    WebKitWebWindowFeaturesPrivate* priv = web_window_features->priv;
+
+    switch(prop_id) {
+    case PROP_X:
+        priv->x = g_value_get_int(value);
+        break;
+    case PROP_Y:
+        priv->y = g_value_get_int(value);
+        break;
+    case PROP_WIDTH:
+        priv->width = g_value_get_int(value);
+        break;
+    case PROP_HEIGHT:
+        priv->height = g_value_get_int(value);
+        break;
+    case PROP_TOOLBAR_VISIBLE:
+        priv->toolbar_visible = g_value_get_boolean(value);
+        break;
+    case PROP_STATUSBAR_VISIBLE:
+        priv->statusbar_visible = g_value_get_boolean(value);
+        break;
+    case PROP_SCROLLBAR_VISIBLE:
+        priv->scrollbar_visible = g_value_get_boolean(value);
+        break;
+    case PROP_MENUBAR_VISIBLE:
+        priv->menubar_visible = g_value_get_boolean(value);
+        break;
+    case PROP_LOCATIONBAR_VISIBLE:
+        priv->locationbar_visible = g_value_get_boolean(value);
+        break;
+    case PROP_FULLSCREEN:
+        priv->fullscreen = g_value_get_boolean(value);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+
+static void webkit_web_window_features_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+    WebKitWebWindowFeatures* web_window_features = WEBKIT_WEB_WINDOW_FEATURES(object);
+    WebKitWebWindowFeaturesPrivate* priv = web_window_features->priv;
+
+    switch (prop_id) {
+    case PROP_X:
+        g_value_set_int(value, priv->x);
+        break;
+    case PROP_Y:
+        g_value_set_int(value, priv->y);
+        break;
+    case PROP_WIDTH:
+        g_value_set_int(value, priv->width);
+        break;
+    case PROP_HEIGHT:
+        g_value_set_int(value, priv->height);
+        break;
+    case PROP_TOOLBAR_VISIBLE:
+        g_value_set_boolean(value, priv->toolbar_visible);
+        break;
+    case PROP_STATUSBAR_VISIBLE:
+        g_value_set_boolean(value, priv->statusbar_visible);
+        break;
+    case PROP_SCROLLBAR_VISIBLE:
+        g_value_set_boolean(value, priv->scrollbar_visible);
+        break;
+    case PROP_MENUBAR_VISIBLE:
+        g_value_set_boolean(value, priv->menubar_visible);
+        break;
+    case PROP_LOCATIONBAR_VISIBLE:
+        g_value_set_boolean(value, priv->locationbar_visible);
+        break;
+    case PROP_FULLSCREEN:
+        g_value_set_boolean(value, priv->fullscreen);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+
+/**
+ * webkit_web_window_features_new:
+ *
+ * Creates a new #WebKitWebWindowFeatures instance with default values. It must
+ * be manually attached to a WebView.
+ *
+ * Returns: a new #WebKitWebWindowFeatures instance
+ *
+ * Since 1.0.3
+ */
+WebKitWebWindowFeatures* webkit_web_window_features_new()
+{
+    return WEBKIT_WEB_WINDOW_FEATURES(g_object_new(WEBKIT_TYPE_WEB_WINDOW_FEATURES, NULL));
+}
+
+// for internal use only
+WebKitWebWindowFeatures* webkit_web_window_features_new_from_core_features(const WebCore::WindowFeatures& features)
+{
+    WebKitWebWindowFeatures *webWindowFeatures = webkit_web_window_features_new();
+
+    if(features.xSet)
+        g_object_set(webWindowFeatures, "x", static_cast<int>(features.x), NULL);
+
+    if(features.ySet)
+        g_object_set(webWindowFeatures, "y", static_cast<int>(features.y), NULL);
+
+    if(features.widthSet)
+        g_object_set(webWindowFeatures, "width", static_cast<int>(features.width), NULL);
+
+    if(features.heightSet)
+        g_object_set(webWindowFeatures, "height", static_cast<int>(features.height), NULL);
+
+    g_object_set(webWindowFeatures,
+                 "toolbar-visible", features.toolBarVisible,
+                 "statusbar-visible", features.statusBarVisible,
+                 "scrollbar-visible", features.scrollbarsVisible,
+                 "menubar-visible", features.menuBarVisible,
+                 "locationbar-visible", features.locationBarVisible,
+                 "fullscreen", features.fullscreen,
+                 NULL);
+
+    return webWindowFeatures;
+}
+
+/**
+ * webkit_web_window_features_equal:
+ * @features1: a #WebKitWebWindowFeatures instance
+ * @features2: another #WebKitWebWindowFeatures instance
+ *
+ * Decides if a #WebKitWebWindowFeatures instance equals another, as
+ * in has the same values.
+ *
+ * Returns: %TRUE if the instances have the same values, %FALSE
+ * otherwise
+ *
+ * Since 1.0.3
+ */
+gboolean webkit_web_window_features_equal(WebKitWebWindowFeatures* features1, WebKitWebWindowFeatures* features2)
+{
+    WebKitWebWindowFeaturesPrivate* priv1 = features1->priv;
+    WebKitWebWindowFeaturesPrivate* priv2 = features2->priv;
+
+    if((priv1->x == priv2->x) &&
+       (priv1->y == priv2->y) &&
+       (priv1->width == priv2->width) &&
+       (priv1->height == priv2->height) &&
+       (priv1->toolbar_visible == priv2->toolbar_visible) &&
+       (priv1->statusbar_visible == priv2->statusbar_visible) &&
+       (priv1->scrollbar_visible == priv2->scrollbar_visible) &&
+       (priv1->menubar_visible == priv2->menubar_visible) &&
+       (priv1->locationbar_visible == priv2->locationbar_visible) &&
+       (priv1->fullscreen == priv2->fullscreen))
+        return TRUE;
+    return FALSE;
+}
+
+
+}
diff --git a/WebKit/gtk/webkit/webkitwebwindowfeatures.h b/WebKit/gtk/webkit/webkitwebwindowfeatures.h
new file mode 100644
index 0000000..cd28988
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitwebwindowfeatures.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WEBKIT_WEB_WINDOW_FEATURES_H
+#define WEBKIT_WEB_WINDOW_FEATURES_H
+
+#include <glib-object.h>
+
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_WEB_WINDOW_FEATURES            (webkit_web_window_features_get_type())
+#define WEBKIT_WEB_WINDOW_FEATURES(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_WINDOW_FEATURES, WebKitWebWindowFeatures))
+#define WEBKIT_WEB_WINDOW_FEATURES_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_WEB_WINDOW_FEATURES, WebKitWebWindowFeaturesClass))
+#define WEBKIT_IS_WEB_WINDOW_FEATURES(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_WINDOW_FEATURES))
+#define WEBKIT_IS_WEB_WINDOW_FEATURES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_WEB_WINDOW_FEATURES))
+#define WEBKIT_WEB_WINDOW_FEATURES_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_WEB_WINDOW_FEATURES, WebKitWebWindowFeaturesClass))
+
+typedef struct _WebKitWebWindowFeaturesPrivate WebKitWebWindowFeaturesPrivate;
+
+struct _WebKitWebWindowFeatures {
+    GObject parent_instance;
+
+    /*< private >*/
+    WebKitWebWindowFeaturesPrivate* priv;
+};
+
+struct _WebKitWebWindowFeaturesClass {
+    GObjectClass parent_class;
+
+    /*< private >*/
+    /* Padding for future expansion */
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+    void (*_webkit_reserved4) (void);
+};
+
+WEBKIT_API GType
+webkit_web_window_features_get_type            (void);
+
+WEBKIT_API WebKitWebWindowFeatures*
+webkit_web_window_features_new                 (void);
+
+WEBKIT_API gboolean
+webkit_web_window_features_equal               (WebKitWebWindowFeatures* features1,
+                                                WebKitWebWindowFeatures* features2);
+
+G_END_DECLS
+
+#endif /* WEBKIT_WEB_WINDOW_FEATURES_H */
diff --git a/WebKit/libgen.h b/WebKit/libgen.h
deleted file mode 100644
index d693ed0..0000000
--- a/WebKit/libgen.h
+++ /dev/null
@@ -1 +0,0 @@
-char    *dirname(const char *);
diff --git a/WebKit/mac/Carbon/CarbonWindowAdapter.m b/WebKit/mac/Carbon/CarbonWindowAdapter.mm
similarity index 99%
rename from WebKit/mac/Carbon/CarbonWindowAdapter.m
rename to 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 @@
 	}
 }
 
-#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_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_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_ = 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 @@
 
 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 @@
 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 @@
 
 - (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 @@
 
 - (void)webView:(WebView *)webView       didParseSource:(NSString *)source
                                                 fromURL:(NSString *)url
-                                               sourceId:(int)sid
+                                               sourceId:(WebSourceId)sid
                                             forWebFrame:(WebFrame *)webFrame
 {
 }
@@ -53,7 +52,7 @@
 - (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 @@
 }
 
 - (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 @@
 
 @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 @@
     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 @@
 - (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 @@
 
 - (void)addVisitedLinksToPageGroup:(PageGroup&)group;
 
+- (WebHistoryItem *)lastVisitedEntry;
+- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry;
+
 @end
 
 @implementation WebHistoryPrivate
@@ -125,6 +127,7 @@
 {
     [_entriesByURL release];
     [_orderedLastVisitedDays release];
+    [_lastVisitedEntry release];
     delete _entriesByDate;
     [super dealloc];
 }
@@ -137,7 +140,7 @@
 
 #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 @@
     }
 }
 
-- (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 @@
 
     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 @@
 
     [self addItemToDateCaches:entry];
     [_entriesByURL setObject:entry forKey:URLString];
+    
+    return YES;
 }
 
 - (BOOL)removeItem:(WebHistoryItem *)entry
@@ -336,7 +373,7 @@
     // 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 @@
     return [self itemForURLString:[URL _web_originalDataAsString]];
 }
 
+- (NSArray *)allItems
+{
+    return [_entriesByURL allValues];
+}
+
 #pragma mark ARCHIVING/UNARCHIVING
 
 - (void)setHistoryAgeInDaysLimit:(int)limit
@@ -516,8 +558,8 @@
             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 @@
     }
 }
 
+- (WebHistoryItem *)lastVisitedEntry
+{
+    return _lastVisitedEntry;
+}
+
+- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry
+{
+    if (_lastVisitedEntry == lastVisitedEntry)
+        return;
+    [_lastVisitedEntry release];
+    _lastVisitedEntry = [lastVisitedEntry retain];
+}
+
 @end
 
 @implementation WebHistory
@@ -661,11 +716,9 @@
 
 - (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 @@
     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 @@
 }
 
 @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 @@
 
 @implementation WebHistoryItem
 
-#ifndef BUILDING_ON_TIGER
 + (void)initialize
 {
+    JSC::initializeThreading();
+#ifndef BUILDING_ON_TIGER
     WebCoreObjCFinalizeOnMainThread(self);
-}
 #endif
+}
 
 - (id)init
 {
@@ -329,14 +340,14 @@
 {
     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 @@
         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);
 
-    NSArray *childDicts = [dict objectForKey:WebChildrenKey];
+    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 *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 @@
     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 @@
 - (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:WebVisitCountKey];
+    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 (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 @@
 
 - (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 @@
     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 @@
 
 - (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 @@
 // 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 @@
 + (size_t)javaScriptObjectsCount
 {
     JSLock lock(false);
-    return JSDOMWindow::commonJSGlobalData()->heap.size();
+    return JSDOMWindow::commonJSGlobalData()->heap.objectCount();
 }
 
 + (size_t)javaScriptGlobalObjectsCount
@@ -122,17 +122,17 @@
 
 + (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 @@
     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 @@
 
 @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 @@
 }
 
 @interface WebIconDatabase (WebReallyInternal)
-- (BOOL)_isEnabled;
 - (void)_sendNotificationForURL:(NSString *)URL;
 - (void)_sendDidRemoveAllIconsNotification;
 - (NSImage *)_iconForFileURL:(NSString *)fileURL withSize:(NSSize)size;
@@ -109,37 +107,8 @@
     [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 @@
     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 @@
 
 - (NSString *)iconURLForURL:(NSString *)URL
 {
-    if (![self _isEnabled])
+    if (![self isEnabled])
         return nil;
     ASSERT_MAIN_THREAD();
 
@@ -197,7 +166,7 @@
 {
     ASSERT_MAIN_THREAD();
     ASSERT(URL);
-    if (![self _isEnabled])
+    if (![self isEnabled])
         return;
 
     iconDatabase()->retainIconForPageURL(URL);
@@ -207,7 +176,7 @@
 {
     ASSERT_MAIN_THREAD();
     ASSERT(pageURL);
-    if (![self _isEnabled])
+    if (![self isEnabled])
         return;
 
     iconDatabase()->releaseIconForPageURL(pageURL);
@@ -243,10 +212,27 @@
 
 @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 @@
 
 @implementation WebIconDatabase (WebInternal)
 
-- (BOOL)_isEnabled
-{
-    return iconDatabase()->isEnabled();
-}
-
 - (void)_sendNotificationForURL:(NSString *)URL
 {
     ASSERT(URL);
@@ -290,6 +271,50 @@
                                                       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 @@
 @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 @@
 @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 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 @@
 
 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 @@
     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 @@
 
 + (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, &region);
-    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 @@
     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 @@
 }
 
 #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 @@
 
 + (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 @@
     
 }
 
-CachedImage* imageFromElement(DOMElement *domElement) {
+static CachedImage* imageFromElement(DOMElement *domElement) {
     Element* element = core(domElement);
     if (!element)
         return 0;
@@ -259,18 +263,23 @@
 {
     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 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
new file mode 100644
index 0000000..207cdb3
--- /dev/null
+++ b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib
Binary files differ
diff --git a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib b/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib
deleted file mode 100644
index 59196ff..0000000
--- a/WebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib
+++ /dev/null
Binary files differ
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 @@
     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 @@
 typedef HashMap<NPStream*, NPP> StreamMap;
 static StreamMap& streams()
 {
-    static StreamMap staticStreams;
+    DEFINE_STATIC_LOCAL(StreamMap, staticStreams, ());
     return staticStreams;
 }
 
@@ -134,7 +135,7 @@
 {
     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 @@
         
     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 @@
 {
     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 @@
 {
     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 @@
         // 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;
     
+    int _mode;
+    
     BOOL _loadManually;
-    RefPtr<WebNetscapePluginStream> _manualStream;
-#ifndef BUILDING_ON_TIGER
-    CALayer *_layer;
-#endif
-    unsigned _dataLengthReceived;
-    NSError *_error;
+    BOOL _shouldFireTimers;
+    BOOL _isStarted;
+    BOOL _hasFocus;
+    BOOL _isCompletelyObscured;
     
-    int mode;
+    RetainPtr<DOMElement> _element;
+    RetainPtr<NSString> _MIMEType;
+    RetainPtr<NSURL> _baseURL;
+    RetainPtr<NSURL> _sourceURL;
     
-    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
-
-    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;
-    
-    NPPluginTextInputFuncs *textInputFuncs;
-    
-    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 @@
        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;
+- (void)stopTimers;
+- (void)startTimers;
+- (void)restartTimers;
 
-// Returns the NPObject that represents the plugin interface.
-// The return value is expected to be retained.
-- (NPObject *)createPluginScriptableObject;
+- (void)stop;
 
-// -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 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)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,1049 +30,175 @@
 
 #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/Document.h>
-#import <WebCore/DocumentLoader.h>
-#import <WebCore/Element.h>
-#import <WebCore/Frame.h> 
-#import <WebCore/FrameLoader.h> 
-#import <WebCore/FrameTree.h> 
-#import <WebCore/Page.h> 
-#import <WebCore/PluginMainThreadScheduler.h>
-#import <WebCore/ScriptController.h>
-#import <WebCore/SoftLinking.h> 
-#import <WebCore/WebCoreObjCExtras.h>
-#import <WebKit/nptextinput.h>
-#import <WebKit/DOMPrivate.h>
-#import <WebKit/WebUIDelegate.h>
-#import <wtf/Assertions.h>
-#import <objc/objc-runtime.h>
 
-using namespace WebCore;
+#import <WebCore/WebCoreObjCExtras.h>
+#import <WebCore/Document.h>
+#import <WebCore/Element.h>
+#import <WebCore/Frame.h>
+#import <WebCore/FrameLoader.h>
+#import <WebCore/Page.h>
+#import <WebKit/DOMPrivate.h>
+#import <runtime/InitializeThreading.h>
+#import <wtf/Assertions.h>
 
 #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
+- (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
 {
-    NSView *contentView = [[self window] contentView];
-    NSView *view;
-    for (view = self; view != nil; view = [view superview]) { 
-        if (view == contentView) {
-            return YES;
-        }
-    }
+    self = [super initWithFrame:frame];
+    if (!self)
+        return nil;
+    
+    _pluginPackage = pluginPackage;
+    _element = anElement;
+    _sourceURL.adoptNS([URL copy]);
+    _baseURL.adoptNS([baseURL copy]);
+    _MIMEType.adoptNS([MIME copy]);
+    
+    [self setAttributeKeys:keys andValues:values];
+    if (loadManually)
+        _mode = NP_FULL;
+    else
+        _mode = NP_EMBED;
+    
+    _loadManually = loadManually;
+    
+    return self;
+}
+
+- (void)dealloc
+{
+    ASSERT(!_isStarted);
+
+    [super dealloc];
+}
+
+- (void)finalize
+{
+    ASSERT_MAIN_THREAD();
+    ASSERT(!_isStarted);
+
+    [super finalize];
+}
+
+- (WebNetscapePluginPackage *)pluginPackage
+{
+    return _pluginPackage.get();
+}
+    
+- (BOOL)isFlipped
+{
+    return YES;
+}
+
+- (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.get()];
+    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;
+}
+
+// Methods that subclasses must override
+- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values
+{
+    ASSERT_NOT_REACHED();
+}
+
+- (void)handleMouseMoved:(NSEvent *)event
+{
+    ASSERT_NOT_REACHED();
+}
+
+- (void)focusChanged
+{
+    ASSERT_NOT_REACHED();
+}
+
+- (void)windowFocusChanged:(BOOL)hasFocus
+{
+    ASSERT_NOT_REACHED();
+}
+
+- (BOOL)createPlugin
+{
+    ASSERT_NOT_REACHED();
     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
+- (void)loadStream
 {
-#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)
+- (BOOL)shouldStop
 {
-    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));
-}
-
-- (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]);
-}
-
-- (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate
-{
-    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;
-}
-
-- (PortState)saveAndSetNewPortState
-{
-    return [self saveAndSetNewPortStateForUpdate:NO];
-}
-
-- (void)restorePortState:(PortState)portState
-{
-    if (drawingModel == NPDrawingModelCoreAnimation)
-        return;
-
-    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;
-
-        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);
-    
-    // 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) && !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;
-}
-
-- (void)sendActivateEvent:(BOOL)activate
-{
-    if (!isStarted)
-        return;
-
-    eventHandler->windowFocusChanged(activate);
-}
-
-- (void)sendDrawRectEvent:(NSRect)rect
-{
-    ASSERT(eventHandler);
-    
-    eventHandler->drawRect(rect);
-}
-
-- (void)stopTimers
-{
-    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();
-    }    
-}
-
-- (void)restartTimers
-{
-    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);
-    }    
-}
-
-- (BOOL)acceptsFirstResponder
-{
+    ASSERT_NOT_REACHED();
     return YES;
 }
 
-- (void)setHasFocus:(BOOL)flag
+- (void)destroyPlugin
 {
-    if (!isStarted)
-        return;
-
-    if (hasFocus == flag)
-        return;
-    
-    hasFocus = flag;
-    
-    // We need to null check the event handler here because
-    // the plug-in view can resign focus after it's been stopped
-    // and the event handler has been deleted.
-    if (eventHandler)
-        eventHandler->focusChanged(hasFocus);    
-}
-
-- (BOOL)becomeFirstResponder
-{
-    [self setHasFocus:YES];
-    return YES;
-}
-
-- (BOOL)resignFirstResponder
-{
-    [self setHasFocus:NO];    
-    return YES;
-}
-
-// 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
-{
-    [self mouseDown:theEvent];
-}
-
-- (void)rightMouseUp:(NSEvent *)theEvent
-{
-    [self mouseUp:theEvent];
-}
-
-- (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);
-}
-
-- (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]);
-}
-
-- (void)selectAll:(id)sender
-{
-    if (!isStarted)
-        return;
-
-    eventHandler->keyDown([NSApp currentEvent]);
-}
-
-#pragma mark WEB_NETSCAPE_PLUGIN
-
-- (BOOL)isNewWindowEqualToOldWindow
-{
-    ASSERT(drawingModel != NPDrawingModelCoreAnimation);
-        
-    if (window.x != lastSetWindow.x)
-        return NO;
-    if (window.y != lastSetWindow.y)
-        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;
+    ASSERT_NOT_REACHED();
 }
 
 - (void)updateAndSetWindow
 {
-    ASSERT(drawingModel != NPDrawingModelCoreAnimation);
-
-    // A plug-in can only update if it's (1) already been started (2) isn't stopped
-    // and (3) is able to draw on-screen. To meet condition (3) the plug-in must not
-    // be hidden and be attached to a window. QuickDraw plug-ins are an important
-    // 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])
-        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];
-}
-
-- (void)setWindowIfNecessary
-{
-    ASSERT(drawingModel != NPDrawingModelCoreAnimation);
-           
-    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;
-    }
+    ASSERT_NOT_REACHED();
 }
 
 - (void)removeTrackingRect
 {
-    if (trackingTag) {
-        [self removeTrackingRect:trackingTag];
-        trackingTag = 0;
-
+    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];
@@ -1082,48 +208,72 @@
 - (void)resetTrackingRect
 {
     [self removeTrackingRect];
-    if (isStarted) {
+    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];
+        _trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
     }
 }
 
-+ (void)setCurrentPluginView:(WebBaseNetscapePluginView *)view
+- (void)stopTimers
 {
-    currentPluginView = view;
+    _shouldFireTimers = NO;
 }
 
-+ (WebBaseNetscapePluginView *)currentPluginView
+- (void)startTimers
 {
-    return currentPluginView;
+    _shouldFireTimers = YES;
 }
 
-- (BOOL)canStart
+- (void)restartTimers
+{
+    ASSERT([self window]);
+    
+    [self stopTimers];
+    
+    if (!_isStarted || [[self window] isMiniaturized])
+        return;
+    
+    [self startTimers];
+}
+
+- (NSRect)visibleRect
+{
+    // WebCore may impose an additional clip (via CSS overflow or clip properties).  Fetch
+    // that clip now.    
+    return NSIntersectionRect([self convertRect:[_element.get() _windowClipRect] fromView:nil], [super visibleRect]);
+}
+
+- (BOOL)acceptsFirstResponder
 {
     return YES;
 }
 
-- (void)didStart
+- (void)sendActivateEvent:(BOOL)activate
 {
-    if (_loadManually) {
-        [self _redeliverStream];
+    if (!_isStarted)
         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];
-    } 
+    [self windowFocusChanged:activate];
+}
+
+- (void)setHasFocus:(BOOL)flag
+{
+    if (!_isStarted)
+        return;
+    
+    if (_hasFocus == flag)
+        return;
+    
+    _hasFocus = flag;
+    
+    [self focusChanged];
 }
 
 - (void)addWindowObservers
 {
     ASSERT([self window]);
-
+    
     NSWindow *theWindow = [self window];
     
     NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
@@ -1156,106 +306,42 @@
     [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;
+        return;
+   
+    Frame* frame = core([self webFrame]);
+    if (!frame)
+        return;
+    Page* page = frame->page();
+    if (!page)
+        return;
+    
+    bool wasDeferring = page->defersLoading();
+    if (!wasDeferring)
+        page->setDefersLoading(true);
 
-    // Open the plug-in package so it remains loaded while our plugin uses it
-    [pluginPackage open];
+    BOOL result = [self createPlugin];
     
-    // 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;
-    }
-    
-    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 (!wasDeferring)
+        page->setDefersLoading(false);
 
-    if (eventModel == (NPEventModel)-1) {
-        // If the plug-in did not specify a drawing model we default to Carbon when it is available.
-#ifndef NP_NO_CARBON
-        eventModel = NPEventModelCarbon;
-#else
-        eventModel = NPEventModelCocoa;
-#endif // NP_NO_CARBON
-    }
-
-#ifndef NP_NO_CARBON
-    if (eventModel == NPEventModelCocoa && isDrawingModelQuickDraw(drawingModel)) {
-        LOG(Plugins, "Plugin can't use use Cocoa event model with QuickDraw drawing model: %@", pluginPackage);
-        [self _destroyPlugin];
-        [pluginPackage close];
-        
-        return NO;
-    }        
-#endif // NP_NO_CARBON
+    if (!result)
+        return;
     
-#ifndef BUILDING_ON_TIGER
-    if (drawingModel == NPDrawingModelCoreAnimation) {
-        void *value = 0;
-        if (NPP_GetValue(plugin, NPPVpluginCoreAnimationLayer, &value) == NPERR_NO_ERROR && value) {
-            _layer = (CALayer *)value;
-            [self setWantsLayer:YES];
-            [self setLayer:_layer];
-            LOG(Plugins, "%@ is using Core Animation drawing model with layer %@", pluginPackage, _layer);
-        }
-
-        ASSERT(_layer);
-    }
-#endif
-    
-    // Create the event handler
-    eventHandler = WebNetscapePluginEventHandler::create(self);
-    
-    // Get the text input vtable
-    if (eventModel == NPEventModelCocoa) {
-        [self willCallPlugInFunction];
-        {
-            JSC::JSLock::DropAllLocks dropAllLocks(false);
-            NPPluginTextInputFuncs *value;
-            if (NPP_GetValue(plugin, NPPVpluginTextInputFuncs, &value) == NPERR_NO_ERROR && value)
-                textInputFuncs = value;
-        }
-        [self didCallPlugInFunction];
-    }
-    
-    isStarted = YES;
+    _isStarted = YES;
     [[self webView] addPluginInstanceView:self];
-
-    if (drawingModel == NPDrawingModelCoreGraphics || isDrawingModelQuickDraw(drawingModel))
-        [self updateAndSetWindow];
-
+    
+    [self updateAndSetWindow];
+    
     if ([self window]) {
         [self addWindowObservers];
         if ([[self window] isKeyWindow]) {
@@ -1263,353 +349,37 @@
         }
         [self restartTimers];
     }
-
+    
     [self resetTrackingRect];
     
-    [self didStart];
-    
-    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 @@
     
     // 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 @@
         } 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 @@
         // 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 @@
     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 @@
     [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 @@
 
 - (void)windowDidDeminiaturize:(NSNotification *)notification
 {
-    [self stopTimers];
+    [self restartTimers];
 }
 
 - (void)loginWindowDidSwitchFromUser:(NSNotification *)notification
@@ -1739,7 +506,7 @@
     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 @@
     }
 }
 
-- (NPObject *)createPluginScriptableObject
+- (void)renewGState
 {
-    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;
+    [super renewGState];
     
-    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--;
+    // -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.
     
-    // 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
-{
-    // 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);
-                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];
-    
-    [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;
-    }
-    
-    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 _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
-{
-    NSEvent *currentEvent = [NSApp currentEvent];
-    
-    // NPN_PopUpContextMenu must be called from within the plug-in's NPP_HandleEvent.
-    if (!currentEvent)
-        return NPERR_GENERIC_ERROR;
-    
-    [NSMenu popUpContextMenu:(NSMenu *)menu withEvent:currentEvent forView:self];
-    return NPERR_NO_ERROR;
-}
-
-@end
-
-@implementation WebPluginRequest
-
-- (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
-
-@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
-{
-    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;
-}
-
-- (void)_viewHasMoved
-{
     // 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 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)
+    BOOL oldIsObscured = _isCompletelyObscured;
+    _isCompletelyObscured = NSIsEmptyRect([self visibleRect]);
+    if (_isCompletelyObscured != oldIsObscured)
         [self restartTimers];
 }
 
-- (NSBitmapImageRep *)_printedPluginBitmap
+- (BOOL)becomeFirstResponder
 {
-#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 setHasFocus:YES];
+    return YES;
 }
 
-- (void)_redeliverStream
+- (BOOL)resignFirstResponder
 {
-    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 setHasFocus:NO];    
+    return YES;
+}
+
+- (WebDataSource *)dataSource
+{
+    WebFrame *webFrame = kit(core(_element.get())->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];
+}
+
+// We want to treat these as regular keyboard events.
+
+- (void)cut:(id)sender
+{
+    [self keyDown:[NSApp currentEvent]];
+}
+
+- (void)copy:(id)sender
+{
+    [self keyDown:[NSApp currentEvent]];
+}
+
+- (void)paste:(id)sender
+{
+    [self keyDown:[NSApp currentEvent]];
+}
+
+- (void)selectAll:(id)sender
+{
+    [self keyDown:[NSApp currentEvent]];
+}
+
+// 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
+{
+    [self mouseDown:theEvent];
+}
+
+- (void)rightMouseUp:(NSEvent *)theEvent
+{
+    [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
similarity index 99%
rename from WebKit/mac/Plugins/WebBasePluginPackage.m
rename to 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 @@
     
     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::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 @@
     
     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 @@
 - (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 @@
         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 @@
     return WebMachOExecutableType;
 }
 
+#if USE(PLUGIN_HOST_PROCESS)
+- (cpu_type_t)pluginHostArchitecture
+{
+    return pluginHostArchitecture;
+}
+#endif
+
 - (void)launchRealPlayer
 {
     CFURLRef appURL = NULL;
@@ -346,8 +364,8 @@
 #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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
     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 @@
         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 @@
             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
similarity index 69%
rename from WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h
rename to 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/WebPlugInStreamLoaderDelegate.h b/WebKit/mac/Plugins/WebPluginRequest.m
similarity index 60%
copy from WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h
copy to WebKit/mac/Plugins/WebPluginRequest.m
index c21fe4c..df36d40 100644
--- a/WebKit/mac/Plugins/WebPlugInStreamLoaderDelegate.h
+++ b/WebKit/mac/Plugins/WebPluginRequest.m
@@ -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,55 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-@class NSURLResponse;
-@class NSError;
-@class NSData;
+#if ENABLE(NETSCAPE_PLUGIN_API)
 
-@protocol WebPlugInStreamLoaderDelegate
+#import "WebPluginRequest.h"
 
-- (void)startStreamWithResponse:(NSURLResponse *)r;
+@implementation WebPluginRequest
 
-// destroyStreamWithError tells the plug-in that the load is completed (error == nil) or ended in error.
-- (void)destroyStreamWithError:(NSError *)error;
+- (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;
+}
 
-// cancelLoadAndDestoryStreamWithError calls cancelLoadWithError: then destroyStreamWithError:.
-- (void)cancelLoadAndDestroyStreamWithError:(NSError *)error;
+- (void)dealloc
+{
+    [_request release];
+    [_frameName release];
+    [super dealloc];
+}
 
-- (void)receivedData:(NSData *)data;
-- (void)finishedLoading;
+- (NSURLRequest *)request
+{
+    return _request;
+}
 
-- (BOOL)wantsAllStreams;
+- (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 @@
 // 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 @@
 
 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
similarity index 89%
rename from WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h
rename to 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 @@
     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 @@
 
     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 @@
         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 @@
     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 @@
 
 @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 @@
     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::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::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::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 @@
 
 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 @@
 
 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::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 @@
     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 @@
     virtual void dispatchDidFinishDocumentLoad();
     virtual void dispatchDidFinishLoad();
     virtual void dispatchDidFirstLayout();
+    virtual void dispatchDidFirstVisuallyNonEmptyLayout();
 
     virtual WebCore::Frame* dispatchCreatePage();
     virtual void dispatchShow();
@@ -136,7 +138,9 @@
 
     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 @@
 
     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 @@
     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 @@
 
 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::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 @@
         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 @@
         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 @@
     [dataSource(loader) _finishedLoading];
 }
 
-void WebFrameLoaderClient::updateGlobalHistory(const KURL& url)
+void WebFrameLoaderClient::updateGlobalHistory()
 {
-    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();
+
+    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()
+{
+    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 @@
 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::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 @@
     [[[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 @@
 
 #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 @@
             
 #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 @@
                 loadManually:loadManually
                 DOMElement:kit(element)] autorelease];
             
-            return new NetscapePluginWidget(embeddedView);
+            return new NetscapePluginWidget(pluginView);
         } 
 #endif
     } else
@@ -1390,8 +1510,8 @@
     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 @@
         } 
 #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 @@
 
 @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 @@
 }
 
 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 @@
     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 @@
     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 @@
 -[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 @@
 +[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 @@
 __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 @@
 -[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 @@
 -[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 @@
 +[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 @@
 -[WebPreferences minimumFontSize]
 -[WebPreferences minimumLogicalFontSize]
 -[WebPreferences arePlugInsEnabled]
+-[WebPreferences(WebPrivate) databasesEnabled]
+-[WebPreferences(WebPrivate) localStorageEnabled]
 -[WebPreferences sansSerifFontFamily]
 -[WebPreferences serifFontFamily]
 -[WebPreferences standardFontFamily]
@@ -198,26 +232,32 @@
 -[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 @@
 -[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 @@
 -[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 @@
 -[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 @@
 -[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 @@
 -[WebHTMLRepresentation init]
 -[WebDataSource(WebFileInternal) _setRepresentation:]
 -[WebHTMLRepresentation setDataSource:]
--[WebFrame(WebInternal) _bridge]
-__ZN20WebDocumentLoaderMac15detachFromFrameEv
-__ZN20WebDocumentLoaderMac17releaseDataSourceEv
-__ZN20WebFrameLoaderClient34updateGlobalHistoryForStandardLoadERKN7WebCore4KURLE
-+[WebHistory optionalSharedHistory]
--[WebHistory addItemForURL:]
--[WebHistoryItem(WebPrivate) initWithURL:title:]
--[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]
--[WebHistory _sendNotification:entries:]
 __Z26WKNotifyHistoryItemChangedv
--[WebDynamicScrollBarsView setScrollBarsSuppressed:repaintOnUnsuppress:]
--[WebDataSource dealloc]
--[WebDataSourcePrivate dealloc]
-__ZN20WebDocumentLoaderMac16detachDataSourceEv
+__ZN20WebFrameLoaderClient19updateGlobalHistoryEv
++[WebHistory optionalSharedHistory]
+-[WebHistory(WebInternal) _visitedURL:withTitle:method:wasFailure:]
+-[WebHistoryPrivate visitedURL:withTitle:]
+-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]
+-[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:]
+-[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 @@
 __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,510 +873,37 @@
 +[WebEditCommand commandWithEditCommand:]
 -[WebEditCommand initWithEditCommand:]
 __ZN15WebEditorClient24respondToChangedContentsEv
--[WebHTMLView keyUp:]
+__ZNK15WebChromeClient18scrollRectIntoViewERKN7WebCore7IntRectEPKNS0_10ScrollViewE
+-[WebHTMLRepresentation matchLabels:againstElement:]
+__Z4coreP10DOMElement
+-[WebHTMLRepresentation searchForLabels:beforeElement:]
+-[WebHTMLView keyDown:]
+__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEmPKS2_
+__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEm
+__ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE15reserveCapacityEm
+__Z32CallFormDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS2_S4_
 __ZN15WebEditorClient21checkSpellingOfStringEPKtiPiS2_
 __ZN15WebEditorClient23spellCheckerDocumentTagEv
 -[WebView(WebViewEditing) spellCheckerDocumentTag]
--[WebHTMLRepresentation matchLabels:againstElement:]
--[WebHTMLRepresentation searchForLabels:beforeElement:]
--[WebHTMLView(WebNSTextInputSupport) doCommandBySelector:]
--[WebDefaultEditingDelegate webView:doCommandBySelector:]
-__ZN15WebEditorClient17shouldDeleteRangeEPN7WebCore5RangeE
--[WebDefaultEditingDelegate webView:shouldDeleteDOMRange:]
-__ZN15WebEditorClient28textWillBeDeletedInTextFieldEPN7WebCore7ElementE
-__Z32CallFormDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS2_S4_
--[WebHistoryItem title]
-+[WebHTMLView(WebPrivate) _postFlagsChangedEvent:]
--[WebHTMLView flagsChanged:]
--[WebHistory saveToURL:error:]
--[WebHistoryPrivate saveToURL:error:]
--[WebHistoryPrivate _saveHistoryGuts:URL:error:]
--[WebHistoryPrivate arrayRepresentation]
-__ZN3WTF6VectorIiLm0EE15reserveCapacityEm
-__ZSt16__introsort_loopIPiiEvT_S1_T0_
-__ZSt22__final_insertion_sortIPiEvT_S1_
-__ZSt16__insertion_sortIPiEvT_S1_
--[WebHistoryItem(WebPrivate) dictionaryRepresentation]
-__ZN3WTF6VectorIiLm0EE6shrinkEm
-_WKSetPatternPhaseInUserSpace
--[WebElementDictionary _domNode]
-__Z3kitPN7WebCore4NodeE
+-[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:]
-__ZN20WebFrameLoaderClient33dispatchWillPerformClientRedirectERKN7WebCore4KURLEdd
-__Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_dS0_S0_
-__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_dS0_S0_
-__ZN20WebFrameLoaderClient31dispatchDidCancelClientRedirectEv
-+[WebStringTruncator centerTruncateString:toWidth:]
-__Z15defaultMenuFontv
--[WebViewFactory pluginSupportsMIMEType:]
--[WebHTMLView(WebPrivate) addTrackingRect:owner:userData:assumeInside:]
--[WebHTMLView(WebPrivate) _sendToolTipMouseEntered]
--[WebHTMLView(WebPrivate) _sendToolTipMouseExited]
--[WebHTMLView(WebPrivate) removeTrackingRect:]
--[WebHTMLView mouseDragged:]
--[WebViewFactory bridgeForView:]
--[WebBaseNetscapePluginView createPluginScriptableObject]
--[WebBaseNetscapePluginView isStarted]
-_NPN_MemFree
--[WebBaseNetscapePluginView mouseEntered:]
--[WebBaseNetscapePluginView getCarbonEvent:withEvent:]
-_WKConvertNSEventToCarbonEvent
--[WebBaseNetscapePluginView modifiersForEvent:]
-_NPN_GetURLNotify
--[WebBaseNetscapePluginView(WebNPPCallbacks) getURLNotify:target:notifyData:]
--[WebBaseNetscapePluginView(WebNPPCallbacks) requestWithURLCString:]
--[NSString(WebKitExtras) _web_stringByStrippingReturnCharacters]
--[WebBaseNetscapePluginView mouseExited:]
--[WebHTMLView scrollWheel:]
-_WKGetWheelEventDeltas
--[WebClipView scrollWheel:]
--[WebDynamicScrollBarsView scrollWheel:]
--[WebDynamicScrollBarsView allowsVerticalScrolling]
--[WebHTMLView performKeyEquivalent:]
--[WebHTMLView _handleStyleKeyEquivalent:]
--[WebPreferences(WebPrivate) respectStandardStyleKeyEquivalents]
--[WebBaseNetscapePluginView acceptsFirstResponder]
--[WebFrameBridge makeFirstResponder:]
--[WebView(WebPrivate) _pushPerformingProgrammaticFocus]
--[WebBaseNetscapePluginView becomeFirstResponder]
--[WebBaseNetscapePluginView installKeyEventHandler]
--[WebView(WebPrivate) _popPerformingProgrammaticFocus]
--[WebBaseNetscapePluginView mouseDown:]
--[WebBaseNetscapePluginView mouseUp:]
--[WebBaseNetscapePluginView mouseDragged:]
--[WebBaseNetscapePluginView resignFirstResponder]
--[WebHTMLView(WebPrivate) _removeTrackingRects:count:]
--[WebHTMLView(WebPrivate) _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]
-__ZN20WebFrameLoaderClient19detachedFromParent2Ev
-__ZN20WebFrameLoaderClient19detachedFromParent3Ev
--[WebFrameBridge close]
-__ZN20WebFrameLoaderClient19detachedFromParent4Ev
--[WebFrameBridge dealloc]
--[WebFrameBridge fini]
-__ZN20WebFrameLoaderClient20frameLoaderDestroyedEv
--[WebFrame dealloc]
--[WebFramePrivate dealloc]
--[WebFrameView dealloc]
--[WebFrameViewPrivate dealloc]
--[WebNetscapePluginStream stop]
--[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:]
--[WebNetscapePluginStream cancelLoadWithError:]
-__ZN35WebNetscapePlugInStreamLoaderClient7didFailEPN7WebCore26NetscapePlugInStreamLoaderERKNS0_13ResourceErrorE
--[WebBaseNetscapePluginStream destroyStreamWithError:]
-+[WebBaseNetscapePluginStream reasonForError:]
-_NPN_GetURL
--[WebBaseNetscapePluginView(WebNPPCallbacks) getURL:target:]
--[NSString(WebNSURLExtras) _webkit_stringByReplacingValidPercentEscapes]
--[WebFrame findFrameNamed:]
--[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]
--[WebBaseNetscapePluginView(WebNPPCallbacks) loadPluginRequest:]
--[WebPluginRequest request]
--[WebPluginRequest frameName]
--[WebBaseNetscapePluginView(WebNPPCallbacks) evaluateJavaScriptPluginRequest:]
--[WebPluginRequest isCurrentEventUserGesture]
--[WebPluginRequest sendNotification]
--[WebPluginRequest dealloc]
--[WebViewFactory defaultLanguageCode]
--[WebDynamicScrollBarsView autoforwardsScrollWheelEvents]
-__ZN20WebFrameLoaderClient14shouldFallBackERKN7WebCore13ResourceErrorE
-__ZN20WebFrameLoaderClient30dispatchDidFailProvisionalLoadERKN7WebCore13ResourceErrorE
--[WebView(WebPrivate) _didFailProvisionalLoadWithError:forFrame:]
--[WebHistoryItem alternateTitle]
--[WebHistoryItem setAlternateTitle:]
--[WebHTMLView(WebPrivate) view:stringForToolTip:point:userData:]
--[WebHTMLView windowDidResignKey:]
--[WebHTMLView removeMouseMovedObserver]
--[WebBaseNetscapePluginView windowResignedKey:]
--[WebBaseNetscapePluginView windowBecameKey:]
--[WebView(WebIBActions) goBack:]
--[WebView goBack]
-__ZNK20WebFrameLoaderClient21shouldGoToHistoryItemEPN7WebCore11HistoryItemE
--[WebHistoryItem(WebPrivate) URL]
-__ZN20WebFrameLoaderClient16restoreViewStateEv
--[WebWindowWatcher windowWillClose:]
--[WebHTMLView needsPanelToBecomeKey]
--[WebHTMLView acceptsFirstMouse:]
-__ZN20WebFrameLoaderClient50dispatchDidReceiveServerRedirectForProvisionalLoadEv
-__ZN15WebChromeClient19addMessageToConsoleERKN7WebCore6StringEjS3_
-__ZN13WebDragClient28dragSourceActionMaskForPointERKN7WebCore8IntPointE
--[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:]
--[WebFrameBridge willPopupMenu:]
-_WKPopupMenu
--[WebHTMLView _accessibilityParentForSubview:]
--[WebHTMLView accessibilityAttributeValue:]
--[WebClipView _focusRingVisibleRect]
--[WebFrameBridge window]
--[WebViewFactory accessibilityHandleFocusChanged]
-_WKAccessibilityHandleFocusChanged
--[WebViewFactory unregisterUniqueIdForUIElement:]
-_WKUnregisterUniqueIdForElement
-__ZN25WebCachedPagePlatformData5clearEv
--[WebHTMLView(WebInternal) closeIfNotCurrentView]
-_WKGetFontInLanguageForCharacter
-__ZN20WebFrameLoaderClient35dispatchDidChangeLocationWithinPageEv
-__ZN20WebFrameLoaderClient13didFinishLoadEv
--[WebView(WebPendingPublic) shouldClose]
--[WebView _windowWillClose:]
--[WebView shouldCloseWithWindow]
--[WebHTMLView windowWillClose:]
--[WebView(WebPrivate) _isClosed]
--[WebView close]
--[WebFrame childFrames]
--[WebView(WebPrivate) _clearUndoRedoOperations]
--[WebView(WebPrivate) _close]
--[WebView(AllWebViews) _removeFromAllWebViewsSet]
--[WebView(WebPendingPublic) setScriptDebugDelegate:]
--[WebView(WebPrivate) _detachScriptDebuggerFromAllFrames]
--[WebView removeDragCaret]
-__ZN15WebEditorClient13pageDestroyedEv
-__ZN18WebInspectorClient18inspectorDestroyedEv
-__ZN20WebContextMenuClient20contextMenuDestroyedEv
-__ZN13WebDragClient23dragControllerDestroyedEv
-__ZN15WebChromeClient15chromeDestroyedEv
--[WebView preferencesIdentifier]
--[WebPreferences identifier]
-+[WebPreferences(WebPrivate) _removeReferenceForIdentifier:]
--[WebPreferences(WebPrivate) didRemoveFromWebView]
-+[WebView(WebFileInternal) _preferencesRemovedNotification:]
-+[WebView(WebFileInternal) _cacheModel]
-+[WebView(WebFileInternal) _maxCacheModelInAnyInstance]
--[WebView dealloc]
--[WebViewPrivate dealloc]
-__ZN20WebFrameLoaderClient38dispatchDidLoadResourceFromMemoryCacheEPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestERKNS0_16ResourceResponseEi
-__Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_S0_S0_
-__Z12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_S0_S0_
--[WebViewFactory inputElementAltText]
-__ZN20WebFrameLoaderClient35transitionToCommittedFromCachedPageEPN7WebCore10CachedPageE
-__ZN20WebFrameLoaderClient11forceLayoutEv
--[WebHTMLView setNeedsToApplyStyles:]
-_WKDrawBezeledTextArea
-__ZN15WebEditorClient23textDidChangeInTextAreaEPN7WebCore7ElementE
--[WebPreferences setJavaScriptCanOpenWindowsAutomatically:]
--[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setBool:forKey:]
-__ZN20WebFrameLoaderClient28updateGlobalHistoryForReloadERKN7WebCore4KURLE
--[WebHistory setLastVisitedTimeInterval:forItem:]
--[WebHistoryPrivate setLastVisitedTimeInterval:forItem:]
--[WebDynamicScrollBarsView allowsHorizontalScrolling]
-__ZN15WebChromeClient10windowRectEv
-__ZN15WebChromeClient11scaleFactorEv
-__ZN15WebChromeClient11canRunModalEv
-__ZN20WebFrameLoaderClient19dispatchDidFailLoadERKN7WebCore13ResourceErrorE
--[WebView(WebPrivate) _didFailLoadWithError:forFrame:]
-__ZN15WebChromeClient12createWindowEPN7WebCore5FrameERKNS0_16FrameLoadRequestERKNS0_14WindowFeaturesE
-__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_
-__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_
--[WebBaseNetscapePluginView preferencesHaveChanged:]
-__ZN15WebChromeClient18setToolbarsVisibleEb
--[WebView becomeFirstResponder]
--[WebFrameView acceptsFirstResponder]
-__ZN15WebChromeClient19setStatusbarVisibleEb
-__ZN15WebChromeClient20setScrollbarsVisibleEb
-__ZN15WebChromeClient17setMenubarVisibleEb
-__ZN15WebChromeClient12setResizableEb
-__ZN15WebChromeClient8pageRectEv
-__ZN15WebChromeClient13setWindowRectERKN7WebCore9FloatRectE
-__ZN15WebChromeClient4showEv
--[WebFramePolicyListener invalidate]
-__ZN20WebFrameLoaderClient29interruptForPolicyChangeErrorERKN7WebCore15ResourceRequestE
--[WebFramePolicyListener ignore]
-+[NSObject(WebScripting) isKeyExcludedFromWebScript:]
--[WebIconDatabase iconURLForURL:]
--[WebHistoryItem(WebPrivate) RSSFeedReferrer]
--[WebView(WebIBActions) reload:]
--[WebFrame reload]
-__ZN15WebChromeClient7unfocusEv
--[WebDefaultUIDelegate webViewUnfocus:]
-__ZN15WebChromeClient15closeWindowSoonEv
--[WebView(WebPrivate) _closeWindow]
--[WebBaseNetscapePluginView windowWillClose:]
--[WebFrameBridge valueForKey:keys:values:]
--[NSError(WebKitExtras) _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]
--[WebNullPluginView initWithFrame:error:DOMElement:]
--[WebNullPluginView viewDidMoveToWindow]
--[WebNullPluginView reportFailure]
--[WebFrameBridge getAppletInView:]
--[WebFrameBridge pollForAppletInView:]
--[WebNullPluginView dealloc]
-__ZN20WebFrameLoaderClient21fileDoesNotExistErrorERKN7WebCore16ResourceResponseE
-__ZN20WebFrameLoaderClient38dispatchDecidePolicyForNewWindowActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestERKNS0_6StringE
-__ZN20WebFrameLoaderClient18dispatchCreatePageEv
-__ZN20WebFrameLoaderClient12dispatchShowEv
-__ZN3WTF6VectorI6CGRectLm16EE14expandCapacityEm
-__ZN3WTF6VectorI6CGRectLm16EE15reserveCapacityEm
--[WebViewFactory refreshPlugins:]
--[WebBackForwardList forwardItem]
--[WebBackForwardList backItem]
--[NSString(WebKitExtras) _web_drawAtPoint:font:textColor:]
-_canUseFastRenderer
--[NSEvent(WebExtras) _web_isOptionTabKeyEvent]
--[NSString(WebNSURLExtras) _webkit_rangeOfURLScheme]
--[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]
--[WebFrame _loadHTMLString:baseURL:unreachableURL:]
--[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]
--[WebBaseNetscapePluginStream _pluginCancelledConnectionError]
--[WebPluginRequest notifyData]
-__ZNK15WebChromeClient11tabsToLinksEv
--[WebPreferences tabsToLinks]
--[WebFrameBridge keyboardUIMode]
--[WebFrameBridge _retrieveKeyboardUIModeFromPreferences:]
--[WebFrameBridge _preferences]
-_WKGetMIMETypeForExtension
--[WebView _pluginForExtension:]
--[WebPluginDatabase pluginForExtension:]
--[WebBasePluginPackage extensionEnumerator]
--[WebBasePluginPackage MIMETypeForExtension:]
--[WebDataSource(WebPrivate) _mainDocumentError]
--[WebHTMLView validateUserInterfaceItem:]
--[WebHTMLView validateUserInterfaceItemWithoutDelegate:]
-__Z3kitN7WebCore8TriStateE
-__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objecta
-__Z28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selectorS2_a
--[WebFrame(WebPrivate) _isDisplayingStandaloneImage]
--[WebHTMLView(WebPrivate) _hasSelection]
--[WebHTMLView(WebPrivate) _isEditable]
--[WebView(WebIBActions) validateUserInterfaceItem:]
--[WebView(WebIBActions) validateUserInterfaceItemWithoutDelegate:]
--[WebHTMLView(WebInternal) isGrammarCheckingEnabled]
--[WebView(WebIBActions) canMakeTextLarger]
--[WebView(WebFileInternal) _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]
--[WebFrame(WebInternal) _documentViews]
--[WebHTMLView(WebTextSizing) _tracksCommonSizeFactor]
--[WebView(WebIBActions) canMakeTextStandardSize]
--[WebView(WebIBActions) canMakeTextSmaller]
--[WebHTMLRepresentation canProvideDocumentSource]
--[WebView supportsTextEncoding]
--[WebHTMLView(WebDocumentPrivateProtocols) supportsTextEncoding]
--[WebView customTextEncodingName]
--[WebView _mainFrameOverrideEncoding]
--[WebHistory orderedLastVisitedDays]
--[WebHistoryPrivate orderedLastVisitedDays]
--[WebHistory orderedItemsLastVisitedOnDay:]
--[WebHistoryPrivate orderedItemsLastVisitedOnDay:]
--[WebHistoryItem icon]
--[WebView(WebIBActions) goForward:]
--[WebView goForward]
-__ZN13WebDragClient24declareAndWriteDragImageEP12NSPasteboardP10DOMElementP5NSURLP8NSStringPN7WebCore5FrameE
-__Z14getTopHTMLViewPN7WebCore5FrameE
--[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]
--[NSPasteboard(WebExtras) _web_declareAndWriteDragImageForElement:URL:title:archive:source:]
-+[NSPasteboard(WebExtras) _web_writableTypesForImageIncludingArchive:]
-__Z33_writableTypesForImageWithArchivev
-__Z36_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
-__ZN7WebCore20CachedResourceClient14notifyFinishedEPNS_14CachedResourceE
--[WebArchive data]
--[WebArchive _propertyListRepresentation]
--[WebResource(WebResourcePrivate) _propertyListRepresentation]
-+[WebResource(WebResourcePrivate) _propertyListsFromResources:]
-_WKGetPreferredExtensionForMIMEType
-__ZN13WebDragClient27willPerformDragSourceActionEN7WebCore16DragSourceActionERKNS0_8IntPointEPNS0_9ClipboardE
--[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:]
-__ZN13WebDragClient9startDragEN3WTF9RetainPtrI7NSImageEERKN7WebCore8IntPointES7_PNS4_9ClipboardEPNS4_5FrameEb
--[WebHTMLView(WebInternal) _mouseDownEvent]
--[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]
--[WebHTMLView draggingSourceOperationMaskForLocal:]
--[WebView _hitTest:dragTypes:]
--[WebView draggingEntered:]
--[WebView documentViewAtWindowPoint:]
--[WebView(WebFileInternal) _frameViewAtWindowPoint:]
-__ZN13WebDragClient17actionMaskForDragEPN7WebCore8DragDataE
--[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]
-__ZNK19WebPasteboardHelper25insertablePasteboardTypesEv
--[WebView draggingUpdated:]
--[WebView _shouldAutoscrollForDraggingInfo:]
--[WebHTMLView draggedImage:movedTo:]
--[WebView draggingExited:]
--[WebHTMLView draggedImage:endedAt: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]
--[WebHTMLView(WebPrivate) pasteboard:provideDataForType:]
--[WebHTMLView(WebInternal) promisedDragTIFFDataSource]
--[WebArchive initWithData:]
--[WebArchive _initWithPropertyList:]
--[WebResource(WebResourcePrivate) _initWithPropertyList:]
-+[WebResource(WebResourcePrivate) _resourcesFromPropertyLists:]
--[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
--[WebArchive subresources]
--[WebArchive mainResource]
--[WebResource MIMEType]
--[WebResource(WebResourcePrivate) _fileWrapperRepresentation]
--[NSPasteboard(WebExtras) _web_writeFileWrapperAsRTFDAttachment:]
-+[WebPluginDatabase closeSharedDatabase]
--[WebPluginDatabase close]
--[WebPluginDatabase(Internal) _removePlugin:]
-+[WebView(WebPrivate) _unregisterViewClassAndRepresentationClassForMIMEType:]
--[WebBasePluginPackage wasRemovedFromPluginDatabase:]
--[WebNetscapePluginPackage wasRemovedFromPluginDatabase:]
--[WebNetscapePluginPackage(Internal) _unloadWithShutdown:]
-___tcf_3
-___tcf_0
-___tcf_2
-_WKDrawBezeledTextFieldCell
--[WebView(WebPrivate) _UIDelegateForwarder]
-+[WebDefaultUIDelegate sharedUIDelegate]
--[WebClipView resetAdditionalClip]
--[WebView(WebIBActions) canGoBack]
--[WebView(WebIBActions) canGoForward]
--[WebHTMLView(WebPrivate) hitTest:]
-+[WebElementDictionary initialize]
--[WebElementDictionary initWithHitTestResult:]
-+[WebElementDictionary initializeLookupTable]
-__Z12addLookupKeyP8NSStringP13objc_selector
--[WebElementDictionary objectForKey:]
--[WebElementDictionary dealloc]
--[WebView(WebPendingPublic) isHoverFeedbackSuspended]
-__ZN15WebChromeClient23mouseDidMoveOverElementERKN7WebCore13HitTestResultEj
--[WebView(WebPrivate) _mouseDidMoveOverElement:modifierFlags:]
-__Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectj
-__Z12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_j
--[WebElementDictionary _absoluteLinkURL]
-__ZN15WebChromeClient10setToolTipERKN7WebCore6StringE
--[WebHTMLView(WebPrivate) _setToolTip:]
-_WKCGContextGetShouldSmoothFonts
-_WKSetCGFontRenderingMode
-__Z29_updateMouseoverTimerCallbackP16__CFRunLoopTimerPv
--[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent]
--[WebHTMLView(WebPrivate) _updateMouseoverWithEvent:]
--[WebIconDatabase(WebInternal) _iconForFileURL:withSize:]
--[WebIconDatabase(WebInternal) _iconsBySplittingRepresentationsOfIcon:]
--[WebIconDatabase(WebInternal) _iconFromDictionary:forSize:cache:]
--[WebHTMLView(WebPrivate) _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
-__ZN20WebFrameLoaderClient29dispatchDidFinishDocumentLoadEv
-__ZN20WebFrameLoaderClient27dispatchDidLoadMainResourceEPN7WebCore14DocumentLoaderE
-+[WebScriptDebugServer listenerCount]
-__ZN20WebFrameLoaderClient24dispatchDidFinishLoadingEPN7WebCore14DocumentLoaderEm
--[WebView(WebViewInternal) _removeObjectForIdentifier:]
-__ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_10HashTraitsImEENSC_IS5_EEEESD_E4findImNS_22IdentityHashTranslatorImS6_SA_EEEENS_17HashTableIteratorImS6_S8_SA_SF_SD_EERKT_
-__ZN20WebDocumentLoaderMac17decreaseLoadCountEm
-__ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E4findImNS_22IdentityHashTranslatorImmS4_EEEENS_17HashTableIteratorImmS2_S4_S6_S6_EERKT_
-+[WebPluginDatabase sharedDatabase]
--[WebPluginDatabase init]
-+[WebPluginDatabase(Internal) _defaultPlugInPaths]
--[WebPluginDatabase setPlugInPaths:]
--[WebPluginDatabase refresh]
--[WebPluginDatabase(Internal) _scanForNewPlugins]
--[WebPluginDatabase(Internal) _plugInPaths]
-+[WebBasePluginPackage initialize]
-+[WebBasePluginPackage pluginWithPath:]
--[WebPluginPackage initWithPath:]
--[WebBasePluginPackage initWithPath:]
--[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:]
--[WebBasePluginPackage dealloc]
-+[WebNetscapePluginPackage initialize]
-_WebLMGetCurApRefNum
-_WebLMSetCurApRefNum
--[WebNetscapePluginPackage initWithPath:]
--[WebNetscapePluginPackage _initWithPath:]
--[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]
--[NSArray(WebPluginExtensions) _web_lowercaseStrings]
--[WebBasePluginPackage setMIMEToExtensionsDictionary:]
--[WebBasePluginPackage setMIMEToDescriptionDictionary:]
--[WebBasePluginPackage filename]
--[WebBasePluginPackage setName:]
--[WebBasePluginPackage setPluginDescription:]
--[WebNetscapePluginPackage getPluginInfoFromResources]
--[WebNetscapePluginPackage openResourceFile]
-+[WebBasePluginPackage preferredLocalizationName]
--[WebPluginPackage load]
-__Z13webGetNSImagePN7WebCore5ImageE7_NSSize
-+[NSNotificationCenter(WebNSNotificationCenterExtras) _postNotificationName:]
--[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:]
--[NSString(WebNSURLExtras) _web_isUserVisibleURL]
--[NSString(WebNSURLExtras) _webkit_looksLikeAbsoluteURL]
--[WebHistoryItem(WebPrivate) visitCount]
--[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]
--[WebView(WebViewInternal) _dispatchDidReceiveIconFromWebFrame:]
-__ZNK19WebPasteboardHelper17urlFromPasteboardEPK12NSPasteboardPN7WebCore6StringE
--[NSPasteboard(WebExtras) _web_bestURL]
-+[WebURLsWithTitles URLsFromPasteboard:]
-+[WebView(WebPrivate) canShowFile:]
-+[WebView(WebPrivate) _MIMETypeForFile:]
--[WebIconDatabase releaseIconForURL:]
--[NSView(WebExtras) _web_dragOperationForDraggingInfo:]
--[WebHistory removeAllItems]
--[WebHistoryPrivate removeAllItems]
-+[WebCache empty]
--[WebBackForwardList pageCacheSize]
--[WebBackForwardList setPageCacheSize:]
--[WebView(WebPrivate) setUsesPageCache:]
--[WebIconDatabase(WebPendingPublic) removeAllIcons]
-__ZN21WebIconDatabaseClient25dispatchDidRemoveAllIconsEv
--[WebIconDatabase(WebInternal) _sendDidRemoveAllIconsNotification]
-__ZN21WebIconDatabaseClient13performImportEv
-__Z21importToWebCoreFormatv
-+[ThreadEnabler enableThreading]
-__Z20objectFromPathForKeyP8NSStringP11objc_object
--[ThreadEnabler threadEnablingSelector:]
--[NSString(WebKitExtras) _webkit_fixedCarbonPOSIXPath]
--[WebViewFactory pluginsInfo]
--[WebFrameView keyDown:]
-_NPN_PostURLNotify
--[WebBaseNetscapePluginView(WebNPPCallbacks) postURLNotify:target:len:buf:file:notifyData:]
--[WebBaseNetscapePluginView(WebNPPCallbacks) _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]
--[NSData(PluginExtras) _web_startsWithBlankLine]
--[NSData(PluginExtras) _web_locationAfterFirstBlankLine]
--[NSData(WebNSDataExtras) _webkit_parseRFC822HeaderFields]
--[NSString(WebNSDataExtrasInternal) _web_capitalizeRFC822HeaderFieldName]
-__ZN3WTF6VectorIN7WebCore15FormDataElementELm0EE6shrinkEm
-__ZN3WTF6VectorIcLm0EE6shrinkEm
--[NSString(WebKitExtras) _web_widthWithFont:]
--[WebView(WebViewInternal) _receivedIconChangedNotification:]
--[WebView mainFrameURL]
 -[WebHTMLView menuForEvent:]
 -[WebViewFactory contextMenuItemTagOpenLink]
 -[WebViewFactory contextMenuItemTagOpenLinkInNewWindow]
@@ -1327,46 +928,593 @@
 -[WebViewFactory contextMenuItemTagCut]
 -[WebViewFactory contextMenuItemTagPaste]
 __ZN20WebContextMenuClient29getCustomMenuFromDefaultItemsEPN7WebCore11ContextMenuE
-__Z19isPreVersion3Clientv
-__Z28isPreInspectElementTagClientv
+__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]
--[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]
+-[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_
+__ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_dS0_S0_
+__ZN20WebFrameLoaderClient31dispatchDidCancelClientRedirectEv
+-[WebViewFactory defaultLanguageCode]
+-[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_
+__ZN20WebFrameLoaderClient22dispatchDidFirstLayoutEv
+__ZN15WebChromeClient7repaintERKN7WebCore7IntRectEbbb
 -[WebView(WebIBActions) stopLoading:]
 -[WebFrame stopLoading]
--[NSURL(WebNSURLExtras) _web_URLWithLowercasedScheme]
-+[NSPasteboard(WebExtras) _web_setFindPasteboardString:withOwner:]
+__ZN15WebChromeClient24disableSuddenTerminationEv
+__ZN15WebChromeClient23enableSuddenTerminationEv
+-[WebHTMLView mouseDragged:]
+__ZN15WebChromeClient18formStateDidChangeEPKN7WebCore4NodeE
+__ZN15WebChromeClient12createWindowEPN7WebCore5FrameERKNS0_16FrameLoadRequestERKNS0_14WindowFeaturesE
+__ZN15WebChromeClient18setToolbarsVisibleEb
+__ZN15WebChromeClient19setStatusbarVisibleEb
+__ZN15WebChromeClient20setScrollbarsVisibleEb
+-[WebFrameView setAllowsScrolling:]
+__ZN15WebChromeClient17setMenubarVisibleEb
+__ZN15WebChromeClient12setResizableEb
+__ZN15WebChromeClient10windowRectEv
+__ZN15WebChromeClient8pageRectEv
+__ZN15WebChromeClient13setWindowRectERKN7WebCore9FloatRectE
+__ZN15WebChromeClient4showEv
+__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:]
+-[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]
-__Z14incrementFrameP8WebFrameaa
--[WebHistory _itemForURLString:]
--[WebView(WebPendingPublic) canMarkAllTextMatches]
--[WebHistoryItem(WebPrivate) _lastVisitedDate]
+-[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]
+-[NSURL(WebNSURLExtras) _web_URLWithLowercasedScheme]
+-[WebFramePolicyListener ignore]
+__ZN20WebFrameLoaderClient36transitionToCommittedFromCachedFrameEPN7WebCore11CachedFrameE
+__ZN20WebFrameLoaderClient11forceLayoutEv
+-[WebHTMLView setNeedsToApplyStyles:]
+-[WebNullPluginView dealloc]
+__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
+WKGetFontInLanguageForCharacter
+__ZN13WebDragClient24declareAndWriteDragImageEP12NSPasteboardP10DOMElementP5NSURLP8NSStringPN7WebCore5FrameE
+__ZL14getTopHTMLViewPN7WebCore5FrameE
+-[DOMNode(WebDOMNodeOperations) webArchive]
+-[WebArchive(WebInternal) _initWithCoreLegacyWebArchive:]
++[WebArchivePrivate initialize]
+-[WebArchivePrivate initWithCoreArchive:]
+-[NSPasteboard(WebExtras) _web_declareAndWriteDragImageForElement:URL:title:archive:source:]
++[NSPasteboard(WebExtras) _web_writableTypesForImageIncludingArchive:]
+__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]
+-[WebHTMLView(WebInternal) setPromisedDragTIFFDataSource:]
+__ZL18promisedDataClientv
+__ZN7WebCore20CachedResourceClient12imageChangedEPNS_11CachedImageEPKNS_7IntRectE
+__ZN7WebCore20CachedResourceClient14notifyFinishedEPNS_14CachedResourceE
+-[WebArchive data]
+-[WebArchivePrivate coreArchive]
+__ZN13WebDragClient27willPerformDragSourceActionEN7WebCore16DragSourceActionERKNS0_8IntPointEPNS0_9ClipboardE
+-[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:]
+__ZN13WebDragClient9startDragEN3WTF9RetainPtrI7NSImageEERKN7WebCore8IntPointES7_PNS4_9ClipboardEPNS4_5FrameEb
+-[WebHTMLView(WebInternal) _mouseDownEvent]
+-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]
+-[WebHTMLView draggingSourceOperationMaskForLocal:]
+-[WebView _hitTest:dragTypes:]
+-[WebView draggingEntered:]
+-[WebView documentViewAtWindowPoint:]
+-[WebView(WebFileInternal) _frameViewAtWindowPoint:]
+__ZN13WebDragClient17actionMaskForDragEPN7WebCore8DragDataE
+-[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]
+__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]
+__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:]
+-[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:]
+-[WebResource dealloc]
+-[WebResourcePrivate dealloc]
+-[NSView(WebExtras) _web_parentWebFrameView]
+-[WebView(WebPrivate) _loadBackForwardListFromOtherView:]
+__ZL8hexDigiti
+__ZN15WebChromeClient18runJavaScriptAlertEPN7WebCore5FrameERKNS0_6StringE
+-[WebIconDatabase releaseIconForURL:]
+-[NSView(WebExtras) _web_dragOperationForDraggingInfo:]
+-[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:]
+-[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 @@
 -[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 @@
 -[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 @@
 -[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 @@
 -[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
+-[WebPluginController destroyPlugin:]
+-[WebPreferences setStandardFontFamily:]
+-[WebPreferences _setStringValue:forKey:]
+-[WebPreferences setDefaultFontSize:]
+-[WebPreferences setFixedFontFamily:]
+-[WebPreferences setDefaultFixedFontSize:]
+-[WebPreferences setDefaultTextEncodingName:]
+-[WebHTMLRepresentation currentForm]
++[WebDatabaseManager sharedWebDatabaseManager]
+-[WebDatabaseManager origins]
+-[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
-__ZN3WTF6VectorIN7WebCore6StringELm0EEC2ERKS3_
-__ZN3WTF6VectorIN7WebCore6StringELm0EE14expandCapacityEmPKS2_
-__ZN3WTF6VectorIN7WebCore6StringELm0EE6shrinkEm
--[WebHTMLView selectAll:]
--[WebHTMLView executeCoreCommandBySelector:]
--[WebHTMLView callDelegateDoCommandBySelectorIfNeeded:]
--[WebHTMLView showGuessPanel:]
--[WebHTMLView ignoreSpelling:]
--[WebHTMLView checkSpelling:]
-__ZN15WebEditorClient33updateSpellingUIWithGrammarStringERKN7WebCore6StringERKNS0_13GrammarDetailE
--[WebHTMLView changeSpelling:]
--[WebHTMLView _changeSpellingToWord:]
--[WebHTMLView(WebHTMLViewFileInternal) _shouldReplaceSelectionWithText:givenAction:]
--[WebHTMLView(WebHTMLViewFileInternal) _selectedRange]
--[WebHTMLView(WebHTMLViewFileInternal) _shouldInsertText:replacingDOMRange:givenAction:]
--[WebView windowScriptObject]
--[WebView setCustomTextEncodingName:]
--[WebPreferences setStandardFontFamily:]
--[WebPreferences _setStringValue:forKey:]
--[WebPreferences setDefaultFontSize:]
--[WebPreferences setDefaultTextEncodingName:]
-+[WebDatabaseManager sharedWebDatabaseManager]
--[WebDatabaseManager origins]
--[WebFrameBridge runOpenPanelForFileButtonWithResultListener:]
-_WKCreateCustomCFReadStream
-_WKSignalCFReadStreamHasBytes
-_WKSignalCFReadStreamEnd
--[WebHTMLView copy:]
-__ZN15WebEditorClient24smartInsertDeleteEnabledEv
-__ZN15WebEditorClient33didSetSelectionTypesForPasteboardEv
--[WebDefaultEditingDelegate webView:didSetSelectionTypesForPasteboard:]
-__ZN15WebEditorClient24dataForArchivedSelectionEPN7WebCore5FrameE
-+[WebArchiver archiveSelectionInFrame:]
--[DOMHTMLTableCellElement(WebDOMHTMLTableCellElementOperationsPrivate) _subresourceURLs]
--[DOMHTMLTableCellElement(WebDOMHTMLTableCellElementOperationsPrivate) _web_background]
--[DOMHTMLTableElement(WebDOMHTMLTableElementOperationsPrivate) _subresourceURLs]
--[DOMHTMLTableElement(WebDOMHTMLTableElementOperationsPrivate) _web_background]
-__ZN15WebEditorClient29didWriteSelectionToPasteboardEv
--[WebDefaultEditingDelegate webView:didWriteSelectionToPasteboard:]
--[WebView(WebPendingPublic) setHoverFeedbackSuspended:]
--[WebHTMLView(WebInternal) _hoverFeedbackSuspendedChanged]
--[WebView elementAtPoint:]
--[WebView _elementAtWindowPoint:]
--[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:]
-+[WebIconDatabase(WebPrivate) _checkIntegrityBeforeOpening]
--[WebPDFRepresentation receivedError:withDataSource:]
+__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 @@
 __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 @@
 __ZN24WebDatabaseTrackerClient23dispatchDidModifyOriginEPN7WebCore14SecurityOriginE
 -[WebSecurityOrigin dealloc]
 __ZN24WebDatabaseTrackerClient25dispatchDidModifyDatabaseEPN7WebCore14SecurityOriginERKNS0_6StringE
-_WKReleaseStyleGroup
--[WebKeyGenerator strengthMenuItemTitles]
-__ZN15WebChromeClient20runJavaScriptConfirmEPN7WebCore5FrameERKNS0_6StringE
-__ZN15WebChromeClient15toolbarsVisibleEv
-__Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selector
-__Z28CallDelegateReturningBooleanaP7WebViewP11objc_objectP13objc_selector
-__ZN15WebChromeClient14menubarVisibleEv
+__ZN15WebChromeClient8runModalEv
+__Z14CallUIDelegateP7WebViewP13objc_selector
+__ZL12CallDelegateP7WebViewP11objc_objectP13objc_selector
+__ZN20WebFrameLoaderClient12blockedErrorERKN7WebCore15ResourceRequestE
 __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:]
+__ZN15WebChromeClient15toolbarsVisibleEv
+__ZN15WebChromeClient14menubarVisibleEv
+-[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 @@
 
 #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 WebSubresourcesKey = @"WebSubresources";
 static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
 
-@interface WebArchivePrivate : NSObject
-{
+@interface WebArchivePrivate : NSObject {
 @public
     WebResource *cachedMainResource;
     NSArray *cachedSubresources;
@@ -63,18 +63,20 @@
 
 @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 @@
         [self release];
         return nil;
     }
-    
     coreArchive = _coreArchive.releaseRef();
-    
     return self;
 }
 
@@ -100,7 +100,8 @@
 {
     ASSERT(coreArchive);
     ASSERT(newCoreArchive);
-    coreArchive->deref();
+    if (coreArchive)
+        coreArchive->deref();
     coreArchive = newCoreArchive.releaseRef();
 }
 
@@ -109,9 +110,10 @@
     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 @@
 
 - (void)finalize
 {
-    ASSERT(coreArchive);
-    coreArchive->deref();
-    coreArchive = 0;
+    if (coreArchive) {
+        coreArchive->deref();
+        coreArchive = 0;
+    }
     
     [super finalize];
 }
@@ -135,6 +138,8 @@
 
 - (id)init
 {
+    WebCoreThreadViolationCheck();
+
     self = [super init];
     if (!self)
         return nil;
@@ -156,6 +161,13 @@
 
 - (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 @@
 
 - (id)initWithData:(NSData *)data
 {
+    WebCoreThreadViolationCheck();
+
     self = [super init];
     if (!self)
         return nil;
@@ -216,7 +230,13 @@
 #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 @@
 
 - (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 @@
 
 - (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 @@
 
 - (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 @@
 
 - (NSData *)data
 {
+    WebCoreThreadViolationCheck();
+
 #if !LOG_DISABLED
     CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
 #endif
@@ -353,6 +396,8 @@
 
 - (id)_initWithCoreLegacyWebArchive:(PassRefPtr<WebCore::LegacyWebArchive>)coreLegacyWebArchive
 {
+    WebCoreThreadViolationCheck();
+
     self = [super init];
     if (!self)
         return nil;
@@ -368,6 +413,8 @@
 
 - (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 @@
 
 @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 @@
     [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 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 @@
     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 @@
     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 @@
     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 @@
 
 - (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 @@
 {
     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 @@
     // 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 @@
 
 - (id)_accessibilityTree
 {
+#if HAVE(ACCESSIBILITY)
     if (!AXObjectCache::accessibilityEnabled()) {
         AXObjectCache::enableAccessibility();
         if ([[NSApp accessibilityAttributeValue:NSAccessibilityEnhancedUserInterfaceAttribute] boolValue])
@@ -696,6 +702,9 @@
     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 @@
     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 @@
 
 - (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 @@
 }
 #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 @@
 
 - (void)loadRequest:(NSURLRequest *)request
 {
-    _private->coreFrame->loader()->load(request);
+    _private->coreFrame->loader()->load(request, false);
 }
 
 static NSURL *createUniqueWebDataURL()
@@ -1266,7 +1336,7 @@
 
     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 @@
 
 - (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 @@
 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 @@
     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 @@
 - (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 @@
 
 - (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 @@
         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 @@
 
         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 @@
     
     _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 @@
     [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 @@
     // 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 @@
 
 - (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 @@
 
 + (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 @@
     NSEvent *keyDownEvent; // Kept after handling the event.
     
     NSSize lastLayoutSize;
-    
+
     NSPoint lastScrollPosition;
 
     WebPluginController *pluginController;
@@ -393,22 +394,23 @@
     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 @@
 
 + (void)initialize
 {
+    JSC::initializeThreading();
 #ifndef BUILDING_ON_TIGER
     WebCoreObjCFinalizeOnMainThread(self);
 #endif
@@ -661,13 +664,15 @@
                                              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 @@
         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 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 @@
     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 @@
     [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 @@
         [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 @@
         [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 @@
 {
     [NSApp registerServicesMenuSendTypes:[[self class] _selectionPasteboardTypes] 
                              returnTypes:[[self class] _insertablePasteboardTypes]];
+    JSC::initializeThreading();
 #ifndef BUILDING_ON_TIGER
     WebCoreObjCFinalizeOnMainThread(self);
 #endif
@@ -2219,6 +2236,9 @@
 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 @@
         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 @@
                || 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 @@
     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 @@
     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 @@
         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 @@
     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 @@
 
 - (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 @@
 
 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 @@
         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 @@
 
 #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 @@
     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 @@
 {
 #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 @@
     // 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 @@
     // 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 @@
             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 @@
         
         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 @@
 - (NSRect)selectionRect
 {
     if ([self _hasSelection])
-        return core([self _frame])->selectionRect();
+        return core([self _frame])->selectionBounds();
     return NSZeroRect;
 }
 
@@ -5599,7 +5668,7 @@
 - (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 @@
             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 @@
         [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 @@
         @"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 @@
     [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 @@
     [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 @@
     WebKitEditableLinkNeverLive
 } WebKitEditableLinkBehavior;
 
+typedef enum {
+    WebTextDirectionSubmenuNeverIncluded,
+    WebTextDirectionSubmenuAutomaticallyIncluded,
+    WebTextDirectionSubmenuAlwaysIncluded
+} WebTextDirectionSubmenuInclusionBehavior;
+
 extern NSString *WebPreferencesChangedNotification;
 extern NSString *WebPreferencesRemovedNotification;
 
@@ -77,6 +83,12 @@
 - (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 @@
 - (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 @@
     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 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 @@
 {
     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 @@
 
 - (id)initWithCoder:(NSCoder *)decoder
 {
+    WebCoreThreadViolationCheck();
+
     self = [super init];
     if (!self)
         return nil;
@@ -200,29 +200,78 @@
 
 - (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 @@
 // 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 @@
            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 @@
         [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 @@
               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:(WTF::PassRefPtr<WebCore::ArchiveResource>)coreResource;
-- (WebCore::ArchiveResource *)_coreResource;
-
+- (id)_initWithCoreResource:(PassRefPtr<WebCore::ArchiveResource>)coreResource;
+- (WebCore::ArchiveResource*)_coreResource;
 @end
+
+#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 @@
 // 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 @@
 
 // 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 @@
 @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 @@
 
 @interface WebScriptCallFrame (WebScriptDebugDelegateInternal)
 
-- (id)_convertValueToObjcValue:(JSValue*)value;
+- (id)_convertValueToObjcValue:(JSValuePtr)value;
 
 @end
 
@@ -62,6 +64,7 @@
     WebScriptObject        *globalObject;   // the global object's proxy (not retained)
     WebScriptCallFrame     *caller;         // previous stack frame
     DebuggerCallFrame* debuggerCallFrame;
+    WebScriptDebugger* debugger;
 }
 @end
 
@@ -85,12 +88,13 @@
 
 @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 @@
     _private->debuggerCallFrame = 0;
 }
 
-- (id)_convertValueToObjcValue:(JSValue*)value
+- (id)_convertValueToObjcValue:(JSValuePtr)value
 {
     if (!value)
         return nil;
@@ -177,8 +181,12 @@
     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 @@
     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 @@
 
     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 @@
 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 @@
     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 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 @@
     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 @@
 
 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 @@
     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 @@
 
     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 @@
     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 @@
     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 @@
     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.
- */
-- (DOMNode *)currentNode;
-
-/*!
- @method currentText:
- @result The current text in the WebTextIterator.
- */
-- (NSString *)currentText;
-
-/*!
- @method atEnd:
+ @method atEnd
  @result YES if the WebTextIterator has reached the end of the DOMRange.
  */
 - (BOOL)atEnd;
 
+/*!
+ @method currentRange
+ @result A range, indicating the position within the document of the current text.
+ */
+- (DOMRange *)currentRange;
+
+/*!
+ @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.
+ */
+- (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
++ (void)initialize
 {
-    delete m_textIterator;
-    [super dealloc];
-}
-
-- (void)finalize
-{
-    delete m_textIterator;
-    [super finalize];
+#ifndef BUILDING_ON_TIGER
+    WebCoreObjCFinalizeOnMainThread(self);
+#endif
 }
 
 @end
@@ -70,39 +67,47 @@
         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();
-}
-
-- (DOMNode *)currentNode
-{
-    ASSERT(_private->m_textIterator);
-    
-    return [DOMNode _wrapNode:_private->m_textIterator->node()];
-}
-
-- (NSString *)currentText
-{
-    ASSERT(_private->m_textIterator);
-    
-    return [NSString stringWithCharacters:_private->m_textIterator->characters() length:_private->m_textIterator->length()];
+    _private->_textIterator->advance();
 }
 
 - (BOOL)atEnd
 {
-    ASSERT(_private->m_textIterator);
-    
-    return _private->m_textIterator->atEnd();
+    return _private->_textIterator->atEnd();
+}
+
+- (DOMRange *)currentRange
+{
+    return [DOMRange _wrapRange:_private->_textIterator->range().get()];
+}
+
+- (const unichar *)currentTextPointer
+{
+    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 @@
     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 @@
 - (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(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 @@
     BOOL allowsUndo;
         
     float zoomMultiplier;
-    BOOL zoomMultiplierIsTextOnly;
 
     NSString *applicationNameForUserAgent;
     String userAgent;
@@ -375,6 +385,7 @@
     NSInteger spellCheckerDocumentTag;
 
     BOOL smartInsertDeleteEnabled;
+    BOOL selectTrailingWhitespaceEnabled;
         
 #if ENABLE(DASHBOARD_SUPPORT)
     BOOL dashboardBehaviorAlwaysSendMouseEventsToAllWindows;
@@ -411,6 +422,8 @@
 @interface WebView (WebCallDelegateFunctions)
 @end
 
+static void patchMailRemoveAttributesMethod();
+
 NSString *WebElementDOMNodeKey =            @"WebElementDOMNode";
 NSString *WebElementFrameKey =              @"WebElementFrame";
 NSString *WebElementImageKey =              @"WebElementImage";
@@ -470,12 +483,13 @@
 
 @implementation WebViewPrivate
 
-#ifndef BUILDING_ON_TIGER
 + (void)initialize
 {
+    JSC::initializeThreading();
+#ifndef BUILDING_ON_TIGER
     WebCoreObjCFinalizeOnMainThread(self);
-}
 #endif
+}
 
 - init 
 {
@@ -485,7 +499,6 @@
     JSC::initializeThreading();
     allowsUndo = YES;
     zoomMultiplier = 1;
-    zoomMultiplierIsTextOnly = YES;
 #if ENABLE(DASHBOARD_SUPPORT)
     dashboardBehaviorAllowWheelScrolling = YES;
 #endif
@@ -665,6 +678,8 @@
 
 - (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
 {
+    WebCoreThreadViolationCheck();
+
 #ifndef NDEBUG
     WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
 #endif
@@ -689,12 +704,17 @@
         [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 @@
 
 #ifndef NDEBUG
     // Need this to make leak messages accurate.
-    if (applicationIsTerminating)
+    if (applicationIsTerminating) {
         gcController().garbageCollectNow();
+        [WebCache empty];
+    }
 #endif
 }
 
@@ -1285,6 +1307,8 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     [[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 @@
     _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 @@
     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 @@
 
 - (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 @@
     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 @@
 
 - (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 @@
 
 - (float)_zoomMultiplier:(BOOL)isTextOnly
 {
-    if (isTextOnly != _private->zoomMultiplierIsTextOnly)
+    if (isTextOnly != [self _realZoomMultiplierIsTextOnly])
         return 1.0f;
     return _private->zoomMultiplier;
 }
@@ -2688,7 +2787,10 @@
 
 - (BOOL)_realZoomMultiplierIsTextOnly
 {
-    return _private->zoomMultiplierIsTextOnly;
+    if (!_private->page)
+        return NO;
+    
+    return _private->page->settings()->zoomsTextOnly();
 }
 
 #define MinimumZoomMultiplier       0.5f
@@ -2825,7 +2927,7 @@
     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 @@
 
 - (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 @@
     [[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 @@
     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 @@
             }
         }
         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 @@
                 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 @@
         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 @@
 
 - (float)pageSizeMultiplier
 {
-    return !_private->zoomMultiplierIsTextOnly ? _private->zoomMultiplier : 1.0f;
+    return ![self _realZoomMultiplierIsTextOnly] ? _private->zoomMultiplier : 1.0f;
 }
 
 - (BOOL)canZoomPageIn
@@ -3782,6 +3891,20 @@
     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 @@
 - (void)setSmartInsertDeleteEnabled:(BOOL)flag
 {
     _private->smartInsertDeleteEnabled = flag;
+    if (flag)
+        [self setSelectTrailingWhitespaceEnabled:false];
 }
 
 - (BOOL)smartInsertDeleteEnabled
@@ -4298,15 +4423,13 @@
 
         // 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 @@
 
         // 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 @@
         // browsing pattern. Even growth above 128MB can have substantial 
         // value / MB for some content / browsing patterns.)
         if (memSize >= 2048)
-            cacheTotalCapacity = 256 * 1024 * 1024;
-        else if (memSize >= 1536)
-            cacheTotalCapacity = 172 * 1024 * 1024;
-        else if (memSize >= 1024)
             cacheTotalCapacity = 128 * 1024 * 1024;
-        else if (memSize >= 512)
+        else if (memSize >= 1536)
+            cacheTotalCapacity = 96 * 1024 * 1024;
+        else if (memSize >= 1024)
             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 @@
     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 @@
 }
 
 @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 @@
     IMP didLoadResourceFromMemoryCacheFunc;
     IMP willCacheResponseFunc;
     IMP plugInFailedWithErrorFunc;
+    IMP shouldUseCredentialStorageFunc;
 } WebResourceDelegateImplementationCache;
 
 typedef struct _WebFrameLoadDelegateImplementationCache {
@@ -177,6 +178,7 @@
     IMP didFailLoadWithErrorForFrameFunc;
     IMP didFinishLoadForFrameFunc;
     IMP didFirstLayoutInFrameFunc;
+    IMP didFirstVisuallyNonEmptyLayoutInFrameFunc;
     IMP didReceiveIconForFrameFunc;
     IMP didFinishDocumentLoadForFrameFunc;
 } WebFrameLoadDelegateImplementationCache;
@@ -216,4 +218,6 @@
 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 @@
 - (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 @@
 - (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 @@
 - (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 @@
 // Addresses 4192534.  SPI for now.
 - (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame;
 
+- (void)webView:(WebView *)sender didFirstVisuallyNonEmptyLayoutInFrame:(WebFrame *)frame;
+
 @end
 
 @interface NSObject (WebResourceLoadDelegatePrivate)
diff --git a/WebKit/qt/Api/headers.pri b/WebKit/qt/Api/headers.pri
index 1e70072..2b3c940 100644
--- a/WebKit/qt/Api/headers.pri
+++ b/WebKit/qt/Api/headers.pri
@@ -1,11 +1,8 @@
-WEBKIT_API_HEADERS = $$PWD/qcookiejar.h \
-                     $$PWD/qwebframe.h \
+WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
                      $$PWD/qwebkitglobal.h \
-                     $$PWD/qwebnetworkinterface.h \
-                     $$PWD/qwebobjectplugin.h \
-                     $$PWD/qwebobjectpluginconnector.h \
                      $$PWD/qwebpage.h \
                      $$PWD/qwebview.h \
-                     $$PWD/qwebpagehistory.h \
                      $$PWD/qwebsettings.h \
-                     $$PWD/qwebhistoryinterface.h
+                     $$PWD/qwebhistoryinterface.h \
+                     $$PWD/qwebdatabase.h \
+                     $$PWD/qwebsecurityorigin.h
diff --git a/WebKit/qt/Api/qtwebkit.prf b/WebKit/qt/Api/qtwebkit.prf
deleted file mode 100644
index 37417c6..0000000
--- a/WebKit/qt/Api/qtwebkit.prf
+++ /dev/null
@@ -1,4 +0,0 @@
-
-qtAddLibrary(QtWebKit)
-
-QT += network
diff --git a/WebKit/qt/Api/qwebdatabase.cpp b/WebKit/qt/Api/qwebdatabase.cpp
new file mode 100644
index 0000000..489ab17
--- /dev/null
+++ b/WebKit/qt/Api/qwebdatabase.cpp
@@ -0,0 +1,148 @@
+/*
+    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebdatabase.h"
+#include "qwebdatabase_p.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
+#include "DatabaseDetails.h"
+#include "DatabaseTracker.h"
+
+using namespace WebCore;
+
+/*!
+    \class QWebDatabase
+    \since 4.5
+    \brief The QWebDatabase class provides access to HTML 5 databases created with JavaScript.
+
+    The upcoming HTML 5 standard includes support for SQL databases that web sites can create and
+    access on a local computer through JavaScript. QWebDatabase is the C++ interface to these databases.
+
+    For more information refer to the \l{http://www.w3.org/html/wg/html5/#sql}{HTML 5 Draft Standard}.
+
+    \sa QWebSecurityOrigin
+*/
+
+/*!
+    Constructs a web database from \a other.
+*/
+QWebDatabase::QWebDatabase(const QWebDatabase& other) : d(other.d)
+{
+}
+
+/*!
+    Assigns the \a other web database to this.
+*/
+QWebDatabase& QWebDatabase::operator=(const QWebDatabase& other)
+{
+    d = other.d;
+    return *this;
+}
+
+/*!
+    Returns the name of the database.
+*/
+QString QWebDatabase::name() const
+{
+    return d->name;
+}
+
+/*!
+    Returns the name of the database as seen by the user.
+*/
+QString QWebDatabase::displayName() const
+{
+    DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
+    return details.displayName();
+}
+
+/*!
+    Returns the expected size of the database in bytes as defined by the web author.
+*/
+qint64 QWebDatabase::expectedSize() const
+{
+    DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
+    return details.expectedUsage();
+}
+
+/*!
+    Returns the current size of the database in bytes.
+*/
+qint64 QWebDatabase::size() const
+{
+    DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
+    return details.currentUsage();
+}
+
+/*!
+    \internal
+*/
+QWebDatabase::QWebDatabase(QWebDatabasePrivate* priv)
+{
+    d = priv;
+}
+
+/*!
+    Returns the file name of the web database.
+
+    The name can be used to access the database through the QtSql database module, for example:
+    \code
+      QWebDatabase webdb = ...
+      QSqlDatabase sqldb = QSqlDatabase::addDatabase("QSQLITE", "myconnection");
+      sqldb.setDatabaseName(webdb.fileName());
+      if (sqldb.open()) {
+          QStringList tables = sqldb.tables();
+          ...
+      }
+    \endcode
+
+    \note Concurrent access to a database from multiple threads or processes
+    is not very efficient because Sqlite is used as WebKit's database backend.
+*/
+QString QWebDatabase::fileName() const
+{
+    return DatabaseTracker::tracker().fullPathForDatabase(d->origin.get(), d->name, false);
+}
+
+/*!
+    Returns the databases's security origin.
+*/
+QWebSecurityOrigin QWebDatabase::origin() const
+{
+    QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(d->origin.get());
+    QWebSecurityOrigin origin(priv);
+    return origin;
+}
+
+/*!
+    Removes the database, \a db, from its security origin. All data stored in this database
+    will be destroyed.
+*/
+void QWebDatabase::removeDatabase(const QWebDatabase &db)
+{
+    DatabaseTracker::tracker().deleteDatabase(db.d->origin.get(), db.d->name);
+}
+
+/*!
+    Destroys the web database object. The data within this database is \b not destroyed.
+*/
+QWebDatabase::~QWebDatabase()
+{
+}
diff --git a/WebKit/qt/Api/qwebdatabase.h b/WebKit/qt/Api/qwebdatabase.h
new file mode 100644
index 0000000..f4c368a
--- /dev/null
+++ b/WebKit/qt/Api/qwebdatabase.h
@@ -0,0 +1,59 @@
+/*
+    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+#ifndef _WEBDATABASE_H_
+#define _WEBDATABASE_H_
+
+#include <QtCore/qstring.h>
+#include <QtCore/qshareddata.h>
+
+#include "qwebkitglobal.h"
+
+namespace WebCore {
+    class DatabaseDetails;
+};
+
+class QWebDatabasePrivate;
+class QWebSecurityOrigin;
+
+class QWEBKIT_EXPORT QWebDatabase
+{
+public:
+    QWebDatabase(const QWebDatabase& other);
+    QWebDatabase &operator=(const QWebDatabase& other);
+    ~QWebDatabase();
+
+    QString name() const;
+    QString displayName() const;
+    qint64 expectedSize() const;
+    qint64 size() const;
+    QString fileName() const;
+    QWebSecurityOrigin origin() const;
+
+    static void removeDatabase(const QWebDatabase &db);
+
+private:
+    QWebDatabase(QWebDatabasePrivate* priv);
+    friend class QWebSecurityOrigin;
+
+private:
+    QExplicitlySharedDataPointer<QWebDatabasePrivate> d;
+};
+
+#endif
+
diff --git a/WebKit/qt/Api/qwebdatabase_p.h b/WebKit/qt/Api/qwebdatabase_p.h
new file mode 100644
index 0000000..988fb16
--- /dev/null
+++ b/WebKit/qt/Api/qwebdatabase_p.h
@@ -0,0 +1,38 @@
+/*
+    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+#ifndef _WEBDATABASE_P_H_
+#define _WEBDATABASE_P_H_
+
+#include <QString>
+#include <QtCore/qshareddata.h>
+
+#include "PlatformString.h"
+#include "SecurityOrigin.h"
+#include "RefPtr.h"
+
+
+class QWebDatabasePrivate : public QSharedData
+{
+public:
+    WebCore::String name;
+    WTF::RefPtr<WebCore::SecurityOrigin> origin;
+};
+
+#endif
+
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 892949d..4e82d54 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -23,6 +23,8 @@
 #include "qwebpage.h"
 #include "qwebpage_p.h"
 #include "qwebframe_p.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
 
 #include "DocumentLoader.h"
 #include "FocusController.h"
@@ -31,6 +33,7 @@
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "IconDatabase.h"
+#include "InspectorController.h"
 #include "Page.h"
 #include "PutPropertySlot.h"
 #include "ResourceRequest.h"
@@ -41,6 +44,7 @@
 #include "SubstituteData.h"
 
 #include "markup.h"
+#include "htmlediting.h"
 #include "RenderTreeAsText.h"
 #include "Element.h"
 #include "Document.h"
@@ -52,17 +56,19 @@
 #include "GraphicsContext.h"
 #include "HitTestResult.h"
 
+#include "CallFrame.h"
+#include "JSDOMBinding.h"
+#include "JSDOMWindow.h"
+#include "JSLock.h"
+#include "JSObject.h"
+#include "qt_instance.h"
+#include "qt_runtime.h"
 #include "runtime.h"
 #include "runtime_object.h"
 #include "runtime_root.h"
-#include "JSDOMWindow.h"
-#include "qt_instance.h"
 #include "ScriptController.h"
-#include "JSDOMBinding.h"
-#include "ExecState.h"
-#include "JSLock.h"
-#include "JSObject.h"
-#include "qt_runtime.h"
+#include "ScriptSourceCode.h"
+#include "ScriptValue.h"
 
 #include "wtf/HashMap.h"
 
@@ -70,6 +76,7 @@
 #include <qevent.h>
 #include <qfileinfo.h>
 #include <qpainter.h>
+#include <QMultiMap>
 #if QT_VERSION >= 0x040400
 #include <qnetworkrequest.h>
 #else
@@ -77,6 +84,8 @@
 #endif
 #include <qregion.h>
 #include <qprinter.h>
+#include "HTMLMetaElement.h"
+#include "NodeList.h"
 
 using namespace WebCore;
 
@@ -85,6 +94,18 @@
 extern Q_GUI_EXPORT int qt_defaultDpi();
 QT_END_NAMESPACE
 
+void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* qframe, bool enabled)
+{
+    Frame* frame = QWebFramePrivate::core(qframe);
+    InspectorController* controller = frame->page()->inspectorController();
+    if (!controller)
+        return;
+    if (enabled)
+        controller->enableProfiler();
+    else
+        controller->disableProfiler();
+}
+
 void QWebFramePrivate::init(QWebFrame *qframe, WebCore::Page *webcorePage, QWebFrameData *frameData)
 {
     q = qframe;
@@ -96,9 +117,17 @@
     frameLoaderClient = new FrameLoaderClientQt();
     RefPtr<Frame> newFrame = Frame::create(webcorePage, frameData->ownerElement, frameLoaderClient);
     frame = newFrame.get();
-    if (frameData->ownerElement)
-        frame->ref(); // balanced by adoptRef in FrameLoaderClientQt::createFrame
     frameLoaderClient->setFrame(qframe, frame);
+
+    // FIXME: All of the below should probably be moved over into WebCore
+    frame->tree()->setName(frameData->name);
+    if (QWebFrame* _parentFrame = parentFrame())
+        QWebFramePrivate::core(_parentFrame)->tree()->appendChild(frame);
+
+    // balanced by adoptRef in FrameLoaderClientQt::createFrame
+    if (frameData->ownerElement)
+        frame->ref();
+
     frame->init();
 }
 
@@ -116,16 +145,34 @@
     return frame->view()->verticalScrollbar();
 }
 
-void QWebFramePrivate::updateBackground()
+void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip, bool contents)
 {
-    WebCore::FrameView *view = frame->view();
-    if (!view)
+    if (!frame->view() || !frame->contentRenderer())
         return;
-    QBrush brush = page->palette().brush(QPalette::Background);
-    if (brush.style() == Qt::SolidPattern) {
-        view->setBaseBackgroundColor(brush.color());
-        if (!brush.color().alpha())
-            view->setTransparent(true);
+
+    QVector<QRect> vector = clip.rects();
+    if (vector.isEmpty())
+        return;
+
+    WebCore::FrameView* view = frame->view();
+    view->layoutIfNeededRecursive();
+
+    GraphicsContext context(painter);
+
+    if (!contents)
+        view->paint(&context, vector.first());
+    else
+        view->paintContents(&context, vector.first());
+
+    for (int i = 1; i < vector.size(); ++i) {
+        const QRect& clipRect = vector.at(i);
+        painter->save();
+        painter->setClipRect(clipRect, Qt::IntersectClip);
+        if (!contents)
+            view->paint(&context, clipRect);
+        else
+            view->paintContents(&context, clipRect);
+        painter->restore();
     }
 }
 
@@ -222,7 +269,7 @@
       JSC::ExecState* exec = window->globalExec();
 
       JSC::JSObject *runtimeObject =
-        JSC::Bindings::Instance::createRuntimeObject(exec, JSC::Bindings::QtInstance::getQtInstance(object, root));
+          JSC::Bindings::QtInstance::getQtInstance(object, root)->createRuntimeObject(exec);
 
       JSC::PutPropertySlot slot;
       window->put(exec, JSC::Identifier(exec, (const UChar *) name.constData(), name.length()), runtimeObject, slot);
@@ -280,6 +327,53 @@
     else return QString();
 }
 
+/*!
+    \since 4.5
+    \brief Returns the meta data in this frame as a QMultiMap
+
+    The meta data consists of the name and content attributes of the
+    of the \c{<meta>} tags in the HTML document.
+
+    For example:
+
+    \code
+    <html>
+        <head>
+            <meta name="description" content="This document is a tutorial about Qt development">
+            <meta name="keywords" content="Qt, WebKit, Programming">
+        </head>
+        ...
+    </html>
+    \endcode
+
+    Given the above HTML code the metaData() function will return a map with two entries:
+    \table
+    \header \o Key
+            \o Value
+    \row    \o "description"
+            \o "This document is a tutorial about Qt development"
+    \row    \o "keywords"
+            \o "Qt, WebKit, Programming"
+    \endtable
+
+    This function returns a multi map to support multiple meta tags with the same attribute name.
+*/
+QMultiMap<QString, QString> QWebFrame::metaData() const
+{
+    if(!d->frame->document())
+       return QMap<QString,QString>();
+
+    QMultiMap<QString,QString> map;
+    Document* doc = d->frame->document();
+    RefPtr<NodeList> list = doc->getElementsByTagName("meta");
+    unsigned len = list->length();
+    for (unsigned i = 0; i < len; i++) {
+        HTMLMetaElement* meta = static_cast<HTMLMetaElement*>(list->item(i));
+        map.insert(meta->name(), meta->content());
+    }
+    return map;
+}
+
 static inline QUrl ensureAbsoluteUrl(const QUrl &url)
 {
     if (!url.isRelative())
@@ -446,7 +540,7 @@
 
 /*!
   Sets the content of this frame to \a html. \a baseUrl is optional and used to resolve relative
-  URLs in the document.
+  URLs in the document, such as referenced images or stylesheets.
 
   When using this method WebKit assumes that external resources such as JavaScript programs or style
   sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external
@@ -542,12 +636,16 @@
 
     if (orientation == Qt::Horizontal) {
         d->horizontalScrollBarPolicy = policy;
-        if (d->frame->view())
+        if (d->frame->view()) {
             d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
+            d->frame->view()->updateDefaultScrollbarState();
+        }
     } else {
         d->verticalScrollBarPolicy = policy;
-        if (d->frame->view())
+        if (d->frame->view()) {
             d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
+            d->frame->view()->updateDefaultScrollbarState();
+        }
     }
 }
 
@@ -617,14 +715,29 @@
 }
 
 /*!
+  \since 4.6
+  Returns the geometry for the scrollbar with orientation \a orientation.
+
+  If the scrollbar does not exist an empty rect is returned.
+*/
+QRect QWebFrame::scrollBarGeometry(Qt::Orientation orientation) const
+{
+    Scrollbar *sb;
+    sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar();
+    if (sb)
+        return sb->frameRect();
+    return QRect();
+}
+
+/*!
   \since 4.5
   Scrolls the frame \a dx pixels to the right and \a dy pixels downward. Both
   \a dx and \a dy may be negative.
   
-  \sa QWebFrame::scrollOffset
+  \sa QWebFrame::scrollPosition
 */
 
-void QWebFrame::scroll(int dx, int dy) const
+void QWebFrame::scroll(int dx, int dy)
 {
     if (!d->frame->view())
         return;
@@ -633,23 +746,25 @@
 }
 
 /*!
-  \property QWebFrame::scrollOffset
-  \brief The offset from the start this frame is currently scrolled to.
+  \property QWebFrame::scrollPosition
+  \since 4.5
+  \brief the position the frame is currently scrolled to.
 */
 
-QSize QWebFrame::scrollOffset() const
+QPoint QWebFrame::scrollPosition() const
 {
     if (!d->frame->view())
-        return QSize(0,0);
+        return QPoint(0,0);
 
-    return d->frame->view()->scrollOffset();
+    IntSize ofs = d->frame->view()->scrollOffset();
+    return QPoint(ofs.width(), ofs.height());
 }
 
-void QWebFrame::setScrollOffset(const QSize &offset) const
+void QWebFrame::setScrollPosition(const QPoint &pos)
 {
-    QSize current = scrollOffset();
-    int dx = offset.width() - current.width();
-    int dy = offset.height() - current.height();
+    QPoint current = scrollPosition();
+    int dx = pos.x() - current.x();
+    int dy = pos.y() - current.y();
     scroll(dx, dy);
 }
 
@@ -660,25 +775,7 @@
 */
 void QWebFrame::render(QPainter *painter, const QRegion &clip)
 {
-    if (!d->frame->view() || !d->frame->contentRenderer())
-        return;
-
-    d->frame->view()->layoutIfNeededRecursive();
-
-    GraphicsContext ctx(painter);
-    QVector<QRect> vector = clip.rects();
-    WebCore::FrameView* view = d->frame->view();
-    for (int i = 0; i < vector.size(); ++i) {
-        if (i > 0) {
-            painter->save();
-            painter->setClipRect(vector.at(i), Qt::IntersectClip);
-        }
-
-        view->paint(&ctx, vector.at(i));
-
-        if (i > 0)
-            painter->restore();
-    }
+    d->renderPrivate(painter, clip);
 }
 
 /*!
@@ -686,14 +783,19 @@
 */
 void QWebFrame::render(QPainter *painter)
 {
-    if (!d->frame->view() || !d->frame->contentRenderer())
+    if (!d->frame->view())
         return;
 
-    d->frame->view()->layoutIfNeededRecursive();
+    d->renderPrivate(painter, QRegion(d->frame->view()->frameRect()));
+}
 
-    GraphicsContext ctx(painter);
-    WebCore::FrameView* view = d->frame->view();
-    view->paint(&ctx, view->frameRect());
+/*!
+  \since 4.6
+  Render the frame's \a contents into \a painter while clipping to \a contents.
+*/
+void QWebFrame::renderContents(QPainter *painter, const QRegion &contents)
+{
+    d->renderPrivate(painter, contents, true);
 }
 
 /*!
@@ -708,11 +810,18 @@
     QWebSettings.
 */
 
+/*!
+    Sets the value of the multiplier used to scale the text in a Web frame to
+    the \a factor specified.
+*/
 void QWebFrame::setTextSizeMultiplier(qreal factor)
 {
     d->frame->setZoomFactor(factor, /*isTextOnly*/true);
 }
 
+/*!
+    Returns the value of the multiplier used to scale the text in a Web frame.
+*/
 qreal QWebFrame::textSizeMultiplier() const
 {
     return d->frame->zoomFactor();
@@ -758,6 +867,8 @@
 /*!
     \property QWebFrame::contentsSize
     \brief the size of the contents in this frame
+
+    \sa contentsSizeChanged
 */
 QSize QWebFrame::contentsSize() const
 {
@@ -886,7 +997,7 @@
     ScriptController *proxy = d->frame->script();
     QVariant rc;
     if (proxy) {
-        JSC::JSValue* v = proxy->evaluate(String(), 1, scriptSource);
+        JSC::JSValuePtr v = proxy->evaluate(ScriptSourceCode(scriptSource)).jsValue();
         if (v) {
             int distance = 0;
             rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject()->globalExec(), v, QMetaType::Void, &distance);
@@ -895,6 +1006,18 @@
     return rc;
 }
 
+/*!
+    \since 4.5
+
+    Returns the frame's security origin.
+*/
+QWebSecurityOrigin QWebFrame::securityOrigin() const
+{
+    QWebFrame* that = const_cast<QWebFrame*>(this);
+    QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(QWebFramePrivate::core(that)->document()->securityOrigin());
+    return QWebSecurityOrigin(priv);
+}
+
 WebCore::Frame* QWebFramePrivate::core(QWebFrame* webFrame)
 {
     return webFrame->d->frame;
@@ -960,14 +1083,12 @@
 */
 
 /*!
-  \since 4.5
-  \fn void QWebFrame::aboutToUpdateHistory(QWebHistoryItem* item);
+  \fn void QWebFrame::contentsSizeChanged(const QSize &size)
+  \since 4.6
 
-  This signal is emitted shortly before the history of navigated pages
-  is changed, for example when navigating back in the history.
+  This signal is emitted when the frame's contents size changes.
 
-  A potential use-case for this signal is to store custom data in
-  the QWebHistoryItem associated to the frame, using QWebHistoryItem::setUserData().
+  \sa contentsSize()
 */
 
 /*!
@@ -991,6 +1112,7 @@
 QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest)
     : isContentEditable(false)
     , isContentSelected(false)
+    , isScrollBar(false)
 {
     if (!hitTest.innerNode())
         return;
@@ -1002,6 +1124,7 @@
     linkTitle = hitTest.titleDisplayString();
     alternateText = hitTest.altDisplayString();
     imageUrl = hitTest.absoluteImageURL();
+    innerNode = hitTest.innerNode();
     innerNonSharedNode = hitTest.innerNonSharedNode();
     WebCore::Image *img = hitTest.image();
     if (img) {
@@ -1015,10 +1138,20 @@
 
     isContentEditable = hitTest.isContentEditable();
     isContentSelected = hitTest.isSelected();
+    isScrollBar = hitTest.scrollbar();
 
     if (innerNonSharedNode && innerNonSharedNode->document()
         && innerNonSharedNode->document()->frame())
         frame = QWebFramePrivate::kit(innerNonSharedNode->document()->frame());
+
+    if (Node *block = WebCore::enclosingBlock(innerNode.get())) {
+        RenderObject *renderBlock = block->renderer();
+        while (renderBlock && renderBlock->isListItem())
+            renderBlock = renderBlock->containingBlock();
+
+        if (renderBlock)
+            enclosingBlock = renderBlock->absoluteClippedOverflowRect();
+    }
 }
 
 /*!
@@ -1085,7 +1218,7 @@
 
 /*!
     \since 4.5
-    Returns the bounding box of the element.
+    Returns the bounding rect of the element.
 */
 QRect QWebHitTestResult::boundingRect() const
 {
@@ -1095,6 +1228,17 @@
 }
 
 /*!
+    \since 4.6
+    Returns the rect of the smallest enclosing block element.
+*/
+QRect QWebHitTestResult::enclosingBlock() const
+{
+    if (!d)
+        return QRect();
+    return d->enclosingBlock;
+}
+
+/*!
     Returns the title of the nearest enclosing HTML element.
 */
 QString QWebHitTestResult::title() const
@@ -1205,3 +1349,13 @@
     return d->frame;
 }
 
+/*!
+    \since 4.6
+    Returns true if the test includes a scrollbar.
+*/
+bool QWebHitTestResult::isScrollBar() const
+{
+    if (!d)
+        return false;
+    return d->isScrollBar;
+}
diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h
index 4d37205..e53e2b5 100644
--- a/WebKit/qt/Api/qwebframe.h
+++ b/WebKit/qt/Api/qwebframe.h
@@ -47,6 +47,7 @@
 class QWebPage;
 class QWebHitTestResult;
 class QWebHistoryItem;
+class QWebSecurityOrigin;
 
 namespace WebCore {
     class WidgetPrivate;
@@ -69,6 +70,7 @@
 
     QPoint pos() const;
     QRect boundingRect() const;
+    QRect enclosingBlock() const;
     QString title() const;
 
     QString linkText() const;
@@ -86,6 +88,8 @@
 
     QWebFrame *frame() const;
 
+    bool isScrollBar() const;
+
 private:
     QWebHitTestResult(QWebHitTestResultPrivate *priv);
     QWebHitTestResultPrivate *d;
@@ -104,7 +108,7 @@
     Q_PROPERTY(QUrl url READ url WRITE setUrl)
     Q_PROPERTY(QIcon icon READ icon)
     Q_PROPERTY(QSize contentsSize READ contentsSize)
-    Q_PROPERTY(QSize scrollOffset READ scrollOffset WRITE setScrollOffset)
+    Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition)
 private:
     QWebFrame(QWebPage *parent, QWebFrameData *frameData);
     QWebFrame(QWebFrame *parent, QWebFrameData *frameData);
@@ -133,6 +137,7 @@
     void setUrl(const QUrl &url);
     QUrl url() const;
     QIcon icon() const;
+    QMultiMap<QString, QString> metaData() const;
 
     QString frameName() const;
 
@@ -146,13 +151,15 @@
     int scrollBarValue(Qt::Orientation orientation) const;
     int scrollBarMinimum(Qt::Orientation orientation) const;
     int scrollBarMaximum(Qt::Orientation orientation) const;
+    QRect scrollBarGeometry(Qt::Orientation orientation) const;
 
-    void scroll(int, int) const;
-    QSize scrollOffset() const;
-    void setScrollOffset(const QSize &offset) const;
+    void scroll(int, int);
+    QPoint scrollPosition() const;
+    void setScrollPosition(const QPoint &pos);
 
     void render(QPainter *painter, const QRegion &clip);
     void render(QPainter *painter);
+    void renderContents(QPainter *painter, const QRegion &contents);
 
     void setTextSizeMultiplier(qreal factor);
     qreal textSizeMultiplier() const;
@@ -168,6 +175,8 @@
 
     virtual bool event(QEvent *);
 
+    QWebSecurityOrigin securityOrigin() const;
+
 public Q_SLOTS:
     QVariant evaluateJavaScript(const QString& scriptSource);
 #ifndef QT_NO_PRINTER
@@ -185,7 +194,7 @@
 
     void iconChanged();
 
-    void aboutToUpdateHistory(QWebHistoryItem* item);
+    void contentsSizeChanged(const QSize &size);
 
 private:
     friend class QWebPage;
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 2b497e6..30f94cf 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -78,11 +78,11 @@
     Qt::ScrollBarPolicy horizontalScrollBarPolicy;
     Qt::ScrollBarPolicy verticalScrollBarPolicy; 
 
-    void updateBackground();
-
     static WebCore::Frame* core(QWebFrame*);
     static QWebFrame* kit(WebCore::Frame*);
 
+    void renderPrivate(QPainter *painter, const QRegion &clip, bool contents = false);
+
     QWebFrame *q;
     WebCore::FrameLoaderClientQt *frameLoaderClient;
     WebCore::Frame *frame;
@@ -96,11 +96,12 @@
 class QWebHitTestResultPrivate
 {
 public:
-    QWebHitTestResultPrivate() : isContentEditable(false), isContentSelected(false) {}
+    QWebHitTestResultPrivate() : isContentEditable(false), isContentSelected(false), isScrollBar(false) {}
     QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest);
 
     QPoint pos;
     QRect boundingRect;
+    QRect enclosingBlock;
     QString title;
     QString linkText;
     QUrl linkUrl;
@@ -111,7 +112,9 @@
     QPixmap pixmap;
     bool isContentEditable;
     bool isContentSelected;
+    bool isScrollBar;
     QPointer<QWebFrame> frame;
+    RefPtr<WebCore::Node> innerNode;
     RefPtr<WebCore::Node> innerNonSharedNode;
 };
 
diff --git a/WebKit/qt/Api/qwebhistory.cpp b/WebKit/qt/Api/qwebhistory.cpp
index 962aeb2..07d027d 100644
--- a/WebKit/qt/Api/qwebhistory.cpp
+++ b/WebKit/qt/Api/qwebhistory.cpp
@@ -23,6 +23,7 @@
 
 #include "PlatformString.h"
 #include "Image.h"
+#include "KURL.h"
 #include "Page.h"
 #include "PageGroup.h"
 
@@ -160,7 +161,7 @@
 /*!
   \since 4.5
 
- Stores user specific data with the history item.
+ Stores user specific data \a userData with the history item.
 
  \sa userData()
 */
@@ -431,7 +432,7 @@
 
 /*!
   \since 4.5
-  Sets the maximum number of items in the history.
+  Sets the maximum number of items in the history to \a count.
 
   \sa maximumItemCount()
 */
diff --git a/WebKit/qt/Api/qwebhistory.h b/WebKit/qt/Api/qwebhistory.h
index 2747c90..c39077d 100644
--- a/WebKit/qt/Api/qwebhistory.h
+++ b/WebKit/qt/Api/qwebhistory.h
@@ -32,7 +32,7 @@
 
 namespace WebCore {
     class FrameLoaderClientQt;
-};
+}
 
 class QWebHistoryItemPrivate;
 class QWEBKIT_EXPORT QWebHistoryItem
diff --git a/WebKit/qt/Api/qwebkitglobal.h b/WebKit/qt/Api/qwebkitglobal.h
index 2486fb6..19d9218 100644
--- a/WebKit/qt/Api/qwebkitglobal.h
+++ b/WebKit/qt/Api/qwebkitglobal.h
@@ -23,15 +23,29 @@
 #include <QtCore/qglobal.h>
 
 #if defined(Q_OS_WIN)
+#  if defined(QT_NODLL)
+#    undef QT_MAKEDLL
+#    undef QT_DLL
+#  elif defined(QT_MAKEDLL)        /* create a Qt DLL library */
+#    if defined(QT_DLL)
+#      undef QT_DLL
+#    endif
 #    if defined(BUILD_WEBKIT)
 #        define QWEBKIT_EXPORT Q_DECL_EXPORT
 #    else
 #        define QWEBKIT_EXPORT Q_DECL_IMPORT
 #    endif
+#  elif defined(QT_DLL) /* use a Qt DLL library */
+#    define QWEBKIT_EXPORT Q_DECL_IMPORT
+#  endif
 #endif
 
 #if !defined(QWEBKIT_EXPORT)
-#define QWEBKIT_EXPORT Q_DECL_EXPORT
+#  if defined(QT_SHARED)
+#    define QWEBKIT_EXPORT Q_DECL_EXPORT
+#  else
+#    define QWEBKIT_EXPORT
+#  endif
 #endif
 
 #if QT_VERSION < 0x040400
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index b7285d6..df40fa6 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+    Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies)
     Copyright (C) 2007 Staikos Computing Services Inc.
     Copyright (C) 2007 Apple Inc.
 
@@ -31,6 +31,7 @@
 
 #include "Frame.h"
 #include "FrameTree.h"
+#include "FrameLoader.h"
 #include "FrameLoaderClientQt.h"
 #include "FrameView.h"
 #include "ChromeClientQt.h"
@@ -95,6 +96,22 @@
 
 using namespace WebCore;
 
+bool QWebPagePrivate::drtRun = false;
+void QWEBKIT_EXPORT qt_drt_run(bool b)
+{
+    QWebPagePrivate::drtRun = b;
+}
+
+void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName)
+{
+    page->handle()->page->setGroupName(groupName);
+}
+
+QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
+{
+    return page->handle()->page->groupName();
+}
+
 // Lookup table mapping QWebPage::WebActions to the associated Editor commands
 static const char* editorCommandWebActions[] = 
 {
@@ -161,11 +178,13 @@
     "InsertNewline", // InsertParagraphSeparator
     "InsertLineBreak", // InsertLineSeparator
 
+    "SelectAll", // SelectAll
+
     0 // WebActionCount
 };
 
 // Lookup the appropriate editor command to use for WebAction \a action
-static const char* editorCommandForWebActions(QWebPage::WebAction action)
+const char* QWebPagePrivate::editorCommandForWebActions(QWebPage::WebAction action)
 {
     if ((action > QWebPage::NoWebAction) && (action < int(sizeof(editorCommandWebActions) / sizeof(const char*))))
         return editorCommandWebActions[action];
@@ -220,6 +239,7 @@
     WebCore::InitializeLoggingChannelsIfNecessary();
     WebCore::PageGroup::setShouldTrackVisitedLinks(true);
     JSC::initializeThreading();
+    WebCore::FrameLoader::setLocalLoadPolicy(WebCore::FrameLoader::AllowLocalLoadsForLocalAndSubstituteData);
 
     chromeClient = new ChromeClientQt(q);
     contextMenuClient = new ContextMenuClientQt();
@@ -245,6 +265,7 @@
     insideOpenCall = false;
     forwardUnsupportedContent = false;
     editable = false;
+    useFixedLayout = false;
     linkPolicy = QWebPage::DontDelegateLinks;
 #ifndef QT_NO_CONTEXTMENU
     currentContextMenu = 0;
@@ -448,6 +469,35 @@
             // those two are handled by QUndoStack
             break;
 #endif // QT_NO_UNDOSTACK
+        case QWebPage::MoveToNextChar:
+        case QWebPage::MoveToPreviousChar:
+        case QWebPage::MoveToNextWord:
+        case QWebPage::MoveToPreviousWord:
+        case QWebPage::MoveToNextLine:
+        case QWebPage::MoveToPreviousLine:
+        case QWebPage::MoveToStartOfLine:
+        case QWebPage::MoveToEndOfLine:
+        case QWebPage::MoveToStartOfBlock:
+        case QWebPage::MoveToEndOfBlock:
+        case QWebPage::MoveToStartOfDocument:
+        case QWebPage::MoveToEndOfDocument:
+        case QWebPage::SelectNextChar:
+        case QWebPage::SelectPreviousChar:
+        case QWebPage::SelectNextWord:
+        case QWebPage::SelectPreviousWord:
+        case QWebPage::SelectNextLine:
+        case QWebPage::SelectPreviousLine:
+        case QWebPage::SelectStartOfLine:
+        case QWebPage::SelectEndOfLine:
+        case QWebPage::SelectStartOfBlock:
+        case QWebPage::SelectEndOfBlock:
+        case QWebPage::SelectStartOfDocument:
+        case QWebPage::SelectEndOfDocument:
+        case QWebPage::DeleteStartOfWord:
+        case QWebPage::DeleteEndOfWord:
+        case QWebPage::SetTextDirectionDefault:
+        case QWebPage::SetTextDirectionLeftToRight:
+        case QWebPage::SetTextDirectionRightToLeft:
         case QWebPage::ToggleBold:
         case QWebPage::ToggleItalic:
         case QWebPage::ToggleUnderline:
@@ -479,6 +529,35 @@
     updateAction(QWebPage::Cut);
     updateAction(QWebPage::Copy);
     updateAction(QWebPage::Paste);
+    updateAction(QWebPage::MoveToNextChar);
+    updateAction(QWebPage::MoveToPreviousChar);
+    updateAction(QWebPage::MoveToNextWord);
+    updateAction(QWebPage::MoveToPreviousWord);
+    updateAction(QWebPage::MoveToNextLine);
+    updateAction(QWebPage::MoveToPreviousLine);
+    updateAction(QWebPage::MoveToStartOfLine);
+    updateAction(QWebPage::MoveToEndOfLine);
+    updateAction(QWebPage::MoveToStartOfBlock);
+    updateAction(QWebPage::MoveToEndOfBlock);
+    updateAction(QWebPage::MoveToStartOfDocument);
+    updateAction(QWebPage::MoveToEndOfDocument);
+    updateAction(QWebPage::SelectNextChar);
+    updateAction(QWebPage::SelectPreviousChar);
+    updateAction(QWebPage::SelectNextWord);
+    updateAction(QWebPage::SelectPreviousWord);
+    updateAction(QWebPage::SelectNextLine);
+    updateAction(QWebPage::SelectPreviousLine);
+    updateAction(QWebPage::SelectStartOfLine);
+    updateAction(QWebPage::SelectEndOfLine);
+    updateAction(QWebPage::SelectStartOfBlock);
+    updateAction(QWebPage::SelectEndOfBlock);
+    updateAction(QWebPage::SelectStartOfDocument);
+    updateAction(QWebPage::SelectEndOfDocument);
+    updateAction(QWebPage::DeleteStartOfWord);
+    updateAction(QWebPage::DeleteEndOfWord);
+    updateAction(QWebPage::SetTextDirectionDefault);
+    updateAction(QWebPage::SetTextDirectionLeftToRight);
+    updateAction(QWebPage::SetTextDirectionRightToLeft);
     updateAction(QWebPage::ToggleBold);
     updateAction(QWebPage::ToggleItalic);
     updateAction(QWebPage::ToggleUnderline);
@@ -516,7 +595,11 @@
         return;
     }
 
-    bool accepted = frame->eventHandler()->handleMousePressEvent(PlatformMouseEvent(ev, 1));
+    bool accepted = false;
+    PlatformMouseEvent mev(ev, 1);
+    // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+    if (mev.button() != NoButton)
+        accepted = frame->eventHandler()->handleMousePressEvent(mev);
     ev->setAccepted(accepted);
 }
 
@@ -526,7 +609,11 @@
     if (!frame->view())
         return;
 
-    bool accepted = frame->eventHandler()->handleMousePressEvent(PlatformMouseEvent(ev, 2));
+    bool accepted = false;
+    PlatformMouseEvent mev(ev, 2);
+    // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+    if (mev.button() != NoButton)
+        accepted = frame->eventHandler()->handleMousePressEvent(mev);
     ev->setAccepted(accepted);
 
     tripleClickTimer.start(QApplication::doubleClickInterval(), q);
@@ -539,7 +626,11 @@
     if (!frame->view())
         return;
 
-    bool accepted = frame->eventHandler()->handleMousePressEvent(PlatformMouseEvent(ev, 3));
+    bool accepted = false;
+    PlatformMouseEvent mev(ev, 3);
+    // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+    if (mev.button() != NoButton)
+        accepted = frame->eventHandler()->handleMousePressEvent(mev);
     ev->setAccepted(accepted);
 }
 
@@ -549,7 +640,11 @@
     if (!frame->view())
         return;
 
-    bool accepted = frame->eventHandler()->handleMouseReleaseEvent(PlatformMouseEvent(ev, 0));
+    bool accepted = false;
+    PlatformMouseEvent mev(ev, 0);
+    // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+    if (mev.button() != NoButton)
+        accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
     ev->setAccepted(accepted);
 
 #ifndef QT_NO_CLIPBOARD
@@ -616,7 +711,7 @@
 #endif // QT_NO_WHEELEVENT
 
 #ifndef QT_NO_SHORTCUT
-static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event)
+QWebPage::WebAction QWebPagePrivate::editorActionForKeyEvent(QKeyEvent* event)
 {
     static struct {
         QKeySequence::StandardKey standardKey;
@@ -657,6 +752,7 @@
         { QKeySequence::InsertParagraphSeparator, QWebPage::InsertParagraphSeparator },
         { QKeySequence::InsertLineSeparator, QWebPage::InsertLineSeparator },
 #endif
+        { QKeySequence::SelectAll, QWebPage::SelectAll },
         { QKeySequence::UnknownKey, QWebPage::NoWebAction }
     };
 
@@ -673,20 +769,9 @@
     bool handled = false;
     WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
     WebCore::Editor* editor = frame->editor();
-#ifndef QT_NO_SHORTCUT
-    if (editor->canEdit()) {
-        QWebPage::WebAction action = editorActionForKeyEvent(ev);
-        if (action != QWebPage::NoWebAction) {
-            q->triggerAction(action);
-            handled = true;
-        }
-    } else {
-        if (ev == QKeySequence::Copy) {
-            q->triggerAction(QWebPage::Copy);
-            handled = true;
-        }
-    }
-#endif // QT_NO_SHORTCUT
+    // we forward the key event to WebCore first to handle potential DOM
+    // defined event handlers and later on end up in EditorClientQt::handleKeyboardEvent
+    // to trigger editor commands via triggerAction().
     if (!handled)
         handled = frame->eventHandler()->keyEvent(ev);
     if (!handled) {
@@ -727,9 +812,6 @@
 
 void QWebPagePrivate::focusInEvent(QFocusEvent *ev)
 {
-    if (ev->reason() == Qt::PopupFocusReason)
-        return;
-
     FocusController *focusController = page->focusController();
     Frame *frame = focusController->focusedFrame();
     focusController->setActive(true);
@@ -742,9 +824,6 @@
 
 void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
 {
-    if (ev->reason() == Qt::PopupFocusReason)
-        return;
-
     // only set the focused frame inactive so that we stop painting the caret
     // and the focus frame. But don't tell the focus controller so that upon
     // focusInEvent() we can re-activate the frame.
@@ -813,15 +892,19 @@
     \property QWebPage::palette
     \brief the page's palette
 
-    The background brush of the palette is used to draw the background of the main frame.
+    The base brush of the palette is used to draw the background of the main frame.
 
     By default, this property contains the application's default palette.
 */
 void QWebPage::setPalette(const QPalette &pal)
 {
     d->palette = pal;
-    if (d->mainFrame)
-        d->mainFrame->d->updateBackground();
+    if (!d->mainFrame || !d->mainFrame->d->frame->view())
+        return;
+
+    QBrush brush = pal.brush(QPalette::Base);
+    QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor();
+    QWebFramePrivate::core(d->mainFrame)->view()->updateBackgroundRecursively(backgroundColor, !backgroundColor.alpha());
 }
 
 QPalette QWebPage::palette() const
@@ -956,7 +1039,7 @@
     case Qt::ImMicroFocus: {
         Frame *frame = d->page->focusController()->focusedFrame();
         if (frame) {
-            return QVariant(frame->selection()->caretRect());
+            return QVariant(frame->selection()->absoluteCaretBounds());
         }
         return QVariant();
     }
@@ -1035,6 +1118,10 @@
 /*!
     \enum QWebPage::WebAction
 
+    This enum describes the types of action which can be performed on the web page.
+    Actions which are related to text editing, cursor movement, and text selection
+    only have an effect if \l contentEditable is true.
+
     \value NoWebAction No action is triggered.
     \value OpenLink Open the current link.
     \value OpenLinkInNewWindow Open the current link in a new window.
@@ -1088,6 +1175,7 @@
     \value InspectElement Show the Web Inspector with the currently highlighted HTML element.
     \value InsertParagraphSeparator Insert a new paragraph.
     \value InsertLineSeparator Insert a new line.
+    \value SelectAll Selects all content.
     \omitvalue WebActionCount
 
 */
@@ -1367,7 +1455,7 @@
             if (QWebFrame *targetFrame = d->hitTestResult.linkTargetFrame()) {
                 WTF::RefPtr<WebCore::Frame> wcFrame = targetFrame->d->frame;
                 targetFrame->d->frame->loader()->loadFrameRequestWithFormAndValues(frameLoadRequest(d->hitTestResult.linkUrl(), wcFrame.get()),
-                                                                                   /*lockHistory*/ false, /*event*/ 0,
+                                                                                   /*lockHistory*/ false, /*lockBackForwardList*/ false, /*event*/ 0,
                                                                                    /*HTMLFormElement*/ 0, /*formValues*/
                                                                                    WTF::HashMap<String, String>());
                 break;
@@ -1422,10 +1510,13 @@
             editor->setBaseWritingDirection(RightToLeftWritingDirection);
             break;
         case InspectElement:
-            d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get());
+            if (!d->hitTestResult.isNull())
+                d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get());
+            else
+                d->page->inspectorController()->show();
             break;
         default:
-            command = editorCommandForWebActions(action);
+            command = QWebPagePrivate::editorCommandForWebActions(action);
             break;
     }
 
@@ -1464,6 +1555,56 @@
     }
 }
 
+QSize QWebPage::fixedLayoutSize() const
+{
+    if (d->mainFrame && d->mainFrame->d->frame->view())
+        return d->mainFrame->d->frame->view()->fixedLayoutSize();
+
+    return d->fixedLayoutSize;
+}
+
+/*!
+    \property QWebPage::fixedLayoutSize
+    \since 4.6
+    \brief the size of the fixed layout
+
+    The size affects the layout of the page in the viewport.  If set to a fixed size of
+    1024x768 for example then webkit will layout the page as if the viewport were that size
+    rather than something different.
+*/
+void QWebPage::setFixedLayoutSize(const QSize &size) const
+{
+    d->fixedLayoutSize = size;
+
+    QWebFrame *frame = mainFrame();
+    if (frame->d->frame && frame->d->frame->view()) {
+        WebCore::FrameView* view = frame->d->frame->view();
+        view->setFixedLayoutSize(size);
+        frame->d->frame->forceLayout();
+    }
+}
+
+bool QWebPage::useFixedLayout() const
+{
+    return d->useFixedLayout;
+}
+
+/*!
+    \property QWebPage::usedFixedLayout
+    \since 4.6
+    \brief whether to use a fixed layout size
+*/
+void QWebPage::setUseFixedLayout(bool useFixedLayout)
+{
+    d->useFixedLayout = useFixedLayout;
+
+    QWebFrame *frame = mainFrame();
+    if (frame->d->frame && frame->d->frame->view()) {
+        WebCore::FrameView* view = frame->d->frame->view();
+        view->setUseFixedLayout(useFixedLayout);
+        frame->d->frame->forceLayout();
+    }
+}
 
 /*!
     \fn bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
@@ -1614,32 +1755,83 @@
         }
 #endif // QT_NO_UNDOSTACK
         case MoveToNextChar:
+            text = tr("Move the cursor to the next character");
+            break;
         case MoveToPreviousChar:
+            text = tr("Move the cursor to the previous character");
+            break;
         case MoveToNextWord:
+            text = tr("Move the cursor to the next word");
+            break;
         case MoveToPreviousWord:
+            text = tr("Move the cursor to the previous word");
+            break;
         case MoveToNextLine:
+            text = tr("Move the cursor to the next line");
+            break;
         case MoveToPreviousLine:
+            text = tr("Move the cursor to the previous line");
+            break;
         case MoveToStartOfLine:
+            text = tr("Move the cursor to the start of the line");
+            break;
         case MoveToEndOfLine:
+            text = tr("Move the cursor to the end of the line");
+            break;
         case MoveToStartOfBlock:
+            text = tr("Move the cursor to the start of the block");
+            break;
         case MoveToEndOfBlock:
+            text = tr("Move the cursor to the end of the block");
+            break;
         case MoveToStartOfDocument:
+            text = tr("Move the cursor to the start of the document");
+            break;
         case MoveToEndOfDocument:
+            text = tr("Move the cursor to the end of the document");
+            break;
         case SelectNextChar:
+            text = tr("Select to the next character");
+            break;
         case SelectPreviousChar:
+            text = tr("Select to the previous character");
+            break;
         case SelectNextWord:
+            text = tr("Select to the next word");
+            break;
         case SelectPreviousWord:
+            text = tr("Select to the previous word");
+            break;
         case SelectNextLine:
+            text = tr("Select to the next line");
+            break;
         case SelectPreviousLine:
+            text = tr("Select to the previous line");
+            break;
         case SelectStartOfLine:
+            text = tr("Select to the start of the line");
+            break;
         case SelectEndOfLine:
+            text = tr("Select to the end of the line");
+            break;
         case SelectStartOfBlock:
+            text = tr("Select to the start of the block");
+            break;
         case SelectEndOfBlock:
+            text = tr("Select to the end of the block");
+            break;
         case SelectStartOfDocument:
+            text = tr("Select to the start of the document");
+            break;
         case SelectEndOfDocument:
+            text = tr("Select to the end of the document");
+            break;
         case DeleteStartOfWord:
+            text = tr("Delete to the start of the word");
+            break;
         case DeleteEndOfWord:
-            break; // ####
+            text = tr("Delete to the end of the word");
+            break;
 
         case SetTextDirectionDefault:
             text = contextMenuItemTagDefaultDirection();
@@ -1813,7 +2005,7 @@
 }
 
 /*!
-    \property QWebPage::editable
+    \property QWebPage::contentEditable
     \brief whether the content in this QWebPage is editable or not
     \since 4.5
 
@@ -1821,7 +2013,7 @@
     cursor. If disabled (the default) only HTML elements in the web page with their
     \c{contenteditable} attribute set are editable.
 */
-void QWebPage::setEditable(bool editable)
+void QWebPage::setContentEditable(bool editable)
 {
     if (d->editable != editable) {
         d->editable = editable;
@@ -1841,7 +2033,7 @@
     }
 }
 
-bool QWebPage::isEditable() const
+bool QWebPage::isContentEditable() const
 {
     return d->editable;
 }
@@ -1974,7 +2166,11 @@
     This enum describes the types of extensions that the page can support. Before using these extensions, you
     should verify that the extension is supported by calling supportsExtension().
 
-    Currently there are no extensions.
+    \value ChooseMultipleFilesExtension Whether the web page supports multiple file selection.
+    This extension is invoked when the web content requests one or more file names, for example
+    as a result of the user clicking on a "file upload" button in a HTML form where multiple
+    file selection is allowed.
+
 */
 
 /*!
@@ -1986,11 +2182,27 @@
 */
 
 /*!
-    \class QWebPage::ExtensionReturn
-    \since 4.4
-    \brief The ExtensionOption class provides an extended output argument to QWebPage's extension support.
+    \class QWebPage::ChooseMultipleFilesExtensionOption
+    \since 4.5
+    \brief The ChooseMultipleFilesExtensionOption class describes the option
+    for the multiple files selection extension.
 
-    \sa QWebPage::extension()
+    The ChooseMultipleFilesExtensionOption class holds the frame originating the request
+    and the suggested filenames which might be provided.
+
+    \sa QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
+*/
+
+/*!
+    \class QWebPage::ChooseMultipleFilesExtensionReturn
+    \since 4.5
+    \brief The ChooseMultipleFilesExtensionReturn describes the return value
+    for the multiple files selection extension.
+
+    The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user
+    when the extension is invoked.
+
+    \sa QWebPage::ChooseMultipleFilesExtensionOption
 */
 
 /*!
@@ -2001,15 +2213,22 @@
 
     You can call supportsExtension() to check if an extension is supported by the page.
 
-    By default, no extensions are supported, and this function returns false.
+    Returns true if the extension was called successfully; otherwise returns false.
 
     \sa supportsExtension(), Extension
 */
 bool QWebPage::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output)
 {
-    Q_UNUSED(extension)
-    Q_UNUSED(option)
-    Q_UNUSED(output)
+#ifndef QT_NO_FILEDIALOG
+    if (extension == ChooseMultipleFilesExtension) {
+        // FIXME: do not ignore suggestedFiles
+        QStringList suggestedFiles = static_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFileNames;
+        QStringList names = QFileDialog::getOpenFileNames(d->view, QString::null);
+        static_cast<ChooseMultipleFilesExtensionReturn*>(output)->fileNames = names;
+        return true;
+    }
+#endif
+
     return false;
 }
 
@@ -2020,8 +2239,12 @@
 */
 bool QWebPage::supportsExtension(Extension extension) const
 {
-    Q_UNUSED(extension)
+#ifndef QT_NO_FILEDIALOG
+    return extension == ChooseMultipleFilesExtension;
+#else
+    Q_UNUSED(extension);
     return false;
+#endif
 }
 
 /*!
@@ -2155,8 +2378,8 @@
 }
 
 /*!
-    This function is called when a user agent for HTTP requests is needed. You can re-implement this
-    function to dynamically return different user agent's for different urls, based on the \a url parameter.
+    This function is called when a user agent for HTTP requests is needed. You can reimplement this
+    function to dynamically return different user agents for different URLs, based on the \a url parameter.
 
     The default implementation returns the following value:
 
@@ -2428,10 +2651,12 @@
 
 /*!
     \fn void QWebPage::contentsChanged()
+    \since 4.5
 
-    This signal is emitted whenever the content changes during editing.
+    This signal is emitted whenever the text in form elements changes
+    as well as other editable content.
 
-    \sa selectedText()
+    \sa contentEditable, QWebFrame::toHtml(), QWebFrame::toPlainText()
 */
 
 /*!
@@ -2540,4 +2765,38 @@
     window that hosts QWebPage should be changed to \a visible.
 */
 
+/*!
+    \fn void QWebPage::databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
+    \since 4.5
+
+    This signal is emitted whenever the web site shown in \a frame is asking to store data
+    to the database \a databaseName and the quota allocated to that web site is exceeded.
+*/
+
+/*!
+  \since 4.5
+  \fn void QWebPage::saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
+
+  This signal is emitted shortly before the history of navigated pages
+  in \a frame is changed, for example when navigating back in the history.
+
+  The provided QWebHistoryItem, \a item, holds the history entry of the frame before
+  the change.
+
+  A potential use-case for this signal is to store custom data in
+  the QWebHistoryItem associated to the frame, using QWebHistoryItem::setUserData().
+*/
+
+/*!
+  \since 4.5
+  \fn void QWebPage::restoreFrameStateRequested(QWebFrame* frame);
+
+  This signal is emitted when the load of \a frame is finished and the application may now update its state accordingly.
+*/
+
+/*!
+  \fn QWebPagePrivate* QWebPage::handle() const
+  \internal
+*/
+
 #include "moc_qwebpage.cpp"
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index 5b978d8..2bbbc2a 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -46,6 +46,7 @@
 class QWebNetworkInterface;
 class QWebPluginFactory;
 class QWebHitTestResult;
+class QWebHistoryItem;
 
 namespace WebCore {
     class ChromeClientQt;
@@ -64,10 +65,12 @@
     Q_PROPERTY(bool modified READ isModified)
     Q_PROPERTY(QString selectedText READ selectedText)
     Q_PROPERTY(QSize viewportSize READ viewportSize WRITE setViewportSize)
+    Q_PROPERTY(QSize fixedLayoutSize READ fixedLayoutSize WRITE setFixedLayoutSize)
+    Q_PROPERTY(bool useFixedLayout READ useFixedLayout WRITE setUseFixedLayout)
     Q_PROPERTY(bool forwardUnsupportedContent READ forwardUnsupportedContent WRITE setForwardUnsupportedContent)
     Q_PROPERTY(LinkDelegationPolicy linkDelegationPolicy READ linkDelegationPolicy WRITE setLinkDelegationPolicy)
     Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
-    Q_PROPERTY(bool editable READ isEditable WRITE setEditable)
+    Q_PROPERTY(bool contentEditable READ isContentEditable WRITE setContentEditable)
     Q_ENUMS(LinkDelegationPolicy NavigationType WebAction)
 public:
     enum NavigationType {
@@ -145,6 +148,8 @@
         InsertParagraphSeparator,
         InsertLineSeparator,
 
+        SelectAll,
+
         WebActionCount
     };
 
@@ -212,6 +217,12 @@
     QSize viewportSize() const;
     void setViewportSize(const QSize &size) const;
 
+    QSize fixedLayoutSize() const;
+    void setFixedLayoutSize(const QSize &size) const;
+
+    bool useFixedLayout() const;
+    void setUseFixedLayout(bool useFixedLayout);
+
     virtual bool event(QEvent*);
     bool focusNextPrevChild(bool next);
 
@@ -228,8 +239,8 @@
     void setPalette(const QPalette &palette);
     QPalette palette() const;
 
-    void setEditable(bool editable);
-    bool isEditable() const;
+    void setContentEditable(bool editable);
+    bool isContentEditable() const;
 
 #ifndef QT_NO_CONTEXTMENU
     bool swallowContextMenuEvent(QContextMenuEvent *event);
@@ -239,14 +250,29 @@
     QMenu *createStandardContextMenu();
 
     enum Extension {
+        ChooseMultipleFilesExtension
     };
     class ExtensionOption
     {};
     class ExtensionReturn
     {};
+
+    class ChooseMultipleFilesExtensionOption : public ExtensionOption {
+    public:
+        QWebFrame *parentFrame;
+        QStringList suggestedFileNames;
+    };
+
+    class ChooseMultipleFilesExtensionReturn : public ExtensionReturn {
+    public:
+        QStringList fileNames;
+    };
+
     virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
     virtual bool supportsExtension(Extension extension) const;
 
+    inline QWebPagePrivate* handle() const { return d; }
+
 Q_SIGNALS:
     void loadStarted();
     void loadProgress(int progress);
@@ -274,6 +300,10 @@
 
     void microFocusChanged();
     void contentsChanged();
+    void databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
+
+    void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
+    void restoreFrameStateRequested(QWebFrame* frame);
 
 protected:
     virtual QWebPage *createWindow(WebWindowType type);
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 8fae81c..fd915a2 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+    Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies)
     Copyright (C) 2008 Holger Hans Peter Freyther
 
     This library is free software; you can redistribute it and/or
@@ -112,6 +112,11 @@
     void leaveEvent(QEvent *);
     bool handleScrolling(QKeyEvent*);
 
+#ifndef QT_NO_SHORTCUT
+    static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event);
+#endif
+    static const char* editorCommandForWebActions(QWebPage::WebAction action);
+
     WebCore::ChromeClientQt *chromeClient;
     WebCore::ContextMenuClientQt *contextMenuClient;
     WebCore::EditorClientQt *editorClient;
@@ -149,6 +154,7 @@
     QWebPage::LinkDelegationPolicy linkPolicy;
 
     QSize viewportSize;
+    QSize fixedLayoutSize;
     QWebHistory history;
     QWebHitTestResult hitTestResult;
 #ifndef QT_NO_CONTEXTMENU
@@ -157,10 +163,13 @@
     QWebSettings *settings;
     QPalette palette;
     bool editable;
+    bool useFixedLayout;
 
     QAction *actions[QWebPage::WebActionCount];
 
     QWebPluginFactory *pluginFactory;
+
+    static bool drtRun;
 };
 
 #endif
diff --git a/WebKit/qt/Api/qwebpluginfactory.cpp b/WebKit/qt/Api/qwebpluginfactory.cpp
index 0d2390c..d2bb124 100644
--- a/WebKit/qt/Api/qwebpluginfactory.cpp
+++ b/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -136,7 +136,7 @@
     For example:
 
     \code
-    <object type="application/x-pdf" data="http://www.trolltech.com/document.pdf" width="500" height="400">
+    <object type="application/x-pdf" data="http://qtsoftware.com/document.pdf" width="500" height="400">
         <param name="showTableOfContents" value="true" />
         <param name="hideThumbnails" value="false" />
     </object>
@@ -149,7 +149,7 @@
     \row    \o mimeType
             \o "application/x-pdf"
     \row    \o url
-            \o "http://www.trolltech.com/document.pdf"
+            \o "http://qtsoftware.com/document.pdf"
     \row    \o argumentNames
             \o "showTableOfContents" "hideThumbnails"
     \row    \o argumentVaues
diff --git a/WebKit/qt/Api/qwebsecurityorigin.cpp b/WebKit/qt/Api/qwebsecurityorigin.cpp
new file mode 100644
index 0000000..5217362
--- /dev/null
+++ b/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -0,0 +1,176 @@
+/*
+    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
+#include "qwebdatabase.h"
+#include "qwebdatabase_p.h"
+
+#include "DatabaseTracker.h"
+#include "KURL.h"
+#include "SecurityOrigin.h"
+#include <QStringList>
+
+using namespace WebCore;
+
+/*!
+    \class QWebSecurityOrigin
+    \since 4.5
+    \brief The QWebSecurityOrigin class defines a security boundary for web sites.
+
+    QWebSecurityOrigin provides access to the security domains defined by web sites.
+    An origin consists of a host name, a scheme, and a port number. Web sites with the same
+    security origin can access each other's resources for client-side scripting or databases.
+
+    ### diagram
+
+    For example the site \c{http://www.example.com/my/page.html} is allowed to share the same
+    database as \c{http://www.example.com/my/overview.html}, or access each other's
+    documents when used in HTML frame sets and JavaScript. At the same time it prevents
+    \c{http://www.malicious.com/evil.html} from accessing \c{http://www.example.com/}'s resources,
+    because they are of a different security origin.
+
+    QWebSecurity also provides access to all databases defined within a security origin.
+
+    For more information refer to the
+    \l{http://en.wikipedia.org/wiki/Same_origin_policy}{"Same origin policy" Wikipedia Article}.
+
+    \sa QWebFrame::securityOrigin()
+*/
+
+/*!
+    Constructs a security origin from \a other.
+*/
+QWebSecurityOrigin::QWebSecurityOrigin(const QWebSecurityOrigin& other) : d(other.d)
+{
+}
+
+/*!
+    Assigns the \a other security origin to this.
+*/
+QWebSecurityOrigin& QWebSecurityOrigin::operator=(const QWebSecurityOrigin& other)
+{
+    d = other.d;
+    return *this;
+}
+
+/*!
+    Returns the scheme defining the security origin.
+*/
+QString QWebSecurityOrigin::scheme() const
+{
+    return d->origin->protocol();
+}
+
+/*!
+    Returns the host name defining the security origin.
+*/
+QString QWebSecurityOrigin::host() const
+{
+    return d->origin->host();
+}
+
+/*!
+    Returns the port number defining the security origin.
+*/
+int QWebSecurityOrigin::port() const
+{
+    return d->origin->port();
+}
+
+/*!
+    Returns the number of bytes all databases in the security origin
+    use on the disk.
+*/
+qint64 QWebSecurityOrigin::databaseUsage() const
+{
+    return DatabaseTracker::tracker().usageForOrigin(d->origin.get());
+}
+
+/*!
+    Returns the quota for the databases in the security origin.
+*/
+qint64 QWebSecurityOrigin::databaseQuota() const
+{
+    return DatabaseTracker::tracker().quotaForOrigin(d->origin.get());
+}
+
+/*!
+    Sets the quota for the databases in the security origin to \a quota bytes.
+
+    If the quota is set to a value less than the current usage, the quota will remain
+    and no data will be purged to meet the new quota. However, no new data can be added
+    to databases in this origin.
+*/
+void QWebSecurityOrigin::setDatabaseQuota(qint64 quota)
+{
+    DatabaseTracker::tracker().setQuota(d->origin.get(), quota);
+}
+
+/*!
+    Destroys the security origin.
+*/
+QWebSecurityOrigin::~QWebSecurityOrigin()
+{
+}
+
+/*!
+    \internal
+*/
+QWebSecurityOrigin::QWebSecurityOrigin(QWebSecurityOriginPrivate* priv)
+{
+    d = priv;
+}
+
+/*!
+    Returns a list of all security origins with a database quota defined.
+*/
+QList<QWebSecurityOrigin> QWebSecurityOrigin::allOrigins()
+{
+    Vector<RefPtr<SecurityOrigin> > coreOrigins;
+    DatabaseTracker::tracker().origins(coreOrigins);
+    QList<QWebSecurityOrigin> webOrigins;
+
+    for (unsigned i = 0; i < coreOrigins.size(); ++i) {
+        QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(coreOrigins[i].get());
+        webOrigins.append(priv);
+    }
+    return webOrigins;
+}
+
+/*!
+    Returns a list of all databases defined in the security origin.
+*/
+QList<QWebDatabase> QWebSecurityOrigin::databases() const
+{
+    Vector<String> nameVector;
+    QList<QWebDatabase> databases;
+    if (!DatabaseTracker::tracker().databaseNamesForOrigin(d->origin.get(), nameVector))
+        return databases;
+    for (unsigned i = 0; i < nameVector.size(); ++i) {
+        QWebDatabasePrivate* priv = new QWebDatabasePrivate();
+        priv->name = nameVector[i];
+        priv->origin = this->d->origin;
+        QWebDatabase webDatabase(priv);
+        databases.append(webDatabase);
+    }
+    return databases;
+}
+
diff --git a/WebKit/qt/Api/qwebsecurityorigin.h b/WebKit/qt/Api/qwebsecurityorigin.h
new file mode 100644
index 0000000..ebe4a77
--- /dev/null
+++ b/WebKit/qt/Api/qwebsecurityorigin.h
@@ -0,0 +1,67 @@
+/*
+    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _WEBSECURITYORIGIN_H_
+#define _WEBSECURITYORIGIN_H_
+
+#include <QtCore/qurl.h>
+#include <QtCore/qshareddata.h>
+
+#include "qwebkitglobal.h"
+
+namespace WebCore {
+    class SecurityOrigin;
+    class ChromeClientQt;
+};
+
+class QWebSecurityOriginPrivate;
+class QWebDatabase;
+class QWebFrame;
+
+class QWEBKIT_EXPORT QWebSecurityOrigin
+{
+public:
+    static QList<QWebSecurityOrigin> allOrigins();
+
+    ~QWebSecurityOrigin();
+
+    QString scheme() const;
+    QString host() const;
+    int port() const;
+
+    qint64 databaseUsage() const;
+    qint64 databaseQuota() const;
+
+    void setDatabaseQuota(qint64 quota);
+
+    QList<QWebDatabase> databases() const;
+
+    QWebSecurityOrigin(const QWebSecurityOrigin& other);
+    QWebSecurityOrigin &operator=(const QWebSecurityOrigin& other);
+private:
+    friend class QWebDatabase;
+    friend class QWebFrame;
+    friend class WebCore::ChromeClientQt;
+    QWebSecurityOrigin(QWebSecurityOriginPrivate* priv);
+
+private:
+    QExplicitlySharedDataPointer<QWebSecurityOriginPrivate> d;
+};
+
+#endif
diff --git a/WebKit/qt/Api/qwebsecurityorigin_p.h b/WebKit/qt/Api/qwebsecurityorigin_p.h
new file mode 100644
index 0000000..73fe8ed
--- /dev/null
+++ b/WebKit/qt/Api/qwebsecurityorigin_p.h
@@ -0,0 +1,40 @@
+/*
+    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _WEBSECURITYORIGIN_P_H_
+#define _WEBSECURITYORIGIN_P_H_
+
+#include "SecurityOrigin.h"
+#include "RefPtr.h"
+
+class QWebSecurityOriginPrivate : public QSharedData
+{
+public:
+    QWebSecurityOriginPrivate(WebCore::SecurityOrigin* o)
+    {
+        Q_ASSERT(o);
+        origin = o;
+    }
+    ~QWebSecurityOriginPrivate()
+    {
+    }
+    WTF::RefPtr<WebCore::SecurityOrigin> origin;
+};
+
+#endif
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index 132eb0c..42baf93 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -32,6 +32,8 @@
 #include "IconDatabase.h"
 #include "Image.h"
 #include "IntSize.h"
+#include "ApplicationCacheStorage.h"
+#include "DatabaseTracker.h"
 
 #include <QHash>
 #include <QSharedData>
@@ -50,6 +52,9 @@
     QHash<int, int> fontSizes;
     QHash<int, bool> attributes;
     QUrl userStyleSheetLocation;
+    QString localStorageDatabasePath;
+    QString offlineWebApplicationCachePath;
+    qint64 offlineStorageDefaultQuota;
 
     void apply();
     WebCore::Settings *settings;
@@ -156,9 +161,28 @@
         QUrl location = !userStyleSheetLocation.isEmpty() ? userStyleSheetLocation : global->userStyleSheetLocation;
         settings->setUserStyleSheetLocation(WebCore::KURL(location));
 
+        QString localStoragePath = !localStorageDatabasePath.isEmpty() ? localStorageDatabasePath : global->localStorageDatabasePath;
+        settings->setLocalStorageDatabasePath(localStoragePath);
+
         value = attributes.value(QWebSettings::ZoomTextOnly,
                                  global->attributes.value(QWebSettings::ZoomTextOnly));
         settings->setZoomsTextOnly(value);
+
+        value = attributes.value(QWebSettings::PrintElementBackgrounds,
+                                      global->attributes.value(QWebSettings::PrintElementBackgrounds));
+        settings->setShouldPrintBackgrounds(value);
+
+        value = attributes.value(QWebSettings::OfflineStorageDatabaseEnabled,
+                                      global->attributes.value(QWebSettings::OfflineStorageDatabaseEnabled));
+        settings->setDatabasesEnabled(value);
+
+        value = attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled,
+                                      global->attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled));
+        settings->setOfflineWebApplicationCacheEnabled(value);
+
+        value = attributes.value(QWebSettings::LocalStorageDatabaseEnabled,
+                                      global->attributes.value(QWebSettings::LocalStorageDatabaseEnabled));
+        settings->setLocalStorageEnabled(value);
     } else {
         QList<QWebSettingsPrivate *> settings = *::allSettings();
         for (int i = 0; i < settings.count(); ++i)
@@ -195,9 +219,26 @@
     family, the location of a custom stylesheet, and generic attributes like java
     script, plugins, etc. The \l{QWebSettings::WebAttribute}{WebAttribute}
     enum further describes this.
-    
+
     QWebSettings also configures global properties such as the web page memory
-    cache and the web page icon database.
+    cache and the web page icon database, local database storage and offline
+    applications storage.
+
+    \section1 Web Application Support
+
+    WebKit provides support for features specified in \l{HTML 5} that improve the
+    performance and capabilities of Web applications. These include client-side
+    (offline) storage and the use of a Web application cache.
+
+    Client-side (offline) storage is an improvement over the use of cookies to
+    store persistent data in Web applications. Applications can configure and
+    enable the use of an offline storage database by calling the
+    setOfflineStoragePath() with an appropriate file path, and can limit the quota
+    for each application by calling setOfflineStorageDefaultQuota().
+
+    The performance of Web applications can be enhanced with the use of an
+    offline cache. This can be enabled by calling setOfflineWebApplicationCache()
+    with an appropriate file path.
 
     \sa QWebPage::settings(), QWebView::settings(), {Browser}
 */
@@ -266,6 +307,14 @@
         included in the keyboard focus chain.
     \value ZoomTextOnly Specifies whether the zoom factor on a frame applies to
         only the text or all content.
+    \value PrintElementBackgrounds Specifies whether the background color and images
+        are also drawn when the page is printed.
+    \value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5
+        offline storage feature is enabled or not.
+    \value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5
+        web application cache feature is enabled or not.
+    \value LocalStorageDatabaseEnabled Specifies whether support for the HTML 5
+        local storage feature is enabled or not.
 */
 
 /*!
@@ -275,9 +324,8 @@
     : d(new QWebSettingsPrivate)
 {
     // Initialize our global defaults
-    // changing any of those will likely break the LayoutTests
-    d->fontSizes.insert(QWebSettings::MinimumFontSize, 5);
-    d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 5);
+    d->fontSizes.insert(QWebSettings::MinimumFontSize, 0);
+    d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 0);
     d->fontSizes.insert(QWebSettings::DefaultFontSize, 14);
     d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 14);
     d->fontFamilies.insert(QWebSettings::StandardFont, QLatin1String("Arial"));
@@ -291,6 +339,12 @@
     d->attributes.insert(QWebSettings::JavascriptEnabled, true);
     d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true);
     d->attributes.insert(QWebSettings::ZoomTextOnly, false);
+    d->attributes.insert(QWebSettings::PrintElementBackgrounds, true);
+    d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true);
+    d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true);
+    d->attributes.insert(QWebSettings::LocalStorageDatabaseEnabled, true);
+    d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
+
 }
 
 /*!
@@ -600,3 +654,130 @@
     }
 }
 
+/*!
+    \since 4.5
+
+    Sets the path for HTML5 offline storage to \a path.
+
+    \a path must point to an existing directory where the databases are stored.
+
+    Setting an empty path disables the feature.
+
+    \sa offlineStoragePath()
+*/
+void QWebSettings::setOfflineStoragePath(const QString& path)
+{
+#if ENABLE(DATABASE)
+    WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(path);
+#endif
+}
+
+/*!
+    \since 4.5
+
+    Returns the path of the HTML5 offline storage or an empty string if the
+    feature is disabled.
+
+    \sa setOfflineStoragePath()
+*/
+QString QWebSettings::offlineStoragePath()
+{
+#if ENABLE(DATABASE)
+    return WebCore::DatabaseTracker::tracker().databaseDirectoryPath();
+#else
+    return QString();
+#endif
+}
+
+/*!
+    \since 4.5
+
+    Sets the value of the default quota for new offline storage databases
+    to \a maximumSize.
+*/
+void QWebSettings::setOfflineStorageDefaultQuota(qint64 maximumSize)
+{
+    QWebSettings::globalSettings()->d->offlineStorageDefaultQuota = maximumSize;
+}
+
+/*!
+    \since 4.5
+
+    Returns the value of the default quota for new offline storage databases.
+*/
+qint64 QWebSettings::offlineStorageDefaultQuota()
+{
+    return QWebSettings::globalSettings()->d->offlineStorageDefaultQuota;
+}
+
+/*!
+    \since 4.5
+
+    Sets the path for HTML5 offline web application cache storage to \a path.
+
+    \a path must point to an existing directory where the cache is stored.
+
+    Setting an empty path disables the feature.
+
+    \sa offlineWebApplicationCachePath()
+*/
+void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+    WebCore::cacheStorage().setCacheDirectory(path);
+#endif
+}
+
+/*!
+    \since 4.5
+
+    Returns the path of the HTML5 offline web application cache storage
+    or an empty string if the feature is disabled.
+
+    \sa setOfflineWebApplicationCachePath()
+*/
+QString QWebSettings::offlineWebApplicationCachePath()
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+    return WebCore::cacheStorage().cacheDirectory();
+#else
+    return QString();
+#endif
+}
+
+/*
+    \since 4.5
+
+    Sets the path for HTML5 local storage databases to \a path.
+
+    \a path must point to an existing directory where the cache is stored.
+
+    Setting an empty path disables the feature.
+
+    \sa localStorageDatabasePath()
+*/
+
+void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path)
+{
+    QWebSettingsPrivate *d = settings->handle();
+    d->localStorageDatabasePath = path;
+    d->apply();
+}
+
+/*
+    \since 4.5
+
+    Returns the path for HTML5 local storage databases
+    or an empty string if the feature is disabled.
+
+    \sa setLocalStorageDatabasePath()
+*/
+QString QWEBKIT_EXPORT qt_websettings_localStorageDatabasePath(QWebSettings* settings)
+{
+    return settings->handle()->localStorageDatabasePath;
+}
+
+/*!
+    \fn QWebSettingsPrivate* QWebSettings::handle() const
+    \internal
+*/
diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h
index 9a75dbf..4251fbb 100644
--- a/WebKit/qt/Api/qwebsettings.h
+++ b/WebKit/qt/Api/qwebsettings.h
@@ -59,7 +59,11 @@
         JavascriptCanAccessClipboard,
         DeveloperExtrasEnabled,
         LinksIncludedInFocusChain,
-        ZoomTextOnly
+        ZoomTextOnly,
+        PrintElementBackgrounds,
+        OfflineStorageDatabaseEnabled,
+        OfflineWebApplicationCacheEnabled,
+        LocalStorageDatabaseEnabled
     };
     enum WebGraphic {
         MissingImageGraphic,
@@ -103,6 +107,16 @@
     static int maximumPagesInCache();
     static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity);
 
+    static void setOfflineStoragePath(const QString& path);
+    static QString offlineStoragePath();
+    static void setOfflineStorageDefaultQuota(qint64 maximumSize);
+    static qint64 offlineStorageDefaultQuota();
+
+    static void setOfflineWebApplicationCachePath(const QString& path);
+    static QString offlineWebApplicationCachePath();
+
+    inline QWebSettingsPrivate* handle() const { return d; }
+
 private:
     friend class QWebPagePrivate;
     friend class QWebSettingsPrivate;
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index ad0b12a..ea503a1 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -156,15 +156,10 @@
 {
     d = new QWebViewPrivate(this);
 
-    QPalette pal = palette();
-    pal.setBrush(QPalette::Background, Qt::white);
-
-    setAttribute(Qt::WA_OpaquePaintEvent);
 #if !defined(Q_WS_QWS)
     setAttribute(Qt::WA_InputMethodEnabled);
 #endif
 
-    setPalette(pal);
     setAcceptDrops(true);
 
     setMouseTracking(true);
@@ -245,6 +240,7 @@
         connect(d->page, SIGNAL(microFocusChanged()),
                 this, SLOT(updateMicroFocus()));
     }
+    setAttribute(Qt::WA_OpaquePaintEvent, d->page);
     update();
 }
 
@@ -290,8 +286,8 @@
 /*!
     Sets the content of the web view to the specified \a html.
 
-    External objects referenced in the HTML document are located relative to
-    \a baseUrl.
+    External objects such as stylesheets or images referenced in the HTML
+    document are located relative to \a baseUrl.
 
     When using this method, WebKit assumes that external resources such as
     JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
@@ -515,11 +511,18 @@
   By default, this property contains a value of 1.0.
 */
 
+/*!
+    Sets the value of the multiplier used to scale the text in a Web page to
+    the \a factor specified.
+*/
 void QWebView::setTextSizeMultiplier(qreal factor)
 {
     page()->mainFrame()->setTextSizeMultiplier(factor);
 }
 
+/*!
+    Returns the value of the multiplier used to scale the text in a Web page.
+*/
 qreal QWebView::textSizeMultiplier() const
 {
     return page()->mainFrame()->textSizeMultiplier();
@@ -546,6 +549,8 @@
     if (d->page) {
 #ifndef QT_NO_CONTEXTMENU
         if (e->type() == QEvent::ContextMenu) {
+            if (!isEnabled())
+                return false;
             QContextMenuEvent *event = static_cast<QContextMenuEvent *>(e);
             if (d->page->swallowContextMenuEvent(event)) {
                 e->accept();
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 3186068..04575c9 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,1310 @@
+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.
+
+        Keep Qt building.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::updateGlobalHistoryForRedirectWithoutHistoryItem):
+        (WebCore::FrameLoaderClientQt::createFrame):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40436.
+
+    2009-01-30  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createFrame):
+
+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.
+
+        * Api/qwebpage.cpp:
+        (QWebPage::triggerAction):
+
+2009-01-27  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Dan Bernstein
+
+        Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::savePlatformDataToCachedFrame):
+        (WebCore::FrameLoaderClientQt::transitionToCommittedFromCachedFrame):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-01-26  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by David Hyatt
+        
+        Back out r40285, because it was checked in with no bug number, no
+        testcase, is rendering change that did not get thorough review,
+        and broke the Mac build.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::hitTestContent):
+
+2009-01-26  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Do not clip the QWebFrame::hitTestContent method to the visible viewport.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::hitTestContent):
+
+2009-01-26  David Boddie  <dboddie@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Doc: qdoc fix for a link to a property and added a basic description of the offline caching and storage features from HTML 5.
+
+        * Api/qwebpage.cpp:
+        * Api/qwebsettings.cpp:
+
+2009-01-25  Urs Wolfer  <uwolfer@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        Add QWebPage::SelectAll to WebAction enum to select all content.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22946
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::editorActionForKeyEvent):
+        * Api/qwebpage.h:
+
+2009-01-25  David Boddie  <dboddie@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Doc: Fixed the terminology used.
+
+        * Api/qwebpage.cpp:
+
+2009-01-25  Thiago Macieira  <thiago.macieira@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Rename links from trolltech.com to qtsoftware.com
+
+        * Api/qwebpluginfactory.cpp:
+
+2009-01-25  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Make QWebPage auto-test more robust by cleaning up generated files
+
+        Sometimes the auto-test may segfault, leaving behind files because the
+        call to cleanupTestCase() never happens, so we also clean up the files
+        at initTestCase() just to make sure we're running in a clean environment.
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::cleanupFiles):
+        (tst_QWebPage::initTestCase):
+        (tst_QWebPage::cleanupTestCase):
+
+2008-12-20  Urs Wolfer  <uwolfer@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        Fix: compile qwebhistory.h with pendantic comiler flag.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22947
+
+        * Api/qwebhistory.h:
+
+2009-01-24  Adam Treat  <adam.treat@torchmobile.com>
+
+        Oops, fix the Qt build.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::render):
+
+2009-01-24  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Add QWebFrame::renderContents() method which allows arbitary rendering
+        of any content region within the QWebFrame.  It also does not draw any
+        scrollbars.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::renderContents):
+        * Api/qwebframe.h:
+
+2009-01-23  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Make the test more robust by taking into account the platform-specific
+        cursor flashing time.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-20  Friedemann Kleint  <Friedemann.Kleint@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Fix spelling error in QWebPage
+
+        * Api/qwebpage.cpp:
+        (QWebPage::action):
+
+2009-01-19  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Fix calling of onkeypress event handlers on input elements when pressing enter
+        and other text insertion commands in the Qt port.
+
+        Similar to the win and mac ports don't execute text inserting editor
+        commands on RawKeyDown but continue processing the event first in
+        WebCore, i.e. also get a keypress event sent. If unhandled it will
+        come back to EditorClientQt::handleKeyboardEvent later and we execute
+        it then.
+
+        This also fixes search by pressing enter on www.trafikanten.no.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::editorCommandForWebActions): Make function
+        accessible from other files.
+        (QWebPage::triggerAction): Adjust to new function visibility.
+        * Api/qwebpage_p.h: Ditto.
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::handleKeyboardEvent): Don't execute
+        text inserting commands on RawKeyPressDown.
+
+2009-01-16  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Simon Hausmann.
+
+        [Qt] Increase popup focus delay time to a sensible 500 ms.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-16  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+         Reviewed by Adam Roben.
+
+         [Qt] Prevent crash if plugin data is NULL.
+
+         * WebCoreSupport/FrameLoaderClientQt.cpp: NULL check.
+         (WebCore::FrameLoaderClientQt::objectContentType):
+
+2009-01-16  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Simon Hausmann.
+
+        [Qt] Per-line cursor movement tests depend on platform-specific font
+        metrics. Remove them to avoid test failures on different platforms.
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::cursorMovements):
+
+2009-01-16  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Simon Hausmann.
+
+        http://www.qtsoftware.com/developer/task-tracker/index_html?id=219344&method=entry
+
+        [Qt] API documentation for QWebPage::WebAction enum.
+
+        * Api/qwebpage.cpp:
+
+2009-01-16  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Another attempt at fixing the Qt build.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::addToJavaScriptWindowObject):
+
+2009-01-14  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Unit tests for text selection and editing actions of QWebPage.
+        The following are tested:
+            - the actions are not NULL
+            - the actions are disabled when contentEditable is false
+            - the actions are enabled when contentEditable is true
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::textSelection):
+        (tst_QWebPage::textEditing):
+
+2009-01-14  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Fix failing assertion when pressing an extra mouse button on a
+        QWebView.
+
+        Mice with more than three buttons - for example with a dedicated
+        "back" button - can generate Qt::XButton1 or Button2.
+        WebCore::MouseButton contains only Left, Middle and Right, so in
+        Qt's PlatformMouseEvent we map to NoButton, resulting in a mouse
+        press or release even with no button set. That triggers an assertion
+        in EventTargetNode::dispatchMouseEvent requiring that either a button
+        is set or it is just a mouse move event, which is correct.
+
+        In QWebPage decide not to dispatch such mouse events where we cannot
+        map the mouse button to a WebCore::MouseButton.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::mousePressEvent):
+        (QWebPagePrivate::mouseDoubleClickEvent):
+        (QWebPagePrivate::mouseTripleClickEvent):
+        (QWebPagePrivate::mouseReleaseEvent):
+
+2009-01-14  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        http://www.qtsoftware.com/developer/task-tracker/index_html?id=241144&method=entry
+
+        [Qt] Create actions for text selection and editing for QWebPage.
+        Also properly disable and enable them when contentEditable is toggled.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::updateAction):
+        (QWebPagePrivate::updateEditorActions):
+        (QWebPage::action):
+
+2009-01-14  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Unit tests for cursor movements. The following are tested:
+            - the actions are not NULL
+            - the actions are disabled when contentEditable is false
+            - the actions are enabled when contentEditable is true
+            - the cursor moves properly when the actions are triggered
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (CursorTrackedPage::CursorTrackedPage):
+        (CursorTrackedPage::selectedText):
+        (CursorTrackedPage::selectionStartOffset):
+        (CursorTrackedPage::selectionEndOffset):
+        (CursorTrackedPage::isSelectionCollapsed):
+        (tst_QWebPage::cursorMovements):
+
+2009-01-08  Yongjun Zhang  <yongjun.zhang@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23187
+
+        Update webview with the intersected rect.
+
+        In ChromeClientQt::repaint, view should be updated with the
+        intersected rect, not the whole windowRect;
+
+        This generally is not a problem for normal viewport setup where
+        viewport size is the same as the qwebview widget size.  However, if we
+        set the viewport size smaller than qwebkit widget, we will see
+        unwanted painting outside the viewport.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::repaint):
+
+2009-01-13  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        [Qt] Missing piece from my previous commit:
+        Disable and enable the cursor navigation actions when contentEditable
+        is changed.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::updateEditorActions):
+
+2009-01-13  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Create actions for cursor navigation for QWebPage. 
+        Also properly disable and enable them when contentEditable is toggled.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::updateAction):
+        (QWebPage::action):
+
+2009-01-13  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23171
+
+        Based on patch by Yael Aharon  <yael.aharon@nokia.com>
+
+        Make the QWebSettings functions for setting the path for the local
+        storage database private QtWebkit API, including the ability to
+        associated a QWebPage with a named page group.
+
+        * Api/qwebpage.cpp:
+        (qt_webpage_setGroupName): Added.
+        (qt_webpage_groupName): Added.
+        * Api/qwebpage.h:
+        (ExtensionOption::handle): Added internal helper function.
+        * Api/qwebsettings.cpp:
+        (qt_websettings_setLocalStorageDatabasePath): Made private API.
+        (qt_websettings_localStorageDatabasePath): Made private API.
+        * Api/qwebsettings.h:
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::database): Small cleanup.
+        (tst_QWebPage::multiplePageGroupsAndLocalStorage): New test for the
+        page group handling, written by Yael.
+
+2009-01-12  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Ensure that we're always notified of navigation actions for local anchors
+        
+        FrameLoader::checkNavigationPolicy() does not notify us if the request has
+        been checked before (which happens for local anchors), but in the case of
+        our clients not accepting the navigation request we do want to be notified
+        again later on, so we clear the lastCheckedRequest flag.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+        (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2009-01-12  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        Build fix: use qobject_cast which does not rely on RTTI. This fixes the
+        unit test when building it with a version of Qt (e.g. Qt/Embedded)
+        configured without RTTI.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-12  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        When the QWebView is disabled context menus implemented in JavaScript should not pop up.
+
+        Just like in QWidget::event() we have to check for the disabled state and
+        ignore context menu events.
+
+        * Api/qwebview.cpp:
+
+2009-01-12  Simon Hausmann  <simon.hausmann@nokia.com
+
+        Reviewed by Tor Arne Vestbø.
+
+        Fix QWebView appearance when showed uninitialized without page.
+
+        Only set WA_OpaquePaintEvent if we have a page set that will actually
+        paint the entire contents, otherwise the optimization does not apply
+        as we do not have a paintEvent() implementation and Qt has to fill the
+        view with its default background instead.
+
+        * Api/qwebview.cpp:
+        (QWebView::QWebView):
+        (QWebView::setPage):
+
+2009-01-11  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        Do not create a QVariant from QObject* directly, use the
+        template-specialized function.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (MyQObject::myOverloadedSlot):
+
+2009-01-09  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        Documentation fixes, remove duplicated docs, document missing
+        parameters and return values.
+
+        * Api/qwebdatabase.cpp:
+        * Api/qwebpage.cpp:
+
+2009-01-09  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Fix linking against QtWebKit on Windows, by defining the EXPORT macros
+        _exactly_ the same way as in qglobal.h, depending on QT_NODLL,
+        QT_MAKEDLL and QT_SHARED.
+
+        * Api/qwebkitglobal.h:
+
+2009-01-09  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Remove qwebnetworkinterface.h from WEBKIT_API_HEADERS as it's not
+        public Qt 4.4/4.5 API.
+
+        * Api/headers.pri:
+
+2009-01-09  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Unreviewed Qt build fix, remove qcookiejar.h from the API headers and
+        therefore HEADERS. It's not part of the API and it moc shouldn't be
+        called on it.
+
+        * Api/headers.pri:
+
+2009-01-09  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        Remove files not present anymore from the WEBKIT_API_HEADERS variable.
+
+        * Api/headers.pri:
+
+2009-01-08  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by Simon Hausmann.
+
+        Don't set the minimumFontSize and minimumLogicalFontSize as these are
+        just for accessibility and should be left up to the client application.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+
+2009-01-08  Kavindra Palaraja  <kdpalara@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Small fixes to the API documentation, missing 4.5 tags and
+        undocumented parameters.
+
+        * Api/qwebhistory.cpp:
+        * Api/qwebpage.cpp:
+        * Api/qwebsettings.cpp:
+
+2009-01-07  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Add Qt API to QWebHitTestResult::isScrollBar method
+
+        * Api/qwebframe.cpp:
+        (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+        (QWebHitTestResult::isScrollBar):
+        * Api/qwebframe.h:
+        * Api/qwebframe_p.h:
+        (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+
+2009-01-07  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Add Qt API for QWebFrame::scrollBarGeometry method
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::scrollBarGeometry):
+        * Api/qwebframe.h:
+
+2009-01-07  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Fix unused variable warnings
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (TestPage::createWindow):
+
+2009-01-07  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Simon Hausmann.
+
+        Qt build fix after r39670.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::evaluateJavaScript):
+
+2009-01-06  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Holger Freyther.
+
+        Allow building QtWebKit statically (within Qt).
+
+        http://trolltech.com/developer/task-tracker/index_html?id=211273&method=entry
+
+        * Api/qwebkitglobal.h:
+
+2009-01-06  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by Simon Hausmann.
+
+        Update the documentation to reflect when these API changes will land in
+        upstream Qt
+
+        * Api/qwebframe.cpp:
+        * Api/qwebpage.cpp:
+
+2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Add Qt API for QWebFrame::contentsSizeChanged signal
+
+        * Api/qwebframe.cpp:
+        * Api/qwebframe.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::contentsSizeChanged):
+        * WebCoreSupport/ChromeClientQt.h:
+
+2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Fixes QWebFrame::setScrollBarPolicy(..) to actually work.  Also happens
+        to fix 192 layout tests that were previously failing for Qt.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::setScrollBarPolicy):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2009-01-04  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Add new API to QWebHitTestResult to return a rect for the smallest enclosing
+        block element of the hit test
+
+        * Api/qwebframe.cpp:
+        (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+        (QWebHitTestResult::enclosingBlock):
+        * Api/qwebframe.h:
+        * Api/qwebframe_p.h:
+
+2008-12-30  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Make the qt port build and work with the new fixedLayoutSize feature
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        (QWebPage::fixedLayoutSize):
+        (QWebPage::setFixedLayoutSize):
+        (QWebPage::useFixedLayout):
+        (QWebPage::setUseFixedLayout):
+        * Api/qwebpage.h:
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2008-12-19  Jade Han <jade.han@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Allow conversion of JavaScript Number and Boolean types to Qt types
+
+        https://bugs.webkit.org/show_bug.cgi?id=22880
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (MyQObject::myInvokableWithBoolArg):
+
+2008-12-18  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        When Web Inspector is launched without an associated node,
+        call show() instead of inspect().
+
+        * Api/qwebpage.cpp:
+        (QWebPage::triggerAction):
+
+2008-12-18  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - stub out FrameLoaderClient::shouldUseCredentialStorage().
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::shouldUseCredentialStorage):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-12-18  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by John Sullivan.
+
+        Stub out FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-12-16  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Holger Freyther.
+
+        Added support for unload event counting to the Qt DRT.
+
+        * Api/qwebpage.cpp:
+        (qt_drt_run): Moved function here.
+        * Api/qwebpage_p.h: Moved drt run boolean here.
+        * WebCoreSupport/EditorClientQt.cpp: Moved drt run boolean.
+        (WebCore::EditorClientQt::shouldShowDeleteInterface): Use the new drt
+        run variable.
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad): Add DRT
+        output for unload event handler counting.
+
+2008-12-15  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        Change the order of sub frame initialisation to avoid crashes
+
+        Add the newly created frame to the FrameTree before calling
+        WebCore::Frame::init to not segfault on
+        LayoutTests/fast/loader/frame-creation-removal.html.
+
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::init):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createFrame):
+
+2008-12-15  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Holger Freyther.
+
+        Implement setJavaScriptProfilingEnabled in the Qt DRT to pass fast/profiler.
+
+        * Api/qwebframe.cpp:
+        (qt_drt_setJavaScriptProfilingEnabled):
+
+2008-12-12  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Fix pressing return/enter not triggering any action on web sites
+        that define event handlers, such as the JS console in the web
+        inspector.
+
+        Process the key events in the DOM first and if not handled map them
+        to editor actions.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::editorActionForKeyEvent): Made a class method.
+        (QWebPagePrivate::keyPressEvent): Pass the key event first to the DOM.
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::handleKeyboardEvent): Map the key event to
+        actions and trigger them.
+
+2008-12-12  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Create the plugin widget even though the web page has no associated
+        view. This prevents the plugin to be uselessly constructed more than once.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createPlugin):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::createViewlessPlugin):
+
+2008-12-11  Enrico Ros  <enrico.ros@m31.com>
+
+        Reviewed by Simon Hausmann.
+
+        Fix the broken focus behavior that happened when QWebPage lost
+        focus to a popup menu.
+
+        The previous code didn't notify the QWebPage at all when the
+        focus was back in (breaking focus rects, caret blinking, ...).
+        By the way when a popup is show, 2 FocusOut events are delivered
+        to the QWebPage, but this doesn't seem to hurt.
+
+        Added a test to check popup opening, closing a lineedit blinks.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::focusInEvent):
+        (QWebPagePrivate::focusOutEvent):
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (tst_QWebFrame::):
+
+2008-12-11  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        When the web page is navigated away, delete the instance
+        of the native plugin.
+
+        http://trolltech.com/developer/task-tracker/index_html?id=214946&method=entry
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (PluginTrackedPage::PluginTrackedPage):
+        (PluginTrackedPage::createPlugin):
+        (tst_QWebPage::destroyPlugin):
+
+2008-12-11  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Allow applications to save and restore their state between loads.
+
+        * Api/qwebframe.cpp:
+        * Api/qwebframe.h:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::restoreViewState):
+        (WebCore::FrameLoaderClientQt::saveViewStateToItem):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::modified):
+
+2008-12-08  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Darin Adler and Holger Freyther.
+
+        Make Widget::frameRectsChanged() and overrides non-const
+
+        This will hopefully allow us to get rid of some of the mutables in
+        the classes that react to the callback by changing their own state.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::):
+
+2008-12-10  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        API changes discussed with Simon Hausmann, Tor Arne
+        Vestbø, Ariya Hidayat...
+
+        * Api/qwebdatabase.cpp:
+        (QWebDatabase::fileName):
+        (QWebDatabase::removeDatabase):
+        * Api/qwebdatabase.h:
+        * Api/qwebframe.cpp:
+        (QWebFrame::scroll):
+        (QWebFrame::scrollPosition):
+        (QWebFrame::setScrollPosition):
+        * Api/qwebframe.h:
+        * Api/qwebpage.cpp:
+        (QWebPage::setContentEditable):
+        (QWebPage::isContentEditable):
+        (QWebPage::extension):
+        * Api/qwebpage.h:
+        * Api/qwebsecurityorigin.cpp:
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        (QWebSettings::QWebSettings):
+        * Api/qwebsettings.h:
+        * QtLauncher/main.cpp:
+        (MainWindow::setEditable):
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::exceededDatabaseQuota):
+        (WebCore::ChromeClientQt::runOpenPanel):
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::isEditable):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::database):
+
+2008-12-09  Balazs Kelemen  <Kelemen.Balazs.3@stud.u-szeged.hu>
+
+        Reviewed by Simon Hausmann.
+
+        Extended QtLauncher so now it can load pages from an url list
+        one by one. This can be useful for testing purposes (eq. leak hunting).
+        The -r option activates this feature.
+
+        https://bugs.webkit.org/show_bug.cgi?id=20932
+
+        * QtLauncher/main.cpp:
+        (MainWindow::webPage):
+        Just a coding style repairing (* written with no space between the return type name)
+        (MainWindow::webView):
+        I need the webView to connect it with the URLLoader object.
+        (URLLoader::URLLoader):
+        (URLLoader::loadNext):
+        (URLLoader::init):
+        (URLLoader::getUrl):
+        (main):
+
+2008-12-10  Simon Hausmann  <hausmann@webkit.org>
+
+        Fix the Qt build, added const to Node* parameter after change
+        in signature.
+
+        * WebCoreSupport/ChromeClientQt.h:
+        (WebCore::ChromeClientQt::formStateDidChange):
+
+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/ChromeClientQt.h:
+        (WebCore::ChromeClientQt::formStateDidChange):
+
+2008-12-09  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Fix the documentation of the localStorageDatabasePath setters/getters.
+
+        * Api/qwebsettings.cpp:
+
+2008-12-08  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Multiple files support for the file chooser.
+
+        * Api/qwebpage.cpp:
+        (QWebPage::chooseFiles):
+        * Api/qwebpage.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::runOpenPanel):
+
+2008-12-06  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dave Hyatt
+
+        https://bugs.webkit.org/show_bug.cgi?id=15671
+
+        Renderer::caretRect() is now localCaretRect(), which needs
+        converting to absolute coordinates (taking transforms into account).
+
+        * Api/qwebpage.cpp:
+        (QWebPage::inputMethodQuery):
+
+2008-12-03  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Allow passing jsNull and jsUndefined to Qt plugins
+
+        Currently limited to functions with QString and QVariant arguments,
+        and properties of these types. Both jsNull and jsUndefined ends up
+        as default-constructed QStrings and QVariants, which means you can
+        check for isEmpty() and isValid() in the native plugin code.
+
+        Based on patches by Jade Han <jade.han@nokia.com>
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-12-02  Simon Hausmann  <hausmann@webkit.org>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        Initial API documentation for QWebDatabase, QWebSecurityOrigin and
+        QWebFrame::securityOrigin().
+
+        * Api/qwebdatabase.cpp:
+        * Api/qwebframe.cpp:
+        * Api/qwebsecurityorigin.cpp:
+
+2008-11-27  Kent Hansen  <khansen@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Added auto tests for making JavaScript bindings for Qt plugin widgets
+        work again.
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (PluginPage::PluginPage):
+        (PluginPage::CallInfo::CallInfo):
+        (PluginPage::createPlugin):
+        (tst_QWebPage::createPlugin):
+
+2008-11-25  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Build fix. Use WebCore::Frame::loader instead of QWebFrame
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::updateGlobalHistory):
+
+2008-11-24  Darin Fisher  <darin@chromium.org>
+
+        Fix bustage.
+
+        http://bugs.webkit.org/show_bug.cgi?id=15643
+
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::isSelectTrailingWhitespaceEnabled):
+        * WebCoreSupport/EditorClientQt.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/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::updateGlobalHistory): Get the URL from the
+        DocumentLoader.
+        * WebCoreSupport/FrameLoaderClientQt.h: Remove argument.
+
+2008-11-24  Darin Fisher  <darin@chromium.org>
+
+        Fix bustage.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22448
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::evaluateJavaScript):
+
+2008-11-20  Sam Weinig  <sam@webkit.org>
+
+        Fix Qt build.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::evaluateJavaScript):
+
+2008-11-19  Darin Fisher  <darin@chromium.org>
+
+        Fix bustage.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22373
+        Ports busted by addition of ScriptValue.{h,cpp}
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::evaluateJavaScript):
+
+2008-11-19  Darin Fisher  <darin@chromium.org>
+
+        Fix bustage.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22373
+        Ports busted by addition of ScriptValue.{h,cpp}
+
+        * Api/qwebframe.cpp:
+
+2008-11-19  Simon Hausmann  <hausmann@webkit.org>
+
+        Fix the Qt build, remove file referenced in the qrc file that does not
+        exist and is not needed.
+
+        * tests/qwebframe/qwebframe.qrc:
+
+2008-11-18  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        Missing file in new unit test for QWebFrame (r38493).
+
+        * tests/qwebframe/qwebframe.pro:
+        * tests/qwebframe/qwebframe.qrc: Added.
+
+2008-11-18  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Rubber-stamped by Simon Hausmann.
+
+        Make sure QWidget based plugins are invisible until placed into the layout
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-11-18  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        React properly to frame rect changes for QWidget based plugins
+
+        We now set the geometry of the QWidget in frameRectsChanged,
+        intead of setFrameRect, which means we pick up the changes to
+        the frame rect when scrolling. We also set a mask on the
+        widget to keep it from painting over scrollbars and the like
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::):
+
+2008-11-18  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Fix crash when trying to pick a file using the file chooser.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::runOpenPanel):
+
+2008-11-18  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        Attempt to share transitionToCommittedForNewPage of FrameLoaderClient with the different ports
+
+        After Hyatt's work on Widget and ScrollView there is little difference
+        between the implementation of Qt, Gtk+ and Win. In fact any kind of
+        difference is mostly a bug. Alp has fixed two of such errors for the Gtk+
+        port and the Qt port has at least one of them left.
+
+        The only difference between the implementations is in getting the the
+        IntSize for the new FrameView, the background color to be applied and
+        eventually some post processing.
+
+        Unify the implementations by providing a static helper function that
+        takes a Frame, IntSize, color and transparency bit and calling it from
+        the Gtk+, the Qt and the Windows port.
+
+        * Api/qwebframe.cpp:
+        * Api/qwebframe_p.h:
+        * Api/qwebpage.cpp:
+        (QWebPage::setPalette):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2008-11-17  Geoffrey Garen  <ggaren@apple.com>
+
+        Not reviewed.
+        
+        Try to fix qt build.
+
+        * Api/qwebframe.cpp:
+
+2008-11-17  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Tor Arne Vestbø and Simon Hausmann.
+
+        Fix regression when loading resources from Qt resource system using qrc:/.
+
+        Added a unit test to catch future regression.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        * tests/qwebframe/image.png: Added.
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-11-16  Darin Adler  <darin@apple.com>
+
+        - try to fix build
+
+        * Api/qwebhistory.cpp: Added include of "KURL.h".
+
+2008-10-24  Yael Aharon <yael.aharon@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Added some basic unit tests for the public database API.
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::initTestCase):
+        (tst_QWebPage::cleanupTestCase):
+        (tst_QWebPage::database):
+
+2008-11-14  Simon Hausmann  <hausmann@webkit.org>
+
+        Fix the Qt build, add missing export macros for the new classes.
+
+        * Api/qwebdatabase.h:
+        * Api/qwebsecurityorigin.h:
+
+2008-10-24  Yael Aharon <yael.aharon@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Adding public API to provide access to the security origin
+        (QWebSecurityOrigin) and the databases used for the offline
+        storage (QWebDatabase).
+
+        In addition QWebSettings gains configuration functions for
+        enabling/disabling offline storage, web application cache
+        and DOM local storage.
+
+        This commits lands the core feature(s), the unit tests and the
+        documentation are going to follow in the comming days/weeks.
+
+        Note: The API is not frozen yet.
+
+        * Api/headers.pri:
+        * Api/qwebdatabase.cpp: Added.
+        (QWebDatabase::QWebDatabase):
+        (QWebDatabase::operator=):
+        (QWebDatabase::name):
+        (QWebDatabase::displayName):
+        (QWebDatabase::expectedSize):
+        (QWebDatabase::size):
+        (QWebDatabase::absoluteFilePath):
+        (QWebDatabase::origin):
+        (QWebDatabase::remove):
+        (QWebDatabase::~QWebDatabase):
+        * Api/qwebdatabase.h: Added.
+        * Api/qwebdatabase_p.h: Added.
+        * Api/qwebframe.cpp:
+        (QWebFrame::securityOrigin):
+        * Api/qwebframe.h:
+        * Api/qwebpage.cpp:
+        * Api/qwebpage.h:
+        * Api/qwebsecurityorigin.cpp: Added.
+        (QWebSecurityOrigin::QWebSecurityOrigin):
+        (QWebSecurityOrigin::operator=):
+        (QWebSecurityOrigin::scheme):
+        (QWebSecurityOrigin::host):
+        (QWebSecurityOrigin::port):
+        (QWebSecurityOrigin::databaseUsage):
+        (QWebSecurityOrigin::databaseQuota):
+        (QWebSecurityOrigin::setDatabaseQuota):
+        (QWebSecurityOrigin::~QWebSecurityOrigin):
+        (QWebSecurityOrigin::allOrigins):
+        (QWebSecurityOrigin::databases):
+        * Api/qwebsecurityorigin.h: Added.
+        * Api/qwebsecurityorigin_p.h: Added.
+        (QWebSecurityOriginPrivate::QWebSecurityOriginPrivate):
+        (QWebSecurityOriginPrivate::~QWebSecurityOriginPrivate):
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        (QWebSettings::QWebSettings):
+        (QWebSettings::setOfflineStoragePath):
+        (QWebSettings::offlineStoragePath):
+        (QWebSettings::setOfflineStorageDefaultQuota):
+        (QWebSettings::offlineStorageDefaultQuota):
+        (QWebSettings::setOfflineWebApplicationCachePath):
+        (QWebSettings::offlineWebApplicationCachePath):
+        (QWebSettings::setLocalStorageDatabasePath):
+        (QWebSettings::localStorageDatabasePath):
+        * Api/qwebsettings.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::exceededDatabaseQuota):
+
+2008-11-12  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Tor Arne Vestbø.
+
+        Mention the color role change (r38331) in the API doc.
+
+        * Api/qwebpage.cpp:
+
+2008-11-11  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Tor Arne Vestbø and Simon Hausmann.
+
+        Use QPalette::Base (instead of QPalette::Background) for the page
+        background.
+
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::updateBackground):
+        * Api/qwebview.cpp:
+        (QWebView::QWebView):
+
+2008-11-11  Cameron Zwarich  <zwarich@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Remove pointless dependencies on the now-deleted kjs directory.
+
+        * WebKit_pch.h:
+
+2008-11-10  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Rubber-stamped by Simon Hausmann.
+
+        To fit Qt API, scroll offset is a QPoint instead of a QSize.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::scrollOffset):
+        (QWebFrame::setScrollOffset):
+        * Api/qwebframe.h:
+
+2008-11-10  David Boddie  <dboddie@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Doc: Fixed qdoc warnings by supplying function documentation.
+
+        * Api/qwebframe.cpp:
+        * Api/qwebview.cpp:
+
+2008-11-10  Tobias Koenig <tobias.koenig@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Removed old and stale prf file that breaks the MingW build.
+
+        * Api/qtwebkit.prf: Removed.
+
+2008-11-10  Kavindra Palaraja  <kdpalara@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Clarify QWebFrame/View::setHTML docs with regards to relative URLs
+
+        * Api/qwebframe.cpp:
+        * Api/qwebview.cpp:
+
+2008-11-10  Joerg Bornemann  <joerg.bornemann@nokia.com>
+
+        Reviewed by Simon Hausmann
+
+        Don't define _CRT_RAND_S on Windows CE in the precompiled
+        header, to fix the CE build.
+
+        * WebKit_pch.h:
+
+2008-11-07  Ariya Hidayat  <ariya.hidayat@trolltech.com>
+
+        Reviewed by Tor Arne Vestbø and Simon Hausmann.
+
+        Added an option to allow printing the background color and images.
+        Mostly reworked from a patch by Holger.
+        This setting is enabled by default.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        (QWebSettings::QWebSettings):
+        * Api/qwebsettings.h:
+
+2008-11-06  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Added a unit tests for QWebFrame::metaData().
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-11-06  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Improved documentation for QWebFrame::metaData().
+
+        * Api/qwebframe.cpp:
+
+2008-11-05  Sriram Yadavalli <sriram.yadavalli@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Added QWebFrame::metaData() to provide a way in the public API
+        to retrieve the values of the <meta> tags.
+
+        See https://bugs.webkit.org/show_bug.cgi?id=22071
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::metaData):
+        * Api/qwebframe.h:
+
 2008-10-24  Yael Aharon <yael.aharon@nokia.com>
 
         Reviewed by Simon Hausmann.
@@ -3686,7 +4993,7 @@
 
         * Api/qwebhistoryinterface.h:
 
-2008-01-21  Adam Treat  <treat@kde.org>
+2008-01-21  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Simon.
 
@@ -5057,7 +6364,7 @@
         * Api/qwebframe.cpp:
         (QWebFramePrivate::init):
 
-2007-11-21  Adam Treat  <treat@kde.org>
+2007-11-21  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Simon.
 
@@ -5070,7 +6377,7 @@
 
 2007-11-20  Simon Hausmann  <hausmann@kde.org>
 
-        Reviewed by Adam Treat <treat@kde.org>.
+        Reviewed by Adam Treat <adam.treat@torchmobile.com>.
 
         Remove static linkage of QtWebKit against the ICO image format plugin.
         
@@ -5101,7 +6408,7 @@
         (QWebPage::mouseMoveEvent):
         * Api/qwebpage.h:
 
-2007-11-20  Adam Treat  <treat@kde.org>
+2007-11-20  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Simon and George.
 
@@ -5110,7 +6417,7 @@
         * WebCoreSupport/FrameLoaderClientQt.cpp:
         (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
 
-2007-11-19  Adam Treat  <treat@kde.org>
+2007-11-19  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Simon.
 
@@ -6861,7 +8168,7 @@
         * WebKitPart/WebKitPartInterface.h: Renamed from WebKitQt/WebKitPart/WebKitPartInterface.h.
         * WebKitPart/org.kde.WebKitPart.xml: Renamed from WebKitQt/WebKitPart/org.kde.WebKitPart.xml.
 
-2007-10-02  Adam Treat  <treat@kde.org>
+2007-10-02  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Eric Seidel.
 
@@ -6963,7 +8270,7 @@
         * WebCoreSupport/EditCommandQt.cpp:
         * WebCoreSupport/EditCommandQt.h:
 
-2007-09-25  Adam Treat  <treat@kde.org>
+2007-09-25  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Simon and Lars.
 
@@ -7200,7 +8507,7 @@
         * WebCoreSupport/FrameLoaderClientQt.cpp:
         (WebCore::FrameLoaderClientQt::userAgent):
 
-2007-08-01  Adam Treat  <treat@kde.org>
+2007-08-01  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by George Staikos.
 
@@ -7215,7 +8522,7 @@
         (QWebHistoryInterface::QWebHistoryInterface):
         * Api/qwebhistoryinterface.h: Added.
 
-2007-07-30  Adam Treat  <treat@kde.org>
+2007-07-30  Adam Treat  <adam.treat@torchmobile.com>
 
         Fix build.
 
@@ -7231,7 +8538,7 @@
 
         * QtLauncher/QtLauncher.pro:
 
-2007-07-29  Adam Treat  <treat@kde.org>
+2007-07-29  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by George Staikos.
 
@@ -7249,7 +8556,7 @@
         * WebCoreSupport/ChromeClientQt.cpp:
         (WebCore::ChromeClientQt::addToDirtyRegion):
 
-2007-07-29  Adam Treat  <treat@kde.org>
+2007-07-29  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Alexey Proskuryakov.
 
@@ -7290,7 +8597,7 @@
         * Api/qwebpage.h:
         * WebCoreSupport/FrameLoaderClientQt.cpp:
 
-2007-07-24  Adam Treat  <treat@kde.org>
+2007-07-24  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by Niko and Lars.
 
@@ -7315,7 +8622,7 @@
         (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
         (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
 
-2007-07-19  Adam Treat  <treat@kde.org>
+2007-07-19  Adam Treat  <adam.treat@torchmobile.com>
 
         Reviewed by George.
 
@@ -7360,7 +8667,7 @@
         (QWebFrame::horizontalScrollBarPolicy):
         * Api/qwebframe.h:
 
-2007-07-17  Adam Treat <treat@kde.org>
+2007-07-17  Adam Treat <adam.treat@torchmobile.com>
 
         Build fix.
 
diff --git a/WebKit/qt/QtLauncher/main.cpp b/WebKit/qt/QtLauncher/main.cpp
index 4d57e56..5d9fef6 100644
--- a/WebKit/qt/QtLauncher/main.cpp
+++ b/WebKit/qt/QtLauncher/main.cpp
@@ -42,6 +42,11 @@
 
 #include <QtUiTools/QUiLoader>
 
+#include <QVector>
+#include <QTextStream>
+#include <QFile>
+#include <cstdio>
+
 class WebPage : public QWebPage
 {
 public:
@@ -83,10 +88,14 @@
         }
     }
 
-    QWebPage *webPage() const {
+    QWebPage* webPage() const {
         return view->page();
     }
 
+    QWebView* webView() const {
+        return view;
+    }
+
 protected slots:
 
     void changeLocation() {
@@ -165,7 +174,7 @@
     }
 
     void setEditable(bool on) {
-        view->page()->setEditable(on);
+        view->page()->setContentEditable(on);
         formatMenuAction->setVisible(on);
     }
 
@@ -322,6 +331,69 @@
     return loader.createWidget(classId, view());
 }
 
+class URLLoader : public QObject
+{
+    Q_OBJECT
+public:
+    URLLoader(QWebView* view, const QString& inputFileName)
+        : m_view(view)
+        , m_stdOut(stdout)
+    {
+        init(inputFileName);
+    }
+
+public slots:
+    void loadNext()
+    {
+        QString qstr;
+        if (getUrl(qstr)) {
+            QUrl url(qstr, QUrl::StrictMode);
+            if (url.isValid()) {
+                m_stdOut << "Loading " << qstr << " ......" << endl;
+                m_view->load(url);
+            } else
+                loadNext();
+        } else
+            disconnect(m_view, 0, this, 0);
+    }
+
+private:
+    void init(const QString& inputFileName)
+    {
+        QFile inputFile(inputFileName);
+        if (inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
+            QTextStream stream(&inputFile);
+            QString line;
+            while (true) {
+                line = stream.readLine();
+                if (line.isNull())
+                    break;
+                m_urls.append(line);
+            }
+        } else {
+            qDebug() << "Cant't open list file";
+            exit(0);
+        }
+        m_index = 0;
+        inputFile.close();
+    }
+
+    bool getUrl(QString& qstr)
+    {
+        if (m_index == m_urls.size())
+            return false;
+
+        qstr = m_urls[m_index++];
+        return true;
+    }
+
+private:
+    QVector<QString> m_urls;
+    int m_index;
+    QWebView* m_view;
+    QTextStream m_stdOut;
+};
+
 #include "main.moc"
 
 int main(int argc, char **argv)
@@ -342,12 +414,26 @@
     QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
 
     const QStringList args = app.arguments();
-    if (args.count() > 1)
-        url = args.at(1);
 
-    MainWindow window(url);
-    window.show();
-
-    return app.exec();
+    // robotized
+    if (args.contains(QLatin1String("-r"))) {
+        QString listFile = args.at(2);
+        if (!(args.count() == 3) && QFile::exists(listFile)) {
+            qDebug() << "Usage: QtLauncher -r listfile";
+            exit(0);
+        }
+        MainWindow window(url);
+        QWebView *view = window.webView();
+        URLLoader loader(view, listFile);
+        QObject::connect(view, SIGNAL(loadFinished(bool)), &loader, SLOT(loadNext()));
+        window.show();
+        return app.exec();
+    } else {
+        if (args.count() > 1)
+            url = args.at(1);
+            
+        MainWindow window(url);
+        window.show();
+        return app.exec();
+    }
 }
-
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 8a4de6b..c545769 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -37,10 +37,14 @@
 #include "HitTestResult.h"
 #include "NotImplemented.h"
 #include "WindowFeatures.h"
+#include "DatabaseTracker.h"
+#include "SecurityOrigin.h"
 
 #include "qwebpage.h"
 #include "qwebpage_p.h"
 #include "qwebframe_p.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
 
 #include <qtooltip.h>
 
@@ -305,8 +309,8 @@
         if (view) {
             QRect rect(windowRect);
             rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize()));
-            if (!windowRect.isEmpty())
-                view->update(windowRect);
+            if (!rect.isEmpty())
+                view->update(rect);
         }
         emit m_webPage->repaintRequested(windowRect);
     }
@@ -340,6 +344,11 @@
     return m_webPage->view();
 }
 
+void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) const
+{
+    emit QWebFramePrivate::kit(frame)->contentsSizeChanged(size);
+}
+
 void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
 {
     if (result.absoluteLinkURL() != lastHoverURL
@@ -377,20 +386,46 @@
     emit m_webPage->printRequested(QWebFramePrivate::kit(frame));
 }
 
-void ChromeClientQt::exceededDatabaseQuota(Frame*, const String&)
+void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseName)
 {
-    notImplemented();
+    quint64 quota = QWebSettings::offlineStorageDefaultQuota();
+#if ENABLE(DATABASE)
+    if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin()))
+        DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota);
+#endif
+    emit m_webPage->databaseQuotaExceeded(QWebFramePrivate::kit(frame), databaseName);
 }
 
 void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
 {
-    // FIXME: Support multiple files.
-
     RefPtr<FileChooser> fileChooser = prpFileChooser;
-    QString suggestedFile = fileChooser->filenames()[0];
-    QString file = m_webPage->chooseFile(QWebFramePrivate::kit(frame), suggestedFile);
-    if (!file.isEmpty())
-        fileChooser->chooseFile(file);
+    bool supportMulti = m_webPage->supportsExtension(QWebPage::ChooseMultipleFilesExtension);
+
+    if (fileChooser->allowsMultipleFiles() && supportMulti) {
+        QWebPage::ChooseMultipleFilesExtensionOption option;
+        option.parentFrame = QWebFramePrivate::kit(frame);
+
+        if (!fileChooser->filenames().isEmpty())
+            for (int i = 0; i < fileChooser->filenames().size(); ++i)
+                option.suggestedFileNames += fileChooser->filenames()[i];
+
+        QWebPage::ChooseMultipleFilesExtensionReturn output;
+        m_webPage->extension(QWebPage::ChooseMultipleFilesExtension, &option, &output);
+
+        if (!output.fileNames.isEmpty()) {
+            Vector<String> names;
+            for (int i = 0; i < output.fileNames.count(); ++i)
+                names.append(output.fileNames.at(i));
+            fileChooser->chooseFiles(names);
+        }
+    } else {
+        QString suggestedFile;
+        if (!fileChooser->filenames().isEmpty())
+            suggestedFile = fileChooser->filenames()[0];
+        QString file = m_webPage->chooseFile(QWebFramePrivate::kit(frame), suggestedFile);
+        if (!file.isEmpty())
+            fileChooser->chooseFile(file);
+    }
 }
 
 }
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 440f29e..a13bb7c 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -106,6 +106,7 @@
         virtual IntPoint screenToWindow(const IntPoint&) const;
         virtual IntRect windowToScreen(const IntRect&) const;
         virtual PlatformWidget platformWindow() const;
+        virtual void contentsSizeChanged(Frame*, const IntSize&) const;
 
         virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
 
@@ -117,6 +118,8 @@
 
         virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
 
+        virtual void formStateDidChange(const Node*) { }
+
         QWebPage* m_webPage;
         WebCore::KURL lastHoverURL;
         WebCore::String lastHoverTitle;
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index a25ff18..a688779 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -1,7 +1,8 @@
 /*
  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2008 Apple Computer, Inc.
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
  *
  * All rights reserved.
  *
@@ -53,16 +54,11 @@
 #define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__);
 
 static bool dumpEditingCallbacks = false;
-static bool drt_run = false;
 static bool acceptsEditing = true;
 void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b)
 {
     dumpEditingCallbacks = b;
 }
-void QWEBKIT_EXPORT qt_drt_run(bool b)
-{
-    drt_run = b;
-}
 
 void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b)
 {
@@ -109,7 +105,7 @@
 
 bool EditorClientQt::shouldShowDeleteInterface(HTMLElement* element)
 {
-    if (drt_run)
+    if (QWebPagePrivate::drtRun)
         return element->className() == "needsDeletionUI";
     return false;
 }
@@ -246,7 +242,7 @@
 
 bool EditorClientQt::isEditable()
 { 
-    return m_page->isEditable();
+    return m_page->isContentEditable();
 }
 
 void EditorClientQt::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> cmd)
@@ -333,6 +329,12 @@
     return false;
 }
 
+bool EditorClientQt::isSelectTrailingWhitespaceEnabled()
+{
+    notImplemented();
+    return false;
+}
+
 void EditorClientQt::toggleContinuousSpellChecking()
 {
     notImplemented();
@@ -359,6 +361,20 @@
 
     // FIXME: refactor all of this to use Actions or something like them
     if (start->isContentEditable()) {
+#ifndef QT_NO_SHORTCUT
+        QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent());
+        if (action != QWebPage::NoWebAction) {
+            const char* cmd = QWebPagePrivate::editorCommandForWebActions(action);
+            // WebKit doesn't have enough information about mode to decide how commands that just insert text if executed via Editor should be treated,
+            // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated
+            // (e.g. Tab that inserts a Tab character, or Enter).
+            if (cmd && frame->editor()->command(cmd).isTextInsertion()
+                && kevent->type() == PlatformKeyboardEvent::RawKeyDown)
+                return;
+
+            m_page->triggerAction(action);
+        } else
+#endif // QT_NO_SHORTCUT
         switch (kevent->windowsVirtualKeyCode()) {
 #if QT_VERSION < 0x040500
             case VK_RETURN:
@@ -424,24 +440,9 @@
                         case VK_B:
                             frame->editor()->command("ToggleBold").execute();
                             break;
-                        case VK_C:
-                            frame->editor()->command("Copy").execute();
-                            break;
                         case VK_I:
                             frame->editor()->command("ToggleItalic").execute();
                             break;
-                        case VK_V:
-                            frame->editor()->command("Paste").execute();
-                            break;
-                        case VK_X:
-                            frame->editor()->command("Cut").execute();
-                            break;
-                        case VK_Y:
-                            frame->editor()->command("Redo").execute();
-                            break;
-                        case VK_Z:
-                            frame->editor()->command("Undo").execute();
-                            break;
                         default:
                             // catch combination AltGr+key or Ctrl+Alt+key
                             if (kevent->type() != PlatformKeyboardEvent::KeyDown && kevent->altKey() && !kevent->text().isEmpty()) {
@@ -453,6 +454,11 @@
                 } else return;
         }
     } else {
+#ifndef QT_NO_SHORTCUT
+        if (kevent->qtEvent() == QKeySequence::Copy) {
+            m_page->triggerAction(QWebPage::Copy);
+        } else
+#endif // QT_NO_SHORTCUT
         switch (kevent->windowsVirtualKeyCode()) {
             case VK_UP:
                 frame->editor()->command("MoveUp").execute();
@@ -480,9 +486,6 @@
                         case VK_A:
                             frame->editor()->command("SelectAll").execute();
                             break;
-                        case VK_C: case VK_X:
-                            frame->editor()->command("Copy").execute();
-                            break;
                         default:
                             return;
                     }
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.h b/WebKit/qt/WebCoreSupport/EditorClientQt.h
index 35020b2..b39f02b 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.h
@@ -48,6 +48,7 @@
     virtual bool shouldDeleteRange(Range*);
     virtual bool shouldShowDeleteInterface(HTMLElement*);
     virtual bool smartInsertDeleteEnabled(); 
+    virtual bool isSelectTrailingWhitespaceEnabled(); 
     virtual bool isContinuousSpellCheckingEnabled();
     virtual void toggleContinuousSpellChecking();
     virtual bool isGrammarCheckingEnabled();
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 6235ed6..af96201 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -3,6 +3,7 @@
  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Coypright (C) 2008 Holger Hans Peter Freyther
  *
  * All rights reserved.
  *
@@ -197,12 +198,12 @@
     return true;
 }
 
-void FrameLoaderClientQt::savePlatformDataToCachedPage(CachedPage*) 
+void FrameLoaderClientQt::savePlatformDataToCachedFrame(CachedFrame*) 
 {
     notImplemented();
 }
 
-void FrameLoaderClientQt::transitionToCommittedFromCachedPage(CachedPage*)
+void FrameLoaderClientQt::transitionToCommittedFromCachedFrame(CachedFrame*)
 {
 }
 
@@ -211,28 +212,14 @@
     ASSERT(m_frame);
     ASSERT(m_webFrame);
 
-    Page* page = m_frame->page();
-    ASSERT(page);
-
-    bool isMainFrame = m_frame == page->mainFrame();
-
-    m_frame->setView(0);
-
-    FrameView* frameView;
-    if (isMainFrame)
-        frameView = new FrameView(m_frame, m_webFrame->page()->viewportSize());
-    else
-        frameView = new FrameView(m_frame);
-
-    m_frame->setView(frameView);
-    // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
-    frameView->deref();
-
-    if (m_webFrame && m_webFrame->page())
-        m_webFrame->d->updateBackground();
-
-    if (m_frame->ownerRenderer())
-        m_frame->ownerRenderer()->setWidget(frameView);
+    QBrush brush = m_webFrame->page()->palette().brush(QPalette::Base);
+    QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor();
+    WebCore::FrameLoaderClient::transitionToCommittedForNewPage(m_frame, m_webFrame->page()->viewportSize(),
+                                                                backgroundColor, !backgroundColor.alpha(),
+                                                                m_webFrame->page()->fixedLayoutSize(),
+                                                                m_webFrame->page()->useFixedLayout(),
+                                                                (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
+                                                                (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
 }
 
 
@@ -370,6 +357,12 @@
     if (dumpFrameLoaderCallbacks)
         printf("%s - didFinishDocumentLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
 
+    if (QWebPagePrivate::drtRun) {
+        int unloadEventCount = m_frame->eventHandler()->pendingFrameUnloadEventCount();
+        if (unloadEventCount)
+            printf("%s - has %u onunload handler(s)\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), unloadEventCount);
+    }
+
     if (m_frame->tree()->parent() || !m_webFrame)
         return;
 
@@ -396,6 +389,10 @@
         emit m_webFrame->initialLayoutCompleted();
 }
 
+void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+    notImplemented();
+}
 
 void FrameLoaderClientQt::dispatchShow()
 {
@@ -541,7 +538,9 @@
 
 void FrameLoaderClientQt::restoreViewState()
 {
-    notImplemented();
+    if (!m_webFrame)
+        return;
+    emit m_webFrame->page()->restoreFrameStateRequested(m_webFrame);
 }
 
 
@@ -621,11 +620,15 @@
     notImplemented();
 }
 
-void FrameLoaderClientQt::updateGlobalHistory(const WebCore::KURL& url)
+void FrameLoaderClientQt::updateGlobalHistory()
 {
     QWebHistoryInterface *history = QWebHistoryInterface::defaultInterface();
     if (history)
-        history->addHistoryEntry(url.prettyURL());
+        history->addHistoryEntry(m_frame->loader()->documentLoader()->urlForHistory().prettyURL());
+}
+
+void FrameLoaderClientQt::updateGlobalHistoryForRedirectWithoutHistoryItem()
+{
 }
 
 bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) const
@@ -636,7 +639,7 @@
 void FrameLoaderClientQt::saveViewStateToItem(WebCore::HistoryItem* item)
 {
     QWebHistoryItem historyItem(new QWebHistoryItemPrivate(item));
-    emit m_webFrame->aboutToUpdateHistory(&historyItem);
+    emit m_webFrame->page()->saveFrameStateRequested(m_webFrame, &historyItem);
 }
 
 bool FrameLoaderClientQt::canCachePage() const
@@ -785,6 +788,13 @@
     //qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << request.url().string`();
 }
 
+bool
+FrameLoaderClientQt::shouldUseCredentialStorage(DocumentLoader*, unsigned long)
+{
+    notImplemented();
+    return false;
+}
+
 void FrameLoaderClientQt::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
 {
     notImplemented();
@@ -881,6 +891,12 @@
     if (!page->d->acceptNavigationRequest(0, r, QWebPage::NavigationType(action.type()))) {
         if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted)
             m_frame->loader()->resetMultipleFormSubmissionProtection();
+
+        if (action.type() == NavigationTypeLinkClicked && r.url().hasFragment()) {
+            ResourceRequest emptyRequest;
+            m_frame->loader()->activeDocumentLoader()->setLastCheckedRequest(emptyRequest);
+        }
+
         slotCallPolicyFunction(PolicyIgnore);
         return;
     }
@@ -902,6 +918,12 @@
     if (!page->d->acceptNavigationRequest(m_webFrame, r, QWebPage::NavigationType(action.type()))) {
         if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted)
             m_frame->loader()->resetMultipleFormSubmissionProtection();
+
+        if (action.type() == NavigationTypeLinkClicked && r.url().hasFragment()) {
+            ResourceRequest emptyRequest;
+            m_frame->loader()->activeDocumentLoader()->setLastCheckedRequest(emptyRequest);
+        }
+
         slotCallPolicyFunction(PolicyIgnore);
         return;
     }
@@ -944,13 +966,10 @@
 
     RefPtr<Frame> childFrame = adoptRef(webFrame->d->frame);
 
-    // FIXME: All of the below should probably be moved over into WebCore
-    childFrame->tree()->setName(name);
-    m_frame->tree()->appendChild(childFrame);
     // ### set override encoding if we have one
 
     FrameLoadType loadType = m_frame->loader()->loadType();
-    FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedHistory;
+    FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedBackForwardList;
 
     childFrame->loader()->loadURL(frameData.url, frameData.referrer, String(), childLoadType, 0, 0);
 
@@ -985,7 +1004,7 @@
     if (PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType))
         return ObjectContentNetscapePlugin;
 
-    if (m_frame->page() && m_frame->page()->pluginData()->supportsMimeType(mimeType))
+    if (m_frame->page() && m_frame->page()->pluginData() && m_frame->page()->pluginData()->supportsMimeType(mimeType))
         return ObjectContentOtherPlugin;
 
     if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
@@ -1011,11 +1030,34 @@
 {
 public:
     QtPluginWidget(QWidget* w = 0): Widget(w) {}
+    ~QtPluginWidget()
+    {
+        if (platformWidget())
+            platformWidget()->deleteLater();
+    }
     virtual void invalidateRect(const IntRect& r)
     { 
         if (platformWidget())
             platformWidget()->update(r);
     }
+    virtual void frameRectsChanged()
+    {
+        if (!platformWidget())
+            return;
+
+        IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height()));
+        platformWidget()->setGeometry(windowRect);
+
+        ScrollView* parentScrollView = parent();
+        if (!parentScrollView)
+            return;
+
+        ASSERT(parentScrollView->isFrameView());
+        IntRect clipRect(static_cast<FrameView*>(parentScrollView)->windowClipRect());
+        clipRect.move(-windowRect.x(), -windowRect.y());
+        clipRect.intersect(platformWidget()->rect());
+        platformWidget()->setMask(QRegion(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()));
+    }
 };
 
 Widget* FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames,
@@ -1042,12 +1084,12 @@
     QString urlStr(url.string());
     QUrl qurl = urlStr;
 
-    QObject *object = 0;
+    QObject* object = 0;
 
     if (mimeType == "application/x-qt-plugin" || mimeType == "application/x-qt-styled-widget") {
         object = m_webFrame->page()->createPlugin(classid, qurl, params, values);
 #ifndef QT_NO_STYLE_STYLESHEET
-        QWidget *widget = qobject_cast<QWidget *>(object);
+        QWidget* widget = qobject_cast<QWidget*>(object);
         if (widget && mimeType == "application/x-qt-styled-widget") {
 
             QString styleSheet = element->getAttribute("style");
@@ -1077,12 +1119,15 @@
 #endif
 
         if (object) {
-            QWidget *widget = qobject_cast<QWidget *>(object);
-            QWidget *view = m_webFrame->page()->view();
-            if (widget && view) {
-                widget->setParent(view);
-                QtPluginWidget* w= new QtPluginWidget();
+            QWidget* widget = qobject_cast<QWidget*>(object);
+            if (widget) {
+                QWidget* view = m_webFrame->page()->view();
+                if (view)
+                    widget->setParent(view);
+                QtPluginWidget* w = new QtPluginWidget();
                 w->setPlatformWidget(widget);
+                // Make sure it's invisible until properly placed into the layout
+                w->setFrameRect(IntRect(0, 0, 0, 0));
                 return w;
             }
             // FIXME: make things work for widgetless plugins as well
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 0156412..908d2aa 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -90,6 +90,7 @@
         virtual void assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&);
 
         virtual void dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long, WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
+        virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier);
         virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
         virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
         virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long, const WebCore::ResourceResponse&);
@@ -113,6 +114,7 @@
         virtual void dispatchDidFinishDocumentLoad();
         virtual void dispatchDidFinishLoad();
         virtual void dispatchDidFirstLayout();
+        virtual void dispatchDidFirstVisuallyNonEmptyLayout();
 
         virtual WebCore::Frame* dispatchCreatePage();
         virtual void dispatchShow();
@@ -144,7 +146,8 @@
         virtual void committedLoad(WebCore::DocumentLoader*, const char*, int);
         virtual void finishedLoading(DocumentLoader*);
 
-        virtual void updateGlobalHistory(const KURL&);
+        virtual void updateGlobalHistory();
+        virtual void updateGlobalHistoryForRedirectWithoutHistoryItem();
         virtual bool shouldGoToHistoryItem(HistoryItem*) const;
 
         virtual ResourceError cancelledError(const ResourceRequest&);
@@ -175,8 +178,8 @@
 
         virtual 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 canCachePage() const;
diff --git a/WebKit/qt/WebKit_pch.h b/WebKit/qt/WebKit_pch.h
index 114121d..9ef73f6 100644
--- a/WebKit/qt/WebKit_pch.h
+++ b/WebKit/qt/WebKit_pch.h
@@ -33,13 +33,13 @@
 
 #if defined __cplusplus
 
-#if defined (_WIN32)
+#if defined(_WIN32) && !defined(_WIN32_WCE)
 #define _CRT_RAND_S
 #define _WIN32_WINNT 0x0500
 #include <windows.h>
 #endif
 
-#include "../../JavaScriptCore/kjs/config.h"
+#include "../../JavaScriptCore/config.h"
 
 #include <math.h>
 #include <stdio.h>
@@ -79,5 +79,5 @@
 #include <wtf/GetPtr.h>
 
 #include "../../WebCore/bindings/js/JSDOMBinding.h"
-#include "../../JavaScriptCore/kjs/MathObject.h"
+#include "../../JavaScriptCore/runtime/MathObject.h"
 #endif
diff --git a/WebKit/qt/tests/qwebframe/image.png b/WebKit/qt/tests/qwebframe/image.png
new file mode 100644
index 0000000..8d70364
--- /dev/null
+++ b/WebKit/qt/tests/qwebframe/image.png
Binary files differ
diff --git a/WebKit/qt/tests/qwebframe/qwebframe.pro b/WebKit/qt/tests/qwebframe/qwebframe.pro
index 9715fd6..e45e6dc 100644
--- a/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -2,5 +2,6 @@
 TARGET = tst_qwebframe
 include(../../../../WebKit.pri)
 SOURCES  += tst_qwebframe.cpp
+RESOURCES += qwebframe.qrc
 QT += testlib network
 QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/WebKit/qt/tests/qwebframe/qwebframe.qrc b/WebKit/qt/tests/qwebframe/qwebframe.qrc
new file mode 100644
index 0000000..69e62d9
--- /dev/null
+++ b/WebKit/qt/tests/qwebframe/qwebframe.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+<file>image.png</file>
+</qresource>
+</RCC>
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 3e4657c..38a3543 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -25,6 +25,9 @@
 #include <qwebview.h>
 #include <qwebframe.h>
 #include <qwebhistory.h>
+#include <QAbstractItemView>
+#include <QApplication>
+#include <QComboBox>
 #include <QRegExp>
 #include <QNetworkRequest>
 //TESTED_CLASS=
@@ -356,6 +359,10 @@
         const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 51;
         m_actuals << qVariantFromValue(arg);
     }
+    Q_INVOKABLE void myInvokableWithBoolArg(bool arg) {
+        m_qtFunctionInvoked = 52;
+        m_actuals << arg;
+    }
 
     void emitMySignal() {
         emit mySignal();
@@ -398,7 +405,7 @@
     }
     void myOverloadedSlot(QObject* arg) {
         m_qtFunctionInvoked = 41;
-        m_actuals << arg;
+        m_actuals << qVariantFromValue(arg);
     }
     void myOverloadedSlot(bool arg) {
         m_qtFunctionInvoked = 25;
@@ -538,6 +545,7 @@
 public:
     tst_QWebFrame();
     virtual ~tst_QWebFrame();
+    bool eventFilter(QObject* watched, QEvent* event);
 
 public slots:
     void init();
@@ -564,7 +572,10 @@
     void progressSignal();
     void domCycles();
     void setHtml();
+    void setHtmlWithResource();
     void ipv6HostEncoding();
+    void metaData();
+    void popupFocus();
 private:
     QString  evalJS(const QString&s) {
         // Convert an undefined return variant to the string "undefined"
@@ -610,6 +621,15 @@
         evalJS("delete retvalue; delete typevalue");
         return ret;
     }
+    QObject* firstChildByClassName(QObject* parent, const char* className) {
+        const QObjectList & children = parent->children();
+        foreach (QObject* child, children) {
+            if (!strcmp(child->metaObject()->className(), className)) {
+                return child;
+            }
+        }
+        return 0;
+    }
 
     const QString sTrue;
     const QString sFalse;
@@ -625,11 +645,13 @@
     QWebView* m_view;
     QWebPage* m_page;
     MyQObject* m_myObject;
+    QWebView* m_popupTestView;
+    int m_popupTestPaintCount;
 };
 
 tst_QWebFrame::tst_QWebFrame()
     : sTrue("true"), sFalse("false"), sUndefined("undefined"), sArray("array"), sFunction("function"), sError("error"),
-        sString("string"), sObject("object"), sNumber("number")
+        sString("string"), sObject("object"), sNumber("number"), m_popupTestView(0), m_popupTestPaintCount(0)
 {
 }
 
@@ -637,6 +659,16 @@
 {
 }
 
+bool tst_QWebFrame::eventFilter(QObject* watched, QEvent* event)
+{
+    // used on the popupFocus test
+    if (watched == m_popupTestView) {
+        if (event->type() == QEvent::Paint)
+            m_popupTestPaintCount++;
+    }
+    return QObject::eventFilter(watched, event);
+}
+
 void tst_QWebFrame::init()
 {
     m_view = new QWebView();
@@ -749,6 +781,27 @@
     QCOMPARE(evalJS("myObject.stringProperty = 123;"
                     "myObject.stringProperty"), QLatin1String("123"));
     QCOMPARE(m_myObject->stringProperty(), QLatin1String("123"));
+    QCOMPARE(evalJS("myObject.stringProperty = null"), QString());
+    QCOMPARE(evalJS("myObject.stringProperty"), QString());
+    QCOMPARE(m_myObject->stringProperty(), QString());
+    QCOMPARE(evalJS("myObject.stringProperty = undefined"), sUndefined);
+    QCOMPARE(evalJS("myObject.stringProperty"), QString());
+    QCOMPARE(m_myObject->stringProperty(), QString());
+
+    QCOMPARE(evalJS("myObject.variantProperty = new Number(1234);"
+                    "myObject.variantProperty").toDouble(), 1234.0);
+    QCOMPARE(m_myObject->variantProperty().toDouble(), 1234.0);
+
+    QCOMPARE(evalJS("myObject.variantProperty = new Boolean(1234);"
+                    "myObject.variantProperty"), sTrue);
+    QCOMPARE(m_myObject->variantProperty().toBool(), true);
+
+    QCOMPARE(evalJS("myObject.variantProperty = null;"
+                    "myObject.variantProperty.valueOf()"), sUndefined);
+    QCOMPARE(m_myObject->variantProperty(), QVariant());
+    QCOMPARE(evalJS("myObject.variantProperty = undefined;"
+                    "myObject.variantProperty.valueOf()"), sUndefined);
+    QCOMPARE(m_myObject->variantProperty(), QVariant());
 
     QCOMPARE(evalJS("myObject.variantProperty = 'foo';"
                     "myObject.variantProperty.valueOf()"), QLatin1String("foo"));
@@ -757,7 +810,6 @@
                     "myObject.variantProperty").toDouble(), 42.0);
     QCOMPARE(m_myObject->variantProperty().toDouble(), 42.0);
 
-
     QCOMPARE(evalJS("myObject.variantListProperty = [1, 'two', true];"
                     "myObject.variantListProperty.length == 3"), sTrue);
     QCOMPARE(evalJS("myObject.variantListProperty[0] === 1"), sTrue);
@@ -921,6 +973,18 @@
     QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDouble(), 123.5);
 
     m_myObject->resetQtFunctionInvoked();
+    QCOMPARE(evalJS("typeof myObject.myInvokableWithDoubleArg(new Number(1234.5))"), sUndefined);
+    QCOMPARE(m_myObject->qtFunctionInvoked(), 4);
+    QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+    QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDouble(), 1234.5);
+
+    m_myObject->resetQtFunctionInvoked();
+    QCOMPARE(evalJS("typeof myObject.myInvokableWithBoolArg(new Boolean(true))"), sUndefined);
+    QCOMPARE(m_myObject->qtFunctionInvoked(), 52);
+    QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+    QCOMPARE(m_myObject->qtFunctionActuals().at(0).toBool(), true);
+
+    m_myObject->resetQtFunctionInvoked();
     QCOMPARE(evalJS("typeof myObject.myInvokableWithStringArg('ciao')"), sUndefined);
     QCOMPARE(m_myObject->qtFunctionInvoked(), 5);
     QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
@@ -933,6 +997,20 @@
     QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QLatin1String("123"));
 
     m_myObject->resetQtFunctionInvoked();
+    QCOMPARE(evalJS("typeof myObject.myInvokableWithStringArg(null)"), sUndefined);
+    QCOMPARE(m_myObject->qtFunctionInvoked(), 5);
+    QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+    QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QString());
+    QVERIFY(m_myObject->qtFunctionActuals().at(0).toString().isEmpty());
+
+    m_myObject->resetQtFunctionInvoked();
+    QCOMPARE(evalJS("typeof myObject.myInvokableWithStringArg(undefined)"), sUndefined);
+    QCOMPARE(m_myObject->qtFunctionInvoked(), 5);
+    QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+    QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QString());
+    QVERIFY(m_myObject->qtFunctionActuals().at(0).toString().isEmpty());
+
+    m_myObject->resetQtFunctionInvoked();
     QCOMPARE(evalJS("typeof myObject.myInvokableWithIntArgs(123, 456)"), sUndefined);
     QCOMPARE(m_myObject->qtFunctionInvoked(), 6);
     QCOMPARE(m_myObject->qtFunctionActuals().size(), 2);
@@ -1057,6 +1135,28 @@
         QCOMPARE(ret.toInt(),123);
     }
 
+    m_myObject->resetQtFunctionInvoked();
+    {
+        QString type;
+        QVariant ret = evalJSV("myObject.myInvokableWithVariantArg(null)", type);
+        QCOMPARE(type, sObject);
+        QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
+        QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+        QCOMPARE(m_myObject->qtFunctionActuals().at(0), QVariant());
+        QVERIFY(!m_myObject->qtFunctionActuals().at(0).isValid());
+    }
+
+    m_myObject->resetQtFunctionInvoked();
+    {
+        QString type;
+        QVariant ret = evalJSV("myObject.myInvokableWithVariantArg(undefined)", type);
+        QCOMPARE(type, sObject);
+        QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
+        QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+        QCOMPARE(m_myObject->qtFunctionActuals().at(0), QVariant());
+        QVERIFY(!m_myObject->qtFunctionActuals().at(0).isValid());
+    }
+
     /* XFAIL - variant support
     m_myObject->resetQtFunctionInvoked();
     {
@@ -2036,6 +2136,24 @@
     QCOMPARE(m_view->page()->mainFrame()->toHtml(), html);
 }
 
+void tst_QWebFrame::setHtmlWithResource()
+{
+    QString html("<html><body><p>hello world</p><img src='qrc:/image.png'/></body></html>");
+
+    QWebPage page;
+    QWebFrame* frame = page.mainFrame();
+
+    // in few seconds, the image should be completey loaded
+    QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+    frame->setHtml(html);
+    QTest::qWait(200);
+    QCOMPARE(spy.count(), 1);
+
+    QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1);
+    QCOMPARE(frame->evaluateJavaScript("document.images[0].width").toInt(), 128);
+    QCOMPARE(frame->evaluateJavaScript("document.images[0].height").toInt(), 128);
+}
+
 class TestNetworkManager : public QNetworkAccessManager
 {
 public:
@@ -2068,5 +2186,91 @@
     QCOMPARE(networkManager->requestedUrls.at(0), QUrl::fromEncoded("http://[::1]/test.xml"));
 }
 
+void tst_QWebFrame::metaData()
+{
+    m_view->setHtml("<html>"
+                    "    <head>"
+                    "        <meta name=\"description\" content=\"Test description\">"
+                    "        <meta name=\"keywords\" content=\"HTML, JavaScript, Css\">"
+                    "    </head>"
+                    "</html>");
+
+    QMultiMap<QString, QString> metaData = m_view->page()->mainFrame()->metaData();
+
+    QCOMPARE(metaData.count(), 2);
+
+    QCOMPARE(metaData.value("description"), QString("Test description"));
+    QCOMPARE(metaData.value("keywords"), QString("HTML, JavaScript, Css"));
+    QCOMPARE(metaData.value("nonexistant"), QString());
+
+    m_view->setHtml("<html>"
+                    "    <head>"
+                    "        <meta name=\"samekey\" content=\"FirstValue\">"
+                    "        <meta name=\"samekey\" content=\"SecondValue\">"
+                    "    </head>"
+                    "</html>");
+
+    metaData = m_view->page()->mainFrame()->metaData();
+
+    QCOMPARE(metaData.count(), 2);
+
+    QStringList values = metaData.values("samekey");
+    QCOMPARE(values.count(), 2);
+
+    QVERIFY(values.contains("FirstValue"));
+    QVERIFY(values.contains("SecondValue"));
+
+    QCOMPARE(metaData.value("nonexistant"), QString());
+}
+
+void tst_QWebFrame::popupFocus()
+{
+    QWebView view;
+    view.setHtml("<html>"
+                 "    <body>"
+                 "        <select name=\"select\">"
+                 "            <option>1</option>"
+                 "            <option>2</option>"
+                 "        </select>"
+                 "        <input type=\"text\"> </input>"
+                 "        <textarea name=\"text_area\" rows=\"3\" cols=\"40\">"
+                 "This test checks whether showing and hiding a popup"
+                 "takes the focus away from the webpage."
+                 "        </textarea>"
+                 "    </body>"
+                 "</html>");
+    view.resize(400, 100);
+    view.show();
+    view.setFocus();
+    QTest::qWait(200);
+    QVERIFY2(view.hasFocus(),
+             "The WebView should be created");
+
+    // open the popup by clicking. check if focus is on the popup
+    QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(25, 25));
+    QObject* webpopup = firstChildByClassName(&view, "WebCore::QWebPopup");
+    QComboBox* combo = qobject_cast<QComboBox*>(webpopup);
+    QTest::qWait(500);
+    QVERIFY2(!view.hasFocus() && combo->view()->hasFocus(),
+             "Focus sould be on the Popup");
+
+    // hide the popup and check if focus is on the page
+    combo->hidePopup();
+    QTest::qWait(500);
+    QVERIFY2(view.hasFocus() && !combo->view()->hasFocus(),
+             "Focus sould be back on the WebView");
+
+    // triple the flashing time, should at least blink twice already
+    int delay = qApp->cursorFlashTime() * 3;
+
+    // focus the lineedit and check if it blinks
+    QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(200, 25));
+    m_popupTestView = &view;
+    view.installEventFilter( this );
+    QTest::qWait(delay);
+    QVERIFY2(m_popupTestPaintCount >= 4,
+             "The input field should have a blinking caret");
+}
+
 QTEST_MAIN(tst_QWebFrame)
 #include "tst_qwebframe.moc"
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 13b9bd2..6f2ce3b 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -27,7 +27,11 @@
 #include <qwebhistory.h>
 #include <qnetworkrequest.h>
 #include <QDebug>
+#include <QLineEdit>
 #include <QMenu>
+#include <qwebsecurityorigin.h>
+#include <qwebdatabase.h>
+#include <QPushButton>
 
 // Will try to wait for the condition while allowing event processing
 #define QTRY_COMPARE(__expr, __expected) \
@@ -81,14 +85,26 @@
 public slots:
     void init();
     void cleanup();
+    void cleanupFiles();
 
 private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
     void acceptNavigationRequest();
     void loadFinished();
     void acceptNavigationRequestWithNewWindow();
     void userStyleSheet();
     void modified();
     void contextMenuCrash();
+    void database();
+    void createPlugin();
+    void destroyPlugin();
+    void createViewlessPlugin();
+    void multiplePageGroupsAndLocalStorage();
+    void cursorMovements();
+    void textSelection();
+    void textEditing();
 
 private:
 
@@ -117,6 +133,23 @@
     delete m_view;
 }
 
+void tst_QWebPage::cleanupFiles()
+{
+    QFile::remove("Databases.db");
+    QDir::current().rmdir("http_www.myexample.com_0");
+    QFile::remove("http_www.myexample.com_0.localstorage");
+}
+
+void tst_QWebPage::initTestCase()
+{
+    cleanupFiles(); // In case there are old files from previous runs
+}
+
+void tst_QWebPage::cleanupTestCase()
+{
+    cleanupFiles(); // Be nice
+}
+
 class NavigationRequestOverride : public QWebPage
 {
 public:
@@ -203,7 +236,7 @@
         return true;
     }
 
-    virtual QWebPage* createWindow(WebWindowType type) {
+    virtual QWebPage* createWindow(WebWindowType) {
         QWebPage* page = new TestPage(this);
         createdWindows.append(page);
         return page;
@@ -320,7 +353,7 @@
     m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fourth page"));
     QVERIFY(m_page->history()->count() == 2);
     m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fifth page"));
-    QVERIFY(::waitForSignal(m_page->mainFrame(), SIGNAL(aboutToUpdateHistory(QWebHistoryItem*))));
+    QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*))));
 }
 
 void tst_QWebPage::contextMenuCrash()
@@ -338,5 +371,613 @@
     delete contextMenu;
 }
 
+void tst_QWebPage::database()
+{
+    QString path = QDir::currentPath();
+    m_page->settings()->setOfflineStoragePath(path);
+    QVERIFY(m_page->settings()->offlineStoragePath() == path);
+
+    QWebSettings::setOfflineStorageDefaultQuota(1024 * 1024);
+    QVERIFY(QWebSettings::offlineStorageDefaultQuota() == 1024 * 1024);
+
+    QString dbFileName = path + "Databases.db";
+
+    if (QFile::exists(dbFileName))
+        QFile::remove(dbFileName);
+
+    qRegisterMetaType<QWebFrame*>("QWebFrame*");
+    QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame *, QString)));
+    m_view->setHtml(QString("<html><head><script>var db; db=openDatabase('testdb', '1.0', 'test database API', 50000); </script></head><body><div></div></body></html>"), QUrl("http://www.myexample.com"));
+    QTRY_COMPARE(spy.count(), 1);
+    m_page->mainFrame()->evaluateJavaScript("var db2; db2=openDatabase('testdb', '1.0', 'test database API', 50000);");
+    QTRY_COMPARE(spy.count(),1);
+
+    m_page->mainFrame()->evaluateJavaScript("localStorage.test='This is a test for local storage';");
+    m_view->setHtml(QString("<html><body id='b'>text</body></html>"), QUrl("http://www.myexample.com"));
+
+    QVariant s1 = m_page->mainFrame()->evaluateJavaScript("localStorage.test");
+    QCOMPARE(s1.toString(), QString("This is a test for local storage"));
+
+    m_page->mainFrame()->evaluateJavaScript("sessionStorage.test='This is a test for session storage';");
+    m_view->setHtml(QString("<html><body id='b'>text</body></html>"), QUrl("http://www.myexample.com"));
+    QVariant s2 = m_page->mainFrame()->evaluateJavaScript("sessionStorage.test");
+    QCOMPARE(s2.toString(), QString("This is a test for session storage"));
+
+    m_view->setHtml(QString("<html><head></head><body><div></div></body></html>"), QUrl("http://www.myexample.com"));
+    m_page->mainFrame()->evaluateJavaScript("var db3; db3=openDatabase('testdb', '1.0', 'test database API', 50000);db3.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Test (text TEXT)', []); }, function(tx, result) { }, function(tx, error) { });");
+    QTest::qWait(200);
+
+    QWebSecurityOrigin origin = m_page->mainFrame()->securityOrigin();
+    QList<QWebDatabase> dbs = origin.databases();
+    if (dbs.count() > 0) {
+        QString fileName = dbs[0].fileName();
+        QVERIFY(QFile::exists(fileName));
+        QWebDatabase::removeDatabase(dbs[0]);
+        QVERIFY(!QFile::exists(fileName));
+    }
+    QTest::qWait(1000);
+}
+
+class PluginPage : public QWebPage
+{
+public:
+    PluginPage(QObject *parent = 0)
+        : QWebPage(parent) {}
+
+    struct CallInfo
+    {
+        CallInfo(const QString &c, const QUrl &u,
+                 const QStringList &pn, const QStringList &pv,
+                 QObject *r)
+            : classid(c), url(u), paramNames(pn),
+              paramValues(pv), returnValue(r)
+            {}
+        QString classid;
+        QUrl url;
+        QStringList paramNames;
+        QStringList paramValues;
+        QObject *returnValue;
+    };
+
+    QList<CallInfo> calls;
+
+protected:
+    virtual QObject *createPlugin(const QString &classid, const QUrl &url,
+                                  const QStringList &paramNames,
+                                  const QStringList &paramValues)
+    {
+        QObject *result = 0;
+        if (classid == "pushbutton")
+            result = new QPushButton();
+        else if (classid == "lineedit")
+            result = new QLineEdit();
+        if (result)
+            result->setObjectName(classid);
+        calls.append(CallInfo(classid, url, paramNames, paramValues, result));
+        return result;
+    }
+};
+
+void tst_QWebPage::createPlugin()
+{
+    QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool)));
+
+    PluginPage* newPage = new PluginPage(m_view);
+    m_view->setPage(newPage);
+
+    // plugins not enabled by default, so the plugin shouldn't be loaded
+    m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
+    QTRY_COMPARE(loadSpy.count(), 1);
+    QCOMPARE(newPage->calls.count(), 0);
+
+    m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+
+    // type has to be application/x-qt-plugin
+    m_view->setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='pushbutton' id='mybutton'/></body></html>"));
+    QTRY_COMPARE(loadSpy.count(), 2);
+    QCOMPARE(newPage->calls.count(), 0);
+
+    m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
+    QTRY_COMPARE(loadSpy.count(), 3);
+    QCOMPARE(newPage->calls.count(), 1);
+    {
+        PluginPage::CallInfo ci = newPage->calls.takeFirst();
+        QCOMPARE(ci.classid, QString::fromLatin1("pushbutton"));
+        QCOMPARE(ci.url, QUrl());
+        QCOMPARE(ci.paramNames.count(), 3);
+        QCOMPARE(ci.paramValues.count(), 3);
+        QCOMPARE(ci.paramNames.at(0), QString::fromLatin1("type"));
+        QCOMPARE(ci.paramValues.at(0), QString::fromLatin1("application/x-qt-plugin"));
+        QCOMPARE(ci.paramNames.at(1), QString::fromLatin1("classid"));
+        QCOMPARE(ci.paramValues.at(1), QString::fromLatin1("pushbutton"));
+        QCOMPARE(ci.paramNames.at(2), QString::fromLatin1("id"));
+        QCOMPARE(ci.paramValues.at(2), QString::fromLatin1("mybutton"));
+        QVERIFY(ci.returnValue != 0);
+        QVERIFY(ci.returnValue->inherits("QPushButton"));
+    }
+    // test JS bindings
+    QCOMPARE(newPage->mainFrame()->evaluateJavaScript("document.getElementById('mybutton').toString()").toString(),
+             QString::fromLatin1("[object HTMLObjectElement]"));
+    QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mybutton.toString()").toString(),
+             QString::fromLatin1("[object HTMLObjectElement]"));
+    QCOMPARE(newPage->mainFrame()->evaluateJavaScript("typeof mybutton.objectName").toString(),
+             QString::fromLatin1("string"));
+    QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mybutton.objectName").toString(),
+             QString::fromLatin1("pushbutton"));
+    QCOMPARE(newPage->mainFrame()->evaluateJavaScript("typeof mybutton.clicked").toString(),
+             QString::fromLatin1("function"));
+    QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mybutton.clicked.toString()").toString(),
+             QString::fromLatin1("function clicked() {\n    [native code]\n}"));
+
+    m_view->setHtml(QString("<html><body><table>"
+                            "<tr><object type='application/x-qt-plugin' classid='lineedit' id='myedit'/></tr>"
+                            "<tr><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></tr>"
+                            "</table></body></html>"), QUrl("http://foo.bar.baz"));
+    QTRY_COMPARE(loadSpy.count(), 4);
+    QCOMPARE(newPage->calls.count(), 2);
+    {
+        PluginPage::CallInfo ci = newPage->calls.takeFirst();
+        QCOMPARE(ci.classid, QString::fromLatin1("lineedit"));
+        QCOMPARE(ci.url, QUrl());
+        QCOMPARE(ci.paramNames.count(), 3);
+        QCOMPARE(ci.paramValues.count(), 3);
+        QCOMPARE(ci.paramNames.at(0), QString::fromLatin1("type"));
+        QCOMPARE(ci.paramValues.at(0), QString::fromLatin1("application/x-qt-plugin"));
+        QCOMPARE(ci.paramNames.at(1), QString::fromLatin1("classid"));
+        QCOMPARE(ci.paramValues.at(1), QString::fromLatin1("lineedit"));
+        QCOMPARE(ci.paramNames.at(2), QString::fromLatin1("id"));
+        QCOMPARE(ci.paramValues.at(2), QString::fromLatin1("myedit"));
+        QVERIFY(ci.returnValue != 0);
+        QVERIFY(ci.returnValue->inherits("QLineEdit"));
+    }
+    {
+        PluginPage::CallInfo ci = newPage->calls.takeFirst();
+        QCOMPARE(ci.classid, QString::fromLatin1("pushbutton"));
+        QCOMPARE(ci.url, QUrl());
+        QCOMPARE(ci.paramNames.count(), 3);
+        QCOMPARE(ci.paramValues.count(), 3);
+        QCOMPARE(ci.paramNames.at(0), QString::fromLatin1("type"));
+        QCOMPARE(ci.paramValues.at(0), QString::fromLatin1("application/x-qt-plugin"));
+        QCOMPARE(ci.paramNames.at(1), QString::fromLatin1("classid"));
+        QCOMPARE(ci.paramValues.at(1), QString::fromLatin1("pushbutton"));
+        QCOMPARE(ci.paramNames.at(2), QString::fromLatin1("id"));
+        QCOMPARE(ci.paramValues.at(2), QString::fromLatin1("mybutton"));
+        QVERIFY(ci.returnValue != 0);
+        QVERIFY(ci.returnValue->inherits("QPushButton"));
+    }
+
+    m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, false);
+
+    m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
+    QTRY_COMPARE(loadSpy.count(), 5);
+    QCOMPARE(newPage->calls.count(), 0);
+}
+
+class PluginTrackedPage : public QWebPage
+{
+public:
+
+    int count;
+    QPointer<QWidget> widget;
+
+    PluginTrackedPage(QWidget *parent = 0) : QWebPage(parent), count(0) {
+       settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+    }
+
+    virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) {
+       count++;
+       QWidget *w = new QWidget;
+       widget = w;
+       return w;
+    }
+};
+
+void tst_QWebPage::destroyPlugin()
+{
+    PluginTrackedPage* page = new PluginTrackedPage(m_view);
+    m_view->setPage(page);
+
+    // we create the plugin, so the widget should be constructed
+    QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>");
+    m_view->setHtml(content);
+    QVERIFY(page->widget != 0);
+    QCOMPARE(page->count, 1);
+
+    // navigate away, the plugin widget should be destructed
+    m_view->setHtml("<html><body>Hi</body></html>");
+    QTestEventLoop::instance().enterLoop(1);
+    QVERIFY(page->widget == 0);
+}
+
+void tst_QWebPage::createViewlessPlugin()
+{
+    PluginTrackedPage* page = new PluginTrackedPage;
+    QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>");
+    page->mainFrame()->setHtml(content);
+    QCOMPARE(page->count, 1);
+    QVERIFY(page->widget != 0);
+    delete page;
+}
+
+// import private API
+void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName);
+QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page);
+void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path);
+
+void tst_QWebPage::multiplePageGroupsAndLocalStorage()
+{
+    QDir dir(QDir::currentPath());
+    dir.mkdir("path1");
+    dir.mkdir("path2");
+
+    QWebView view1;
+    QWebView view2;
+
+    qt_websettings_setLocalStorageDatabasePath(view1.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
+    qt_webpage_setGroupName(view1.page(), "group1");
+    qt_websettings_setLocalStorageDatabasePath(view2.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
+    qt_webpage_setGroupName(view2.page(), "group2");
+    QCOMPARE(qt_webpage_groupName(view1.page()), QString("group1"));
+    QCOMPARE(qt_webpage_groupName(view2.page()), QString("group2"));
+
+
+    view1.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+    view2.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+
+    view1.page()->mainFrame()->evaluateJavaScript("localStorage.test='value1';");
+    view2.page()->mainFrame()->evaluateJavaScript("localStorage.test='value2';");
+
+    view1.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+    view2.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+
+    QVariant s1 = view1.page()->mainFrame()->evaluateJavaScript("localStorage.test");
+    QCOMPARE(s1.toString(), QString("value1"));
+
+    QVariant s2 = view2.page()->mainFrame()->evaluateJavaScript("localStorage.test");
+    QCOMPARE(s2.toString(), QString("value2"));
+
+    QTest::qWait(1000);
+
+    QFile::remove(QDir::toNativeSeparators(QDir::currentPath() + "/path1/http_www.myexample.com_0.localstorage"));
+    QFile::remove(QDir::toNativeSeparators(QDir::currentPath() + "/path2/http_www.myexample.com_0.localstorage"));
+    dir.rmdir(QDir::toNativeSeparators("./path1"));
+    dir.rmdir(QDir::toNativeSeparators("./path2"));
+}
+
+class CursorTrackedPage : public QWebPage
+{
+public:
+
+    CursorTrackedPage(QWidget *parent = 0): QWebPage(parent) {
+        setViewportSize(QSize(1024, 768)); // big space
+    }
+
+    QString selectedText() {
+        return mainFrame()->evaluateJavaScript("window.getSelection().toString()").toString();
+    }
+
+    int selectionStartOffset() {
+        return mainFrame()->evaluateJavaScript("window.getSelection().getRangeAt(0).startOffset").toInt();
+    }
+
+    int selectionEndOffset() {
+        return mainFrame()->evaluateJavaScript("window.getSelection().getRangeAt(0).endOffset").toInt();
+    }
+
+    // true if start offset == end offset, i.e. no selected text
+    int isSelectionCollapsed() {
+        return mainFrame()->evaluateJavaScript("window.getSelection().getRangeAt(0).collapsed").toBool();
+    }
+};
+
+void tst_QWebPage::cursorMovements()
+{
+    CursorTrackedPage* page = new CursorTrackedPage;
+    QString content("<html><body<p id=one>The quick brown fox</p><p id=two>jumps over the lazy dog</p><p>May the source<br/>be with you!</p></body></html>");
+    page->mainFrame()->setHtml(content);
+
+    // this will select the first paragraph
+    QString script = "var range = document.createRange(); " \
+        "var node = document.getElementById(\"one\"); " \
+        "range.selectNode(node); " \
+        "getSelection().addRange(range);";
+    page->mainFrame()->evaluateJavaScript(script);
+    QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
+
+    // these actions must exist
+    QVERIFY(page->action(QWebPage::MoveToNextChar) != 0);
+    QVERIFY(page->action(QWebPage::MoveToPreviousChar) != 0);
+    QVERIFY(page->action(QWebPage::MoveToNextWord) != 0);
+    QVERIFY(page->action(QWebPage::MoveToPreviousWord) != 0);
+    QVERIFY(page->action(QWebPage::MoveToNextLine) != 0);
+    QVERIFY(page->action(QWebPage::MoveToPreviousLine) != 0);
+    QVERIFY(page->action(QWebPage::MoveToStartOfLine) != 0);
+    QVERIFY(page->action(QWebPage::MoveToEndOfLine) != 0);
+    QVERIFY(page->action(QWebPage::MoveToStartOfBlock) != 0);
+    QVERIFY(page->action(QWebPage::MoveToEndOfBlock) != 0);
+    QVERIFY(page->action(QWebPage::MoveToStartOfDocument) != 0);
+    QVERIFY(page->action(QWebPage::MoveToEndOfDocument) != 0);
+
+    // right now they are disabled because contentEditable is false
+    QCOMPARE(page->action(QWebPage::MoveToNextChar)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToPreviousChar)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToNextWord)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToPreviousWord)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToNextLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToPreviousLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToStartOfLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToEndOfLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToStartOfBlock)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToEndOfBlock)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToStartOfDocument)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::MoveToEndOfDocument)->isEnabled(), false);
+
+    // make it editable before navigating the cursor
+    page->setContentEditable(true);
+
+    // here the actions are enabled after contentEditable is true
+    QCOMPARE(page->action(QWebPage::MoveToNextChar)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToPreviousChar)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToNextWord)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToPreviousWord)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToNextLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToPreviousLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToStartOfLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToEndOfLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToStartOfBlock)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToEndOfBlock)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToStartOfDocument)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::MoveToEndOfDocument)->isEnabled(), true);
+
+    // cursor will be before the word "jump"
+    page->triggerAction(QWebPage::MoveToNextChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 0);
+
+    // cursor will be between 'j' and 'u' in the word "jump"
+    page->triggerAction(QWebPage::MoveToNextChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 1);
+
+    // cursor will be between 'u' and 'm' in the word "jump"
+    page->triggerAction(QWebPage::MoveToNextChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 2);
+
+    // cursor will be after the word "jump"
+    page->triggerAction(QWebPage::MoveToNextWord);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 5);
+
+    // cursor will be after the word "lazy"
+    page->triggerAction(QWebPage::MoveToNextWord);
+    page->triggerAction(QWebPage::MoveToNextWord);
+    page->triggerAction(QWebPage::MoveToNextWord);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 19);
+
+    // cursor will be between 'z' and 'y' in "lazy"
+    page->triggerAction(QWebPage::MoveToPreviousChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 18);
+
+    // cursor will be between 'a' and 'z' in "lazy"
+    page->triggerAction(QWebPage::MoveToPreviousChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 17);
+
+    // cursor will be before the word "lazy"
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 15);
+
+    // cursor will be before the word "quick"
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 4);
+
+    // cursor will be between 'p' and 's' in the word "jumps"
+    page->triggerAction(QWebPage::MoveToNextWord);
+    page->triggerAction(QWebPage::MoveToNextWord);
+    page->triggerAction(QWebPage::MoveToNextWord);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 4);
+
+    // cursor will be before the word "jumps"
+    page->triggerAction(QWebPage::MoveToStartOfLine);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 0);
+
+    // cursor will be after the word "dog"
+    page->triggerAction(QWebPage::MoveToEndOfLine);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 23);
+
+    // cursor will be between 'w' and 'n' in "brown"
+    page->triggerAction(QWebPage::MoveToStartOfLine);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 14);
+
+    // cursor will be after the word "fox"
+    page->triggerAction(QWebPage::MoveToEndOfLine);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 19);
+
+    // cursor will be before the word "The"
+    page->triggerAction(QWebPage::MoveToStartOfDocument);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 0);
+
+    // cursor will be after the word "you!"
+    page->triggerAction(QWebPage::MoveToEndOfDocument);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 12);
+
+    // cursor will be before the word "be"
+    page->triggerAction(QWebPage::MoveToStartOfBlock);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 2);
+
+    // cursor will be after the word "you!"
+    page->triggerAction(QWebPage::MoveToEndOfBlock);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 12);
+
+    // try to move before the document start
+    page->triggerAction(QWebPage::MoveToStartOfDocument);
+    page->triggerAction(QWebPage::MoveToPreviousChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 0);
+    page->triggerAction(QWebPage::MoveToStartOfDocument);
+    page->triggerAction(QWebPage::MoveToPreviousWord);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 0);
+
+    // try to move past the document end
+    page->triggerAction(QWebPage::MoveToEndOfDocument);
+    page->triggerAction(QWebPage::MoveToNextChar);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 12);
+    page->triggerAction(QWebPage::MoveToEndOfDocument);
+    page->triggerAction(QWebPage::MoveToNextWord);
+    QVERIFY(page->isSelectionCollapsed());
+    QCOMPARE(page->selectionStartOffset(), 12);
+
+    delete page;
+}
+
+void tst_QWebPage::textSelection()
+{
+    CursorTrackedPage* page = new CursorTrackedPage;
+    QString content("<html><body<p id=one>The quick brown fox</p>" \
+        "<p id=two>jumps over the lazy dog</p>" \
+        "<p>May the source<br/>be with you!</p></body></html>");
+    page->mainFrame()->setHtml(content);
+
+    // this will select the first paragraph
+    QString script = "var range = document.createRange(); " \
+        "var node = document.getElementById(\"one\"); " \
+        "range.selectNode(node); " \
+        "getSelection().addRange(range);";
+    page->mainFrame()->evaluateJavaScript(script);
+    QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
+
+    // these actions must exist
+    QVERIFY(page->action(QWebPage::SelectNextChar) != 0);
+    QVERIFY(page->action(QWebPage::SelectPreviousChar) != 0);
+    QVERIFY(page->action(QWebPage::SelectNextWord) != 0);
+    QVERIFY(page->action(QWebPage::SelectPreviousWord) != 0);
+    QVERIFY(page->action(QWebPage::SelectNextLine) != 0);
+    QVERIFY(page->action(QWebPage::SelectPreviousLine) != 0);
+    QVERIFY(page->action(QWebPage::SelectStartOfLine) != 0);
+    QVERIFY(page->action(QWebPage::SelectEndOfLine) != 0);
+    QVERIFY(page->action(QWebPage::SelectStartOfBlock) != 0);
+    QVERIFY(page->action(QWebPage::SelectEndOfBlock) != 0);
+    QVERIFY(page->action(QWebPage::SelectStartOfDocument) != 0);
+    QVERIFY(page->action(QWebPage::SelectEndOfDocument) != 0);
+
+    // right now they are disabled because contentEditable is false
+    QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectPreviousWord)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectNextLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectPreviousLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectStartOfLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectEndOfLine)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectStartOfBlock)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectEndOfBlock)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), false);
+
+    // make it editable before navigating the cursor
+    page->setContentEditable(true);
+
+    // here the actions are enabled after contentEditable is true
+    QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectPreviousWord)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectNextLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectPreviousLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectStartOfLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectEndOfLine)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectStartOfBlock)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectEndOfBlock)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), true);
+
+    delete page;
+}
+
+void tst_QWebPage::textEditing()
+{
+    CursorTrackedPage* page = new CursorTrackedPage;
+    QString content("<html><body<p id=one>The quick brown fox</p>" \
+        "<p id=two>jumps over the lazy dog</p>" \
+        "<p>May the source<br/>be with you!</p></body></html>");
+    page->mainFrame()->setHtml(content);
+
+    // this will select the first paragraph
+    QString script = "var range = document.createRange(); " \
+        "var node = document.getElementById(\"one\"); " \
+        "range.selectNode(node); " \
+        "getSelection().addRange(range);";
+    page->mainFrame()->evaluateJavaScript(script);
+    QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
+
+    // these actions must exist
+    QVERIFY(page->action(QWebPage::DeleteStartOfWord) != 0);
+    QVERIFY(page->action(QWebPage::DeleteEndOfWord) != 0);
+    QVERIFY(page->action(QWebPage::SetTextDirectionDefault) != 0);
+    QVERIFY(page->action(QWebPage::SetTextDirectionLeftToRight) != 0);
+    QVERIFY(page->action(QWebPage::SetTextDirectionRightToLeft) != 0);
+    QVERIFY(page->action(QWebPage::ToggleBold) != 0);
+    QVERIFY(page->action(QWebPage::ToggleItalic) != 0);
+    QVERIFY(page->action(QWebPage::ToggleUnderline) != 0);
+
+    // right now they are disabled because contentEditable is false
+    QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::DeleteEndOfWord)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SetTextDirectionDefault)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SetTextDirectionLeftToRight)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::SetTextDirectionRightToLeft)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), false);
+    QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), false);
+
+    // make it editable before navigating the cursor
+    page->setContentEditable(true);
+
+    // here the actions are enabled after contentEditable is true
+    QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::DeleteEndOfWord)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SetTextDirectionDefault)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SetTextDirectionLeftToRight)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::SetTextDirectionRightToLeft)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), true);
+    QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), true);
+
+    delete page;
+}
+
+
 QTEST_MAIN(tst_QWebPage)
 #include "tst_qwebpage.moc"
diff --git a/WebKit/win/AccessibleBase.cpp b/WebKit/win/AccessibleBase.cpp
index fdf9404..df91151 100644
--- a/WebKit/win/AccessibleBase.cpp
+++ b/WebKit/win/AccessibleBase.cpp
@@ -102,7 +102,7 @@
 {
     *parent = 0;
 
-    if (!m_object)
+    if (!m_object || !m_object->topDocumentFrameView())
         return E_FAIL;
 
     return WebView::AccessibleObjectFromWindow(m_object->topDocumentFrameView()->hostWindow()->platformWindow(),
@@ -393,6 +393,9 @@
     if (FAILED(hr))
         return hr;
 
+    if (!childObj->documentFrameView())
+        return E_FAIL;
+
     IntRect screenRect(childObj->documentFrameView()->contentsToScreen(childObj->boundingBoxRect()));
     *left = screenRect.x();
     *top = screenRect.y();
@@ -465,7 +468,7 @@
 
     ::VariantInit(pvChildAtPoint);
 
-    if (!m_object)
+    if (!m_object || !m_object->documentFrameView())
         return E_FAIL;
 
     IntPoint point = m_object->documentFrameView()->screenToContents(IntPoint(x, y));
diff --git a/WebKit/win/COMPropertyBag.h b/WebKit/win/COMPropertyBag.h
index 6bec57f..ae4a7b7 100644
--- a/WebKit/win/COMPropertyBag.h
+++ b/WebKit/win/COMPropertyBag.h
@@ -34,10 +34,10 @@
 

 #include "COMVariantSetter.h"

 

-template<typename ValueType, typename HashType = typename WebCore::StringHash>

+template<typename ValueType, typename KeyType = typename WebCore::String, typename HashType = typename WebCore::StringHash>

 class COMPropertyBag : public IPropertyBag, public IPropertyBag2, Noncopyable {

 public:

-    typedef HashMap<WebCore::String, ValueType, HashType> HashMapType;

+    typedef HashMap<KeyType, ValueType, HashType> HashMapType;

 

     static COMPropertyBag* createInstance(const HashMapType&);

     static COMPropertyBag* adopt(HashMapType&);

@@ -77,16 +77,16 @@
 };

 

 // COMPropertyBag ------------------------------------------------------------------

-template<typename ValueType, typename HashType>

-COMPropertyBag<ValueType, HashType>* COMPropertyBag<typename ValueType, HashType>::createInstance(const HashMapType& hashMap)

+template<typename ValueType, typename KeyType, typename HashType>

+COMPropertyBag<ValueType, KeyType, HashType>* COMPropertyBag<typename ValueType, typename KeyType, HashType>::createInstance(const HashMapType& hashMap)

 {

     COMPropertyBag* instance = new COMPropertyBag(hashMap);

     instance->AddRef();

     return instance;

 }

 

-template<typename ValueType, typename HashType>

-COMPropertyBag<ValueType, HashType>* COMPropertyBag<typename ValueType, HashType>::adopt(HashMapType& hashMap)

+template<typename ValueType, typename KeyType, typename HashType>

+COMPropertyBag<ValueType, KeyType, HashType>* COMPropertyBag<typename ValueType, typename KeyType, HashType>::adopt(HashMapType& hashMap)

 {

     COMPropertyBag* instance = new COMPropertyBag;

     instance->m_hashMap.swap(hashMap);

@@ -95,8 +95,8 @@
 }

 

 // IUnknown ------------------------------------------------------------------------

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::QueryInterface(REFIID riid, void** ppvObject)

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::QueryInterface(REFIID riid, void** ppvObject)

 {

     *ppvObject = 0;

     if (IsEqualGUID(riid, IID_IUnknown))

@@ -112,14 +112,14 @@
     return S_OK;

 }

 

-template<typename ValueType, typename HashType>

-ULONG STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::AddRef()

+template<typename ValueType, typename KeyType, typename HashType>

+ULONG STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::AddRef()

 {

     return ++m_refCount;

 }

 

-template<typename ValueType, typename HashType>

-ULONG STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::Release()

+template<typename ValueType, typename KeyType, typename HashType>

+ULONG STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::Release()

 {

     ULONG newRef = --m_refCount;

     if (!newRef)

@@ -130,8 +130,8 @@
 

 // IPropertyBag --------------------------------------------------------------------

 

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog)

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog)

 {

     if (!pszPropName)

         return E_POINTER;

@@ -145,32 +145,45 @@
     V_VT(pVar) = VT_EMPTY;

     COMVariantSetter<ValueType>::setVariant(pVar, it->second);

 

-    if (requestedType != COMVariantSetter<ValueType>::VariantType && requestedType != VT_EMPTY)

+    if (requestedType != COMVariantSetter<ValueType>::variantType(it->second) && requestedType != VT_EMPTY)

         return ::VariantChangeType(pVar, pVar, VARIANT_NOUSEROVERRIDE | VARIANT_ALPHABOOL, requestedType);

 

     return S_OK;

 }

 

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::Write(LPCOLESTR pszPropName, VARIANT* pVar)

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::Write(LPCOLESTR pszPropName, VARIANT* pVar)

 {

     return E_FAIL;

 }

 

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::Read(ULONG cProperties, PROPBAG2*, IErrorLog*, VARIANT* pvarValue, HRESULT* phrError)

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::Read(ULONG cProperties, PROPBAG2* pPropBag, IErrorLog* pErrorLog, VARIANT* pvarValue, HRESULT* phrError)

+{

+    if (!pPropBag || !pvarValue || !phrError)

+        return E_POINTER;

+

+    HRESULT hr = S_OK;

+

+    for (ULONG i = 0; i < cProperties; ++i) {

+        VariantInit(&pvarValue[i]);

+        pvarValue[i].vt = pPropBag[i].vt;

+        phrError[i] = Read(pPropBag[i].pstrName, &pvarValue[i], pErrorLog);

+        if (FAILED(phrError[i]))

+            hr = E_FAIL;

+    }

+

+    return hr;

+}

+

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::Write(ULONG cProperties, PROPBAG2*, VARIANT*)

 {

     return E_NOTIMPL;

 }

 

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::Write(ULONG cProperties, PROPBAG2*, VARIANT*)

-{

-    return E_NOTIMPL;

-}

-

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::CountProperties(ULONG* pcProperties)

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::CountProperties(ULONG* pcProperties)

 {

     if (!pcProperties)

         return E_POINTER;

@@ -179,8 +192,8 @@
     return S_OK;

 }

 

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::GetPropertyInfo(ULONG iProperty, ULONG cProperties, PROPBAG2* pPropBag, ULONG* pcProperties)

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::GetPropertyInfo(ULONG iProperty, ULONG cProperties, PROPBAG2* pPropBag, ULONG* pcProperties)

 {

     if (!pPropBag || !pcProperties)

         return E_POINTER;

@@ -196,11 +209,11 @@
         ;

     for (ULONG j = 0; j < cProperties && current != end; ++j, ++current) {

         // FIXME: the following fields aren't filled in

-        //pPropBag[j].dwType;   // (DWORD) Type of property. This will be one of the PROPBAG2_TYPE values.
-        //pPropBag[j].cfType;   // (CLIPFORMAT) Clipboard format or MIME type of the property.
-        //pPropBag[j].clsid;    // (CLSID) CLSID of the object. This member is valid only if dwType is PROPBAG2_TYPE_OBJECT.
+        //pPropBag[j].cfType;   // (CLIPFORMAT) Clipboard format or MIME type of the property.

+        //pPropBag[j].clsid;    // (CLSID) CLSID of the object. This member is valid only if dwType is PROPBAG2_TYPE_OBJECT.

 

-        pPropBag[j].vt = COMVariantSetter<ValueType>::VariantType;

+        pPropBag[j].dwType = PROPBAG2_TYPE_DATA;

+        pPropBag[j].vt = COMVariantSetter<ValueType>::variantType(current->second);

         pPropBag[j].dwHint = iProperty + j;

         pPropBag[j].pstrName = (LPOLESTR)CoTaskMemAlloc(sizeof(wchar_t)*(current->first.length()+1));

         if (!pPropBag[j].pstrName)

@@ -211,8 +224,8 @@
     return S_OK;

 }

 

-template<typename ValueType, typename HashType>

-HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, HashType>::LoadObject(LPCOLESTR pstrName, DWORD dwHint, IUnknown*, IErrorLog*)

+template<typename ValueType, typename KeyType, typename HashType>

+HRESULT STDMETHODCALLTYPE COMPropertyBag<ValueType, KeyType, HashType>::LoadObject(LPCOLESTR pstrName, DWORD dwHint, IUnknown*, IErrorLog*)

 {

     return E_NOTIMPL;

 }

diff --git a/WebKit/win/COMVariantSetter.h b/WebKit/win/COMVariantSetter.h
index 5c6b21c..76ca927 100644
--- a/WebKit/win/COMVariantSetter.h
+++ b/WebKit/win/COMVariantSetter.h
@@ -36,7 +36,15 @@
 

 template<typename T> struct COMVariantSetter {};

 

-template<> struct COMVariantSetter<WebCore::String>

+template<typename T> struct COMVariantSetterBase

+{

+    static inline VARENUM variantType(const T&)

+    {

+        return COMVariantSetter<T>::VariantType;

+    }

+};

+

+template<> struct COMVariantSetter<WebCore::String> : COMVariantSetterBase<WebCore::String>

 {

     static const VARENUM VariantType = VT_BSTR;

 

@@ -49,7 +57,7 @@
     }

 };

 

-template<> struct COMVariantSetter<unsigned long long>

+template<> struct COMVariantSetter<unsigned long long> : COMVariantSetterBase<unsigned long long>

 {

     static const VARENUM VariantType = VT_UI8;

 

@@ -62,7 +70,7 @@
     }

 };

 

-template<> struct COMVariantSetter<int>

+template<> struct COMVariantSetter<int> : COMVariantSetterBase<int>

 {

     static const VARENUM VariantType = VT_I4;

 

@@ -75,7 +83,7 @@
     }

 };

 

-template<typename T> struct COMVariantSetter<COMPtr<T> >

+template<typename T> struct COMVariantSetter<COMPtr<T> > : COMVariantSetterBase<COMPtr<T> >

 {

     static const VARENUM VariantType = VT_UNKNOWN;

 

@@ -90,7 +98,7 @@
 };

 

 template<typename COMType, typename UnderlyingType>

-struct COMIUnknownVariantSetter

+struct COMIUnknownVariantSetter : COMVariantSetterBase<UnderlyingType>

 {

     static const VARENUM VariantType = VT_UNKNOWN;

 

@@ -103,4 +111,61 @@
     }

 };

 

+class COMVariant {

+public:

+    COMVariant()

+    {

+        ::VariantInit(&m_variant);

+    }

+

+    template<typename UnderlyingType>

+    COMVariant(UnderlyingType value)

+    {

+        ::VariantInit(&m_variant);

+        COMVariantSetter<UnderlyingType>::setVariant(&m_variant, value);

+    }

+

+    ~COMVariant()

+    {

+        ::VariantClear(&m_variant);

+    }

+

+    COMVariant(const COMVariant& other)

+    {

+        ::VariantInit(&m_variant);

+        other.copyTo(&m_variant);

+    }

+

+    COMVariant& operator=(const COMVariant& other)

+    {

+        other.copyTo(&m_variant);

+        return *this;

+    }

+

+    void copyTo(VARIANT* dest) const

+    {

+        ::VariantCopy(dest, const_cast<VARIANT*>(&m_variant));

+    }

+

+    VARENUM variantType() const { return static_cast<VARENUM>(V_VT(&m_variant)); }

+

+private:

+    VARIANT m_variant;

+};

+

+template<> struct COMVariantSetter<COMVariant>

+{

+    static inline VARENUM variantType(const COMVariant& value)

+    {

+        return value.variantType();

+    }

+

+    static void setVariant(VARIANT* variant, const COMVariant& value)

+    {

+        ASSERT(V_VT(variant) == VT_EMPTY);

+

+        value.copyTo(variant);

+    }

+};

+

 #endif // COMVariantSetter

diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index ae26480..bbafe2e 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,1648 @@
+2009-02-12  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40886.
+
+    2009-02-11  Brady Eidson  <beidson@apple.com>
+
+        Fix my last checkin for more effect.
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):
+
+2009-02-12  Mark Rowe  <mrowe@apple.com>
+
+        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.
+
+        * WebHistory.cpp:
+        (WebHistory::loadHistoryGutsFromURL):
+        (WebHistory::addItems):
+        (WebHistory::addItem): 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.
+        (WebHistory::visitedURL): Swap the removeItemFromDateCaches and visitedWithTitle calls.
+        * WebHistory.h:
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):  Add the negative-visit-count-correction-logic as implemented
+          for Mac in http://trac.webkit.org/changeset/40851.
+
+2009-02-06  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40726.
+
+    2009-02-06  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        - fix an assertion failure in Vector::at() beneath
+          WebHistoryItem::dictionaryRepresentation.
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::dictionaryRepresentation): Give the numbers vector initial
+        size. Also reduced the inline capacity of the vector used for weekly visit
+        counts to 5, which is the expected maximum size.
+
+2009-02-06  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40713.
+
+    2009-02-06  Maciej Stachowiak  <mjs@apple.com>
+
+        Rubber stamped by Dan Bernstein.
+
+        - fix obvious problem in previous commit (|| used instead of &&)
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):
+
+2009-02-06  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40712.
+
+    2009-02-05  Maciej Stachowiak  <mjs@apple.com> and Brady Eidson  <beidson@apple.com>
+
+        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.
+
+        * Interfaces/IWebHistoryItemPrivate.idl: Added new interface.
+        * WebHistory.cpp:
+        (WebHistory::visitedURL): Use new recordInitialVisit method.
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation): Add parsing support
+        for new data.
+        (WebHistoryItem::dictionaryRepresentation): Add saving support for
+        new data.
+        (WebHistoryItem::getDailyVisitCounts): SPI accessor.
+        (WebHistoryItem::getWeeklyVisitCounts): SPI accessor.
+        (WebHistoryItem::recordInitialVisit): Tell WebCore to record an initial visit.
+        * WebHistoryItem.h:
+
+2009-02-04  Steve Falkenburg  <sfalken@apple.com>
+
+        Merge r40365.
+
+    2009-01-29  Adam Roben  <aroben@apple.com>
+
+        Build fix after r40353
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::loadURLIntoChild): Removed the check for
+        FrameLoadTypeReloadAllowingStaleData.
+
+2009-02-04  Steve Falkenburg  <sfalken@apple.com>
+
+        Merge r40511.
+
+    2009-02-02  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::loadURLIntoChild):
+
+2009-02-04  Steve Falkenburg  <sfalken@apple.com>
+
+        Merge part of r40470.
+
+    2009-01-31  Matt Lilek  <webkit@mattlilek.com>
+
+        Not reviewed, build fixes.
+
+        * WebCoreSupport/WebContextMenuClient.cpp:
+        (WebContextMenuClient::searchWithGoogle):
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40392.
+
+    2009-01-29  Sam Weinig  <sam@webkit.org>
+
+        Fix Windows build
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40529.
+
+    2009-02-03  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * WebHistory.cpp:
+        (WebHistory::visitedURL):
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40528.
+
+    2009-02-02  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * WebHistory.cpp:
+        (WebHistory::visitedURL):
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40511.
+
+    2009-02-02  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::loadURLIntoChild):
+
+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.
+
+        * Interfaces/IWebFramePrivate.idl: Updated for WebCore rename.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::updateGlobalHistory):
+        (WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem):
+        Store redirect information in global history.
+
+        (WebFrameLoaderClient::loadURLIntoChild): Updated for extra parameter.
+
+        * WebCoreSupport/WebFrameLoaderClient.h: See above.
+
+        * WebFrame.cpp:
+        (WebFrame::loadRequest):
+        (WebFrame::loadData): Updated for extra parameter.
+
+        * WebHistory.cpp:
+        (WebHistory::visitedURL):
+        (WebHistory::visitedURLForRedirectWithoutHistoryItem): Store redirect
+        information in global history.
+
+        * WebHistory.h: See above.
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40503.
+
+    2009-02-02  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Dan Bernstein
+
+        Transition Windows WebHistory to using the same "update already existing History Items" technique that Mac does.
+
+        * Interfaces/IWebHistoryItemPrivate.idl:
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::updateGlobalHistory):
+
+        * WebHistory.cpp:
+        (WebHistory::visitedURL):
+        * WebHistory.h:
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::visitedWithTitle):
+        * WebHistoryItem.h:
+
+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.
+
+        * Interfaces/IWebHistoryItemPrivate.idl:
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::dictionaryRepresentation):
+        (WebHistoryItem::redirectURLs):
+        * WebHistoryItem.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.
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):
+        (WebHistoryItem::dictionaryRepresentation):
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40436.
+
+    2009-01-30  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * Interfaces/IWebFramePrivate.idl:
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::loadURLIntoChild):
+
+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.cpp:
+        (WebView::setCustomTextEncodingName):
+
+2009-02-03  Mark Rowe  <mrowe@apple.com>
+
+        Merge r40366.
+
+    2009-01-29  Adam Roben  <aroben@apple.com>
+
+        Fix Bug 23623: Windowed Flash instances aren't captured when a WebView
+        receives a WM_PRINTCLIENT message
+
+        <https://bugs.webkit.org/show_bug.cgi?id=23623>
+        <rdar://problem/6513921>
+        <rdar://problem/6536874>
+
+        Reviewed by Darin Adler.
+
+        * WebFrame.cpp:
+        (WebFrame::paintDocumentRectToContext):
+        (WebFrame::spoolPages):
+        Call GraphicsContext::setShouldIncludeChildWindows so that child
+        windows will be painted into the GraphicsContext rather than painted
+        directly to the screen.
+
+        * WebView.cpp:
+        (WebView::updateBackingStore): Added a windowsToPaint parameter, which
+        we pass along to paintIntoBackingStore.
+
+        (WebView::paint): Tell updateBackingStore to paint child windows if
+        we're not painting to the screen.
+
+        (WebView::paintIntoBackingStore): Added a windowsToPaint paramter,
+        which we use to tell our GraphicsContext whether or not to include
+        child windows.
+
+        * WebView.h: Added windowsToPaint parameters to paintIntoBackingStore
+        and updateBackingStore (which I also made private).
+
+2009-01-27  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Dan Bernstein
+
+        Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::savePlatformDataToCachedFrame):
+        (WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
+        * WebFrame.cpp:
+        * WebFrame.h:
+
+2009-01-26  Adam Roben  <aroben@apple.com>
+
+        Fix an assertion failure when Safari loads an error page
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebFrame.cpp:
+        (WebFrame::loadData): Use the two-argument version of KURL and
+        MarshallingHelpers::BSTRToKURL, for reasons mentioned in r40248.
+
+2009-01-26  Adam Roben  <aroben@apple.com>
+
+        Fix an assertion on launch in KURL::KURL
+
+        All URL strings passed in to the WebKit API need to be passed to
+        MarshallingHelpers::BSTRToKURL so that they may be properly parsed.
+
+        Reviewed by Alexey Proskuryakov.
+
+        * MarshallingHelpers.cpp:
+        (MarshallingHelpers::BSTRToKURL): Changed to use the two-argument
+        constructor for KURL so that the strings will be parsed rather than
+        assumed to be in the correct encoding/form.
+
+        * WebResource.cpp:
+        (WebResource::initWithData):
+        * WebURLResponse.cpp:
+        (WebURLResponse::initWithURL):
+        * WebView.cpp:
+        (WebView::userAgentForURL):
+        (WebView::copyURL):
+        Changed to use MarshallingHelpers::BSTRToKURL instead of trying to do
+        the work manually.
+
+2009-01-25  Darin Adler  <darin@apple.com>
+
+        Try to fix Windows build.
+
+        * WebView.cpp: Added FloatQuad.h.
+
+2009-01-23  Brent Fulgham  <bfulgham@webkit.org>
+
+        Reviewed by Darin Adler
+
+        https://bugs.webkit.org/show_bug.cgi?id=23492
+        Exclude calls to WebKitSystemInterface functions when not
+        using CoreGraphics.
+
+        * WebPreferences.cpp:
+        (WebPreferences::setFontSmoothing): 
+        (WebPreferences::setFontSmoothingContrast):
+        * WebTextRenderer.cpp:
+        (WebTextRenderer::registerPrivateFont):
+
+2009-01-23  Brady Eidson  <beidson@apple.com>
+
+        Rubberstamped by Darin Adler
+
+        Rename CachedPagePlatformData to CachedFramePlatformData to more accurately reflect its true role.
+
+        * WebCachedFramePlatformData.h: Copied from WebKit/win/WebCachedPagePlatformData.h.
+        (WebCachedFramePlatformData::WebCachedFramePlatformData):
+        * WebCachedPagePlatformData.h: Removed.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::savePlatformDataToCachedPage):
+
+        * WebKit.vcproj/WebKit.vcproj:
+
+2009-01-22  Eric Roman  <eroman@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=20806
+        Deprecate RSSFeedReferrer() and setRSSFeedReferrer().
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::RSSFeedReferrer):
+        (WebHistoryItem::setRSSFeedReferrer):
+
+2009-01-19  Sam Weinig  <sam@webkit.org>
+
+        Rubber-stamped by Gavin Barraclough.
+
+        Remove temporary operator-> from JSValuePtr.
+
+        * WebScriptCallFrame.cpp:
+        (WebScriptCallFrame::jsValueToString):
+        * WebView.cpp:
+        (WebView::stringByEvaluatingJavaScriptFromString):
+
+2009-01-19  Adam Roben  <aroben@apple.com>
+
+        Windows build fix
+
+        * DOMCoreClasses.cpp: Replaced "using namespace WebCore" with
+        individual using directives for each type we need from that namespace,
+        to avoid conflicts between DOMObject and WebCore::DOMObject.
+        (DOMElement::font): Added a now-needed WebCore::.
+
+2009-01-17  Steve Falkenburg  <sfalken@apple.com>
+
+        Build fix.
+
+        * WebCoreSupport/WebDragClient.cpp:
+        (WebDragClient::createDragImageForLink):
+
+2009-01-17  David Hyatt  <hyatt@apple.com>
+
+        Eliminate dependencies on backslashAsCurrencySymbol from WebKit.
+
+        Reviewed by Oliver Hunt
+
+        * WebFrame.cpp:
+        (WebFrame::selectedString):
+
+2009-01-16  Steve Falkenburg  <sfalken@apple.com>
+
+        <rdar://problem/6502511> Safari crashes if it's running while the desktop theme is changed.
+        
+        This was caused by mismatched ENABLE definitions across WebCore and WebKit.
+        
+        Several virtual methods were added to RenderTheme.h, conditionalized by ENABLE(VIDEO).
+        In addition to adding ENABLE_VIDEO to WebKit, this change also adds ENABLE_DATABASE and ENABLE_ICONDATABASE
+        to Windows WebCore/WebKit, and adds ENABLE_WORKERS, and several ENABLE_SVG_ flags to WebKit on Windows.
+        Our Windows ENABLE flags now match Mac.
+        
+        Reviewed by Adele Peterson.
+
+        * WebKit.vcproj/WebKit.vcproj:
+
+2009-01-15  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin Adler.
+        
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=21799
+        <rdar://problem/6310684> Crash in dumpFramesAsText() when running http/tests/security/cross-origin-xsl-BLOCKED.html
+        
+        Return S_OK or E_FAIL based on the result from CreateInstance.
+        This was causing DumpRenderTree to not realize it had just gotten a null documentElement.
+        
+        * DOMCoreClasses.cpp: Made all functions that return the result of CreateInstance consistent.
+        (DOMNode::parentNode):
+        (DOMNode::ownerDocument):
+        (DOMNodeList::item):
+        (DOMDocument::documentElement):
+        (DOMDocument::createElement):
+        (DOMDocument::getElementsByTagName):
+        (DOMDocument::getElementsByTagNameNS):
+        (DOMDocument::getElementById):
+        (DOMDocument::getComputedStyle):
+        (DOMDocument::createEvent):
+        (DOMElement::style):
+
+2009-01-14  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=23335
+        <rdar://problem/6247650> Update <input type="search"> for RenderThemeWin
+        
+        Added artwork.
+        
+        * WebKit.vcproj/WebKit.rc:
+        * WebKit.vcproj/WebKit.vcproj:
+        * WebKit.vcproj/resource.h:
+        * WebKit.vcproj/searchCancel.png: Added.
+        * WebKit.vcproj/searchCancelPressed.png: Added.
+        * WebKit.vcproj/searchMagnifier.png: Added.
+        * WebKit.vcproj/searchMagnifierResults.png: Added.
+        * WebKitDLL.cpp:(loadResourceIntoBuffer):
+
+2009-01-14  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        - update copyright
+
+        * WebKit.resources/Info.plist:
+        * WebKit.vcproj/WebKit.rc:
+
+2009-01-13  Steve Falkenburg  <sfalken@apple.com>
+
+        Build fix.
+
+        * WebScriptCallFrame.cpp:
+        (WebScriptCallFrame::jsValueToString):
+
+2009-01-12  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Dan Bernstein
+        
+        <rdar://problem/6490446> - Crash when going back to a cached page
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::savePlatformDataToCachedPage):  ENABLE(CFNETWORK) needed to be USE(CFNETWORK)
+
+2009-01-12  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler
+
+        <rdar://problem/6468274> - Track Non-get requests in global history
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::updateGlobalHistory):
+
+        * WebHistory.cpp:
+        (WebHistory::addItem):
+        * WebHistory.h:
+
+        * Interfaces/IWebHistoryItemPrivate.idl:
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):
+        (WebHistoryItem::dictionaryRepresentation):
+        (WebHistoryItem::lastVisitWasHTTPNonGet):
+        (WebHistoryItem::setLastVisitWasHTTPNonGet):
+        * WebHistoryItem.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
+
+        * WebCoreStatistics.cpp:
+        (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.
+
+        * WebDownload.cpp: a different header file included.
+        * WebDropSource.cpp: a different header file included.
+
+2009-01-09  Darin Adler  <darin@apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        Bug 22913: REGRESSION: Space bar doesn't scroll on windows
+        https://bugs.webkit.org/show_bug.cgi?id=22913
+        rdar://problem/6479834
+
+        * WebView.cpp:
+        (WebView::keyPress): Removed code to handle space bar here; put it in
+        WebCore instead.
+
+2009-01-09  Brent Fulgham  <bfulgham@gmail.com>
+
+        Reviewed by Adam Roben.
+
+        Fixes: http://bugs.webkit.org/show_bug.cgi?id=23092
+        Separate CFNetwork-specific code in WebKit.dll into separate
+        implementation files. Create cURL stub files to be populated
+        with new implementation in a future bug report. 
+
+        * WebCookieManager.cpp: Move CFNetwork-specific routines to
+          the new WebCookieManagerCFNet.cpp file.
+        (WebCookieManager::Release):
+        * WebCookieManagerCFNet.cpp: Copied from WebCookieManager.cpp.
+        (WebCookieManager::cookieStorage):
+        * WebCookieManagerCurl.cpp: Added.
+        (WebCookieManager::cookieStorage):
+        (WebCookieManager::setCookieStorage):
+        * WebCoreSupport/WebFrameLoaderClient.cpp: Conditionalize two
+          methods in this file.
+        (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
+        (WebFrameLoaderClient::savePlatformDataToCachedPage):
+        * WebDownload.cpp: Move CFNetwork-specific logic to the new
+          WebDownloadCFNet.cpp
+        (WebDownload::bundleExtension):
+        (WebDownload::bundleMagicNumber):
+        (WebDownload::bundlePathForTargetPath):
+        (WebDownload::extractResumeDataFromBundle): Made static class method
+          so it could be used in WebDownload.cpp and WebDownloadCFNet.cpp
+        (WebDownload::appendResumeDataToBundle): Made static class method
+          so it could be used in WebDownload.cpp and WebDownloadCFNet.cpp
+        * WebDownload.h:
+        * WebDownloadCFNet.cpp: Copied from WebDownload.cpp.
+        (WebDownload::initToResumeWithBundle):
+        (WebDownload::setDestination):
+        (didFailCallback):
+        * WebDownloadCurl.cpp: Added.
+        (WebDownload::init):
+        (WebDownload::initWithRequest):
+        (WebDownload::initToResumeWithBundle):
+        (WebDownload::start):
+        (WebDownload::cancel):
+        (WebDownload::cancelForResume):
+        (WebDownload::deletesFileUponFailure):
+        (WebDownload::setDeletesFileUponFailure):
+        (WebDownload::setDestination):
+        (WebDownload::cancelAuthenticationChallenge):
+        (WebDownload::continueWithoutCredentialForAuthenticationChallenge):
+        (WebDownload::useCredential):
+        * WebKit.vcproj/WebKit.vcproj: Modify Apple targets to exclude the
+          new cURL files. Modify Cairo targets to exclude CFNet files.
+        * WebMutableURLRequest.cpp: Conditionalize the single method
+          with a CFNetwork-speicic call.
+        (WebMutableURLRequest::mutableCopy):
+        * WebURLAuthenticationChallenge.cpp: Conditionalize one line that
+          causes build problems for cURL. This will be removed later.
+        (WebURLAuthenticationChallenge::initWithProtectionSpace):
+        * WebURLAuthenticationChallengeSender.cpp:
+        * WebURLAuthenticationChallengeSenderCFNet.cpp: Copied from WebURLAuthenticationChallengeSender.cpp.
+        (WebURLAuthenticationChallengeSender::useCredential):
+        * WebURLAuthenticationChallengeSenderCurl.cpp: Added.
+        (WebURLAuthenticationChallengeSender::cancelAuthenticationChallenge):
+        (WebURLAuthenticationChallengeSender::continueWithoutCredentialForAuthenticationChallenge):
+        (WebURLAuthenticationChallengeSender::useCredential):
+        * WebURLResponse.cpp: Exclude WebKitSystemInterface when compiling
+          for the cURL target.
+
+2009-01-09  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Fix many appcache tests on Windows by making synchronous XMLHttpRequest throw on cache miss.
+
+        * WebFrame.cpp: (WebFrame::cannotShowURLError): Implement, so that synchronous XHR can
+        raise exceptions, as needed for AppCache tests. I do not know why this error was not
+        implemented.
+
+2009-01-09  Darin Adler  <darin@apple.com>
+
+        Reviewed and landed by Adele Peterson.
+
+        Bug 23160: add setMemoryCacheClientCallsEnabled SPI so Safari can be faster with activity window closed
+        https://bugs.webkit.org/show_bug.cgi?id=23160
+
+        * Interfaces/IWebViewPrivate.idl: Added setMemoryCacheDelegateCallsEnabled.
+        * WebView.cpp:
+        (WebView::setMemoryCacheDelegateCallsEnabled): Ditto.
+        * WebView.h: Ditto.
+
+2009-01-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Adam Roben.
+
+        - WebPreferences changes to support Core Graphics native glyph drawing
+
+        * Interfaces/IWebPreferencesPrivate.idl: Added font smoothing contrast
+        getter and setter.
+        * WebPreferenceKeysPrivate.h: Added
+        WebKitFontSmoothingContrastPreferenceKey.
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings): Initialized
+        WebKitFontSmoothingContrastPreferenceKey to 2.
+        (WebPreferences::setFloatValue): Added.
+        (WebPreferences::setFontSmoothing): Changed to map
+        FontSmoothingTypeWindows to FontSmoothingTypeMedium.
+        (WebPreferences::fontSmoothingContrast): Added.
+        (WebPreferences::setFontSmoothingContrast): Added. Calls
+        wkSetFontSmoothingContrast().
+        * WebPreferences.h:
+
+2009-01-08  Steve Falkenburg  <sfalken@apple.com>
+
+        <rdar://problem/6474244> REGRESSION(39561-39603): Heap corruption when saving passwords?
+        
+        Reviewed by Adam Roben.
+
+        * WebView.cpp:
+        (WebViewWndProc): Hold a ref to the WebView inside the WNDPROC, since it could go away in an event handler.
+
+2009-01-07  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Fix a crash with querying a WebView for its global history item when
+        its associated Page has no global history item.
+
+        Reviewed by Dan Bernstein.
+
+        * WebView.cpp:
+        (WebView::globalHistoryItem): If the Page has no global history item,
+        report 0.
+
+2009-01-06  Adam Roben  <aroben@apple.com>
+
+        Fix Bug 22262: Clicking close ("X") button in docked Web Inspector
+        clears Web Inspector but doesn't close it
+
+        <https://bugs.webkit.org/show_bug.cgi?id=22262>
+        <rdar://problem/6371873>
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorClient::WebInspectorClient): Initialize new member.
+        (WebInspectorClient::showWindow): Moved code from here to
+        showWindowWithoutNotifications.
+        (WebInspectorClient::closeWindow): Moved code from here to
+        closeWindowWithoutNotifications.
+
+        (WebInspectorClient::attachWindow):
+        (WebInspectorClient::detachWindow):
+        Record whether or not we should be attached, then close and reopen the
+        window without notifying the InspectorController. Code that was in
+        these functions moved to showWindowWithoutNotifications and
+        closeWindowWithoutNotifications, respectively.
+
+        (WebInspectorClient::closeWindowWithoutNotifications): Added. Code
+        came from closeWindow and detachWindow.
+        (WebInspectorClient::showWindowWithoutNotifications): Added. Code came
+        from showWindow and attachWindow.
+
+        * WebCoreSupport/WebInspectorClient.h: Added
+        {close,show}WindowWithoutNotifications and m_shouldAttachWhenShown.
+
+2009-01-06  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add a way for application to provide custom, full frame, views for certain MIME types.
+        
+        * Interfaces/IWebEmbeddedView.idl:
+        Add loading related methods.
+        
+        * Interfaces/IWebViewPrivate.idl:
+        Add new registerEmbeddedViewMIMEType method.
+        
+        * WebCoreSupport/EmbeddedWidget.cpp:
+        (EmbeddedWidget::didReceiveResponse):
+        (EmbeddedWidget::didReceiveData):
+        (EmbeddedWidget::didFinishLoading):
+        (EmbeddedWidget::didFail):
+        Implement these and call the IEmbeddedView methods.
+        
+        * WebCoreSupport/EmbeddedWidget.h:
+        Inherit from PluginManualLoader.
+        
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::redirectDataToPlugin):
+        Handle the case where the widget is an EnbeddedWidget.
+        
+        (WebFrameLoaderClient::shouldUsePluginDocument):
+        Have this call WebView::shouldUseEmbeddedView.
+        
+        * WebView.cpp:
+        (WebView::canShowMIMEType):
+        Have this call WebView::shouldUseEmbeddedView.
+        
+        (WebView::registerEmbeddedViewMIMEType):
+        Add the MIME type to the set.
+        
+        (WebView::shouldUseEmbeddedView):
+        Given a MIME type, returns whether an embedded view should be used or not.
+        
+2009-01-06  David Kilzer  <ddkilzer@apple.com>
+
+        BUILD FIX (r39641): Try to fix WebIconDatabase build errors #4
+
+        * WebIconDatabase.cpp:
+        (WebIconDatabase::isEnabled): Added 'WebIconDatabase::' to method
+        signature.  (Another copy-paste error.)
+        (WebIconDatabase::setEnabled): Ditto.
+        * WebIconDatabase.h:
+        (WebIconDatabase::startUpIconDatabase): Make private again.
+        (WebIconDatabase::shutDownIconDatabase): Ditto.
+
+2009-01-06  David Kilzer  <ddkilzer@apple.com>
+
+        BUILD FIX (r39641): Try to fix build errors #3
+
+        Try to fix the following (more specific) build errors:
+
+            WebIconDatabase.cpp
+            ..\WebIconDatabase.cpp(255) : error C2248: 'WebIconDatabase::shutDownIconDatabase' : cannot access private member declared in class 'WebIconDatabase'
+                    ...\webkit\win\WebIconDatabase.h(61) : see declaration of 'WebIconDatabase::shutDownIconDatabase'
+                    ...\webkit\win\WebIconDatabase.h(51) : see declaration of 'WebIconDatabase'
+            ..\WebIconDatabase.cpp(255) : error C2352: 'WebIconDatabase::shutDownIconDatabase' : illegal call of non-static member function
+                    ...\webkit\win\WebIconDatabase.h(61) : see declaration of 'WebIconDatabase::shutDownIconDatabase'
+            ..\WebIconDatabase.cpp(258) : error C2248: 'WebIconDatabase::startUpIconDatabase' : cannot access private member declared in class 'WebIconDatabase'
+                    ...\webkit\win\WebIconDatabase.h(60) : see declaration of 'WebIconDatabase::startUpIconDatabase'
+                    ...\webkit\win\WebIconDatabase.h(51) : see declaration of 'WebIconDatabase'
+            ..\WebIconDatabase.cpp(258) : error C2352: 'WebIconDatabase::startUpIconDatabase' : illegal call of non-static member function
+                    ...\webkit\win\WebIconDatabase.h(60) : see declaration of 'WebIconDatabase::startUpIconDatabase'
+
+        * WebIconDatabase.cpp:
+        (setEnabled): Get instance of shared WebIconDatabase, then call
+        startUp/shutDown methods on it.
+        * WebIconDatabase.h:
+        (WebIconDatabase::startUpIconDatabase): Make protected again.
+        (WebIconDatabase::shutDownIconDatabase): Ditto.
+
+2009-01-06  David Kilzer  <ddkilzer@apple.com>
+
+        BUILD FIX (r39641): Try to fix build errors again
+
+        Try to fix the following build errors:
+
+            WebIconDatabase.cpp
+            ..\WebIconDatabase.cpp(255) : error C3861: 'shutDownIconDatabase': identifier not found
+            ..\WebIconDatabase.cpp(258) : error C3861: 'startUpIconDatabase': identifier not found
+
+        * WebIconDatabase.cpp:
+        (setEnabled): Add class prefix to startUpIconDatabase() and
+        shutDownIconDatabase().
+        * WebIconDatabase.h:
+        (WebIconDatabase::startUpIconDatabase): Make private again.
+        (WebIconDatabase::shutDownIconDatabase): Ditto.
+
+2009-01-06  David Kilzer  <ddkilzer@apple.com>
+
+        BUILD FIX (r39641): Try to fix build error
+
+        Try to fix the following build errors:
+
+            WebIconDatabase.cpp
+            ..\WebIconDatabase.cpp(255) : error C3861: 'shutDownIconDatabase': identifier not found
+            ..\WebIconDatabase.cpp(258) : error C3861: 'startUpIconDatabase': identifier not found
+
+        * WebIconDatabase.h:
+        (WebIconDatabase::startUpIconDatabase): Make protected.
+        (WebIconDatabase::shutDownIconDatabase): Ditto.
+
+2009-01-06  David Kilzer  <ddkilzer@apple.com>
+
+        BUILD FIX (r39641): Fix more silly errors
+
+        Fixes the following compilation errors:
+
+            WebIconDatabase.cpp
+            ..\WebIconDatabase.cpp(85) : error C2065: 'standardPrefs' : undeclared identifier
+            ..\WebIconDatabase.cpp(85) : error C2227: left of '->iconDatabaseLocation' must point to class/struct/union/generic type
+                    type is ''unknown-type''
+            ..\WebIconDatabase.cpp(241) : error C2575: 'isEnabled' : only member functions and bases can be virtual
+            ..\WebIconDatabase.cpp(248) : error C2575: 'setEnabled' : only member functions and bases can be virtual
+            ..\WebIconDatabase.cpp(253) : error C3861: 'shutDownIconDatabase': identifier not found
+            ..\WebIconDatabase.cpp(256) : error C3861: 'startUpIconDatabase': identifier not found
+
+        * WebIconDatabase.cpp:
+        (WebIconDatabase::startUpIconDatabase): Redeclare standardPrefs
+        since this was in init() but not in this method after it was
+        extracted from init().
+        (isEnabled): Don't use "virtual" in method implementation
+        (silly copy-paste error).
+        (setEnabled): Ditto.
+
+2009-01-06  David Kilzer  <ddkilzer@apple.com>
+
+        BUILD FIX (r39641): Remove STDMETHODCALLTYPE from method declarations in IWebIconDatabase.idl
+
+        * Interfaces/IWebIconDatabase.idl: Removed "STDMETHODCALLTYPE"
+        from silly copy-paste error in two method declarations.
+
+2009-01-05  David Kilzer  <ddkilzer@apple.com>
+
+        Add API to enable, disable and check state of WebIconDatabase
+
+        Reviewed by Darin Adler & Timothy Hatcher.
+
+        Add WebIconDatabase::isEnabled() and WebIconDatabase::setEnabled()
+        API to make it possible to enable, disable and check the state of
+        the icon database.
+
+        * Interfaces/IWebIconDatabase.idl: Declared isEnabled() and
+        setEnabled() methods.
+        * WebIconDatabase.cpp:
+        (WebIconDatabase::init): Extracted code into startUpIconDatabase().
+        (WebIconDatabase::startUpIconDatabase): Added.  Extracted from
+        init().
+        (WebIconDatabase::shutDownIconDatabase): Added.  Method is empty
+        since there is nothing to do yet on Windows.
+        (isEnabled): Added.
+        (setEnabled): Added.
+        * WebIconDatabase.h: Added method declarations.
+
+2009-01-05  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        Pass more information in the property bag passed to embeddedViewWithArguments.
+        
+        * Interfaces/IWebUIDelegatePrivate.idl:
+        Declare new keys.
+        
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::createPlugin):
+        Pass the base URL, MIME type and the containing element to embeddedViewWithArguments.
+
+2009-01-05  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Darin Adler, Jon Honeycutt.
+
+        Add a templatized COMVariant constructor so we can make COMVariants out of
+        everything that has a COMVariantSetter specialization.
+        
+        Add a COMVariantSetter specialization for COMVariant.
+        
+        * COMVariantSetter.h:
+        (COMVariant::COMVariant):
+
+2009-01-05  Brent Fulgham  <bfulgham@gmail.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fixes: https://bugs.webkit.org/show_bug.cgi?id=23027
+
+        Removes the WebKitGraphics files from the Cairo build, as well
+        as excluding their link definitions.  These are not used outside
+        of Safari, and should not be part of the 'Redistributable API.'
+
+        * WebKit.vcproj/WebKit.vcproj:  Update *_Cairo targets to exclude
+          the WebKitGraphics.cpp/.h files.
+        * WebKit.vcproj/WebKit_Cairo.def: Added.  File without Safari
+          link definitions.
+        * WebKit.vcproj/WebKit_Cairo_debug.def: Added.  File without Safari
+          link definitions.
+
+2009-01-05  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        Add a simple, memory managed, wrapper around a VARIANT struuct.
+        
+        * COMVariantSetter.h:
+        (COMVariant::COMVariant):
+        (COMVariant::~COMVariant):
+        (COMVariant::operator=):
+        (COMVariant::copyTo):
+        (COMVariant::variantType):
+
+2009-01-05  Adele Peterson  <adele@apple.com>
+
+        Windows build fix.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+
+2009-01-05  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Make it possible to have per value variant types.
+        
+        * COMPropertyBag.h:
+        (::Read):
+        Call variantType here, passing in the value.
+        
+        (::GetPropertyInfo):
+        Ditto.
+        
+        * COMVariantSetter.h:
+        (COMVariantSetterBase::variantType):
+        Add COMVariantSetterBase, whose variantType implementation just returns the
+        VariantType variable. Make all existing classes inherit from COMVariantSetterBase.
+
+2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
+
+        Fix win build
+
+        * WebCoreSupport/WebChromeClient.h:
+
+2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Build fix for contentsSizeChanged
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::contentsSizeChanged):
+        * WebCoreSupport/WebChromeClient.h:
+
+2009-01-05  Anders Carlsson  <andersca@apple.com> 
+
+        Reviewed by Kevin Decker.
+
+        Use the ManualLoader class instead of assuming that the manual loader
+        is a plug-in view.
+        
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::WebFrameLoaderClient):
+        (WebFrameLoaderClient::setMainDocumentError):
+        (WebFrameLoaderClient::committedLoad):
+        (WebFrameLoaderClient::finishedLoading):
+        (WebFrameLoaderClient::redirectDataToPlugin):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
+2009-01-04  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Make the apple windows port build with the new fixedLayoutSize feature
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
+2008-12-20  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Ada Chan.
+
+        - expose the new allItems() method via a new IWebHistoryPrivate
+          interface
+
+        * Interfaces/IWebHistoryPrivate.idl: Added.
+        * Interfaces/WebKit.idl: Added IWebHistoryPrivate.idl.
+        * WebHistory.cpp:
+        (WebHistory::QueryInterface): Added IWebHistoryPrivate.
+        (WebHistory::allItems):
+        * WebHistory.h:
+
+2008-12-19  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix.
+
+        * WebHistory.cpp:
+        (WebHistory::allItems):
+
+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.
+        
+        * WebHistory.cpp:
+        (WebHistory::orderedItemsLastVisitedOnDay):
+        (WebHistory::allItems):
+        * WebHistory.h:
+
+2008-12-18  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - implement FrameLoaderClient::shouldUseCredentialStorage() by calling
+          a new resource load delegae method.
+
+        * Interfaces/IWebResourceLoadDelegatePrivate.idl: Added
+        a ne interface, IWebResourceLoadDelegatePrivate2, including a new
+        method, shouldUseCredentialStorage().
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::shouldUseCredentialStorage): Added. Calls the
+        delegate method. If the method is unimplemented, returns true for
+        backwards compatibility.
+        * WebCoreSupport/WebFrameLoaderClient.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.
+
+        * Interfaces/IWebFrameLoadDelegatePrivate.idl:
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
+2008-12-16  Steve Falkenburg  <sfalken@apple.com>
+
+        Windows build fix.
+        
+        Reviewed by Stephanie Lewis.
+
+        * COMPropertyBag.h:
+        (::createInstance):
+        (::adopt):
+        (::QueryInterface):
+        (::AddRef):
+        (::Release):
+        (::Read):
+        (::Write):
+        (::CountProperties):
+        (::GetPropertyInfo):
+        (::LoadObject):
+        * WebURLResponse.cpp:
+        (WebURLResponse::allHeaderFields):
+
+2008-12-16  Stephanie Lewis  <slewis@apple.com>
+
+        Another Windows Build Fix.
+
+        * WebURLResponse.cpp:
+        (WebURLResponse::allHeaderFields):
+
+2008-12-14  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - Windows equivalent of <rdar://problem/3258561>
+          WebHistoryAllItemsRemovedNotification should add items to userInfo
+
+        * WebHistory.cpp:
+        (WebHistory::removeAllItems): Changed to create an array of all items
+        and send it in the notification.
+
+2008-12-12  Brent Fulgham  <bfulgham@gmail.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fixes: https://bugs.webkit.org/show_bug.cgi?id=22805
+
+        Provides implementation of image drag for Windows Cairo back-end.
+        Switch to generic PlatformGraphicsContext data type, rather than
+        specific use of CoreGraphics types.
+
+        * WebCoreSupport/WebDragClient.cpp:
+        (WebDragClient::createDragImageForLink): Revise calls to use more
+        generic PlatformGraphicsContext data types and calls for better
+        portability.
+
+2008-12-12  Steve Falkenburg  <sfalken@apple.com>
+
+        Update Windows cache sizes to match recent Mac change.
+        
+        Reviewed by Stephanie Lewis, Sam Weinig.
+
+        * WebView.cpp:
+        (WebView::setCacheModel):
+
+2008-12-12  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Rubber-stamped by Oliver Hunt.
+
+        Remove mutables from EmbeddedWidget
+
+        We can do this now that frameRectsChanged() is no longer const
+
+        * WebCoreSupport/EmbeddedWidget.h:
+
+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.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        * WebPreferences.h:
+
+2008-12-10  Glenn Wilson  <gwilson@google.com>
+
+        Reviewed by Adam Roben.
+
+        Added support for overriding default preferences per-test.
+        https://bugs.webkit.org/show_bug.cgi?id=20534
+        Two new methods were added: resetToDefaults and overridePreference.
+
+        * Interfaces/IWebPreferencesPrivate.idl: new method signatures
+        * WebPreferenceKeysPrivate.h: added new key for internal state
+        * WebPreferences.cpp: added new methods
+        (WebPreferences::overridePreference): new method
+        (WebPreferences::resetToDefaults): new method
+        * WebPreferences.h: new method signatures
+
+2008-12-08  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Darin Adler and Holger Freyther.
+
+        Make Widget::frameRectsChanged() and overrides non-const
+
+        This will hopefully allow us to get rid of some of the mutables in
+        the classes that react to the callback by changing their own state.
+
+        * WebCoreSupport/EmbeddedWidget.cpp:
+        (EmbeddedWidget::frameRectsChanged):
+        * WebCoreSupport/EmbeddedWidget.h:
+
+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):
+
+ks2008-12-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Adam Roben.
+
+        - Fix nightly builds
+
+        * Interfaces/IWebViewPrivate.idl: Moved globalHistoryItem() to the end,
+        so that it comes after all methods used by Safari 3.2.1.
+
+2008-12-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        - WebKit/win part of tracking the global history item for a WebView
+
+        * Interfaces/IWebViewPrivate.idl: Declared globalHistoryItem()
+        * WebView.cpp:
+        (WebView::globalHistoryItem): Added. Gets the page's global history
+        item.
+        * WebView.h:
+
+2008-12-06  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dave Hyatt
+
+        https://bugs.webkit.org/show_bug.cgi?id=15671
+
+        Renderer::caretRect() is now localCaretRect(), which needs
+        converting to absolute coordinates (taking transforms into account).
+
+        * WebView.cpp:
+        (WebView::handleContextMenuEvent):
+
+2008-12-05  Darin Adler  <darin@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        - fix https://bugs.webkit.org/show_bug.cgi?id=22674
+          Webkit r39005 does not start, an entry point not found
+
+        * WebView.cpp:
+        (findCFNetworkModule): Added.
+        (findCopySharedURLCacheFunction): Added.
+        (WebView::setCacheModel): Call CFURLCacheCopySharedURLCache via dynamic loading
+        instead of compiling based on which version of CFNetwork headers are present.
+
+2008-12-04  Steve Falkenburg  <sfalken@apple.com>
+
+        Implement IPropertyBag2::Read.
+        Fill in dwType for IPropertyBag2::GetPropertyInfo (we always use PROPBAG2_TYPE_DATA).
+        https://bugs.webkit.org/show_bug.cgi?id=22659
+        
+        This fixes <rdar://problem/6419127> REGRESSION: Forms autocomplete is broken for "other forms"
+        
+        Reviewed by Ada Chan, Alice Liu.
+
+        * COMPropertyBag.h:
+        (::Read): Implemented.
+        (::GetPropertyInfo): Set dwType to PROPBAG2_TYPE_DATA.
+
+2008-12-02  Adam Roben  <aroben@apple.com>
+
+        Export new-ish JSCore convenience constructor functions
+
+        Reviewed by Jon Honeycutt.
+
+        * WebKit.vcproj/WebKit.def:
+        * WebKit.vcproj/WebKit_debug.def:
+        Export JSObjectMakeArray, JSObjectMakeDate, and JSObjectMakeRegExp.
+        Remove duplicate export of JSObjectMakeFunction.
+
+2008-12-02  Michael Moss  <mmoss@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        - Fix http/tests/navigation/reload-subframe-*frame.html on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=20926
+
+        Change 31264 fixed this on Mac (since moved to WebCore/loader/FrameLoader.cpp), but was never ported to Windows.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::loadURLIntoChild):
+
+2008-12-01  Steve Falkenburg  <sfalken@apple.com>
+
+        Implement renderedImage for Windows.
+        https://bugs.webkit.org/show_bug.cgi?25648
+        
+        Reviewed by Adam Roben.
+
+        * DOMCoreClasses.cpp:
+        (DOMElement::renderedImage):
+        * DOMCoreClasses.h:
+        * Interfaces/DOMPrivate.idl:
+
+2008-12-01  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Roben.
+
+        NULL-check documentFrameView() and topDocumentFrameView() it's possible
+        for either of these methods to return NULL, and this was seen to cause
+        crashes in Chromium.
+        https://bugs.webkit.org/show_bug.cgi?id=22572
+
+        * AccessibleBase.cpp:
+        (AccessibleBase::get_accParent):
+        (AccessibleBase::accLocation):
+        (AccessibleBase::accHitTest):
+
+2008-11-30  Antti Koivisto  <antti@apple.com>
+
+        Another Windows build fix.
+
+        * WebCoreStatistics.cpp:
+        (WebCoreStatistics::javaScriptObjectsCount):
+
+2008-11-30  Antti Koivisto  <antti@apple.com>
+
+        Windows build fix.
+
+        * WebJavaScriptCollector.cpp:
+        (WebJavaScriptCollector::objectCount):
+
+2008-11-29  Brent Fulgham  <bfulgham@gmail.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Remove Visual Studio project dependencies on non-redistributable
+        components in the Debug_Cairo and Release_Cairo build targets.
+        See https://bugs.webkit.org/show_bug.cgi?id=22527
+
+        * WebKit.vcproj/WebKit.vcproj:
+        * WebKit.vcproj/WebKit.sln: Instruct Cairo builds to not bother
+          building the unused QuickTime support library.
+
+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.
+
+        * Interfaces/IWebView.idl:
+        * WebCoreSupport/WebEditorClient.cpp:
+        (WebEditorClient::selectTrailingWhitespaceEnabled):
+        * WebCoreSupport/WebEditorClient.h:
+        * WebView.cpp:
+        (WebView::WebView):
+        (WebView::setSelectTrailingWhitespaceEnabled):
+        (WebView::selectTrailingWhitespaceEnabled):
+        * WebView.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.cpp:
+        (WebFrameLoaderClient::updateGlobalHistory): Get the URL from the
+        DocumentLoader, just as we do the title and the failure flag.
+        * WebCoreSupport/WebFrameLoaderClient.h: Remove argument.
+
+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.
+
+        * Interfaces/IWebHistoryItemPrivate.idl: Added setLastVisitWasFailure.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::updateGlobalHistory): Added code to check for failure
+        and pass the argument in to WebHistory.
+
+        * WebHistory.cpp: (WebHistory::addItem): Added wasFailure argument.
+        Set the flag on the newly created history item.
+        * WebHistory.h: Ditto.
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::setLastVisitWasFailure): Added.
+        * WebHistoryItem.h: Ditto.
+
+2008-11-24  Simon Fraser  <simon.fraser@apple.com>
+
+        Fix call to Frame::selectionBounds in Windows build.
+
+        * WebView.cpp:
+        (WebView::selectionRect):
+
+2008-11-21  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Debug WebKit crashes on launch because of threading not being initialized early enough.
+
+        * WebKitClassFactory.cpp: (WebKitClassFactory::WebKitClassFactory):
+        Call JSC::InitializeThreading().
+
+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.cpp:
+        (WebView::stringByEvaluatingJavaScriptFromString):
+
+2008-11-19  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin Adler.
+
+        For transparent views, clear the dirty rect instead of painting it white.
+        
+        * WebView.cpp: (WebView::paintIntoBackingStore):
+
+2008-11-18  Adele Peterson  <adele@apple.com>
+
+        Reverting last change.  I just realized it causes the view to never get cleared out.
+
+        * WebView.cpp: (WebView::paintIntoBackingStore):
+
+2008-11-18  Adele Peterson  <adele@apple.com>
+
+        Reviewed by John Sullivan.
+
+        Don't fill the view with white if its transparent.
+        
+        * WebView.cpp: (WebView::paintIntoBackingStore):
+
+2008-11-18  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Try to fix the Windows build. It is view and not webView.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
+2008-11-18  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        Attempt to share transitionToCommittedForNewPage of FrameLoaderClient with the different ports
+
+        After Hyatt's work on Widget and ScrollView there is little difference
+        between the implementation of Qt, Gtk+ and Win. In fact any kind of
+        difference is mostly a bug. Alp has fixed two of such errors for the Gtk+
+        port and the Qt port has at least one of them left.
+
+        The only difference between the implementations is in getting the the
+        IntSize for the new FrameView, the background color to be applied and
+        eventually some post processing.
+
+        Unify the implementations by providing a static helper function that
+        takes a Frame, IntSize, color and transparency bit and calling it from
+        the Gtk+, the Qt and the Windows port.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
+2008-11-18  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22056
+
+        Move setting the background color and transparency from WebKit/win
+        to WebCore. This allows WebKit/win, WebKit/Qt and WebKit/Gtk+
+        to share this code.
+
+        * WebFrame.cpp:
+        (WebFrame::updateBackground):
+
+2008-11-16  Geoffrey Garen  <ggaren@apple.com>
+
+        Not reviewed.
+        
+        Try to fix Windows build.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+
+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
+
+        * Interfaces/IWebHistoryItemPrivate.idl: Added lastVisitWasFailure function.
+
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation): Set the lastVisitWasFailure
+        flag in the history item if the dictionary had an entry for lastVisitWasFailureKey.
+        (WebHistoryItem::dictionaryRepresentation): Set the lastVisitWasFailureKey key
+        in the dictionary if the history item had the lastVisitWasFailure flag.
+        (WebHistoryItem::lastVisitWasFailure): Added.
+
+        * WebHistoryItem.h: Added lastVisitWasFailure function.
+
+2008-11-15  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+        
+        Updated for JavaScriptCore renames.
+
+        * WebScriptCallFrame.cpp:
+        (WebScriptCallFrame::valueByEvaluatingJavaScriptFromString):
+
+2008-11-14  Dan Bernstein  <mitz@apple.com>
+
+        - try to fix the Windows build
+
+        * WebCoreLocalizedStrings.cpp:
+        (WebCore::contextMenuItemTagTextDirectionMenu): Added.
+
+2008-11-13  Adam Roben  <aroben@apple.com>
+
+        Fix Bug 22244: Webkit nightly builds crash with Safari 3.2
+
+        <https://bugs.webkit.org/show_bug.cgi?id=22244>
+
+        r36652 added IWebViewPrivate::clearMainFrameName into the middle of
+        the IWebViewPrivate interface, which modifies the part of the
+        IWebViewPrivate vtable that Safari 3.2 relies on.
+
+        Reviewed by Dan Bernstein.
+
+        * Interfaces/IWebViewPrivate.idl: Move clearMainFrameName to the end
+        of the interface.
+
+2008-11-11  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit/win part of adding a master volume control for media elements in a WebView
+        * Interfaces/IWebViewPrivate.idl: Added setMediaVolume() and
+        mediaVolume().
+        * WebView.cpp:
+        (WebView::setMediaVolume): Added.
+        (WebView::mediaVolume): Added.
+        * WebView.h:
+
+2008-11-10  Adam Roben  <aroben@apple.com>
+
+        Fix Bug 22158: Would like to turn on WebCore logging channels via an
+        environment variable
+
+        <https://bugs.webkit.org/show_bug.cgi?id=22158>
+
+        Reviewed by Anders Carlsson.
+
+        * WebView.cpp:
+        (WebView::initWithFrame): Call WebCore's
+        InitializeLoggingChannelsIfNecessary.
+
+2008-11-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - WebKit/win part of adding WebPreferences for controlling databases and local storage
+
+        * Interfaces/IWebPreferencesPrivate.idl: Declared setDatabasesEnabled,
+        databasesEnabled, setLocalStorageEnabled and localStorageEnabled.
+        * WebPreferenceKeysPrivate.h: Added WebKitDatabasesEnabledPreferenceKey
+        and WebKitLocalStorageEnabledPreferenceKey.
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings): Made databases and local
+        storage enabled by default.
+        (WebPreferences::setDatabasesEnabled): Added.
+        (WebPreferences::databasesEnabled): Added.
+        (WebPreferences::setLocalStorageEnabled): Added.
+        (WebPreferences::localStorageEnabled): Added.
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged): Transfer the databases and local
+        storage preferences to WebCore settings.
+
+2008-11-06  John Sullivan  <sullivan@apple.com>
+    
+        Eliminated one of the two booleans tracking whether zoom was text-only, to avoid future problems.
+    
+        Reviewed by Adam Roben
+
+        * WebView.h:
+        removed m_zoomMultiplierIsTextOnly
+        
+        * WebView.cpp:
+        (WebView::WebView):
+        removed initialization of m_zoomMultiplierIsTextOnly
+        (WebView::setZoomMultiplier):
+        use m_page->settings()->setZoomsTextOnly() instead of setting m_zoomMultiplierIsTextOnly
+        (WebView::zoomMultiplier):
+        use m_page->settings()->zoomsTextOnly() instead of reading m_zoomMultiplierIsTextOnly
+
+2008-11-06  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Add support for a WebKitZoomsTextOnly preference.
+
+        * Interfaces/IWebPreferences.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::setZoomsTextOnly):
+        (WebPreferences::zoomsTextOnly):
+        * WebPreferences.h:
+
+        * WebView.cpp:
+        (WebView::canMakeTextLarger): Consider the zoomsTextOnly setting when computing this.
+        (WebView::makeTextLarger): ditto.
+        (WebView::canMakeTextSmaller): ditto.
+        (WebView::makeTextSmaller): ditto.
+        (WebView::canMakeTextStandardSize): 
+        Don't consider the setting in this case since we need to reset both text zoom and page zoom regardless of the setting.
+        (WebView::makeTextStandardSize):
+        (WebView::notifyPreferencesChanged): Set the WebCore settings to match the WebPreference for WebKitZoomsTextOnly.
+
+2008-11-05  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        - make the {protocol,proxyType} argument of
+          WebURLProtectionSpace::initWith{Proxy}Host actually work and fix
+          assertion failures.
+
+        * WebURLProtectionSpace.cpp:
+        (WebURLProtectionSpace::initWithHost): The BString comparisons were
+        applying the BString==BSTR operator to a right hand side that was
+        actually a WCHAR string. Fixed by using BStrings on both sides.
+        (WebURLProtectionSpace::initWithProxyHost): Ditto.
+
 2008-11-01  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebKit/win/DOMCoreClasses.cpp b/WebKit/win/DOMCoreClasses.cpp
index 713a369..2da3e28 100644
--- a/WebKit/win/DOMCoreClasses.cpp
+++ b/WebKit/win/DOMCoreClasses.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple 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
@@ -38,6 +38,7 @@
 #include <WebCore/DOMWindow.h>
 #include <WebCore/Document.h>
 #include <WebCore/Element.h>
+#include <WebCore/Frame.h>
 #include <WebCore/SimpleFontData.h>
 #include <WebCore/HTMLFormElement.h>
 #include <WebCore/HTMLInputElement.h>
@@ -53,8 +54,19 @@
 // {3B0C0EFF-478B-4b0b-8290-D2321E08E23E}
 DEFINE_GUID(IID_DOMElement, 0x3b0c0eff, 0x478b, 0x4b0b, 0x82, 0x90, 0xd2, 0x32, 0x1e, 0x8, 0xe2, 0x3e);
 
-using namespace WebCore;
-using namespace HTMLNames;
+// Our normal style is just to say "using namespace WebCore" rather than having
+// individual using directives for each type from that namespace. But
+// "DOMObject" exists both in the WebCore namespace and unnamespaced in this
+// file, which leads to ambiguities if we say "using namespace WebCore".
+using namespace WebCore::HTMLNames;
+using WebCore::AtomicString;
+using WebCore::BString;
+using WebCore::Element;
+using WebCore::ExceptionCode;
+using WebCore::FontDescription;
+using WebCore::Frame;
+using WebCore::IntRect;
+using WebCore::String;
 
 // DOMObject - IUnknown -------------------------------------------------------
 
@@ -128,7 +140,7 @@
     if (!m_node || !m_node->parentNode())
         return E_FAIL;
     *result = DOMNode::createInstance(m_node->parentNode());
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::childNodes( 
@@ -182,7 +194,7 @@
     if (!m_node)
         return E_FAIL;
     *result = DOMDocument::createInstance(m_node->ownerDocument());
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::insertBefore( 
@@ -464,9 +476,7 @@
         return E_FAIL;
 
     *result = DOMNode::createInstance(itemNode);
-    if (!(*result))
-        return E_FAIL;
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMNodeList::length( 
@@ -547,7 +557,7 @@
     /* [retval][out] */ IDOMElement** result)
 {
     *result = DOMElement::createInstance(m_document->documentElement());
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMDocument::createElement( 
@@ -560,9 +570,7 @@
     String tagNameString(tagName);
     ExceptionCode ec;
     *result = DOMElement::createInstance(m_document->createElement(tagNameString, ec).get());
-    if (!(*result))
-        return E_FAIL;
-    return S_OK;    
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMDocument::createDocumentFragment( 
@@ -630,9 +638,7 @@
 
     String tagNameString(tagName);
     *result = DOMNodeList::createInstance(m_document->getElementsByTagName(tagNameString).get());
-    if (!(*result))
-        return E_FAIL;
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMDocument::importNode( 
@@ -673,9 +679,7 @@
     String namespaceURIString(namespaceURI);
     String localNameString(localName);
     *result = DOMNodeList::createInstance(m_document->getElementsByTagNameNS(namespaceURIString, localNameString).get());
-    if (!(*result))
-        return E_FAIL;
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMDocument::getElementById( 
@@ -687,9 +691,7 @@
 
     String idString(elementId);
     *result = DOMElement::createInstance(m_document->getElementById(idString));
-    if (!(*result))
-        return E_FAIL;
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 // DOMDocument - IDOMViewCSS --------------------------------------------------
@@ -715,7 +717,7 @@
         return E_FAIL;
     
     *result = DOMCSSStyleDeclaration::createInstance(dv->getComputedStyle(element, pseudoEltString.impl()).get());
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 // DOMDocument - IDOMDocumentEvent --------------------------------------------
@@ -727,7 +729,7 @@
     String eventTypeString(eventType, SysStringLen(eventType));
     WebCore::ExceptionCode ec = 0;
     *result = DOMEvent::createInstance(m_document->createEvent(eventTypeString, ec));
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 // DOMDocument - DOMDocument --------------------------------------------------
@@ -1061,12 +1063,33 @@
     webFontDescription->family = family.characters();
     webFontDescription->familyLength = family.length();
     webFontDescription->size = fontDescription.computedSize();
-    webFontDescription->bold = fontDescription.weight() >= FontWeight600;
+    webFontDescription->bold = fontDescription.weight() >= WebCore::FontWeight600;
     webFontDescription->italic = fontDescription.italic();
 
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE DOMElement::renderedImage(HBITMAP* image)
+{
+    if (!image) {
+        ASSERT_NOT_REACHED();
+        return E_POINTER;
+    }
+    *image = 0;
+
+    ASSERT(m_element);
+
+    Frame* frame = m_element->document()->frame();
+    if (!frame)
+        return E_FAIL;
+
+    *image = frame->nodeImage(m_element);
+    if (!*image)
+        return E_FAIL;
+
+    return S_OK;
+}
+
 // IDOMElementCSSInlineStyle --------------------------------------------------
 
 HRESULT STDMETHODCALLTYPE DOMElement::style( 
@@ -1082,7 +1105,7 @@
         return E_FAIL;
 
     *result = DOMCSSStyleDeclaration::createInstance(style);
-    return S_OK;
+    return *result ? S_OK : E_FAIL;
 }
 
 // IDOMElementExtensions ------------------------------------------------------
diff --git a/WebKit/win/DOMCoreClasses.h b/WebKit/win/DOMCoreClasses.h
index 1278c7c..3941d13 100644
--- a/WebKit/win/DOMCoreClasses.h
+++ b/WebKit/win/DOMCoreClasses.h
@@ -777,6 +777,9 @@
     virtual HRESULT STDMETHODCALLTYPE font(
         WebFontDescription* webFontDescription);
 
+    virtual HRESULT STDMETHODCALLTYPE renderedImage(
+        /* [retval][out] */ HBITMAP* image);
+
     // IDOMElementCSSInlineStyle
     virtual HRESULT STDMETHODCALLTYPE style( 
         /* [retval][out] */ IDOMCSSStyleDeclaration **result);
diff --git a/WebKit/win/Interfaces/DOMPrivate.idl b/WebKit/win/Interfaces/DOMPrivate.idl
index dcacac2..7210943 100644
--- a/WebKit/win/Interfaces/DOMPrivate.idl
+++ b/WebKit/win/Interfaces/DOMPrivate.idl
@@ -46,6 +46,7 @@
     HRESULT isFocused([out, retval] BOOL* result);
     HRESULT innerText([out, retval] BSTR* result);
     [local] HRESULT font(WebFontDescription* webFontDescription);
+    HRESULT renderedImage([out, retval] HBITMAP* image);
 }
 
 /*
diff --git a/WebKit/win/Interfaces/IWebEmbeddedView.idl b/WebKit/win/Interfaces/IWebEmbeddedView.idl
index 0a65ff7..bcca2fd 100644
--- a/WebKit/win/Interfaces/IWebEmbeddedView.idl
+++ b/WebKit/win/Interfaces/IWebEmbeddedView.idl
@@ -38,4 +38,9 @@
 interface IWebEmbeddedView : IUnknown

 {

     HRESULT createViewWindow([in] OLE_HANDLE parentWindow, [in] LPSIZE pluginSize, [out, retval] OLE_HANDLE* window);

+

+    HRESULT didReceiveResponse([in] IWebURLResponse* response);
+    HRESULT didReceiveData([in] IStream* data);
+    HRESULT didFinishLoading();
+    HRESULT didFail([in] IWebError* error);

 }

diff --git a/WebKit/win/Interfaces/IWebFrameLoadDelegatePrivate.idl b/WebKit/win/Interfaces/IWebFrameLoadDelegatePrivate.idl
index 79707a3..5ae91dd 100644
--- a/WebKit/win/Interfaces/IWebFrameLoadDelegatePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFrameLoadDelegatePrivate.idl
@@ -51,3 +51,14 @@
     //- (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame;
     HRESULT didHandleOnloadEventsForFrame([in] IWebView* sender, [in] IWebFrame* frame);
 }
+
+[
+    object,
+    oleautomation,
+    uuid(5566CB49-6E87-4075-80CE-9BAC374C52DE),
+    pointer_default(unique)
+]
+interface IWebFrameLoadDelegatePrivate2 : IWebFrameLoadDelegatePrivate
+{
+    HRESULT didFirstVisuallyNonEmptyLayoutInFrame([in] IWebView* sender, [in] IWebFrame* frame);
+}
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index bd7c0b6..d1f6cbf 100755
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -41,7 +41,7 @@
     WebFrameLoadTypeReload,
     WebFrameLoadTypeReloadAllowingStaleData,
     WebFrameLoadTypeSame,               // user loads same URL again (but not reload button)
-    WebFrameLoadTypeRedirectWithLockedHistory,
+    WebFrameLoadTypeRedirectWithLockedBackForwardList,
     WebFrameLoadTypeReplace
 } WebFrameLoadType;
 
diff --git a/WebKit/win/Interfaces/IWebHistoryItemPrivate.idl b/WebKit/win/Interfaces/IWebHistoryItemPrivate.idl
index aa8c162..4922504 100644
--- a/WebKit/win/Interfaces/IWebHistoryItemPrivate.idl
+++ b/WebKit/win/Interfaces/IWebHistoryItemPrivate.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -55,4 +55,15 @@
     HRESULT target([out, retval] BSTR* target);
     HRESULT isTargetItem([out, retval] BOOL* result);
     [local] HRESULT children([out] unsigned* childCount, [out, retval] SAFEARRAY** children);
+    HRESULT lastVisitWasFailure([out, retval] BOOL* wasFailure);
+    HRESULT setLastVisitWasFailure([in] BOOL wasFailure);
+    HRESULT lastVisitWasHTTPNonGet([out, retval] BOOL* HTTPNonGet);
+    HRESULT setLastVisitWasHTTPNonGet([in] BOOL wasHTTPNonGet);
+
+    HRESULT redirectURLs([out, retval] IEnumVARIANT** result);
+    HRESULT visitedWithTitle([in] BSTR title);
+
+    HRESULT getDailyVisitCounts([out] int* number, [out, retval] int** counts);
+    HRESULT getWeeklyVisitCounts([out] int* number, [out, retval] int** counts);
+    HRESULT recordInitialVisit();
 }
diff --git a/WebKit/win/Interfaces/IWebHistoryPrivate.idl b/WebKit/win/Interfaces/IWebHistoryPrivate.idl
new file mode 100644
index 0000000..6e4754e
--- /dev/null
+++ b/WebKit/win/Interfaces/IWebHistoryPrivate.idl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2008 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+interface IWebHistoryItem;
+
+[
+    object,
+    oleautomation,
+    hidden,
+    uuid(B811003B-3475-46ad-9697-91D0D181CC05),
+    pointer_default(unique)
+]
+interface IWebHistoryPrivate : IUnknown
+{
+    HRESULT allItems([in, out] int* count, [out, retval] IWebHistoryItem** items);
+}
diff --git a/WebKit/win/Interfaces/IWebIconDatabase.idl b/WebKit/win/Interfaces/IWebIconDatabase.idl
index 0dfbf1a..57d6683 100644
--- a/WebKit/win/Interfaces/IWebIconDatabase.idl
+++ b/WebKit/win/Interfaces/IWebIconDatabase.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -148,4 +148,20 @@
         - (NSString *)iconURLForURL:(NSString *)URL;
     */
     HRESULT iconURLForURL([in] BSTR url, [out, retval] BSTR* iconURL);
+
+    /*!
+        @method isEnabled
+        @discussion Returns true if the icon database is currently enabled, or false if it
+        is disabled.
+        - (BOOL)isEnabled;
+    */
+    HRESULT isEnabled([out, retval] BOOL* result);
+
+    /*!
+        @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;
+    */
+    HRESULT setEnabled([in] BOOL flag);
 }
diff --git a/WebKit/win/Interfaces/IWebPreferences.idl b/WebKit/win/Interfaces/IWebPreferences.idl
index 16f0d9c..9a52d7c 100644
--- a/WebKit/win/Interfaces/IWebPreferences.idl
+++ b/WebKit/win/Interfaces/IWebPreferences.idl
@@ -183,4 +183,7 @@
 
     HRESULT setShouldPaintCustomScrollbars(BOOL shouldPaint);
     HRESULT shouldPaintCustomScrollbars(BOOL *shouldPaint);
+
+    HRESULT setZoomsTextOnly(BOOL zoomsTextOnly);
+    HRESULT zoomsTextOnly(BOOL *zoomsTextOnly);
 }
diff --git a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
index 4a71dbd..aa1073f 100644
--- a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
+++ b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 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
@@ -60,4 +60,13 @@
 
     HRESULT setShouldPaintNativeControls([in] BOOL shouldPaint);
     HRESULT shouldPaintNativeControls([out, retval] BOOL* enabled);
+
+    HRESULT setDatabasesEnabled([in] BOOL enabled);
+    HRESULT databasesEnabled([out, retval] BOOL *enabled);
+
+    HRESULT setLocalStorageEnabled([in] BOOL enabled);
+    HRESULT localStorageEnabled([out, retval] BOOL* enabled);
+
+    HRESULT setFontSmoothingContrast([in] float contrast);
+    HRESULT fontSmoothingContrast([out, retval] float* contrast);
 }
diff --git a/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl b/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl
index de2bdc0..95040bf 100644
--- a/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl
+++ b/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate.idl
@@ -59,3 +59,14 @@
     */
     HRESULT didLoadResourceFromMemoryCache([in] IWebView* webView, [in] IWebURLRequest* request, [in] IWebURLResponse* response, [in] UINT length, [in] IWebDataSource* dataSource);
 }
+
+[
+    object,
+    oleautomation,
+    uuid(E7B724A4-F0E5-4e11-9AC5-5F60AC09301E),
+    pointer_default(unique)
+]
+interface IWebResourceLoadDelegatePrivate2 : IWebResourceLoadDelegatePrivate
+{
+    HRESULT shouldUseCredentialStorage([in] IWebView* webView, [in] unsigned long identifier, [in] IWebDataSource* dataSource, [out, retval] BOOL* shouldUse);
+}
diff --git a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
index 85a72e7..5ef53d9 100755
--- a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
+++ b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
@@ -31,6 +31,9 @@
 #endif
 
 cpp_quote("#define WebEmbeddedViewAttributesKey TEXT(\"WebEmbeddedViewAttributesKey\")")
+cpp_quote("#define WebEmbeddedViewBaseURLKey TEXT(\"WebEmbeddedViewBaseURLKey\")")
+cpp_quote("#define WebEmbeddedViewContainingElementKey TEXT(\"WebEmbeddedViewContainingElementKey\")")
+cpp_quote("#define WebEmbeddedViewMIMETypeKey TEXT(\"WebEmbeddedViewMIMETypeKey\")")
 
 interface IWebEmbeddedView;
 interface IWebFrame;
diff --git a/WebKit/win/Interfaces/IWebView.idl b/WebKit/win/Interfaces/IWebView.idl
index 92fa2b5..e38406b 100644
--- a/WebKit/win/Interfaces/IWebView.idl
+++ b/WebKit/win/Interfaces/IWebView.idl
@@ -1014,6 +1014,16 @@
         - (void)setGrammarCheckingEnabled:(BOOL)flag
     */
     HRESULT setGrammarCheckingEnabled(BOOL enabled);
+
+    /*
+        - (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag;
+    */
+    HRESULT setSelectTrailingWhitespaceEnabled([in] BOOL flag);
+
+    /*
+        - (BOOL)selectTrailingWhitespaceEnabled;
+    */
+    HRESULT isSelectTrailingWhitespaceEnabled([out, retval] BOOL* enabled);
 }
 
 /*
diff --git a/WebKit/win/Interfaces/IWebViewPrivate.idl b/WebKit/win/Interfaces/IWebViewPrivate.idl
index b49addf..c32a20b 100644
--- a/WebKit/win/Interfaces/IWebViewPrivate.idl
+++ b/WebKit/win/Interfaces/IWebViewPrivate.idl
@@ -122,7 +122,6 @@
 
     // SPI for DumpRenderTree
     HRESULT executeCoreCommandByName([in] BSTR name, [in] BSTR value);
-    HRESULT clearMainFrameName();
 
     HRESULT windowAncestryDidChange();
 
@@ -146,4 +145,16 @@
 
     HRESULT setCookieEnabled([in] BOOL enable);
     HRESULT cookieEnabled([out, retval] BOOL* enabled);
+
+    HRESULT setMediaVolume([in] float volume);
+    HRESULT mediaVolume([out, retval] float* volume);
+
+    // SPI for DumpRenderTree
+    HRESULT clearMainFrameName();
+
+    HRESULT globalHistoryItem([out, retval] IWebHistoryItem**);
+
+    HRESULT registerEmbeddedViewMIMEType([in] BSTR mimeType);
+
+    HRESULT setMemoryCacheDelegateCallsEnabled([in] BOOL enabled);
 }
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index fe08792..a78a5d3 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -90,6 +90,7 @@
 #include "IWebHistory.idl"
 #include "IWebHistoryItem.idl"
 #include "IWebHistoryItemPrivate.idl"
+#include "IWebHistoryPrivate.idl"
 #include "IWebIconDatabase.idl"
 #include "IWebIconFetcher.idl"
 #include "IWebInspector.idl"
diff --git a/WebKit/win/MarshallingHelpers.cpp b/WebKit/win/MarshallingHelpers.cpp
index 2a3935e..60f2749 100644
--- a/WebKit/win/MarshallingHelpers.cpp
+++ b/WebKit/win/MarshallingHelpers.cpp
@@ -42,7 +42,7 @@
 
 KURL MarshallingHelpers::BSTRToKURL(BSTR urlStr)
 {
-    return KURL(String(urlStr, SysStringLen(urlStr)));
+    return KURL(KURL(), String(urlStr, SysStringLen(urlStr)));
 }
 
 BSTR MarshallingHelpers::KURLToBSTR(const KURL& url)
diff --git a/WebKit/win/WebCachedPagePlatformData.h b/WebKit/win/WebCachedFramePlatformData.h
similarity index 83%
rename from WebKit/win/WebCachedPagePlatformData.h
rename to WebKit/win/WebCachedFramePlatformData.h
index f5a5388..ec850e3 100644
--- a/WebKit/win/WebCachedPagePlatformData.h
+++ b/WebKit/win/WebCachedFramePlatformData.h
@@ -25,16 +25,16 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef WebCachedPagePlatformData_h
-#define WebCachedPagePlatformData_h
+#ifndef WebCachedFramePlatformData_h
+#define WebCachedFramePlatformData_h
 
 #include "WebDataSource.h"
 
-#include <WebCore/CachedPagePlatformData.h>
+#include <WebCore/CachedFramePlatformData.h>
 
-class WebCachedPagePlatformData : public WebCore::CachedPagePlatformData {
+class WebCachedFramePlatformData : public WebCore::CachedFramePlatformData {
 public:
-    WebCachedPagePlatformData(IWebDataSource* webDataSource) : m_webDataSource(webDataSource) { }
+    WebCachedFramePlatformData(IWebDataSource* webDataSource) : m_webDataSource(webDataSource) { }
 
     IWebDataSource* webDataSource() { return m_webDataSource.get(); }
 
@@ -42,4 +42,4 @@
     COMPtr<IWebDataSource> m_webDataSource;
 };
 
-#endif // CachedPagePlatformData_h
+#endif // CachedFramePlatformData_h
diff --git a/WebKit/win/WebCookieManager.cpp b/WebKit/win/WebCookieManager.cpp
index db51fd1..499d857 100644
--- a/WebKit/win/WebCookieManager.cpp
+++ b/WebKit/win/WebCookieManager.cpp
@@ -27,9 +27,6 @@
 #include "WebKitDLL.h"
 #include "WebCookieManager.h"
 
-#include <CFNetwork/CFHTTPCookiesPriv.h>
-#include <WebCore/CookieStorageWin.h>
-
 using namespace WebCore;
 
 // WebCookieManager -------------------------------------------------------
@@ -83,22 +80,3 @@
 
     return newRef;
 }
-
-// IWebCookieManager -------------------------------------------------------
-
-HRESULT STDMETHODCALLTYPE WebCookieManager::cookieStorage( 
-    /* [retval][out] */ CFHTTPCookieStorageRef* storage)
-{
-    if (!storage)
-        return E_POINTER;
-
-    *storage = currentCookieStorage();
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebCookieManager::setCookieStorage( 
-    /* [in] */ CFHTTPCookieStorageRef storage)
-{
-    setCurrentCookieStorage(storage);
-    return S_OK;
-}
diff --git a/WebKit/win/WebCookieManagerCFNet.cpp b/WebKit/win/WebCookieManagerCFNet.cpp
new file mode 100644
index 0000000..415a679
--- /dev/null
+++ b/WebKit/win/WebCookieManagerCFNet.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebKitDLL.h"
+#include "WebCookieManager.h"
+
+#include <CFNetwork/CFHTTPCookiesPriv.h>
+#include <WebCore/CookieStorageWin.h>
+
+using namespace WebCore;
+
+// IWebCookieManager -------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebCookieManager::cookieStorage( 
+    /* [retval][out] */ CFHTTPCookieStorageRef* storage)
+{
+   if (!storage)
+        return E_POINTER;
+
+    *storage = currentCookieStorage();
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebCookieManager::setCookieStorage( 
+    /* [in] */ CFHTTPCookieStorageRef storage)
+{
+    setCurrentCookieStorage(storage);
+    return S_OK;
+}
diff --git a/WebKit/win/WebCookieManagerCurl.cpp b/WebKit/win/WebCookieManagerCurl.cpp
new file mode 100644
index 0000000..e60d8cf
--- /dev/null
+++ b/WebKit/win/WebCookieManagerCurl.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 Brent Fulgham <bfulgham@gmail.com>. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebKitDLL.h"
+#include "WebCookieManager.h"
+
+#include "NotImplemented.h"
+
+using namespace WebCore;
+
+// IWebCookieManager -------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebCookieManager::cookieStorage( 
+    /* [retval][out] */ CFHTTPCookieStorageRef* storage)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebCookieManager::setCookieStorage( 
+    /* [in] */ CFHTTPCookieStorageRef storage)
+{
+   notImplemented();
+   return E_FAIL;
+}
diff --git a/WebKit/win/WebCoreLocalizedStrings.cpp b/WebKit/win/WebCoreLocalizedStrings.cpp
index f754a47..21dc35d 100644
--- a/WebKit/win/WebCoreLocalizedStrings.cpp
+++ b/WebKit/win/WebCoreLocalizedStrings.cpp
@@ -69,6 +69,7 @@
 String WebCore::contextMenuItemTagUnderline() { return String(LPCTSTR_UI_STRING("Underline", "Underline context menu item")); }
 String WebCore::contextMenuItemTagOutline() { return String(LPCTSTR_UI_STRING("Outline", "Outline context menu item")); }
 String WebCore::contextMenuItemTagWritingDirectionMenu() { return String(LPCTSTR_UI_STRING("Writing Direction", "Writing direction context sub-menu item")); }
+String WebCore::contextMenuItemTagTextDirectionMenu() { return String(LPCTSTR_UI_STRING("Text Direction", "Text direction context sub-menu item")); }
 String WebCore::contextMenuItemTagDefaultDirection() { return String(LPCTSTR_UI_STRING("Default", "Default writing direction context menu item")); }
 String WebCore::contextMenuItemTagLeftToRight() { return String(LPCTSTR_UI_STRING("Left to Right", "Left to Right context menu item")); }
 String WebCore::contextMenuItemTagRightToLeft() { return String(LPCTSTR_UI_STRING("Right to Left", "Right to Left context menu item")); }
diff --git a/WebKit/win/WebCoreStatistics.cpp b/WebKit/win/WebCoreStatistics.cpp
index ad5af7d..3f7a14c 100644
--- a/WebKit/win/WebCoreStatistics.cpp
+++ b/WebKit/win/WebCoreStatistics.cpp
@@ -98,7 +98,7 @@
         return E_POINTER;
 
     JSLock lock(false);
-    *count = (UINT)JSDOMWindow::commonJSGlobalData()->heap.size();
+    *count = (UINT)JSDOMWindow::commonJSGlobalData()->heap.objectCount();
     return S_OK;
 }
 
@@ -192,7 +192,7 @@
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) FontCache::fontDataCount();
+    *count = (UINT) fontCache()->fontDataCount();
     return S_OK;
 }
 
@@ -201,13 +201,13 @@
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) FontCache::inactiveFontDataCount();
+    *count = (UINT) fontCache()->inactiveFontDataCount();
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebCoreStatistics::purgeInactiveFontData(void)
 {
-    FontCache::purgeInactiveFontData();
+    fontCache()->purgeInactiveFontData();
     return S_OK;
 }
 
diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
index b18022b..952bc03 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
@@ -31,6 +31,10 @@
 #include <WebCore/FrameView.h>

 #include <WebCore/RenderObject.h>

 

+#include "MemoryStream.h"

+#include "WebError.h"

+#include "WebURLResponse.h"

+

 using namespace WebCore;

 

 EmbeddedWidget* EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)

@@ -84,7 +88,7 @@
     frameRectsChanged();

 }

 

-void EmbeddedWidget::frameRectsChanged() const

+void EmbeddedWidget::frameRectsChanged()

 {

     if (!parent())

         return;

@@ -207,3 +211,30 @@
         ShowWindow(m_window, SW_HIDE);

     m_attachedToWindow = false;

 }

+

+void EmbeddedWidget::didReceiveResponse(const ResourceResponse& response)

+{

+    ASSERT(m_view);

+

+    COMPtr<IWebURLResponse> urlResponse(AdoptCOM, WebURLResponse::createInstance(response));

+    m_view->didReceiveResponse(urlResponse.get());

+}

+

+void EmbeddedWidget::didReceiveData(const char* data, int length)

+{

+    RefPtr<SharedBuffer> buffer(SharedBuffer::create(data, length));

+

+    COMPtr<IStream> stream(AdoptCOM, MemoryStream::createInstance(buffer.release()));

+    m_view->didReceiveData(stream.get());

+}

+

+void EmbeddedWidget::didFinishLoading()

+{

+    m_view->didFinishLoading();

+}

+

+void EmbeddedWidget::didFail(const ResourceError& error)

+{

+    COMPtr<IWebError> webError(AdoptCOM, WebError::createInstance(error));

+    m_view->didFail(webError.get());

+}

diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.h b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
index ed7c025..56cd436 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.h
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
@@ -28,7 +28,7 @@
 

 #include <WebCore/COMPtr.h>

 #include <WebCore/IntRect.h>

-#include <WebCore/Widget.h>

+#include <WebCore/PluginView.h>

 

 namespace WebCore {

     class Element;

@@ -37,7 +37,7 @@
 

 interface IWebEmbeddedView;

 

-class EmbeddedWidget : public WebCore::Widget {

+class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {

 public:

     static EmbeddedWidget* create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);

     ~EmbeddedWidget();

@@ -54,9 +54,14 @@
 

     bool createWindow(HWND parentWindow, const WebCore::IntSize& size);

 

+    virtual void didReceiveResponse(const WebCore::ResourceResponse&);
+    virtual void didReceiveData(const char*, int);
+    virtual void didFinishLoading();
+    virtual void didFail(const WebCore::ResourceError&);
+

     virtual void invalidateRect(const WebCore::IntRect&);

     virtual void setFrameRect(const WebCore::IntRect&);

-    virtual void frameRectsChanged() const;

+    virtual void frameRectsChanged();

     virtual void setFocus();

     virtual void show();

     virtual void hide();

@@ -73,8 +78,8 @@
     bool m_isVisible;

     bool m_attachedToWindow;

         

-    mutable WebCore::IntRect m_clipRect; // The clip rect to apply to an embedded view.

-    mutable WebCore::IntRect m_windowRect; // Our window rect.

+    WebCore::IntRect m_clipRect; // The clip rect to apply to an embedded view.

+    WebCore::IntRect m_windowRect; // Our window rect.

 };

 

 #endif // EmbeddedWidget_h

diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index dba87e5..9aec24b 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -40,6 +40,7 @@
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/LocalizedStrings.h>
+#include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
 #include <WebCore/WindowFeatures.h>
 #pragma warning(pop)
@@ -474,6 +475,11 @@
     return viewWindow;
 }
 
+void WebChromeClient::contentsSizeChanged(Frame*, const IntSize&) const
+{
+    notImplemented();
+}
+
 void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h
index 83c5a70..cb9f470 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -97,6 +97,7 @@
     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint& p) const;
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect& r) const;
     virtual PlatformWidget platformWindow() const;
+    virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
 
     virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
 
@@ -117,6 +118,8 @@
 
     WebView* webView() const { return m_webView; }
 
+    virtual void formStateDidChange(const WebCore::Node*) { }
+
 private:
     COMPtr<IWebUIDelegate> uiDelegate();
     COMPtr<IWebUIDelegate2> uiDelegate2();
diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
index be7b483..deabb5c 100644
--- a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
@@ -160,7 +160,7 @@
 
     ResourceRequest request = ResourceRequest(url);
     if (Page* page = frame->page())
-        page->mainFrame()->loader()->urlSelected(FrameLoadRequest(request), 0, false);
+        page->mainFrame()->loader()->urlSelected(FrameLoadRequest(request), 0, false, false);
 }
 
 void WebContextMenuClient::lookUpInDictionary(Frame*)
diff --git a/WebKit/win/WebCoreSupport/WebDragClient.cpp b/WebKit/win/WebCoreSupport/WebDragClient.cpp
index c35991f..d42f7b5 100644
--- a/WebKit/win/WebCoreSupport/WebDragClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebDragClient.cpp
@@ -30,7 +30,6 @@
 #include "WebView.h"
 
 #include <shlobj.h>
-#include <CoreGraphics/CoreGraphics.h>
 
 #pragma warning(push, 0) 
 #include <WebCore/ClipboardWin.h>
@@ -46,7 +45,8 @@
 #pragma warning(pop) 
 
 namespace WebCore {
-    HBITMAP allocImage(HDC dc, IntSize size, CGContextRef *targetRef);
+    HBITMAP allocImage(HDC dc, IntSize size, PlatformGraphicsContext** targetRef);
+    void deallocContext(PlatformGraphicsContext* target);
 }
 
 
@@ -223,7 +223,7 @@
         return 0;
     }
 
-    CGContextRef contextRef;
+    PlatformGraphicsContext* contextRef;
     image = allocImage(workingDC, imageSize, &contextRef);
     if (!image) {
         DeleteDC(workingDC);
@@ -237,7 +237,6 @@
     // for drag images on win, so we use 1
     static const Color backgroundColor(140, 140, 140);
     static const IntSize radii(DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS);
-    context.setFont(labelFont);
     IntRect rect(0, 0, imageSize.width(), imageSize.height());
     context.fillRoundedRect(rect, radii, radii, radii, radii, backgroundColor);
  
@@ -257,7 +256,7 @@
     IntPoint textPos(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y + labelFont.pixelSize());
     WebCoreDrawDoubledTextAtPoint(context, label, textPos, labelFont, topColor, bottomColor);
 
-    CGContextRelease(contextRef);
+    deallocContext(contextRef);
     DeleteDC(workingDC);
     ReleaseDC(0, dc);
     return image;
diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.cpp b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
index e38cd0d..985742f 100644
--- a/WebKit/win/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
@@ -295,6 +295,13 @@
     return !!enabled;
 }
 
+bool WebEditorClient::isSelectTrailingWhitespaceEnabled(void)
+{
+    BOOL enabled = FALSE;
+    m_webView->isSelectTrailingWhitespaceEnabled(&enabled);
+    return !!enabled;
+}
+
 bool WebEditorClient::shouldChangeSelectedRange(WebCore::Range*, WebCore::Range*, WebCore::EAffinity, bool)
 { notImplemented(); return true; }
 
diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.h b/WebKit/win/WebCoreSupport/WebEditorClient.h
index 8c603f2..52cb66d 100644
--- a/WebKit/win/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/win/WebCoreSupport/WebEditorClient.h
@@ -75,6 +75,7 @@
     void webViewDidChangeSelection(WebNotification*);
 
     bool smartInsertDeleteEnabled();
+    bool isSelectTrailingWhitespaceEnabled();
 
     void registerCommandForUndo(PassRefPtr<WebCore::EditCommand>);
     void registerCommandForRedo(PassRefPtr<WebCore::EditCommand>);
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 17bee47..1af1673 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -31,9 +31,11 @@
 
 #include "CFDictionaryPropertyBag.h"
 #include "COMPropertyBag.h"
+#include "DOMHTMLClasses.h"
 #include "EmbeddedWidget.h"
 #include "MarshallingHelpers.h"
-#include "WebCachedPagePlatformData.h"
+#include "NotImplemented.h"
+#include "WebCachedFramePlatformData.h"
 #include "WebChromeClient.h"
 #include "WebDocumentLoader.h"
 #include "WebError.h"
@@ -46,6 +48,7 @@
 #include "WebURLResponse.h"
 #include "WebView.h"
 #pragma warning(push, 0)
+#include <WebCore/CachedFrame.h>
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameTree.h>
@@ -71,7 +74,7 @@
 
 WebFrameLoaderClient::WebFrameLoaderClient(WebFrame* webFrame)
     : m_webFrame(webFrame)
-    , m_pluginView(0) 
+    , m_manualLoader(0) 
     , m_hasSentResponseToPlugin(false) 
 {
     ASSERT_ARG(webFrame, webFrame);
@@ -102,8 +105,27 @@
     resourceLoadDelegate->identifierForInitialRequest(webView, webURLRequest.get(), getWebDataSource(loader), identifier);
 }
 
+bool WebFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader* loader, unsigned long identifier)
+{
+    WebView* webView = m_webFrame->webView();
+    COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
+        return true;
+
+    COMPtr<IWebResourceLoadDelegatePrivate2> resourceLoadDelegatePrivate;
+    if (FAILED(resourceLoadDelegate->QueryInterface(IID_IWebResourceLoadDelegatePrivate2, reinterpret_cast<void**>(&resourceLoadDelegatePrivate))))
+        return true;
+
+    BOOL shouldUse;
+    if (SUCCEEDED(resourceLoadDelegatePrivate->shouldUseCredentialStorage(webView, identifier, getWebDataSource(loader), &shouldUse)))
+        return shouldUse;
+
+    return true;
+}
+
 void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge& challenge)
 {
+#if USE(CFNETWORK)
     ASSERT(challenge.sourceHandle());
 
     WebView* webView = m_webFrame->webView();
@@ -117,6 +139,9 @@
     // If the ResourceLoadDelegate doesn't exist or fails to handle the call, we tell the ResourceHandle
     // to continue without credential - this is the best approximation of Mac behavior
     challenge.sourceHandle()->receivedRequestToContinueWithoutCredential(challenge);
+#else
+   notImplemented();
+#endif
 }
 
 void WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge& challenge)
@@ -297,6 +322,17 @@
         frameLoadDelegatePriv->didFirstLayoutInFrame(webView, m_webFrame);
 }
 
+void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+    WebView* webView = m_webFrame->webView();
+    COMPtr<IWebFrameLoadDelegatePrivate> frameLoadDelegatePrivate;
+    if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePrivate)) && frameLoadDelegatePrivate) {
+        COMPtr<IWebFrameLoadDelegatePrivate2> frameLoadDelegatePrivate2(Query, frameLoadDelegatePrivate);
+        if (frameLoadDelegatePrivate2)
+            frameLoadDelegatePrivate2->didFirstVisuallyNonEmptyLayoutInFrame(webView, m_webFrame);
+    }
+}
+
 Frame* WebFrameLoaderClient::dispatchCreatePage()
 {
     WebView* webView = m_webFrame->webView();
@@ -331,12 +367,11 @@
 
 void WebFrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError& error)
 {
-    if (!m_pluginView)
+    if (!m_manualLoader)
         return;
 
-    if (m_pluginView->status() == PluginStatusLoadedSuccessfully)
-        m_pluginView->didFail(error);
-    m_pluginView = 0;
+    m_manualLoader->didFail(error);
+    m_manualLoader = 0;
     m_hasSentResponseToPlugin = false;
 }
 
@@ -366,22 +401,22 @@
     // FIXME: This should probably go through the data source.
     const String& textEncoding = loader->response().textEncodingName();
 
-    if (!m_pluginView)
+    if (!m_manualLoader)
         receivedData(data, length, textEncoding);
 
-    if (!m_pluginView || m_pluginView->status() != PluginStatusLoadedSuccessfully)
+    if (!m_manualLoader)
         return;
 
     if (!m_hasSentResponseToPlugin) {
-        m_pluginView->didReceiveResponse(core(m_webFrame)->loader()->documentLoader()->response());
+        m_manualLoader->didReceiveResponse(core(m_webFrame)->loader()->documentLoader()->response());
         // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in
-        // setting up this stream can cause the main document load to be cancelled, setting m_pluginView
+        // setting up this stream can cause the main document load to be cancelled, setting m_manualLoader
         // to null
-        if (!m_pluginView)
+        if (!m_manualLoader)
             return;
         m_hasSentResponseToPlugin = true;
     }
-    m_pluginView->didReceiveData(data, length);
+    m_manualLoader->didReceiveData(data, length);
 }
 
 void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)
@@ -405,23 +440,44 @@
     // Telling the frame we received some data and passing 0 as the data is our
     // way to get work done that is normally done when the first bit of data is
     // received, even for the case of a document with no data (like about:blank)
-    if (!m_pluginView) {
+    if (!m_manualLoader) {
         committedLoad(loader, 0, 0);
         return;
     }
 
-    if (m_pluginView->status() == PluginStatusLoadedSuccessfully)
-        m_pluginView->didFinishLoading();
-    m_pluginView = 0;
+    m_manualLoader->didFinishLoading();
+    m_manualLoader = 0;
     m_hasSentResponseToPlugin = false;
 }
 
-void WebFrameLoaderClient::updateGlobalHistory(const KURL& url)
+void WebFrameLoaderClient::updateGlobalHistory()
 {
     WebHistory* history = WebHistory::sharedHistory();
     if (!history)
         return;
-    history->addItem(url, core(m_webFrame)->loader()->documentLoader()->title());                 
+
+    DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
+
+    if (loader->urlForHistoryReflectsServerRedirect()) {
+        history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), loader->url(), false);                 
+        return;
+    }
+
+    if (loader->urlForHistoryReflectsClientRedirect()) {
+        history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), true);
+        return;
+    }
+
+    history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), false);
+}
+
+void WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem()
+{
+    WebHistory* history = WebHistory::sharedHistory();
+    if (!history)
+        return;
+    DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
+    history->visitedURLForRedirectWithoutHistoryItem(loader->url());
 }
 
 bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem*) const
@@ -464,56 +520,35 @@
     itemPrivate->setTitle(BString(title));
 }
 
-void WebFrameLoaderClient::savePlatformDataToCachedPage(CachedPage* cachedPage)
+void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame)
 {
+#if USE(CFNETWORK)
     Frame* coreFrame = core(m_webFrame);
     if (!coreFrame)
         return;
 
-    ASSERT(coreFrame->loader()->documentLoader() == cachedPage->documentLoader());
+    ASSERT(coreFrame->loader()->documentLoader() == cachedFrame->documentLoader());
 
-    WebCachedPagePlatformData* webPlatformData = new WebCachedPagePlatformData(static_cast<IWebDataSource*>(getWebDataSource(coreFrame->loader()->documentLoader())));
-    cachedPage->setCachedPagePlatformData(webPlatformData);
+    WebCachedFramePlatformData* webPlatformData = new WebCachedFramePlatformData(static_cast<IWebDataSource*>(getWebDataSource(coreFrame->loader()->documentLoader())));
+    cachedFrame->setCachedFramePlatformData(webPlatformData);
+#else
+    notImplemented();
+#endif
+}
+
+void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*)
+{
 }
 
 void WebFrameLoaderClient::transitionToCommittedForNewPage()
 {
-    Frame* frame = core(m_webFrame);
-    ASSERT(frame);
+    WebView* view = m_webFrame->webView();
 
-    Page* page = frame->page();
-    ASSERT(page);
-
-    bool isMainFrame = frame == page->mainFrame();
-
-    if (isMainFrame && frame->view())
-        frame->view()->setParentVisible(false);
-
-    frame->setView(0);
-
-    WebView* webView = m_webFrame->webView();
-
-    FrameView* frameView;
-    if (isMainFrame) {
-        RECT rect;
-        webView->frameRect(&rect);
-        frameView = new FrameView(frame, IntRect(rect).size());
-    } else
-        frameView = new FrameView(frame);
-
-    frame->setView(frameView);
-    frameView->deref(); // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
-
-    m_webFrame->updateBackground();
-
-    if (isMainFrame)
-        frameView->setParentVisible(true);
-
-    if (frame->ownerRenderer())
-        frame->ownerRenderer()->setWidget(frameView);
-
-    if (HTMLFrameOwnerElement* owner = frame->ownerElement())
-        frame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
+    RECT rect;
+    view->frameRect(&rect);
+    bool transparent = view->transparent();
+    Color backgroundColor = transparent ? Color::transparent : Color::white;
+    WebCore::FrameLoaderClient::transitionToCommittedForNewPage(core(m_webFrame), IntRect(rect).size(), backgroundColor, transparent, IntSize(), false);
 }
 
 bool WebFrameLoaderClient::canCachePage() const
@@ -562,18 +597,14 @@
 
     HistoryItem* parentItem = coreFrame->loader()->currentHistoryItem();
     FrameLoadType loadType = coreFrame->loader()->loadType();
-    FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedHistory;
+    FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedBackForwardList;
 
     KURL url = originalURL;
 
     // If we're moving in the backforward list, we might want to replace the content
     // of this child frame with whatever was there at that point.
     // Reload will maintain the frame contents, LoadSame will not.
-    if (parentItem && parentItem->children().size() &&
-        (isBackForwardLoadType(loadType)
-         || loadType == FrameLoadTypeReload
-         || loadType == FrameLoadTypeReloadAllowingStaleData))
-    {
+    if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType)) {
         if (HistoryItem* childItem = parentItem->childItemWithName(core(childFrame)->tree()->name())) {
             // Use the original URL to ensure we get all the side-effects, such as
             // onLoad handlers, of any redirects that happened. An example of where
@@ -593,7 +624,7 @@
 
     // FIXME: Handle loading WebArchives here
     String frameName = core(childFrame)->tree()->name();
-    core(childFrame)->loader()->loadURL(url, referrer, frameName, childLoadType, 0, 0);
+    core(childFrame)->loader()->loadURL(url, referrer, frameName, false, childLoadType, 0, 0);
 }
 
 Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
@@ -610,11 +641,16 @@
             for (unsigned i = 0; i < paramNames.size(); i++) 
                 viewArguments.set(paramNames[i], paramValues[i]);
             COMPtr<IPropertyBag> viewArgumentsBag(AdoptCOM, COMPropertyBag<String>::adopt(viewArguments));
+            COMPtr<IDOMElement> containingElement(AdoptCOM, DOMElement::createInstance(element));
 
-            // Now create a new property bag where the view arguments is the only property.
-            HashMap<String, COMPtr<IUnknown> > arguments;
-            arguments.set(WebEmbeddedViewAttributesKey, COMPtr<IUnknown>(AdoptCOM, viewArgumentsBag.releaseRef()));
-            COMPtr<IPropertyBag> argumentsBag(AdoptCOM, COMPropertyBag<COMPtr<IUnknown> >::adopt(arguments));
+            HashMap<String, COMVariant> arguments;
+
+            arguments.set(WebEmbeddedViewAttributesKey, viewArgumentsBag);
+            arguments.set(WebEmbeddedViewBaseURLKey, url.string());
+            arguments.set(WebEmbeddedViewContainingElementKey, containingElement);
+            arguments.set(WebEmbeddedViewMIMETypeKey, mimeType);
+
+            COMPtr<IPropertyBag> argumentsBag(AdoptCOM, COMPropertyBag<COMVariant>::adopt(arguments));
 
             COMPtr<IWebEmbeddedView> view;
             HRESULT result = uiPrivate->embeddedViewWithArguments(webView, m_webFrame, argumentsBag.get(), &view);
@@ -694,7 +730,10 @@
 {
     // Ideally, this function shouldn't be necessary, see <rdar://problem/4852889>
 
-    m_pluginView = static_cast<PluginView*>(pluginWidget);
+    if (pluginWidget->isPluginView())
+        m_manualLoader = static_cast<PluginView*>(pluginWidget);
+    else 
+        m_manualLoader = static_cast<EmbeddedWidget*>(pluginWidget);
 }
 
 WebHistory* WebFrameLoaderClient::webHistory() const
@@ -704,3 +743,12 @@
 
     return WebHistory::sharedHistory();
 }
+
+bool WebFrameLoaderClient::shouldUsePluginDocument(const String& mimeType) const
+{
+    WebView* webView = m_webFrame->webView();
+    if (!webView)
+        return false;
+
+    return webView->shouldUseEmbeddedView(mimeType);
+}
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index b9fd027..3877273 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -34,7 +34,7 @@
 #pragma warning(pop)
 
 namespace WebCore {
-    class PluginView;
+    class PluginManualLoader;
 }
 
 template <typename T> class COMPtr;
@@ -49,6 +49,7 @@
     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&);
@@ -69,6 +70,7 @@
     virtual void dispatchDidFinishDocumentLoad();
     virtual void dispatchDidFinishLoad();
     virtual void dispatchDidFirstLayout();
+    virtual void dispatchDidFirstVisuallyNonEmptyLayout();
 
     virtual WebCore::Frame* dispatchCreatePage();
     virtual void dispatchShow();
@@ -83,13 +85,15 @@
     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 PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
     virtual void setTitle(const WebCore::String& title, const WebCore::KURL&);
 
-    virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+    virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*);
+    virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
     virtual void transitionToCommittedForNewPage();
 
     virtual bool canCachePage() const;
@@ -99,6 +103,8 @@
     virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually);
     virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
 
+    virtual bool shouldUsePluginDocument(const WebCore::String& mimeType) const;
+
 protected:
     WebFrameLoaderClient(WebFrame*);
     ~WebFrameLoaderClient();
@@ -111,8 +117,8 @@
 
     WebFrame* m_webFrame;
 
-    // Points to the plugin view that data should be redirected to.
-    WebCore::PluginView* m_pluginView;
+    // Points to the manual loader that data should be redirected to.
+    WebCore::PluginManualLoader* m_manualLoader;
 
     bool m_hasSentResponseToPlugin;
 };
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index bfbf858..56cf0df 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -72,6 +72,7 @@
     : m_inspectedWebView(webView)
     , m_hwnd(0)
     , m_webViewHwnd(0)
+    , m_shouldAttachWhenShown(false)
     , m_attached(false)
 {
     ASSERT(m_inspectedWebView);
@@ -202,20 +203,13 @@
 
 void WebInspectorClient::showWindow()
 {
-    if (!m_hwnd)
-        return;
-
-    updateWindowTitle();
-    ::SetWindowPos(m_hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
+    showWindowWithoutNotifications();
     m_inspectedWebView->page()->inspectorController()->setWindowVisible(true);
 }
 
 void WebInspectorClient::closeWindow()
 {
-    if (!m_webView)
-        return;
-
-    ::ShowWindow(m_hwnd, SW_HIDE);
+    closeWindowWithoutNotifications();
     m_inspectedWebView->page()->inspectorController()->setWindowVisible(false);
 }
 
@@ -226,27 +220,13 @@
 
 void WebInspectorClient::attachWindow()
 {
-    ASSERT(m_hwnd);
-    ASSERT(m_webView);
-    ASSERT(m_inspectedWebViewHwnd);
-
     if (m_attached)
         return;
 
-    WindowMessageBroadcaster::addListener(m_inspectedWebViewHwnd, this);
+    m_shouldAttachWhenShown = true;
 
-    HWND hostWindow;
-    if (FAILED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
-        return;
-
-    m_webView->setHostWindow((OLE_HANDLE)(ULONG64)hostWindow);
-    ::ShowWindow(m_hwnd, SW_HIDE);
-    m_attached = true;
-
-    ::SendMessage(hostWindow, WM_SIZE, 0, 0);
-
-    if (m_highlight && m_highlight->isShowing())
-        m_highlight->update();
+    closeWindowWithoutNotifications();
+    showWindowWithoutNotifications();
 }
 
 void WebInspectorClient::detachWindow()
@@ -254,20 +234,10 @@
     if (!m_attached)
         return;
 
-    WindowMessageBroadcaster::removeListener(m_inspectedWebViewHwnd, this);
+    m_shouldAttachWhenShown = false;
 
-    m_attached = false;
-
-    m_webView->setHostWindow((OLE_HANDLE)(ULONG64)m_hwnd);
-    ::ShowWindow(m_hwnd, SW_SHOW);
-    ::SendMessage(m_hwnd, WM_SIZE, 0, 0);
-
-    HWND hostWindow;
-    if (SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
-        ::SendMessage(hostWindow, WM_SIZE, 0, 0);
-
-    if (m_highlight && m_highlight->isShowing())
-        m_highlight->update();
+    closeWindowWithoutNotifications();
+    showWindowWithoutNotifications();
 }
 
 void WebInspectorClient::setAttachedWindowHeight(unsigned height)
@@ -303,6 +273,74 @@
     updateWindowTitle();
 }
 
+void WebInspectorClient::closeWindowWithoutNotifications()
+{
+    if (!m_hwnd)
+        return;
+
+    if (!m_attached) {
+        ShowWindow(m_hwnd, SW_HIDE);
+        return;
+    }
+
+    ASSERT(m_webView);
+    ASSERT(m_inspectedWebViewHwnd);
+    ASSERT(!IsWindowVisible(m_hwnd));
+
+    // Remove the Inspector's WebView from the inspected WebView's parent window.
+    WindowMessageBroadcaster::removeListener(m_inspectedWebViewHwnd, this);
+
+    m_attached = false;
+
+    m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_hwnd));
+
+    // Make sure everything has the right size/position.
+    HWND hostWindow;
+    if (SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
+        SendMessage(hostWindow, WM_SIZE, 0, 0);
+
+    if (m_highlight && m_highlight->isShowing())
+        m_highlight->update();
+}
+
+void WebInspectorClient::showWindowWithoutNotifications()
+{
+    if (!m_hwnd)
+        return;
+
+    ASSERT(m_webView);
+    ASSERT(m_inspectedWebViewHwnd);
+
+    if (!m_shouldAttachWhenShown) {
+        // Put the Inspector's WebView inside our window and show it.
+        m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_hwnd));
+        SendMessage(m_hwnd, WM_SIZE, 0, 0);
+        updateWindowTitle();
+
+        SetWindowPos(m_hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
+        return;
+    }
+
+    // Put the Inspector's WebView inside the inspected WebView's parent window.
+    WindowMessageBroadcaster::addListener(m_inspectedWebViewHwnd, this);
+
+    HWND hostWindow;
+    if (FAILED(m_inspectedWebView->hostWindow(reinterpret_cast<OLE_HANDLE*>(&hostWindow))))
+        return;
+
+    m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(hostWindow));
+
+    // Then hide our own window.
+    ShowWindow(m_hwnd, SW_HIDE);
+
+    m_attached = true;
+
+    // Make sure everything has the right size/position.
+    SendMessage(hostWindow, WM_SIZE, 0, 0);
+    if (m_highlight && m_highlight->isShowing())
+        m_highlight->update();
+}
+
 void WebInspectorClient::updateWindowTitle()
 {
     // FIXME: The series of appends should be replaced with a call to String::format()
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h
index a28507a..86317f6 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -71,6 +71,9 @@
 private:
     ~WebInspectorClient();
 
+    void closeWindowWithoutNotifications();
+    void showWindowWithoutNotifications();
+
     void updateWindowTitle();
 
     LRESULT onGetMinMaxInfo(WPARAM, LPARAM);
@@ -88,6 +91,7 @@
     COMPtr<WebView> m_webView;
     HWND m_webViewHwnd;
 
+    bool m_shouldAttachWhenShown;
     bool m_attached;
 
     OwnPtr<WebNodeHighlight> m_highlight;
diff --git a/WebKit/win/WebDownload.cpp b/WebKit/win/WebDownload.cpp
index 8a2fe8e..0893a73 100644
--- a/WebKit/win/WebDownload.cpp
+++ b/WebKit/win/WebDownload.cpp
@@ -43,37 +43,29 @@
 #include <sys/types.h>
 
 #pragma warning(push, 0)
-#include <WebCore/AuthenticationCF.h>
 #include <WebCore/BString.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/ResourceError.h>
 #include <WebCore/ResourceHandle.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/ResourceResponse.h>
-#include <WebCore/SystemTime.h>
+#include <wtf/CurrentTime.h>
+#include <wtf/StdLibExtras.h>
 #pragma warning(pop)
 
 using namespace WebCore;
 
-// CFURLDownload Callbacks ----------------------------------------------------------------
-static void didStartCallback(CFURLDownloadRef download, const void *clientInfo);
-static CFURLRequestRef willSendRequestCallback(CFURLDownloadRef download, CFURLRequestRef request, CFURLResponseRef redirectionResponse, const void *clientInfo);
-static void didReceiveAuthenticationChallengeCallback(CFURLDownloadRef download, CFURLAuthChallengeRef challenge, const void *clientInfo);
-static void didReceiveResponseCallback(CFURLDownloadRef download, CFURLResponseRef response, const void *clientInfo);
-static void willResumeWithResponseCallback(CFURLDownloadRef download, CFURLResponseRef response, UInt64 startingByte, const void *clientInfo);
-static void didReceiveDataCallback(CFURLDownloadRef download, CFIndex length, const void *clientInfo);
-static Boolean shouldDecodeDataOfMIMETypeCallback(CFURLDownloadRef download, CFStringRef encodingType, const void *clientInfo);
-static void decideDestinationWithSuggestedObjectNameCallback(CFURLDownloadRef download, CFStringRef objectName, const void *clientInfo);
-static void didCreateDestinationCallback(CFURLDownloadRef download, CFURLRef path, const void *clientInfo);
-static void didFinishCallback(CFURLDownloadRef download, const void *clientInfo);
-static void didFailCallback(CFURLDownloadRef download, CFErrorRef error, const void *clientInfo);
-
 // Download Bundle file utilities ----------------------------------------------------------------
-static const String BundleExtension(".download");
-static UInt32 BundleMagicNumber = 0xDECAF4EA;
+const String& WebDownload::bundleExtension()
+{
+   DEFINE_STATIC_LOCAL(const String, bundleExtension, (".download"));
+   return bundleExtension;
+}
 
-static CFDataRef extractResumeDataFromBundle(const String& bundlePath);
-static HRESULT appendResumeDataToBundle(CFDataRef resumeData, const String& bundlePath);
+UInt32 WebDownload::bundleMagicNumber()
+{
+   return 0xDECAF4EA;
+}
 
 // WebDownload ----------------------------------------------------------------
 
@@ -84,57 +76,6 @@
     gClassNameCount.add("WebDownload");
 }
 
-void WebDownload::init(ResourceHandle* handle, const ResourceRequest& request, const ResourceResponse& response, IWebDownloadDelegate* delegate)
-{
-    m_delegate = delegate ? delegate : DefaultDownloadDelegate::sharedInstance();
-    CFURLConnectionRef connection = handle->connection();
-    if (!connection) {
-        LOG_ERROR("WebDownload::WebDownload(ResourceHandle*,...) called with an inactive ResourceHandle");    
-        return;
-    }
-
-    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
-        didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback,
-        decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
-
-    m_request.adoptRef(WebMutableURLRequest::createInstance(request));
-    m_download.adoptCF(CFURLDownloadCreateAndStartWithLoadingConnection(0, connection, request.cfURLRequest(), response.cfURLResponse(), &client));
-
-    // It is possible for CFURLDownloadCreateAndStartWithLoadingConnection() to fail if the passed in CFURLConnection is not in a "downloadable state"
-    // However, we should never hit that case
-    if (!m_download) {
-        ASSERT_NOT_REACHED();
-        LOG_ERROR("WebDownload - Failed to create WebDownload from existing connection (%s)", request.url().string().utf8().data());
-    } else
-        LOG(Download, "WebDownload - Created WebDownload %p from existing connection (%s)", this, request.url().string().utf8().data());
-
-    // The CFURLDownload either starts successfully and retains the CFURLConnection, 
-    // or it fails to creating and we have a now-useless connection with a dangling ref. 
-    // Either way, we need to release the connection to balance out ref counts
-    handle->releaseConnectionForDownload();
-    CFRelease(connection);
-}
-
-void WebDownload::init(const KURL& url, IWebDownloadDelegate* delegate)
-{
-    m_delegate = delegate ? delegate : DefaultDownloadDelegate::sharedInstance();
-    LOG_ERROR("Delegate is %p", m_delegate.get());
-
-    ResourceRequest request(url);
-    CFURLRequestRef cfRequest = request.cfURLRequest();
-
-    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
-                                  didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback, 
-                                  decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
-    m_request.adoptRef(WebMutableURLRequest::createInstance(request));
-    m_download.adoptCF(CFURLDownloadCreate(0, cfRequest, &client));
-
-    CFURLDownloadScheduleWithCurrentMessageQueue(m_download.get());
-    CFURLDownloadScheduleDownloadWithRunLoop(m_download.get(), ResourceHandle::loaderRunLoop(), kCFRunLoopDefaultMode);
-
-    LOG(Download, "WebDownload - Initialized download of url %s in WebDownload %p", url.string().utf8().data(), this);
-}
-
 WebDownload::~WebDownload()
 {
     LOG(Download, "WebDownload - Destroying download (%p)", this);
@@ -202,89 +143,6 @@
 
 // IWebDownload -------------------------------------------------------------------
 
-HRESULT STDMETHODCALLTYPE WebDownload::initWithRequest(
-        /* [in] */ IWebURLRequest* request, 
-        /* [in] */ IWebDownloadDelegate* delegate)
-{
-    COMPtr<WebMutableURLRequest> webRequest;
-    if (!request || FAILED(request->QueryInterface(&webRequest))) {
-        LOG(Download, "WebDownload - initWithRequest failed - not a WebMutableURLRequest");    
-        return E_FAIL;
-    }
-
-    if (!delegate)
-        return E_FAIL;
-    m_delegate = delegate;
-    LOG(Download, "Delegate is %p", m_delegate.get());
-
-    RetainPtr<CFURLRequestRef> cfRequest = webRequest->resourceRequest().cfURLRequest();
-
-    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
-                                  didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback, 
-                                  decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
-    m_request.adoptRef(WebMutableURLRequest::createInstance(webRequest.get()));
-    m_download.adoptCF(CFURLDownloadCreate(0, cfRequest.get(), &client));
-
-    // If for some reason the download failed to create, 
-    // we have particular cleanup to do
-    if (!m_download) {
-        m_request = 0;    
-        return E_FAIL;
-    }
-
-    CFURLDownloadScheduleWithCurrentMessageQueue(m_download.get());
-    CFURLDownloadScheduleDownloadWithRunLoop(m_download.get(), ResourceHandle::loaderRunLoop(), kCFRunLoopDefaultMode);
-
-    LOG(Download, "WebDownload - initWithRequest complete, started download of url %s", webRequest->resourceRequest().url().string().utf8().data());
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebDownload::initToResumeWithBundle(
-        /* [in] */ BSTR bundlePath, 
-        /* [in] */ IWebDownloadDelegate* delegate)
-{
-    LOG(Download, "Attempting resume of download bundle %s", String(bundlePath, SysStringLen(bundlePath)).ascii().data());
-
-    RetainPtr<CFDataRef> resumeData(AdoptCF, extractResumeDataFromBundle(String(bundlePath, SysStringLen(bundlePath))));
-    
-    if (!resumeData)
-        return E_FAIL;
-
-    if (!delegate)
-        return E_FAIL;
-    m_delegate = delegate;
-    LOG(Download, "Delegate is %p", m_delegate.get());
-
-    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
-                                  didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback, 
-                                  decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
-    
-    RetainPtr<CFURLRef> pathURL(AdoptCF, MarshallingHelpers::PathStringToFileCFURLRef(String(bundlePath, SysStringLen(bundlePath))));
-    ASSERT(pathURL);
-
-    m_download.adoptCF(CFURLDownloadCreateWithResumeData(0, resumeData.get(), pathURL.get(), &client));
-
-    if (!m_download) {
-        LOG(Download, "Failed to create CFURLDownloadRef for resume");    
-        return E_FAIL;
-    }
-    
-    m_bundlePath = String(bundlePath, SysStringLen(bundlePath));
-    // Attempt to remove the ".download" extension from the bundle for the final file destination
-    // Failing that, we clear m_destination and will ask the delegate later once the download starts
-    if (m_bundlePath.endsWith(BundleExtension, false)) {
-        m_destination = m_bundlePath.copy();
-        m_destination.truncate(m_destination.length() - BundleExtension.length());
-    } else
-        m_destination = String();
-    
-    CFURLDownloadScheduleWithCurrentMessageQueue(m_download.get());
-    CFURLDownloadScheduleDownloadWithRunLoop(m_download.get(), ResourceHandle::loaderRunLoop(), kCFRunLoopDefaultMode);
-
-    LOG(Download, "WebDownload - initWithRequest complete, resumed download of bundle %s", String(bundlePath, SysStringLen(bundlePath)).ascii().data());
-    return S_OK;
-}
-
 HRESULT STDMETHODCALLTYPE WebDownload::canResumeDownloadDecodedWithEncodingMIMEType(
         /* [in] */ BSTR, 
         /* [out, retval] */ BOOL*)
@@ -293,70 +151,6 @@
     return E_FAIL;
 }
 
-HRESULT STDMETHODCALLTYPE WebDownload::start()
-{
-    LOG(Download, "WebDownload - Starting download (%p)", this);
-    if (!m_download)
-        return E_FAIL;
-
-    CFURLDownloadStart(m_download.get());
-    // FIXME: 4950477 - CFURLDownload neglects to make the didStart() client call upon starting the download.
-    // This is a somewhat critical call, so we'll fake it for now!
-    didStart();
-
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebDownload::cancel()
-{
-    LOG(Download, "WebDownload - Cancelling download (%p)", this);
-    if (!m_download)
-        return E_FAIL;
-
-    CFURLDownloadCancel(m_download.get());
-    m_download = 0;
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebDownload::cancelForResume()
-{
-    LOG(Download, "WebDownload - Cancelling download (%p), writing resume information to file if possible", this);
-    ASSERT(m_download);
-    if (!m_download)
-        return E_FAIL;
-
-    HRESULT hr = S_OK;
-    RetainPtr<CFDataRef> resumeData;
-    if (m_destination.isEmpty()) {
-        CFURLDownloadCancel(m_download.get());
-        goto exit;
-    }
-
-    CFURLDownloadSetDeletesUponFailure(m_download.get(), false);
-    CFURLDownloadCancel(m_download.get());
-
-    resumeData = CFURLDownloadCopyResumeData(m_download.get());
-    if (!resumeData) {
-        LOG(Download, "WebDownload - Unable to create resume data for download (%p)", this);
-        goto exit;
-    }
-
-    appendResumeDataToBundle(resumeData.get(), m_bundlePath);
-   
-exit:
-    m_download = 0;
-    return hr;
-}
-
-HRESULT STDMETHODCALLTYPE WebDownload::deletesFileUponFailure(
-        /* [out, retval] */ BOOL* result)
-{
-    if (!m_download)
-        return E_FAIL;
-    *result = CFURLDownloadDeletesUponFailure(m_download.get());
-    return S_OK;
-}
-
 HRESULT STDMETHODCALLTYPE WebDownload::bundlePathForTargetPath(
         /* [in] */ BSTR targetPath, 
         /* [out, retval] */ BSTR* bundlePath)
@@ -371,10 +165,10 @@
     if (bundle[bundle.length()-1] == '/')
         bundle.truncate(1);
 
-    bundle += BundleExtension;
+    bundle += bundleExtension();
     *bundlePath = SysAllocStringLen(bundle.characters(), bundle.length());
     if (!*bundlePath)
-        return E_FAIL;
+       return E_FAIL;
     return S_OK;
 }
 
@@ -389,275 +183,9 @@
     return S_OK;
 }
 
-HRESULT STDMETHODCALLTYPE WebDownload::setDeletesFileUponFailure(
-        /* [in] */ BOOL deletesFileUponFailure)
-{
-    if (!m_download)
-        return E_FAIL;
-    CFURLDownloadSetDeletesUponFailure(m_download.get(), !!deletesFileUponFailure);
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebDownload::setDestination(
-        /* [in] */ BSTR path, 
-        /* [in] */ BOOL allowOverwrite)
-{
-    if (!m_download)
-        return E_FAIL;
-
-    m_destination = String(path, SysStringLen(path));
-    m_bundlePath = m_destination + BundleExtension;
-
-    CFURLRef pathURL = MarshallingHelpers::PathStringToFileCFURLRef(m_bundlePath);
-    CFURLDownloadSetDestination(m_download.get(), pathURL, !!allowOverwrite);
-    CFRelease(pathURL);
-
-    LOG(Download, "WebDownload - Set destination to %s", m_bundlePath.ascii().data());
-
-    return S_OK;
-}
-
-// IWebURLAuthenticationChallengeSender -------------------------------------------------------------------
-
-HRESULT STDMETHODCALLTYPE WebDownload::cancelAuthenticationChallenge(
-        /* [in] */ IWebURLAuthenticationChallenge*)
-{
-    if (m_download) {
-        CFURLDownloadCancel(m_download.get());
-        m_download = 0;
-    }
-
-    // FIXME: Do we need a URL or description for this error code?
-    ResourceError error(String(WebURLErrorDomain), WebURLErrorUserCancelledAuthentication, "", "");
-    COMPtr<WebError> webError(AdoptCOM, WebError::createInstance(error));
-    m_delegate->didFailWithError(this, webError.get());
-
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebDownload::continueWithoutCredentialForAuthenticationChallenge(
-        /* [in] */ IWebURLAuthenticationChallenge* challenge)
-{
-    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
-    if (!webChallenge)
-        return E_NOINTERFACE;
-
-    if (m_download)
-        CFURLDownloadUseCredential(m_download.get(), 0, webChallenge->authenticationChallenge().cfURLAuthChallengeRef());
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebDownload::useCredential(
-        /* [in] */ IWebURLCredential* credential, 
-        /* [in] */ IWebURLAuthenticationChallenge* challenge)
-{
-    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
-    if (!webChallenge)
-        return E_NOINTERFACE;
-
-    COMPtr<WebURLCredential> webCredential(Query, credential);
-    if (!webCredential)
-        return E_NOINTERFACE;
-
-    RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(webCredential->credential()));
-
-    if (m_download)
-        CFURLDownloadUseCredential(m_download.get(), cfCredential.get(), webChallenge->authenticationChallenge().cfURLAuthChallengeRef());
-    return S_OK;
-}
-
-// CFURLDownload Callbacks -------------------------------------------------------------------
-void WebDownload::didStart()
-{
-#ifndef NDEBUG
-    m_startTime = m_dataTime = currentTime();
-    m_received = 0;
-    LOG(Download, "DOWNLOAD - Started %p at %.3f seconds", this, m_startTime);
-#endif
-    if (FAILED(m_delegate->didBegin(this)))
-        LOG_ERROR("DownloadDelegate->didBegin failed");
-}
-
-CFURLRequestRef WebDownload::willSendRequest(CFURLRequestRef request, CFURLResponseRef response)
-{
-    COMPtr<WebMutableURLRequest> webRequest(AdoptCOM, WebMutableURLRequest::createInstance(ResourceRequest(request)));
-    COMPtr<WebURLResponse> webResponse(AdoptCOM, WebURLResponse::createInstance(ResourceResponse(response)));
-    COMPtr<IWebMutableURLRequest> finalRequest;
-
-    if (FAILED(m_delegate->willSendRequest(this, webRequest.get(), webResponse.get(), &finalRequest)))
-        LOG_ERROR("DownloadDelegate->willSendRequest failed");
-    
-    if (!finalRequest)
-        return 0;
-
-    COMPtr<WebMutableURLRequest> finalWebRequest(AdoptCOM, WebMutableURLRequest::createInstance(finalRequest.get()));
-    m_request = finalWebRequest.get();
-    CFURLRequestRef result = finalWebRequest->resourceRequest().cfURLRequest();
-    CFRetain(result);
-    return result;
-}
-
-void WebDownload::didReceiveAuthenticationChallenge(CFURLAuthChallengeRef challenge)
-{
-    COMPtr<IWebURLAuthenticationChallenge> webChallenge(AdoptCOM,
-        WebURLAuthenticationChallenge::createInstance(AuthenticationChallenge(challenge, 0), this));
-
-    if (SUCCEEDED(m_delegate->didReceiveAuthenticationChallenge(this, webChallenge.get())))
-        return;
-
-    cancelAuthenticationChallenge(webChallenge.get());
-}
-
-void WebDownload::didReceiveResponse(CFURLResponseRef response)
-{
-    COMPtr<WebURLResponse> webResponse(AdoptCOM, WebURLResponse::createInstance(ResourceResponse(response)));
-    if (FAILED(m_delegate->didReceiveResponse(this, webResponse.get())))
-        LOG_ERROR("DownloadDelegate->didReceiveResponse failed");
-}
-
-void WebDownload::willResumeWithResponse(CFURLResponseRef response, UInt64 fromByte)
-{
-    COMPtr<WebURLResponse> webResponse(AdoptCOM, WebURLResponse::createInstance(ResourceResponse(response)));
-    if (FAILED(m_delegate->willResumeWithResponse(this, webResponse.get(), fromByte)))
-        LOG_ERROR("DownloadDelegate->willResumeWithResponse failed");
-}
-
-void WebDownload::didReceiveData(CFIndex length)
-{
-#ifndef NDEBUG
-    m_received += length;
-    double current = currentTime();
-    if (current - m_dataTime > 2.0)
-        LOG(Download, "DOWNLOAD - %p hanged for %.3f seconds - Received %i bytes for a total of %i", this, current - m_dataTime, length, m_received);
-    m_dataTime = current;
-#endif
-    if (FAILED(m_delegate->didReceiveDataOfLength(this, length)))
-        LOG_ERROR("DownloadDelegate->didReceiveData failed");
-}
-
-bool WebDownload::shouldDecodeDataOfMIMEType(CFStringRef mimeType)
-{
-    BOOL result;
-    if (FAILED(m_delegate->shouldDecodeSourceDataOfMIMEType(this, BString(mimeType), &result))) {
-        LOG_ERROR("DownloadDelegate->shouldDecodeSourceDataOfMIMEType failed");
-        return false;
-    }
-    return !!result;
-}
-
-void WebDownload::decideDestinationWithSuggestedObjectName(CFStringRef name)
-{    
-    if (FAILED(m_delegate->decideDestinationWithSuggestedFilename(this, BString(name))))
-        LOG_ERROR("DownloadDelegate->decideDestinationWithSuggestedObjectName failed");
-}
-
-void WebDownload::didCreateDestination(CFURLRef destination)
-{
-    // The concept of the ".download bundle" is internal to the WebDownload, so therefore
-    // we try to mask the delegate from its existence as much as possible by telling it the final
-    // destination was created, when in reality the bundle was created
-
-    String createdDestination = MarshallingHelpers::FileCFURLRefToPathString(destination);
-
-    // At this point in receiving CFURLDownload callbacks, we should definitely have the bundle path stored locally
-    // and it should match with the file that CFURLDownload created
-    ASSERT(createdDestination == m_bundlePath);
-    // And we should also always have the final-destination stored
-    ASSERT(!m_destination.isEmpty());
-
-    BString path(m_destination);
-    if (FAILED(m_delegate->didCreateDestination(this, path)))
-        LOG_ERROR("DownloadDelegate->didCreateDestination failed");
-}
-
-void WebDownload::didFinish()
-{
-#ifndef NDEBUG
-    LOG(Download, "DOWNLOAD - Finished %p after %i bytes and %.3f seconds", this, m_received, currentTime() - m_startTime);
-#endif
-
-    ASSERT(!m_bundlePath.isEmpty() && !m_destination.isEmpty());
-    LOG(Download, "WebDownload - Moving file from bundle %s to destination %s", m_bundlePath.ascii().data(), m_destination.ascii().data());
-
-    // We try to rename the bundle to the final file name.  If that fails, we give the delegate one more chance to chose
-    // the final file name, then we just leave it
-    if (!MoveFileEx(m_bundlePath.charactersWithNullTermination(), m_destination.charactersWithNullTermination(), 0)) {
-        LOG_ERROR("Failed to move bundle %s to %s on completion\nError - %i", m_bundlePath.ascii().data(), m_destination.ascii().data(), GetLastError());
-        
-        bool reportBundlePathAsFinalPath = true;
-
-        BString destinationBSTR(m_destination.characters(), m_destination.length());
-        if (FAILED(m_delegate->decideDestinationWithSuggestedFilename(this, destinationBSTR)))
-            LOG_ERROR("delegate->decideDestinationWithSuggestedFilename() failed");
-
-        // The call to m_delegate->decideDestinationWithSuggestedFilename() should have changed our destination, so we'll try the move
-        // one last time.
-        if (!m_destination.isEmpty())
-            if (MoveFileEx(m_bundlePath.charactersWithNullTermination(), m_destination.charactersWithNullTermination(), 0))
-                reportBundlePathAsFinalPath = false;
-
-        // We either need to tell the delegate our final filename is the bundle filename, or is the file name they just told us to use
-        if (reportBundlePathAsFinalPath) {
-            BString bundleBSTR(m_bundlePath);
-            m_delegate->didCreateDestination(this, bundleBSTR);
-        } else {
-            BString finalDestinationBSTR = BString(m_destination);
-            m_delegate->didCreateDestination(this, finalDestinationBSTR);
-        }
-    }
-
-    // It's extremely likely the call to delegate->didFinish() will deref this, so lets not let that cause our destruction just yet
-    COMPtr<WebDownload> protect = this;
-    if (FAILED(m_delegate->didFinish(this)))
-        LOG_ERROR("DownloadDelegate->didFinish failed");
-
-    m_download = 0;
-}
-
-void WebDownload::didFail(CFErrorRef error)
-{
-    COMPtr<WebError> webError(AdoptCOM, WebError::createInstance(ResourceError(error)));
-    if (FAILED(m_delegate->didFailWithError(this, webError.get())))
-        LOG_ERROR("DownloadDelegate->didFailWithError failed");
-}
-
-// CFURLDownload Callbacks ----------------------------------------------------------------
-void didStartCallback(CFURLDownloadRef, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->didStart(); }
-
-CFURLRequestRef willSendRequestCallback(CFURLDownloadRef, CFURLRequestRef request, CFURLResponseRef redirectionResponse, const void *clientInfo)
-{ return ((WebDownload*)clientInfo)->willSendRequest(request, redirectionResponse); }
-
-void didReceiveAuthenticationChallengeCallback(CFURLDownloadRef, CFURLAuthChallengeRef challenge, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->didReceiveAuthenticationChallenge(challenge); }
-
-void didReceiveResponseCallback(CFURLDownloadRef, CFURLResponseRef response, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->didReceiveResponse(response); }
-
-void willResumeWithResponseCallback(CFURLDownloadRef, CFURLResponseRef response, UInt64 startingByte, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->willResumeWithResponse(response, startingByte); }
-
-void didReceiveDataCallback(CFURLDownloadRef, CFIndex length, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->didReceiveData(length); }
-
-Boolean shouldDecodeDataOfMIMETypeCallback(CFURLDownloadRef, CFStringRef encodingType, const void *clientInfo)
-{ return ((WebDownload*)clientInfo)->shouldDecodeDataOfMIMEType(encodingType); }
-
-void decideDestinationWithSuggestedObjectNameCallback(CFURLDownloadRef, CFStringRef objectName, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->decideDestinationWithSuggestedObjectName(objectName); }
-
-void didCreateDestinationCallback(CFURLDownloadRef, CFURLRef path, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->didCreateDestination(path); }
-
-void didFinishCallback(CFURLDownloadRef, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->didFinish(); }
-
-void didFailCallback(CFURLDownloadRef, CFErrorRef error, const void *clientInfo)
-{ ((WebDownload*)clientInfo)->didFail(error); }
-
 // Download Bundle file utilities ----------------------------------------------------------------
 
-static CFDataRef extractResumeDataFromBundle(const String& bundlePath)
+CFDataRef WebDownload::extractResumeDataFromBundle(const String& bundlePath)
 {
     if (bundlePath.isEmpty()) {
         LOG_ERROR("Cannot create resume data from empty download bundle path");
@@ -694,8 +222,8 @@
         goto exit;
     }
 
-    if (footerMagicNumber != BundleMagicNumber) {
-        LOG_ERROR("Footer's magic number does not match 0x%X - errno(%i)", BundleMagicNumber, errno);  
+    if (footerMagicNumber != bundleMagicNumber()) {
+        LOG_ERROR("Footer's magic number does not match 0x%X - errno(%i)", bundleMagicNumber(), errno);  
         goto exit;
     }
 
@@ -748,7 +276,7 @@
     return result;
 }
 
-static HRESULT appendResumeDataToBundle(CFDataRef resumeData, const String& bundlePath)
+HRESULT WebDownload::appendResumeDataToBundle(CFDataRef resumeData, const String& bundlePath)
 {
     if (!resumeData) {
         LOG_ERROR("Invalid resume data to write to bundle path");
@@ -788,7 +316,8 @@
         goto exit;
     }
 
-    if (fwrite(&BundleMagicNumber, 4, 1, bundle) != 1) {
+    const UInt32& magic = bundleMagicNumber();
+    if (fwrite(&magic, 4, 1, bundle) != 1) {
         LOG_ERROR("Failed to write footer magic number to the bundle - errno(%i)", errno);
         goto exit;
     }
diff --git a/WebKit/win/WebDownload.h b/WebKit/win/WebDownload.h
index 6e8e3ee..0d80b80 100644
--- a/WebKit/win/WebDownload.h
+++ b/WebKit/win/WebDownload.h
@@ -104,6 +104,7 @@
         /* [in] */ IWebURLCredential* credential, 
         /* [in] */ IWebURLAuthenticationChallenge* challenge);
 
+#if USE(CFNETWORK)
     // CFURLDownload Callbacks
     void didStart();
     CFURLRequestRef willSendRequest(CFURLRequestRef, CFURLResponseRef);
@@ -116,13 +117,21 @@
     void didCreateDestination(CFURLRef);
     void didFinish();
     void didFail(CFErrorRef);
+#endif
 
 protected:
+    static CFDataRef extractResumeDataFromBundle(const WebCore::String&);
+    static HRESULT appendResumeDataToBundle(CFDataRef, const WebCore::String&);
+    static const WebCore::String& bundleExtension();
+    static UInt32 bundleMagicNumber();
+
     ULONG m_refCount;
 
     WebCore::String m_destination;
     WebCore::String m_bundlePath;
+#if USE(CFNETWORK)
     RetainPtr<CFURLDownloadRef> m_download;
+#endif
     COMPtr<IWebMutableURLRequest> m_request;
     COMPtr<IWebDownloadDelegate> m_delegate;
 
diff --git a/WebKit/win/WebDownloadCFNet.cpp b/WebKit/win/WebDownloadCFNet.cpp
new file mode 100644
index 0000000..12fd15b
--- /dev/null
+++ b/WebKit/win/WebDownloadCFNet.cpp
@@ -0,0 +1,537 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebKitDLL.h"
+#include "WebDownload.h"
+
+#include "CString.h"
+#include "DefaultDownloadDelegate.h"
+#include "MarshallingHelpers.h"
+#include "WebError.h"
+#include "WebKit.h"
+#include "WebKitLogging.h"
+#include "WebMutableURLRequest.h"
+#include "WebURLAuthenticationChallenge.h"
+#include "WebURLCredential.h"
+#include "WebURLResponse.h"
+
+#include <wtf/platform.h>
+
+#include <io.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#pragma warning(push, 0)
+#include <WebCore/AuthenticationCF.h>
+#include <WebCore/BString.h>
+#include <WebCore/NotImplemented.h>
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceHandle.h>
+#include <WebCore/ResourceRequest.h>
+#include <WebCore/ResourceResponse.h>
+#include <wtf/CurrentTime.h>
+#pragma warning(pop)
+
+using namespace WebCore;
+
+// CFURLDownload Callbacks ----------------------------------------------------------------
+static void didStartCallback(CFURLDownloadRef download, const void *clientInfo);
+static CFURLRequestRef willSendRequestCallback(CFURLDownloadRef download, CFURLRequestRef request, CFURLResponseRef redirectionResponse, const void *clientInfo);
+static void didReceiveAuthenticationChallengeCallback(CFURLDownloadRef download, CFURLAuthChallengeRef challenge, const void *clientInfo);
+static void didReceiveResponseCallback(CFURLDownloadRef download, CFURLResponseRef response, const void *clientInfo);
+static void willResumeWithResponseCallback(CFURLDownloadRef download, CFURLResponseRef response, UInt64 startingByte, const void *clientInfo);
+static void didReceiveDataCallback(CFURLDownloadRef download, CFIndex length, const void *clientInfo);
+static Boolean shouldDecodeDataOfMIMETypeCallback(CFURLDownloadRef download, CFStringRef encodingType, const void *clientInfo);
+static void decideDestinationWithSuggestedObjectNameCallback(CFURLDownloadRef download, CFStringRef objectName, const void *clientInfo);
+static void didCreateDestinationCallback(CFURLDownloadRef download, CFURLRef path, const void *clientInfo);
+static void didFinishCallback(CFURLDownloadRef download, const void *clientInfo);
+static void didFailCallback(CFURLDownloadRef download, CFErrorRef error, const void *clientInfo);
+
+void WebDownload::init(ResourceHandle* handle, const ResourceRequest& request, const ResourceResponse& response, IWebDownloadDelegate* delegate)
+{
+    m_delegate = delegate ? delegate : DefaultDownloadDelegate::sharedInstance();
+    CFURLConnectionRef connection = handle->connection();
+    if (!connection) {
+        LOG_ERROR("WebDownload::WebDownload(ResourceHandle*,...) called with an inactive ResourceHandle");    
+        return;
+    }
+
+    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
+        didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback,
+        decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
+
+    m_request.adoptRef(WebMutableURLRequest::createInstance(request));
+    m_download.adoptCF(CFURLDownloadCreateAndStartWithLoadingConnection(0, connection, request.cfURLRequest(), response.cfURLResponse(), &client));
+
+    // It is possible for CFURLDownloadCreateAndStartWithLoadingConnection() to fail if the passed in CFURLConnection is not in a "downloadable state"
+    // However, we should never hit that case
+    if (!m_download) {
+        ASSERT_NOT_REACHED();
+        LOG_ERROR("WebDownload - Failed to create WebDownload from existing connection (%s)", request.url().string().utf8().data());
+    } else
+        LOG(Download, "WebDownload - Created WebDownload %p from existing connection (%s)", this, request.url().string().utf8().data());
+
+    // The CFURLDownload either starts successfully and retains the CFURLConnection, 
+    // or it fails to creating and we have a now-useless connection with a dangling ref. 
+    // Either way, we need to release the connection to balance out ref counts
+    handle->releaseConnectionForDownload();
+    CFRelease(connection);
+}
+
+void WebDownload::init(const KURL& url, IWebDownloadDelegate* delegate)
+{
+    m_delegate = delegate ? delegate : DefaultDownloadDelegate::sharedInstance();
+    LOG_ERROR("Delegate is %p", m_delegate.get());
+
+    ResourceRequest request(url);
+    CFURLRequestRef cfRequest = request.cfURLRequest();
+
+    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
+                                  didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback, 
+                                  decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
+    m_request.adoptRef(WebMutableURLRequest::createInstance(request));
+    m_download.adoptCF(CFURLDownloadCreate(0, cfRequest, &client));
+
+    CFURLDownloadScheduleWithCurrentMessageQueue(m_download.get());
+    CFURLDownloadScheduleDownloadWithRunLoop(m_download.get(), ResourceHandle::loaderRunLoop(), kCFRunLoopDefaultMode);
+
+    LOG(Download, "WebDownload - Initialized download of url %s in WebDownload %p", url.string().utf8().data(), this);
+}
+
+// IWebDownload -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebDownload::initWithRequest(
+        /* [in] */ IWebURLRequest* request, 
+        /* [in] */ IWebDownloadDelegate* delegate)
+{
+    COMPtr<WebMutableURLRequest> webRequest;
+    if (!request || FAILED(request->QueryInterface(&webRequest))) {
+        LOG(Download, "WebDownload - initWithRequest failed - not a WebMutableURLRequest");    
+        return E_FAIL;
+    }
+
+    if (!delegate)
+        return E_FAIL;
+    m_delegate = delegate;
+    LOG(Download, "Delegate is %p", m_delegate.get());
+
+    RetainPtr<CFURLRequestRef> cfRequest = webRequest->resourceRequest().cfURLRequest();
+
+    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
+                                  didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback, 
+                                  decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
+    m_request.adoptRef(WebMutableURLRequest::createInstance(webRequest.get()));
+    m_download.adoptCF(CFURLDownloadCreate(0, cfRequest.get(), &client));
+
+    // If for some reason the download failed to create, 
+    // we have particular cleanup to do
+    if (!m_download) {
+        m_request = 0;    
+        return E_FAIL;
+    }
+
+    CFURLDownloadScheduleWithCurrentMessageQueue(m_download.get());
+    CFURLDownloadScheduleDownloadWithRunLoop(m_download.get(), ResourceHandle::loaderRunLoop(), kCFRunLoopDefaultMode);
+
+    LOG(Download, "WebDownload - initWithRequest complete, started download of url %s", webRequest->resourceRequest().url().string().utf8().data());
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::initToResumeWithBundle(
+        /* [in] */ BSTR bundlePath, 
+        /* [in] */ IWebDownloadDelegate* delegate)
+{
+    LOG(Download, "Attempting resume of download bundle %s", String(bundlePath, SysStringLen(bundlePath)).ascii().data());
+
+    RetainPtr<CFDataRef> resumeData(AdoptCF, extractResumeDataFromBundle(String(bundlePath, SysStringLen(bundlePath))));
+    
+    if (!resumeData)
+        return E_FAIL;
+
+    if (!delegate)
+        return E_FAIL;
+    m_delegate = delegate;
+    LOG(Download, "Delegate is %p", m_delegate.get());
+
+    CFURLDownloadClient client = {0, this, 0, 0, 0, didStartCallback, willSendRequestCallback, didReceiveAuthenticationChallengeCallback, 
+                                  didReceiveResponseCallback, willResumeWithResponseCallback, didReceiveDataCallback, shouldDecodeDataOfMIMETypeCallback, 
+                                  decideDestinationWithSuggestedObjectNameCallback, didCreateDestinationCallback, didFinishCallback, didFailCallback};
+    
+    RetainPtr<CFURLRef> pathURL(AdoptCF, MarshallingHelpers::PathStringToFileCFURLRef(String(bundlePath, SysStringLen(bundlePath))));
+    ASSERT(pathURL);
+
+    m_download.adoptCF(CFURLDownloadCreateWithResumeData(0, resumeData.get(), pathURL.get(), &client));
+
+    if (!m_download) {
+        LOG(Download, "Failed to create CFURLDownloadRef for resume");    
+        return E_FAIL;
+    }
+    
+    m_bundlePath = String(bundlePath, SysStringLen(bundlePath));
+    // Attempt to remove the ".download" extension from the bundle for the final file destination
+    // Failing that, we clear m_destination and will ask the delegate later once the download starts
+    if (m_bundlePath.endsWith(bundleExtension(), false)) {
+        m_destination = m_bundlePath.copy();
+        m_destination.truncate(m_destination.length() - bundleExtension().length());
+    } else
+        m_destination = String();
+    
+    CFURLDownloadScheduleWithCurrentMessageQueue(m_download.get());
+    CFURLDownloadScheduleDownloadWithRunLoop(m_download.get(), ResourceHandle::loaderRunLoop(), kCFRunLoopDefaultMode);
+
+    LOG(Download, "WebDownload - initWithRequest complete, resumed download of bundle %s", String(bundlePath, SysStringLen(bundlePath)).ascii().data());
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::start()
+{
+    LOG(Download, "WebDownload - Starting download (%p)", this);
+    if (!m_download)
+        return E_FAIL;
+
+    CFURLDownloadStart(m_download.get());
+    // FIXME: 4950477 - CFURLDownload neglects to make the didStart() client call upon starting the download.
+    // This is a somewhat critical call, so we'll fake it for now!
+    didStart();
+
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::cancel()
+{
+    LOG(Download, "WebDownload - Cancelling download (%p)", this);
+    if (!m_download)
+        return E_FAIL;
+
+    CFURLDownloadCancel(m_download.get());
+    m_download = 0;
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::cancelForResume()
+{
+    LOG(Download, "WebDownload - Cancelling download (%p), writing resume information to file if possible", this);
+    ASSERT(m_download);
+    if (!m_download)
+        return E_FAIL;
+
+    HRESULT hr = S_OK;
+    RetainPtr<CFDataRef> resumeData;
+    if (m_destination.isEmpty()) {
+        CFURLDownloadCancel(m_download.get());
+        goto exit;
+    }
+
+    CFURLDownloadSetDeletesUponFailure(m_download.get(), false);
+    CFURLDownloadCancel(m_download.get());
+
+    resumeData = CFURLDownloadCopyResumeData(m_download.get());
+    if (!resumeData) {
+        LOG(Download, "WebDownload - Unable to create resume data for download (%p)", this);
+        goto exit;
+    }
+
+    appendResumeDataToBundle(resumeData.get(), m_bundlePath);
+   
+exit:
+    m_download = 0;
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::deletesFileUponFailure(
+        /* [out, retval] */ BOOL* result)
+{
+    if (!m_download)
+        return E_FAIL;
+    *result = CFURLDownloadDeletesUponFailure(m_download.get());
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::setDeletesFileUponFailure(
+        /* [in] */ BOOL deletesFileUponFailure)
+{
+    if (!m_download)
+        return E_FAIL;
+    CFURLDownloadSetDeletesUponFailure(m_download.get(), !!deletesFileUponFailure);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::setDestination(
+        /* [in] */ BSTR path, 
+        /* [in] */ BOOL allowOverwrite)
+{
+    if (!m_download)
+        return E_FAIL;
+
+    m_destination = String(path, SysStringLen(path));
+    m_bundlePath = m_destination + bundleExtension();
+
+    CFURLRef pathURL = MarshallingHelpers::PathStringToFileCFURLRef(m_bundlePath);
+    CFURLDownloadSetDestination(m_download.get(), pathURL, !!allowOverwrite);
+    CFRelease(pathURL);
+
+    LOG(Download, "WebDownload - Set destination to %s", m_bundlePath.ascii().data());
+
+    return S_OK;
+}
+
+// IWebURLAuthenticationChallengeSender -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebDownload::cancelAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge*)
+{
+    if (m_download) {
+        CFURLDownloadCancel(m_download.get());
+        m_download = 0;
+    }
+
+    // FIXME: Do we need a URL or description for this error code?
+    ResourceError error(String(WebURLErrorDomain), WebURLErrorUserCancelledAuthentication, "", "");
+    COMPtr<WebError> webError(AdoptCOM, WebError::createInstance(error));
+    m_delegate->didFailWithError(this, webError.get());
+
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::continueWithoutCredentialForAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
+    if (!webChallenge)
+        return E_NOINTERFACE;
+
+    if (m_download)
+        CFURLDownloadUseCredential(m_download.get(), 0, webChallenge->authenticationChallenge().cfURLAuthChallengeRef());
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::useCredential(
+        /* [in] */ IWebURLCredential* credential, 
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
+    if (!webChallenge)
+        return E_NOINTERFACE;
+
+    COMPtr<WebURLCredential> webCredential(Query, credential);
+    if (!webCredential)
+        return E_NOINTERFACE;
+
+    RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(webCredential->credential()));
+
+    if (m_download)
+        CFURLDownloadUseCredential(m_download.get(), cfCredential.get(), webChallenge->authenticationChallenge().cfURLAuthChallengeRef());
+    return S_OK;
+}
+
+// CFURLDownload Callbacks -------------------------------------------------------------------
+void WebDownload::didStart()
+{
+#ifndef NDEBUG
+    m_startTime = m_dataTime = currentTime();
+    m_received = 0;
+    LOG(Download, "DOWNLOAD - Started %p at %.3f seconds", this, m_startTime);
+#endif
+    if (FAILED(m_delegate->didBegin(this)))
+        LOG_ERROR("DownloadDelegate->didBegin failed");
+}
+
+CFURLRequestRef WebDownload::willSendRequest(CFURLRequestRef request, CFURLResponseRef response)
+{
+    COMPtr<WebMutableURLRequest> webRequest(AdoptCOM, WebMutableURLRequest::createInstance(ResourceRequest(request)));
+    COMPtr<WebURLResponse> webResponse(AdoptCOM, WebURLResponse::createInstance(ResourceResponse(response)));
+    COMPtr<IWebMutableURLRequest> finalRequest;
+
+    if (FAILED(m_delegate->willSendRequest(this, webRequest.get(), webResponse.get(), &finalRequest)))
+        LOG_ERROR("DownloadDelegate->willSendRequest failed");
+    
+    if (!finalRequest)
+        return 0;
+
+    COMPtr<WebMutableURLRequest> finalWebRequest(AdoptCOM, WebMutableURLRequest::createInstance(finalRequest.get()));
+    m_request = finalWebRequest.get();
+    CFURLRequestRef result = finalWebRequest->resourceRequest().cfURLRequest();
+    CFRetain(result);
+    return result;
+}
+
+void WebDownload::didReceiveAuthenticationChallenge(CFURLAuthChallengeRef challenge)
+{
+    COMPtr<IWebURLAuthenticationChallenge> webChallenge(AdoptCOM,
+        WebURLAuthenticationChallenge::createInstance(AuthenticationChallenge(challenge, 0), this));
+
+    if (SUCCEEDED(m_delegate->didReceiveAuthenticationChallenge(this, webChallenge.get())))
+        return;
+
+    cancelAuthenticationChallenge(webChallenge.get());
+}
+
+void WebDownload::didReceiveResponse(CFURLResponseRef response)
+{
+    COMPtr<WebURLResponse> webResponse(AdoptCOM, WebURLResponse::createInstance(ResourceResponse(response)));
+    if (FAILED(m_delegate->didReceiveResponse(this, webResponse.get())))
+        LOG_ERROR("DownloadDelegate->didReceiveResponse failed");
+}
+
+void WebDownload::willResumeWithResponse(CFURLResponseRef response, UInt64 fromByte)
+{
+    COMPtr<WebURLResponse> webResponse(AdoptCOM, WebURLResponse::createInstance(ResourceResponse(response)));
+    if (FAILED(m_delegate->willResumeWithResponse(this, webResponse.get(), fromByte)))
+        LOG_ERROR("DownloadDelegate->willResumeWithResponse failed");
+}
+
+void WebDownload::didReceiveData(CFIndex length)
+{
+#ifndef NDEBUG
+    m_received += length;
+    double current = currentTime();
+    if (current - m_dataTime > 2.0)
+        LOG(Download, "DOWNLOAD - %p hanged for %.3f seconds - Received %i bytes for a total of %i", this, current - m_dataTime, length, m_received);
+    m_dataTime = current;
+#endif
+    if (FAILED(m_delegate->didReceiveDataOfLength(this, length)))
+        LOG_ERROR("DownloadDelegate->didReceiveData failed");
+}
+
+bool WebDownload::shouldDecodeDataOfMIMEType(CFStringRef mimeType)
+{
+    BOOL result;
+    if (FAILED(m_delegate->shouldDecodeSourceDataOfMIMEType(this, BString(mimeType), &result))) {
+        LOG_ERROR("DownloadDelegate->shouldDecodeSourceDataOfMIMEType failed");
+        return false;
+    }
+    return !!result;
+}
+
+void WebDownload::decideDestinationWithSuggestedObjectName(CFStringRef name)
+{    
+    if (FAILED(m_delegate->decideDestinationWithSuggestedFilename(this, BString(name))))
+        LOG_ERROR("DownloadDelegate->decideDestinationWithSuggestedObjectName failed");
+}
+
+void WebDownload::didCreateDestination(CFURLRef destination)
+{
+    // The concept of the ".download bundle" is internal to the WebDownload, so therefore
+    // we try to mask the delegate from its existence as much as possible by telling it the final
+    // destination was created, when in reality the bundle was created
+
+    String createdDestination = MarshallingHelpers::FileCFURLRefToPathString(destination);
+
+    // At this point in receiving CFURLDownload callbacks, we should definitely have the bundle path stored locally
+    // and it should match with the file that CFURLDownload created
+    ASSERT(createdDestination == m_bundlePath);
+    // And we should also always have the final-destination stored
+    ASSERT(!m_destination.isEmpty());
+
+    BString path(m_destination);
+    if (FAILED(m_delegate->didCreateDestination(this, path)))
+        LOG_ERROR("DownloadDelegate->didCreateDestination failed");
+}
+
+void WebDownload::didFinish()
+{
+#ifndef NDEBUG
+    LOG(Download, "DOWNLOAD - Finished %p after %i bytes and %.3f seconds", this, m_received, currentTime() - m_startTime);
+#endif
+
+    ASSERT(!m_bundlePath.isEmpty() && !m_destination.isEmpty());
+    LOG(Download, "WebDownload - Moving file from bundle %s to destination %s", m_bundlePath.ascii().data(), m_destination.ascii().data());
+
+    // We try to rename the bundle to the final file name.  If that fails, we give the delegate one more chance to chose
+    // the final file name, then we just leave it
+    if (!MoveFileEx(m_bundlePath.charactersWithNullTermination(), m_destination.charactersWithNullTermination(), 0)) {
+        LOG_ERROR("Failed to move bundle %s to %s on completion\nError - %i", m_bundlePath.ascii().data(), m_destination.ascii().data(), GetLastError());
+        
+        bool reportBundlePathAsFinalPath = true;
+
+        BString destinationBSTR(m_destination.characters(), m_destination.length());
+        if (FAILED(m_delegate->decideDestinationWithSuggestedFilename(this, destinationBSTR)))
+            LOG_ERROR("delegate->decideDestinationWithSuggestedFilename() failed");
+
+        // The call to m_delegate->decideDestinationWithSuggestedFilename() should have changed our destination, so we'll try the move
+        // one last time.
+        if (!m_destination.isEmpty())
+            if (MoveFileEx(m_bundlePath.charactersWithNullTermination(), m_destination.charactersWithNullTermination(), 0))
+                reportBundlePathAsFinalPath = false;
+
+        // We either need to tell the delegate our final filename is the bundle filename, or is the file name they just told us to use
+        if (reportBundlePathAsFinalPath) {
+            BString bundleBSTR(m_bundlePath);
+            m_delegate->didCreateDestination(this, bundleBSTR);
+        } else {
+            BString finalDestinationBSTR = BString(m_destination);
+            m_delegate->didCreateDestination(this, finalDestinationBSTR);
+        }
+    }
+
+    // It's extremely likely the call to delegate->didFinish() will deref this, so lets not let that cause our destruction just yet
+    COMPtr<WebDownload> protect = this;
+    if (FAILED(m_delegate->didFinish(this)))
+        LOG_ERROR("DownloadDelegate->didFinish failed");
+
+    m_download = 0;
+}
+
+void WebDownload::didFail(CFErrorRef error)
+{
+    COMPtr<WebError> webError(AdoptCOM, WebError::createInstance(ResourceError(error)));
+    if (FAILED(m_delegate->didFailWithError(this, webError.get())))
+        LOG_ERROR("DownloadDelegate->didFailWithError failed");
+}
+
+// CFURLDownload Callbacks ----------------------------------------------------------------
+void didStartCallback(CFURLDownloadRef, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->didStart(); }
+
+CFURLRequestRef willSendRequestCallback(CFURLDownloadRef, CFURLRequestRef request, CFURLResponseRef redirectionResponse, const void *clientInfo)
+{ return ((WebDownload*)clientInfo)->willSendRequest(request, redirectionResponse); }
+
+void didReceiveAuthenticationChallengeCallback(CFURLDownloadRef, CFURLAuthChallengeRef challenge, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->didReceiveAuthenticationChallenge(challenge); }
+
+void didReceiveResponseCallback(CFURLDownloadRef, CFURLResponseRef response, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->didReceiveResponse(response); }
+
+void willResumeWithResponseCallback(CFURLDownloadRef, CFURLResponseRef response, UInt64 startingByte, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->willResumeWithResponse(response, startingByte); }
+
+void didReceiveDataCallback(CFURLDownloadRef, CFIndex length, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->didReceiveData(length); }
+
+Boolean shouldDecodeDataOfMIMETypeCallback(CFURLDownloadRef, CFStringRef encodingType, const void *clientInfo)
+{ return ((WebDownload*)clientInfo)->shouldDecodeDataOfMIMEType(encodingType); }
+
+void decideDestinationWithSuggestedObjectNameCallback(CFURLDownloadRef, CFStringRef objectName, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->decideDestinationWithSuggestedObjectName(objectName); }
+
+void didCreateDestinationCallback(CFURLDownloadRef, CFURLRef path, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->didCreateDestination(path); }
+
+void didFinishCallback(CFURLDownloadRef, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->didFinish(); }
+
+void didFailCallback(CFURLDownloadRef, CFErrorRef error, const void *clientInfo)
+{ ((WebDownload*)clientInfo)->didFail(error); }
diff --git a/WebKit/win/WebDownloadCurl.cpp b/WebKit/win/WebDownloadCurl.cpp
new file mode 100644
index 0000000..608830b
--- /dev/null
+++ b/WebKit/win/WebDownloadCurl.cpp
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2008 Brent Fulgham <bfulgham@gmail.com>. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebKitDLL.h"
+#include "WebDownload.h"
+
+#include "CString.h"
+#include "DefaultDownloadDelegate.h"
+#include "MarshallingHelpers.h"
+#include "WebError.h"
+#include "WebKit.h"
+#include "WebKitLogging.h"
+#include "WebMutableURLRequest.h"
+#include "WebURLAuthenticationChallenge.h"
+#include "WebURLCredential.h"
+#include "WebURLResponse.h"
+
+#include <wtf/platform.h>
+
+#include <io.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#pragma warning(push, 0)
+#include <WebCore/BString.h>
+#include <WebCore/NotImplemented.h>
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceHandle.h>
+#include <WebCore/ResourceRequest.h>
+#include <WebCore/ResourceResponse.h>
+#include <WebCore/SystemTime.h>
+#pragma warning(pop)
+
+using namespace WebCore;
+
+// WebDownload ----------------------------------------------------------------
+
+void WebDownload::init(ResourceHandle* handle, const ResourceRequest& request, const ResourceResponse& response, IWebDownloadDelegate* delegate)
+{
+   notImplemented();
+}
+
+void WebDownload::init(const KURL& url, IWebDownloadDelegate* delegate)
+{
+   notImplemented();
+}
+
+// IWebDownload -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebDownload::initWithRequest(
+        /* [in] */ IWebURLRequest* request, 
+        /* [in] */ IWebDownloadDelegate* delegate)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::initToResumeWithBundle(
+        /* [in] */ BSTR bundlePath, 
+        /* [in] */ IWebDownloadDelegate* delegate)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::start()
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::cancel()
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::cancelForResume()
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::deletesFileUponFailure(
+        /* [out, retval] */ BOOL* result)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::setDeletesFileUponFailure(
+        /* [in] */ BOOL deletesFileUponFailure)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::setDestination(
+        /* [in] */ BSTR path, 
+        /* [in] */ BOOL allowOverwrite)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+// IWebURLAuthenticationChallengeSender -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebDownload::cancelAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge*)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::continueWithoutCredentialForAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+   notImplemented();
+   return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebDownload::useCredential(
+        /* [in] */ IWebURLCredential* credential, 
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+   notImplemented();
+   return E_FAIL;
+}
diff --git a/WebKit/win/WebDropSource.cpp b/WebKit/win/WebDropSource.cpp
index bc68c6c..47ffd5a 100644
--- a/WebKit/win/WebDropSource.cpp
+++ b/WebKit/win/WebDropSource.cpp
@@ -34,7 +34,7 @@
 #include <WebCore/Frame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PlatformMouseEvent.h>
-#include <WebCore/SystemTime.h>
+#include <wtf/CurrentTime.h>
 
 #include <Windows.h>
 
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 701d1ab..009111a 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -313,6 +313,7 @@
 
     HDC dc = (HDC)(ULONG64)deviceContext;
     GraphicsContext gc(dc);
+    gc.setShouldIncludeChildWindows(true);
     gc.save();
     LONG width = rect.right - rect.left;
     LONG height = rect.bottom - rect.top;
@@ -475,7 +476,7 @@
     if (!coreFrame)
         return E_FAIL;
 
-    coreFrame->loader()->load(requestImpl->resourceRequest());
+    coreFrame->loader()->load(requestImpl->resourceRequest(), false);
     return S_OK;
 }
 
@@ -486,15 +487,20 @@
         mimeTypeString = "text/html";
 
     String encodingString(textEncodingName, SysStringLen(textEncodingName));
-    KURL baseKURL(String(baseURL ? baseURL : L"", SysStringLen(baseURL)));
-    KURL failingKURL(String(failingURL, SysStringLen(failingURL)));
+
+    // FIXME: We should really be using MarshallingHelpers::BSTRToKURL here,
+    // but that would turn a null BSTR into a null KURL, and we crash inside of
+    // WebCore if we use a null KURL in constructing the ResourceRequest.
+    KURL baseKURL = KURL(KURL(), String(baseURL ? baseURL : L"", SysStringLen(baseURL)));
+
+    KURL failingKURL = MarshallingHelpers::BSTRToKURL(failingURL);
 
     ResourceRequest request(baseKURL);
     SubstituteData substituteData(data, mimeTypeString, encodingString, failingKURL);
 
     // This method is only called from IWebFrame methods, so don't ASSERT that the Frame pointer isn't null.
     if (Frame* coreFrame = core(this))
-        coreFrame->loader()->load(request, substituteData);
+        coreFrame->loader()->load(request, substituteData, false);
 }
 
 
@@ -910,8 +916,7 @@
     if (!coreFrame)
         return E_FAIL;
 
-    String text = coreFrame->selectedText();
-    text.replace('\\', coreFrame->backslashAsCurrencySymbol());
+    String text = coreFrame->displayStringModifiedByEncoding(coreFrame->selectedText());
 
     *result = BString(text).release();
     return S_OK;
@@ -1322,10 +1327,6 @@
     return d->webView->userAgentForKURL(url);
 }
 
-void WebFrame::transitionToCommittedFromCachedPage(CachedPage*)
-{
-}
-
 void WebFrame::saveViewStateToItem(HistoryItem*)
 {
 }
@@ -1343,10 +1344,10 @@
     return ResourceError(String(WebKitErrorDomain), WebKitErrorCannotUseRestrictedPort, request.url().string(), String());
 }
 
-ResourceError WebFrame::cannotShowURLError(const ResourceRequest&)
+ResourceError WebFrame::cannotShowURLError(const ResourceRequest& request)
 {
-    notImplemented();
-    return ResourceError();
+    // FIXME: Need to implement the String descriptions for errors in the WebKitErrorDomain and have them localized
+    return ResourceError(String(WebKitErrorDomain), WebKitErrorCannotShowURL, request.url().string(), String());
 }
 
 ResourceError WebFrame::interruptForPolicyChangeError(const ResourceRequest& request)
@@ -1812,6 +1813,7 @@
     float headerHeight = 0, footerHeight = 0;
     headerAndFooterHeights(&headerHeight, &footerHeight);
     GraphicsContext spoolCtx(pctx);
+    spoolCtx.setShouldIncludeChildWindows(true);
 
     for (UINT ii = startPage; ii < endPage; ii++) {
         IntRect pageRect = m_pageRects[ii];
@@ -2036,13 +2038,10 @@
 {
     Color backgroundColor = webView()->transparent() ? Color::transparent : Color::white;
     Frame* coreFrame = core(this);
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
-        FrameView* view = frame->view();
-        if (!view)
-            continue;
 
-        view->setTransparent(webView()->transparent());
-        view->setBaseBackgroundColor(backgroundColor);
-    }
+    if (!coreFrame || !coreFrame->view())
+        return;
+
+    coreFrame->view()->updateBackgroundRecursively(backgroundColor, webView()->transparent());
 }
 
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index 1bd7478..bf234d3 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -260,7 +260,6 @@
     virtual void didFinishLoad();
     virtual void prepareForDataSourceReplacement();
     virtual WebCore::String userAgent(const WebCore::KURL&);
-    virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
     virtual void saveViewStateToItem(WebCore::HistoryItem *);
     virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&);
     virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&);
diff --git a/WebKit/win/WebHistory.cpp b/WebKit/win/WebHistory.cpp
index d0bc07a..5ee2e32 100644
--- a/WebKit/win/WebHistory.cpp
+++ b/WebKit/win/WebHistory.cpp
@@ -39,6 +39,7 @@
 #include <wtf/Vector.h>
 #include <WebCore/KURL.h>
 #include <WebCore/PageGroup.h>
+#include <WebCore/HistoryItem.h>
 #pragma warning( pop )
 
 using namespace WebCore;
@@ -148,6 +149,8 @@
         *ppvObject = static_cast<IWebHistory*>(this);
     else if (IsEqualGUID(riid, IID_IWebHistory))
         *ppvObject = static_cast<IWebHistory*>(this);
+    else if (IsEqualGUID(riid, IID_IWebHistoryPrivate))
+        *ppvObject = static_cast<IWebHistoryPrivate*>(this);
     else
         return E_NOINTERFACE;
 
@@ -310,8 +313,10 @@
             if (ageLimitPassed || itemLimitPassed)
                 CFArrayAppendValue(discardedItems, item.get());
             else {
-                addItem(item.get()); // ref is added inside addItem
-                ++numberOfItemsLoaded;
+                bool added;
+                addItem(item.get(), true, &added); // ref is added inside addItem
+                if (added)
+                    ++numberOfItemsLoaded;
                 if (numberOfItemsLoaded == itemCountLimit)
                     itemLimitPassed = true;
             }
@@ -428,7 +433,7 @@
 
     HRESULT hr;
     for (int i = itemCount - 1; i >= 0; --i) {
-        hr = addItem(items[i]);
+        hr = addItem(items[i], false, 0);
         if (FAILED(hr))
             return hr;
     }
@@ -454,11 +459,18 @@
 {
     CFArrayRemoveAllValues(m_entriesByDate.get());
     CFArrayRemoveAllValues(m_datesWithEntries.get());
+
+    CFIndex itemCount = CFDictionaryGetCount(m_entriesByURL.get());
+    Vector<IWebHistoryItem*> itemsVector(itemCount);
+    CFDictionaryGetKeysAndValues(m_entriesByURL.get(), 0, (const void**)itemsVector.data());
+    RetainPtr<CFArrayRef> allItems(AdoptCF, CFArrayCreate(kCFAllocatorDefault, (const void**)itemsVector.data(), itemCount, &MarshallingHelpers::kIUnknownArrayCallBacks));
+
     CFDictionaryRemoveAllValues(m_entriesByURL.get());
 
     PageGroup::removeAllVisitedLinks();
 
-    return postNotification(kWebHistoryAllItemsRemovedNotification);
+    CFDictionaryPropertyBag* userInfo = createUserInfoFromArray(getNotificationString(kWebHistoryAllItemsRemovedNotification), allItems.get());
+    return postNotification(kWebHistoryAllItemsRemovedNotification, userInfo);
 }
 
 HRESULT STDMETHODCALLTYPE WebHistory::orderedLastVisitedDays( 
@@ -520,15 +532,37 @@
     *count = newCount;
     for (int i = 0; i < newCount; i++) {
         IWebHistoryItem* item = (IWebHistoryItem*)CFArrayGetValueAtIndex(entries, i);
-        if (!item)
-            return E_FAIL;
         item->AddRef();
-        items[newCount-i-1] = item; // reverse when inserting to get the list sorted oldest to newest
+        items[newCount - i - 1] = item; // reverse when inserting to get the list sorted oldest to newest
     }
 
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebHistory::allItems( 
+    /* [out][in] */ int* count,
+    /* [out][retval] */ IWebHistoryItem** items)
+{
+    int entriesByURLCount = CFDictionaryGetCount(m_entriesByURL.get());
+
+    if (!items) {
+        *count = entriesByURLCount;
+        return S_OK;
+    }
+
+    if (*count < entriesByURLCount) {
+        *count = entriesByURLCount;
+        return E_FAIL;
+    }
+
+    *count = entriesByURLCount;
+    CFDictionaryGetKeysAndValues(m_entriesByURL.get(), 0, (const void**)items);
+    for (int i = 0; i < entriesByURLCount; i++)
+        items[i]->AddRef();
+
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebHistory::setHistoryItemLimit( 
     /* [in] */ int limit)
 {
@@ -592,7 +626,7 @@
     return hr;
 }
 
-HRESULT WebHistory::addItem(IWebHistoryItem* entry)
+HRESULT WebHistory::addItem(IWebHistoryItem* entry, bool discardDuplicate, bool* added)
 {
     HRESULT hr = S_OK;
 
@@ -611,6 +645,12 @@
         m_entriesByURL.get(), urlString.get()));
     
     if (oldEntry) {
+        if (discardDuplicate) {
+            if (added)
+                *added = false;
+            return S_OK;
+        }
+        
         removeItemForURLString(urlString.get());
 
         // If we already have an item with this URL, we need to merge info that drives the
@@ -634,30 +674,82 @@
     hr = postNotification(kWebHistoryItemsAddedNotification, userInfo);
     releaseUserInfo(userInfo);
 
+    if (added)
+        *added = true;
+
     return hr;
 }
 
-void WebHistory::addItem(const KURL& url, const String& title)
+void WebHistory::visitedURL(const KURL& url, const String& title, const String& httpMethod, bool wasFailure, const KURL& serverRedirectURL, bool isClientRedirect)
 {
-    COMPtr<WebHistoryItem> item(AdoptCOM, WebHistoryItem::createInstance());
-    if (!item)
+    if (isClientRedirect) {
+        ASSERT(serverRedirectURL.isEmpty());
+        if (m_lastVisitedEntry)
+            m_lastVisitedEntry->historyItem()->addRedirectURL(url.string());
+    }
+
+    RetainPtr<CFStringRef> urlString(AdoptCF, url.string().createCFString());
+
+    IWebHistoryItem* entry = (IWebHistoryItem*) CFDictionaryGetValue(m_entriesByURL.get(), urlString.get());
+
+    if (entry) {
+        COMPtr<IWebHistoryItemPrivate> entryPrivate(Query, entry);
+        if (!entryPrivate)
+            return;
+
+        // Remove the item from date caches before changing its last visited date.  Otherwise we might get duplicate entries
+        // as seen in <rdar://problem/6570573>.
+        removeItemFromDateCaches(entry);
+        entryPrivate->visitedWithTitle(BString(title));
+    } else {
+        COMPtr<WebHistoryItem> item(AdoptCOM, WebHistoryItem::createInstance());
+        if (!item)
+            return;
+
+        entry = item.get();
+
+        SYSTEMTIME currentTime;
+        GetSystemTime(&currentTime);
+        DATE lastVisited;
+        if (!SystemTimeToVariantTime(&currentTime, &lastVisited))
+            return;
+
+        if (FAILED(entry->initWithURLString(BString(url.string()), BString(title), lastVisited)))
+            return;
+        
+        item->recordInitialVisit();
+
+        CFDictionarySetValue(m_entriesByURL.get(), urlString.get(), entry);
+    }
+
+    addItemToDateCaches(entry);
+
+    m_lastVisitedEntry.query(entry);
+
+    COMPtr<IWebHistoryItemPrivate> entryPrivate(Query, entry);
+    if (!entryPrivate)
         return;
 
-    SYSTEMTIME currentTime;
-    GetSystemTime(&currentTime);
-    DATE lastVisited;
-    if (!SystemTimeToVariantTime(&currentTime, &lastVisited))
-        return;
+    entryPrivate->setLastVisitWasFailure(wasFailure);
+    if (!httpMethod.isEmpty())
+        entryPrivate->setLastVisitWasHTTPNonGet(!equalIgnoringCase(httpMethod, "GET"));
 
-    HRESULT hr = item->initWithURLString(BString(url.string()), BString(title), 0);
-    if (FAILED(hr))
-        return;
+    if (!serverRedirectURL.isEmpty()) {
+        ASSERT(!isClientRedirect);
+        COMPtr<WebHistoryItem> item(Query, entry);
+        item->historyItem()->addRedirectURL(serverRedirectURL);
+    }
 
-    hr = item->setLastVisitedTimeInterval(lastVisited); // also increments visitedCount
-    if (FAILED(hr))
-        return;
+    CFDictionaryPropertyBag* userInfo = createUserInfoFromHistoryItem(
+        getNotificationString(kWebHistoryItemsAddedNotification), entry);
+    postNotification(kWebHistoryItemsAddedNotification, userInfo);
+    releaseUserInfo(userInfo);
+}
 
-    addItem(item.get());
+void WebHistory::visitedURLForRedirectWithoutHistoryItem(const KURL& url)
+{
+    if (m_lastVisitedEntry)
+        m_lastVisitedEntry->historyItem()->addRedirectURL(url.string());
 }
 
 HRESULT WebHistory::itemForURLString(
diff --git a/WebKit/win/WebHistory.h b/WebKit/win/WebHistory.h
index a49f320..111f6ae 100644
--- a/WebKit/win/WebHistory.h
+++ b/WebKit/win/WebHistory.h
@@ -42,7 +42,7 @@
 
 class WebPreferences;
 
-class WebHistory : public IWebHistory {
+class WebHistory : public IWebHistory, public IWebHistoryPrivate {
 public:
     static WebHistory* createInstance();
 private:
@@ -107,9 +107,16 @@
     virtual HRESULT STDMETHODCALLTYPE historyAgeInDaysLimit( 
         /* [retval][out] */ int* limit);
 
+    // IWebHistoryPrivate
+
+    virtual HRESULT STDMETHODCALLTYPE allItems( 
+        /* [out][in] */ int* count,
+        /* [retval][out] */ IWebHistoryItem** items);
+
     // WebHistory
     static WebHistory* sharedHistory();
-    void addItem(const WebCore::KURL&, const WebCore::String&);
+    void visitedURL(const WebCore::KURL&, const WebCore::String& title, const WebCore::String& httpMethod, bool wasFailure, const WebCore::KURL& serverRedirectURL, bool isClientRedirect);
+    void visitedURLForRedirectWithoutHistoryItem(const WebCore::KURL&);
     void addVisitedLinksToPageGroup(WebCore::PageGroup&);
 
 private:
@@ -127,7 +134,7 @@
     HRESULT saveHistoryGuts(CFURLRef url, IWebError** error);
     HRESULT postNotification(NotificationType notifyType, IPropertyBag* userInfo = 0);
     HRESULT removeItem(IWebHistoryItem* entry);
-    HRESULT addItem(IWebHistoryItem* entry);
+    HRESULT addItem(IWebHistoryItem* entry, bool discardDuplicate, bool* added);
     HRESULT removeItemForURLString(CFStringRef urlString);
     HRESULT addItemToDateCaches(IWebHistoryItem* entry);
     HRESULT removeItemFromDateCaches(IWebHistoryItem* entry);
@@ -144,6 +151,7 @@
     RetainPtr<CFMutableArrayRef> m_datesWithEntries;
     RetainPtr<CFMutableArrayRef> m_entriesByDate;
     COMPtr<WebPreferences> m_preferences;
+    COMPtr<WebHistoryItem> m_lastVisitedEntry;
 };
 
 #endif
diff --git a/WebKit/win/WebHistoryItem.cpp b/WebKit/win/WebHistoryItem.cpp
index 594309e..5866c41 100644
--- a/WebKit/win/WebHistoryItem.cpp
+++ b/WebKit/win/WebHistoryItem.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,13 +27,16 @@
 #include "WebKitDLL.h"
 #include "WebHistoryItem.h"
 
+#include "COMEnumVariant.h"
 #include "COMPtr.h"
 #include "MarshallingHelpers.h"
 #include "WebKit.h"
 
 #pragma warning(push, 0)
 #include <WebCore/BString.h>
+#include <WebCore/CString.h>
 #include <WebCore/HistoryItem.h>
+#include <WebCore/KURL.h>
 #pragma warning(pop)
 
 #include <wtf/RetainPtr.h>
@@ -94,51 +97,109 @@
 static CFStringRef lastVisitedDateKey = CFSTR("lastVisitedDate");
 static CFStringRef titleKey = CFSTR("title");
 static CFStringRef visitCountKey = CFSTR("visitCount");
+static CFStringRef lastVisitWasFailureKey = CFSTR("lastVisitWasFailure");
+static CFStringRef lastVisitWasHTTPNonGetKey = CFSTR("lastVisitWasHTTPNonGet");
+static CFStringRef redirectURLsKey = CFSTR("redirectURLs");
+static CFStringRef dailyVisitCountKey = CFSTR("D"); // short key to save space
+static CFStringRef weeklyVisitCountKey = CFSTR("W"); // short key to save space
 
 HRESULT STDMETHODCALLTYPE WebHistoryItem::initFromDictionaryRepresentation(void* dictionary)
 {
     CFDictionaryRef dictionaryRef = (CFDictionaryRef) dictionary;
-    HRESULT hr = S_OK;
-    int visitedCount = 0;
-    CFAbsoluteTime lastVisitedTime = 0.0;
 
     CFStringRef urlStringRef = (CFStringRef) CFDictionaryGetValue(dictionaryRef, urlKey);
-    if (urlStringRef && CFGetTypeID(urlStringRef) != CFStringGetTypeID()) {
-        hr = E_FAIL;
-        goto exit;
-    }
+    if (urlStringRef && CFGetTypeID(urlStringRef) != CFStringGetTypeID())
+        return E_FAIL;
 
     CFStringRef lastVisitedRef = (CFStringRef) CFDictionaryGetValue(dictionaryRef, lastVisitedDateKey);
-    if (!lastVisitedRef || CFGetTypeID(lastVisitedRef) != CFStringGetTypeID()) {
-        hr = E_FAIL;
-        goto exit;
-    }
-    lastVisitedTime = CFStringGetDoubleValue(lastVisitedRef);
+    if (!lastVisitedRef || CFGetTypeID(lastVisitedRef) != CFStringGetTypeID())
+        return E_FAIL;
+    CFAbsoluteTime lastVisitedTime = CFStringGetDoubleValue(lastVisitedRef);
 
     CFStringRef titleRef = (CFStringRef) CFDictionaryGetValue(dictionaryRef, titleKey);
-    if (titleRef && CFGetTypeID(titleRef) != CFStringGetTypeID()) {
-        hr = E_FAIL;
-        goto exit;
-    }
+    if (titleRef && CFGetTypeID(titleRef) != CFStringGetTypeID())
+        return E_FAIL;
 
     CFNumberRef visitCountRef = (CFNumberRef) CFDictionaryGetValue(dictionaryRef, visitCountKey);
-    if (!visitCountRef || CFGetTypeID(visitCountRef) != CFNumberGetTypeID()) {
-        hr = E_FAIL;
-        goto exit;
+    if (!visitCountRef || CFGetTypeID(visitCountRef) != CFNumberGetTypeID())
+        return E_FAIL;
+    int visitedCount = 0;
+    if (!CFNumberGetValue(visitCountRef, kCFNumberIntType, &visitedCount))
+        return E_FAIL;
+
+    // Can't trust data on disk, and we've had at least one report of this (<rdar://6572300>).
+    if (visitedCount < 0) {
+        LOG_ERROR("visit count for history item \"%s\" is negative (%d), will be reset to 1", String(urlStringRef).utf8().data(), visitedCount);
+        visitedCount = 1;
+    }
+
+    CFBooleanRef lastVisitWasFailureRef = static_cast<CFBooleanRef>(CFDictionaryGetValue(dictionaryRef, lastVisitWasFailureKey));
+    if (lastVisitWasFailureRef && CFGetTypeID(lastVisitWasFailureRef) != CFBooleanGetTypeID())
+        return E_FAIL;
+    bool lastVisitWasFailure = lastVisitWasFailureRef && CFBooleanGetValue(lastVisitWasFailureRef);
+
+    CFBooleanRef lastVisitWasHTTPNonGetRef = static_cast<CFBooleanRef>(CFDictionaryGetValue(dictionaryRef, lastVisitWasHTTPNonGetKey));
+    if (lastVisitWasHTTPNonGetRef && CFGetTypeID(lastVisitWasHTTPNonGetRef) != CFBooleanGetTypeID())
+        return E_FAIL;
+    bool lastVisitWasHTTPNonGet = lastVisitWasHTTPNonGetRef && CFBooleanGetValue(lastVisitWasHTTPNonGetRef);
+
+    std::auto_ptr<Vector<String> > redirectURLsVector;
+    if (CFArrayRef redirectURLsRef = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionaryRef, redirectURLsKey))) {
+        CFIndex size = CFArrayGetCount(redirectURLsRef);
+        redirectURLsVector.reset(new Vector<String>(size));
+        for (CFIndex i = 0; i < size; ++i)
+            (*redirectURLsVector)[i] = String(static_cast<CFStringRef>(CFArrayGetValueAtIndex(redirectURLsRef, i)));
+    }
+
+    CFArrayRef dailyCounts = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionaryRef, dailyVisitCountKey));
+    if (dailyCounts && CFGetTypeID(dailyCounts) != CFArrayGetTypeID())
+        dailyCounts = 0;
+    CFArrayRef weeklyCounts = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionaryRef, weeklyVisitCountKey));
+    if (weeklyCounts && CFGetTypeID(weeklyCounts) != CFArrayGetTypeID())
+        weeklyCounts = 0;
+
+    std::auto_ptr<Vector<int> > dailyVector, weeklyVector;
+    if (dailyCounts || weeklyCounts) {
+        CFIndex dailySize = dailyCounts ? CFArrayGetCount(dailyCounts) : 0;
+        CFIndex weeklySize = weeklyCounts ? CFArrayGetCount(weeklyCounts) : 0;
+        dailyVector.reset(new Vector<int>(dailySize));
+        weeklyVector.reset(new Vector<int>(weeklySize));
+
+        // Daily and weekly counts < 0 are errors in the data read from disk, so reset to 0.
+        for (CFIndex i = 0; i < dailySize; ++i) {
+            CFNumberRef dailyCount = static_cast<CFNumberRef>(CFArrayGetValueAtIndex(dailyCounts, i));        
+            if (CFGetTypeID(dailyCount) == CFNumberGetTypeID())
+                CFNumberGetValue(dailyCount, kCFNumberIntType, &(*dailyVector)[i]);
+            if ((*dailyVector)[i] < 0)
+                (*dailyVector)[i] = 0;
+        }
+        for (CFIndex i = 0; i < weeklySize; ++i) {
+            CFNumberRef weeklyCount = static_cast<CFNumberRef>(CFArrayGetValueAtIndex(weeklyCounts, i));        
+            if (CFGetTypeID(weeklyCount) == CFNumberGetTypeID())
+                CFNumberGetValue(weeklyCount, kCFNumberIntType, &(*weeklyVector)[i]);
+            if ((*weeklyVector)[i] < 0)
+                (*weeklyVector)[i] = 0;
+        }
     }
 
     historyItemWrappers().remove(m_historyItem.get());
     m_historyItem = HistoryItem::create(urlStringRef, titleRef, lastVisitedTime);
     historyItemWrappers().set(m_historyItem.get(), this);
 
-    if (!CFNumberGetValue(visitCountRef, kCFNumberIntType, &visitedCount)) {
-        hr = E_FAIL;
-        goto exit;
-    }
-
     m_historyItem->setVisitCount(visitedCount);
-exit:
-    return hr;
+    if (lastVisitWasFailure)
+        m_historyItem->setLastVisitWasFailure(true);
+
+    if (lastVisitWasHTTPNonGet && (protocolIs(m_historyItem->urlString(), "http") || protocolIs(m_historyItem->urlString(), "https")))
+        m_historyItem->setLastVisitWasHTTPNonGet(true);
+
+    if (redirectURLsVector.get())
+        m_historyItem->setRedirectURLs(redirectURLsVector);
+
+    if (dailyVector.get())
+        m_historyItem->adoptVisitCounts(*dailyVector, *weeklyVector);
+
+    return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebHistoryItem::dictionaryRepresentation(void** dictionary)
@@ -151,8 +212,9 @@
         return E_FAIL;
 
     int keyCount = 0;
-    CFTypeRef keys[4];
-    CFTypeRef values[4];
+    CFTypeRef keys[9];
+    CFTypeRef values[9];
+
     if (!m_historyItem->urlString().isEmpty()) {
         keys[keyCount] = urlKey;
         values[keyCount++] = m_historyItem->urlString().createCFString();
@@ -160,16 +222,72 @@
 
     keys[keyCount] = lastVisitedDateKey;
     values[keyCount++] = lastVisitedStringRef;
-    
+
     if (!m_historyItem->title().isEmpty()) {
         keys[keyCount] = titleKey;
         values[keyCount++] = m_historyItem->title().createCFString();
     }
-    
-    keys[keyCount]   = visitCountKey;
+
+    keys[keyCount] = visitCountKey;
     int visitCount = m_historyItem->visitCount();
     values[keyCount++] = CFNumberCreate(0, kCFNumberIntType, &visitCount);
-    
+
+    if (m_historyItem->lastVisitWasFailure()) {
+        keys[keyCount] = lastVisitWasFailureKey;
+        values[keyCount++] = CFRetain(kCFBooleanTrue);
+    }
+
+    if (m_historyItem->lastVisitWasHTTPNonGet()) {
+        ASSERT(m_historyItem->urlString().startsWith("http:", false) || m_historyItem->urlString().startsWith("https:", false));
+        keys[keyCount] = lastVisitWasHTTPNonGetKey;
+        values[keyCount++] = CFRetain(kCFBooleanTrue);
+    }
+
+    if (Vector<String>* redirectURLs = m_historyItem->redirectURLs()) {
+        size_t size = redirectURLs->size();
+        ASSERT(size);
+        CFStringRef* items = new CFStringRef[size];
+        for (size_t i = 0; i < size; ++i)
+            items[i] = redirectURLs->at(i).createCFString();
+        CFArrayRef result = CFArrayCreate(0, (const void**)items, size, &kCFTypeArrayCallBacks);
+        for (size_t i = 0; i < size; ++i)
+            CFRelease(items[i]);
+        delete[] items;
+
+        keys[keyCount] = redirectURLsKey;
+        values[keyCount++] = result;
+    }
+
+    const Vector<int>& dailyVisitCount(m_historyItem->dailyVisitCounts());
+    if (size_t size = dailyVisitCount.size()) {
+        Vector<CFNumberRef, 13> numbers(size);
+        for (size_t i = 0; i < size; ++i)
+            numbers[i] = CFNumberCreate(0, kCFNumberIntType, &dailyVisitCount[i]);
+
+        CFArrayRef result = CFArrayCreate(0, (const void**)numbers.data(), size, &kCFTypeArrayCallBacks);
+
+        for (size_t i = 0; i < size; ++i)
+            CFRelease(numbers[i]);
+
+        keys[keyCount] = dailyVisitCountKey;
+        values[keyCount++] = result;
+    }
+
+    const Vector<int>& weeklyVisitCount(m_historyItem->weeklyVisitCounts());
+    if (size_t size = weeklyVisitCount.size()) {
+        Vector<CFNumberRef, 5> numbers(size);
+        for (size_t i = 0; i < size; ++i)
+            numbers[i] = CFNumberCreate(0, kCFNumberIntType, &weeklyVisitCount[i]);
+
+        CFArrayRef result = CFArrayCreate(0, (const void**)numbers.data(), size, &kCFTypeArrayCallBacks);
+
+        for (size_t i = 0; i < size; ++i)
+            CFRelease(numbers[i]);
+
+        keys[keyCount] = weeklyVisitCountKey;
+        values[keyCount++] = result;
+    }
+
     *dictionaryRef = CFDictionaryCreate(0, keys, values, keyCount, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
     
     for (int i = 0; i < keyCount; ++i)
@@ -225,7 +343,7 @@
 
 HRESULT STDMETHODCALLTYPE WebHistoryItem::RSSFeedReferrer(BSTR* url)
 {
-    BString str(m_historyItem->rssFeedReferrer());
+    BString str(m_historyItem->referrer());
     *url = str.release();
 
     return S_OK;
@@ -233,7 +351,7 @@
 
 HRESULT STDMETHODCALLTYPE WebHistoryItem::setRSSFeedReferrer(BSTR url)
 {
-    m_historyItem->setRSSFeedReferrer(String(url, SysStringLen(url)));
+    m_historyItem->setReferrer(String(url, SysStringLen(url)));
 
     return S_OK;
 }
@@ -320,6 +438,96 @@
 
 }
 
+HRESULT STDMETHODCALLTYPE WebHistoryItem::lastVisitWasFailure(BOOL* wasFailure)
+{
+    if (!wasFailure) {
+        ASSERT_NOT_REACHED();
+        return E_POINTER;
+    }
+
+    *wasFailure = m_historyItem->lastVisitWasFailure();
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::setLastVisitWasFailure(BOOL wasFailure)
+{
+    m_historyItem->setLastVisitWasFailure(wasFailure);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::lastVisitWasHTTPNonGet(BOOL* HTTPNonGet)
+{
+    if (!HTTPNonGet) {
+        ASSERT_NOT_REACHED();
+        return E_POINTER;
+    }
+
+    *HTTPNonGet = m_historyItem->lastVisitWasHTTPNonGet();
+
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::setLastVisitWasHTTPNonGet(BOOL HTTPNonGet)
+{
+    m_historyItem->setLastVisitWasHTTPNonGet(HTTPNonGet);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::redirectURLs(IEnumVARIANT** urls)
+{
+    if (!urls) {
+        ASSERT_NOT_REACHED();
+        return E_POINTER;
+    }
+
+    Vector<String>* urlVector = m_historyItem->redirectURLs();
+    if (!urlVector) {
+        *urls = 0;
+        return S_OK;
+    }
+
+    COMPtr<COMEnumVariant<Vector<String> > > enumVariant(AdoptCOM, COMEnumVariant<Vector<String> >::createInstance(*urlVector));
+    *urls = enumVariant.releaseRef();
+
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::visitedWithTitle(BSTR title)
+{
+    m_historyItem->visited(title, CFAbsoluteTimeGetCurrent());
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::getDailyVisitCounts(int* number, int** counts)
+{
+    if (!number || !counts) {
+        ASSERT_NOT_REACHED();
+        return E_POINTER;
+    }
+
+    *counts = const_cast<int*>(m_historyItem->dailyVisitCounts().data());
+    *number = m_historyItem->dailyVisitCounts().size();
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::getWeeklyVisitCounts(int* number, int** counts)
+{
+    if (!number || !counts) {
+        ASSERT_NOT_REACHED();
+        return E_POINTER;
+    }
+
+    *counts = const_cast<int*>(m_historyItem->weeklyVisitCounts().data());
+    *number = m_historyItem->weeklyVisitCounts().size();
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebHistoryItem::recordInitialVisit()
+{
+    m_historyItem->recordInitialVisit();
+    return S_OK;
+}
+
 // IUnknown -------------------------------------------------------------------
 
 HRESULT STDMETHODCALLTYPE WebHistoryItem::QueryInterface(REFIID riid, void** ppvObject)
@@ -438,6 +646,7 @@
 }
 
 // WebHistoryItem -------------------------------------------------------------
+
 HistoryItem* WebHistoryItem::historyItem() const
 {
     return m_historyItem.get();
diff --git a/WebKit/win/WebHistoryItem.h b/WebKit/win/WebHistoryItem.h
index 6734ff0..861dc6e 100644
--- a/WebKit/win/WebHistoryItem.h
+++ b/WebKit/win/WebHistoryItem.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -97,9 +97,18 @@
     virtual HRESULT STDMETHODCALLTYPE target(BSTR* target);
     virtual HRESULT STDMETHODCALLTYPE isTargetItem(BOOL* result);
     virtual HRESULT STDMETHODCALLTYPE children(unsigned* childCount, SAFEARRAY** children);
-
+    virtual HRESULT STDMETHODCALLTYPE lastVisitWasFailure(BOOL* wasFailure);
+    virtual HRESULT STDMETHODCALLTYPE setLastVisitWasFailure(BOOL wasFailure);
+    virtual HRESULT STDMETHODCALLTYPE lastVisitWasHTTPNonGet(BOOL* HTTPNonGet);
+    virtual HRESULT STDMETHODCALLTYPE setLastVisitWasHTTPNonGet(BOOL HTTPNonGet);
+    virtual HRESULT STDMETHODCALLTYPE redirectURLs(IEnumVARIANT**);
+    virtual HRESULT STDMETHODCALLTYPE visitedWithTitle(BSTR title);
+    virtual HRESULT STDMETHODCALLTYPE getDailyVisitCounts(int* number, int** counts);
+    virtual HRESULT STDMETHODCALLTYPE getWeeklyVisitCounts(int* number, int** counts);
+    virtual HRESULT STDMETHODCALLTYPE recordInitialVisit();
     // WebHistoryItem
     WebCore::HistoryItem* historyItem() const;
+
 protected:
     ULONG m_refCount;
 
diff --git a/WebKit/win/WebIconDatabase.cpp b/WebKit/win/WebIconDatabase.cpp
index 5f9121f..237438c 100644
--- a/WebKit/win/WebIconDatabase.cpp
+++ b/WebKit/win/WebIconDatabase.cpp
@@ -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
@@ -71,6 +71,15 @@
         LOG_ERROR("Unable to get icon database enabled preference");
     }
     iconDatabase()->setEnabled(!!enabled);
+    if (!(!!enabled))
+        return;
+
+    startUpIconDatabase();
+}
+
+void WebIconDatabase::startUpIconDatabase()
+{
+    WebPreferences* standardPrefs = WebPreferences::sharedStandardPreferences();
 
     iconDatabase()->setClient(this);
 
@@ -91,6 +100,10 @@
             LOG_ERROR("Failed to open icon database path");
 }
 
+void WebIconDatabase::shutDownIconDatabase()
+{
+}
+
 WebIconDatabase* WebIconDatabase::createInstance()
 {
     WebIconDatabase* instance = new WebIconDatabase();
@@ -225,6 +238,28 @@
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebIconDatabase::isEnabled( 
+        /* [retval][out] */ BOOL *result)
+{
+    *result = iconDatabase()->isEnabled();
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebIconDatabase::setEnabled( 
+        /* [in] */ BOOL flag)
+{
+    BOOL currentlyEnabled;
+    isEnabled(&currentlyEnabled);
+    if (currentlyEnabled && !flag) {
+        iconDatabase()->setEnabled(false);
+        shutDownIconDatabase();
+    } else if (!currentlyEnabled && flag) {
+        iconDatabase()->setEnabled(true);
+        startUpIconDatabase();
+    }
+    return S_OK;
+}
+
 HBITMAP createDIB(LPSIZE size)
 {
     HBITMAP result;
diff --git a/WebKit/win/WebIconDatabase.h b/WebKit/win/WebIconDatabase.h
index 85f57b7..ac42d4a 100644
--- a/WebKit/win/WebIconDatabase.h
+++ b/WebKit/win/WebIconDatabase.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -57,6 +57,8 @@
     WebIconDatabase();
     ~WebIconDatabase();
     void init();
+    void startUpIconDatabase();
+    void shutDownIconDatabase();
 public:
 
     // IUnknown
@@ -94,6 +96,12 @@
         /* [in] */ BSTR url,
         /* [retval][out] */ BSTR *iconURL);
 
+    virtual HRESULT STDMETHODCALLTYPE isEnabled( 
+        /* [retval][out] */ BOOL *result);
+
+    virtual HRESULT STDMETHODCALLTYPE setEnabled( 
+        /* [in] */ BOOL /*flag*/);
+
     // IconDatabaseClient
     virtual void dispatchDidRemoveAllIcons();
     virtual void dispatchDidAddIconForPageURL(const WebCore::String&);
diff --git a/WebKit/win/WebJavaScriptCollector.cpp b/WebKit/win/WebJavaScriptCollector.cpp
index 818fb4e..2e0d7e6 100644
--- a/WebKit/win/WebJavaScriptCollector.cpp
+++ b/WebKit/win/WebJavaScriptCollector.cpp
@@ -114,6 +114,6 @@
     }
 
     JSLock lock(false);
-    *count = (UINT)JSDOMWindow::commonJSGlobalData()->heap.size();
+    *count = (UINT)JSDOMWindow::commonJSGlobalData()->heap.objectCount();
     return S_OK;
 }
diff --git a/WebKit/win/WebKit.resources/Info.plist b/WebKit/win/WebKit.resources/Info.plist
index 859ce3d..9477472 100644
--- a/WebKit/win/WebKit.resources/Info.plist
+++ b/WebKit/win/WebKit.resources/Info.plist
@@ -7,7 +7,7 @@
 	<key>CFBundleExecutable</key>
 	<string>WebKit</string>
 	<key>CFBundleGetInfoString</key>
-	<string>522+, Copyright 2003-2007 Apple Inc.</string>
+	<string>522+, Copyright 2003-2009 Apple Inc.</string>
 	<key>CFBundleIdentifier</key>
 	<string>com.apple.WebKit</string>
 	<key>CFBundleInfoDictionaryVersion</key>
diff --git a/WebKit/win/WebKit.vcproj/WebKit.def b/WebKit/win/WebKit.vcproj/WebKit.def
index a436558..fa3f2bc 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.def
+++ b/WebKit/win/WebKit.vcproj/WebKit.def
@@ -29,10 +29,12 @@
 	    JSObjectIsConstructor
 	    JSObjectIsFunction
 	    JSObjectMake
+	    JSObjectMakeArray
 	    JSObjectMakeConstructor
-	    JSObjectMakeFunction
+	    JSObjectMakeDate
 	    JSObjectMakeFunction
 	    JSObjectMakeFunctionWithCallback
+	    JSObjectMakeRegExp
 	    JSObjectSetPrivate
 	    JSObjectSetProperty
 	    JSObjectSetPropertyAtIndex
diff --git a/WebKit/win/WebKit.vcproj/WebKit.rc b/WebKit/win/WebKit.vcproj/WebKit.rc
index bfab23a..1c4e4f5 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.rc
+++ b/WebKit/win/WebKit.vcproj/WebKit.rc
@@ -42,7 +42,7 @@
             VALUE "FileVersion", __VERSION_TEXT__
             VALUE "CompanyName", "Apple Inc."
             VALUE "InternalName", "WebKit"
-            VALUE "LegalCopyright", "Copyright Apple Inc. 2003-2008"
+            VALUE "LegalCopyright", "Copyright Apple Inc. 2003-2009"
             VALUE "OriginalFilename", "WebKit.dll"
             VALUE "ProductName", " WebKit"
             VALUE "ProductVersion", __BUILD_NUMBER_SHORT__
@@ -77,4 +77,8 @@
 IDR_PAN_SOUTH_WEST_CURSOR        PNG                     "panSouthWestCursor.png"
 IDR_PAN_NORTH_EAST_CURSOR        PNG                     "panNorthEastCursor.png"
 IDR_PAN_NORTH_WEST_CURSOR        PNG                     "panNorthWestCursor.png"
+IDR_SEARCH_CANCEL                PNG                     "searchCancel.png"
+IDR_SEARCH_CANCEL_PRESSED        PNG                     "searchCancelPressed.png"
+IDR_SEARCH_MAGNIFIER             PNG                     "searchMagnifier.png"
+IDR_SEARCH_MAGNIFIER_RESULTS     PNG                     "searchMagnifierResults.png"
 
diff --git a/WebKit/win/WebKit.vcproj/WebKit.sln b/WebKit/win/WebKit.vcproj/WebKit.sln
index beca071..e06e650 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.sln
+++ b/WebKit/win/WebKit.vcproj/WebKit.sln
@@ -235,13 +235,11 @@
 		{0A324352-B3B6-496C-9E5B-4C7E923E628B}.Release|Win32.ActiveCfg = Release|Win32

 		{0A324352-B3B6-496C-9E5B-4C7E923E628B}.Release|Win32.Build.0 = Release|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Debug_Cairo|Win32.ActiveCfg = Debug|Win32

-		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Debug_Cairo|Win32.Build.0 = Debug|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Debug|Win32.ActiveCfg = Debug|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Debug|Win32.Build.0 = Debug|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Release_Cairo|Win32.ActiveCfg = Release|Win32

-		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Release_Cairo|Win32.Build.0 = Release|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Release|Win32.ActiveCfg = Release|Win32

 		{E498CA9D-3BD2-4D52-8E37-C8DC76526325}.Release|Win32.Build.0 = Release|Win32

 		{114FCA11-216B-4C8C-957E-30A75AE80443}.Debug_Cairo|Win32.ActiveCfg = Debug|Win32

diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj
index d4d21d1..0740e8a 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.vcproj
+++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj
@@ -40,7 +40,7 @@
 			<Tool

 				Name="VCCLCompilerTool"

 				AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..\WebCoreSupport&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"

-				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;ENABLE_DOM_STORAGE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_XSLT;ENABLE_XPATH;FRAMEWORK_NAME=WebKit"

+				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;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"

 				UsePrecompiledHeader="2"

 				PrecompiledHeaderThrough="WebKitPrefix.h"

 				ForcedIncludeFiles="WebKitPrefix.h"

@@ -116,7 +116,7 @@
 			<Tool

 				Name="VCCLCompilerTool"

 				AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..\WebCoreSupport&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"

-				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;ENABLE_DOM_STORAGE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_XSLT;ENABLE_XPATH;FRAMEWORK_NAME=WebKit"

+				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;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"

 				UsePrecompiledHeader="2"

 				PrecompiledHeaderThrough="WebKitPrefix.h"

 				ForcedIncludeFiles="WebKitPrefix.h"

@@ -191,7 +191,7 @@
 			<Tool

 				Name="VCCLCompilerTool"

 				AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..\WebCoreSupport&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"

-				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;ENABLE_DOM_STORAGE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_XSLT;ENABLE_XPATH;FRAMEWORK_NAME=WebKit"

+				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;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"

 				UsePrecompiledHeader="2"

 				PrecompiledHeaderThrough="WebKitPrefix.h"

 				Detect64BitPortabilityProblems="false"

@@ -269,7 +269,7 @@
 			<Tool

 				Name="VCCLCompilerTool"

 				AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..\WebCoreSupport&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"

-				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;ENABLE_DOM_STORAGE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_XSLT;ENABLE_XPATH;FRAMEWORK_NAME=WebKit"

+				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;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_WORKERS;ENABLE_XPATH;ENABLE_XSLT"

 				UsePrecompiledHeader="2"

 				PrecompiledHeaderThrough="WebKitPrefix.h"

 				ForcedIncludeFiles="WebKitPrefix.h"

@@ -287,17 +287,18 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuin$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CoreGraphics.lib CFNetwork$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib QTMovieWin$(WebKitConfigSuffix).lib crypt32.lib cairo.lib giflib.lib jpeg.lib libpng.lib libcurl_imp.lib ws2_32.lib wininet.lib Wldap32.lib iphlpapi.lib"

+				AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuin$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CFLite_Debug.lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib msimg32.lib crypt32.lib cairo.lib giflib.lib jpeg.lib libpng.lib libcurl_imp.lib ws2_32.lib wininet.lib Wldap32.lib iphlpapi.lib"

 				OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"

 				AdditionalLibraryDirectories=""

-				ModuleDefinitionFile="WebKit$(WebKitDLLConfigSuffix).def"

-				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll"

+				ModuleDefinitionFile="WebKit_Cairo$(WebKitDLLConfigSuffix).def"

+				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;iphlpapi.dll"

 			/>

 			<Tool

 				Name="VCALinkTool"

 			/>

 			<Tool

 				Name="VCManifestTool"

+				VerboseOutput="false"

 			/>

 			<Tool

 				Name="VCXDCMakeTool"

@@ -347,7 +348,7 @@
 			<Tool

 				Name="VCCLCompilerTool"

 				AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..\WebCoreSupport&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"

-				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;ENABLE_DOM_STORAGE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_XSLT;ENABLE_XPATH;FRAMEWORK_NAME=WebKit"

+				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;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_WORKERS;ENABLE_XPATH;ENABLE_XSLT"

 				UsePrecompiledHeader="2"

 				PrecompiledHeaderThrough="WebKitPrefix.h"

 				ForcedIncludeFiles="WebKitPrefix.h"

@@ -365,11 +366,11 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuin$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib msimg32.lib QTMovieWin$(WebKitConfigSuffix).lib crypt32.lib cairo.lib giflib.lib jpeg.lib libpng.lib libcurl_imp.lib ws2_32.lib wininet.lib Wldap32.lib iphlpapi.lib"

+				AdditionalDependencies="delayimp.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib usp10.lib comctl32.lib version.lib shlwapi.lib libxml2$(LibraryConfigSuffix).lib libxslt$(LibraryConfigSuffix).lib icuin$(LibraryConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib SQLite3$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib CFLite.lib JavaScriptCore$(WebKitConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib msimg32.lib crypt32.lib cairo.lib giflib.lib jpeg.lib libpng.lib libcurl_imp.lib ws2_32.lib wininet.lib Wldap32.lib iphlpapi.lib"

 				OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"

 				AdditionalLibraryDirectories=""

-				ModuleDefinitionFile="WebKit$(WebKitDLLConfigSuffix).def"

-				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll"

+				ModuleDefinitionFile="WebKit_Cairo$(WebKitDLLConfigSuffix).def"

+				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;iphlpapi.dll"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -425,7 +426,7 @@
 				Name="VCCLCompilerTool"

 				WholeProgramOptimization="false"

 				AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..\WebCoreSupport&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"

-				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;ENABLE_DOM_STORAGE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_XSLT;ENABLE_XPATH;FRAMEWORK_NAME=WebKit"

+				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;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"

 				UsePrecompiledHeader="2"

 				PrecompiledHeaderThrough="WebKitPrefix.h"

 				ForcedIncludeFiles="WebKitPrefix.h"

@@ -504,7 +505,7 @@
 				Name="VCCLCompilerTool"

 				WholeProgramOptimization="false"

 				AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..\WebCoreSupport&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"

-				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;ENABLE_DOM_STORAGE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_XSLT;ENABLE_XPATH;FRAMEWORK_NAME=WebKit"

+				PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;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"

 				UsePrecompiledHeader="2"

 				PrecompiledHeaderThrough="WebKitPrefix.h"

 				ForcedIncludeFiles="WebKitPrefix.h"

@@ -687,7 +688,7 @@
 				>

 			</File>

 			<File

-				RelativePath="..\WebCachedPagePlatformData.h"

+				RelativePath="..\WebCachedFramePlatformData.h"

 				>

 			</File>

 			<File

@@ -773,6 +774,22 @@
 			<File

 				RelativePath="..\WebKitGraphics.h"

 				>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCustomBuildTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCustomBuildTool"

+					/>

+				</FileConfiguration>

 			</File>

 			<File

 				RelativePath="..\WebKitLogging.h"

@@ -793,6 +810,22 @@
 			<File

 				RelativePath="..\WebLocalizableStrings.h"

 				>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCustomBuildTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCustomBuildTool"

+					/>

+				</FileConfiguration>

 			</File>

 			<File

 				RelativePath="..\WebMutableURLRequest.h"

@@ -939,6 +972,70 @@
 				>

 			</File>

 			<File

+				RelativePath="..\WebCookieManagerCFNet.cpp"

+				>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\WebCookieManagerCurl.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_PGOInstrument|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_PGOOptimize|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

 				RelativePath="..\WebCoreStatistics.cpp"

 				>

 			</File>

@@ -959,6 +1056,70 @@
 				>

 			</File>

 			<File

+				RelativePath="..\WebDownloadCFNet.cpp"

+				>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\WebDownloadCurl.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_PGOInstrument|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_PGOOptimize|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

 				RelativePath="..\WebDropSource.cpp"

 				>

 			</File>

@@ -1067,6 +1228,70 @@
 				>

 			</File>

 			<File

+				RelativePath="..\WebURLAuthenticationChallengeSenderCFNet.cpp"

+				>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\WebURLAuthenticationChallengeSenderCurl.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_PGOInstrument|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_PGOOptimize|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

 				RelativePath="..\WebURLCredential.cpp"

 				>

 			</File>

@@ -1095,6 +1320,22 @@
 				>

 			</File>

 			<File

+				RelativePath=".\searchCancel.png"

+				>

+			</File>

+			<File

+				RelativePath=".\searchCancelPressed.png"

+				>

+			</File>

+			<File

+				RelativePath=".\searchMagnifier.png"

+				>

+			</File>

+			<File

+				RelativePath=".\searchMagnifierResults.png"

+				>

+			</File>

+			<File

 				RelativePath=".\textAreaResizeCorner.png"

 				>

 			</File>

@@ -1185,10 +1426,34 @@
 			<File

 				RelativePath="..\WebKitGraphics.cpp"

 				>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

 			</File>

 			<File

 				RelativePath="..\WebLocalizableStrings.cpp"

 				>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

 			</File>

 		</Filter>

 		<Filter

diff --git a/WebKit/win/WebKit.vcproj/WebKit_Cairo.def b/WebKit/win/WebKit.vcproj/WebKit_Cairo.def
new file mode 100755
index 0000000..50b3675
--- /dev/null
+++ b/WebKit/win/WebKit.vcproj/WebKit_Cairo.def
@@ -0,0 +1,127 @@
+LIBRARY	"WebKit"
+
+EXPORTS
+        DllGetClassObject   PRIVATE
+        DllCanUnloadNow     PRIVATE
+        DllRegisterServer   PRIVATE
+        DllUnregisterServer PRIVATE
+        RunAsLocalServer    PRIVATE
+        LocalServerDidDie   PRIVATE
+	    JSCheckScriptSyntax
+	    JSClassCreate
+	    JSClassRelease
+	    JSClassRetain
+	    JSContextGetGlobalObject
+	    JSEvaluateScript
+	    JSGarbageCollect
+	    JSGlobalContextCreate
+	    JSGlobalContextRelease
+	    JSGlobalContextRetain
+	    JSObjectCallAsConstructor
+	    JSObjectCallAsFunction
+	    JSObjectCopyPropertyNames
+	    JSObjectDeleteProperty
+	    JSObjectGetPrivate
+	    JSObjectGetProperty
+	    JSObjectGetPropertyAtIndex
+	    JSObjectGetPrototype
+	    JSObjectHasProperty
+	    JSObjectIsConstructor
+	    JSObjectIsFunction
+	    JSObjectMake
+	    JSObjectMakeArray
+	    JSObjectMakeConstructor
+	    JSObjectMakeDate
+	    JSObjectMakeFunction
+	    JSObjectMakeFunctionWithCallback
+	    JSObjectMakeRegExp
+	    JSObjectSetPrivate
+	    JSObjectSetProperty
+	    JSObjectSetPropertyAtIndex
+	    JSObjectSetPrototype
+	    JSPropertyNameAccumulatorAddName
+	    JSPropertyNameArrayGetCount
+	    JSPropertyNameArrayGetNameAtIndex
+	    JSPropertyNameArrayRelease
+	    JSPropertyNameArrayRetain
+	    JSStringCopyBSTR
+	    JSStringCopyCFString
+	    JSStringCreateWithBSTR
+	    JSStringCreateWithCFString
+	    JSStringCreateWithCharacters
+	    JSStringCreateWithUTF8CString
+	    JSStringGetCharactersPtr
+	    JSStringGetLength
+	    JSStringGetMaximumUTF8CStringSize
+	    JSStringGetUTF8CString
+	    JSStringIsEqual
+	    JSStringIsEqualToUTF8CString
+	    JSStringRelease
+	    JSStringRetain
+	    JSValueGetType
+	    JSValueIsBoolean
+	    JSValueIsEqual
+	    JSValueIsInstanceOfConstructor
+	    JSValueIsNull
+	    JSValueIsNumber
+	    JSValueIsObject
+	    JSValueIsObjectOfClass
+	    JSValueIsStrictEqual
+	    JSValueIsString
+	    JSValueIsUndefined
+	    JSValueMakeBoolean
+	    JSValueMakeNull
+	    JSValueMakeNumber
+	    JSValueMakeString
+	    JSValueMakeUndefined
+	    JSValueProtect
+	    JSValueToBoolean
+	    JSValueToNumber
+	    JSValueToObject
+	    JSValueToStringCopy
+	    JSValueUnprotect
+;   	KJS_JSCreateNativeJSObject
+;   	KJS_JSObject_JSFinalize
+;   	KJS_JSObject_JSObjectCall
+;   	KJS_JSObject_JSObjectEval
+;   	KJS_JSObject_JSObjectGetMember
+;   	KJS_JSObject_JSObjectGetSlot
+;   	KJS_JSObject_JSObjectRemoveMember
+;   	KJS_JSObject_JSObjectSetMember
+;   	KJS_JSObject_JSObjectSetSlot
+;   	KJS_JSObject_JSObjectToString
+        setUseOpenSourceWebKit
+        shutDownWebKit
+        progIDForClass
+        WebLocalizedStringUTF8
+        WebLocalizedLPCTSTRUTF8
+        ?fastMalloc@WTF@@YAPAXI@Z
+        ?fastZeroedMalloc@WTF@@YAPAXI@Z
+        ?fastFree@WTF@@YAXPAX@Z
+        ?fastCalloc@WTF@@YAPAXII@Z
+        ??0Mutex@WTF@@QAE@XZ
+        ??0ThreadCondition@WTF@@QAE@XZ
+        ??1Mutex@WTF@@QAE@XZ
+        ??1ThreadCondition@WTF@@QAE@XZ
+        ?broadcast@ThreadCondition@WTF@@QAEXXZ
+        ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
+        ?createThread@WTF@@YAIP6APAXPAX@Z0PBD@Z
+        ?currentThread@WTF@@YAIXZ
+        ?detachThread@WTF@@YAXI@Z
+        ?initializeMainThread@WTF@@YAXXZ
+        ?initializeThreading@WTF@@YAXXZ
+        ?isMainThread@WTF@@YA_NXZ
+        ?lock@Mutex@WTF@@QAEXXZ
+        ?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
+        ?signal@ThreadCondition@WTF@@QAEXXZ
+        ?tryLock@Mutex@WTF@@QAE_NXZ
+        ?unlock@Mutex@WTF@@QAEXXZ
+        ?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
+        ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
+        ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
+
+        ; These functions are deprecated
+        WebLocalizedString
+        WebLocalizedLPCTSTR
+        SetWebLocalizedStringMainBundle
+        ?createThread@WTF@@YAIP6APAXPAX@Z0@Z
diff --git a/WebKit/win/WebKit.vcproj/WebKit_Cairo_debug.def b/WebKit/win/WebKit.vcproj/WebKit_Cairo_debug.def
new file mode 100755
index 0000000..a53f027
--- /dev/null
+++ b/WebKit/win/WebKit.vcproj/WebKit_Cairo_debug.def
@@ -0,0 +1,133 @@
+LIBRARY    "WebKit_debug"
+
+EXPORTS
+        DllGetClassObject   PRIVATE
+        DllCanUnloadNow     PRIVATE
+        DllRegisterServer   PRIVATE
+        DllUnregisterServer PRIVATE
+        RunAsLocalServer    PRIVATE
+        LocalServerDidDie   PRIVATE
+        JSCheckScriptSyntax
+        JSClassCreate
+        JSClassRelease
+        JSClassRetain
+        JSContextGetGlobalObject
+        JSEvaluateScript
+        JSGarbageCollect
+        JSGlobalContextCreate
+        JSGlobalContextRelease
+        JSGlobalContextRetain
+        JSObjectCallAsConstructor
+        JSObjectCallAsFunction
+        JSObjectCopyPropertyNames
+        JSObjectDeleteProperty
+        JSObjectGetPrivate
+        JSObjectGetProperty
+        JSObjectGetPropertyAtIndex
+        JSObjectGetPrototype
+        JSObjectHasProperty
+        JSObjectIsConstructor
+        JSObjectIsFunction
+        JSObjectMake
+        JSObjectMakeArray
+        JSObjectMakeConstructor
+        JSObjectMakeDate
+        JSObjectMakeFunction
+        JSObjectMakeFunctionWithCallback
+        JSObjectMakeRegExp
+        JSObjectSetPrivate
+        JSObjectSetProperty
+        JSObjectSetPropertyAtIndex
+        JSObjectSetPrototype
+        JSPropertyNameAccumulatorAddName
+        JSPropertyNameArrayGetCount
+        JSPropertyNameArrayGetNameAtIndex
+        JSPropertyNameArrayRelease
+        JSPropertyNameArrayRetain
+        JSStringCopyBSTR
+        JSStringCopyCFString
+        JSStringCreateWithBSTR
+        JSStringCreateWithCFString
+        JSStringCreateWithCharacters
+        JSStringCreateWithUTF8CString
+        JSStringGetCharactersPtr
+        JSStringGetLength
+        JSStringGetMaximumUTF8CStringSize
+        JSStringGetUTF8CString
+        JSStringIsEqual
+        JSStringIsEqualToUTF8CString
+        JSStringRelease
+        JSStringRetain
+        JSValueGetType
+        JSValueIsBoolean
+        JSValueIsEqual
+        JSValueIsInstanceOfConstructor
+        JSValueIsNull
+        JSValueIsNumber
+        JSValueIsObject
+        JSValueIsObjectOfClass
+        JSValueIsStrictEqual
+        JSValueIsString
+        JSValueIsUndefined
+        JSValueMakeBoolean
+        JSValueMakeNull
+        JSValueMakeNumber
+        JSValueMakeString
+        JSValueMakeUndefined
+        JSValueProtect
+        JSValueToBoolean
+        JSValueToNumber
+        JSValueToObject
+        JSValueToStringCopy
+        JSValueUnprotect
+;       KJS_JSCreateNativeJSObject
+;       KJS_JSObject_JSFinalize
+;       KJS_JSObject_JSObjectCall
+;       KJS_JSObject_JSObjectEval
+;       KJS_JSObject_JSObjectGetMember
+;       KJS_JSObject_JSObjectGetSlot
+;       KJS_JSObject_JSObjectRemoveMember
+;       KJS_JSObject_JSObjectSetMember
+;       KJS_JSObject_JSObjectSetSlot
+;       KJS_JSObject_JSObjectToString
+        setUseOpenSourceWebKit
+        shutDownWebKit
+        progIDForClass
+        WebLocalizedStringUTF8
+        WebLocalizedLPCTSTRUTF8
+        WebDrawText
+        ?fastMalloc@WTF@@YAPAXI@Z
+        ?fastZeroedMalloc@WTF@@YAPAXI@Z
+        ?fastFree@WTF@@YAXPAX@Z
+        ?fastCalloc@WTF@@YAPAXII@Z
+        ??0Mutex@WTF@@QAE@XZ
+        ??0ThreadCondition@WTF@@QAE@XZ
+        ??1Mutex@WTF@@QAE@XZ
+        ??1ThreadCondition@WTF@@QAE@XZ
+        ?broadcast@ThreadCondition@WTF@@QAEXXZ
+        ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
+        ?createThread@WTF@@YAIP6APAXPAX@Z0PBD@Z
+        ?currentThread@WTF@@YAIXZ
+        ?detachThread@WTF@@YAXI@Z
+        ?initializeMainThread@WTF@@YAXXZ
+        ?initializeThreading@WTF@@YAXXZ
+        ?isMainThread@WTF@@YA_NXZ
+        ?lock@Mutex@WTF@@QAEXXZ
+        ?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ        
+        ?signal@ThreadCondition@WTF@@QAEXXZ
+        ?tryLock@Mutex@WTF@@QAE_NXZ
+        ?unlock@Mutex@WTF@@QAEXXZ
+        ?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
+        ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
+        ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
+        WTFLog
+        WTFReportArgumentAssertionFailure
+        WTFReportAssertionFailure
+        WTFReportAssertionFailureWithMessage
+        WTFReportError
+
+        ; These functions are deprecated
+        WebLocalizedString
+        WebLocalizedLPCTSTR
+        SetWebLocalizedStringMainBundle
+        ?createThread@WTF@@YAIP6APAXPAX@Z0@Z
diff --git a/WebKit/win/WebKit.vcproj/WebKit_debug.def b/WebKit/win/WebKit.vcproj/WebKit_debug.def
index d4fb488..6ed6a90 100644
--- a/WebKit/win/WebKit.vcproj/WebKit_debug.def
+++ b/WebKit/win/WebKit.vcproj/WebKit_debug.def
@@ -29,10 +29,12 @@
         JSObjectIsConstructor
         JSObjectIsFunction
         JSObjectMake
+        JSObjectMakeArray
         JSObjectMakeConstructor
-        JSObjectMakeFunction
+        JSObjectMakeDate
         JSObjectMakeFunction
         JSObjectMakeFunctionWithCallback
+        JSObjectMakeRegExp
         JSObjectSetPrivate
         JSObjectSetProperty
         JSObjectSetPropertyAtIndex
diff --git a/WebKit/win/WebKit.vcproj/resource.h b/WebKit/win/WebKit.vcproj/resource.h
index 134e215..028cb3c 100644
--- a/WebKit/win/WebKit.vcproj/resource.h
+++ b/WebKit/win/WebKit.vcproj/resource.h
@@ -19,6 +19,10 @@
 #define IDR_PAN_SOUTH_WEST_CURSOR       15
 #define IDR_PAN_NORTH_EAST_CURSOR       16
 #define IDR_PAN_NORTH_WEST_CURSOR       17
+#define IDR_SEARCH_CANCEL               18
+#define IDR_SEARCH_CANCEL_PRESSED       19
+#define IDR_SEARCH_MAGNIFIER            20
+#define IDR_SEARCH_MAGNIFIER_RESULTS    21
 #define IDC_STATIC                      -1
 
 #define BUILD_NUMBER                    1
@@ -27,7 +31,7 @@
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        18
+#define _APS_NEXT_RESOURCE_VALUE        22
 #define _APS_NEXT_COMMAND_VALUE         40001
 #define _APS_NEXT_CONTROL_VALUE         1000
 #define _APS_NEXT_SYMED_VALUE           101
diff --git a/WebKit/win/WebKit.vcproj/searchCancel.png b/WebKit/win/WebKit.vcproj/searchCancel.png
new file mode 100644
index 0000000..49f3f47
--- /dev/null
+++ b/WebKit/win/WebKit.vcproj/searchCancel.png
Binary files differ
diff --git a/WebKit/win/WebKit.vcproj/searchCancelPressed.png b/WebKit/win/WebKit.vcproj/searchCancelPressed.png
new file mode 100644
index 0000000..b699d81
--- /dev/null
+++ b/WebKit/win/WebKit.vcproj/searchCancelPressed.png
Binary files differ
diff --git a/WebKit/win/WebKit.vcproj/searchMagnifier.png b/WebKit/win/WebKit.vcproj/searchMagnifier.png
new file mode 100644
index 0000000..f9b8cae
--- /dev/null
+++ b/WebKit/win/WebKit.vcproj/searchMagnifier.png
Binary files differ
diff --git a/WebKit/win/WebKit.vcproj/searchMagnifierResults.png b/WebKit/win/WebKit.vcproj/searchMagnifierResults.png
new file mode 100644
index 0000000..9aa1b36
--- /dev/null
+++ b/WebKit/win/WebKit.vcproj/searchMagnifierResults.png
Binary files differ
diff --git a/WebKit/win/WebKitClassFactory.cpp b/WebKit/win/WebKitClassFactory.cpp
index 0da303a..112dabe 100644
--- a/WebKit/win/WebKitClassFactory.cpp
+++ b/WebKit/win/WebKitClassFactory.cpp
@@ -54,6 +54,7 @@
 #include "WebScriptDebugServer.h"
 #include "WebView.h"
 #pragma warning(push, 0)
+#include <JavaScriptCore/InitializeThreading.h>
 #include <WebCore/FontDatabase.h>
 #include <WebCore/SoftLinking.h>
 #pragma warning(pop)
@@ -82,6 +83,7 @@
     }
 #endif
 
+    JSC::initializeThreading();
     WebCore::populateFontDatabase();
 
     gClassCount++;
diff --git a/WebKit/win/WebKitDLL.cpp b/WebKit/win/WebKitDLL.cpp
index eab96b9..2df3584 100644
--- a/WebKit/win/WebKitDLL.cpp
+++ b/WebKit/win/WebKitDLL.cpp
@@ -167,6 +167,14 @@
         idr = IDR_PAN_NORTH_EAST_CURSOR;
     else if (!strcmp(name, "panNorthWestCursor"))
         idr = IDR_PAN_NORTH_WEST_CURSOR;
+    else if (!strcmp(name, "searchMagnifier"))
+        idr = IDR_SEARCH_MAGNIFIER;
+    else if (!strcmp(name, "searchMagnifierResults"))
+        idr = IDR_SEARCH_MAGNIFIER_RESULTS;
+    else if (!strcmp(name, "searchCancel"))
+        idr = IDR_SEARCH_CANCEL;
+    else if (!strcmp(name, "searchCancelPressed"))
+        idr = IDR_SEARCH_CANCEL_PRESSED;
     else if (!strcmp(name, "zoomInCursor"))
         idr = IDR_ZOOM_IN_CURSOR;
     else if (!strcmp(name, "zoomOutCursor"))
diff --git a/WebKit/win/WebKitPrefix.cpp b/WebKit/win/WebKitPrefix.cpp
index e82b88d..193e9f6 100644
--- a/WebKit/win/WebKitPrefix.cpp
+++ b/WebKit/win/WebKitPrefix.cpp
@@ -27,3 +27,4 @@
  */
 
 #include "WebKitPrefix.h"
+
diff --git a/WebKit/win/WebMutableURLRequest.cpp b/WebKit/win/WebMutableURLRequest.cpp
index c4e034e..63a060e 100644
--- a/WebKit/win/WebMutableURLRequest.cpp
+++ b/WebKit/win/WebMutableURLRequest.cpp
@@ -35,9 +35,12 @@
 #include <WebCore/BString.h>
 #include <WebCore/CString.h>
 #include <WebCore/FormData.h>
+#include <WebCore/NotImplemented.h>
 #include <WebCore/ResourceHandle.h>
 #pragma warning(pop)
 
+#include <wtf/RetainPtr.h>
+
 using namespace WebCore;
 
 // IWebURLRequest ----------------------------------------------------------------
@@ -367,9 +370,15 @@
 {
     if (!result)
         return E_POINTER;
+
+#if USE(CFNETWORK)
     RetainPtr<CFMutableURLRequestRef> mutableRequest(AdoptCF, CFURLRequestCreateMutableCopy(kCFAllocatorDefault, m_request.cfURLRequest()));
     *result = createInstance(ResourceRequest(mutableRequest.get()));
     return S_OK;
+#else
+   notImplemented();
+   return E_NOTIMPL;
+#endif
 }
 
 // IWebMutableURLRequest ----------------------------------------------------
diff --git a/WebKit/win/WebPreferenceKeysPrivate.h b/WebKit/win/WebPreferenceKeysPrivate.h
index 6f3dacd..758254e 100644
--- a/WebKit/win/WebPreferenceKeysPrivate.h
+++ b/WebKit/win/WebPreferenceKeysPrivate.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc.  All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -49,6 +49,8 @@
 #define WebKitJavaScriptEnabledPreferenceKey "WebKitJavaScriptEnabled"
 #define WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey "WebKitJavaScriptCanOpenWindowsAutomatically"
 #define WebKitPluginsEnabledPreferenceKey "WebKitPluginsEnabled"
+#define WebKitDatabasesEnabledPreferenceKey "WebKitDatabasesEnabled"
+#define WebKitLocalStorageEnabledPreferenceKey "WebKitLocalStorageEnabled"
 #define WebKitAllowAnimatedImagesPreferenceKey "WebKitAllowAnimatedImagesPreferenceKey"
 #define WebKitAllowAnimatedImageLoopingPreferenceKey "WebKitAllowAnimatedImageLoopingPreferenceKey"
 #define WebKitDisplayImagesKey "WebKitDisplayImagesKey"
@@ -89,6 +91,7 @@
 
 // Windows-specific keys
 #define WebKitFontSmoothingTypePreferenceKey "WebKitFontSmoothingType" // default: FontSmoothingTypeMedium (2)
+#define WebKitFontSmoothingContrastPreferenceKey "WebKitFontSmoothingContrast" // default: "2"
 #define WebKitCookieStorageAcceptPolicyPreferenceKey "WebKitCookieStorageAcceptPolicy" // default: WebKitCookieStorageAcceptPolicyOnlyFromMainDocumentDomain
 
 #define WebContinuousSpellCheckingEnabledPreferenceKey "WebContinuousSpellCheckingEnabled" // default: false
@@ -116,3 +119,5 @@
 
 #define WebKitPaintNativeControlsPreferenceKey "WebKitPaintNativeControls"
 
+#define WebKitZoomsTextOnlyPreferenceKey "WebKitZoomsTextOnly"
+
diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp
index 316524a..5fcd319 100644
--- a/WebKit/win/WebPreferences.cpp
+++ b/WebKit/win/WebPreferences.cpp
@@ -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
@@ -42,14 +42,17 @@
 #pragma warning( pop )
 
 #include <CoreFoundation/CoreFoundation.h>
-#include <CoreGraphics/CoreGraphics.h>
 #include <shlobj.h>
 #include <shfolder.h>
 #include <tchar.h>
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
 #include <wtf/HashMap.h>
 #include <wtf/OwnArrayPtr.h>
 
+#if PLATFORM(CG)
+#include <CoreGraphics/CoreGraphics.h>
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif
+
 using namespace WebCore;
 
 static const String& oldPreferencesPath()
@@ -202,6 +205,8 @@
     CFDictionaryAddValue(defaults, CFSTR(WebKitJavaScriptEnabledPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitPluginsEnabledPreferenceKey), kCFBooleanTrue);
+    CFDictionaryAddValue(defaults, CFSTR(WebKitDatabasesEnabledPreferenceKey), kCFBooleanTrue);
+    CFDictionaryAddValue(defaults, CFSTR(WebKitLocalStorageEnabledPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitAllowAnimatedImagesPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitAllowAnimatedImageLoopingPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitDisplayImagesKey), kCFBooleanTrue);
@@ -221,6 +226,7 @@
     CFDictionaryAddValue(defaults, CFSTR(WebKitIconDatabaseLocationKey), CFSTR(""));
     CFDictionaryAddValue(defaults, CFSTR(WebKitIconDatabaseEnabledPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitFontSmoothingTypePreferenceKey), CFSTR("2"));
+    CFDictionaryAddValue(defaults, CFSTR(WebKitFontSmoothingContrastPreferenceKey), CFSTR("2"));
     CFDictionaryAddValue(defaults, CFSTR(WebKitCookieStorageAcceptPolicyPreferenceKey), CFSTR("2"));
     CFDictionaryAddValue(defaults, CFSTR(WebContinuousSpellCheckingEnabledPreferenceKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(WebGrammarCheckingEnabledPreferenceKey), kCFBooleanFalse);
@@ -334,6 +340,16 @@
     postPreferencesChangesNotification();
 }
 
+void WebPreferences::setFloatValue(CFStringRef key, float value)
+{
+    if (floatValueForKey(key) == value)
+        return;
+
+    setValueForKey(key, cfNumber(value).get());
+
+    postPreferencesChangesNotification();
+}
+
 void WebPreferences::setBoolValue(CFStringRef key, BOOL value)
 {
     if (boolValueForKey(key) == value)
@@ -963,8 +979,27 @@
 {
     setIntegerValue(CFSTR(WebKitFontSmoothingTypePreferenceKey), smoothingType);
     if (smoothingType == FontSmoothingTypeWindows)
-        smoothingType = FontSmoothingTypeStandard;
+        smoothingType = FontSmoothingTypeMedium;
+#if PLATFORM(CG)
     wkSetFontSmoothingLevel((int)smoothingType);
+#endif
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::fontSmoothingContrast( 
+    /* [retval][out] */ float* contrast)
+{
+    *contrast = floatValueForKey(CFSTR(WebKitFontSmoothingContrastPreferenceKey));
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::setFontSmoothingContrast( 
+    /* [in] */ float contrast)
+{
+    setFloatValue(CFSTR(WebKitFontSmoothingContrastPreferenceKey), contrast);
+#if PLATFORM(CG)
+    wkSetFontSmoothingContrast(contrast);
+#endif
     return S_OK;
 }
 
@@ -1173,6 +1208,30 @@
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebPreferences::setDatabasesEnabled(BOOL enabled)
+{
+    setBoolValue(CFSTR(WebKitDatabasesEnabledPreferenceKey), enabled);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::databasesEnabled(BOOL* enabled)
+{
+    *enabled = boolValueForKey(CFSTR(WebKitDatabasesEnabledPreferenceKey));
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::setLocalStorageEnabled(BOOL enabled)
+{
+    setBoolValue(CFSTR(WebKitLocalStorageEnabledPreferenceKey), enabled);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::localStorageEnabled(BOOL* enabled)
+{
+    *enabled = boolValueForKey(CFSTR(WebKitLocalStorageEnabledPreferenceKey));
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebPreferences::localStorageDatabasePath(BSTR* location)
 {
     *location = stringValueForKey(CFSTR(WebKitLocalStorageDatabasePathPreferenceKey));
@@ -1185,6 +1244,18 @@
     return S_OK;
 }
 
+HRESULT WebPreferences::setZoomsTextOnly(BOOL zoomsTextOnly)
+{
+    setBoolValue(CFSTR(WebKitZoomsTextOnlyPreferenceKey), zoomsTextOnly);
+    return S_OK;
+}
+
+HRESULT WebPreferences::zoomsTextOnly(BOOL* zoomsTextOnly)
+{
+    *zoomsTextOnly = boolValueForKey(CFSTR(WebKitZoomsTextOnlyPreferenceKey));
+    return S_OK;
+}
+
 void WebPreferences::willAddToWebView()
 {
     ++m_numWebViews;
diff --git a/WebKit/win/WebPreferences.h b/WebKit/win/WebPreferences.h
index 46df0a2..6ab3dcb 100644
--- a/WebKit/win/WebPreferences.h
+++ b/WebKit/win/WebPreferences.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -308,6 +308,18 @@
     virtual HRESULT STDMETHODCALLTYPE offlineWebApplicationCacheEnabled( 
         /* [retval][out] */ BOOL *enabled);
 
+    virtual HRESULT STDMETHODCALLTYPE setDatabasesEnabled( 
+        /* [in] */ BOOL enabled);
+        
+    virtual HRESULT STDMETHODCALLTYPE databasesEnabled( 
+        /* [retval][out] */ BOOL *enabled);
+
+    virtual HRESULT STDMETHODCALLTYPE setLocalStorageEnabled( 
+        /* [in] */ BOOL enabled);
+        
+    virtual HRESULT STDMETHODCALLTYPE localStorageEnabled( 
+        /* [retval][out] */ BOOL *enabled);
+
     virtual HRESULT STDMETHODCALLTYPE localStorageDatabasePath(
         /* [out, retval] */ BSTR* location);
 
@@ -320,6 +332,18 @@
     virtual HRESULT STDMETHODCALLTYPE shouldPaintNativeControls( 
     /* [retval][out] */ BOOL *shouldPaint);
 
+    virtual HRESULT STDMETHODCALLTYPE setZoomsTextOnly( 
+    /* [retval][out] */ BOOL zoomsTextOnly);
+
+    virtual HRESULT STDMETHODCALLTYPE zoomsTextOnly( 
+    /* [retval][out] */ BOOL *zoomsTextOnly);
+
+    virtual HRESULT STDMETHODCALLTYPE fontSmoothingContrast( 
+    /* [retval][out] */ float* contrast);
+    
+    virtual HRESULT STDMETHODCALLTYPE setFontSmoothingContrast( 
+    /* [in] */ float contrast);
+
     // WebPreferences
 
     // This method accesses a different preference key than developerExtrasEnabled.
@@ -355,6 +379,7 @@
     void setStringValue(CFStringRef key, LPCTSTR value);
     void setIntegerValue(CFStringRef key, int value);
     void setBoolValue(CFStringRef key, BOOL value);
+    void setFloatValue(CFStringRef key, float value);
     void setLongLongValue(CFStringRef key, LONGLONG value);
     static WebPreferences* getInstanceForIdentifier(BSTR identifier);
     static void initializeDefaultSettings();
diff --git a/WebKit/win/WebResource.cpp b/WebKit/win/WebResource.cpp
index 9374aec..3c2087f 100644
--- a/WebKit/win/WebResource.cpp
+++ b/WebKit/win/WebResource.cpp
@@ -27,6 +27,7 @@
 #include "WebKitDLL.h"
 #include "WebResource.h"
 
+#include "MarshallingHelpers.h"
 #include "MemoryStream.h"
 
 #pragma warning(push, 0)
@@ -105,7 +106,7 @@
     /* [in] */ BSTR frameName)
 {
     m_data = data;
-    m_url = KURL(String(url));
+    m_url = MarshallingHelpers::BSTRToKURL(url);
     m_mimeType = String(mimeType);
     m_textEncodingName = String(textEncodingName);
     m_frameName = String(frameName);
diff --git a/WebKit/win/WebScriptCallFrame.cpp b/WebKit/win/WebScriptCallFrame.cpp
index a831565..fa76fe9 100644
--- a/WebKit/win/WebScriptCallFrame.cpp
+++ b/WebKit/win/WebScriptCallFrame.cpp
@@ -32,7 +32,7 @@
 #include "COMEnumVariant.h"
 #include "WebKitDLL.h"
 
-#include <JavaScriptCore/Interpreter.h>
+#include <JavaScriptCore/Completion.h>
 #include <JavaScriptCore/JSFunction.h>
 #include <JavaScriptCore/JSGlobalObject.h>
 #include <JavaScriptCore/JSLock.h>
@@ -49,20 +49,20 @@
 
 using namespace JSC;
 
-UString WebScriptCallFrame::jsValueToString(JSC::ExecState* state, JSValue* jsvalue)
+UString WebScriptCallFrame::jsValueToString(JSC::ExecState* state, JSValuePtr jsvalue)
 {
     if (!jsvalue)
         return "undefined";
 
-    if (jsvalue->isString())
-        return jsvalue->getString();
-    else if (jsvalue->isNumber())
-        return UString::from(jsvalue->getNumber());
-    else if (jsvalue->isBoolean())
-        return jsvalue->getBoolean() ? "True" : "False";
-    else if (jsvalue->isObject()) {
-        jsvalue = jsvalue->getObject()->defaultValue(state, PreferString);
-        return jsvalue->getString();
+    if (jsvalue.isString())
+        return jsvalue.getString();
+    else if (jsvalue.isNumber())
+        return UString::from(jsvalue.uncheckedGetNumber());
+    else if (jsvalue.isBoolean())
+        return jsvalue.getBoolean() ? "True" : "False";
+    else if (jsvalue.isObject()) {
+        jsvalue = jsvalue.getObject()->defaultValue(state, PreferString);
+        return jsvalue.getString();
     }
 
     return "undefined";
@@ -182,7 +182,7 @@
 
     JSLock lock(false);
 
-    JSValue* scriptExecutionResult = valueByEvaluatingJavaScriptFromString(script);
+    JSValuePtr scriptExecutionResult = valueByEvaluatingJavaScriptFromString(script);
     *result = WebCore::BString(jsValueToString(m_state, scriptExecutionResult)).release();
 
     return S_OK;
@@ -221,7 +221,7 @@
     Identifier identKey(m_state, reinterpret_cast<UChar*>(key), SysStringLen(key));
 
 #if 0
-    JSValue* jsvalue = noValue();
+    JSValuePtr jsvalue = noValue();
     ScopeChain scopeChain = m_state->scopeChain();
     for (ScopeChainIterator it = scopeChain.begin(); it != scopeChain.end() && !jsvalue; ++it)
         jsvalue = (*it)->get(m_state, identKey);
@@ -231,7 +231,7 @@
     return S_OK;
 }
 
-JSValue* WebScriptCallFrame::valueByEvaluatingJavaScriptFromString(BSTR script)
+JSValuePtr WebScriptCallFrame::valueByEvaluatingJavaScriptFromString(BSTR script)
 {
 #if 0
     ExecState* state = m_state;
@@ -240,7 +240,7 @@
     // find "eval"
     JSObject* eval = 0;
     if (state->scopeNode()) {  // "eval" won't work without context (i.e. at global scope)
-        JSValue* v = globObj->get(state, "eval");
+        JSValuePtr v = globObj->get(state, "eval");
         if (v->isObject() && asObject(v)->implementsCall())
             eval = asObject(v);
         else
@@ -248,20 +248,20 @@
             state = globObj->globalExec();
     }
 
-    JSValue* savedException = state->exception();
+    JSValuePtr savedException = state->exception();
     state->clearException();
 
     UString code(reinterpret_cast<UChar*>(script), SysStringLen(script));
 
     // evaluate
-    JSValue* scriptExecutionResult;
+    JSValuePtr scriptExecutionResult;
     if (eval) {
         ArgList args;
         args.append(jsString(state, code));
         scriptExecutionResult = eval->call(state, 0, args);
     } else
         // no "eval", or no context (i.e. global scope) - use global fallback
-        scriptExecutionResult = Interpreter::evaluate(state, UString(), 0, code.data(), code.size(), globObj).value();
+        scriptExecutionResult = JSC::evaluate(state, UString(), 0, code.data(), code.size(), globObj).value();
 
     if (state->hadException())
         scriptExecutionResult = state->exception();    // (may be redundant depending on which eval path was used)
diff --git a/WebKit/win/WebScriptCallFrame.h b/WebKit/win/WebScriptCallFrame.h
index d3cc4f8..d3c3243 100644
--- a/WebKit/win/WebScriptCallFrame.h
+++ b/WebKit/win/WebScriptCallFrame.h
@@ -74,10 +74,10 @@
         /* [out, retval] */ BSTR* value);
 
     // Helper and accessors
-    virtual JSC::JSValue* valueByEvaluatingJavaScriptFromString(BSTR script);
+    virtual JSC::JSValuePtr valueByEvaluatingJavaScriptFromString(BSTR script);
     virtual JSC::ExecState* state() const { return m_state; }
 
-    static JSC::UString jsValueToString(JSC::ExecState*, JSC::JSValue*);
+    static JSC::UString jsValueToString(JSC::ExecState*, JSC::JSValuePtr);
 
 private:
     ULONG m_refCount;
diff --git a/WebKit/win/WebTextRenderer.cpp b/WebKit/win/WebTextRenderer.cpp
index 38fa544..7ff2ff3 100644
--- a/WebKit/win/WebTextRenderer.cpp
+++ b/WebKit/win/WebTextRenderer.cpp
@@ -32,7 +32,9 @@
 #include "WebKitDLL.h"
 
 #include <CoreFoundation/CFString.h>
+#if PLATFORM(CG)
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif
 #include <wtf/RetainPtr.h>
 
 WebTextRenderer* WebTextRenderer::createInstance()
@@ -90,6 +92,8 @@
         return E_FAIL;
 
     RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(fontFilePath), static_cast<CFIndex>(wcslen(fontFilePath))));
+#if PLATFORM(CG)
     wkAddFontsAtPath(string.get());
+#endif
     return S_OK;
 }
diff --git a/WebKit/win/WebURLAuthenticationChallenge.cpp b/WebKit/win/WebURLAuthenticationChallenge.cpp
index e0923d5..7c37501 100644
--- a/WebKit/win/WebURLAuthenticationChallenge.cpp
+++ b/WebKit/win/WebURLAuthenticationChallenge.cpp
@@ -149,9 +149,10 @@
 
     // FIXME: After we change AuthenticationChallenge to use "ResourceHandle" as the abstract "Sender" or "Source of this Auth Challenge", then we'll
     // construct the AuthenticationChallenge with that as obtained from the webSender
-
+#if USE(CFNETWORK)
     m_authenticationChallenge = AuthenticationChallenge(webSpace->protectionSpace(), webCredential->credential(),
                                     previousFailureCount, webResponse->resourceResponse(), webError->resourceError());
+#endif
     return S_OK;
 }
 
diff --git a/WebKit/win/WebURLAuthenticationChallengeSender.cpp b/WebKit/win/WebURLAuthenticationChallengeSender.cpp
index dfd2689..c80e33f 100644
--- a/WebKit/win/WebURLAuthenticationChallengeSender.cpp
+++ b/WebKit/win/WebURLAuthenticationChallengeSender.cpp
@@ -29,6 +29,7 @@
 #include "WebURLAuthenticationChallengeSender.h"
 
 #include "COMPtr.h"
+#include "NotImplemented.h"
 #include "WebKit.h"
 #include "WebURLAuthenticationChallenge.h"
 #include "WebURLCredential.h"
@@ -95,46 +96,6 @@
     return newRef;
 }
 
-// IWebURLAuthenticationChallengeSender -------------------------------------------------------------------
-
-HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::cancelAuthenticationChallenge(
-        /* [in] */ IWebURLAuthenticationChallenge* challenge)
-{
-    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
-    if (!webChallenge)
-        return E_FAIL;
-
-    m_handle->receivedCancellation(webChallenge->authenticationChallenge());
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::continueWithoutCredentialForAuthenticationChallenge(
-        /* [in] */ IWebURLAuthenticationChallenge* challenge)
-{
-    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
-    if (!webChallenge)
-        return E_FAIL;
-
-    m_handle->receivedRequestToContinueWithoutCredential(webChallenge->authenticationChallenge());
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::useCredential(
-        /* [in] */ IWebURLCredential* credential, 
-        /* [in] */ IWebURLAuthenticationChallenge* challenge)
-{
-    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
-    if (!webChallenge)
-        return E_FAIL;
-    
-    COMPtr<WebURLCredential> webCredential;
-    if (!credential || FAILED(credential->QueryInterface(__uuidof(WebURLCredential), (void**)&webCredential)))
-        return E_FAIL;
-
-    m_handle->receivedCredential(webChallenge->authenticationChallenge(), webCredential->credential());
-    return S_OK;
-}
-
 // WebURLAuthenticationChallengeSender ----------------------------------------------------------------
 
 ResourceHandle* WebURLAuthenticationChallengeSender::resourceHandle() const
diff --git a/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp b/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp
new file mode 100644
index 0000000..21f79e0
--- /dev/null
+++ b/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebKitDLL.h"
+#include <initguid.h>
+#include "WebURLAuthenticationChallengeSender.h"
+
+#include "COMPtr.h"
+#include "WebKit.h"
+#include "WebURLAuthenticationChallenge.h"
+#include "WebURLCredential.h"
+
+#pragma warning(push, 0)
+#include <WebCore/ResourceHandle.h>
+#pragma warning(pop)
+
+using namespace WebCore;
+
+// IWebURLAuthenticationChallengeSender -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::cancelAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
+    if (!webChallenge)
+        return E_FAIL;
+
+    m_handle->receivedCancellation(webChallenge->authenticationChallenge());
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::continueWithoutCredentialForAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
+    if (!webChallenge)
+        return E_FAIL;
+
+    m_handle->receivedRequestToContinueWithoutCredential(webChallenge->authenticationChallenge());
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::useCredential(
+        /* [in] */ IWebURLCredential* credential, 
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
+    if (!webChallenge)
+        return E_FAIL;
+    
+    COMPtr<WebURLCredential> webCredential;
+    if (!credential || FAILED(credential->QueryInterface(__uuidof(WebURLCredential), (void**)&webCredential)))
+        return E_FAIL;
+
+    m_handle->receivedCredential(webChallenge->authenticationChallenge(), webCredential->credential());
+    return S_OK;
+}
diff --git a/WebKit/win/WebURLAuthenticationChallengeSenderCurl.cpp b/WebKit/win/WebURLAuthenticationChallengeSenderCurl.cpp
new file mode 100644
index 0000000..2cf9a75
--- /dev/null
+++ b/WebKit/win/WebURLAuthenticationChallengeSenderCurl.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 Brent Fulgham <bfulgham@gmail.com>. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebKitDLL.h"
+#include <initguid.h>
+#include "WebURLAuthenticationChallengeSender.h"
+
+#include "COMPtr.h"
+#include "NotImplemented.h"
+#include "WebKit.h"
+#include "WebURLAuthenticationChallenge.h"
+#include "WebURLCredential.h"
+
+#pragma warning(push, 0)
+#include <WebCore/ResourceHandle.h>
+#pragma warning(pop)
+
+using namespace WebCore;
+
+// IWebURLAuthenticationChallengeSender -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::cancelAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    notImplemented();
+    return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::continueWithoutCredentialForAuthenticationChallenge(
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    notImplemented();
+    return E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::useCredential(
+        /* [in] */ IWebURLCredential* credential, 
+        /* [in] */ IWebURLAuthenticationChallenge* challenge)
+{
+    notImplemented();
+    return E_FAIL;
+}
diff --git a/WebKit/win/WebURLProtectionSpace.cpp b/WebKit/win/WebURLProtectionSpace.cpp
index dc40704..c3d78bb 100644
--- a/WebKit/win/WebURLProtectionSpace.cpp
+++ b/WebKit/win/WebURLProtectionSpace.cpp
@@ -152,14 +152,19 @@
     /* [in] */ BSTR realm, 
     /* [in] */ BSTR authenticationMethod)
 {
+    static BString& webURLProtectionSpaceHTTPBString = *new BString(WebURLProtectionSpaceHTTP);
+    static BString& webURLProtectionSpaceHTTPSBString = *new BString(WebURLProtectionSpaceHTTPS);
+    static BString& webURLProtectionSpaceFTPBString = *new BString(WebURLProtectionSpaceFTP);
+    static BString& webURLProtectionSpaceFTPSBString = *new BString(WebURLProtectionSpaceFTPS);
+
     ProtectionSpaceServerType serverType = ProtectionSpaceServerHTTP;
-    if (BString(protocol) == WebURLProtectionSpaceHTTP)
+    if (BString(protocol) == webURLProtectionSpaceHTTPBString)
         serverType = ProtectionSpaceServerHTTP;
-    else if (BString(protocol) == WebURLProtectionSpaceHTTPS)
+    else if (BString(protocol) == webURLProtectionSpaceHTTPSBString)
         serverType = ProtectionSpaceServerHTTPS;
-    else if (BString(protocol) == WebURLProtectionSpaceFTP)
+    else if (BString(protocol) == webURLProtectionSpaceFTPBString)
         serverType = ProtectionSpaceServerFTP;
-    else if (BString(protocol) == WebURLProtectionSpaceFTPS)
+    else if (BString(protocol) == webURLProtectionSpaceFTPSBString)
         serverType = ProtectionSpaceServerFTPS;
     else
         ASSERT_NOT_REACHED();
@@ -177,14 +182,19 @@
     /* [in] */ BSTR realm, 
     /* [in] */ BSTR authenticationMethod)
 {
+    static BString& webURLProtectionSpaceHTTPProxyBString = *new BString(WebURLProtectionSpaceHTTPProxy);
+    static BString& webURLProtectionSpaceHTTPSProxyBString = *new BString(WebURLProtectionSpaceHTTPSProxy);
+    static BString& webURLProtectionSpaceFTPProxyBString = *new BString(WebURLProtectionSpaceFTPProxy);
+    static BString& webURLProtectionSpaceSOCKSProxyBString = *new BString(WebURLProtectionSpaceSOCKSProxy);
+
     ProtectionSpaceServerType serverType = ProtectionSpaceProxyHTTP;
-    if (BString(proxyType) == WebURLProtectionSpaceHTTPProxy)
+    if (BString(proxyType) == webURLProtectionSpaceHTTPProxyBString)
         serverType = ProtectionSpaceProxyHTTP;
-    else if (BString(proxyType) == WebURLProtectionSpaceHTTPSProxy)
+    else if (BString(proxyType) == webURLProtectionSpaceHTTPSProxyBString)
         serverType = ProtectionSpaceProxyHTTPS;
-    else if (BString(proxyType) == WebURLProtectionSpaceFTPProxy)
+    else if (BString(proxyType) == webURLProtectionSpaceFTPProxyBString)
         serverType = ProtectionSpaceProxyFTP;
-    else if (BString(proxyType) == WebURLProtectionSpaceSOCKSProxy)
+    else if (BString(proxyType) == webURLProtectionSpaceSOCKSProxyBString)
         serverType = ProtectionSpaceProxySOCKS;
     else
         ASSERT_NOT_REACHED();
diff --git a/WebKit/win/WebURLResponse.cpp b/WebKit/win/WebURLResponse.cpp
index 7f2c795..b1f4488 100644
--- a/WebKit/win/WebURLResponse.cpp
+++ b/WebKit/win/WebURLResponse.cpp
@@ -33,7 +33,10 @@
 #include "MarshallingHelpers.h"
 #include "WebLocalizableStrings.h"
 
+#if USE(CFNETWORK)
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif
+
 #include <wtf/platform.h>
 #pragma warning( push, 0 )
 #include <WebCore/BString.h>
@@ -293,7 +296,7 @@
     /* [in] */ int expectedContentLength,
     /* [in] */ BSTR textEncodingName)
 {
-    m_response = ResourceResponse(KURL(url), String(mimeType), expectedContentLength, String(textEncodingName), String());
+    m_response = ResourceResponse(MarshallingHelpers::BSTRToKURL(url), String(mimeType), expectedContentLength, String(textEncodingName), String());
     return S_OK;
 }
 
@@ -360,7 +363,7 @@
 {
     ASSERT(m_response.isHTTP());
 
-    *headerFields = COMPropertyBag<String, CaseFoldingHash>::createInstance(m_response.httpHeaderFields());
+    *headerFields = COMPropertyBag<String, AtomicString, CaseFoldingHash>::createInstance(m_response.httpHeaderFields());
     return S_OK;
 }
 
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 273d626..eb176dc 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -29,6 +29,7 @@
 
 #include "CFDictionaryPropertyBag.h"
 #include "DOMCoreClasses.h"
+#include "MarshallingHelpers.h"
 #include "WebDatabaseManager.h"
 #include "WebDocumentLoader.h"
 #include "WebEditorClient.h"
@@ -67,6 +68,7 @@
 #include <WebCore/EventNames.h>
 #include <WebCore/FileSystem.h>
 #include <WebCore/FocusController.h>
+#include <WebCore/FloatQuad.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameTree.h>
 #include <WebCore/FrameView.h>
@@ -92,6 +94,7 @@
 #include <WebCore/RenderTheme.h>
 #include <WebCore/ResourceHandle.h>
 #include <WebCore/ResourceHandleClient.h>
+#include <WebCore/ScriptValue.h>
 #include <WebCore/ScrollbarTheme.h>
 #include <WebCore/SelectionController.h>
 #include <WebCore/Settings.h>
@@ -124,6 +127,20 @@
 static String osVersion();
 static String webKitVersion();
 
+typedef CFURLCacheRef (*CopySharedURLCacheFunction)();
+
+static HMODULE findCFNetworkModule()
+{
+    if (HMODULE module = GetModuleHandleA("CFNetwork"))
+        return module;
+    return GetModuleHandleA("CFNetwork_debug");
+}
+
+static CopySharedURLCacheFunction findCopySharedURLCacheFunction()
+{
+    return reinterpret_cast<CopySharedURLCacheFunction>(GetProcAddress(findCFNetworkModule(), "CFURLCacheCopySharedURLCache"));
+}
+
 WebView* kit(Page* page)
 {
     return page ? static_cast<WebChromeClient*>(page->chrome()->client())->webView() : 0;
@@ -268,7 +285,6 @@
 , m_useBackForwardList(true)
 , m_userAgentOverridden(false)
 , m_zoomMultiplier(1.0f)
-, m_zoomMultiplierIsTextOnly(true)
 , m_mouseActivated(false)
 , m_dragData(0)
 , m_currentCharacterCode(0)
@@ -283,6 +299,7 @@
 , m_topLevelParent(0)
 , m_deleteBackingStoreTimerActive(false)
 , m_transparent(false)
+, m_selectTrailingWhitespaceEnabled(false)
 {
     JSC::initializeThreading();
 
@@ -366,11 +383,14 @@
     if (s_didSetCacheModel && cacheModel == s_cacheModel)
         return;
 
-#ifdef CFURLCacheCopySharedURLCachePresent
-    RetainPtr<CFURLCacheRef> cfurlCache(AdoptCF, CFURLCacheCopySharedURLCache());
-#else
-    RetainPtr<CFURLCacheRef> cfurlCache = CFURLCacheSharedURLCache();
-#endif
+    // Once we require a newer version of CFNetwork with the CFURLCacheCopySharedURLCache function,
+    // we can call CFURLCacheCopySharedURLCache directly and eliminate copySharedURLCache.
+    static CopySharedURLCacheFunction copySharedURLCache = findCopySharedURLCacheFunction();
+    RetainPtr<CFURLCacheRef> cfurlCache;
+    if (copySharedURLCache)
+        cfurlCache.adoptCF(copySharedURLCache());
+    else
+        cfurlCache = CFURLCacheSharedURLCache();
 
     RetainPtr<CFStringRef> cfurlCacheDirectory(AdoptCF, wkCopyFoundationCacheDirectory());
     if (!cfurlCacheDirectory)
@@ -398,14 +418,12 @@
 
         // 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)
+        else if (memSize >= 512)
             cacheTotalCapacity = 16 * 1024 * 1024; 
 
         cacheMinDeadCapacity = 0;
@@ -432,14 +450,12 @@
 
         // 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)
+        else if (memSize >= 512)
             cacheTotalCapacity = 16 * 1024 * 1024; 
 
         cacheMinDeadCapacity = cacheTotalCapacity / 8;
@@ -486,14 +502,12 @@
         // browsing pattern. Even growth above 128MB can have substantial 
         // value / MB for some content / browsing patterns.)
         if (memSize >= 2048)
-            cacheTotalCapacity = 256 * 1024 * 1024;
-        else if (memSize >= 1536)
-            cacheTotalCapacity = 172 * 1024 * 1024;
-        else if (memSize >= 1024)
             cacheTotalCapacity = 128 * 1024 * 1024;
-        else if (memSize >= 512)
+        else if (memSize >= 1536)
+            cacheTotalCapacity = 96 * 1024 * 1024;
+        else if (memSize >= 1024)
             cacheTotalCapacity = 64 * 1024 * 1024;
-        else if (memSize >= 256)
+        else if (memSize >= 512)
             cacheTotalCapacity = 32 * 1024 * 1024; 
 
         cacheMinDeadCapacity = cacheTotalCapacity / 4;
@@ -805,7 +819,7 @@
         rects.append(*rect);
 }
 
-void WebView::updateBackingStore(FrameView* frameView, HDC dc, bool backingStoreCompletelyDirty)
+void WebView::updateBackingStore(FrameView* frameView, HDC dc, bool backingStoreCompletelyDirty, WindowsToPaint windowsToPaint)
 {
     LOCAL_GDI_COUNTER(0, __FUNCTION__);
 
@@ -835,7 +849,7 @@
         }
 
         for (unsigned i = 0; i < paintRects.size(); ++i)
-            paintIntoBackingStore(frameView, bitmapDC, paintRects[i]);
+            paintIntoBackingStore(frameView, bitmapDC, paintRects[i], windowsToPaint);
 
         if (m_uiDelegatePrivate) {
             COMPtr<IWebUIDelegatePrivate2> uiDelegatePrivate2(Query, m_uiDelegatePrivate);
@@ -870,16 +884,23 @@
     OwnPtr<HRGN> region;
     int regionType = NULLREGION;
     PAINTSTRUCT ps;
+    WindowsToPaint windowsToPaint;
     if (!dc) {
         region.set(CreateRectRgn(0,0,0,0));
         regionType = GetUpdateRgn(m_viewWindow, region.get(), false);
         hdc = BeginPaint(m_viewWindow, &ps);
         rcPaint = ps.rcPaint;
+        // We're painting to the screen, and our child windows can handle
+        // painting themselves to the screen.
+        windowsToPaint = PaintWebViewOnly;
     } else {
         hdc = dc;
         ::GetClientRect(m_viewWindow, &rcPaint);
         if (options & PRF_ERASEBKGND)
             ::FillRect(hdc, &rcPaint, (HBRUSH)GetStockObject(WHITE_BRUSH));
+        // Since we aren't painting to the screen, we want to paint all our
+        // children into the HDC.
+        windowsToPaint = PaintWebViewAndChildren;
     }
 
     HDC bitmapDC = ::CreateCompatibleDC(hdc);
@@ -887,7 +908,7 @@
     ::SelectObject(bitmapDC, m_backingStoreBitmap.get());
 
     // Update our backing store if needed.
-    updateBackingStore(frameView, bitmapDC, backingStoreCompletelyDirty);
+    updateBackingStore(frameView, bitmapDC, backingStoreCompletelyDirty, windowsToPaint);
 
     // Now we blit the updated backing store
     IntRect windowDirtyRect = rcPaint;
@@ -928,7 +949,7 @@
         deleteBackingStoreSoon();
 }
 
-void WebView::paintIntoBackingStore(FrameView* frameView, HDC bitmapDC, const IntRect& dirtyRect)
+void WebView::paintIntoBackingStore(FrameView* frameView, HDC bitmapDC, const IntRect& dirtyRect, WindowsToPaint windowsToPaint)
 {
     LOCAL_GDI_COUNTER(0, __FUNCTION__);
 
@@ -944,14 +965,18 @@
     ::ReleaseDC(m_viewWindow, dc);
 #endif
 
-    FillRect(bitmapDC, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
+    GraphicsContext gc(bitmapDC, m_transparent);
+    gc.setShouldIncludeChildWindows(windowsToPaint == PaintWebViewAndChildren);
+    gc.save();
+    if (m_transparent)
+        gc.clearRect(dirtyRect);
+    else
+        FillRect(bitmapDC, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
     if (frameView && frameView->frame() && frameView->frame()->contentRenderer()) {
-        GraphicsContext gc(bitmapDC, m_transparent);
-        gc.save();
         gc.clip(dirtyRect);
         frameView->paint(&gc, dirtyRect);
-        gc.restore();
     }
+    gc.restore();
 }
 
 void WebView::paintIntoWindow(HDC bitmapDC, HDC windowDC, const IntRect& dirtyRect)
@@ -1053,18 +1078,23 @@
             if (!renderer)
                 return false;
 
-            // Calculate the rect of the first line of the selection (cribbed from -[WebCoreFrameBridge firstRectForDOMRange:]).
+            // Calculate the rect of the first line of the selection (cribbed from -[WebCoreFrameBridge firstRectForDOMRange:],
+            // now Frame::firstRectForRange(), which perhaps this should call).
             int extraWidthToEndOfLine = 0;
 
             InlineBox* startInlineBox;
             int startCaretOffset;
             start.getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset);
-            IntRect startCaretRect = renderer->caretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine);
+            IntRect startCaretRect = renderer->localCaretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine);
+            if (startCaretRect != IntRect())
+                startCaretRect = renderer->localToAbsoluteQuad(FloatRect(startCaretRect)).enclosingBoundingBox();
 
             InlineBox* endInlineBox;
             int endCaretOffset;
             end.getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset);
-            IntRect endCaretRect = renderer->caretRect(endInlineBox, endCaretOffset);
+            IntRect endCaretRect = renderer->localCaretRect(endInlineBox, endCaretOffset);
+            if (endCaretRect != IntRect())
+                endCaretRect = renderer->localToAbsoluteQuad(FloatRect(endCaretRect)).enclosingBoundingBox();
 
             IntRect firstRect;
             if (startCaretRect.y() == endCaretRect.y())
@@ -1586,17 +1616,7 @@
     // IE does not dispatch keypress event for WM_SYSCHAR.
     if (systemKeyDown)
         return frame->eventHandler()->handleAccessKey(keyEvent);
-    if (frame->eventHandler()->keyEvent(keyEvent))
-        return true;
-
-    // Need to scroll the page if space is hit.
-    if (charCode == ' ') {
-        ScrollDirection direction = keyEvent.shiftKey() ? ScrollUp : ScrollDown;
-        if (!frame->eventHandler()->scrollOverflow(direction, ScrollByPage))
-            frame->view()->scroll(direction, ScrollByPage);
-        return true;
-    }
-    return false;
+    return frame->eventHandler()->keyEvent(keyEvent);
 }
 
 bool WebView::inResizer(LPARAM lParam)
@@ -1662,7 +1682,7 @@
 {
     LRESULT lResult = 0;
     LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
-    WebView* webView = reinterpret_cast<WebView*>(longPtr);
+    COMPtr<WebView> webView = reinterpret_cast<WebView*>(longPtr); // hold a ref, since the WebView could go away in an event handler.
     WebFrame* mainFrameImpl = webView ? webView->topLevelFrame() : 0;
     if (!mainFrameImpl || webView->isBeingDestroyed())
         return DefWindowProc(hWnd, message, wParam, lParam);
@@ -1758,7 +1778,7 @@
             COMPtr<IWebUIDelegatePrivate> uiDelegatePrivate;
             if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
                 SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
-                uiDelegatePrivate->webViewReceivedFocus(webView);
+                uiDelegatePrivate->webViewReceivedFocus(webView.get());
 
             FocusController* focusController = webView->page()->focusController();
             if (Frame* frame = focusController->focusedFrame()) {
@@ -1776,7 +1796,7 @@
             HWND newFocusWnd = reinterpret_cast<HWND>(wParam);
             if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
                 SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
-                uiDelegatePrivate->webViewLostFocus(webView, (OLE_HANDLE)(ULONG64)newFocusWnd);
+                uiDelegatePrivate->webViewLostFocus(webView.get(), (OLE_HANDLE)(ULONG64)newFocusWnd);
 
             FocusController* focusController = webView->page()->focusController();
             Frame* frame = focusController->focusedOrMainFrame();
@@ -1852,7 +1872,7 @@
             }
             if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
                 SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate &&
-                SUCCEEDED(uiDelegatePrivate->webViewGetDlgCode(webView, keyCode, &dlgCode)))
+                SUCCEEDED(uiDelegatePrivate->webViewGetDlgCode(webView.get(), keyCode, &dlgCode)))
                 return dlgCode;
             handled = false;
             break;
@@ -2060,7 +2080,8 @@
 
     *canShow = MIMETypeRegistry::isSupportedImageMIMEType(mimeTypeStr) ||
         MIMETypeRegistry::isSupportedNonImageMIMEType(mimeTypeStr) ||
-        PluginInfoStore::supportsMIMEType(mimeTypeStr);
+        PluginInfoStore::supportsMIMEType(mimeTypeStr) ||
+        shouldUseEmbeddedView(mimeTypeStr);
     
     return S_OK;
 }
@@ -2147,6 +2168,7 @@
     sharedPreferences->willAddToWebView();
     m_preferences = sharedPreferences;
 
+    InitializeLoggingChannelsIfNecessary();
     WebKitSetWebDatabasesPathIfNecessary();
     WebKitSetApplicationCachePathIfNecessary();
     
@@ -2497,7 +2519,7 @@
 void WebView::setZoomMultiplier(float multiplier, bool isTextOnly)
 {
     m_zoomMultiplier = multiplier;
-    m_zoomMultiplierIsTextOnly = isTextOnly;
+    m_page->settings()->setZoomsTextOnly(isTextOnly);
     if (Frame* coreFrame = core(m_mainFrame))
         coreFrame->setZoomFactor(multiplier, isTextOnly);
 }
@@ -2518,7 +2540,7 @@
 
 float WebView::zoomMultiplier(bool isTextOnly)
 {
-    if (isTextOnly != m_zoomMultiplierIsTextOnly)
+    if (isTextOnly != m_page->settings()->zoomsTextOnly())
         return 1.0f;
     return m_zoomMultiplier;
 }
@@ -2564,8 +2586,7 @@
     /* [in] */ BSTR url,
     /* [retval][out] */ BSTR* userAgent)
 {
-    String urlStr(url, SysStringLen(url));
-    String userAgentString = this->userAgentForKURL(KURL(urlStr));
+    String userAgentString = userAgentForKURL(MarshallingHelpers::BSTRToKURL(url));
     *userAgent = SysAllocStringLen(userAgentString.characters(), userAgentString.length());
     if (!*userAgent && userAgentString.length())
         return E_OUTOFMEMORY;
@@ -2593,7 +2614,7 @@
 
     if (oldEncoding != encodingName && (!oldEncoding || !encodingName || _tcscmp(oldEncoding, encodingName))) {
         if (Frame* coreFrame = core(m_mainFrame))
-            coreFrame->loader()->reloadAllowingStaleData(String(encodingName, SysStringLen(encodingName)));
+            coreFrame->loader()->reloadWithOverrideEncoding(String(encodingName, SysStringLen(encodingName)));
     }
 
     return S_OK;
@@ -2662,12 +2683,12 @@
     if (!coreFrame)
         return E_FAIL;
 
-    JSC::JSValue* scriptExecutionResult = coreFrame->loader()->executeScript(WebCore::String(script), true);
-    if(!scriptExecutionResult)
+    JSC::JSValuePtr scriptExecutionResult = coreFrame->loader()->executeScript(WebCore::String(script), true).jsValue();
+    if (!scriptExecutionResult)
         return E_FAIL;
-    else if (scriptExecutionResult->isString()) {
+    else if (scriptExecutionResult.isString()) {
         JSLock lock(false);
-        *result = BString(String(scriptExecutionResult->getString()));
+        *result = BString(String(scriptExecutionResult.getString()));
     }
 
     return S_OK;
@@ -2951,7 +2972,7 @@
     WebCore::Frame* frame = m_page->focusController()->focusedOrMainFrame();
 
     if (frame) {
-        IntRect ir = enclosingIntRect(frame->selectionRect());
+        IntRect ir = enclosingIntRect(frame->selectionBounds());
         ir = frame->view()->convertToContainingWindow(ir);
         ir.move(-frame->view()->scrollOffset().width(), -frame->view()->scrollOffset().height());
         rc->left = ir.x();
@@ -3255,7 +3276,7 @@
         /* [in] */ IUnknown* /*sender*/,
         /* [retval][out] */ BOOL* result)
 {
-    bool canGrowMore = canZoomIn(true);
+    bool canGrowMore = canZoomIn(m_page->settings()->zoomsTextOnly());
     *result = canGrowMore ? TRUE : FALSE;
     return S_OK;
 }
@@ -3277,7 +3298,7 @@
 HRESULT STDMETHODCALLTYPE WebView::makeTextLarger( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    return zoomIn(true);
+    return zoomIn(m_page->settings()->zoomsTextOnly());
 }
 
 HRESULT STDMETHODCALLTYPE WebView::zoomPageIn( 
@@ -3298,7 +3319,7 @@
         /* [in] */ IUnknown* /*sender*/,
         /* [retval][out] */ BOOL* result)
 {
-    bool canShrinkMore = canZoomOut(true);
+    bool canShrinkMore = canZoomOut(m_page->settings()->zoomsTextOnly());
     *result = canShrinkMore ? TRUE : FALSE;
     return S_OK;
 }
@@ -3320,7 +3341,7 @@
 HRESULT STDMETHODCALLTYPE WebView::makeTextSmaller( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    return zoomOut(true);
+    return zoomOut(m_page->settings()->zoomsTextOnly());
 }
 
 HRESULT STDMETHODCALLTYPE WebView::zoomPageOut( 
@@ -3341,6 +3362,7 @@
     /* [in] */ IUnknown* /*sender*/,
     /* [retval][out] */ BOOL* result)
 {
+    // Since we always reset text zoom and page zoom together, this should continue to return an answer about text zoom even if its not enabled.
     bool notAlreadyStandard = canResetZoom(true);
     *result = notAlreadyStandard ? TRUE : FALSE;
     return S_OK;
@@ -3487,6 +3509,8 @@
         /* [in] */ BOOL flag)
 {
     m_smartInsertDeleteEnabled = !!flag;
+    if (m_smartInsertDeleteEnabled)
+        setSelectTrailingWhitespaceEnabled(false);
     return S_OK;
 }
     
@@ -3496,7 +3520,23 @@
     *enabled = m_smartInsertDeleteEnabled ? TRUE : FALSE;
     return S_OK;
 }
+ 
+HRESULT STDMETHODCALLTYPE WebView::setSelectTrailingWhitespaceEnabled( 
+        /* [in] */ BOOL flag)
+{
+    m_selectTrailingWhitespaceEnabled = !!flag;
+    if (m_selectTrailingWhitespaceEnabled)
+        setSmartInsertDeleteEnabled(false);
+    return S_OK;
+}
     
+HRESULT STDMETHODCALLTYPE WebView::isSelectTrailingWhitespaceEnabled( 
+        /* [retval][out] */ BOOL* enabled)
+{
+    *enabled = m_selectTrailingWhitespaceEnabled ? TRUE : FALSE;
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebView::setContinuousSpellCheckingEnabled( 
         /* [in] */ BOOL flag)
 {
@@ -3774,8 +3814,7 @@
 HRESULT STDMETHODCALLTYPE WebView::copyURL( 
         /* [in] */ BSTR url)
 {
-    String temp(url, SysStringLen(url));
-    m_page->focusController()->focusedOrMainFrame()->editor()->copyURL(KURL(temp), "");
+    m_page->focusController()->focusedOrMainFrame()->editor()->copyURL(MarshallingHelpers::BSTRToKURL(url), "");
     return S_OK;
 }
 
@@ -4121,6 +4160,11 @@
         return hr;
     settings->setShouldPaintCustomScrollbars(!!enabled);
 
+    hr = preferences->zoomsTextOnly(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setZoomsTextOnly(!!enabled);
+
     settings->setShowsURLsInToolTips(false);
     settings->setForceFTPDirectoryListings(true);
     settings->setDeveloperExtrasEnabled(developerExtrasEnabled());
@@ -4150,6 +4194,16 @@
         return hr;
     settings->setOfflineWebApplicationCacheEnabled(enabled);
 
+    hr = prefsPrivate->databasesEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setDatabasesEnabled(enabled);
+
+    hr = prefsPrivate->localStorageEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setLocalStorageEnabled(enabled);
+
 #if USE(SAFARI_THEME)
     hr = prefsPrivate->shouldPaintNativeControls(&enabled);
     if (FAILED(hr))
@@ -4963,6 +5017,27 @@
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebView::setMediaVolume(float volume)
+{
+    if (!m_page)
+        return E_FAIL;
+
+    m_page->setMediaVolume(volume);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebView::mediaVolume(float* volume)
+{
+    if (!volume)
+        return E_POINTER;
+
+    if (!m_page)
+        return E_FAIL;
+
+    *volume = m_page->mediaVolume();
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebView::setDefersCallbacks(BOOL defersCallbacks)
 {
     if (!m_page)
@@ -4984,6 +5059,23 @@
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebView::globalHistoryItem(IWebHistoryItem** item)
+{
+    if (!item)
+        return E_POINTER;
+
+    if (!m_page)
+        return E_FAIL;
+
+    if (!m_page->globalHistoryItem()) {
+        *item = 0;
+        return S_OK;
+    }
+
+    *item = WebHistoryItem::createInstance(m_page->globalHistoryItem());
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebView::setAlwaysUsesComplexTextCodePath(BOOL complex)
 {
     WebCoreSetAlwaysUsesComplexTextCodePath(complex);
@@ -5000,6 +5092,26 @@
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebView::registerEmbeddedViewMIMEType(BSTR mimeType)
+{
+    if (!mimeType)
+        return E_POINTER;
+
+    if (!m_embeddedViewMIMETypes)
+        m_embeddedViewMIMETypes.set(new HashSet<String>);
+
+    m_embeddedViewMIMETypes->add(String(mimeType, ::SysStringLen(mimeType)));
+    return S_OK;
+}
+
+bool WebView::shouldUseEmbeddedView(const WebCore::String& mimeType) const
+{
+    if (!m_embeddedViewMIMETypes)
+        return false;
+
+    return m_embeddedViewMIMETypes->contains(mimeType);
+}
+
 bool WebView::onGetObject(WPARAM wParam, LPARAM lParam, LRESULT& lResult) const
 {
     lResult = 0;
@@ -5042,6 +5154,12 @@
     return procPtr(hwnd, objectID, riid, ppObject);
 }
 
+HRESULT WebView::setMemoryCacheDelegateCallsEnabled(BOOL enabled)
+{
+    m_page->setMemoryCacheClientCallsEnabled(enabled);
+    return S_OK;
+}
+
 class EnumTextMatches : public IEnumTextMatches
 {
     long m_ref;
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index c64bc59..281defd 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -34,6 +34,7 @@
 #include <WebCore/IntRect.h>
 #include <WebCore/Timer.h>
 #include <WebCore/WindowMessageListener.h>
+#include <wtf/HashSet.h>
 #include <wtf/OwnPtr.h>
 
 class WebFrame;
@@ -390,7 +391,13 @@
     
     virtual HRESULT STDMETHODCALLTYPE smartInsertDeleteEnabled( 
         /* [in] */ BOOL *enabled);
+
+    virtual HRESULT STDMETHODCALLTYPE setSelectTrailingWhitespaceEnabled( 
+        /* [in] */ BOOL flag);
     
+    virtual HRESULT STDMETHODCALLTYPE isSelectTrailingWhitespaceEnabled( 
+        /* [in] */ BOOL *enabled);
+
     virtual HRESULT STDMETHODCALLTYPE setContinuousSpellCheckingEnabled( 
         /* [in] */ BOOL flag);
     
@@ -690,6 +697,9 @@
     virtual HRESULT STDMETHODCALLTYPE defersCallbacks(
         /* [out, retval] */ BOOL* defersCallbacks);
 
+    virtual HRESULT STDMETHODCALLTYPE globalHistoryItem(
+        /* [out, retval] */ IWebHistoryItem** item);
+
     virtual HRESULT STDMETHODCALLTYPE setAlwaysUsesComplexTextCodePath(
         /* [in] */ BOOL complex);
 
@@ -702,7 +712,21 @@
     virtual HRESULT STDMETHODCALLTYPE cookieEnabled(
         /* [out, retval] */ BOOL* enabled);
 
+    virtual HRESULT STDMETHODCALLTYPE setMediaVolume(
+        /* [in] */ float volume);
+
+    virtual HRESULT STDMETHODCALLTYPE mediaVolume(
+        /* [out, retval] */ float* volume);
+
+    virtual HRESULT STDMETHODCALLTYPE registerEmbeddedViewMIMEType( 
+        /* [in] */ BSTR mimeType);
+
+    virtual HRESULT STDMETHODCALLTYPE setMemoryCacheDelegateCallsEnabled( 
+        /* [in] */ BOOL enabled);
+
     // WebView
+    bool shouldUseEmbeddedView(const WebCore::String& mimeType) const;
+
     WebCore::Page* page();
     bool handleMouseEvent(UINT, WPARAM, LPARAM);
     void setMouseActivated(bool flag) { m_mouseActivated = flag; }
@@ -719,13 +743,11 @@
     bool keyPress(WPARAM, LPARAM, bool systemKeyDown = false);
     bool inResizer(LPARAM lParam);
     void paint(HDC, LPARAM);
-    void paintIntoBackingStore(WebCore::FrameView*, HDC bitmapDC, const WebCore::IntRect& dirtyRect);
     void paintIntoWindow(HDC bitmapDC, HDC windowDC, const WebCore::IntRect& dirtyRect);
     bool ensureBackingStore();
     void addToDirtyRegion(const WebCore::IntRect&);
     void addToDirtyRegion(HRGN);
     void scrollBackingStore(WebCore::FrameView*, int dx, int dy, const WebCore::IntRect& scrollViewRect, const WebCore::IntRect& clipRect);
-    void updateBackingStore(WebCore::FrameView*, HDC = 0, bool backingStoreCompletelyDirty = false);
     void deleteBackingStore();
     void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
     void frameRect(RECT* rect);
@@ -802,6 +824,10 @@
     HRESULT resetZoom(bool isTextOnly);
     bool active();
 
+    enum WindowsToPaint { PaintWebViewOnly, PaintWebViewAndChildren };
+    void paintIntoBackingStore(WebCore::FrameView*, HDC bitmapDC, const WebCore::IntRect& dirtyRect, WindowsToPaint);
+    void updateBackingStore(WebCore::FrameView*, HDC = 0, bool backingStoreCompletelyDirty = false, WindowsToPaint = PaintWebViewOnly);
+
 protected:
     HIMC getIMMContext();
     void releaseIMMContext(HIMC);
@@ -849,7 +875,6 @@
     WebCore::String m_userAgentCustom;
     WebCore::String m_userAgentStandard;
     float m_zoomMultiplier;
-    bool m_zoomMultiplierIsTextOnly;
     WebCore::String m_overrideEncoding;
     WebCore::String m_applicationName;
     bool m_mouseActivated;
@@ -862,6 +887,7 @@
     unsigned m_paintCount;
     bool m_hasSpellCheckerDocumentTag;
     bool m_smartInsertDeleteEnabled;
+    bool m_selectTrailingWhitespaceEnabled;
     bool m_didClose;
     bool m_hasCustomDropTarget;
     unsigned m_inIMEComposition;
@@ -877,6 +903,8 @@
     OwnPtr<TRACKMOUSEEVENT> m_mouseOutTracker;
 
     HWND m_topLevelParent;
+
+    OwnPtr<HashSet<WebCore::String> > m_embeddedViewMIMETypes;
 };
 
 #endif
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index beb9f8a..a7212f0 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,268 @@
+2009-01-27  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Dan Bernstein
+
+        Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::savePlatformDataToCachedFrame):
+        (WebCore::FrameLoaderClientWx::transitionToCommittedFromCachedFrame):
+        * WebKitSupport/FrameLoaderClientWx.h:
+
+2009-01-23  Kevin Ollivier  <kevino@theolliviers.com>
+
+        wx build fix, add missing include dir.
+
+        * presets/wxwebkit.bkl:
+
+2009-01-19  Sam Weinig  <sam@webkit.org>
+
+        Rubber-stamped by Gavin Barraclough.
+
+        Remove temporary operator-> from JSValuePtr.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+
+2009-01-14  miggilin  <mr.diggilin@gmail.com>
+
+        Reviewed by Kevin Ollivier.
+
+        Fixing wx compilation for wx 2.9/trunk.
+
+        * WebFrame.cpp:
+        (wxWebFrame::SetPageSource):
+        * WebView.cpp:
+
+2009-01-12  Kevin Ollivier  <kevino@theolliviers.com>
+
+        wx build fix. JSValue* -> JSValuePtr.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+
+2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by George Staikos.
+
+        Build fix for contentsSizeChanged
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::contentsSizeChanged):
+        * WebKitSupport/ChromeClientWx.h:
+
+2008-12-19  miggilin  <mr.diggilin@gmail.com>
+
+        Reviewed by Kevin Ollivier.
+
+        Add Context Menu support to wx bindings.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=22675
+
+        * WebKitSupport/ContextMenuClientWx.cpp:
+        (WebCore::ContextMenuClientWx::contextMenuDestroyed):
+        (WebCore::ContextMenuClientWx::getCustomMenuFromDefaultItems):
+        * WebView.cpp:
+        (wxWebView::OnMouseEvents):
+        (wxWebView::OnContextMenuEvents):
+        (wxWebView::OnMenuSelectEvents):
+        * WebView.h:
+
+
+2008-12-19  Kevin Ollivier  <kevino@theolliviers.com>
+
+        wx build fixes after recent changes.
+
+        * presets/wxwebkit.bkl:
+
+2008-12-18  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - stub out FrameLoaderClient::shouldUseCredentialStorage().
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::shouldUseCredentialStorage):
+        * WebKitSupport/FrameLoaderClientWx.h:
+
+2008-12-18  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by John Sullivan.
+
+        Stub out FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::dispatchDidFirstVisuallyNonEmptyLayout):
+        * WebKitSupport/FrameLoaderClientWx.h:
+
+2008-12-13  Kevin Watters  <kevinwatters@gmail.com>
+
+        Reviewed by Kevin Ollivier.
+
+        Expose findString in wxWebView as FindString.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22458
+
+        * WebView.cpp:
+        (wxWebView::FindString):
+        * WebView.h:
+
+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.
+
+        * WebKitSupport/ChromeClientWx.h:
+        (WebCore::ChromeClientWx::formStateDidChange):
+
+2008-12-02  Kevin Watters  <kevinwatters@gmail.com>
+
+        Reviewed by Kevin Ollivier.
+
+        Add HitTest to wxWebView (and wxWebFrame).
+        
+        https://bugs.webkit.org/show_bug.cgi?id=22459
+
+        * WebFrame.cpp:
+        (wxWebFrame::HitTest):
+        * WebFrame.h:
+        * WebView.cpp:
+        (wxWebView::HitTest):
+        * WebView.h:
+
+2008-11-24  Darin Fisher  <darin@chromium.org>
+
+        Fix bustage.
+
+        http://bugs.webkit.org/show_bug.cgi?id=15643
+
+        * WebKitSupport/EditorClientWx.cpp:
+        (WebCore::EditorClientWx::isSelectTrailingWhitespaceEnabled):
+        * WebKitSupport/EditorClientWx.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
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::updateGlobalHistory): Remove argument.
+        * WebKitSupport/FrameLoaderClientWx.h: Ditto.
+
+2008-11-21  Kevin Watters  <kevinwatters@gmail.com>
+
+        Reviewed by Kevin Ollivier.
+
+        Maintain an EditCommand stack in WebFramePrivate, and expose Undo and
+        Redo in wxWebView.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=22403
+
+        * WebFrame.cpp:
+        (wxWebFrame::wxWebFrame):
+        (wxWebFrame::Undo):
+        (wxWebFrame::Redo):
+        (wxWebFrame::CanUndo):
+        (wxWebFrame::CanRedo):
+        * WebFrame.h:
+        * WebFramePrivate.h: Added.
+        (WebFramePrivate::WebFramePrivate):
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::createWindow):
+        * WebKitSupport/EditCommandWx.h: Added.
+        (EditCommandWx::EditCommandWx):
+        (EditCommandWx::~EditCommandWx):
+        (EditCommandWx::editCommand):
+        * WebKitSupport/EditorClientWx.cpp:
+        (WebCore::EditorClientWx::registerCommandForUndo):
+        (WebCore::EditorClientWx::registerCommandForRedo):
+        (WebCore::EditorClientWx::canUndo):
+        (WebCore::EditorClientWx::canRedo):
+        (WebCore::EditorClientWx::undo):
+        (WebCore::EditorClientWx::redo):
+        * WebKitSupport/EditorClientWx.h:
+        * WebView.cpp:
+        (wxWebView::OnMouseEvents):
+        (wxWebView::OnKeyEvents):
+        * WebViewPrivate.h:
+
+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*.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+
+2008-11-17  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+        
+        Updated for JavaScriptCore renames.
+
+        * presets/wxwebkit.bkl:
+
+2008-11-17  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+        
+        Updated for JavaScriptCore renames.
+
+        * presets/wxwebkit.bkl:
+
+2008-11-17  Geoffrey Garen  <ggaren@apple.com>
+
+        Not reviewed.
+        
+        Try to fix wx build.
+
+        * presets/wxwebkit.bkl:
+
+2008-11-15  Kevin Watters  <kevinwatters@gmail.com>
+
+        Reviewed by Kevin Ollivier.
+
+        Add API for setting transparent webview background.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=22281
+
+        * WebView.cpp:
+        (wxWebView::SetTransparent):
+        (wxWebView::IsTransparent):
+        * WebView.h:
+
+2008-11-11  Cameron Zwarich  <zwarich@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Remove pointless dependencies on the deleted kjs directory.
+
+        * presets/wxwebkit.bkl:
+
+2008-11-08  Kevin Ollivier  <kevino@theolliviers.com>
+
+        wx build fixes after addition of JSCore parser and bycompiler dirs. 
+
+        * presets/wxwebkit.bkl:
+
+2008-11-05  Cameron Zwarich  <zwarich@apple.com>
+
+        Rubber-stamped by Sam Weinig.
+
+        Move more files to the runtime subdirectory of JavaScriptCore.
+
+        * WebFrame.cpp:
+        * WebView.cpp:
+
 2008-10-31  Kevin Ollivier  <kevino@theolliviers.com>
 
         wxMSW build fix. Missing header.
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index b1f03e0..7bfcc5d 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -28,9 +28,11 @@
 #include "Document.h"
 #include "Editor.h"
 #include "Element.h"
+#include "EventHandler.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
+#include "HitTestResult.h"
 #include "HTMLFrameOwnerElement.h"
 #include "markup.h"
 #include "Page.h"
@@ -42,9 +44,10 @@
 #include "FrameLoaderClientWx.h"
 
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include "JSDOMBinding.h"
 #include <runtime/JSValue.h>
-#include <kjs/ustring.h>
+#include <runtime/UString.h>
 
 #include "wx/wxprec.h"
 #ifndef WX_PRECOMP
@@ -53,6 +56,7 @@
 
 #include "WebFrame.h"
 #include "WebView.h"
+#include "WebFramePrivate.h"
 #include "WebViewPrivate.h"
 
 #include <wx/defs.h>
@@ -71,7 +75,7 @@
     m_title(wxEmptyString)
 {
 
-    m_impl = new WebViewPrivate();
+    m_impl = new WebFramePrivate();
  
     WebCore::HTMLFrameOwnerElement* parentFrame = 0;
     
@@ -138,7 +142,7 @@
     if (m_impl->frame && m_impl->frame->loader()) {
         WebCore::FrameLoader* loader = m_impl->frame->loader();
         loader->begin(WebCore::KURL(static_cast<const char*>(baseUrl.mb_str(wxConvUTF8))));
-        loader->write(source);
+        loader->write(static_cast<const WebCore::String>(source));
         loader->end();
     }
 }
@@ -172,13 +176,21 @@
 {
     wxString returnValue = wxEmptyString;
     if (m_impl->frame) {
-        JSC::JSValue* result = m_impl->frame->loader()->executeScript(javascript, true);
+        JSC::JSValuePtr result = m_impl->frame->loader()->executeScript(javascript, true).jsValue();
         if (result)
-            returnValue = wxString(result->toString(m_impl->frame->script()->globalObject()->globalExec()).UTF8String().c_str(), wxConvUTF8);        
+            returnValue = wxString(result.toString(m_impl->frame->script()->globalObject()->globalExec()).UTF8String().c_str(), wxConvUTF8);        
     }
     return returnValue;
 }
 
+bool wxWebFrame::FindString(const wxString& string, bool forward, bool caseSensitive, bool wrapSelection, bool startInSelection)
+{
+    if (m_impl->frame)
+        return m_impl->frame->findString(string, forward, caseSensitive, wrapSelection, startInSelection);
+
+    return false;
+}
+
 void wxWebFrame::LoadURL(const wxString& url)
 {
     if (m_impl->frame && m_impl->frame->loader()) {
@@ -232,6 +244,35 @@
 
     return false;
 }
+
+void wxWebFrame::Undo()
+{
+    if (m_impl->frame && m_impl->frame->editor() && CanUndo())
+        return m_impl->frame->editor()->undo();
+}
+
+void wxWebFrame::Redo()
+{
+    if (m_impl->frame && m_impl->frame->editor() && CanRedo())
+        return m_impl->frame->editor()->redo();
+}
+
+bool wxWebFrame::CanUndo()
+{
+    if (m_impl->frame && m_impl->frame->editor())
+        return m_impl->frame->editor()->canUndo();
+
+    return false;
+}
+
+bool wxWebFrame::CanRedo()
+{
+    if (m_impl->frame && m_impl->frame->editor())
+        return m_impl->frame->editor()->canRedo();
+
+    return false;
+}
+
 bool wxWebFrame::CanIncreaseTextSize() const
 {
     if (m_impl->frame) {
@@ -315,3 +356,21 @@
         m_impl->frame->editor()->paste();
 
 }
+
+wxWebViewDOMElementInfo wxWebFrame::HitTest(const wxPoint& pos) const
+{
+    wxWebViewDOMElementInfo domInfo;
+
+    if (m_impl->frame->view()) {
+        WebCore::HitTestResult result = m_impl->frame->eventHandler()->hitTestResultAtPoint(m_impl->frame->view()->windowToContents(pos), false);
+        if (result.innerNode()) {
+            domInfo.SetLink(result.absoluteLinkURL().string());
+            domInfo.SetText(result.textContent());
+            domInfo.SetImageSrc(result.absoluteImageURL().string());
+            domInfo.SetSelected(result.isSelected());
+        }
+    }
+
+    return domInfo;
+}
+
diff --git a/WebKit/wx/WebFrame.h b/WebKit/wx/WebFrame.h
index a6961eb..5c697d6 100644
--- a/WebKit/wx/WebFrame.h
+++ b/WebKit/wx/WebFrame.h
@@ -33,13 +33,14 @@
     #include "wx/wx.h"
 #endif
 
-class WebViewPrivate;
+class WebFramePrivate;
 class WebViewFrameData;
 class wxWebView;
 
 namespace WebCore {
     class ChromeClientWx;
     class FrameLoaderClientWx;
+    class EditorClientWx;
     class Frame;
 }
 
@@ -57,12 +58,44 @@
 #define WXDLLIMPEXP_WEBKIT
 #endif // SWIG
 
+class WXDLLIMPEXP_WEBKIT wxWebViewDOMElementInfo
+{
+public:
+    wxWebViewDOMElementInfo();
+
+    ~wxWebViewDOMElementInfo() { }
+
+    wxString GetTagName() const { return m_tagName; }
+    void SetTagName(const wxString& name) { m_tagName = name; }
+
+    bool IsSelected() const { return m_isSelected; }
+    void SetSelected(bool sel) { m_isSelected = sel; }
+
+    wxString GetText() const { return m_text; }
+    void SetText(const wxString& text) { m_text = text; }
+
+    wxString GetImageSrc() const { return m_imageSrc; }
+    void SetImageSrc(const wxString& src) { m_imageSrc = src; }
+
+    wxString GetLink() const { return m_link; }
+    void SetLink(const wxString& link) { m_link = link; }
+
+private:
+    void* m_domElement;
+    bool m_isSelected;
+    wxString m_tagName;
+    wxString m_text;
+    wxString m_imageSrc;
+    wxString m_link;
+};
+
 class WXDLLIMPEXP_WEBKIT wxWebFrame
 {
     // ChromeClientWx needs to get the Page* stored by the wxWebView
     // for the createWindow function. 
     friend class WebCore::ChromeClientWx;
     friend class WebCore::FrameLoaderClientWx;
+    friend class WebCore::EditorClientWx;
     friend class wxWebView;
 
     wxWebFrame(wxWebView* container, wxWebFrame* parent = NULL, WebViewFrameData* data = NULL);
@@ -86,6 +119,12 @@
     void Copy();
     void Paste();
     
+    bool CanUndo();
+    bool CanRedo();
+    
+    void Undo();
+    void Redo();
+    
     wxString GetPageSource();
     void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString);
     
@@ -95,6 +134,10 @@
     
     wxString RunScript(const wxString& javascript);
     
+    bool FindString(const wxString& string, bool forward = true,
+        bool caseSensitive = false, bool wrapSelection = true,
+        bool startInSelection = true);
+    
     bool CanIncreaseTextSize() const;
     void IncreaseTextSize();
     bool CanDecreaseTextSize() const;
@@ -106,13 +149,15 @@
     void SetPageTitle(const wxString& title) { m_title = title; }
     
     WebCore::Frame* GetFrame();
+
+    wxWebViewDOMElementInfo HitTest(const wxPoint& post) const;
     
 private:
     float m_textMagnifier;
     bool m_isEditable;
     bool m_isInitialized;
     bool m_beingDestroyed;
-    WebViewPrivate* m_impl;
+    WebFramePrivate* m_impl;
     wxString m_title;
     
 };
diff --git a/WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h b/WebKit/wx/WebFramePrivate.h
similarity index 72%
copy from WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h
copy to WebKit/wx/WebFramePrivate.h
index 3b0ab32..7af70a8 100644
--- a/WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h
+++ b/WebKit/wx/WebFramePrivate.h
@@ -1,18 +1,18 @@
 /*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Kevin Ollivier.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
+ *     notice, this list of conditions and the following disclaimer. 
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
+ *     documentation and/or other materials provided with the distribution. 
  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
+ *     from this software without specific prior written permission. 
  *
  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -25,19 +25,28 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+ 
+#ifndef WXWEBFRAMEPRIVATE_H
+#define WXWEBFRAMEPRIVATE_H
 
-#import <objc/objc-runtime.h>
-#import <WebCore/CachedPagePlatformData.h>
-#import <wtf/RetainPtr.h>
+#include "config.h"
+#include "EditCommand.h"
+#include "EditCommandWx.h"
+#include "Frame.h"
+#include "wtf/RefPtr.h"
+#include "wtf/Vector.h"
 
-class WebCachedPagePlatformData : public WebCore::CachedPagePlatformData {
+class WebFramePrivate {
+
 public:
-    WebCachedPagePlatformData(id webDocumentView) : m_webDocumentView(webDocumentView) { }
-    
-    virtual void clear() { objc_msgSend(m_webDocumentView.get(), @selector(closeIfNotCurrentView)); }
+    WebFramePrivate() :
+            frame(0)
+    {}
 
-    id webDocumentView() { return m_webDocumentView.get(); }
-private:
-    RetainPtr<id> m_webDocumentView;
+    WTF::Vector<EditCommandWx> undoStack;
+    WTF::Vector<EditCommandWx> redoStack;
+    
+    WTF::RefPtr<WebCore::Frame> frame;
 };
 
+#endif
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
index 3d119a5..29fef0e 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -122,7 +122,7 @@
 
         WebViewPrivate* impl = newFrame->webview->m_impl;
         if (impl)
-            myPage = impl->frame->page();
+            myPage = impl->page;
     }
     
     return myPage;
@@ -314,6 +314,11 @@
     return 0;
 }
 
+void ChromeClientWx::contentsSizeChanged(Frame*, const IntSize&) const
+{
+    notImplemented();
+}
+
 void ChromeClientWx::scrollBackingStore(int dx, int dy, 
                     const IntRect& scrollViewRect, 
                     const IntRect& clipRect)
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h
index d90788f..74e0023 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.h
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h
@@ -102,6 +102,7 @@
     virtual IntPoint screenToWindow(const IntPoint&) const;
     virtual IntRect windowToScreen(const IntRect&) const;
     virtual PlatformWidget platformWindow() const;
+    virtual void contentsSizeChanged(Frame*, const IntSize&) const;
 
     virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
 
@@ -113,6 +114,8 @@
 
     virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
 
+    virtual void formStateDidChange(const Node*) { }
+
 private:
     wxWebView* m_webView;
 };
diff --git a/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
index 8f88f1a..e3d8e5a 100644
--- a/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "ContextMenuClientWx.h"
 #include "NotImplemented.h"
+#include "ContextMenu.h"
 #include <stdio.h>
 
 namespace WebCore {
@@ -38,13 +39,12 @@
 
 void ContextMenuClientWx::contextMenuDestroyed()
 {
-    notImplemented();
+    delete this;
 }
 
-PlatformMenuDescription ContextMenuClientWx::getCustomMenuFromDefaultItems(ContextMenu*)
+PlatformMenuDescription ContextMenuClientWx::getCustomMenuFromDefaultItems(ContextMenu* menu)
 {
-    notImplemented();
-    return 0;
+    return menu->releasePlatformDescription();
 }
 
 void ContextMenuClientWx::contextMenuItemSelected(ContextMenuItem*,
diff --git a/WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h b/WebKit/wx/WebKitSupport/EditCommandWx.h
similarity index 73%
copy from WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h
copy to WebKit/wx/WebKitSupport/EditCommandWx.h
index 3b0ab32..e5deedd 100644
--- a/WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h
+++ b/WebKit/wx/WebKitSupport/EditCommandWx.h
@@ -1,18 +1,18 @@
 /*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Kevin Ollivier.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
+ *     notice, this list of conditions and the following disclaimer. 
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
+ *     documentation and/or other materials provided with the distribution. 
  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
+ *     from this software without specific prior written permission. 
  *
  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -25,19 +25,30 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+ 
+#ifndef WXEDITCOMMAND_H
+#define WXEDITCOMMAND_H
 
-#import <objc/objc-runtime.h>
-#import <WebCore/CachedPagePlatformData.h>
-#import <wtf/RetainPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 
-class WebCachedPagePlatformData : public WebCore::CachedPagePlatformData {
+namespace WebCore {
+    class EditCommand;
+}
+
+class EditCommandWx 
+{
 public:
-    WebCachedPagePlatformData(id webDocumentView) : m_webDocumentView(webDocumentView) { }
+    EditCommandWx(WTF::PassRefPtr<WebCore::EditCommand> command) 
+    {
+        m_editCommand = command;
+    }
     
-    virtual void clear() { objc_msgSend(m_webDocumentView.get(), @selector(closeIfNotCurrentView)); }
-
-    id webDocumentView() { return m_webDocumentView.get(); }
+    ~EditCommandWx() {}
+    WTF::PassRefPtr<WebCore::EditCommand> editCommand() { return m_editCommand; }
+    
 private:
-    RetainPtr<id> m_webDocumentView;
+    WTF::RefPtr<WebCore::EditCommand> m_editCommand;
 };
 
+#endif
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.cpp b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
index ade0f41..6c443ed 100644
--- a/WebKit/wx/WebKitSupport/EditorClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
@@ -39,7 +39,11 @@
 #include "PlatformKeyboardEvent.h"
 #include "PlatformString.h"
 #include "SelectionController.h"
+
+#include "WebFrame.h"
+#include "WebFramePrivate.h"
 #include "WebView.h"
+#include "WebViewPrivate.h"
 
 #include <stdio.h>
 
@@ -78,6 +82,12 @@
     return false;
 }
 
+bool EditorClientWx::isSelectTrailingWhitespaceEnabled()
+{
+    notImplemented();
+    return false;
+}
+
 bool EditorClientWx::isContinuousSpellCheckingEnabled()
 {
     notImplemented();
@@ -195,14 +205,28 @@
     notImplemented();
 }
 
-void EditorClientWx::registerCommandForUndo(PassRefPtr<EditCommand>)
+void EditorClientWx::registerCommandForUndo(PassRefPtr<EditCommand> command)
 {
-    notImplemented();
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+    if (frame) {
+        wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+        if (webKitWin) {
+            webKitWin->GetMainFrame()->m_impl->undoStack.append(EditCommandWx(command));
+        }
+    }
 }
 
-void EditorClientWx::registerCommandForRedo(PassRefPtr<EditCommand>)
+void EditorClientWx::registerCommandForRedo(PassRefPtr<EditCommand> command)
 {
-    notImplemented();
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+    if (frame) {
+        wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+        if (webKitWin) {
+            webKitWin->GetMainFrame()->m_impl->redoStack.insert(0, EditCommandWx(command));
+        }
+    }
 }
 
 void EditorClientWx::clearUndoRedoOperations()
@@ -212,24 +236,54 @@
 
 bool EditorClientWx::canUndo() const
 {
-    notImplemented();
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+    if (frame) {
+        wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+        if (webKitWin && webKitWin->GetMainFrame()) {
+            return webKitWin->GetMainFrame()->m_impl->undoStack.size() != 0;
+        }
+    }
     return false;
 }
 
 bool EditorClientWx::canRedo() const
 {
-    notImplemented();
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+    if (frame) {
+        wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+        if (webKitWin && webKitWin->GetMainFrame()) {
+            return webKitWin->GetMainFrame()->m_impl->redoStack.size() != 0;
+        }
+    }
     return false;
 }
 
 void EditorClientWx::undo()
 {
-    notImplemented();
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+    if (frame) {
+        wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+        if (webKitWin && webKitWin->GetMainFrame()) {
+            webKitWin->GetMainFrame()->m_impl->undoStack.last().editCommand()->unapply();
+            webKitWin->GetMainFrame()->m_impl->undoStack.removeLast();
+        }
+    }
 }
 
 void EditorClientWx::redo()
 {
-    notImplemented();
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+    if (frame) {
+        wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+        if (webKitWin && webKitWin->GetMainFrame()) {
+            webKitWin->GetMainFrame()->m_impl->redoStack.first().editCommand()->reapply();
+            webKitWin->GetMainFrame()->m_impl->redoStack.remove(0);
+        }
+    }
 }
 
 void EditorClientWx::handleInputMethodKeydown(KeyboardEvent* event)
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.h b/WebKit/wx/WebKitSupport/EditorClientWx.h
index 51b820c..0f98167 100644
--- a/WebKit/wx/WebKitSupport/EditorClientWx.h
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.h
@@ -31,9 +31,15 @@
 #include "EditorClient.h"
 #include "Page.h"
 
+#include "WebView.h"
+#include "WebFrame.h"
+
 namespace WebCore {
 
 class EditorClientWx : public EditorClient {
+friend class ::wxWebView;
+friend class ::wxWebFrame;
+
 public:
     virtual ~EditorClientWx();
     void setPage(Page*);
@@ -42,6 +48,7 @@
     virtual bool shouldDeleteRange(Range*);
     virtual bool shouldShowDeleteInterface(HTMLElement*);
     virtual bool smartInsertDeleteEnabled();
+    virtual bool isSelectTrailingWhitespaceEnabled();
     virtual bool isContinuousSpellCheckingEnabled();
     virtual void toggleContinuousSpellChecking();
     virtual bool isGrammarCheckingEnabled();
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index 685da65..a34576d 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -227,13 +227,6 @@
     notImplemented();
 }
 
-
-void FrameLoaderClientWx::loadedFromCachedPage()
-{
-    notImplemented();
-}
-
-
 void FrameLoaderClientWx::dispatchDidHandleOnloadEvents()
 {
     if (m_webView) {
@@ -330,6 +323,10 @@
     notImplemented();
 }
 
+void FrameLoaderClientWx::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+    notImplemented();
+}
 
 void FrameLoaderClientWx::dispatchShow()
 {
@@ -529,7 +526,7 @@
     notImplemented();
 }
 
-void FrameLoaderClientWx::updateGlobalHistory(const WebCore::KURL&)
+void FrameLoaderClientWx::updateGlobalHistory()
 {
     notImplemented();
 }
@@ -626,6 +623,12 @@
     notImplemented();
 }
 
+bool FrameLoaderClientWx::shouldUseCredentialStorage(DocumentLoader*, unsigned long)
+{
+    notImplemented();
+    return false;
+}
+
 void FrameLoaderClientWx::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
 {
     notImplemented();
@@ -834,12 +837,12 @@
     notImplemented();
 }
 
-void FrameLoaderClientWx::savePlatformDataToCachedPage(CachedPage*)
+void FrameLoaderClientWx::savePlatformDataToCachedFrame(CachedFrame*)
 { 
     notImplemented();
 }
 
-void FrameLoaderClientWx::transitionToCommittedFromCachedPage(CachedPage*)
+void FrameLoaderClientWx::transitionToCommittedFromCachedFrame(CachedFrame*)
 { 
     notImplemented();
 }
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
index 3b525b1..9ad4ddc 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -90,8 +90,6 @@
         virtual void detachedFromParent2();
         virtual void detachedFromParent3();
 
-        virtual void loadedFromCachedPage();
-
         virtual void frameLoaderDestroyed();
         virtual bool canHandleRequest(const ResourceRequest&) const;
 
@@ -108,6 +106,7 @@
         virtual void dispatchDidFinishDocumentLoad();
         virtual void dispatchDidFinishLoad();
         virtual void dispatchDidFirstLayout();
+        virtual void dispatchDidFirstVisuallyNonEmptyLayout();
 
         virtual void dispatchShow();
         virtual void cancelPolicyCheck();
@@ -145,11 +144,11 @@
 
         virtual String userAgent(const 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 void updateGlobalHistory(const KURL&);
+        virtual void updateGlobalHistory();
         virtual bool shouldGoToHistoryItem(HistoryItem*) const;
         virtual void saveScrollPositionAndViewStateToItem(HistoryItem*);
         virtual bool canCachePage() const;
@@ -169,6 +168,7 @@
         virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
         
         virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&);
+        virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier);
         virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
         virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
         virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&);
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
index fb2164f..6ed8aef 100644
--- a/WebKit/wx/WebView.cpp
+++ b/WebKit/wx/WebView.cpp
@@ -37,6 +37,9 @@
 #include "Logging.h"
 #include "markup.h"
 #include "Page.h"
+#include "ContextMenu.h"
+#include "ContextMenuItem.h"
+#include "ContextMenuController.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformMouseEvent.h"
 #include "PlatformString.h"
@@ -57,7 +60,7 @@
 #include "ScriptController.h"
 #include "JSDOMBinding.h"
 #include <runtime/JSValue.h>
-#include <kjs/ustring.h>
+#include <runtime/UString.h>
 
 #include "wx/wxprec.h"
 #ifndef WX_PRECOMP
@@ -70,6 +73,7 @@
 
 #include <wx/defs.h>
 #include <wx/dcbuffer.h>
+#include <wx/dcgraph.h>
 
 #if defined(_MSC_VER)
 int rint(double val)
@@ -172,6 +176,8 @@
     EVT_PAINT(wxWebView::OnPaint)
     EVT_SIZE(wxWebView::OnSize)
     EVT_MOUSE_EVENTS(wxWebView::OnMouseEvents)
+    EVT_CONTEXT_MENU(wxWebView::OnContextMenuEvents)
+    EVT_MENU(wxID_ANY, wxWebView::OnMenuSelectEvents)
     EVT_KEY_DOWN(wxWebView::OnKeyEvents)
     EVT_KEY_UP(wxWebView::OnKeyEvents)
     EVT_CHAR(wxWebView::OnKeyEvents)
@@ -312,6 +318,30 @@
     return wxEmptyString;
 }
 
+void wxWebView::SetTransparent(bool transparent)
+{
+    WebCore::Frame* frame = 0;
+    if (m_mainFrame)
+        frame = m_mainFrame->GetFrame();
+    
+    if (!frame || !frame->view())
+        return;
+
+    frame->view()->setTransparent(transparent);
+}
+
+bool wxWebView::IsTransparent() const
+{
+    WebCore::Frame* frame = 0;
+    if (m_mainFrame)
+        frame = m_mainFrame->GetFrame();
+
+   if (!frame || !frame->view())
+        return false;
+
+    return frame->view()->isTransparent();
+}
+
 wxString wxWebView::RunScript(const wxString& javascript)
 {
     if (m_mainFrame)
@@ -439,6 +469,14 @@
     }
 }
 
+bool wxWebView::FindString(const wxString& string, bool forward, bool caseSensitive, bool wrapSelection, bool startInSelection)
+{
+    if (m_mainFrame)
+        return m_mainFrame->FindString(string, forward, caseSensitive, wrapSelection, startInSelection);
+
+    return false;
+}
+
 void wxWebView::OnSize(wxSizeEvent& event)
 { 
     if (m_isInitialized && m_mainFrame) {
@@ -474,17 +512,60 @@
     
     WebCore::PlatformMouseEvent wkEvent(event, globalPoint);
 
-    if (type == wxEVT_LEFT_DOWN || type == wxEVT_MIDDLE_DOWN || type == wxEVT_RIGHT_DOWN)
+    if (type == wxEVT_LEFT_DOWN || type == wxEVT_MIDDLE_DOWN || type == wxEVT_RIGHT_DOWN || 
+                type == wxEVT_LEFT_DCLICK || type == wxEVT_MIDDLE_DCLICK || type == wxEVT_RIGHT_DCLICK)
         frame->eventHandler()->handleMousePressEvent(wkEvent);
     
-    else if (type == wxEVT_LEFT_UP || type == wxEVT_MIDDLE_UP || type == wxEVT_RIGHT_UP || 
-                type == wxEVT_LEFT_DCLICK || type == wxEVT_MIDDLE_DCLICK || type == wxEVT_RIGHT_DCLICK)
+    else if (type == wxEVT_LEFT_UP || type == wxEVT_MIDDLE_UP || type == wxEVT_RIGHT_UP)
         frame->eventHandler()->handleMouseReleaseEvent(wkEvent);
 
     else if (type == wxEVT_MOTION)
         frame->eventHandler()->mouseMoved(wkEvent);
 }
 
+void wxWebView::OnContextMenuEvents(wxContextMenuEvent& event)
+{
+    m_impl->page->contextMenuController()->clearContextMenu();
+    wxPoint localEventPoint = ScreenToClient(event.GetPosition());
+
+    if (!m_mainFrame)
+        return;
+        
+    WebCore::Frame* focusedFrame = m_mainFrame->GetFrame();
+    if (!focusedFrame->view())
+        return;
+
+    //Create WebCore mouse event from the wxContextMenuEvent
+    wxMouseEvent mouseEvent(wxEVT_RIGHT_DOWN);
+    mouseEvent.m_x = localEventPoint.x;
+    mouseEvent.m_y = localEventPoint.y;
+    WebCore::PlatformMouseEvent wkEvent(mouseEvent, event.GetPosition());
+
+    bool handledEvent = focusedFrame->eventHandler()->sendContextMenuEvent(wkEvent);
+    if (!handledEvent)
+        return;
+
+    WebCore::ContextMenu* coreMenu = m_impl->page->contextMenuController()->contextMenu();
+    if (!coreMenu)
+        return;
+
+    WebCore::PlatformMenuDescription menuWx = coreMenu->platformDescription();
+    if (!menuWx)
+        return;
+
+    PopupMenu(menuWx, localEventPoint);
+}
+
+void wxWebView::OnMenuSelectEvents(wxCommandEvent& event)
+{
+    WebCore::ContextMenuItem* item = WebCore::ContextMenu::itemWithId (event.GetId());
+    if (!item)
+        return;
+
+    m_impl->page->contextMenuController()->contextMenuItemSelected(item);
+    delete item;
+}
+
 bool wxWebView::CanCopy()
 {
     if (m_mainFrame)
@@ -538,13 +619,24 @@
         // WebCore doesn't handle these events itself, so we need to do
         // it and not send the event down or else CTRL+C will erase the text
         // and replace it with c.
-        if (event.CmdDown() && event.GetKeyCode() == static_cast<int>('C'))
-            Copy();
-        else if (event.CmdDown() && event.GetKeyCode() == static_cast<int>('X'))
-            Cut();
-        else if (event.CmdDown() && event.GetKeyCode() == static_cast<int>('V'))
-            Paste();
-        else {    
+        if (event.CmdDown() && event.GetEventType() == wxEVT_KEY_UP) {
+            if (event.GetKeyCode() == static_cast<int>('C'))
+                Copy();
+            else if (event.GetKeyCode() == static_cast<int>('X'))
+                Cut();
+            else if (event.GetKeyCode() == static_cast<int>('V'))
+                Paste();
+            else if (event.GetKeyCode() == static_cast<int>('Z')) {
+                if (event.ShiftDown()) {
+                    if (m_mainFrame->CanRedo())
+                        m_mainFrame->Redo();
+                }
+                else {
+                    if (m_mainFrame->CanUndo())
+                        m_mainFrame->Undo();
+                }
+            }
+        } else {    
             WebCore::PlatformKeyboardEvent wkEvent(event);
             if (wkEvent.type() == WebCore::PlatformKeyboardEvent::Char && wkEvent.altKey())
                 frame->eventHandler()->handleAccessKey(wkEvent);
@@ -592,3 +684,12 @@
 
     event.Skip();
 }
+
+wxWebViewDOMElementInfo wxWebView::HitTest(const wxPoint& pos) const
+{
+    if (m_mainFrame)
+        return m_mainFrame->HitTest(pos);
+
+    return wxWebViewDOMElementInfo();
+}
+
diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h
index b8fce63..387d193 100644
--- a/WebKit/wx/WebView.h
+++ b/WebKit/wx/WebView.h
@@ -33,6 +33,8 @@
     #include "wx/wx.h"
 #endif
 
+#include "WebFrame.h"
+
 class WebViewPrivate;
 class WebViewFrameData;
 class wxWebFrame;
@@ -118,7 +120,14 @@
     wxString GetAsMarkup();
     wxString GetExternalRepresentation();
     
+    void SetTransparent(bool transparent);
+    bool IsTransparent() const;
+    
     wxString RunScript(const wxString& javascript);
+
+    bool FindString(const wxString& string, bool forward = true,
+        bool caseSensitive = false, bool wrapSelection = true,
+        bool startInSelection = true);
     
     bool CanIncreaseTextSize() const;
     void IncreaseTextSize();
@@ -132,12 +141,16 @@
     
     wxWebFrame* GetMainFrame() { return m_mainFrame; }
 
+    wxWebViewDOMElementInfo HitTest(const wxPoint& post) const;
+
 protected:
 
     // event handlers (these functions should _not_ be virtual)
     void OnPaint(wxPaintEvent& event);
     void OnSize(wxSizeEvent& event);
     void OnMouseEvents(wxMouseEvent& event);
+    void OnContextMenuEvents(wxContextMenuEvent& event);
+    void OnMenuSelectEvents(wxCommandEvent& event);
     void OnKeyEvents(wxKeyEvent& event);
     void OnSetFocus(wxFocusEvent& event);
     void OnKillFocus(wxFocusEvent& event);
@@ -185,37 +198,6 @@
     wxWEBVIEW_NAV_OTHER = 32
 };
 
-class WXDLLIMPEXP_WEBKIT wxWebViewDOMElementInfo
-{
-public: 
-    wxWebViewDOMElementInfo();
-
-    ~wxWebViewDOMElementInfo() { }
-    
-    wxString GetTagName() const { return m_tagName; }
-    void SetTagName(const wxString& name) { m_tagName = name; }
-
-    bool IsSelected() const { return m_isSelected; }
-    void SetSelected(bool sel) { m_isSelected = sel; }
- 
-    wxString GetText() const { return m_text; }
-    void SetText(const wxString& text) { m_text = text; }
- 
-    wxString GetImageSrc() const { return m_imageSrc; }
-    void SetImageSrc(const wxString& src) { m_imageSrc = src; }
- 
-    wxString GetLink() const { return m_link; }
-    void SetLink(const wxString& link) { m_link = link; }
-
-private:
-    void* m_domElement;
-    bool m_isSelected;
-    wxString m_tagName;
-    wxString m_text;
-    wxString m_imageSrc;
-    wxString m_link;
-};
-
 class WXDLLIMPEXP_WEBKIT wxWebViewBeforeLoadEvent : public wxCommandEvent
 {
 #ifndef SWIG
diff --git a/WebKit/wx/WebViewPrivate.h b/WebKit/wx/WebViewPrivate.h
index 2eef499..9ad8a3e 100644
--- a/WebKit/wx/WebViewPrivate.h
+++ b/WebKit/wx/WebViewPrivate.h
@@ -29,10 +29,9 @@
 #ifndef WXWEBVIEWPRIVATE_H
 #define WXWEBVIEWPRIVATE_H
 
-
 #include "config.h"
-#include "Frame.h"
-#include "FrameView.h"
+#include "HTMLFrameOwnerElement.h"
+#include "Page.h"
 #include "wtf/RefPtr.h"
 #include "KURL.h"
 
@@ -40,11 +39,9 @@
 {
 public:
     WebViewPrivate() :
-        frame(0),
         page(0)
     {}
     
-    WTF::RefPtr<WebCore::Frame> frame;
     WebCore::Page* page;
 };
 
diff --git a/WebKit/wx/presets/wxwebkit.bkl b/WebKit/wx/presets/wxwebkit.bkl
index 80ffd2f..df21c67 100644
--- a/WebKit/wx/presets/wxwebkit.bkl
+++ b/WebKit/wx/presets/wxwebkit.bkl
@@ -116,8 +116,11 @@
         <include>$(WK_ROOT)/WebCore/loader</include>
         <include>$(WK_ROOT)/WebCore/loader/icon</include>
         <include>$(WK_ROOT)/WebCore/page</include>
+        <include>$(WK_ROOT)/WebCore/page/animation</include>
         <include>$(WK_ROOT)/WebCore/platform</include>
+        <include>$(WK_ROOT)/WebCore/platform/animation</include>
         <include>$(WK_ROOT)/WebCore/platform/graphics</include>
+        <include>$(WK_ROOT)/WebCore/platform/graphics/transforms</include>
         <include>$(WK_ROOT)/WebCore/platform/image-decoders</include>
         <include>$(WK_ROOT)/WebCore/platform/image-decoders/gif</include>
         <include>$(WK_ROOT)/WebCore/platform/image-decoders/jpeg</include>
@@ -133,11 +136,14 @@
         <include>$(WK_ROOT)/WebCore/xml</include>
         
         <include>$(WK_ROOT)/JavaScriptCore</include>
-        <include>$(WK_ROOT)/JavaScriptCore/kjs</include>
+        <include>$(WK_ROOT)/JavaScriptCore/bytecode</include>
+        <include>$(WK_ROOT)/JavaScriptCore/bytecompiler</include>
+        <include>$(WK_ROOT)/JavaScriptCore/jit</include>
+        <include>$(WK_ROOT)/JavaScriptCore/parser</include>
         <include>$(WK_ROOT)/JavaScriptCore/pcre</include>
         <include>$(WK_ROOT)/JavaScriptCore/profiler</include>
         <include>$(WK_ROOT)/JavaScriptCore/runtime</include>
-        <include>$(WK_ROOT)/JavaScriptCore/VM</include>
+        <include>$(WK_ROOT)/JavaScriptCore/interpreter</include>
         <include>$(WK_ROOT)/JavaScriptCore/wtf</include>
     </template>