Commit f9c8c5c9 authored by mkosiba@chromium.org's avatar mkosiba@chromium.org

Don't stop the documentLoader on navigations.

If the new navigation will be canceled by a Browser-side throttle we
don't want to cancel the currently loading document.

BUG=308257, 378716

Review URL: https://codereview.chromium.org/181493007

git-svn-id: svn://svn.chromium.org/blink/trunk@175269 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent cb8ee97f
...@@ -3,4 +3,8 @@ If we drag files onto an editable area, then the filenames should be inserted in ...@@ -3,4 +3,8 @@ If we drag files onto an editable area, then the filenames should be inserted in
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
FAIL result should be <div>LayoutTests/editing/pasteboard/foo</div><div>LayoutTests/editing/pasteboard/bar</div><div>LayoutTests/editing/pasteboard/baz</div>. Was .
PASS successfullyParsed is true
TEST COMPLETE
...@@ -11,6 +11,7 @@ function createInput(name) { ...@@ -11,6 +11,7 @@ function createInput(name) {
div.addEventListener('drop', function(e) { div.addEventListener('drop', function(e) {
debug('PASS: drop event is fired.'); debug('PASS: drop event is fired.');
e.preventDefault();
}); });
return div; return div;
......
...@@ -14,6 +14,7 @@ function createBox(name) { ...@@ -14,6 +14,7 @@ function createBox(name) {
}); });
div.addEventListener('drop', function(e) { div.addEventListener('drop', function(e) {
debug('PASS: drop event is fired.'); debug('PASS: drop event is fired.');
e.preventDefault();
}); });
return div; return div;
......
This is a test for https://bugs.webkit.org/show_bug.cgi?id=29276. It passes if it does not crash. If not run from DRT, drag a file onto the file input. PASS
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
{ {
window.scrollBy(0, 1000); window.scrollBy(0, 1000);
if (window.eventSender) { if (window.eventSender) {
eventSender.beginDragWithFiles(["resources/abe.png"]); eventSender.beginDragWithFiles(["resources/drag-file-crash-pass.html"]);
var fileInput = document.getElementById('file'); var fileInput = document.getElementById('file');
moveMouseToCenterOfElement(fileInput); moveMouseToCenterOfElement(fileInput);
eventSender.mouseUp(); eventSender.mouseUp();
......
...@@ -11,10 +11,11 @@ function log(text) ...@@ -11,10 +11,11 @@ function log(text)
document.body.appendChild(document.createElement('br')); document.body.appendChild(document.createElement('br'));
document.body.appendChild(document.createElement('div').appendChild(document.createTextNode(text))); document.body.appendChild(document.createElement('div').appendChild(document.createTextNode(text)));
} }
window.addEventListener('beforeunload', function () window.addEventListener('beforeunload', function (e)
{ {
log('PASS'); log('PASS');
testRunner.notifyDone(); testRunner.notifyDone();
e.preventDefault();
}); });
document.body.addEventListener('dragenter', function (event) document.body.addEventListener('dragenter', function (event)
{ {
...@@ -41,7 +42,6 @@ document.body.addEventListener('drop', function (event) ...@@ -41,7 +42,6 @@ document.body.addEventListener('drop', function (event)
window.setTimeout(function () window.setTimeout(function ()
{ {
// Deadman's switch so we don't need to wait for the test to timeout to fail. // Deadman's switch so we don't need to wait for the test to timeout to fail.
log('FAIL');
testRunner.notifyDone(); testRunner.notifyDone();
}, 0); }, 0);
})(); })();
......
...@@ -54,9 +54,10 @@ window.onload = function() ...@@ -54,9 +54,10 @@ window.onload = function()
testRunner.dumpAsText(); testRunner.dumpAsText();
testRunner.waitUntilDone(); testRunner.waitUntilDone();
window.addEventListener('beforeunload', function () { window.addEventListener('beforeunload', function (e) {
if (!dropReceived) if (!dropReceived)
log('Drop not received'); log('Drop not received');
e.preventDefault();
testRunner.notifyDone(); testRunner.notifyDone();
}); });
......
...@@ -941,6 +941,10 @@ bool FrameLoader::checkLoadCompleteForThisFrame() ...@@ -941,6 +941,10 @@ bool FrameLoader::checkLoadCompleteForThisFrame()
ASSERT(client()->hasWebView()); ASSERT(client()->hasWebView());
RefPtr<LocalFrame> protect(m_frame); RefPtr<LocalFrame> protect(m_frame);
bool allChildrenAreDoneLoading = true;
for (LocalFrame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling())
allChildrenAreDoneLoading &= child->loader().checkLoadCompleteForThisFrame();
if (m_state == FrameStateProvisional && m_provisionalDocumentLoader) { if (m_state == FrameStateProvisional && m_provisionalDocumentLoader) {
const ResourceError& error = m_provisionalDocumentLoader->mainDocumentError(); const ResourceError& error = m_provisionalDocumentLoader->mainDocumentError();
if (error.isNull()) if (error.isNull())
...@@ -956,9 +960,6 @@ bool FrameLoader::checkLoadCompleteForThisFrame() ...@@ -956,9 +960,6 @@ bool FrameLoader::checkLoadCompleteForThisFrame()
return true; return true;
} }
bool allChildrenAreDoneLoading = true;
for (LocalFrame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling())
allChildrenAreDoneLoading &= child->loader().checkLoadCompleteForThisFrame();
if (!allChildrenAreDoneLoading) if (!allChildrenAreDoneLoading)
return false; return false;
...@@ -1293,8 +1294,13 @@ void FrameLoader::loadWithNavigationAction(const NavigationAction& action, Frame ...@@ -1293,8 +1294,13 @@ void FrameLoader::loadWithNavigationAction(const NavigationAction& action, Frame
return; return;
} }
// A new navigation is in progress, so don't clear the history's provisional item. if (m_provisionalDocumentLoader) {
stopAllLoaders(); m_provisionalDocumentLoader->stopLoading();
if (m_provisionalDocumentLoader)
m_provisionalDocumentLoader->detachFromFrame();
m_provisionalDocumentLoader = nullptr;
}
m_checkTimer.stop();
// <rdar://problem/6250856> - In certain circumstances on pages with multiple frames, stopAllLoaders() // <rdar://problem/6250856> - In certain circumstances on pages with multiple frames, stopAllLoaders()
// might detach the current FrameLoader, in which case we should bail on this newly defunct load. // might detach the current FrameLoader, in which case we should bail on this newly defunct load.
......
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