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 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1456 contextMenuEvent = true; | 1456 contextMenuEvent = true; |
1457 #endif | 1457 #endif |
1458 | 1458 |
1459 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; | 1459 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; |
1460 const bool shouldDispatchClickEvent = m_clickCount > 0 | 1460 const bool shouldDispatchClickEvent = m_clickCount > 0 |
1461 && !contextMenuEvent | 1461 && !contextMenuEvent |
1462 && mev.innerNode() && m_clickNode | 1462 && mev.innerNode() && m_clickNode |
1463 && mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canPartic ipateInFlatTree() | 1463 && mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canPartic ipateInFlatTree() |
1464 && !(selectionController().hasExtendedSelection() && isLinkSelection(mev )); | 1464 && !(selectionController().hasExtendedSelection() && isLinkSelection(mev )); |
1465 if (shouldDispatchClickEvent) { | 1465 if (shouldDispatchClickEvent) { |
1466 // Updates distribution because a 'mouseup' event listener can make the | 1466 if (m_clickNode != mev.innerNode() |
dtapuska
2016/04/21 16:08:27
This isn't the same code as before..
What happens
| |
1467 // tree dirty at dispatchMouseEvent() invocation above. | 1467 && m_clickNode->document() == mev.innerNode()->document()) { |
1468 // Unless distribution is updated, commonAncestor would hit ASSERT. | 1468 // Updates distribution because a 'mouseup' event listener can make the |
1469 // Both m_clickNode and mev.innerNode() don't need to be updated | 1469 // tree dirty at dispatchMouseEvent() invocation above. |
1470 // because commonAncestor() will exit early if their documents are diffe rent. | 1470 // Unless distribution is updated, commonAncestor would hit ASSERT. |
1471 m_clickNode->updateDistribution(); | 1471 m_clickNode->updateDistribution(); |
1472 mev.innerNode()->updateDistribution(); | |
1473 } | |
1472 if (Node* clickTargetNode = mev.innerNode()->commonAncestor( | 1474 if (Node* clickTargetNode = mev.innerNode()->commonAncestor( |
1473 *m_clickNode, parentForClickEvent)) { | 1475 *m_clickNode, parentForClickEvent)) { |
1474 | 1476 |
1475 // Dispatch mouseup directly w/o calling updateMouseEventTargetNodeA ndSendEvents | 1477 // Dispatch mouseup directly w/o calling updateMouseEventTargetNodeA ndSendEvents |
1476 // because the mouseup dispatch above has already updated it | 1478 // because the mouseup dispatch above has already updated it |
1477 // correctly. Moreover, clickTargetNode is different from | 1479 // correctly. Moreover, clickTargetNode is different from |
1478 // mev.innerNode at drag-release. | 1480 // mev.innerNode at drag-release. |
1479 clickEventResult = toWebInputEventResult(clickTargetNode->dispatchMo useEvent(mev.event(), | 1481 clickEventResult = toWebInputEventResult(clickTargetNode->dispatchMo useEvent(mev.event(), |
1480 EventTypeNames::click, m_clickCount)); | 1482 EventTypeNames::click, m_clickCount)); |
1481 } | 1483 } |
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4104 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 4106 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
4105 { | 4107 { |
4106 #if OS(MACOSX) | 4108 #if OS(MACOSX) |
4107 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); | 4109 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); |
4108 #else | 4110 #else |
4109 return PlatformEvent::AltKey; | 4111 return PlatformEvent::AltKey; |
4110 #endif | 4112 #endif |
4111 } | 4113 } |
4112 | 4114 |
4113 } // namespace blink | 4115 } // namespace blink |
OLD | NEW |