-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevTools] Route input events to the correct RenderWidgetHost
With OOPIFs, we route input events sent to main frame's target to the correct RenderWidgetHost inside. We might consider doing the same for non-main frames as well, or instead prohibit input domain on them. This does not touch gestures yet, those will follow in next patch. Bug: 746266 [email protected] (cherry picked from commit 901b630) Change-Id: I7ba87c6d227ea24a559ebb7b5ca6a3cf9764d0f0 Reviewed-on: https://chromium-review.googlesource.com/939540 Commit-Queue: Dmitry Gozman <[email protected]> Reviewed-by: Andrey Kosyakov <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#540419} Reviewed-on: https://chromium-review.googlesource.com/953163 Reviewed-by: Dmitry Gozman <[email protected]> Cr-Commit-Position: refs/branch-heads/3359@{#66} Cr-Branched-From: 66afc5e-refs/heads/master@{#540276}
- Loading branch information
Showing
8 changed files
with
380 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<body> | ||
<script src='oopif-input.js'></script> | ||
Hello World! | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<body> | ||
<script src="oopif-input.js"></script> | ||
<iframe style="width: 100px; height: 100px; position: absolute; top: 100px; left: 200px; border: 0;"></iframe> | ||
<script> | ||
var url = window.location.href; | ||
url = url.replace(/a\.com/, "b.com"); | ||
url = url.replace(/oopif-input\.html/, "oopif-input-iframe.html"); | ||
document.querySelector('iframe').setAttribute('src', url); | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
var logs = []; | ||
function log(text) { | ||
logs.push(text); | ||
} | ||
|
||
function logMouseEvent(event) { | ||
log('Event'); | ||
log('type: ' + event.type); | ||
log('button: ' + event.button); | ||
if (event.shiftKey) | ||
log('shiftKey'); | ||
log('x: ' + event.x); | ||
log('y: ' + event.y); | ||
if (event.type === 'mousewheel') { | ||
log('deltaX: ' + event.deltaX); | ||
log('deltaY: ' + event.deltaY); | ||
} | ||
event.preventDefault(); | ||
} | ||
|
||
function logKeyEvent(event) { | ||
log('Event'); | ||
log('type: ' + event.type); | ||
event.preventDefault(); | ||
} | ||
|
||
function logTouchEvent(event) { | ||
log('Event'); | ||
log('type: ' + event.type); | ||
for (var touch of event.touches) { | ||
log('touch x: ' + touch.pageX); | ||
log('touch y: ' + touch.pageY); | ||
} | ||
event.preventDefault(); | ||
} | ||
|
||
window.addEventListener('mousedown', logMouseEvent); | ||
window.addEventListener('mouseup', logMouseEvent); | ||
window.addEventListener('contextmenu', logMouseEvent); | ||
window.addEventListener('mousewheel', logMouseEvent); | ||
window.addEventListener('keydown', logKeyEvent); | ||
window.addEventListener('touchstart', logTouchEvent); | ||
window.addEventListener('touchend', event => event.preventDefault()); |
Oops, something went wrong.