Bug 6331 - REGRESSION: form events don't fire after back/forward navigation, due to inconsistent load state
Summary: REGRESSION: form events don't fire after back/forward navigation, due to inco...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Geoffrey Garen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-01 23:58 PST by Geoffrey Garen
Modified: 2006-01-09 10:34 PST (History)
0 users

See Also:


Attachments
reduction (966 bytes, application/octet-stream)
2006-01-01 23:59 PST, Geoffrey Garen
no flags Details
Fix (15.56 KB, patch)
2006-01-08 22:20 PST, Geoffrey Garen
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2006-01-01 23:58:32 PST
Check out the attached reduction. 

The patch for 5518 caused this. I'm surprised Mitz didn't catch it; he must be slipping... :)
Comment 1 Geoffrey Garen 2006-01-01 23:59:06 PST
Created attachment 5414 [details]
reduction
Comment 2 Geoffrey Garen 2006-01-02 00:12:28 PST
Sorry, not 5518; rdar://problem/4268278.
Comment 3 Geoffrey Garen 2006-01-08 22:20:29 PST
Created attachment 5562 [details]
Fix

Darin had a look at a previous incarnation of this patch, but I think I've
found a better way that is more in tune with the loader's natural behavior.
Comment 4 Geoffrey Garen 2006-01-08 22:22:01 PST
Comment on attachment 5562 [details]
Fix

The key to this new patch is:

+    } else if ([_private->subresourceLoaders count] > 0) {
+	 // The main resource loader already finished loading. Set the
cancelled error on the 
+	 // document and let the subresourceLoaders send individual cancelled
messages below.
+	 [self _setMainDocumentError:[self _cancelledError]];
     } else {
-	 // Main handle is already done. Set the cancelled error.
-	 NSError *cancelledError = [NSError
_webKitErrorWithDomain:NSURLErrorDomain
-							     
code:NSURLErrorCancelled
-							       URL:[self
_URL]];
-	 [self _setMainDocumentError:cancelledError];
+	 // If there are no resource loaders, we need to manufacture a
cancelled message.
+	 // (A back/forward navigation has no resource loaders because its
resources are cached.)
+	 [[self _webView] _mainReceivedError:[self _cancelledError]
+			      fromDataSource:self
+				    complete:YES];
     }
Comment 5 Darin Adler 2006-01-09 09:05:30 PST
Comment on attachment 5562 [details]
Fix

I would write "Cancels the DataSource's pending loads" as "Cancels the data
source's pending loads" (not important, just a comment in passing).

This looks better than the earlier fix you had me review last week.

r=me
Comment 6 Geoffrey Garen 2006-01-09 10:34:05 PST
Landed as revision 11963.