[webkit-changes] cvs commit: WebKit/WebView.subproj WebFrame.m
Adele
adele at opensource.apple.com
Fri Jul 15 22:53:05 PDT 2005
adele 05/07/15 22:53:05
Modified: . ChangeLog
WebView.subproj WebFrame.m
Log:
Written by Trey Matteson <trey at usa.net>
Reviewed by John Sullivan.
Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3910 - REGRESSION: Replying "Cancel" to the form repost nag leaves wrong b/f cursor
* WebView.subproj/WebFrame.m:
(-[WebFrame _resetBackForwardList]): new helper method
(-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]):
If the delegate bailed on the navigation, tell the main frame
to reset the b/f cursor back to where it was before we started.
Revision Changes Path
1.3232 +13 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3231
retrieving revision 1.3232
diff -u -r1.3231 -r1.3232
--- ChangeLog 15 Jul 2005 22:59:15 -0000 1.3231
+++ ChangeLog 16 Jul 2005 05:53:01 -0000 1.3232
@@ -1,3 +1,16 @@
+2005-07-15 Adele Peterson <adele at apple.com>
+
+ Written by Trey Matteson <trey at usa.net>
+ Reviewed by John Sullivan.
+
+ Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3910 - REGRESSION: Replying "Cancel" to the form repost nag leaves wrong b/f cursor
+
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame _resetBackForwardList]): new helper method
+ (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]):
+ If the delegate bailed on the navigation, tell the main frame
+ to reset the b/f cursor back to where it was before we started.
+
2005-07-15 John Sullivan <sullivan at apple.com>
Written by Trey Matteson
1.242 +20 -1 WebKit/WebView.subproj/WebFrame.m
Index: WebFrame.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebFrame.m,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -r1.241 -r1.242
--- WebFrame.m 14 Jul 2005 23:06:10 -0000 1.241
+++ WebFrame.m 16 Jul 2005 05:53:04 -0000 1.242
@@ -2233,6 +2233,16 @@
return path;
}
+- (void)_resetBackForwardList
+{
+ // Note this doesn't verify the current load type as a b/f operation because it is called from
+ // a subframe in the case of a delegate bailing out of the nav before it even gets to provisional state.
+ ASSERT(self == [[self webView] mainFrame]);
+ WebHistoryItem *resetItem = [_private currentItem];
+ if (resetItem)
+ [[[self webView] backForwardList] goToItem:resetItem];
+}
+
// If we bailed out of a b/f navigation, we might need to set the b/f cursor back to the current
// item, because we optimistically move it right away at the start of the operation. But when
// alternate content is loaded for an unreachableURL, we don't want to reset the b/f cursor.
@@ -2320,8 +2330,18 @@
// through this method already, nested; otherwise, _private->policyDataSource should still be set.
ASSERT(_private->policyDataSource || [[self provisionalDataSource] unreachableURL] != nil);
+ WebHistoryItem *item = [_private provisionalItem];
if (!request) {
[self _setPolicyDataSource:nil];
+ // If the delegate punts on the navigation, we have the problem that we have optimistically moved
+ // the b/f cursor already, so move it back. For sanity we only do this if the navigation of the
+ // target frame or top-level frame is canceled. A primary case of this is the user responding
+ // Cancel to the form repost nag sheet.
+ if (([item isTargetItem] || [[self webView] mainFrame] == self)
+ && (_private->policyLoadType == WebFrameLoadTypeForward
+ || _private->policyLoadType == WebFrameLoadTypeBack
+ || _private->policyLoadType == WebFrameLoadTypeIndexedBackForward))
+ [[[self webView] mainFrame] _resetBackForwardList];
return;
}
@@ -2343,7 +2363,6 @@
if (self == [[self webView] mainFrame])
LOG(DocumentLoad, "loading %@", [[[self provisionalDataSource] request] URL]);
- WebHistoryItem *item = [_private provisionalItem];
if ((loadType == WebFrameLoadTypeForward ||
loadType == WebFrameLoadTypeBack ||
loadType == WebFrameLoadTypeIndexedBackForward) &&
More information about the webkit-changes
mailing list