[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 05:59:25 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 21e5cf5d44f097d8d3080a82d1e29d4c1fb2258d
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 29 01:44:52 2002 +0000

            Modified the initial layout policy.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@885 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 7527bd1..6c23478 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2002-03-28  Richard Williamson  <rjw at apple.com>
+    
+        Modified the initial layout policy.
+
+	* WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController
+	_receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController
+	_mainReceivedProgress:forResource:fromDataSource:]):
+	* WebView.subproj/IFPreferences.mm: (+[IFPreferences load]), (-[IFPreferences
+	_initialTimedLayoutDelay]), (-[IFPreferences _initialTimedLayoutSize]):
+	* WebView.subproj/IFPreferencesPrivate.h:
+	* WebView.subproj/IFWebFramePrivate.h:
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame
+	_transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame
+	_transitionProvisionalToCommitted]), (-[IFWebFrame _initialLayout:]),
+	(-[IFWebFrame _isLoadComplete]):
+
 2002-03-28  Darin Adler  <darin at apple.com>
 
         New private interface for getting at the cache.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 7527bd1..6c23478 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-03-28  Richard Williamson  <rjw at apple.com>
+    
+        Modified the initial layout policy.
+
+	* WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController
+	_receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController
+	_mainReceivedProgress:forResource:fromDataSource:]):
+	* WebView.subproj/IFPreferences.mm: (+[IFPreferences load]), (-[IFPreferences
+	_initialTimedLayoutDelay]), (-[IFPreferences _initialTimedLayoutSize]):
+	* WebView.subproj/IFPreferencesPrivate.h:
+	* WebView.subproj/IFWebFramePrivate.h:
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame
+	_transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame
+	_transitionProvisionalToCommitted]), (-[IFWebFrame _initialLayout:]),
+	(-[IFWebFrame _isLoadComplete]):
+
 2002-03-28  Darin Adler  <darin at apple.com>
 
         New private interface for getting at the cache.
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
index 0141384..825cdf2 100644
--- a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
@@ -6,6 +6,7 @@
 #import <WebKit/IFWebDataSourcePrivate.h>
 #import <WebKit/IFWebViewPrivate.h>
 #import <WebKit/IFWebFramePrivate.h>
+#import <WebKit/IFPreferencesPrivate.h>
 
 #include <KWQKHTMLPart.h>
 #include <rendering/render_frames.h>
@@ -44,6 +45,7 @@
 
     // This resouce has completed, so check if the load is complete for all frames.
     if (progress->bytesSoFar == progress->totalToLoad){
+        [frame _transitionProvisionalToLayoutAcceptable];
         [frame _checkLoadCompleteResource: resourceDescription error: nil isMainDocument: NO];
     }
 }
@@ -68,16 +70,19 @@
         [frame _transitionProvisionalToCommitted];
     }
 
-    // If the load is complete, make the primary load as done.  The primary load is the load
-    // of the main document.  Other resources may still be arriving.
-    if (progress->bytesSoFar == progress->totalToLoad){
-        [dataSource _setPrimaryLoadComplete: YES];
-    }
-    
     // This resouce has completed, so check if the load is complete for all frames.
     if (progress->bytesSoFar == progress->totalToLoad){
+        [dataSource _setPrimaryLoadComplete: YES];
         [frame _checkLoadCompleteResource: resourceDescription error: nil  isMainDocument: YES];
     }
+    else {
+        // If the load is complete, make the primary load as done.  The primary load is the load
+        // of the main document.  Other resources may still be arriving.
+        int timedLayoutSize = [[IFPreferences standardPreferences] _initialTimedLayoutSize];
+        if (progress->bytesSoFar > timedLayoutSize)
+            [frame _transitionProvisionalToLayoutAcceptable];
+    }
+    
 }
 
 
diff --git a/WebKit/WebView.subproj/IFPreferences.mm b/WebKit/WebView.subproj/IFPreferences.mm
index 2c29cb5..d650b5f 100644
--- a/WebKit/WebView.subproj/IFPreferences.mm
+++ b/WebKit/WebView.subproj/IFPreferences.mm
@@ -20,6 +20,7 @@
 #define	WebKitJScriptEnabledPreferenceKey	@"WebKitJScriptEnabled"
 #define	WebKitPluginsEnabledPreferenceKey	@"WebKitPluginsEnabled"
 #define	WebKitInitialTimedLayoutDelayPreferenceKey	@"WebKitInitialTimedLayoutDelay"
+#define	WebKitInitialTimedLayoutSizePreferenceKey	@"WebKitInitialTimedLayoutSize"
 #define	WebKitInitialTimedLayoutEnabledPreferenceKey	@"WebKitInitialTimedLayoutEnabled"
 
 @implementation IFPreferences
@@ -56,6 +57,7 @@ static IFPreferences *_standardPreferences = nil;
         @"Papyrus", 		WebKitFantasyFontPreferenceKey,
         @"6", 			WebKitMinimumFontSizePreferenceKey,
         @"1.5", 		WebKitInitialTimedLayoutDelayPreferenceKey,
+        @"2048", 		WebKitInitialTimedLayoutSizePreferenceKey,
         timedLayoutEnabled,	WebKitInitialTimedLayoutEnabledPreferenceKey,
         fontSizeArray,		WebKitFontSizesPreferenceKey,
         javaEnabled,		WebKitJavaEnabledPreferenceKey,
@@ -185,6 +187,12 @@ static IFPreferences *_standardPreferences = nil;
     return (NSTimeInterval)[[NSUserDefaults standardUserDefaults] floatForKey:WebKitInitialTimedLayoutDelayPreferenceKey];
 }
 
+- (int)_initialTimedLayoutSize
+{
+    int size = [[NSUserDefaults standardUserDefaults] integerForKey:WebKitInitialTimedLayoutDelayPreferenceKey];
+    return size;
+}
+
 - (BOOL)_initialTimedLayoutEnabled
 {
     return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitInitialTimedLayoutEnabledPreferenceKey];
diff --git a/WebKit/WebView.subproj/IFPreferencesPrivate.h b/WebKit/WebView.subproj/IFPreferencesPrivate.h
index ba15903..2f22309 100644
--- a/WebKit/WebView.subproj/IFPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/IFPreferencesPrivate.h
@@ -11,6 +11,7 @@
 @interface IFPreferences (IFPrivate)
 
 - (NSTimeInterval)_initialTimedLayoutDelay;
+- (int)_initialTimedLayoutSize;
 - (BOOL)_initialTimedLayoutEnabled;
 
 @end
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.h b/WebKit/WebView.subproj/IFWebFramePrivate.h
index db74a94..68f12e6 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.h
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.h
@@ -13,8 +13,17 @@
 typedef enum {
     IFWEBFRAMESTATE_UNINITIALIZED = 1,
     IFWEBFRAMESTATE_PROVISIONAL = 2,
-    IFWEBFRAMESTATE_COMMITTED = 3,
-    IFWEBFRAMESTATE_COMPLETE = 4
+    
+    // This state indicates we are ready to commit to a page,
+    // that means the view will transition to use the new
+    // datasource.
+    IFWEBFRAMESTATE_COMMITTED_PAGE = 3,
+    
+    // This state indicates that it is reasonable to perform
+    // a layout.
+    IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE = 4,
+    
+    IFWEBFRAMESTATE_COMPLETE = 5
 } IFWebFrameState;
 
 @interface IFWebFramePrivate : NSObject
@@ -50,6 +59,7 @@ typedef enum {
 - (void *)_renderFramePart;
 - (void)_setDataSource: (IFWebDataSource *)d;
 - (void)_transitionProvisionalToCommitted;
+- (void)_transitionProvisionalToLayoutAcceptable;
 - (IFWebFrameState)_state;
 - (void)_setState: (IFWebFrameState)newState;
 + (void)_recursiveCheckCompleteFromFrame: (IFWebFrame *)fromFrame;
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index 2236c92..ff35172 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -100,6 +100,65 @@
     [ds _setController: [self controller]];
 }
 
+char *stateNames[6] = {
+    "zero state",
+    "IFWEBFRAMESTATE_UNINITIALIZED",
+    "IFWEBFRAMESTATE_PROVISIONAL",
+    "IFWEBFRAMESTATE_COMMITTED_PAGE",
+    "IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE",
+    "IFWEBFRAMESTATE_COMPLETE" };
+
+
+- (void)_transitionProvisionalToLayoutAcceptable
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    switch ([self _state]){
+    	case IFWEBFRAMESTATE_COMMITTED_PAGE:
+        {
+            [self _setState: IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE];
+                    
+            // Start a timer to guarantee that we get an initial layout after
+            // X interval, even if the document and resources are not completely
+            // loaded.
+            BOOL timedDelayEnabled = [[IFPreferences standardPreferences] _initialTimedLayoutEnabled];
+            if (timedDelayEnabled){
+                NSTimeInterval defaultTimedDelay = [[IFPreferences standardPreferences] _initialTimedLayoutDelay];
+                double timeSinceStart;
+
+                // If the delay getting to the commited state exceeds the initial layout delay, go
+                // ahead and schedule a layout.
+                timeSinceStart = (CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
+                if (timeSinceStart > (double)defaultTimedDelay){
+                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "performing early layout because commit time, %f, exceeded initial layout interval %f\n", timeSinceStart, defaultTimedDelay);
+                    [self _initialLayout: nil];
+                }
+                else {
+                    NSTimeInterval timedDelay = defaultTimedDelay - timeSinceStart;
+                    
+                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "registering delayed layout after %f seconds, time since start %f\n", timedDelay, timeSinceStart);
+                    [NSTimer scheduledTimerWithTimeInterval:timedDelay target:self selector: @selector(_initialLayout:) userInfo: nil repeats:FALSE];
+                }
+            }
+            break;
+        }
+
+        case IFWEBFRAMESTATE_COMPLETE:
+        case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
+        {
+            break;
+        }
+        
+        case IFWEBFRAMESTATE_UNINITIALIZED:
+        case IFWEBFRAMESTATE_PROVISIONAL:
+        default:
+        {
+            [[NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE from %s", stateNames[data->state]] userInfo: nil] raise];
+            return;
+        }
+    }
+}
+
 
 - (void)_transitionProvisionalToCommitted
 {
@@ -139,67 +198,39 @@
             // Now that the provisional data source is committed, release it.
             [data setProvisionalDataSource: nil];
         
-            [self _setState: IFWEBFRAMESTATE_COMMITTED];
+            [self _setState: IFWEBFRAMESTATE_COMMITTED_PAGE];
         
             [[self controller] locationChangeCommittedForFrame: self];
             
-            // Start a timer to guarantee that we get an initial layout after
-            // X interval, even if the document and resources are not completely
-            // loaded.
-            BOOL timedDelayEnabled = [[IFPreferences standardPreferences] _initialTimedLayoutEnabled];
-            if (timedDelayEnabled){
-                NSTimeInterval defaultTimedDelay = [[IFPreferences standardPreferences] _initialTimedLayoutDelay];
-                double timeSinceStart;
-
-                // If the delay getting to the commited state exceeds the initial layout delay, go
-                // ahead and schedule a layout.
-                timeSinceStart = (CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
-                if (timeSinceStart > (double)defaultTimedDelay){
-                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "performing early layout because commit time, %f, exceeded initial layout interval %f\n", timeSinceStart, defaultTimedDelay);
-                    [self _initialLayout: nil];
-                }
-                else {
-                    NSTimeInterval timedDelay = defaultTimedDelay - timeSinceStart;
-                    
-                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "registering delayed layout after %f seconds, time since start %f\n", timedDelay, timeSinceStart);
-                    [NSTimer scheduledTimerWithTimeInterval:timedDelay target:self selector: @selector(_initialLayout:) userInfo: nil repeats:FALSE];
-                }
-            }
             break;
         }
         
         case IFWEBFRAMESTATE_UNINITIALIZED:
-        case IFWEBFRAMESTATE_COMMITTED:
+        case IFWEBFRAMESTATE_COMMITTED_PAGE:
+        case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
         case IFWEBFRAMESTATE_COMPLETE:
         default:
         {
-            [[NSException exceptionWithName:NSGenericException reason:@"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED" userInfo: nil] raise];
+            [[NSException exceptionWithName:NSGenericException reason:[NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED from %s", stateNames[data->state]] userInfo: nil] raise];
             return;
         }
     }
 }
 
-char *stateNames[5] = {
-    "zero state",
-    "IFWEBFRAMESTATE_UNINITIALIZED",
-    "IFWEBFRAMESTATE_PROVISIONAL",
-    "IFWEBFRAMESTATE_COMMITTED",
-    "IFWEBFRAMESTATE_COMPLETE" };
-
 
 - (void)_initialLayout: userInfo
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
 
-    WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "state = %s\n", stateNames[data->state]);
+    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "%s:  state = %s\n", [[self name] cString], stateNames[data->state]);
     
-    if (data->state == IFWEBFRAMESTATE_COMMITTED){
-        WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "performing initial layout\n");
+    if (data->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+        WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "%s:  performing initial layout\n", [[self name] cString]);
         [[self view] setNeedsLayout: YES];
         [[self view] setNeedsDisplay: YES];
     }
     else {
-        WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "timed initial layout not required\n");
+        WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "%s:  timed initial layout not required\n", [[self name] cString]);
     }
 }
 
@@ -263,15 +294,17 @@ char *stateNames[5] = {
             return;
         }
         
-        case IFWEBFRAMESTATE_COMMITTED:
+        case IFWEBFRAMESTATE_COMMITTED_PAGE:
+        case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
         {
             WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "%s:  checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
             if (![[self dataSource] isLoading]){
-               [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 id mainView = [[[self controller] mainFrame] view];
                 id thisView = [self view];
-                
+
                 WEBKIT_ASSERT ([self dataSource] != nil);
+
+                [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 
                 [[self dataSource] _part]->end();
                 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index db74a94..68f12e6 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -13,8 +13,17 @@
 typedef enum {
     IFWEBFRAMESTATE_UNINITIALIZED = 1,
     IFWEBFRAMESTATE_PROVISIONAL = 2,
-    IFWEBFRAMESTATE_COMMITTED = 3,
-    IFWEBFRAMESTATE_COMPLETE = 4
+    
+    // This state indicates we are ready to commit to a page,
+    // that means the view will transition to use the new
+    // datasource.
+    IFWEBFRAMESTATE_COMMITTED_PAGE = 3,
+    
+    // This state indicates that it is reasonable to perform
+    // a layout.
+    IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE = 4,
+    
+    IFWEBFRAMESTATE_COMPLETE = 5
 } IFWebFrameState;
 
 @interface IFWebFramePrivate : NSObject
@@ -50,6 +59,7 @@ typedef enum {
 - (void *)_renderFramePart;
 - (void)_setDataSource: (IFWebDataSource *)d;
 - (void)_transitionProvisionalToCommitted;
+- (void)_transitionProvisionalToLayoutAcceptable;
 - (IFWebFrameState)_state;
 - (void)_setState: (IFWebFrameState)newState;
 + (void)_recursiveCheckCompleteFromFrame: (IFWebFrame *)fromFrame;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 2236c92..ff35172 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -100,6 +100,65 @@
     [ds _setController: [self controller]];
 }
 
+char *stateNames[6] = {
+    "zero state",
+    "IFWEBFRAMESTATE_UNINITIALIZED",
+    "IFWEBFRAMESTATE_PROVISIONAL",
+    "IFWEBFRAMESTATE_COMMITTED_PAGE",
+    "IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE",
+    "IFWEBFRAMESTATE_COMPLETE" };
+
+
+- (void)_transitionProvisionalToLayoutAcceptable
+{
+    IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
+
+    switch ([self _state]){
+    	case IFWEBFRAMESTATE_COMMITTED_PAGE:
+        {
+            [self _setState: IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE];
+                    
+            // Start a timer to guarantee that we get an initial layout after
+            // X interval, even if the document and resources are not completely
+            // loaded.
+            BOOL timedDelayEnabled = [[IFPreferences standardPreferences] _initialTimedLayoutEnabled];
+            if (timedDelayEnabled){
+                NSTimeInterval defaultTimedDelay = [[IFPreferences standardPreferences] _initialTimedLayoutDelay];
+                double timeSinceStart;
+
+                // If the delay getting to the commited state exceeds the initial layout delay, go
+                // ahead and schedule a layout.
+                timeSinceStart = (CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
+                if (timeSinceStart > (double)defaultTimedDelay){
+                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "performing early layout because commit time, %f, exceeded initial layout interval %f\n", timeSinceStart, defaultTimedDelay);
+                    [self _initialLayout: nil];
+                }
+                else {
+                    NSTimeInterval timedDelay = defaultTimedDelay - timeSinceStart;
+                    
+                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "registering delayed layout after %f seconds, time since start %f\n", timedDelay, timeSinceStart);
+                    [NSTimer scheduledTimerWithTimeInterval:timedDelay target:self selector: @selector(_initialLayout:) userInfo: nil repeats:FALSE];
+                }
+            }
+            break;
+        }
+
+        case IFWEBFRAMESTATE_COMPLETE:
+        case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
+        {
+            break;
+        }
+        
+        case IFWEBFRAMESTATE_UNINITIALIZED:
+        case IFWEBFRAMESTATE_PROVISIONAL:
+        default:
+        {
+            [[NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE from %s", stateNames[data->state]] userInfo: nil] raise];
+            return;
+        }
+    }
+}
+
 
 - (void)_transitionProvisionalToCommitted
 {
@@ -139,67 +198,39 @@
             // Now that the provisional data source is committed, release it.
             [data setProvisionalDataSource: nil];
         
-            [self _setState: IFWEBFRAMESTATE_COMMITTED];
+            [self _setState: IFWEBFRAMESTATE_COMMITTED_PAGE];
         
             [[self controller] locationChangeCommittedForFrame: self];
             
-            // Start a timer to guarantee that we get an initial layout after
-            // X interval, even if the document and resources are not completely
-            // loaded.
-            BOOL timedDelayEnabled = [[IFPreferences standardPreferences] _initialTimedLayoutEnabled];
-            if (timedDelayEnabled){
-                NSTimeInterval defaultTimedDelay = [[IFPreferences standardPreferences] _initialTimedLayoutDelay];
-                double timeSinceStart;
-
-                // If the delay getting to the commited state exceeds the initial layout delay, go
-                // ahead and schedule a layout.
-                timeSinceStart = (CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
-                if (timeSinceStart > (double)defaultTimedDelay){
-                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "performing early layout because commit time, %f, exceeded initial layout interval %f\n", timeSinceStart, defaultTimedDelay);
-                    [self _initialLayout: nil];
-                }
-                else {
-                    NSTimeInterval timedDelay = defaultTimedDelay - timeSinceStart;
-                    
-                    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "registering delayed layout after %f seconds, time since start %f\n", timedDelay, timeSinceStart);
-                    [NSTimer scheduledTimerWithTimeInterval:timedDelay target:self selector: @selector(_initialLayout:) userInfo: nil repeats:FALSE];
-                }
-            }
             break;
         }
         
         case IFWEBFRAMESTATE_UNINITIALIZED:
-        case IFWEBFRAMESTATE_COMMITTED:
+        case IFWEBFRAMESTATE_COMMITTED_PAGE:
+        case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
         case IFWEBFRAMESTATE_COMPLETE:
         default:
         {
-            [[NSException exceptionWithName:NSGenericException reason:@"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED" userInfo: nil] raise];
+            [[NSException exceptionWithName:NSGenericException reason:[NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED from %s", stateNames[data->state]] userInfo: nil] raise];
             return;
         }
     }
 }
 
-char *stateNames[5] = {
-    "zero state",
-    "IFWEBFRAMESTATE_UNINITIALIZED",
-    "IFWEBFRAMESTATE_PROVISIONAL",
-    "IFWEBFRAMESTATE_COMMITTED",
-    "IFWEBFRAMESTATE_COMPLETE" };
-
 
 - (void)_initialLayout: userInfo
 {
     IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
 
-    WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "state = %s\n", stateNames[data->state]);
+    WEBKITDEBUGLEVEL2 (WEBKIT_LOG_LOADING, "%s:  state = %s\n", [[self name] cString], stateNames[data->state]);
     
-    if (data->state == IFWEBFRAMESTATE_COMMITTED){
-        WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "performing initial layout\n");
+    if (data->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+        WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "%s:  performing initial layout\n", [[self name] cString]);
         [[self view] setNeedsLayout: YES];
         [[self view] setNeedsDisplay: YES];
     }
     else {
-        WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "timed initial layout not required\n");
+        WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "%s:  timed initial layout not required\n", [[self name] cString]);
     }
 }
 
@@ -263,15 +294,17 @@ char *stateNames[5] = {
             return;
         }
         
-        case IFWEBFRAMESTATE_COMMITTED:
+        case IFWEBFRAMESTATE_COMMITTED_PAGE:
+        case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
         {
             WEBKITDEBUGLEVEL1 (WEBKIT_LOG_LOADING, "%s:  checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
             if (![[self dataSource] isLoading]){
-               [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 id mainView = [[[self controller] mainFrame] view];
                 id thisView = [self view];
-                
+
                 WEBKIT_ASSERT ([self dataSource] != nil);
+
+                [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 
                 [[self dataSource] _part]->end();
                 
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index 2c29cb5..d650b5f 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -20,6 +20,7 @@
 #define	WebKitJScriptEnabledPreferenceKey	@"WebKitJScriptEnabled"
 #define	WebKitPluginsEnabledPreferenceKey	@"WebKitPluginsEnabled"
 #define	WebKitInitialTimedLayoutDelayPreferenceKey	@"WebKitInitialTimedLayoutDelay"
+#define	WebKitInitialTimedLayoutSizePreferenceKey	@"WebKitInitialTimedLayoutSize"
 #define	WebKitInitialTimedLayoutEnabledPreferenceKey	@"WebKitInitialTimedLayoutEnabled"
 
 @implementation IFPreferences
@@ -56,6 +57,7 @@ static IFPreferences *_standardPreferences = nil;
         @"Papyrus", 		WebKitFantasyFontPreferenceKey,
         @"6", 			WebKitMinimumFontSizePreferenceKey,
         @"1.5", 		WebKitInitialTimedLayoutDelayPreferenceKey,
+        @"2048", 		WebKitInitialTimedLayoutSizePreferenceKey,
         timedLayoutEnabled,	WebKitInitialTimedLayoutEnabledPreferenceKey,
         fontSizeArray,		WebKitFontSizesPreferenceKey,
         javaEnabled,		WebKitJavaEnabledPreferenceKey,
@@ -185,6 +187,12 @@ static IFPreferences *_standardPreferences = nil;
     return (NSTimeInterval)[[NSUserDefaults standardUserDefaults] floatForKey:WebKitInitialTimedLayoutDelayPreferenceKey];
 }
 
+- (int)_initialTimedLayoutSize
+{
+    int size = [[NSUserDefaults standardUserDefaults] integerForKey:WebKitInitialTimedLayoutDelayPreferenceKey];
+    return size;
+}
+
 - (BOOL)_initialTimedLayoutEnabled
 {
     return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitInitialTimedLayoutEnabledPreferenceKey];
diff --git a/WebKit/WebView.subproj/WebPreferencesPrivate.h b/WebKit/WebView.subproj/WebPreferencesPrivate.h
index ba15903..2f22309 100644
--- a/WebKit/WebView.subproj/WebPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/WebPreferencesPrivate.h
@@ -11,6 +11,7 @@
 @interface IFPreferences (IFPrivate)
 
 - (NSTimeInterval)_initialTimedLayoutDelay;
+- (int)_initialTimedLayoutSize;
 - (BOOL)_initialTimedLayoutEnabled;
 
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list