Index: third_party/WebKit/Source/core/page/Page.cpp |
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp |
index ff71fae0c65ade2aa799053f8718ba2b8a3e55f3..e2706cfb914652bbe9c3708c7839d61f0982cad9 100644 |
--- a/third_party/WebKit/Source/core/page/Page.cpp |
+++ b/third_party/WebKit/Source/core/page/Page.cpp |
@@ -19,6 +19,7 @@ |
#include "core/page/Page.h" |
+#include "bindings/core/v8/ScriptController.h" |
#include "core/css/resolver/ViewportStyleResolver.h" |
#include "core/dom/ClientRectList.h" |
#include "core/dom/StyleChangeReason.h" |
@@ -421,6 +422,20 @@ void Page::settingsChanged(SettingsDelegate::ChangeType changeType) |
} |
} |
break; |
+ case SettingsDelegate::DOMWorldsChange: |
+ { |
+ if (!settings().forceMainWorldInitialization()) |
+ break; |
+ if (!mainFrame() || !mainFrame()->isLocalFrame()) |
+ break; |
+ if (!toLocalFrame(mainFrame())->loader().stateMachine()->committedFirstRealDocumentLoad()) |
+ break; |
+ for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { |
+ if (frame->isLocalFrame()) |
+ toLocalFrame(frame)->script().initializeMainWorld(); |
+ } |
+ } |
+ break; |
} |
} |