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 21 matching lines...) Expand all Loading... |
32 #include "core/css/CSSRuleList.h" | 32 #include "core/css/CSSRuleList.h" |
33 #include "core/css/DOMWindowCSS.h" | 33 #include "core/css/DOMWindowCSS.h" |
34 #include "core/css/MediaQueryList.h" | 34 #include "core/css/MediaQueryList.h" |
35 #include "core/css/MediaQueryMatcher.h" | 35 #include "core/css/MediaQueryMatcher.h" |
36 #include "core/css/StyleMedia.h" | 36 #include "core/css/StyleMedia.h" |
37 #include "core/css/resolver/StyleResolver.h" | 37 #include "core/css/resolver/StyleResolver.h" |
38 #include "core/dom/DOMImplementation.h" | 38 #include "core/dom/DOMImplementation.h" |
39 #include "core/dom/ExecutionContextTask.h" | 39 #include "core/dom/ExecutionContextTask.h" |
40 #include "core/dom/FrameRequestCallback.h" | 40 #include "core/dom/FrameRequestCallback.h" |
41 #include "core/dom/SandboxFlags.h" | 41 #include "core/dom/SandboxFlags.h" |
| 42 #include "core/dom/custom/CustomElementsRegistry.h" |
42 #include "core/editing/Editor.h" | 43 #include "core/editing/Editor.h" |
43 #include "core/events/DOMWindowEventQueue.h" | 44 #include "core/events/DOMWindowEventQueue.h" |
44 #include "core/events/HashChangeEvent.h" | 45 #include "core/events/HashChangeEvent.h" |
45 #include "core/events/MessageEvent.h" | 46 #include "core/events/MessageEvent.h" |
46 #include "core/events/PageTransitionEvent.h" | 47 #include "core/events/PageTransitionEvent.h" |
47 #include "core/events/PopStateEvent.h" | 48 #include "core/events/PopStateEvent.h" |
48 #include "core/events/ScopedEventQueue.h" | 49 #include "core/events/ScopedEventQueue.h" |
49 #include "core/frame/BarProp.h" | 50 #include "core/frame/BarProp.h" |
50 #include "core/frame/Console.h" | 51 #include "core/frame/Console.h" |
51 #include "core/frame/EventHandlerRegistry.h" | 52 #include "core/frame/EventHandlerRegistry.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 m_history = nullptr; | 546 m_history = nullptr; |
546 m_locationbar = nullptr; | 547 m_locationbar = nullptr; |
547 m_menubar = nullptr; | 548 m_menubar = nullptr; |
548 m_personalbar = nullptr; | 549 m_personalbar = nullptr; |
549 m_scrollbars = nullptr; | 550 m_scrollbars = nullptr; |
550 m_statusbar = nullptr; | 551 m_statusbar = nullptr; |
551 m_toolbar = nullptr; | 552 m_toolbar = nullptr; |
552 m_console = nullptr; | 553 m_console = nullptr; |
553 m_navigator = nullptr; | 554 m_navigator = nullptr; |
554 m_media = nullptr; | 555 m_media = nullptr; |
| 556 m_customElements = nullptr; |
555 m_applicationCache = nullptr; | 557 m_applicationCache = nullptr; |
556 #if ENABLE(ASSERT) | 558 #if ENABLE(ASSERT) |
557 m_hasBeenReset = true; | 559 m_hasBeenReset = true; |
558 #endif | 560 #endif |
559 | 561 |
560 LocalDOMWindow::notifyContextDestroyed(); | 562 LocalDOMWindow::notifyContextDestroyed(); |
561 } | 563 } |
562 | 564 |
563 void LocalDOMWindow::sendOrientationChangeEvent() | 565 void LocalDOMWindow::sendOrientationChangeEvent() |
564 { | 566 { |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 return document->requestIdleCallback(callback, options); | 1303 return document->requestIdleCallback(callback, options); |
1302 return 0; | 1304 return 0; |
1303 } | 1305 } |
1304 | 1306 |
1305 void LocalDOMWindow::cancelIdleCallback(int id) | 1307 void LocalDOMWindow::cancelIdleCallback(int id) |
1306 { | 1308 { |
1307 if (Document* document = this->document()) | 1309 if (Document* document = this->document()) |
1308 document->cancelIdleCallback(id); | 1310 document->cancelIdleCallback(id); |
1309 } | 1311 } |
1310 | 1312 |
| 1313 CustomElementsRegistry* LocalDOMWindow::customElements() const |
| 1314 { |
| 1315 if (!m_customElements) |
| 1316 m_customElements = CustomElementsRegistry::create(); |
| 1317 return m_customElements.get(); |
| 1318 } |
| 1319 |
1311 bool LocalDOMWindow::addEventListenerInternal(const AtomicString& eventType, Eve
ntListener* listener, const EventListenerOptions& options) | 1320 bool LocalDOMWindow::addEventListenerInternal(const AtomicString& eventType, Eve
ntListener* listener, const EventListenerOptions& options) |
1312 { | 1321 { |
1313 if (!EventTarget::addEventListenerInternal(eventType, listener, options)) | 1322 if (!EventTarget::addEventListenerInternal(eventType, listener, options)) |
1314 return false; | 1323 return false; |
1315 | 1324 |
1316 if (frame() && frame()->host()) | 1325 if (frame() && frame()->host()) |
1317 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, options); | 1326 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype, options); |
1318 | 1327 |
1319 if (Document* document = this->document()) { | 1328 if (Document* document = this->document()) { |
1320 document->addListenerTypeIfNeeded(eventType); | 1329 document->addListenerTypeIfNeeded(eventType); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 visitor->trace(m_history); | 1506 visitor->trace(m_history); |
1498 visitor->trace(m_locationbar); | 1507 visitor->trace(m_locationbar); |
1499 visitor->trace(m_menubar); | 1508 visitor->trace(m_menubar); |
1500 visitor->trace(m_personalbar); | 1509 visitor->trace(m_personalbar); |
1501 visitor->trace(m_scrollbars); | 1510 visitor->trace(m_scrollbars); |
1502 visitor->trace(m_statusbar); | 1511 visitor->trace(m_statusbar); |
1503 visitor->trace(m_toolbar); | 1512 visitor->trace(m_toolbar); |
1504 visitor->trace(m_console); | 1513 visitor->trace(m_console); |
1505 visitor->trace(m_navigator); | 1514 visitor->trace(m_navigator); |
1506 visitor->trace(m_media); | 1515 visitor->trace(m_media); |
| 1516 visitor->trace(m_customElements); |
1507 visitor->trace(m_applicationCache); | 1517 visitor->trace(m_applicationCache); |
1508 visitor->trace(m_eventQueue); | 1518 visitor->trace(m_eventQueue); |
1509 visitor->trace(m_postMessageTimers); | 1519 visitor->trace(m_postMessageTimers); |
1510 DOMWindow::trace(visitor); | 1520 DOMWindow::trace(visitor); |
1511 Supplementable<LocalDOMWindow>::trace(visitor); | 1521 Supplementable<LocalDOMWindow>::trace(visitor); |
1512 DOMWindowLifecycleNotifier::trace(visitor); | 1522 DOMWindowLifecycleNotifier::trace(visitor); |
1513 } | 1523 } |
1514 | 1524 |
1515 LocalFrame* LocalDOMWindow::frame() const | 1525 LocalFrame* LocalDOMWindow::frame() const |
1516 { | 1526 { |
1517 // If the LocalDOMWindow still has a frame reference, that frame must point | 1527 // If the LocalDOMWindow still has a frame reference, that frame must point |
1518 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1528 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1519 // where script execution leaks between different LocalDOMWindows. | 1529 // where script execution leaks between different LocalDOMWindows. |
1520 if (m_frameObserver->frame()) | 1530 if (m_frameObserver->frame()) |
1521 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1531 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1522 return m_frameObserver->frame(); | 1532 return m_frameObserver->frame(); |
1523 } | 1533 } |
1524 | 1534 |
1525 } // namespace blink | 1535 } // namespace blink |
OLD | NEW |