[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:48:24 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 7455a6cbc4950bac945a309d66f4a4f19d60b278
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jul 24 01:38:55 2003 +0000
Fixed 3311725: Added support for key/value binding.
(As a side effect also made icon loading work! In 1.0
it doesn't work unless a secret preference value is set.)
Reviewed by Ken.
* Misc.subproj/WebIconDatabase.m:
(-[WebIconDatabase _createFileDatabase]):
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _startLoading:]):
(-[WebDataSource _setTitle:]):
(-[WebDataSource _updateIconDatabaseWithURL:]):
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _transitionToCommitted:]):
(-[WebFrame _isLoadComplete]):
* WebView.subproj/WebView.m:
(-[WebView setMainFrameURL:]):
(-[WebView mainFrameURL]):
(-[WebView isLoading]):
(-[WebView mainFrameTitle]):
(-[WebView mainFrameIcon]):
* WebView.subproj/WebViewPrivate.h:
* WebView.subproj/WebViewPrivate.m:
(-[WebView _progressStarted]):
(-[WebView _progressCompleted]):
(-[WebView _incrementProgressForConnection:data:]):
(-[WebView _completeProgressForConnection:]):
(-[WebView _declaredKeys]):
(-[WebView setObservationInfo:]):
(-[WebView observationInfo]):
(-[WebView _willChangeBackForwardKeys]):
(-[WebView _didChangeBackForwardKeys]):
(-[WebView _didStartProvisionalLoadForFrame:]):
(-[WebView _didCommitLoadForFrame:]):
(-[WebView _didFinishLoadForFrame:]):
(-[WebView _didFailLoadWithError:forFrame:]):
(-[WebView _didFailProvisionalLoadWithError:forFrame:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 881183e..7ff09ac 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,45 @@
2003-07-23 Richard Williamson <rjw at apple.com>
+ Fixed 3311725: Added support for key/value binding.
+ (As a side effect also made icon loading work! In 1.0
+ it doesn't work unless a secret preference value is set.)
+
+ Reviewed by Ken.
+
+ * Misc.subproj/WebIconDatabase.m:
+ (-[WebIconDatabase _createFileDatabase]):
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _startLoading:]):
+ (-[WebDataSource _setTitle:]):
+ (-[WebDataSource _updateIconDatabaseWithURL:]):
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _transitionToCommitted:]):
+ (-[WebFrame _isLoadComplete]):
+ * WebView.subproj/WebView.m:
+ (-[WebView setMainFrameURL:]):
+ (-[WebView mainFrameURL]):
+ (-[WebView isLoading]):
+ (-[WebView mainFrameTitle]):
+ (-[WebView mainFrameIcon]):
+ * WebView.subproj/WebViewPrivate.h:
+ * WebView.subproj/WebViewPrivate.m:
+ (-[WebView _progressStarted]):
+ (-[WebView _progressCompleted]):
+ (-[WebView _incrementProgressForConnection:data:]):
+ (-[WebView _completeProgressForConnection:]):
+ (-[WebView _declaredKeys]):
+ (-[WebView setObservationInfo:]):
+ (-[WebView observationInfo]):
+ (-[WebView _willChangeBackForwardKeys]):
+ (-[WebView _didChangeBackForwardKeys]):
+ (-[WebView _didStartProvisionalLoadForFrame:]):
+ (-[WebView _didCommitLoadForFrame:]):
+ (-[WebView _didFinishLoadForFrame:]):
+ (-[WebView _didFailLoadWithError:forFrame:]):
+ (-[WebView _didFailProvisionalLoadWithError:forFrame:]):
+
+2003-07-23 Richard Williamson <rjw at apple.com>
+
Fixed 3341119: Crash when content contains nil (0x0) characters.
Reviewed by Ken.
diff --git a/WebKit/Misc.subproj/WebIconDatabase.m b/WebKit/Misc.subproj/WebIconDatabase.m
index a16ea06..c5a89fd 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.m
+++ b/WebKit/Misc.subproj/WebIconDatabase.m
@@ -224,7 +224,8 @@ NSSize WebIconLargeSize = {128, 128};
NSString *databaseDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebIconDatabaseDirectoryDefaultsKey];
if (!databaseDirectory) {
- return;
+ databaseDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Icons"];
+ [[NSUserDefaults standardUserDefaults] setObject:databaseDirectory forKey:WebIconDatabaseDirectoryDefaultsKey];
}
_private->fileDatabase = [[WebFileDatabase alloc] initWithPath:databaseDirectory];
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index dcdbb8a..0079b2e 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -180,6 +180,7 @@
[_private->webView _progressStarted];
+ [_private->webView _didStartProvisionalLoadForFrame:[self webFrame]];
[[_private->webView _frameLoadDelegateForwarder] webView:_private->webView
didStartProvisionalLoadForFrame:[self webFrame]];
@@ -300,8 +301,10 @@
if (!trimmed || [trimmed length] == 0)
return;
+ [_private->webView willChangeValueForKey: _WebMainFrameTitleKey];
[_private->pageTitle release];
_private->pageTitle = [trimmed copy];
+ [_private->webView didChangeValueForKey: _WebMainFrameTitleKey];
// The title doesn't get communicated to the WebView until we are committed.
if (_private->committed) {
@@ -605,10 +608,17 @@
[iconDB _setIconURL:[iconURL absoluteString] forURL:[[self _URL] absoluteString]];
[iconDB _setIconURL:[iconURL absoluteString] forURL:[[[self _originalRequest] URL] absoluteString]];
+
+ if ([self webFrame] == [_private->webView mainFrame])
+ [_private->webView willChangeValueForKey:_WebMainFrameIconKey];
+
NSImage *icon = [iconDB iconForURL:[[self _URL] absoluteString] withSize:WebIconSmallSize];
[[_private->webView _frameLoadDelegateForwarder] webView:_private->webView
didReceiveIcon:icon
forFrame:[self webFrame]];
+
+ if ([self webFrame] == [_private->webView mainFrame])
+ [_private->webView didChangeValueForKey:_WebMainFrameIconKey];
}
- (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iconLoader
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 4f3205f..55c60ca 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -713,6 +713,7 @@ NSString *WebCorePageCacheStateKey = @"WebCorePageCacheState";
// Tell the client we've committed this URL.
ASSERT([[self frameView] documentView] != nil);
+ [[self webView] _didCommitLoadForFrame: self];
[[[self webView] _frameLoadDelegateForwarder] webView:_private->webView didCommitLoadForFrame:self];
// If we have a title let the WebView know about it.
@@ -919,6 +920,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
if (![pd isLoading]) {
LOG(Loading, "%@: checking complete in WebFrameStateProvisional, load done", [self name]);
+ [[self webView] _didFailProvisionalLoadWithError:[pd _mainDocumentError] forFrame:self];
[[[self webView] _frameLoadDelegateForwarder] webView:_private->webView
didFailProvisionalLoadWithError:[pd _mainDocumentError]
forFrame:self];
@@ -1003,10 +1005,12 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
[[self webView] _progressCompleted];
if ([ds _mainDocumentError]) {
+ [[self webView] _didFailLoadWithError:[ds _mainDocumentError] forFrame:self];
[[[self webView] _frameLoadDelegateForwarder] webView:_private->webView
didFailLoadWithError:[ds _mainDocumentError]
forFrame:self];
} else {
+ [[self webView] _didFinishLoadForFrame:self];
[[[self webView] _frameLoadDelegateForwarder] webView:_private->webView
didFinishLoadForFrame:self];
}
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index d7e8a86..ad02be7 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -16,6 +16,7 @@
#import <WebKit/WebHistoryItem.h>
#import <WebKit/WebHistoryItemPrivate.h>
#import <WebKit/WebHTMLView.h>
+#import <WebKit/WebIconDatabase.h>
#import <WebKit/WebKitErrors.h>
#import <WebKit/WebKitStatisticsPrivate.h>
#import <WebKit/WebNSPasteboardExtras.h>
@@ -783,3 +784,38 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
@end
+
+
+ at implementation WebView (WebPendingPublic)
+
+- (void)setMainFrameURL:(NSString *)URLString
+{
+ [[self mainFrame] loadRequest: [NSURLRequest requestWithURL: [NSURL URLWithString: URLString]]];
+}
+
+- (NSString *)mainFrameURL
+{
+ WebDataSource *ds;
+ ds = [[self mainFrame] provisionalDataSource];
+ if (!ds)
+ ds = [[self mainFrame] dataSource];
+ return [[[ds request] URL] absoluteString];
+}
+
+- (BOOL)isLoading
+{
+ return [[[self mainFrame] dataSource] isLoading];
+}
+
+- (NSString *)mainFrameTitle
+{
+ NSString *mainFrameTitle = [[[self mainFrame] dataSource] pageTitle];
+ return (mainFrameTitle != nil) ? mainFrameTitle : @"";
+}
+
+- (NSImage *)mainFrameIcon
+{
+ return [[WebIconDatabase sharedIconDatabase] iconForURL:[[[[self mainFrame] dataSource] _URL] absoluteString] withSize:WebIconSmallSize];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 72a67b2..5bc7c49 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -28,6 +28,14 @@ typedef struct _WebResourceDelegateImplementationCache {
uint delegateImplementsIdentifierForRequest:1;
} WebResourceDelegateImplementationCache;
+extern NSString *_WebCanGoBackKey;
+extern NSString *_WebCanGoForwardKey;
+extern NSString *_WebEstimatedProgressKey;
+extern NSString *_WebIsLoadingKey;
+extern NSString *_WebMainFrameIconKey;
+extern NSString *_WebMainFrameTitleKey;
+extern NSString *_WebMainFrameURLKey;
+
@interface WebViewPrivate : NSObject
{
@public
@@ -76,9 +84,21 @@ typedef struct _WebResourceDelegateImplementationCache {
int numProgressTrackedFrames;
NSMutableDictionary *progressItems;
+
+ void *observationInfo;
}
@end
+ at interface WebView (WebPendingPublic)
+
+- (void)setMainFrameURL:(NSString *)URLString;
+- (NSString *)mainFrameURL;
+- (BOOL)isLoading;
+- (NSString *)mainFrameTitle;
+- (NSImage *)mainFrameIcon;
+
+ at end
+
@interface WebView (WebPrivate)
/*!
@@ -217,6 +237,12 @@ Could be worth adding to the API.
- (void)_incrementProgressForConnection:(NSURLConnection *)con data:(NSData *)dataSource;
- (void)_completeProgressForConnection:(NSURLConnection *)con;
+- (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame;
+- (void)_didCommitLoadForFrame:(WebFrame *)frame;
+- (void)_didFinishLoadForFrame:(WebFrame *)frame;
+- (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
+- (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
+
@end
@interface _WebSafeForwarder : NSObject
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 62ee4aa..f8c1aaf 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -39,6 +39,14 @@
static NSMutableSet *schemesWithRepresentationsSet;
+NSString *_WebCanGoBackKey = @"canGoBack";
+NSString *_WebCanGoForwardKey = @"canGoForward";
+NSString *_WebEstimatedProgressKey = @"estimatedProgress";
+NSString *_WebIsLoadingKey = @"isLoading";
+NSString *_WebMainFrameIconKey = @"mainFrameIcon";
+NSString *_WebMainFrameTitleKey = @"mainFrameTitle";
+NSString *_WebMainFrameURLKey = @"mainFrameURL";
+
@interface WebProgressItem : NSObject
{
@public
@@ -639,6 +647,7 @@ static NSMutableSet *schemesWithRepresentationsSet;
- (void)_progressStarted
{
+ [self willChangeValueForKey: @"estimatedProgress"];
if (_private->numProgressTrackedFrames == 0){
_private->totalPageAndResourceBytesToLoad = 0;
_private->totalBytesReceived = 0;
@@ -647,10 +656,12 @@ static NSMutableSet *schemesWithRepresentationsSet;
[[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressStartedNotification object:self];
}
_private->numProgressTrackedFrames++;
+ [self didChangeValueForKey: @"estimatedProgress"];
}
- (void)_progressCompleted
{
+ [self willChangeValueForKey: @"estimatedProgress"];
if (![[[self mainFrame] dataSource] isLoading])
_private->numProgressTrackedFrames = 0;
@@ -660,6 +671,7 @@ static NSMutableSet *schemesWithRepresentationsSet;
_private->progressValue = 1;
[[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressFinishedNotification object:self];
}
+ [self didChangeValueForKey: @"estimatedProgress"];
}
- (void)_incrementProgressForConnection:(NSURLConnection *)con response:(NSURLResponse *)response;
@@ -696,6 +708,8 @@ static NSMutableSet *schemesWithRepresentationsSet;
if (!item)
return;
+ [self willChangeValueForKey: @"estimatedProgress"];
+
unsigned bytesReceived = [data length];
double increment = 0, percentOfRemainingBytes;
long long remainingBytes, estimatedBytesForPendingRequests;
@@ -727,6 +741,8 @@ static NSMutableSet *schemesWithRepresentationsSet;
[[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressEstimateChangedNotification object:self];
_private->lastNotifiedProgressValue = _private->progressValue;
}
+
+ [self didChangeValueForKey: @"estimatedProgress"];
}
- (void)_completeProgressForConnection:(NSURLConnection *)con
@@ -742,6 +758,76 @@ static NSMutableSet *schemesWithRepresentationsSet;
item->estimatedLength = item->bytesReceived;
}
+- (NSArray *)_declaredKeys {
+ static NSArray *declaredKeys = nil;
+
+ if (!declaredKeys) {
+ declaredKeys = [NSArray arrayWithObjects:_WebMainFrameURLKey, _WebIsLoadingKey, _WebEstimatedProgressKey, _WebCanGoBackKey, _WebCanGoForwardKey, _WebMainFrameTitleKey, _WebMainFrameIconKey, nil];
+ }
+
+ return declaredKeys;
+}
+
+- (void)setObservationInfo:(void *)info
+{
+ _private->observationInfo = info;
+}
+
+- (void *)observationInfo
+{
+ return _private->observationInfo;
+}
+
+- (void)_willChangeBackForwardKeys
+{
+ [self willChangeValueForKey: _WebCanGoBackKey];
+ [self willChangeValueForKey: _WebCanGoForwardKey];
+}
+
+- (void)_didChangeBackForwardKeys
+{
+ [self didChangeValueForKey: _WebCanGoBackKey];
+ [self didChangeValueForKey: _WebCanGoForwardKey];
+}
+
+- (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame
+{
+ [self _willChangeBackForwardKeys];
+ if (frame == [self mainFrame]){
+ [self willChangeValueForKey: _WebIsLoadingKey];
+ [self willChangeValueForKey: _WebMainFrameURLKey];
+ }
+}
+
+- (void)_didCommitLoadForFrame:(WebFrame *)frame
+{
+ if (frame == [self mainFrame])
+ [self didChangeValueForKey: _WebMainFrameURLKey];
+}
+
+- (void)_didFinishLoadForFrame:(WebFrame *)frame
+{
+ [self _didChangeBackForwardKeys];
+ if (frame == [self mainFrame])
+ [self didChangeValueForKey: _WebIsLoadingKey];
+}
+
+- (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+ [self _didChangeBackForwardKeys];
+ if (frame == [self mainFrame])
+ [self didChangeValueForKey: _WebIsLoadingKey];
+}
+
+- (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+ [self _didChangeBackForwardKeys];
+ if (frame == [self mainFrame]){
+ [self didChangeValueForKey: _WebIsLoadingKey];
+ [self didChangeValueForKey: _WebMainFrameURLKey];
+ }
+}
+
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list