Index: Source/WebCore/page/DOMWindow.cpp |
=================================================================== |
--- Source/WebCore/page/DOMWindow.cpp (revision 112895) |
+++ Source/WebCore/page/DOMWindow.cpp (working copy) |
@@ -951,11 +951,11 @@ |
if (context) { |
ASSERT(isMainThread()); |
- Frame* activeFrame = static_cast<Document*>(context)->frame(); |
- if (!activeFrame) |
+ Document* activeDocument = static_cast<Document*>(context); |
+ if (!activeDocument) |
return; |
- if (!activeFrame->loader()->shouldAllowNavigation(m_frame)) |
+ if (!activeDocument->canNavigate(m_frame)) |
return; |
} |
@@ -1674,11 +1674,11 @@ |
if (!isCurrentlyDisplayedInFrame()) |
return; |
- Frame* activeFrame = activeWindow->frame(); |
- if (!activeFrame) |
+ Document* activeDocument = activeWindow->document(); |
+ if (!activeDocument) |
return; |
- if (!activeFrame->loader()->shouldAllowNavigation(m_frame)) |
+ if (!activeDocument->canNavigate(m_frame)) |
return; |
Frame* firstFrame = firstWindow->frame(); |
@@ -1693,8 +1693,9 @@ |
return; |
// We want a new history item if we are processing a user gesture. |
- m_frame->navigationScheduler()->scheduleLocationChange(activeFrame->document()->securityOrigin(), |
- completedURL, activeFrame->loader()->outgoingReferrer(), |
+ m_frame->navigationScheduler()->scheduleLocationChange(activeDocument->securityOrigin(), |
+ // FIXME: What if activeDocument()->frame() is 0? |
+ completedURL, activeDocument->frame()->loader()->outgoingReferrer(), |
locking != LockHistoryBasedOnGestureState || !ScriptController::processingUserGesture(), |
locking != LockHistoryBasedOnGestureState); |
} |
@@ -1801,8 +1802,8 @@ |
{ |
if (!isCurrentlyDisplayedInFrame()) |
return 0; |
- Frame* activeFrame = activeWindow->frame(); |
- if (!activeFrame) |
+ Document* activeDocument = activeWindow->document(); |
+ if (!activeDocument) |
return 0; |
Frame* firstFrame = firstWindow->frame(); |
if (!firstFrame) |
@@ -1827,7 +1828,7 @@ |
targetFrame = m_frame; |
} |
if (targetFrame) { |
- if (!activeFrame->loader()->shouldAllowNavigation(targetFrame)) |
+ if (!activeDocument->canNavigate(targetFrame)) |
return 0; |
KURL completedURL = firstFrame->document()->completeURL(urlString); |
@@ -1842,7 +1843,7 @@ |
// determine the outgoing referrer. We replicate that behavior here. |
bool lockHistory = !ScriptController::processingUserGesture(); |
targetFrame->navigationScheduler()->scheduleLocationChange( |
- activeFrame->document()->securityOrigin(), |
+ activeDocument->securityOrigin(), |
completedURL, |
firstFrame->loader()->outgoingReferrer(), |
lockHistory, |