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

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:35:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 25e7cf912be0059adee82e05e28068cf9ce5195f
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Apr 10 07:14:51 2003 +0000

    	3223413 - crash in [CompletionController controlTextDidChange] at travelocity.com
    
    	This was a great one to get steps for repro - it has shown up at least twice before.
    
    	The problem is that when there is a focused TextField within a frame, the proper
    	FormDelegate messages were not being sent on refresh or b/f.  The cause was that
    	the FirstResponder would be reset in the middle of detaching the frame, at which point
    	our object graph was already half taken apart.  Fix is to detect that case before
    	doing the detach work, and endEditing explicitly.
    
            Reviewed by Darin.
    
            * ChangeLog:
            * Misc.subproj/WebKitLogging.h:
            * Misc.subproj/WebKitLogging.m:   New FormDelegate logging category.
            * WebCoreSupport.subproj/WebBridge.m:
    	All changes in here are just calling LOG for the new category.
            (-[WebBridge controlTextDidBeginEditing:]):
            (-[WebBridge controlTextDidEndEditing:]):
            (-[WebBridge controlTextDidChange:]):
            (-[WebBridge control:textShouldBeginEditing:]):
            (-[WebBridge control:textShouldEndEditing:]):
            (-[WebBridge control:didFailToFormatString:errorDescription:]):
            (-[WebBridge control:didFailToValidatePartialString:errorDescription:]):
            (-[WebBridge control:isValidObject:]):
            (-[WebBridge control:textView:doCommandBySelector:]):
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _setDataSource:]):  The fix, as described above.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4058 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 43de141..714bee6 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,34 @@
+2003-04-09  Trey Matteson  <trey at apple.com>
+
+	3223413 - crash in [CompletionController controlTextDidChange] at travelocity.com
+
+	This was a great one to get steps for repro - it has shown up at least twice before.
+
+	The problem is that when there is a focused TextField within a frame, the proper
+	FormDelegate messages were not being sent on refresh or b/f.  The cause was that
+	the FirstResponder would be reset in the middle of detaching the frame, at which point
+	our object graph was already half taken apart.  Fix is to detect that case before
+	doing the detach work, and endEditing explicitly.
+
+        Reviewed by Darin.
+
+        * ChangeLog:
+        * Misc.subproj/WebKitLogging.h:
+        * Misc.subproj/WebKitLogging.m:   New FormDelegate logging category.
+        * WebCoreSupport.subproj/WebBridge.m:
+	All changes in here are just calling LOG for the new category.
+        (-[WebBridge controlTextDidBeginEditing:]):
+        (-[WebBridge controlTextDidEndEditing:]):
+        (-[WebBridge controlTextDidChange:]):
+        (-[WebBridge control:textShouldBeginEditing:]):
+        (-[WebBridge control:textShouldEndEditing:]):
+        (-[WebBridge control:didFailToFormatString:errorDescription:]):
+        (-[WebBridge control:didFailToValidatePartialString:errorDescription:]):
+        (-[WebBridge control:isValidObject:]):
+        (-[WebBridge control:textView:doCommandBySelector:]):
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _setDataSource:]):  The fix, as described above.
+
 2003-04-09  Richard Williamson   <rjw at apple.com>
 
         Fix for 3222904.  This change fixes the immediate symptoms of the bug,
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index c7a3661..5991f21 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -27,3 +27,5 @@ extern WebLogChannel WebKitLogRedirect;
 
 extern WebLogChannel WebKitLogPageCache;
 extern WebLogChannel WebKitLogCacheSizes;
+
+extern WebLogChannel WebKitLogFormDelegate;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index e574963..9911a13 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -23,3 +23,5 @@ WebLogChannel WebKitLogRedirect =     		{ 0x00040000, "WebKitLogLevel", WebLogCh
 
 WebLogChannel WebKitLogPageCache =              { 0x00080000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogCacheSizes =             { 0x00100000, "WebKitLogLevel", WebLogChannelUninitialized };
+
+WebLogChannel WebKitLogFormDelegate = 	        { 0x00200000, "WebKitLogLevel", WebLogChannelUninitialized };
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index bf7635b..d7b3bca 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -857,48 +857,59 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     return [[self->frame webView] _formDelegate];
 }
 
+#define FormDelegateLog(ctrl)  LOG(FormDelegate, "control=%@", ctrl)
+
 - (void)controlTextDidBeginEditing:(NSNotification *)obj
 {
+    FormDelegateLog([obj object]);
     [formDelegate(self) controlTextDidBeginEditing:obj inFrame:frame];
 }
 
 - (void)controlTextDidEndEditing:(NSNotification *)obj
 {
+    FormDelegateLog([obj object]);
     [formDelegate(self) controlTextDidEndEditing:obj inFrame:frame];
 }
 
 - (void)controlTextDidChange:(NSNotification *)obj
 {
+    FormDelegateLog([obj object]);
     [formDelegate(self) controlTextDidChange:obj inFrame:frame];
 }
 
 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
 {
+    FormDelegateLog(control);
     return [formDelegate(self) control:control textShouldBeginEditing:fieldEditor inFrame:frame];
 }
 
 - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
 {
+    FormDelegateLog(control);
     return [formDelegate(self) control:control textShouldEndEditing:fieldEditor inFrame:frame];
 }
 
 - (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error
 {
+    FormDelegateLog(control);
     return [formDelegate(self) control:control didFailToFormatString:string errorDescription:error inFrame:frame];
 }
 
 - (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error
 {
+    FormDelegateLog(control);
     [formDelegate(self) control:control didFailToValidatePartialString:string errorDescription:error inFrame:frame];
 }
 
 - (BOOL)control:(NSControl *)control isValidObject:(id)obj
 {
+    FormDelegateLog(control);
     return [formDelegate(self) control:control isValidObject:obj inFrame:frame];
 }
 
 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector
 {
+    FormDelegateLog(control);
     return [formDelegate(self) control:control textView:textView doCommandBySelector:commandSelector inFrame:frame];
 }
 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index c481187..3d4fe17 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -432,14 +432,39 @@ Repeat load of the same URL (by any other means of navigation other than the rel
     }
 
     ASSERT(ds != _private->dataSource);
-    
-    if ([_private->dataSource isDocumentHTML] && ![ds isDocumentHTML]) {
-        [_private->bridge removeFromFrame];
-    }
 
-    [self _detachChildren];
-    
-    [_private->dataSource _setWebFrame:nil];
+    if (_private->dataSource) {
+        // Make sure that any work that is triggered by resigning first reponder can get done.
+        // The main example where this came up is the textDidEndEditing that is sent to the
+        // FormsDelegate (3223413).  We need to do this before _detachChildren, since that will
+        // remove the views as a side-effect of freeing the bridge, at which point we can't
+        // post the FormDelegate messages.
+        //
+        // Note that this can also take FirstResponder away from a child of our frameView that
+        // is not in a child frame's view.  This is OK because we are in the process
+        // of loading new content, which will blow away all editors in this top frame, and if
+        // a non-editor is firstReponder it will not be affected by endEditingFor:.
+        // Potentially one day someone could write a DocView whose editors were not all
+        // replaced by loading new content, but that does not apply currently.
+        NSView *frameView = [self frameView];
+        NSWindow *window = [frameView window];
+        NSResponder *firstResp = [window firstResponder];
+        if ([firstResp isKindOfClass:[NSView class]]
+            && [(NSView *)firstResp isDescendantOf:frameView])
+        {
+            [window endEditingFor:firstResp];
+        }
+
+        if ([_private->dataSource isDocumentHTML] && ![ds isDocumentHTML]) {
+            [_private->bridge removeFromFrame];
+        }
+
+        [self _detachChildren];
+
+        [_private->dataSource _setWebFrame:nil];
+    } else {
+        ASSERT(!_private->children);
+    }
 
     [_private setDataSource:ds];
     [ds _setController:[self webView]];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list