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