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

Unified Diff: third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html

Issue 1964523002: Fix clientX/Y properties of touch pointer events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix zoom problem Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html
diff --git a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..fd7dbb384e6925a00044fd8f241100397d53eb5b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML>
+<script src='../../../../../resources/js-test.js'></script>
+<style>
+iframe {
+ width: 300px;
+ height: 300px;
+ top: 100px;
+ left: 50px;
+ border: 0;
+ position: absolute;
+ background: green;
+}
+</style>
+<iframe id='target' srcdoc="
+ <body style='height:500px; width: 500px; padding: 0; margin: 0;'>
+ <script>
+ var testEventList = ['pointerup', 'pointerdown', 'pointermove',
+ 'touchstart', 'touchmove', 'touchend'];
+ testEventList.forEach(function(eventName) {
+ document.documentElement.addEventListener(eventName, function(event) {
+ top.document.events.push(event);
+ });
+ });
+ </script>
+ </body>">
+</iframe>
+
+<div id='console'></div>
+
+<script>
+
+var attributes = [
+ 'clientX',
+ 'clientY'
+];
+
+document.events = [];
+
+function testScenario(scrollX, scrollY, zoomFactor) {
+ debug('===== scrollX=' + scrollX + ', scrollY=' + scrollY + ', zoomFactor=' + zoomFactor);
+
+ document.getElementById('target').contentWindow.scrollTo(scrollX, scrollY);
+ window.internals.setZoomFactor(zoomFactor);
+
+ // touch events inside iframe
+ eventSender.addTouchPoint(200, 200)
+ eventSender.touchStart();
+ eventSender.updateTouchPoint(0, 200, 200);
+ eventSender.touchMove();
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+
+ dumpEvents();
+ debug('');
+}
+
+function runTests(scrollX, scrollY) {
+ testScenario(25, 100, 1);
+ testScenario(40, 140, 1);
+ testScenario(40, 140, 2);
+
+ testRunner.notifyDone();
+}
+
+function dumpEvents()
+{
+ document.events.forEach(function(event) {
+ if (event.type.startsWith('pointer')) {
+ debug(event.type + " of " + event.pointerType + " is recieved:");
+ attributes.forEach(function(att) {
+ debug(att + " = " + event[att]);
+ });
+ } else if (event.type.startsWith('touch')) {
+ debug(event.type + " is recieved:");
+ attributes.forEach(function(att) {
+ debug(att + " = " + event.changedTouches[0][att]);
+ });
+ }
+ });
+ document.events = [];
+}
+
+if (window.eventSender) {
+ testRunner.waitUntilDone();
+ window.onload = runTests;
+} else
+ debug('This test requires eventSender');
+
+description("This test verifies clientX/Y of pointer events inside iframe.");
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698