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 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 | 1329 |
1330 CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState)
const | 1330 CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState)
const |
1331 { | 1331 { |
1332 if (!scriptState->world().isMainWorld()) | 1332 if (!scriptState->world().isMainWorld()) |
1333 return nullptr; | 1333 return nullptr; |
1334 return customElements(); | 1334 return customElements(); |
1335 } | 1335 } |
1336 | 1336 |
1337 CustomElementsRegistry* LocalDOMWindow::customElements() const | 1337 CustomElementsRegistry* LocalDOMWindow::customElements() const |
1338 { | 1338 { |
1339 if (!m_customElements) | 1339 if (!m_customElements && m_document) |
1340 m_customElements = CustomElementsRegistry::create(document()->registrati
onContext()); | 1340 m_customElements = CustomElementsRegistry::create(document()); |
1341 return m_customElements; | 1341 return m_customElements; |
1342 } | 1342 } |
1343 | 1343 |
1344 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) | 1344 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) |
1345 { | 1345 { |
1346 DOMWindow::addedEventListener(eventType, registeredListener); | 1346 DOMWindow::addedEventListener(eventType, registeredListener); |
1347 if (frame() && frame()->host()) | 1347 if (frame() && frame()->host()) |
1348 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); | 1348 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); |
1349 | 1349 |
1350 if (Document* document = this->document()) | 1350 if (Document* document = this->document()) |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 { | 1538 { |
1539 // If the LocalDOMWindow still has a frame reference, that frame must point | 1539 // If the LocalDOMWindow still has a frame reference, that frame must point |
1540 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1540 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1541 // where script execution leaks between different LocalDOMWindows. | 1541 // where script execution leaks between different LocalDOMWindows. |
1542 if (m_frameObserver->frame()) | 1542 if (m_frameObserver->frame()) |
1543 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1543 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1544 return m_frameObserver->frame(); | 1544 return m_frameObserver->frame(); |
1545 } | 1545 } |
1546 | 1546 |
1547 } // namespace blink | 1547 } // namespace blink |
OLD | NEW |