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

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
« no previous file with comments | « Source/core/page/EventHandler.cpp ('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) 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 if (event.button == WebMouseEvent::ButtonLeft) { 477 if (event.button == WebMouseEvent::ButtonLeft) {
478 selectPopup = m_selectPopup; 478 selectPopup = m_selectPopup;
479 pagePopup = m_pagePopup; 479 pagePopup = m_pagePopup;
480 hidePopups(); 480 hidePopups();
481 ASSERT(!m_selectPopup); 481 ASSERT(!m_selectPopup);
482 ASSERT(!m_pagePopup); 482 ASSERT(!m_pagePopup);
483 } 483 }
484 484
485 m_lastMouseDownPoint = WebPoint(event.x, event.y); 485 m_lastMouseDownPoint = WebPoint(event.x, event.y);
486 486
487 if (event.button == WebMouseEvent::ButtonLeft) { 487 // Take capture on a mouse down on a plugin so we can send it mouse events.
488 IntPoint point(event.x, event.y); 488 // If the hit node is a plugin but a scrollbar is over it don't start mouse
489 // capture because it will interfere with the scrollbar receiving events.
490 IntPoint point(event.x, event.y);
491 if (event.button == WebMouseEvent::ButtonLeft && !m_page->mainFrame()->view( )->scrollbarAtPoint(point)) {
489 point = m_page->mainFrame()->view()->windowToContents(point); 492 point = m_page->mainFrame()->view()->windowToContents(point);
490 HitTestResult result(m_page->mainFrame()->eventHandler().hitTestResultAt Point(point)); 493 HitTestResult result(m_page->mainFrame()->eventHandler().hitTestResultAt Point(point));
491 Node* hitNode = result.innerNonSharedNode(); 494 Node* hitNode = result.innerNonSharedNode();
492 495
493 // Take capture on a mouse down on a plugin so we can send it mouse even ts. 496 if (!result.scrollbar() && hitNode && hitNode->renderer() && hitNode->re nderer()->isEmbeddedObject()) {
494 if (hitNode && hitNode->renderer() && hitNode->renderer()->isEmbeddedObj ect()) {
495 m_mouseCaptureNode = hitNode; 497 m_mouseCaptureNode = hitNode;
496 TRACE_EVENT_ASYNC_BEGIN0("input", "capturing mouse", this); 498 TRACE_EVENT_ASYNC_BEGIN0("input", "capturing mouse", this);
497 } 499 }
498 } 500 }
499 501
500 PageWidgetEventHandler::handleMouseDown(mainFrame, event); 502 PageWidgetEventHandler::handleMouseDown(mainFrame, event);
501 503
502 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode) 504 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode)
503 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG estureToken(); 505 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG estureToken();
504 506
(...skipping 3546 matching lines...) Expand 10 before | Expand all | Expand 10 after
4051 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4053 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4052 4054
4053 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4055 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4054 return false; 4056 return false;
4055 4057
4056 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4058 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4057 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4059 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4058 } 4060 }
4059 4061
4060 } // namespace blink 4062 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698