| 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 038cf60a8afc2b21412fab348d49efb7f0661d53..0cdca1c3c84e30ce55f07372e1a07eae4bf2c06a 100644
|
| --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
|
| @@ -83,6 +83,7 @@
|
| #include "core/xml/parser/XMLDocumentParser.h"
|
| #include "platform/Logging.h"
|
| #include "platform/PluginScriptForbiddenScope.h"
|
| +#include "platform/ScriptForbiddenScope.h"
|
| #include "platform/UserGestureIndicator.h"
|
| #include "platform/network/HTTPParsers.h"
|
| #include "platform/network/ResourceRequest.h"
|
| @@ -488,8 +489,13 @@ void FrameLoader::finishedParsing()
|
|
|
| m_progressTracker->finishedParsing();
|
|
|
| - if (client())
|
| + if (client()) {
|
| + ScriptForbiddenScope forbidScripts;
|
| client()->dispatchDidFinishDocumentLoad(m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true);
|
| + }
|
| +
|
| + if (client())
|
| + client()->runScriptsAtDocumentReady();
|
|
|
| checkCompleted();
|
|
|
| @@ -1485,9 +1491,16 @@ bool FrameLoader::shouldTreatURLAsSrcdocDocument(const KURL& url) const
|
|
|
| void FrameLoader::dispatchDocumentElementAvailable()
|
| {
|
| + ScriptForbiddenScope forbidScripts;
|
| client()->documentElementAvailable();
|
| }
|
|
|
| +void FrameLoader::runScriptsAtDocumentElementAvailable()
|
| +{
|
| + client()->runScriptsAtDocumentElementAvailable();
|
| + // The frame might be detached at this point.
|
| +}
|
| +
|
| void FrameLoader::dispatchDidClearDocumentOfWindowObject()
|
| {
|
| if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
|
|
|