Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 309793003: Mainframe scrollbars should get events even if document prevent-defaults the mouse events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/scrollbars/scrollbar-miss-mouseevents-if-document-preventdefaulted-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 const bool wasLastScrollBar = mev.scrollbar() == m_lastScrollbarUnderMou se.get(); 1281 const bool wasLastScrollBar = mev.scrollbar() == m_lastScrollbarUnderMou se.get();
1282 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent); 1282 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent);
1283 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mou seEvent); 1283 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mou seEvent);
1284 if (wasLastScrollBar && mev.scrollbar() != m_lastScrollbarUnderMouse.get ()) 1284 if (wasLastScrollBar && mev.scrollbar() != m_lastScrollbarUnderMouse.get ())
1285 m_lastScrollbarUnderMouse = nullptr; 1285 m_lastScrollbarUnderMouse = nullptr;
1286 } 1286 }
1287 1287
1288 if (swallowEvent) { 1288 if (swallowEvent) {
1289 // scrollbars should get events anyway, even disabled controls might be scrollable 1289 // scrollbars should get events anyway, even disabled controls might be scrollable
1290 Scrollbar* scrollbar = mev.scrollbar(); 1290 Scrollbar* scrollbar = mev.scrollbar();
1291 if (!scrollbar) {
1292 FrameView* view = m_frame->view();
1293 scrollbar = view ? view->scrollbarAtPoint(mouseEvent.position()) : 0 ;
1294 }
1291 1295
1292 updateLastScrollbarUnderMouse(scrollbar, true); 1296 updateLastScrollbarUnderMouse(scrollbar, true);
1293 1297
1294 if (scrollbar) 1298 if (scrollbar)
1295 passMousePressEventToScrollbar(mev, scrollbar); 1299 passMousePressEventToScrollbar(mev, scrollbar);
1296 } else { 1300 } else {
1297 if (shouldRefetchEventTarget(mev)) { 1301 if (shouldRefetchEventTarget(mev)) {
1298 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Ac tive | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent); 1302 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Ac tive | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent);
1299 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); 1303 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
1300 } 1304 }
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after
3731 unsigned EventHandler::accessKeyModifiers() 3735 unsigned EventHandler::accessKeyModifiers()
3732 { 3736 {
3733 #if OS(MACOSX) 3737 #if OS(MACOSX)
3734 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3738 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3735 #else 3739 #else
3736 return PlatformEvent::AltKey; 3740 return PlatformEvent::AltKey;
3737 #endif 3741 #endif
3738 } 3742 }
3739 3743
3740 } // namespace WebCore 3744 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/scrollbars/scrollbar-miss-mouseevents-if-document-preventdefaulted-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698