| Index: third_party/WebKit/Source/core/input/MouseEventManager.cpp
|
| diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
|
| index 3672b0fa43f8f76190a6cdaffc828cdb4de6aa81..8649084de97f92988e9453a00c88478142c24961 100644
|
| --- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
|
| +++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
|
| @@ -233,7 +233,8 @@ WebInputEventResult MouseEventManager::setMousePositionAndDispatchMouseEvent(
|
| WebInputEventResult MouseEventManager::dispatchMouseClickIfNeeded(
|
| Node* target,
|
| const WebMouseEvent& mouseEvent,
|
| - const String& canvasRegionId) {
|
| + const String& canvasRegionId,
|
| + Node* targetWithoutCapture) {
|
| // We only prevent click event when the click may cause contextmenu to popup.
|
| // However, we always send auxclick.
|
| bool contextMenuEvent =
|
| @@ -267,6 +268,23 @@ WebInputEventResult MouseEventManager::dispatchMouseClickIfNeeded(
|
| clickTargetNode = target->commonAncestor(
|
| *m_clickNode, EventHandlingUtil::parentForClickEvent);
|
| }
|
| +
|
| + // This block is only for the purpose of gathering the metric and can be
|
| + // removed as soon as we don't need the metric.
|
| + if (targetWithoutCapture != target) {
|
| + Node* alternativeClickTargetNode = nullptr;
|
| + if (m_clickNode == targetWithoutCapture) {
|
| + alternativeClickTargetNode = m_clickNode;
|
| + } else if (m_clickNode->document() == targetWithoutCapture->document()) {
|
| + alternativeClickTargetNode = targetWithoutCapture->commonAncestor(
|
| + *m_clickNode, EventHandlingUtil::parentForClickEvent);
|
| + }
|
| + if (alternativeClickTargetNode != clickTargetNode) {
|
| + UseCounter::count(m_frame,
|
| + UseCounter::PointerEventClickRetargetCausedByCapture);
|
| + }
|
| + }
|
| +
|
| if (clickTargetNode) {
|
| clickEventResult = dispatchMouseEvent(
|
| clickTargetNode,
|
|
|