Modified: trunk/Source/WebCore/ChangeLog (167851 => 167852)
--- trunk/Source/WebCore/ChangeLog 2014-04-27 04:09:45 UTC (rev 167851)
+++ trunk/Source/WebCore/ChangeLog 2014-04-27 08:15:13 UTC (rev 167852)
@@ -1,3 +1,15 @@
+2014-04-27 David Kilzer <[email protected]>
+
+ Roll out changes not part of the patch reviewed for Bug 132089
+ <http://webkit.org/b/132089>
+
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadOrRedirectSubframe):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::setLocation):
+ (WebCore::DOMWindow::createWindow):
+ (WebCore::DOMWindow::open):
+
2014-04-26 Darin Adler <[email protected]>
Frame and page lifetime fixes in WebCore::createWindow
Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (167851 => 167852)
--- trunk/Source/WebCore/loader/SubframeLoader.cpp 2014-04-27 04:09:45 UTC (rev 167851)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp 2014-04-27 08:15:13 UTC (rev 167852)
@@ -322,9 +322,6 @@
Frame* SubframeLoader::loadOrRedirectSubframe(HTMLFrameOwnerElement& ownerElement, const URL& url, const AtomicString& frameName, LockHistory lockHistory, LockBackForwardList lockBackForwardList)
{
- if (!url.isValid())
- return nullptr;
-
Frame* frame = ownerElement.contentFrame();
if (frame)
frame->navigationScheduler().scheduleLocationChange(m_frame.document()->securityOrigin(), url.string(), m_frame.loader().outgoingReferrer(), lockHistory, lockBackForwardList);
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (167851 => 167852)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2014-04-27 04:09:45 UTC (rev 167851)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2014-04-27 08:15:13 UTC (rev 167852)
@@ -1891,20 +1891,19 @@
return;
URL completedURL = firstFrame->document()->completeURL(urlString);
- if (!completedURL.isValid())
+ if (completedURL.isNull())
return;
if (isInsecureScriptAccess(activeWindow, completedURL))
return;
- Frame* referrerFrame = activeDocument->frame();
- if (!referrerFrame)
- return;
-
// We want a new history item if we are processing a user gesture.
LockHistory lockHistory = (locking != LockHistoryBasedOnGestureState || !ScriptController::processingUserGesture()) ? LockHistory::Yes : LockHistory::No;
LockBackForwardList lockBackForwardList = (locking != LockHistoryBasedOnGestureState) ? LockBackForwardList::Yes : LockBackForwardList::No;
- m_frame->navigationScheduler().scheduleLocationChange(activeDocument->securityOrigin(), completedURL, referrerFrame->loader().outgoingReferrer(), lockHistory, lockBackForwardList);
+ m_frame->navigationScheduler().scheduleLocationChange(activeDocument->securityOrigin(),
+ // FIXME: What if activeDocument()->frame() is 0?
+ completedURL, activeDocument->frame()->loader().outgoingReferrer(),
+ lockHistory, lockBackForwardList);
}
void DOMWindow::printErrorMessage(const String& message)
@@ -1989,7 +1988,7 @@
if (!completedURL.isEmpty() && !completedURL.isValid()) {
// Don't expose client code to invalid URLs.
activeWindow.printErrorMessage("Unable to open a window with invalid URL '" + completedURL.string() + "'.\n");
- return nullptr;
+ return 0;
}
// For whatever reason, Firefox uses the first frame to determine the outgoingReferrer. We replicate that behavior here.
@@ -2004,7 +2003,7 @@
bool created;
RefPtr<Frame> newFrame = WebCore::createWindow(activeFrame, openerFrame, frameRequest, windowFeatures, created);
if (!newFrame)
- return nullptr;
+ return 0;
newFrame->loader().setOpener(openerFrame);
newFrame->page()->setOpenedByDOM();
@@ -2033,24 +2032,24 @@
DOMWindow& activeWindow, DOMWindow& firstWindow)
{
if (!isCurrentlyDisplayedInFrame())
- return nullptr;
+ return 0;
Document* activeDocument = activeWindow.document();
if (!activeDocument)
- return nullptr;
+ return 0;
Frame* firstFrame = firstWindow.frame();
if (!firstFrame)
- return nullptr;
+ return 0;
if (!firstWindow.allowPopUp()) {
// Because FrameTree::find() returns true for empty strings, we must check for empty frame names.
// Otherwise, illegitimate window.open() calls with no name will pass right through the popup blocker.
if (frameName.isEmpty() || !m_frame->tree().find(frameName))
- return nullptr;
+ return 0;
}
// Get the target frame for the special cases of _top and _parent.
// In those cases, we schedule a location change right now and return early.
- Frame* targetFrame = nullptr;
+ Frame* targetFrame = 0;
if (frameName == "_top")
targetFrame = &m_frame->tree().top();
else if (frameName == "_parent") {
@@ -2061,11 +2060,9 @@
}
if (targetFrame) {
if (!activeDocument->canNavigate(targetFrame))
- return nullptr;
+ return 0;
URL completedURL = firstFrame->document()->completeURL(urlString);
- if (!completedURL.isValid())
- return nullptr;
if (targetFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
return targetFrame->document()->domWindow();
@@ -2083,7 +2080,7 @@
WindowFeatures windowFeatures(windowFeaturesString);
RefPtr<Frame> result = createWindow(urlString, frameName, windowFeatures, activeWindow, firstFrame, m_frame);
- return result ? result->document()->domWindow() : nullptr;
+ return result ? result->document()->domWindow() : 0;
}
void DOMWindow::showModalDialog(const String& urlString, const String& dialogFeaturesString, DOMWindow& activeWindow, DOMWindow& firstWindow, std::function<void (DOMWindow&)> prepareDialogFunction)