| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 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 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); | 1415 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); |
| 1416 Frame* subframe = subframeForHitTestResult(mev); | 1416 Frame* subframe = subframeForHitTestResult(mev); |
| 1417 if (m_eventHandlerWillResetCapturingMouseEventsNode) | 1417 if (m_eventHandlerWillResetCapturingMouseEventsNode) |
| 1418 m_capturingMouseEventsNode = 0; | 1418 m_capturingMouseEventsNode = 0; |
| 1419 if (subframe && passMousePressEventToSubframe(mev, subframe)) | 1419 if (subframe && passMousePressEventToSubframe(mev, subframe)) |
| 1420 return true; | 1420 return true; |
| 1421 | 1421 |
| 1422 m_clickCount = mouseEvent.clickCount(); | 1422 m_clickCount = mouseEvent.clickCount(); |
| 1423 bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev
.targetNode(), true, m_clickCount, mouseEvent, false); | 1423 bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev
.targetNode(), true, m_clickCount, mouseEvent, false); |
| 1424 | 1424 |
| 1425 bool swallowClickEvent = mouseEvent.button() == LeftButton && mev.targetNode
() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(
), true, m_clickCount, mouseEvent, true); | 1425 bool swallowClickEvent = mouseEvent.button() != RightButton && mev.targetNod
e() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode
(), true, m_clickCount, mouseEvent, true); |
| 1426 | 1426 |
| 1427 if (m_lastScrollbarUnderMouse) | 1427 if (m_lastScrollbarUnderMouse) |
| 1428 swallowMouseUpEvent = m_lastScrollbarUnderMouse->mouseUp(); | 1428 swallowMouseUpEvent = m_lastScrollbarUnderMouse->mouseUp(); |
| 1429 | 1429 |
| 1430 bool swallowMouseReleaseEvent = !swallowMouseUpEvent && handleMouseReleaseEv
ent(mev); | 1430 bool swallowMouseReleaseEvent = !swallowMouseUpEvent && handleMouseReleaseEv
ent(mev); |
| 1431 | 1431 |
| 1432 invalidateClick(); | 1432 invalidateClick(); |
| 1433 | 1433 |
| 1434 return swallowMouseUpEvent || swallowClickEvent || swallowMouseReleaseEvent; | 1434 return swallowMouseUpEvent || swallowClickEvent || swallowMouseReleaseEvent; |
| 1435 } | 1435 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1606 HitTestRequest request(HitTestRequest::MouseUp); | 1606 HitTestRequest request(HitTestRequest::MouseUp); |
| 1607 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); | 1607 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); |
| 1608 Frame* subframe = m_capturingMouseEventsNode.get() ? subframeForTargetNode(m
_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev); | 1608 Frame* subframe = m_capturingMouseEventsNode.get() ? subframeForTargetNode(m
_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev); |
| 1609 if (m_eventHandlerWillResetCapturingMouseEventsNode) | 1609 if (m_eventHandlerWillResetCapturingMouseEventsNode) |
| 1610 m_capturingMouseEventsNode = 0; | 1610 m_capturingMouseEventsNode = 0; |
| 1611 if (subframe && passMouseReleaseEventToSubframe(mev, subframe)) | 1611 if (subframe && passMouseReleaseEventToSubframe(mev, subframe)) |
| 1612 return true; | 1612 return true; |
| 1613 | 1613 |
| 1614 bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev
.targetNode(), true, m_clickCount, mouseEvent, false); | 1614 bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev
.targetNode(), true, m_clickCount, mouseEvent, false); |
| 1615 | 1615 |
| 1616 bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() == LeftButt
on && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickEv
ent, mev.targetNode(), true, m_clickCount, mouseEvent, true); | 1616 bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() != RightBut
ton && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickE
vent, mev.targetNode(), true, m_clickCount, mouseEvent, true); |
| 1617 | 1617 |
| 1618 if (m_resizeLayer) { | 1618 if (m_resizeLayer) { |
| 1619 m_resizeLayer->setInResizeMode(false); | 1619 m_resizeLayer->setInResizeMode(false); |
| 1620 m_resizeLayer = 0; | 1620 m_resizeLayer = 0; |
| 1621 } | 1621 } |
| 1622 | 1622 |
| 1623 bool swallowMouseReleaseEvent = false; | 1623 bool swallowMouseReleaseEvent = false; |
| 1624 if (!swallowMouseUpEvent) | 1624 if (!swallowMouseUpEvent) |
| 1625 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev); | 1625 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev); |
| 1626 | 1626 |
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2991 touchEventTarget->dispatchEvent(touchEvent.get(), ec); | 2991 touchEventTarget->dispatchEvent(touchEvent.get(), ec); |
| 2992 defaultPrevented |= touchEvent->defaultPrevented(); | 2992 defaultPrevented |= touchEvent->defaultPrevented(); |
| 2993 } | 2993 } |
| 2994 } | 2994 } |
| 2995 | 2995 |
| 2996 return defaultPrevented; | 2996 return defaultPrevented; |
| 2997 } | 2997 } |
| 2998 #endif | 2998 #endif |
| 2999 | 2999 |
| 3000 } | 3000 } |
| OLD | NEW |