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 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 void LocalDOMWindow::cancelIdleCallback(int id) | 1324 void LocalDOMWindow::cancelIdleCallback(int id) |
1325 { | 1325 { |
1326 if (Document* document = this->document()) | 1326 if (Document* document = this->document()) |
1327 document->cancelIdleCallback(id); | 1327 document->cancelIdleCallback(id); |
1328 } | 1328 } |
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(); |
| 1335 } |
| 1336 |
| 1337 CustomElementsRegistry* LocalDOMWindow::customElements() const |
| 1338 { |
1334 if (!m_customElements) | 1339 if (!m_customElements) |
1335 m_customElements = CustomElementsRegistry::create(scriptState, document(
)->registrationContext()); | 1340 m_customElements = CustomElementsRegistry::create(document()->registrati
onContext()); |
1336 return m_customElements.get(); | 1341 return m_customElements; |
1337 } | 1342 } |
1338 | 1343 |
1339 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) | 1344 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
dEventListener& registeredListener) |
1340 { | 1345 { |
1341 DOMWindow::addedEventListener(eventType, registeredListener); | 1346 DOMWindow::addedEventListener(eventType, registeredListener); |
1342 if (frame() && frame()->host()) | 1347 if (frame() && frame()->host()) |
1343 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); | 1348 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, registeredListener.options()); |
1344 | 1349 |
1345 if (Document* document = this->document()) | 1350 if (Document* document = this->document()) |
1346 document->addListenerTypeIfNeeded(eventType); | 1351 document->addListenerTypeIfNeeded(eventType); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 { | 1538 { |
1534 // 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 |
1535 // 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 |
1536 // where script execution leaks between different LocalDOMWindows. | 1541 // where script execution leaks between different LocalDOMWindows. |
1537 if (m_frameObserver->frame()) | 1542 if (m_frameObserver->frame()) |
1538 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1543 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1539 return m_frameObserver->frame(); | 1544 return m_frameObserver->frame(); |
1540 } | 1545 } |
1541 | 1546 |
1542 } // namespace blink | 1547 } // namespace blink |
OLD | NEW |