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 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1264 m_resizeScrollableArea = layer->scrollableArea(); | 1264 m_resizeScrollableArea = layer->scrollableArea(); |
1265 m_resizeScrollableArea->setInResizeMode(true); | 1265 m_resizeScrollableArea->setInResizeMode(true); |
1266 m_offsetFromResizeCorner = m_resizeScrollableArea->offsetFromResizeC orner(p); | 1266 m_offsetFromResizeCorner = m_resizeScrollableArea->offsetFromResizeC orner(p); |
1267 invalidateClick(); | 1267 invalidateClick(); |
1268 return true; | 1268 return true; |
1269 } | 1269 } |
1270 } | 1270 } |
1271 | 1271 |
1272 m_frame->selection().setCaretBlinkingSuspended(true); | 1272 m_frame->selection().setCaretBlinkingSuspended(true); |
1273 | 1273 |
1274 FrameView* view = m_frame->view(); | |
1275 Scrollbar* scrollbar = view ? view->scrollbarAtPoint(mouseEvent.position()) : 0; | |
Rick Byers
2014/05/22 13:53:36
Shouldn't this already be in mev.scrollbar()? See
| |
1276 if (scrollbar) { | |
1277 updateLastScrollbarUnderMouse(scrollbar, true); | |
1278 if (passMousePressEventToScrollbar(mev, scrollbar)) | |
1279 return true; | |
1280 } | |
1281 | |
1274 bool swallowEvent = !dispatchMouseEvent(EventTypeNames::mousedown, mev.targe tNode(), m_clickCount, mouseEvent, true); | 1282 bool swallowEvent = !dispatchMouseEvent(EventTypeNames::mousedown, mev.targe tNode(), m_clickCount, mouseEvent, true); |
1275 swallowEvent = swallowEvent || !handleMouseFocus(mouseEvent); | 1283 swallowEvent = swallowEvent || !handleMouseFocus(mouseEvent); |
1276 m_capturesDragging = !swallowEvent || mev.scrollbar(); | 1284 m_capturesDragging = !swallowEvent || mev.scrollbar(); |
1277 | 1285 |
1278 // If the hit testing originally determined the event was in a scrollbar, re fetch the MouseEventWithHitTestResults | 1286 // If the hit testing originally determined the event was in a scrollbar, re fetch the MouseEventWithHitTestResults |
1279 // in case the scrollbar widget was destroyed when the mouse event was handl ed. | 1287 // in case the scrollbar widget was destroyed when the mouse event was handl ed. |
1280 if (mev.scrollbar()) { | 1288 if (mev.scrollbar()) { |
1281 const bool wasLastScrollBar = mev.scrollbar() == m_lastScrollbarUnderMou se.get(); | 1289 const bool wasLastScrollBar = mev.scrollbar() == m_lastScrollbarUnderMou se.get(); |
1282 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent); | 1290 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent); |
1283 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mou seEvent); | 1291 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mou seEvent); |
1284 if (wasLastScrollBar && mev.scrollbar() != m_lastScrollbarUnderMouse.get ()) | 1292 if (wasLastScrollBar && mev.scrollbar() != m_lastScrollbarUnderMouse.get ()) |
1285 m_lastScrollbarUnderMouse = nullptr; | 1293 m_lastScrollbarUnderMouse = nullptr; |
1286 } | 1294 } |
1287 | 1295 |
1288 if (swallowEvent) { | 1296 if (swallowEvent) { |
1289 // scrollbars should get events anyway, even disabled controls might be scrollable | 1297 // scrollbars should get events anyway, even disabled controls might be scrollable |
1290 Scrollbar* scrollbar = mev.scrollbar(); | 1298 scrollbar = mev.scrollbar(); |
1291 | 1299 |
1292 updateLastScrollbarUnderMouse(scrollbar, true); | 1300 updateLastScrollbarUnderMouse(scrollbar, true); |
1293 | 1301 |
1294 if (scrollbar) | 1302 if (scrollbar) |
1295 passMousePressEventToScrollbar(mev, scrollbar); | 1303 passMousePressEventToScrollbar(mev, scrollbar); |
1296 } else { | 1304 } else { |
1297 if (shouldRefetchEventTarget(mev)) { | 1305 if (shouldRefetchEventTarget(mev)) { |
1298 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Ac tive | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent); | 1306 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Ac tive | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent); |
1299 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); | 1307 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); |
1300 } | 1308 } |
1301 | 1309 |
1302 FrameView* view = m_frame->view(); | 1310 scrollbar = mev.scrollbar(); |
1303 Scrollbar* scrollbar = view ? view->scrollbarAtPoint(mouseEvent.position ()) : 0; | |
1304 if (!scrollbar) | |
1305 scrollbar = mev.scrollbar(); | |
1306 | 1311 |
1307 updateLastScrollbarUnderMouse(scrollbar, true); | 1312 updateLastScrollbarUnderMouse(scrollbar, true); |
1308 | 1313 |
1309 if (scrollbar && passMousePressEventToScrollbar(mev, scrollbar)) | 1314 if (scrollbar && passMousePressEventToScrollbar(mev, scrollbar)) |
1310 swallowEvent = true; | 1315 swallowEvent = true; |
1311 else | 1316 else |
1312 swallowEvent = handleMousePressEvent(mev); | 1317 swallowEvent = handleMousePressEvent(mev); |
1313 } | 1318 } |
1314 | 1319 |
1315 return swallowEvent; | 1320 return swallowEvent; |
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3729 unsigned EventHandler::accessKeyModifiers() | 3734 unsigned EventHandler::accessKeyModifiers() |
3730 { | 3735 { |
3731 #if OS(MACOSX) | 3736 #if OS(MACOSX) |
3732 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3737 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3733 #else | 3738 #else |
3734 return PlatformEvent::AltKey; | 3739 return PlatformEvent::AltKey; |
3735 #endif | 3740 #endif |
3736 } | 3741 } |
3737 | 3742 |
3738 } // namespace WebCore | 3743 } // namespace WebCore |
OLD | NEW |