| Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
|
| diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
|
| index fd31c7bb45871c054a182fb7c16e5c39aa1fb9fa..f49584b5abb2039ac5caa22d544f57a70038f02f 100644
|
| --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
|
| @@ -718,6 +718,19 @@ void FrameLoader::checkCompleted() {
|
| if (!shouldComplete(m_frame->document()))
|
| return;
|
|
|
| + if (client()) {
|
| + client()->runScriptsAtDocumentIdle();
|
| +
|
| + // Injected scripts may have disconnected this frame.
|
| + if (!client())
|
| + return;
|
| +
|
| + // Check again, because runScriptsAtDocumentIdle() may have delayed the load
|
| + // event.
|
| + if (!shouldComplete(m_frame->document()))
|
| + return;
|
| + }
|
| +
|
| // OK, completed.
|
| m_frame->document()->setReadyState(Document::Complete);
|
| if (m_frame->document()->loadEventStillNeeded())
|
|
|