[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:27:46 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8b7072972d71ee0fb7f32d6f7078b20186fbfcba
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 27 04:38:09 2004 +0000

    Tests:
    
    	Made Blot support the 'nmsg' event that Safari sends for the "Mail Page" and "Mail Page Address" feature.
    
            Reviewed by NOBODY (OOPS!).
    
            * Blot/BlotApp.m:
            (-[BlotApp awakeFromNib]):
            (-[BlotApp handleURLEvent:withReplyEvent:]):
            (-[BlotApp handleNewMessageEvent:withReplyEvent:]):
            * Blot/BlotDocument.h:
            * Blot/BlotDocument.m:
            (-[BlotDocument setSubject:]):
            (-[BlotDocument webView:didFinishLoadForFrame:]):
            (-[BlotDocument loadPropertyList:]):
            * Blot/English.lproj/BlotDocument.nib:
            * Blot/Info.plist:
    
    WebKit:
    
    	WebKit side of:
    	<rdar://problem/3056566>: mail a link to this page
    	<rdar://problem/2961206>: implement ability to e-mail entire page
    
            Reviewed by john.
    
            * English.lproj/StringsNotToBeLocalized.txt:
            * Misc.subproj/WebIconDatabase.m:
            (-[WebIconDatabase _createFileDatabase]): tweaks
            (-[WebIconDatabase _loadIconDictionaries]): fixed an assertion failure I found in Blot. Keep the original list of icon URLs as a separate list when doing the initial clean-up so we don't over release any icons.
            (-[WebIconDatabase _updateFileDatabase]): tweaks
            (-[WebIconDatabase _setIcon:forIconURL:]): tweaks
            (-[WebIconDatabase _releaseIconForIconURLString:]): tweaks
            (-[WebIconDatabase _retainOriginalIconsOnDisk]): use the original list of icons on disk instead of the current list
            (-[WebIconDatabase _releaseOriginalIconsOnDisk]): use the original list of icons on disk instead of the current list
            * Misc.subproj/WebIconDatabasePrivate.h:
            * WebKit.exp:
            * WebKit.pbproj/project.pbxproj:
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource _propertyListWithData:subresourceURLStrings:]): new, code moved from [WebHTMLView _selectedPropertyList:], creates property list rep of data and subresources
            (-[WebDataSource propertyList]): does the above with all the data source data, this is what "Mail Page" uses
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebFrame.m:
            (-[WebFrame loadPropertyList:]): renamed from loadHTMLPropertyList because the property list may contain non-HTML data
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView _selectedPropertyList:]): renamed, code moved to [WebDataSource _propertyListWithData:subresourceURLStrings:]
            (-[WebHTMLView _writeSelectionToPasteboard:]): call renamed _selectedPropertyList
    
    WebBrowser:
    
    	Fixed:
    	<rdar://problem/3056566>: mail a link to this page
    	<rdar://problem/2961206>: implement ability to e-mail entire page
    
    	The above work with Blot if you have that installed and will work with Mail once Mail supports it.
    
            Reviewed by john.
    
            * BrowserDocument.m:
            (-[BrowserDocument validateUserInterfaceItem:]): handle mailPage and mailPageAddress
            (-[BrowserDocument _mailPropertyList:]): new, takes a WebKit property list and sends it to your Mail app if it supports it
            (-[BrowserDocument mailPage:]): calls _mailPropertyList with [WebDataSource propertyList]
            (-[BrowserDocument mailPageAddress:]): calls _mailPropertyList with boiler plate HTML
            * BrowserNSWorkspaceExtras.h:
            * BrowserNSWorkspaceExtras.m:
            (-[NSWorkspace launchApplicationAtPath:processSerialNumber:makeFrontmost:alreadyOpen:event:]): rearranged the arguments a little for aesthetic reasons
            * English.lproj/Localizable.strings:
            * English.lproj/MainMenu.nib: added "Mail Page" and "Mail Page Address" to the File menu
            * English.lproj/StringsNotToBeLocalized.txt:
            * Preferences.subproj/AdvancedPreferences.m:
            (-[AdvancedPreferences openProxyPreferences:]): call renamed launchApplicationAtPath:::::
            * WebBrowser.pbproj/project.pbxproj:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9a926df..77a6848 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,34 @@
+2004-02-26  Chris Blumenberg  <cblu at apple.com>
+
+	WebKit side of:
+	<rdar://problem/3056566>: mail a link to this page
+	<rdar://problem/2961206>: implement ability to e-mail entire page
+
+        Reviewed by john.
+
+        * English.lproj/StringsNotToBeLocalized.txt:
+        * Misc.subproj/WebIconDatabase.m:
+        (-[WebIconDatabase _createFileDatabase]): tweaks
+        (-[WebIconDatabase _loadIconDictionaries]): fixed an assertion failure I found in Blot. Keep the original list of icon URLs as a separate list when doing the initial clean-up so we don't over release any icons.
+        (-[WebIconDatabase _updateFileDatabase]): tweaks
+        (-[WebIconDatabase _setIcon:forIconURL:]): tweaks
+        (-[WebIconDatabase _releaseIconForIconURLString:]): tweaks
+        (-[WebIconDatabase _retainOriginalIconsOnDisk]): use the original list of icons on disk instead of the current list
+        (-[WebIconDatabase _releaseOriginalIconsOnDisk]): use the original list of icons on disk instead of the current list
+        * Misc.subproj/WebIconDatabasePrivate.h:
+        * WebKit.exp:
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource _propertyListWithData:subresourceURLStrings:]): new, code moved from [WebHTMLView _selectedPropertyList:], creates property list rep of data and subresources
+        (-[WebDataSource propertyList]): does the above with all the data source data, this is what "Mail Page" uses
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame loadPropertyList:]): renamed from loadHTMLPropertyList because the property list may contain non-HTML data
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView _selectedPropertyList:]): renamed, code moved to [WebDataSource _propertyListWithData:subresourceURLStrings:]
+        (-[WebHTMLView _writeSelectionToPasteboard:]): call renamed _selectedPropertyList
+
 2004-02-26  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by Chris
@@ -1269,6 +1300,7 @@
 
         * WebView.subproj/WebTextView.m:
         (-[WebTextView setFixedWidthFont]): Use [[WebTextRendererFactory sharedFactory] fontWithFamilies:traits:size:] to get the font since it takes the font family which is what we store in WebPreferences and it does fallback work. Only set the font if 
+
 non-nil is returned.
 
 2003-11-21  Maciej Stachowiak  <mjs at apple.com>
@@ -1824,6 +1856,7 @@ non-nil is returned.
 
         * WebView.subproj/WebTextView.m:
         (-[WebTextView menuForEvent:]): Made WebTextView's context menu behavior like WebHTMLView's context menu behavior with regards to selection. If the control-click was on a selection, show menu options for the selection like copy. If it was not on a
+
  selection, show menu options such as save and print. Don't select anything when control-clicking.
 
 2003-11-08  Chris Blumenberg  <cblu at apple.com>
@@ -2284,6 +2317,7 @@ non-nil is returned.
 
         * WebView.subproj/WebFrame.m:
         (-[WebFrame _isLoadComplete]): call _progressCompleted after we deliver the didFailLoadWithError or didFinishLoadForFrame message as we do in other places. This allows to be aware of the error (if there is one), when they get the WebViewProgressFi
+
 nishedNotification notification.
 
 2003-10-27  Maciej Stachowiak  <mjs at apple.com>
@@ -2403,6 +2437,7 @@ nishedNotification notification.
 
         * WebView.subproj/WebView.m:
 	(+[WebView _viewClass:andRepresentationClass:forMIMEType:]): use _web_objectForMIMEType when getting an object for a MIME. Removed unnecessary code that checked for the document classes after loading the plug-in DB since it is not an optimization because
+
  the plug-in DB calls _viewTypesAllowImageTypeOmission:NO.
 
 2003-10-23  Chris Blumenberg  <cblu at apple.com>
@@ -2425,6 +2460,7 @@ nishedNotification notification.
         (+[WebFrameView _viewClassForMIMEType:]): call [WebView _viewClass:andRepresentationClass:forMIMEType:]
         * WebView.subproj/WebView.m:
 	(+[WebView _viewClass:andRepresentationClass:forMIMEType:]): new, central place for mapping from a MIME to the document classes. We now load the plug-in DB when a non-HTML MIME type is encountered instead of loading the plug-in DB when the class for the 
+
 MIME type is not found. This is required to fully fix 3364036.
         (+[WebView canShowMIMEType:]): call [WebView _viewClass:andRepresentationClass:forMIMEType:]
         (+[WebView registerViewClass:representationClass:forMIMEType:]): tweak
@@ -2559,6 +2595,7 @@ MIME type is not found. This is required to fully fix 3364036.
 
         * Plugins.subproj/WebPluginDatabase.m:
         (-[WebPluginDatabase pluginForExtension:]): If no plug-in is found from the extension, attempt to map from the extension to a MIME type using our mappings and find a plug-in from the MIME type. This improves our chances of finding a plug-in when n
+
 o MIME type is specified.
         * WebCoreSupport.subproj/WebBridge.m:
 	(-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): If the passed MIME is empty, nil it out so that clients only need to check for nil. This avoids error sheets complaining about "" MIME types.
@@ -3231,6 +3268,7 @@ o MIME type is specified.
 2003-09-30  Richard Williamson   <rjw at apple.com>
 
 	Fixed 3420396.  If a frame targets _top and a URL that contains a fragment (very unusual, it's meaningless for a frameset to contain a named anchor point) the frameset won't be reloaded.  Our normal path is to just scroll to the anchor point.  This is on
+
 ly important because our Help folks oddly depend on the behavior.
 
         Reviewed by Chris.
@@ -3764,7 +3802,9 @@ ly important because our Help folks oddly depend on the behavior.
 	Fixed: <rdar://problem/3412380>: REGRESSION (85-98): www.minoltan.com is decoded incorrectly on Japanese system
 
 	The default encoding that Safari uses is latin1 regardless of the current system encoding. This is how it's always been. The problem is that the UI is displaying shift JIS for the default text encoding instead of latin1. This is happening because WebKit 
+
 is using "latin1" instead of "ISO-8859-1" for the default text encoding name. "ISO-8859-1" is the IANA character set name for latin1 and this is what the  WebKitDefaultTextEncodingNamePreferenceKey preference expects. This ends up confusing Safari, so Saf
+
 ari just ends up displaying the first item in the pop-up menu which is shift JIS.
 
         Reviewed by rjw.
@@ -3963,6 +4003,7 @@ ari just ends up displaying the first item in the pop-up menu which is shift JIS
 2003-08-29  Richard Williamson   <rjw at apple.com>
 
 	Fixed 3400807.  Don't release state associated with the current b/f item.  We shouldn't normally have page cache state associated with the current item (3401376).  This fix guarantees that we won't prematurely release the page cache state for the current
+
  item.
 
         Reviewed byJohn Sullivan.
@@ -4000,6 +4041,7 @@ ari just ends up displaying the first item in the pop-up menu which is shift JIS
 2003-08-27  Richard Williamson   <rjw at apple.com>
 
 	Fixed 3398229.  When we request a font from NSFont by name we should use a case specific name.  We do case insensitve comparsion, but once a match is found we should use the actual font name, not the requested name.  Two layout tests are still failing, b
+
 ut I don't think the failures are font related.
 
         Reviewed by Hyatt.
@@ -5956,6 +5998,7 @@ ut I don't think the failures are font related.
         (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): this method covers the regular load case. This is where we need to stop the load, set the load type and the provisional data source. Code was in _prepareForProvisionalLoadWithData
 
 
+
 Source::
         (-[WebFrame _loadDataSource:withLoadType:formState:]): set the policyLoadType and policyDataSource (the beginning of the regular load case)
 
@@ -5988,6 +6031,7 @@ Source::
         (-[WebFrame _loadDataSource:withLoadType:formState:]): don't call stopLoading, _setLoadType and _setProvisionalDataSource, since that stops the frame even for command-click and option-click. Do this work in _prepareForProvisionalLoadWithDataSource
 
 
+
 :loadType: instead.
 
 2003-06-10  Richard Williamson   <rjw at apple.com>
@@ -6256,9 +6300,11 @@ Source::
 	The problem happens when you call NPP_SetWindow with a 0 width or height more than once. The first call to NPP_SetWindow always seems to have width and height set to 0, but the next call sometimes has it set to the correct values (those in the EMBED tag)
 
 
+
 . This is when it draws successfully. It seems to me that the fix is to always pass the correct width and height to NPP_SetWindow. You always position the plug-in far offscreen (1000000, -52) and set the clip region to an empty rect (48576, 52, 48576, 52)
 
 
+
  so there isn't really any danger of the plug-in drawing anyway. Additionally, you pass the correct width and height in the call to NPP_New before the first call to NPP_SetWindow.
 
         Reviewed by john, darin.
@@ -12204,6 +12250,7 @@ Source::
 
 
 
+
 is to retain the incomplete data even though the load ends in error.
 
         Reviewed by darin.
@@ -12269,6 +12316,7 @@ is to retain the incomplete data even though the load ends in error.
 
 
 
+
 e machinery in WebKit. The stream is only delivered once. This fix addresses that.
 
         Reviewed by trey.
@@ -12735,6 +12783,7 @@ e machinery in WebKit. The stream is only delivered once. This fix addresses tha
 
 
 
+
 t leak when we cancel a download.
         (-[WebDownload _setRequest:]): added
         (-[WebDownload _setResponse:]): added
@@ -12875,6 +12924,7 @@ t leak when we cancel a download.
 
 
 
+
 l.
         * Downloads.subproj/WebDownload.m:
         (-[WebDownloadPrivate dealloc]): release directory path
@@ -16677,6 +16727,7 @@ l.
 
 
 
+
 ts each with 60 timeouts. The event also cause the Finder to do a lot of work.
 
 	We should:
@@ -16700,6 +16751,7 @@ ts each with 60 timeouts. The event also cause the Finder to do a lot of work.
 
 
 
+
 nds 2 apple events both with a 60 second timeout. This method returns immediately.
         * WebKit.pbproj/project.pbxproj:
 
@@ -17334,6 +17386,7 @@ nds 2 apple events both with a 60 second timeout. This method returns immediatel
 
 
 
+
 en't providing the declared data. 
 
         * Misc.subproj/WebNSPasteboardExtras.h:
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index d74609a..c2c3966 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -58,6 +58,7 @@
 "ATSUSetLayoutControls failed(%d)"
 "ATSUSetTransientFontMatching failed(%d)"
 "Apple Chancery"
+"Apple Web Kit pasteboard type"
 "AppleFontSmoothing"
 "AppleKeyboardUIMode"
 "BP_CreatePluginMIMETypesPreferences"
@@ -97,11 +98,9 @@
 "Library/Internet Plug-Ins"
 "List count: %d items\n"
 "List total size: %d bytes\n"
+"LoginWindowDidSwitchFromUserNotification"
+"LoginWindowDidSwitchToUserNotification"
 "Lucida Grande"
-"Mozilla/4.0 (compatible; MSIE 5.2; Mac_PowerPC) AppleWebKit/%@ %@"
-"Mozilla/4.0 (compatible; MSIE 5.2; Mac_PowerPC) AppleWebKit/%@"
-"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT) AppleWebKit/%@ %@"
-"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT) AppleWebKit/%@"
 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko) %@"
 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko)"
 "NP_GetEntryPoints"
@@ -117,6 +116,7 @@
 "Papyrus"
 "Set-Cookie"
 "Times"
+"UTF-8"
 "UseBackForwardList"
 "WebActionButtonKey"
 "WebActionElementKey"
@@ -128,7 +128,6 @@
 "WebCurrentFrameState"
 "WebDataRequest"
 "WebElementFrame"
-"WebElementHTMLString"
 "WebElementImage"
 "WebElementImageAltString"
 "WebElementImageRect"
@@ -198,6 +197,7 @@
 "WebKitTabToLinksPreferenceKey"
 "WebKitUserStyleSheetEnabledPreferenceKey"
 "WebKitUserStyleSheetLocationPreferenceKey"
+"WebMainResource"
 "WebMethodNotYetImplemented"
 "WebModalDialogPretendWindow"
 "WebPageCacheDataSourceKey"
@@ -220,8 +220,13 @@
 "WebProgressEstimateChangedNotification"
 "WebProgressFinishedNotification"
 "WebProgressStartedNotification"
+"WebResourceData"
+"WebResourceMIMEType"
+"WebResourceTextEncodingName"
+"WebResourceURL"
 "WebRuntimeError"
 "WebSiteURLToIconURLKey"
+"WebSubresources"
 "WebURLsWithTitlesPboardType"
 "\""
 "\"@?"
@@ -296,7 +301,6 @@
 "visitCount"
 "x"
 "x-apple-web-kit/"
-"xn--"
 "~/Library/Icons"
 History.subproj/WebHistoryItem.m:" in \"%@\""
 History.subproj/WebHistoryItem.m:"children"
diff --git a/WebKit/Misc.subproj/WebIconDatabase.m b/WebKit/Misc.subproj/WebIconDatabase.m
index 282b829..ff1e287 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.m
+++ b/WebKit/Misc.subproj/WebIconDatabase.m
@@ -228,7 +228,7 @@ NSSize WebIconLargeSize = {128, 128};
         [[NSUserDefaults standardUserDefaults] setObject:databaseDirectory forKey:WebIconDatabaseDirectoryDefaultsKey];
     }
     databaseDirectory = [databaseDirectory stringByExpandingTildeInPath];
-
+    
     _private->fileDatabase = [[WebFileDatabase alloc] initWithPath:databaseDirectory];
     [_private->fileDatabase setSizeLimit:20000000];
     [_private->fileDatabase open];
@@ -292,9 +292,9 @@ NSSize WebIconLargeSize = {128, 128};
     }
 
     if (v == WebIconDatabaseCurrentVersion) {
-	_private->iconsOnDiskWithURLs = 	[fileDB objectForKey:WebIconsOnDiskKey];
-	_private->URLToIconURL = 		[fileDB objectForKey:WebURLToIconURLKey];
-	_private->iconURLToURLs = 	[fileDB objectForKey:WebIconURLToURLsKey];
+        _private->iconsOnDiskWithURLs = 	[fileDB objectForKey:WebIconsOnDiskKey];
+        _private->URLToIconURL = 		[fileDB objectForKey:WebURLToIconURLKey];
+        _private->iconURLToURLs = 	[fileDB objectForKey:WebIconURLToURLsKey];
     }
 
     if (![self _iconDictionariesAreGood]) {
@@ -303,6 +303,7 @@ NSSize WebIconLargeSize = {128, 128};
         _private->iconURLToURLs = 	[NSMutableDictionary dictionary];
     }
 
+    _private->originalIconsOnDiskWithURLs = [_private->iconsOnDiskWithURLs copy];
     [_private->iconsOnDiskWithURLs retain];
     [_private->iconURLToURLs retain];
     [_private->URLToIconURL retain];
@@ -337,7 +338,7 @@ NSSize WebIconLargeSize = {128, 128};
 
     while ((iconURLString = [enumerator nextObject]) != nil) {
         NSMutableDictionary *icons = [_private->iconURLToIcons objectForKey:iconURLString];
-        if(icons){
+        if (icons) {
             // Save the 16 x 16 size icons as this is the only size the Safari uses.
             // If we ever use larger sizes, we should save the largest size so icons look better when scaling up.
             // This also worksaround the problem with cnet's blank 32x32 icon (3105486).
@@ -347,15 +348,15 @@ NSSize WebIconLargeSize = {128, 128};
                 icon = [self _largestIconFromDictionary:icons];
             }
             NSData *iconData = [icon TIFFRepresentation];
-            if(iconData){
+            if (iconData) {
                 //NSLog(@"Writing icon: %@", iconURLString);
                 [fileDB setObject:iconData forKey:iconURLString];
                 [_private->iconsOnDiskWithURLs addObject:iconURLString];
             }
         } else if ([_private->iconURLsWithNoIcons containsObject:iconURLString]) {
-	    [fileDB setObject:[NSNull null] forKey:iconURLString];
-	    [_private->iconsOnDiskWithURLs addObject:iconURLString];
-	}
+            [fileDB setObject:[NSNull null] forKey:iconURLString];
+            [_private->iconsOnDiskWithURLs addObject:iconURLString];
+        }
     }
     
     [_private->iconsToEraseWithURLs removeAllObjects];
@@ -461,7 +462,7 @@ NSSize WebIconLargeSize = {128, 128};
     
     NSMutableDictionary *icons = [self _iconsBySplittingRepresentationsOfIcon:icon];
 
-    if(!icons){
+    if (!icons) {
         return;
     }
 
@@ -560,7 +561,7 @@ NSSize WebIconLargeSize = {128, 128};
     int newRetainCount = [retainCount intValue] - 1;
     [_private->iconURLToRetainCount setObject:[NSNumber numberWithInt:newRetainCount] forKey:iconURLString];
 
-    if(newRetainCount == 0){
+    if (newRetainCount == 0) {
         
         if([_private->iconsOnDiskWithURLs containsObject:iconURLString]){
             [_private->iconsToEraseWithURLs addObject:iconURLString];
@@ -571,7 +572,7 @@ NSSize WebIconLargeSize = {128, 128};
         [_private->iconURLToIcons removeObjectForKey:iconURLString];
 
         // Remove negative cache item for icon, if any
-	[_private->iconURLsWithNoIcons removeObject:iconURLString];
+        [_private->iconURLsWithNoIcons removeObject:iconURLString];
 
         // Remove the icon's retain count
         [_private->iconURLToRetainCount removeObjectForKey:iconURLString];
@@ -623,11 +624,8 @@ NSSize WebIconLargeSize = {128, 128};
 
 - (void)_retainOriginalIconsOnDisk
 {
-    NSEnumerator *enumerator;
+    NSEnumerator *enumerator = [_private->originalIconsOnDiskWithURLs objectEnumerator];;
     NSString *iconURLString;
-
-    enumerator = [_private->iconsOnDiskWithURLs objectEnumerator];
-
     while ((iconURLString = [enumerator nextObject]) != nil) {
         [self _retainIconForIconURLString:iconURLString];
     }
@@ -635,17 +633,19 @@ NSSize WebIconLargeSize = {128, 128};
 
 - (void)_releaseOriginalIconsOnDisk
 {
-    if(_private->cleanupCount > 0){
+    if (_private->cleanupCount > 0) {
         _private->waitingToCleanup = YES;
         return;
     }
 
-    NSEnumerator *enumerator = [_private->iconsOnDiskWithURLs objectEnumerator];
+    NSEnumerator *enumerator = [_private->originalIconsOnDiskWithURLs objectEnumerator];
     NSString *iconURLString;
-
     while ((iconURLString = [enumerator nextObject]) != nil) {
         [self _releaseIconForIconURLString:iconURLString];
     }
+    
+    [_private->originalIconsOnDiskWithURLs release];
+    _private->originalIconsOnDiskWithURLs = nil;
 
     _private->didCleanup = YES;
 }
diff --git a/WebKit/Misc.subproj/WebIconDatabasePrivate.h b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
index 7b5e368..44a719a 100644
--- a/WebKit/Misc.subproj/WebIconDatabasePrivate.h
+++ b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
@@ -27,6 +27,7 @@
     NSMutableSet *iconsToEraseWithURLs;
     NSMutableSet *iconsToSaveWithURLs;
     NSMutableSet *iconURLsWithNoIcons;
+    NSMutableSet *originalIconsOnDiskWithURLs;
     
     int cleanupCount;
 
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index e41413c..e80fd73 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -19,6 +19,7 @@
 .objc_class_name_WebKitStatistics
 .objc_class_name_WebPreferences
 .objc_class_name_WebRenderNode
+.objc_class_name_WebResource
 .objc_class_name_WebStringTruncator
 .objc_class_name_WebTextView
 .objc_class_name_WebURLsWithTitles
@@ -62,6 +63,7 @@ _WebKitErrorPlugInNameKey
 _WebKitErrorPlugInPageURLStringKey
 _WebLocalizedString
 _WebLog
+_WebMainResourceKey
 _WebReportArgumentAssertionFailure
 _WebReportAssertionFailure
 _WebReportAssertionFailureWithMessage
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index f8f0f1d..76702fa 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -1071,6 +1071,9 @@
 			fileRef = 39446072020F50ED0ECA1767;
 			isa = PBXBuildFile;
 			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
 			};
 		};
 		39446091020F50ED0ECA1767 = {
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index cdb2956..0ee6c7c 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -104,6 +104,46 @@
     }
 }
 
+- (id)_propertyListWithData:(NSData *)data subresourceURLStrings:(NSArray *)subresourceURLStrings
+{
+    NSMutableDictionary *propertyList = [NSMutableDictionary dictionary];
+    WebResource *resource = [[WebResource alloc] initWithData:data
+                                                          URL:[_private->response URL] 
+                                                     MIMEType:[_private->response MIMEType]
+                                             textEncodingName:[self _isDocumentHTML] ? @"UTF-8" : [_private->response textEncodingName]];
+    [propertyList setObject:[resource _propertyListRepresentation] forKey:WebMainResourceKey];
+    [resource release];
+    
+    NSEnumerator *enumerator = [subresourceURLStrings objectEnumerator];
+    NSMutableArray *subresources = [[NSMutableArray alloc] init];
+    NSString *URLString;
+    while ((URLString = [enumerator nextObject]) != nil) {
+        resource = [_private->subresources objectForKey:URLString];
+        if (resource) {
+            [subresources addObject:[resource _propertyListRepresentation]];
+        } else {
+            ERROR("Failed to copy subresource because data source does not have subresource for %@", URLString);
+        }
+    }
+    
+    if ([subresources count] > 0) {
+        [propertyList setObject:subresources forKey:WebSubresourcesKey];
+    }
+    
+    [subresources release];
+    
+    return propertyList;
+}
+
+- (id)propertyList
+{
+    if ([self isLoading] || [_private->resourceData length] == 0) {
+        return nil;
+    }
+    NSData *data = [self _isDocumentHTML] ? [[[self _bridge] HTMLString:nil] dataUsingEncoding:NSUTF8StringEncoding] : _private->resourceData;
+    return [self _propertyListWithData:data subresourceURLStrings:[_private->subresources allKeys]];
+}
+
 - (WebView *)_webView
 {
     return _private->webView;
@@ -844,7 +884,6 @@
     return [WebView canShowMIMETypeAsHTML:MIMEType];
 }
 
-
 @end
 
 @implementation WebDataSource
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 7eab448..0cea152 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -120,6 +120,9 @@
 - (WebResource *)subresourceForURL:(NSURL *)URL;
 - (void)addSubresource:(WebResource *)subresource;
 - (void)addSubresources:(NSArray *)subresources;
+- (id)propertyList;
+
+- (id)_propertyListWithData:(NSData *)data subresourceURLStrings:(NSArray *)subresourceURLStrings;
 
 - (NSError *)_mainDocumentError;
 - (NSString *)_stringWithData:(NSData *)data;
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index c0cfd63..3516cda 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -256,10 +256,10 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
 
 @implementation WebFrame (WebPrivate)
 
-- (void)loadHTMLPropertyList:(id)HTMLPropertyList
+- (void)loadPropertyList:(id)propertyList
 {
-    if ([HTMLPropertyList isKindOfClass:[NSDictionary class]]) {
-        NSDictionary *resourcePropertyList = [HTMLPropertyList objectForKey:WebMainResourceKey];
+    if ([propertyList isKindOfClass:[NSDictionary class]]) {
+        NSDictionary *resourcePropertyList = [propertyList objectForKey:WebMainResourceKey];
         if (resourcePropertyList) {
             WebResource *resource = [[WebResource alloc] _initWithPropertyList:resourcePropertyList];
             if (resource) {
@@ -267,7 +267,8 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
                                                             MIMEType:[resource MIMEType]
                                                     textEncodingName:[resource textEncodingName]
                                                              baseURL:[resource URL]];
-                NSArray *subresourcePropertyLists = [HTMLPropertyList objectForKey:WebSubresourcesKey];
+                [resource release];
+                NSArray *subresourcePropertyLists = [propertyList objectForKey:WebSubresourcesKey];
                 [self _loadRequest:request subresources:subresourcePropertyLists ? [WebResource _resourcesFromPropertyLists:subresourcePropertyLists] : nil];
             }
         }
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 45028df..d8e64b4 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -116,7 +116,7 @@ extern NSString *WebPageCacheDocumentViewKey;
 @interface WebFrame (WebPrivate)
 
 // API Considerations:
-- (void)loadHTMLPropertyList:(id)HTMLPropertyList;
+- (void)loadPropertyList:(id)HTMLPropertyList;
 
 - (NSURLRequest *)_webDataRequestForData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL;
 - (void)_loadRequest:(NSURLRequest *)request subresources:(NSArray *)subresources;
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 2331bb1..f626d23 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -519,41 +519,12 @@ static WebHTMLView *lastHitView = nil;
     return [NSArray arrayWithObjects:WebHTMLPboardType, NSHTMLPboardType, NSRTFPboardType, NSRTFDPboardType, NSStringPboardType, nil];
 }
 
-- (NSDictionary *)_selectedHTMLPropertyList:(NSString **)HTMLString
+- (id)_selectedPropertyList:(NSString **)HTMLString
 {
     NSArray *subresourceURLStrings;
     *HTMLString = [[self _bridge] selectedHTMLString:&subresourceURLStrings];
-    NSMutableDictionary *HTMLPropertyList = [NSMutableDictionary dictionary];
-
-    WebDataSource *dataSource = [self _dataSource];
-    NSURLResponse *response = [dataSource response];
-    WebResource *resource = [[WebResource alloc] initWithData:[*HTMLString dataUsingEncoding:NSUTF8StringEncoding] 
-                                                          URL:[response URL] 
-                                                     MIMEType:[response MIMEType]
-                                             textEncodingName:[response textEncodingName]];
-    [HTMLPropertyList setObject:[resource _propertyListRepresentation] forKey:WebMainResourceKey];
-    [resource release];
-    
-    NSEnumerator *enumerator = [subresourceURLStrings objectEnumerator];
-    NSMutableArray *subresources = [[NSMutableArray alloc] init];
-    NSString *URLString;
-    while ((URLString = [enumerator nextObject]) != nil) {
-        NSURL *URL = [NSURL _web_URLWithDataAsString:URLString];
-        resource = [dataSource subresourceForURL:URL];
-        if (resource) {
-            [subresources addObject:[resource _propertyListRepresentation]];
-        } else {
-            ERROR("Failed to copy subresource because data source does not have subresource for %@", URLString);
-        }
-    }
-    
-    if ([subresources count] > 0) {
-        [HTMLPropertyList setObject:subresources forKey:WebSubresourcesKey];
-    }
-    
-    [subresources release];
-    
-    return HTMLPropertyList;
+    return [[self _dataSource] _propertyListWithData:[*HTMLString dataUsingEncoding:NSUTF8StringEncoding]  
+                               subresourceURLStrings:subresourceURLStrings];
 }
 
 - (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard
@@ -562,7 +533,7 @@ static WebHTMLView *lastHitView = nil;
 
     // Put HTML on the pasteboard.
     NSString *HTMLString;
-    NSDictionary *HTMLPropertyList = [self _selectedHTMLPropertyList:&HTMLString];
+    NSDictionary *HTMLPropertyList = [self _selectedPropertyList:&HTMLString];
     [pasteboard setString:HTMLString forType:NSHTMLPboardType];
     [pasteboard setPropertyList:HTMLPropertyList forType:WebHTMLPboardType];
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list