OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 m_clickNode->updateDistribution(); | 1437 m_clickNode->updateDistribution(); |
1438 mev.innerNode()->updateDistribution(); | 1438 mev.innerNode()->updateDistribution(); |
1439 clickTargetNode = mev.innerNode()->commonAncestor( | 1439 clickTargetNode = mev.innerNode()->commonAncestor( |
1440 *m_clickNode, parentForClickEvent); | 1440 *m_clickNode, parentForClickEvent); |
1441 } | 1441 } |
1442 if (clickTargetNode) { | 1442 if (clickTargetNode) { |
1443 // Dispatch mouseup directly w/o calling updateMouseEventTargetNodeA
ndSendEvents | 1443 // Dispatch mouseup directly w/o calling updateMouseEventTargetNodeA
ndSendEvents |
1444 // because the mouseup dispatch above has already updated it | 1444 // because the mouseup dispatch above has already updated it |
1445 // correctly. Moreover, clickTargetNode is different from | 1445 // correctly. Moreover, clickTargetNode is different from |
1446 // mev.innerNode at drag-release. | 1446 // mev.innerNode at drag-release. |
1447 | 1447 clickEventResult = toWebInputEventResult(clickTargetNode->dispatchMo
useEvent(mev.event(), |
1448 MouseEvent* event = MouseEvent::create( | 1448 EventTypeNames::click, m_clickCount)); |
1449 EventTypeNames::click, | |
1450 clickTargetNode->document().domWindow(), | |
1451 mev.event(), m_clickCount, nullptr); | |
1452 | |
1453 // This is to suppress sending click events for non-primary buttons. | |
1454 // But still doing default action like opening a new tab for middle | |
1455 // click (crbug.com/255). | |
1456 if (mev.event().button() != MouseButton::LeftButton) | |
1457 event->stopPropagation(); | |
1458 | |
1459 clickEventResult = toWebInputEventResult(clickTargetNode->dispatchEv
ent(event)); | |
1460 } | 1449 } |
1461 } | 1450 } |
1462 | 1451 |
1463 if (m_resizeScrollableArea) { | 1452 if (m_resizeScrollableArea) { |
1464 m_resizeScrollableArea->setInResizeMode(false); | 1453 m_resizeScrollableArea->setInResizeMode(false); |
1465 m_resizeScrollableArea = nullptr; | 1454 m_resizeScrollableArea = nullptr; |
1466 } | 1455 } |
1467 | 1456 |
1468 if (eventResult == WebInputEventResult::NotHandled) | 1457 if (eventResult == WebInputEventResult::NotHandled) |
1469 eventResult = handleMouseReleaseEvent(mev); | 1458 eventResult = handleMouseReleaseEvent(mev); |
(...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3700 | 3689 |
3701 FrameHost* EventHandler::frameHost() const | 3690 FrameHost* EventHandler::frameHost() const |
3702 { | 3691 { |
3703 if (!m_frame->page()) | 3692 if (!m_frame->page()) |
3704 return nullptr; | 3693 return nullptr; |
3705 | 3694 |
3706 return &m_frame->page()->frameHost(); | 3695 return &m_frame->page()->frameHost(); |
3707 } | 3696 } |
3708 | 3697 |
3709 } // namespace blink | 3698 } // namespace blink |
OLD | NEW |