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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 if (m_frame->page() && m_frame->view()) { | 406 if (m_frame->page() && m_frame->view()) { |
407 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll
ingCoordinator()) { | 407 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll
ingCoordinator()) { |
408 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame-
>view(), HorizontalScrollbar); | 408 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame-
>view(), HorizontalScrollbar); |
409 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame-
>view(), VerticalScrollbar); | 409 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame-
>view(), VerticalScrollbar); |
410 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi
ew()); | 410 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi
ew()); |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 m_frame->selection().updateSecureKeyboardEntryIfActive(); | 414 m_frame->selection().updateSecureKeyboardEntryIfActive(); |
415 | |
416 if (m_frame->isMainFrame()) { | |
417 if (m_document->hasTouchEventHandlers()) | |
418 m_frame->host()->chrome().client().needTouchEvents(true); | |
419 } | |
420 return m_document; | 415 return m_document; |
421 } | 416 } |
422 | 417 |
423 EventQueue* LocalDOMWindow::eventQueue() const | 418 EventQueue* LocalDOMWindow::eventQueue() const |
424 { | 419 { |
425 return m_eventQueue.get(); | 420 return m_eventQueue.get(); |
426 } | 421 } |
427 | 422 |
428 void LocalDOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event) | 423 void LocalDOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event) |
429 { | 424 { |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<
EventListener> listener, bool useCapture) | 1527 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<
EventListener> listener, bool useCapture) |
1533 { | 1528 { |
1534 if (!EventTarget::addEventListener(eventType, listener, useCapture)) | 1529 if (!EventTarget::addEventListener(eventType, listener, useCapture)) |
1535 return false; | 1530 return false; |
1536 | 1531 |
1537 if (m_frame && m_frame->host()) | 1532 if (m_frame && m_frame->host()) |
1538 m_frame->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype); | 1533 m_frame->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype); |
1539 | 1534 |
1540 if (Document* document = this->document()) { | 1535 if (Document* document = this->document()) { |
1541 document->addListenerTypeIfNeeded(eventType); | 1536 document->addListenerTypeIfNeeded(eventType); |
1542 if (isTouchEventType(eventType)) | 1537 if (eventType == EventTypeNames::storage) |
1543 document->didAddTouchEventHandler(document); | |
1544 else if (eventType == EventTypeNames::storage) | |
1545 didAddStorageEventListener(this); | 1538 didAddStorageEventListener(this); |
1546 } | 1539 } |
1547 | 1540 |
1548 lifecycleNotifier().notifyAddEventListener(this, eventType); | 1541 lifecycleNotifier().notifyAddEventListener(this, eventType); |
1549 | 1542 |
1550 if (eventType == EventTypeNames::unload) { | 1543 if (eventType == EventTypeNames::unload) { |
1551 UseCounter::count(document(), UseCounter::DocumentUnloadRegistered); | 1544 UseCounter::count(document(), UseCounter::DocumentUnloadRegistered); |
1552 addUnloadEventListener(this); | 1545 addUnloadEventListener(this); |
1553 } else if (eventType == EventTypeNames::beforeunload) { | 1546 } else if (eventType == EventTypeNames::beforeunload) { |
1554 UseCounter::count(document(), UseCounter::DocumentBeforeUnloadRegistered
); | 1547 UseCounter::count(document(), UseCounter::DocumentBeforeUnloadRegistered
); |
(...skipping 12 matching lines...) Expand all Loading... |
1567 } | 1560 } |
1568 | 1561 |
1569 bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, EventLis
tener* listener, bool useCapture) | 1562 bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, EventLis
tener* listener, bool useCapture) |
1570 { | 1563 { |
1571 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) | 1564 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) |
1572 return false; | 1565 return false; |
1573 | 1566 |
1574 if (m_frame && m_frame->host()) | 1567 if (m_frame && m_frame->host()) |
1575 m_frame->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eve
ntType); | 1568 m_frame->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eve
ntType); |
1576 | 1569 |
1577 if (Document* document = this->document()) { | |
1578 if (isTouchEventType(eventType)) | |
1579 document->didRemoveTouchEventHandler(document); | |
1580 } | |
1581 | |
1582 lifecycleNotifier().notifyRemoveEventListener(this, eventType); | 1570 lifecycleNotifier().notifyRemoveEventListener(this, eventType); |
1583 | 1571 |
1584 if (eventType == EventTypeNames::unload) { | 1572 if (eventType == EventTypeNames::unload) { |
1585 removeUnloadEventListener(this); | 1573 removeUnloadEventListener(this); |
1586 } else if (eventType == EventTypeNames::beforeunload && allowsBeforeUnloadLi
steners(this)) { | 1574 } else if (eventType == EventTypeNames::beforeunload && allowsBeforeUnloadLi
steners(this)) { |
1587 removeBeforeUnloadEventListener(this); | 1575 removeBeforeUnloadEventListener(this); |
1588 } | 1576 } |
1589 | 1577 |
1590 return true; | 1578 return true; |
1591 } | 1579 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 | 1628 |
1641 void LocalDOMWindow::removeAllEventListenersInternal(BroadcastListenerRemoval mo
de) | 1629 void LocalDOMWindow::removeAllEventListenersInternal(BroadcastListenerRemoval mo
de) |
1642 { | 1630 { |
1643 EventTarget::removeAllEventListeners(); | 1631 EventTarget::removeAllEventListeners(); |
1644 | 1632 |
1645 lifecycleNotifier().notifyRemoveAllEventListeners(this); | 1633 lifecycleNotifier().notifyRemoveAllEventListeners(this); |
1646 | 1634 |
1647 if (mode == DoBroadcastListenerRemoval) { | 1635 if (mode == DoBroadcastListenerRemoval) { |
1648 if (m_frame && m_frame->host()) | 1636 if (m_frame && m_frame->host()) |
1649 m_frame->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*t
his); | 1637 m_frame->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*t
his); |
1650 | |
1651 if (Document* document = this->document()) | |
1652 document->didClearTouchEventHandlers(document); | |
1653 } | 1638 } |
1654 | 1639 |
1655 removeAllUnloadEventListeners(this); | 1640 removeAllUnloadEventListeners(this); |
1656 removeAllBeforeUnloadEventListeners(this); | 1641 removeAllBeforeUnloadEventListeners(this); |
1657 } | 1642 } |
1658 | 1643 |
1659 void LocalDOMWindow::removeAllEventListeners() | 1644 void LocalDOMWindow::removeAllEventListeners() |
1660 { | 1645 { |
1661 removeAllEventListenersInternal(DoBroadcastListenerRemoval); | 1646 removeAllEventListenersInternal(DoBroadcastListenerRemoval); |
1662 } | 1647 } |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 visitor->trace(m_localStorage); | 1911 visitor->trace(m_localStorage); |
1927 visitor->trace(m_applicationCache); | 1912 visitor->trace(m_applicationCache); |
1928 visitor->trace(m_performance); | 1913 visitor->trace(m_performance); |
1929 visitor->trace(m_css); | 1914 visitor->trace(m_css); |
1930 visitor->trace(m_eventQueue); | 1915 visitor->trace(m_eventQueue); |
1931 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); | 1916 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); |
1932 EventTargetWithInlineData::trace(visitor); | 1917 EventTargetWithInlineData::trace(visitor); |
1933 } | 1918 } |
1934 | 1919 |
1935 } // namespace WebCore | 1920 } // namespace WebCore |
OLD | NEW |