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 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState)
const | 1327 CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState)
const |
1328 { | 1328 { |
1329 if (!scriptState->world().isMainWorld()) | 1329 if (!scriptState->world().isMainWorld()) |
1330 return nullptr; | 1330 return nullptr; |
1331 return customElements(); | 1331 return customElements(); |
1332 } | 1332 } |
1333 | 1333 |
1334 CustomElementsRegistry* LocalDOMWindow::customElements() const | 1334 CustomElementsRegistry* LocalDOMWindow::customElements() const |
1335 { | 1335 { |
1336 if (!m_customElements && m_document) | 1336 if (!m_customElements && m_document) |
1337 m_customElements = CustomElementsRegistry::create(document()); | 1337 m_customElements = CustomElementsRegistry::create(this); |
1338 return m_customElements; | 1338 return m_customElements; |
1339 } | 1339 } |
1340 | 1340 |
| 1341 CustomElementsRegistry* LocalDOMWindow::maybeCustomElements() const |
| 1342 { |
| 1343 return m_customElements; |
| 1344 } |
| 1345 |
1341 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) | 1346 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) |
1342 { | 1347 { |
1343 DOMWindow::addedEventListener(eventType, registeredListener); | 1348 DOMWindow::addedEventListener(eventType, registeredListener); |
1344 if (frame() && frame()->host()) | 1349 if (frame() && frame()->host()) |
1345 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); | 1350 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); |
1346 | 1351 |
1347 if (Document* document = this->document()) | 1352 if (Document* document = this->document()) |
1348 document->addListenerTypeIfNeeded(eventType); | 1353 document->addListenerTypeIfNeeded(eventType); |
1349 | 1354 |
1350 for (auto& it : m_eventListenerObservers) { | 1355 for (auto& it : m_eventListenerObservers) { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 { | 1548 { |
1544 // If the LocalDOMWindow still has a frame reference, that frame must point | 1549 // If the LocalDOMWindow still has a frame reference, that frame must point |
1545 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1550 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1546 // where script execution leaks between different LocalDOMWindows. | 1551 // where script execution leaks between different LocalDOMWindows. |
1547 if (m_frameObserver->frame()) | 1552 if (m_frameObserver->frame()) |
1548 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1553 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1549 return m_frameObserver->frame(); | 1554 return m_frameObserver->frame(); |
1550 } | 1555 } |
1551 | 1556 |
1552 } // namespace blink | 1557 } // namespace blink |
OLD | NEW |