[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 06:02:11 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0ef8ffc97ab6eee319d8aa0bb0e81e83515d356b
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Apr 4 00:54:44 2002 +0000

            Added support for finalURL in data source.
            Added support for finalURL and wasRedirected to datasource.
            Added additional layouts on resource loads.
            Added more implementations of frame related methods in data source.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@959 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 1770ade..9bca7c8 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,10 @@
+2002-04-03  Richard Williamson  <rjw at apple.com>
+
+        Added support for finalURL in data source.
+        
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient IFURLHandle:didRedirectToURL:]):
+	* src/kwq/external.h:
+
 2002-04-03  Darin Adler  <darin at apple.com>
 
 	* src/Makefile.am: Don't strip at all if STRIP_FLAGS are empty.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1770ade..9bca7c8 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,10 @@
+2002-04-03  Richard Williamson  <rjw at apple.com>
+
+        Added support for finalURL in data source.
+        
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient IFURLHandle:didRedirectToURL:]):
+	* src/kwq/external.h:
+
 2002-04-03  Darin Adler  <darin at apple.com>
 
 	* src/Makefile.am: Don't strip at all if STRIP_FLAGS are empty.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1770ade..9bca7c8 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,10 @@
+2002-04-03  Richard Williamson  <rjw at apple.com>
+
+        Added support for finalURL in data source.
+        
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient IFURLHandle:didRedirectToURL:]):
+	* src/kwq/external.h:
+
 2002-04-03  Darin Adler  <darin at apple.com>
 
 	* src/Makefile.am: Don't strip at all if STRIP_FLAGS are empty.
diff --git a/WebCore/kwq/KWQKloader.mm b/WebCore/kwq/KWQKloader.mm
index 5ae4052..32b06aa 100644
--- a/WebCore/kwq/KWQKloader.mm
+++ b/WebCore/kwq/KWQKloader.mm
@@ -1134,6 +1134,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
     KWQDEBUGLEVEL (KWQ_LOG_LOADING, "url = %s\n", [[url absoluteString] cString]);
     [m_dataSource _part]->setBaseURL([[url absoluteString] cString]);
     
+    [m_dataSource _setFinalURL: url];
+    
     [[m_dataSource controller] serverRedirectTo: url forDataSource: m_dataSource];
 }
 
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index 5ae4052..32b06aa 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -1134,6 +1134,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
     KWQDEBUGLEVEL (KWQ_LOG_LOADING, "url = %s\n", [[url absoluteString] cString]);
     [m_dataSource _part]->setBaseURL([[url absoluteString] cString]);
     
+    [m_dataSource _setFinalURL: url];
+    
     [[m_dataSource controller] serverRedirectTo: url forDataSource: m_dataSource];
 }
 
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index 5ae4052..32b06aa 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -1134,6 +1134,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
     KWQDEBUGLEVEL (KWQ_LOG_LOADING, "url = %s\n", [[url absoluteString] cString]);
     [m_dataSource _part]->setBaseURL([[url absoluteString] cString]);
     
+    [m_dataSource _setFinalURL: url];
+    
     [[m_dataSource controller] serverRedirectTo: url forDataSource: m_dataSource];
 }
 
diff --git a/WebCore/kwq/external.h b/WebCore/kwq/external.h
index 79736aa..e413ff0 100644
--- a/WebCore/kwq/external.h
+++ b/WebCore/kwq/external.h
@@ -60,6 +60,7 @@
 - controller;
 - (KHTMLPart *)_part;
 - (void)_setTitle: (NSString *)title;
+- (void)_setFinalURL: (NSURL *)url;
 @end
 
 // This should not be allowed here.  data source should not reference view
diff --git a/WebCore/src/kwq/KWQKloader.mm b/WebCore/src/kwq/KWQKloader.mm
index 5ae4052..32b06aa 100644
--- a/WebCore/src/kwq/KWQKloader.mm
+++ b/WebCore/src/kwq/KWQKloader.mm
@@ -1134,6 +1134,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
     KWQDEBUGLEVEL (KWQ_LOG_LOADING, "url = %s\n", [[url absoluteString] cString]);
     [m_dataSource _part]->setBaseURL([[url absoluteString] cString]);
     
+    [m_dataSource _setFinalURL: url];
+    
     [[m_dataSource controller] serverRedirectTo: url forDataSource: m_dataSource];
 }
 
diff --git a/WebCore/src/kwq/external.h b/WebCore/src/kwq/external.h
index 79736aa..e413ff0 100644
--- a/WebCore/src/kwq/external.h
+++ b/WebCore/src/kwq/external.h
@@ -60,6 +60,7 @@
 - controller;
 - (KHTMLPart *)_part;
 - (void)_setTitle: (NSString *)title;
+- (void)_setFinalURL: (NSURL *)url;
 @end
 
 // This should not be allowed here.  data source should not reference view
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 59e2c09..4595a9d 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,26 @@
+2002-04-03  Richard Williamson  <rjw at apple.com>
+
+        Added support for finalURL and wasRedirected to datasource.
+        Added additional layouts on resource loads.
+        Added more implementations of frame related methods in data source.
+        
+	* WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient
+	IFURLHandle:didRedirectToURL:]):
+	* WebView.subproj/IFPreferences.mm: (+[IFPreferences load]), (-[IFPreferences
+	_resourceTimedLayoutDelay]), (-[IFPreferences _resourceTimedLayoutEnabled]):
+	* WebView.subproj/IFPreferencesPrivate.h:
+	* WebView.subproj/IFWebDataSource.h:
+	* WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource frameNames]),
+	(-[IFWebDataSource findDataSourceForFrameNamed:]), (-[IFWebDataSource
+	frameExists:]), (-[IFWebDataSource finalURL]), (-[IFWebDataSource
+	wasRedirected]):
+	* WebView.subproj/IFWebDataSourcePrivate.h:
+	* WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]),
+	(-[IFWebDataSource _setTitle:]), (-[IFWebDataSource _setFinalURL:]):
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _scheduleLayout:]),
+	(-[IFWebFrame _transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame
+	_isLoadComplete]):
+
 2002-04-03  Kenneth Kocienda  <kocienda at apple.com>
 
         Updated debugging log messages to use new varargs macros.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 59e2c09..4595a9d 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,26 @@
+2002-04-03  Richard Williamson  <rjw at apple.com>
+
+        Added support for finalURL and wasRedirected to datasource.
+        Added additional layouts on resource loads.
+        Added more implementations of frame related methods in data source.
+        
+	* WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient
+	IFURLHandle:didRedirectToURL:]):
+	* WebView.subproj/IFPreferences.mm: (+[IFPreferences load]), (-[IFPreferences
+	_resourceTimedLayoutDelay]), (-[IFPreferences _resourceTimedLayoutEnabled]):
+	* WebView.subproj/IFPreferencesPrivate.h:
+	* WebView.subproj/IFWebDataSource.h:
+	* WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource frameNames]),
+	(-[IFWebDataSource findDataSourceForFrameNamed:]), (-[IFWebDataSource
+	frameExists:]), (-[IFWebDataSource finalURL]), (-[IFWebDataSource
+	wasRedirected]):
+	* WebView.subproj/IFWebDataSourcePrivate.h:
+	* WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]),
+	(-[IFWebDataSource _setTitle:]), (-[IFWebDataSource _setFinalURL:]):
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _scheduleLayout:]),
+	(-[IFWebFrame _transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame
+	_isLoadComplete]):
+
 2002-04-03  Kenneth Kocienda  <kocienda at apple.com>
 
         Updated debugging log messages to use new varargs macros.
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.mm b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
index 55bd695..48a8b05 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.mm
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
@@ -101,6 +101,8 @@
     WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[url absoluteString] cString]);
     part->setBaseURL([[url absoluteString] cString]);
     
+    [dataSource _setFinalURL: url];
+    
     [[dataSource controller] serverRedirectTo: url forDataSource: dataSource];
 }
 
diff --git a/WebKit/WebView.subproj/IFPreferences.mm b/WebKit/WebView.subproj/IFPreferences.mm
index cc9b9f1..5b54fea 100644
--- a/WebKit/WebView.subproj/IFPreferences.mm
+++ b/WebKit/WebView.subproj/IFPreferences.mm
@@ -22,6 +22,8 @@
 #define	WebKitInitialTimedLayoutDelayPreferenceKey	@"WebKitInitialTimedLayoutDelay"
 #define	WebKitInitialTimedLayoutSizePreferenceKey	@"WebKitInitialTimedLayoutSize"
 #define	WebKitInitialTimedLayoutEnabledPreferenceKey	@"WebKitInitialTimedLayoutEnabled"
+#define	WebKitResourceTimedLayoutEnabledPreferenceKey	@"WebKitResourceTimedLayoutEnabled"
+#define	WebKitResourceTimedLayoutDelayPreferenceKey	@"WebKitResourceTimedLayoutDelay"
 
 @implementation IFPreferences
 
@@ -46,23 +48,26 @@ static IFPreferences *_standardPreferences = nil;
     NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
     NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *timedLayoutEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *resourceTimedLayoutEnabled = [NSNumber numberWithBool:TRUE];
 
     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-        @"0x0", 		WebKitLogLevelPreferenceKey,
-        @"Georgia", 		WebKitStandardFontPreferenceKey,
-        @"Monaco",	  	WebKitFixedFontPreferenceKey,
-        @"Georgia", 		WebKitSerifFontPreferenceKey,
-        @"Arial", 		WebKitSansSerifFontPreferenceKey,
-        @"Apple Chancery", 	WebKitCursiveFontPreferenceKey,
-        @"Papyrus", 		WebKitFantasyFontPreferenceKey,
-        @"6", 			WebKitMinimumFontSizePreferenceKey,
-        @"1.5", 		WebKitInitialTimedLayoutDelayPreferenceKey,
-        @"4096", 		WebKitInitialTimedLayoutSizePreferenceKey,
-        timedLayoutEnabled,	WebKitInitialTimedLayoutEnabledPreferenceKey,
-        fontSizeArray,		WebKitFontSizesPreferenceKey,
-        javaEnabled,		WebKitJavaEnabledPreferenceKey,
-        jScriptEnabled,		WebKitJScriptEnabledPreferenceKey,
-        pluginsEnabled,		WebKitPluginsEnabledPreferenceKey,
+        @"0x0", 			WebKitLogLevelPreferenceKey,
+        @"Georgia", 			WebKitStandardFontPreferenceKey,
+        @"Monaco",	  		WebKitFixedFontPreferenceKey,
+        @"Georgia", 			WebKitSerifFontPreferenceKey,
+        @"Arial", 			WebKitSansSerifFontPreferenceKey,
+        @"Apple Chancery", 		WebKitCursiveFontPreferenceKey,
+        @"Papyrus", 			WebKitFantasyFontPreferenceKey,
+        @"6", 				WebKitMinimumFontSizePreferenceKey,
+        @"1.5",		 		WebKitInitialTimedLayoutDelayPreferenceKey,
+        @"4096", 			WebKitInitialTimedLayoutSizePreferenceKey,
+        @"1.0", 			WebKitResourceTimedLayoutDelayPreferenceKey,
+        timedLayoutEnabled,		WebKitInitialTimedLayoutEnabledPreferenceKey,
+        resourceTimedLayoutEnabled,	WebKitResourceTimedLayoutEnabledPreferenceKey,
+        fontSizeArray,			WebKitFontSizesPreferenceKey,
+        javaEnabled,			WebKitJavaEnabledPreferenceKey,
+        jScriptEnabled,			WebKitJScriptEnabledPreferenceKey,
+        pluginsEnabled,			WebKitPluginsEnabledPreferenceKey,
         nil];
 
     [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -199,4 +204,16 @@ static IFPreferences *_standardPreferences = nil;
 }
 
 
+- (NSTimeInterval)_resourceTimedLayoutDelay
+{
+    return [[NSUserDefaults standardUserDefaults] floatForKey:WebKitResourceTimedLayoutDelayPreferenceKey];
+}
+
+- (BOOL)_resourceTimedLayoutEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitResourceTimedLayoutEnabledPreferenceKey];
+}
+
+
+
 @end
diff --git a/WebKit/WebView.subproj/IFPreferencesPrivate.h b/WebKit/WebView.subproj/IFPreferencesPrivate.h
index 2f22309..0b4a202 100644
--- a/WebKit/WebView.subproj/IFPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/IFPreferencesPrivate.h
@@ -13,6 +13,8 @@
 - (NSTimeInterval)_initialTimedLayoutDelay;
 - (int)_initialTimedLayoutSize;
 - (BOOL)_initialTimedLayoutEnabled;
+- (BOOL)_resourceTimedLayoutEnabled;
+- (NSTimeInterval)_resourceTimedLayoutDelay;
 
 @end
 
diff --git a/WebKit/WebView.subproj/IFWebDataSource.h b/WebKit/WebView.subproj/IFWebDataSource.h
index a9ff3e8..bfb907f 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.h
+++ b/WebKit/WebView.subproj/IFWebDataSource.h
@@ -10,62 +10,11 @@
 #import <WebKit/IFWebFrame.h>
 
 /* 
-   =============================================================================
+    =============================================================================
    
-    A IFWebDataSource represents all the state associated
-    with a web page.  It is typicallly initialized with a URL, but
-    may also be initialized with an NSString or NSData that hold
-    HTML (?also other, i.e. image data?) content.
-    
-    Typical usage of a IFWebDataSource.
-    
-    IFWebDataSource *dataSource = [[IFWebDataSource alloc] initWithURL: url];
-    id <IFWebController>myController = [[MyControllerClass alloc] init];
-    [myController setDataSource: dataSource];
-
-   Changes:
-   
-   2001-12-12
-    
-    After group discussion we decided to classify API as :
-        Tier 1:  Needed by our browser (or Sherlock).
-        Tier 2:  Nedded by Apple internal clients (Mail, Help, PB, other TBD).
-        Tier 3:  Third party software vendors.
-    
-    Added finalURL and isRedirected.
-   
-    2001-12-13
-    
-        Remove setBase: and setBaseTarget:
-        
-        Changed return type of baseTarget to (NSString *)
-        
-        Added the following two methods:
-            - (IFDataSource *)parent;
-            - (NSArry *)children;
-            - (BOOL)isMainDocument;
-  
-        Added the following methods:
-        
-            - (NSArray *)frameNames;
-            - (IFWebDataSource) findDataSourceForFrameNamed: (NSString *)name;
-            - (BOOL)frameExists: (NSString *)name;
-            - (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName;
-            - (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier;
-
-  2001-12-14
-
-        Removed all mentions of resolved URLs, because browsers don't
-        actuall treat DNS aliases specially.
-        
-        Moved search API to IFWebView.
-        
-        Moved IFPreferences to a new file, IFPreferences.h.  We are still discussing
-        this item and it will not make it into the white paper.
-                    
-	Minor naming changes.
-
-   ============================================================================= */
+    A IFWebDataSource represents the data associated with a web page.
+
+    ============================================================================= */
 
 #ifdef TENTATIVE_API
 @class IFLoader;
@@ -136,8 +85,6 @@
 - (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName;
 
 
-- (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier;
-
 
 // Set the controller for this data source.  NOTE:  The controller is not retained by the
 // data source.  Perhaps setController: should be private?  Perhaps the back pointers
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 61513cc..312ac6f 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -119,8 +119,7 @@ static id IFWebDataSourceMake(void *url)
 // frames then frameNames will return nil.
 - (NSArray *)frameNames
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::frameNames is not implemented"];
-    return nil;
+    return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->frames allKeys];
 }
 
 
@@ -128,15 +127,13 @@ static id IFWebDataSourceMake(void *url)
 // the frame named 'name', or nil. 
 - (IFWebDataSource *) findDataSourceForFrameNamed: (NSString *)name
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::findDataSourceForFrameNamed: is not implemented"];
-    return nil;
+    return [[self frameNamed: name] dataSource];
 }
 
 
 - (BOOL)frameExists: (NSString *)name
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::frameExists: is not implemented"];
-    return NO;
+    return [self frameNamed: name] == 0 ? NO : YES;
 }
 
 
@@ -146,12 +143,6 @@ static id IFWebDataSourceMake(void *url)
 }
 
 
-- (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier
-{
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::openURL:inIFrame: is not implemented"];
-}
-
-
 - (id <IFWebController>)controller
 {
     // All data sources used in a document share the same
@@ -176,8 +167,7 @@ static id IFWebDataSourceMake(void *url)
 // a redirect is processed
 - (NSURL *)finalURL
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::finalURL is not implemented"];
-    return nil;
+    return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->finalURL;
 }
 
 
@@ -185,8 +175,7 @@ static id IFWebDataSourceMake(void *url)
 // i.e. inputURL != finalURL.
 - (BOOL)wasRedirected
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::wasRedirected is not implemented"];
-    return NO;
+    return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL isEqual: [self finalURL]];
 }
 
 
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
index 3ba37a6..a4f45db 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
@@ -26,6 +26,9 @@
     // The original URL as requested during initialization.
     NSURL *inputURL;
     
+    // The original URL we may have been redirected to.
+    NSURL *finalURL;
+    
     KHTMLPart *part;
     
     // Child frames of this frame.
@@ -71,4 +74,5 @@
 - (void)_setPrimaryLoadComplete: (BOOL)flag;
 - (double)_loadingStartedTime;
 - (void)_setTitle: (NSString *)title;
+- (void)_setFinalURL: (NSURL *)url;
 @end
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
index be28b3c..f9e3a18 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
@@ -46,6 +46,7 @@
     }
     [frames release];
     [inputURL release];
+    [finalURL release];
     [urlHandles release];
     [mainHandle release];
     [mainURLHandleClient release];
@@ -232,4 +233,12 @@
         [[self controller] receivedPageTitle:data->pageTitle forDataSource:self];
 }
 
+- (void)_setFinalURL: (NSURL *)url
+{
+    IFWebDataSourcePrivate *data = (IFWebDataSourcePrivate *)_dataSourcePrivate;
+
+    [data->finalURL release];
+    data->finalURL = [url retain];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index 6b768e9..f212f54 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -129,6 +129,11 @@ char *stateNames[6] = {
     "IFWEBFRAMESTATE_COMPLETE" };
 
 
+- (void)_scheduleLayout: (NSTimeInterval)inSeconds
+{
+    [NSTimer scheduledTimerWithTimeInterval:inSeconds target:self selector: @selector(_timedLayout:) userInfo: nil repeats:FALSE];
+}
+
 - (void)_transitionProvisionalToLayoutAcceptable
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
@@ -157,7 +162,7 @@ char *stateNames[6] = {
                     NSTimeInterval timedDelay = defaultTimedDelay - timeSinceStart;
                     
                     WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "registering delayed layout after %f seconds, time since start %f\n", timedDelay, timeSinceStart);
-                    [NSTimer scheduledTimerWithTimeInterval:timedDelay target:self selector: @selector(_timedLayout:) userInfo: nil repeats:FALSE];
+                    [self _scheduleLayout: timedDelay];
                 }
             }
             break;
@@ -362,6 +367,17 @@ char *stateNames[6] = {
                 
                 return;
             }
+            // A resource was loaded, but not the entire frame isn't complete.  Schedule a
+            // layout.
+            else {
+                if ([self _state] == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+                    BOOL resourceTimedDelayEnabled = [[IFPreferences standardPreferences] _resourceTimedLayoutEnabled];
+                    if (resourceTimedDelayEnabled){
+                        NSTimeInterval timedDelay = [[IFPreferences standardPreferences] _resourceTimedLayoutDelay];
+                        [self _scheduleLayout: timedDelay];
+                    }
+                }
+            }
             return;
         }
         
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index a9ff3e8..bfb907f 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -10,62 +10,11 @@
 #import <WebKit/IFWebFrame.h>
 
 /* 
-   =============================================================================
+    =============================================================================
    
-    A IFWebDataSource represents all the state associated
-    with a web page.  It is typicallly initialized with a URL, but
-    may also be initialized with an NSString or NSData that hold
-    HTML (?also other, i.e. image data?) content.
-    
-    Typical usage of a IFWebDataSource.
-    
-    IFWebDataSource *dataSource = [[IFWebDataSource alloc] initWithURL: url];
-    id <IFWebController>myController = [[MyControllerClass alloc] init];
-    [myController setDataSource: dataSource];
-
-   Changes:
-   
-   2001-12-12
-    
-    After group discussion we decided to classify API as :
-        Tier 1:  Needed by our browser (or Sherlock).
-        Tier 2:  Nedded by Apple internal clients (Mail, Help, PB, other TBD).
-        Tier 3:  Third party software vendors.
-    
-    Added finalURL and isRedirected.
-   
-    2001-12-13
-    
-        Remove setBase: and setBaseTarget:
-        
-        Changed return type of baseTarget to (NSString *)
-        
-        Added the following two methods:
-            - (IFDataSource *)parent;
-            - (NSArry *)children;
-            - (BOOL)isMainDocument;
-  
-        Added the following methods:
-        
-            - (NSArray *)frameNames;
-            - (IFWebDataSource) findDataSourceForFrameNamed: (NSString *)name;
-            - (BOOL)frameExists: (NSString *)name;
-            - (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName;
-            - (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier;
-
-  2001-12-14
-
-        Removed all mentions of resolved URLs, because browsers don't
-        actuall treat DNS aliases specially.
-        
-        Moved search API to IFWebView.
-        
-        Moved IFPreferences to a new file, IFPreferences.h.  We are still discussing
-        this item and it will not make it into the white paper.
-                    
-	Minor naming changes.
-
-   ============================================================================= */
+    A IFWebDataSource represents the data associated with a web page.
+
+    ============================================================================= */
 
 #ifdef TENTATIVE_API
 @class IFLoader;
@@ -136,8 +85,6 @@
 - (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName;
 
 
-- (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier;
-
 
 // Set the controller for this data source.  NOTE:  The controller is not retained by the
 // data source.  Perhaps setController: should be private?  Perhaps the back pointers
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 61513cc..312ac6f 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -119,8 +119,7 @@ static id IFWebDataSourceMake(void *url)
 // frames then frameNames will return nil.
 - (NSArray *)frameNames
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::frameNames is not implemented"];
-    return nil;
+    return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->frames allKeys];
 }
 
 
@@ -128,15 +127,13 @@ static id IFWebDataSourceMake(void *url)
 // the frame named 'name', or nil. 
 - (IFWebDataSource *) findDataSourceForFrameNamed: (NSString *)name
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::findDataSourceForFrameNamed: is not implemented"];
-    return nil;
+    return [[self frameNamed: name] dataSource];
 }
 
 
 - (BOOL)frameExists: (NSString *)name
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::frameExists: is not implemented"];
-    return NO;
+    return [self frameNamed: name] == 0 ? NO : YES;
 }
 
 
@@ -146,12 +143,6 @@ static id IFWebDataSourceMake(void *url)
 }
 
 
-- (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier
-{
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::openURL:inIFrame: is not implemented"];
-}
-
-
 - (id <IFWebController>)controller
 {
     // All data sources used in a document share the same
@@ -176,8 +167,7 @@ static id IFWebDataSourceMake(void *url)
 // a redirect is processed
 - (NSURL *)finalURL
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::finalURL is not implemented"];
-    return nil;
+    return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->finalURL;
 }
 
 
@@ -185,8 +175,7 @@ static id IFWebDataSourceMake(void *url)
 // i.e. inputURL != finalURL.
 - (BOOL)wasRedirected
 {
-    [NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::wasRedirected is not implemented"];
-    return NO;
+    return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL isEqual: [self finalURL]];
 }
 
 
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 3ba37a6..a4f45db 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -26,6 +26,9 @@
     // The original URL as requested during initialization.
     NSURL *inputURL;
     
+    // The original URL we may have been redirected to.
+    NSURL *finalURL;
+    
     KHTMLPart *part;
     
     // Child frames of this frame.
@@ -71,4 +74,5 @@
 - (void)_setPrimaryLoadComplete: (BOOL)flag;
 - (double)_loadingStartedTime;
 - (void)_setTitle: (NSString *)title;
+- (void)_setFinalURL: (NSURL *)url;
 @end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index be28b3c..f9e3a18 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -46,6 +46,7 @@
     }
     [frames release];
     [inputURL release];
+    [finalURL release];
     [urlHandles release];
     [mainHandle release];
     [mainURLHandleClient release];
@@ -232,4 +233,12 @@
         [[self controller] receivedPageTitle:data->pageTitle forDataSource:self];
 }
 
+- (void)_setFinalURL: (NSURL *)url
+{
+    IFWebDataSourcePrivate *data = (IFWebDataSourcePrivate *)_dataSourcePrivate;
+
+    [data->finalURL release];
+    data->finalURL = [url retain];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 6b768e9..f212f54 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -129,6 +129,11 @@ char *stateNames[6] = {
     "IFWEBFRAMESTATE_COMPLETE" };
 
 
+- (void)_scheduleLayout: (NSTimeInterval)inSeconds
+{
+    [NSTimer scheduledTimerWithTimeInterval:inSeconds target:self selector: @selector(_timedLayout:) userInfo: nil repeats:FALSE];
+}
+
 - (void)_transitionProvisionalToLayoutAcceptable
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
@@ -157,7 +162,7 @@ char *stateNames[6] = {
                     NSTimeInterval timedDelay = defaultTimedDelay - timeSinceStart;
                     
                     WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "registering delayed layout after %f seconds, time since start %f\n", timedDelay, timeSinceStart);
-                    [NSTimer scheduledTimerWithTimeInterval:timedDelay target:self selector: @selector(_timedLayout:) userInfo: nil repeats:FALSE];
+                    [self _scheduleLayout: timedDelay];
                 }
             }
             break;
@@ -362,6 +367,17 @@ char *stateNames[6] = {
                 
                 return;
             }
+            // A resource was loaded, but not the entire frame isn't complete.  Schedule a
+            // layout.
+            else {
+                if ([self _state] == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+                    BOOL resourceTimedDelayEnabled = [[IFPreferences standardPreferences] _resourceTimedLayoutEnabled];
+                    if (resourceTimedDelayEnabled){
+                        NSTimeInterval timedDelay = [[IFPreferences standardPreferences] _resourceTimedLayoutDelay];
+                        [self _scheduleLayout: timedDelay];
+                    }
+                }
+            }
             return;
         }
         
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 55bd695..48a8b05 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -101,6 +101,8 @@
     WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[url absoluteString] cString]);
     part->setBaseURL([[url absoluteString] cString]);
     
+    [dataSource _setFinalURL: url];
+    
     [[dataSource controller] serverRedirectTo: url forDataSource: dataSource];
 }
 
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 55bd695..48a8b05 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -101,6 +101,8 @@
     WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[url absoluteString] cString]);
     part->setBaseURL([[url absoluteString] cString]);
     
+    [dataSource _setFinalURL: url];
+    
     [[dataSource controller] serverRedirectTo: url forDataSource: dataSource];
 }
 
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index cc9b9f1..5b54fea 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -22,6 +22,8 @@
 #define	WebKitInitialTimedLayoutDelayPreferenceKey	@"WebKitInitialTimedLayoutDelay"
 #define	WebKitInitialTimedLayoutSizePreferenceKey	@"WebKitInitialTimedLayoutSize"
 #define	WebKitInitialTimedLayoutEnabledPreferenceKey	@"WebKitInitialTimedLayoutEnabled"
+#define	WebKitResourceTimedLayoutEnabledPreferenceKey	@"WebKitResourceTimedLayoutEnabled"
+#define	WebKitResourceTimedLayoutDelayPreferenceKey	@"WebKitResourceTimedLayoutDelay"
 
 @implementation IFPreferences
 
@@ -46,23 +48,26 @@ static IFPreferences *_standardPreferences = nil;
     NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
     NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *timedLayoutEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *resourceTimedLayoutEnabled = [NSNumber numberWithBool:TRUE];
 
     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-        @"0x0", 		WebKitLogLevelPreferenceKey,
-        @"Georgia", 		WebKitStandardFontPreferenceKey,
-        @"Monaco",	  	WebKitFixedFontPreferenceKey,
-        @"Georgia", 		WebKitSerifFontPreferenceKey,
-        @"Arial", 		WebKitSansSerifFontPreferenceKey,
-        @"Apple Chancery", 	WebKitCursiveFontPreferenceKey,
-        @"Papyrus", 		WebKitFantasyFontPreferenceKey,
-        @"6", 			WebKitMinimumFontSizePreferenceKey,
-        @"1.5", 		WebKitInitialTimedLayoutDelayPreferenceKey,
-        @"4096", 		WebKitInitialTimedLayoutSizePreferenceKey,
-        timedLayoutEnabled,	WebKitInitialTimedLayoutEnabledPreferenceKey,
-        fontSizeArray,		WebKitFontSizesPreferenceKey,
-        javaEnabled,		WebKitJavaEnabledPreferenceKey,
-        jScriptEnabled,		WebKitJScriptEnabledPreferenceKey,
-        pluginsEnabled,		WebKitPluginsEnabledPreferenceKey,
+        @"0x0", 			WebKitLogLevelPreferenceKey,
+        @"Georgia", 			WebKitStandardFontPreferenceKey,
+        @"Monaco",	  		WebKitFixedFontPreferenceKey,
+        @"Georgia", 			WebKitSerifFontPreferenceKey,
+        @"Arial", 			WebKitSansSerifFontPreferenceKey,
+        @"Apple Chancery", 		WebKitCursiveFontPreferenceKey,
+        @"Papyrus", 			WebKitFantasyFontPreferenceKey,
+        @"6", 				WebKitMinimumFontSizePreferenceKey,
+        @"1.5",		 		WebKitInitialTimedLayoutDelayPreferenceKey,
+        @"4096", 			WebKitInitialTimedLayoutSizePreferenceKey,
+        @"1.0", 			WebKitResourceTimedLayoutDelayPreferenceKey,
+        timedLayoutEnabled,		WebKitInitialTimedLayoutEnabledPreferenceKey,
+        resourceTimedLayoutEnabled,	WebKitResourceTimedLayoutEnabledPreferenceKey,
+        fontSizeArray,			WebKitFontSizesPreferenceKey,
+        javaEnabled,			WebKitJavaEnabledPreferenceKey,
+        jScriptEnabled,			WebKitJScriptEnabledPreferenceKey,
+        pluginsEnabled,			WebKitPluginsEnabledPreferenceKey,
         nil];
 
     [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -199,4 +204,16 @@ static IFPreferences *_standardPreferences = nil;
 }
 
 
+- (NSTimeInterval)_resourceTimedLayoutDelay
+{
+    return [[NSUserDefaults standardUserDefaults] floatForKey:WebKitResourceTimedLayoutDelayPreferenceKey];
+}
+
+- (BOOL)_resourceTimedLayoutEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitResourceTimedLayoutEnabledPreferenceKey];
+}
+
+
+
 @end
diff --git a/WebKit/WebView.subproj/WebPreferencesPrivate.h b/WebKit/WebView.subproj/WebPreferencesPrivate.h
index 2f22309..0b4a202 100644
--- a/WebKit/WebView.subproj/WebPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/WebPreferencesPrivate.h
@@ -13,6 +13,8 @@
 - (NSTimeInterval)_initialTimedLayoutDelay;
 - (int)_initialTimedLayoutSize;
 - (BOOL)_initialTimedLayoutEnabled;
+- (BOOL)_resourceTimedLayoutEnabled;
+- (NSTimeInterval)_resourceTimedLayoutDelay;
 
 @end
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list