Commit 3a55cfde authored by trey's avatar trey
Browse files

Fixed client redirects, some more. The upshot is that they do not

	generate two items in the back-forward list.  iBench still works.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge reportClientRedirectTo:delay:fireDate:]):  Call straight to the frame for all impl.
        (-[WebBridge reportClientRedirectCancelled]):  Call straight to the frame for all impl.
        (-[WebBridge loadURL:reload:triggeringEvent:isFormSubmission:]):
	clientRedirect param removed when sending _loadURL: to frame.
        * WebView.subproj/WebFramePrivate.h:
        * WebView.subproj/WebFramePrivate.m:
        (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
	clientRedirect param  removed. Check our own ivar to know if we are in client redirect case.
        (-[WebFrame _loadURL:intoChild:]):
	clientRedirect param removed when sending _loadURL: .
        (-[WebFrame _clientRedirectedTo:delay:fireDate:]):
	Note that we are doing a redirect if time=0 and we're not completed.  Also includes
	previous impl moved from Bridge.
        (-[WebFrame _clientRedirectCancelled]):  Previous impl moved from Bridge.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 53a8ad15
2002-11-13 Trey Matteson <trey@apple.com>
Fixed client redirects, some more. The upshot is that they do not
generate two items in the back-forward list. iBench still works.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge reportClientRedirectTo:delay:fireDate:]): Call straight to the frame for all impl.
(-[WebBridge reportClientRedirectCancelled]): Call straight to the frame for all impl.
(-[WebBridge loadURL:reload:triggeringEvent:isFormSubmission:]):
clientRedirect param removed when sending _loadURL: to frame.
* WebView.subproj/WebFramePrivate.h:
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
clientRedirect param removed. Check our own ivar to know if we are in client redirect case.
(-[WebFrame _loadURL:intoChild:]):
clientRedirect param removed when sending _loadURL: .
(-[WebFrame _clientRedirectedTo:delay:fireDate:]):
Note that we are doing a redirect if time=0 and we're not completed. Also includes
previous impl moved from Bridge.
(-[WebFrame _clientRedirectCancelled]): Previous impl moved from Bridge.
2002-11-13 Maciej Stachowiak <mjs@apple.com>
 
Pass mime type instead of full response to content policy delegate
......
2002-11-13 Trey Matteson <trey@apple.com>
Fixed client redirects, some more. The upshot is that they do not
generate two items in the back-forward list. iBench still works.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge reportClientRedirectTo:delay:fireDate:]): Call straight to the frame for all impl.
(-[WebBridge reportClientRedirectCancelled]): Call straight to the frame for all impl.
(-[WebBridge loadURL:reload:triggeringEvent:isFormSubmission:]):
clientRedirect param removed when sending _loadURL: to frame.
* WebView.subproj/WebFramePrivate.h:
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
clientRedirect param removed. Check our own ivar to know if we are in client redirect case.
(-[WebFrame _loadURL:intoChild:]):
clientRedirect param removed when sending _loadURL: .
(-[WebFrame _clientRedirectedTo:delay:fireDate:]):
Note that we are doing a redirect if time=0 and we're not completed. Also includes
previous impl moved from Bridge.
(-[WebFrame _clientRedirectCancelled]): Previous impl moved from Bridge.
2002-11-13 Maciej Stachowiak <mjs@apple.com>
 
Pass mime type instead of full response to content policy delegate
......
......@@ -227,18 +227,12 @@ - (BOOL)isReloading
- (void)reportClientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date
{
LOG(Redirect, "Client redirect to: %@", URL);
[[[frame controller] locationChangeDelegate] clientWillRedirectTo:URL delay:seconds fireDate:date forFrame:frame];
if (seconds == 0.0) {
// used to set loadType to internal, to prevent a redirect from going in the backforward list
_doingClientRedirect = YES;
}
[frame _clientRedirectedTo:URL delay:seconds fireDate:date];
}
- (void)reportClientRedirectCancelled
{
[[[frame controller] locationChangeDelegate] clientRedirectCancelledForFrame:frame];
_doingClientRedirect = NO;
[frame _clientRedirectCancelled];
}
- (void)setFrame:(WebFrame *)webFrame
......@@ -273,8 +267,7 @@ - (void)setIconURL:(NSURL *)URL withType:(NSString *)type
- (void)loadURL:(NSURL *)URL reload:(BOOL)reload triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission
{
[frame _loadURL:URL loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard) clientRedirect:_doingClientRedirect triggeringEvent:event isFormSubmission:isFormSubmission];
_doingClientRedirect = NO;
[frame _loadURL:URL loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard) triggeringEvent:event isFormSubmission:isFormSubmission];
}
- (void)postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event
......
......@@ -63,6 +63,7 @@ typedef enum {
WebHistoryItem *provisionalItem; // BF item for where we're trying to go
// (only known when navigating to a pre-existing BF item)
WebHistoryItem *previousItem; // BF item for previous content, see _itemForSavingDocState
BOOL instantRedirectComing;
}
- (void)setName:(NSString *)name;
......@@ -110,10 +111,13 @@ typedef enum {
- (NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event;
- (BOOL)_continueAfterNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource;
- (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type;
- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType clientRedirect:(BOOL)clientRedirect triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission;
- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission;
- (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame;
- (void)_postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event;
- (void)_clientRedirectedTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
- (void)_clientRedirectCancelled;
- (void)_saveScrollPositionToItem:(WebHistoryItem *)item;
- (void)_restoreScrollPosition;
- (void)_scrollToTop;
......
......@@ -1041,7 +1041,7 @@ -(BOOL)_continueAfterNavigationPolicyForRequest:(WebResourceRequest *)request da
}
// main funnel for navigating via callback from WebCore (e.g., clicking a link, redirect)
- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType clientRedirect:(BOOL)clientRedirect triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission
- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission
{
WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
[request setReferrer:[_private->bridge referrer]];
......@@ -1092,13 +1092,13 @@ - (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType clientRedirect
} else {
WebFrameLoadType previousLoadType = [self _loadType];
WebDataSource *oldDataSource = [[self dataSource] retain];
WebFrameState stateBeforeStartingLoad = [self _state];
[self _loadRequest:request triggeringAction:action];
// NB: must be done after loadRequest:, which sets the provDataSource, which
// inits the load type to Standard
[self _setLoadType:loadType];
if (clientRedirect && stateBeforeStartingLoad != WebFrameStateComplete) {
if (_private->instantRedirectComing) {
_private->instantRedirectComing = NO;
// Inherit the loadType from the operation that spawned the redirect
[self _setLoadType:previousLoadType];
......@@ -1136,7 +1136,7 @@ - (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame
}
}
[childFrame _loadURL:URL loadType:childLoadType clientRedirect:NO triggeringEvent:nil isFormSubmission:NO];
[childFrame _loadURL:URL loadType:childLoadType triggeringEvent:nil isFormSubmission:NO];
// want this here???
if (childItem) {
if (loadType != WebFrameLoadTypeReload) {
......@@ -1168,6 +1168,23 @@ - (void)_postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)co
[request release];
}
- (void)_clientRedirectedTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date
{
LOG(Redirect, "Client redirect to: %@", URL);
[[[self controller] locationChangeDelegate] clientWillRedirectTo:URL delay:seconds fireDate:date forFrame:self];
// If a zero-time redirect comes in and we're still finishing the previous page, we set
// a special mode so we treat the next load as part of the same navigation.
if (seconds == 0.0 && [self _state] != WebFrameStateComplete) {
_private->instantRedirectComing = YES;
}
}
- (void)_clientRedirectCancelled
{
[[[self controller] locationChangeDelegate] clientRedirectCancelledForFrame:self];
_private->instantRedirectComing = NO;
}
- (void)_saveScrollPositionToItem:(WebHistoryItem *)item
{
if (item) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment