Reviewed by John.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2005 19:17:45 +0000 (19:17 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2005 19:17:45 +0000 (19:17 +0000)
        - fixed <rdar://problem/4034603> REGRESSION (185-188): RadarWeb can't send enclosures anymore

        * WebView.subproj/WebFormDataStream.m:
        (closeCurrentStream): Release currentData when closing the stream.
        (advanceCurrentStream): Set up and retain currentData when the current stream is reading that data, so the
        data won't be released while in use.
        (formCreate): Initialize currentData to NULL.

        - fixed <rdar://problem/4037562> Tiger8A402: Help Viewer crashed when viewing help for iChat (infinite recursion in WebView)

        * WebView.subproj/WebView.m: (-[WebView _responderValidateUserInterfaceItem:]):
        Check for the case where we ourselves are the responder. This avoids an infinite loop.
        The actual code to perform operations avoids this with a global variable, but this lighter weight
        solution is sufficient here because validate operations don't call through to the next responder.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8793 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebView.subproj/WebFormDataStream.m
WebKit/WebView.subproj/WebView.m

index 7ddbb5aca393f6a2a8c835d3d1f11f1e2af50774..51faff7199cd9707511d73d62c6926c02728103f 100644 (file)
@@ -1,3 +1,22 @@
+2005-03-05  Darin Adler  <darin@apple.com>
+
+        Reviewed by John.
+
+        - fixed <rdar://problem/4034603> REGRESSION (185-188): RadarWeb can't send enclosures anymore
+
+        * WebView.subproj/WebFormDataStream.m:
+        (closeCurrentStream): Release currentData when closing the stream.
+        (advanceCurrentStream): Set up and retain currentData when the current stream is reading that data, so the
+        data won't be released while in use.
+        (formCreate): Initialize currentData to NULL.
+
+        - fixed <rdar://problem/4037562> Tiger8A402: Help Viewer crashed when viewing help for iChat (infinite recursion in WebView)
+
+        * WebView.subproj/WebView.m: (-[WebView _responderValidateUserInterfaceItem:]):
+        Check for the case where we ourselves are the responder. This avoids an infinite loop.
+        The actual code to perform operations avoids this with a global variable, but this lighter weight
+        solution is sufficient here because validate operations don't call through to the next responder.
+
 2005-03-04  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/3968753> REGRESSION: Poor performance with differing multiple animated GIFs (was fast in Panther)
index 72c3e426b80798c276968607466f6ba590ce184f..41af5ee5a58a398a56d4e323291f04ddb46dc5a2 100644 (file)
@@ -22,6 +22,7 @@ typedef struct {
     CFMutableSetRef scheduledRunLoopPairs;
     CFMutableArrayRef formDataArray;
     CFReadStreamRef currentStream;
+    CFDataRef currentData;
     CFReadStreamRef formStream;
 } FormStreamFields;
 
@@ -73,6 +74,10 @@ static void closeCurrentStream(FormStreamFields *form)
         CFRelease(form->currentStream);
         form->currentStream = NULL;
     }
+    if (form->currentData) {
+        CFRelease(form->currentData);
+        form->currentData = NULL;
+    }
 }
 
 static void scheduleWithPair(const void *value, void *context)
@@ -99,6 +104,8 @@ static void advanceCurrentStream(FormStreamFields *form)
         // nextInput is a CFData containing an absolute path
         CFDataRef data = (CFDataRef)nextInput;
         form->currentStream = CFReadStreamCreateWithBytesNoCopy(alloc, CFDataGetBytePtr(data), CFDataGetLength(data), kCFAllocatorNull);
+        form->currentData = data;
+        CFRetain(data);
     } else {
         // nextInput is a CFString containing an absolute path
         CFStringRef path = (CFStringRef)nextInput;
@@ -139,6 +146,7 @@ static void *formCreate(CFReadStreamRef stream, void *context)
     newInfo->scheduledRunLoopPairs = CFSetCreateMutable(alloc, 0, &runLoopAndModeCallBacks);
     newInfo->formDataArray = CFArrayCreateMutableCopy(alloc, CFArrayGetCount(formDataArray), formDataArray);
     newInfo->currentStream = NULL;
+    newInfo->currentData = NULL;
     newInfo->formStream = stream; // Don't retain. That would create a reference cycle.
     return newInfo;
 }
index 0569853ea823ad1ed47bd50c676e80a4e5c40a9f..e4e96b95389d4b56e14d0cd3721321d3d92d8a7c 100644 (file)
@@ -2367,7 +2367,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 - (BOOL)_responderValidateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
 {
     id responder = [self _responderForResponderOperations];
-    if ([responder respondsToSelector:[item action]]) {
+    if (responder != self && [responder respondsToSelector:[item action]]) {
         if ([responder respondsToSelector:@selector(validateUserInterfaceItem:)]) {
             return [responder validateUserInterfaceItem:item];
         }
@@ -2377,7 +2377,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 }
 
 #define VALIDATE(name) \
-else if (action == @selector(name:)) { return [self _responderValidateUserInterfaceItem:item]; }
+    else if (action == @selector(name:)) { return [self _responderValidateUserInterfaceItem:item]; }
 
 - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
 {