Summary: | REGRESSION: form events don't fire after back/forward navigation, due to inconsistent load state | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> | ||||||
Component: | JavaScriptCore | Assignee: | Geoffrey Garen <ggaren> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | ||||||||
Priority: | P1 | ||||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Attachments: |
|
Description
Geoffrey Garen
2006-01-01 23:58:32 PST
Created attachment 5414 [details]
reduction
Sorry, not 5518; rdar://problem/4268278. 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 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 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
Landed as revision 11963. |