OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 return document->requestIdleCallback(callback, options); | 1315 return document->requestIdleCallback(callback, options); |
1316 return 0; | 1316 return 0; |
1317 } | 1317 } |
1318 | 1318 |
1319 void LocalDOMWindow::cancelIdleCallback(int id) | 1319 void LocalDOMWindow::cancelIdleCallback(int id) |
1320 { | 1320 { |
1321 if (Document* document = this->document()) | 1321 if (Document* document = this->document()) |
1322 document->cancelIdleCallback(id); | 1322 document->cancelIdleCallback(id); |
1323 } | 1323 } |
1324 | 1324 |
1325 CustomElementsRegistry* LocalDOMWindow::customElements() const | 1325 CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState)
const |
1326 { | 1326 { |
| 1327 if (!scriptState->world().isMainWorld()) |
| 1328 return nullptr; |
1327 if (!m_customElements) | 1329 if (!m_customElements) |
1328 m_customElements = CustomElementsRegistry::create(); | 1330 m_customElements = CustomElementsRegistry::create(scriptState, document(
)->registrationContext()); |
1329 return m_customElements.get(); | 1331 return m_customElements.get(); |
1330 } | 1332 } |
1331 | 1333 |
1332 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) | 1334 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) |
1333 { | 1335 { |
1334 DOMWindow::addedEventListener(eventType, registeredListener); | 1336 DOMWindow::addedEventListener(eventType, registeredListener); |
1335 if (frame() && frame()->host()) | 1337 if (frame() && frame()->host()) |
1336 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); | 1338 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); |
1337 | 1339 |
1338 if (Document* document = this->document()) | 1340 if (Document* document = this->document()) |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 { | 1530 { |
1529 // If the LocalDOMWindow still has a frame reference, that frame must point | 1531 // If the LocalDOMWindow still has a frame reference, that frame must point |
1530 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1532 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1531 // where script execution leaks between different LocalDOMWindows. | 1533 // where script execution leaks between different LocalDOMWindows. |
1532 if (m_frameObserver->frame()) | 1534 if (m_frameObserver->frame()) |
1533 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1535 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1534 return m_frameObserver->frame(); | 1536 return m_frameObserver->frame(); |
1535 } | 1537 } |
1536 | 1538 |
1537 } // namespace blink | 1539 } // namespace blink |
OLD | NEW |