| Index: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
|
| index acb4cfcd292594344964e315ca59425eaed2fd62..ca410ef58a8a9013af839fbca1ad794c770e9219 100644
|
| --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
|
| @@ -1324,8 +1324,10 @@ void LocalDOMWindow::cancelIdleCallback(int id)
|
|
|
| CustomElementsRegistry* LocalDOMWindow::customElements() const
|
| {
|
| - if (!m_customElements)
|
| - m_customElements = CustomElementsRegistry::create();
|
| + if (!m_customElements && frame()) {
|
| + ScriptState* scriptState = ScriptState::forMainWorld(frame());
|
| + m_customElements = CustomElementsRegistry::create(scriptState);
|
| + }
|
| return m_customElements.get();
|
| }
|
|
|
|
|