#include <WebCore/WebCoreThread.h>
+#include <WebKit/WebKitErrors.h>
#include <WebKit/WebPreferences.h>
#include <WebKit/DOMCSSPrimitiveValue.h>
if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled)
return;
+ if ([[error domain] isEqualToString:WebKitErrorDomain] && [error code] == WebKitErrorFrameLoadInterruptedByPolicyChange) {
+ request_ = (id) stage2_;
+ stage1_ = nil;
+ stage2_ = nil;
+ return;
+ }
+
if ([frame parentFrame] == nil) {
[self loadURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?%@",
[[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"error" ofType:@"html"]] absoluteString],
}
- (void) webView:(WebView *)view didDecidePolicy:(CYWebPolicyDecision)decision forNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame {
- if (decision == CYWebPolicyDecisionUse && !error_)
- request_ = request;
+ if ([frame parentFrame] == nil)
+ if (decision == CYWebPolicyDecisionUse)
+ if (!error_) {
+ stage1_ = (id) request_;
+ request_ = request;
+ }
}
- (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frame decisionListener:(id<WebPolicyDecisionListener>)listener {
[loading_ removeObject:[NSValue valueWithNonretainedObject:frame]];
if ([frame parentFrame] == nil) {
+ stage1_ = nil;
+ stage2_ = nil;
+
if (DOMDocument *document = [frame DOMDocument])
if (DOMNodeList<NSFastEnumeration> *bodies = [document getElementsByTagName:@"body"])
for (DOMHTMLBodyElement *body in (id) bodies) {
style_ = nil;
function_ = nil;
+ stage2_ = (id) stage1_;
+ stage1_ = nil;
+
[self setHidesNavigationBar:NO];
// XXX: do we still need to do this?