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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 296003011: Fix event passing to overlay scrollbars when over a plugin (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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (event.button == WebMouseEvent::ButtonLeft) { 478 if (event.button == WebMouseEvent::ButtonLeft) {
479 selectPopup = m_selectPopup; 479 selectPopup = m_selectPopup;
480 pagePopup = m_pagePopup; 480 pagePopup = m_pagePopup;
481 hidePopups(); 481 hidePopups();
482 ASSERT(!m_selectPopup); 482 ASSERT(!m_selectPopup);
483 ASSERT(!m_pagePopup); 483 ASSERT(!m_pagePopup);
484 } 484 }
485 485
486 m_lastMouseDownPoint = WebPoint(event.x, event.y); 486 m_lastMouseDownPoint = WebPoint(event.x, event.y);
487 487
488 if (event.button == WebMouseEvent::ButtonLeft) { 488 // Take capture on a mouse down on a plugin so we can send it mouse events.
489 IntPoint point(event.x, event.y); 489 // If the hit node is a plugin but a scrollbar is over it don't start mouse
490 // capture because it will interfere with the scrollbar receiving events.
491 IntPoint point(event.x, event.y);
492 if (event.button == WebMouseEvent::ButtonLeft && !m_page->mainFrame()->view( )->scrollbarAtPoint(point)) {
490 point = m_page->mainFrame()->view()->windowToContents(point); 493 point = m_page->mainFrame()->view()->windowToContents(point);
491 HitTestResult result(m_page->mainFrame()->eventHandler().hitTestResultAt Point(point)); 494 HitTestResult result(m_page->mainFrame()->eventHandler().hitTestResultAt Point(point));
492 Node* hitNode = result.innerNonSharedNode(); 495 Node* hitNode = result.innerNonSharedNode();
493 496
494 // Take capture on a mouse down on a plugin so we can send it mouse even ts. 497 if (!result.scrollbar() && hitNode && hitNode->renderer() && hitNode->re nderer()->isEmbeddedObject()) {
495 if (hitNode && hitNode->renderer() && hitNode->renderer()->isEmbeddedObj ect()) {
496 m_mouseCaptureNode = hitNode; 498 m_mouseCaptureNode = hitNode;
497 TRACE_EVENT_ASYNC_BEGIN0("input", "capturing mouse", this); 499 TRACE_EVENT_ASYNC_BEGIN0("input", "capturing mouse", this);
498 } 500 }
499 } 501 }
500 502
501 PageWidgetEventHandler::handleMouseDown(mainFrame, event); 503 PageWidgetEventHandler::handleMouseDown(mainFrame, event);
502 504
503 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode) 505 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode)
504 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG estureToken(); 506 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG estureToken();
505 507
(...skipping 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after
4068 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4070 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4069 4071
4070 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4072 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4071 return false; 4073 return false;
4072 4074
4073 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4075 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4074 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4076 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4075 } 4077 }
4076 4078
4077 } // namespace blink 4079 } // namespace blink
OLDNEW
« LayoutTests/plugins/overlay-scrollbar-mouse-capture.html ('K') | « Source/core/page/EventHandler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698