summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/touchadjustment
diff options
context:
space:
mode:
authorcommit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2012-10-25 18:49:51 +0000
committercommit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2012-10-25 18:49:51 +0000
commit6ef8e0f79588e177a0705204a0be1fbcadf8572b (patch)
treecda75cd0e309b30cb79877d254558df0ae060340 /third_party/WebKit/LayoutTests/touchadjustment
parent06a3057598edece0bd4f38ee4c19906d278dcca0 (diff)
downloadchromium_src-6ef8e0f79588e177a0705204a0be1fbcadf8572b.zip
chromium_src-6ef8e0f79588e177a0705204a0be1fbcadf8572b.tar.gz
chromium_src-6ef8e0f79588e177a0705204a0be1fbcadf8572b.tar.bz2
Touch adjustment snaps to wrong target at a plugin boundary.
https://bugs.webkit.org/show_bug.cgi?id=99938 Patch by Kevin Ellis <kevers@chromium.org> on 2012-10-25 Reviewed by Antonio Gomes. Source/WebCore: Inidcate that an <embed> element can respond to mouse click events, since mouse events are forwarded to the plugin. Fixes touch adjustment at a plugin boundary. Prior to the patch a clickable element adjacent to the plugin would capture synthetic mouse events from tap gestures that spanned the plugin boundary. Test: touchadjustment/plugin.html * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::willRespondToMouseClickEvents): (WebCore): * html/HTMLEmbedElement.h: LayoutTests: Test for touch adjustment at a plugin boundary. Prior to the patch, plugins were not considered candidates for touch adjustment. * touchadjustment/plugin-expected.txt: Added. * touchadjustment/plugin.html: Added. git-svn-id: svn://svn.chromium.org/blink/trunk@132509 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/touchadjustment')
-rw-r--r--third_party/WebKit/LayoutTests/touchadjustment/plugin-expected.txt21
-rw-r--r--third_party/WebKit/LayoutTests/touchadjustment/plugin.html93
2 files changed, 114 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/touchadjustment/plugin-expected.txt b/third_party/WebKit/LayoutTests/touchadjustment/plugin-expected.txt
new file mode 100644
index 0000000..909a6fd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/touchadjustment/plugin-expected.txt
@@ -0,0 +1,21 @@
+Tests touch-adjustment at a plugin boundary.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test direct hits.
+PASS adjusted node was EMBED#plugin.
+PASS adjusted node was BUTTON#button1.
+PASS adjusted node was BUTTON#button2.
+PASS adjusted node was BUTTON#button3.
+Test hits spanning the plugin boundary.
+PASS adjusted node was EMBED#plugin.
+PASS adjusted node was BUTTON#button1.
+PASS adjusted node was EMBED#plugin.
+PASS adjusted node was BUTTON#button2.
+PASS adjusted node was EMBED#plugin.
+PASS adjusted node was BUTTON#button3.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/third_party/WebKit/LayoutTests/touchadjustment/plugin.html b/third_party/WebKit/LayoutTests/touchadjustment/plugin.html
new file mode 100644
index 0000000..52ceec6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/touchadjustment/plugin.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Touch Adjustment : Plugin boundary - bug ????</title>
+ <script src="../fast/js/resources/js-test-pre.js"></script>
+ <script src="resources/touchadjustment.js"></script>
+ <style>
+ #plugin {
+ height: 160px;
+ margin-left: 10px;
+ margin-top: 10px;
+ width: 320px;
+ }
+ #toolbar {
+ -webkit-box-align: stretch;
+ -webkit-box-orient: horizontal;
+ display: -webkit-box;
+ margin-left: 10px;
+ }
+ </style>
+</head>
+<body>
+
+<div id=sandbox>
+ <embed id="plugin" type="Application/x-webkit-test-webplugin">
+ <div id="toolbar" onckick="function(){}">
+ <button id="button1">A</button>
+ <button id="button2">B</button>
+ <button id="button3">C</button>
+ </div>
+</div>
+
+<p id='description'></p>
+<div id='console'></div>
+
+<script>
+ // Set up shortcut access to elements
+ var ids = ['sandbox', 'plugin', 'toolbar', 'button1', 'button2', 'button3'];
+ var e = {};
+ ids.forEach(function(a) {
+ e[a] = document.getElementById(a);
+ });
+ var bounds = {};
+ ids.forEach(function(a) {
+ bounds[a] = findAbsoluteBounds(e[a]);
+ });
+
+ function testMidpoint(id)
+ {
+ var x = bounds[id].left + bounds[id].width / 2;
+ var y = bounds[id].top + bounds[id].height / 2;
+ testTouchPoint(touchPoint(x, y, 10), e[id]);
+ }
+
+ function testBoundary(buttonId)
+ {
+ var x = bounds[buttonId].left + bounds[buttonId].width / 2;
+ var y = (bounds['plugin'].top + bounds['plugin'].height + bounds[buttonId].top) / 2;
+ testTouchPoint(touchPoint(x, y - 5, 10), e['plugin']);
+ testTouchPoint(touchPoint(x, y + 5, 10), e[buttonId]);
+ }
+
+ function testDirectTouches()
+ {
+ debug('Test direct hits.');
+ testMidpoint('plugin');
+ testMidpoint('button1');
+ testMidpoint('button2');
+ testMidpoint('button3');
+ }
+
+ function testIndirectTouches()
+ {
+ debug('Test hits spanning the plugin boundary.');
+ testBoundary('button1');
+ testBoundary('button2');
+ testBoundary('button3');
+ }
+
+ function runTests()
+ {
+ if (window.testRunner && window.internals && internals.touchNodeAdjustedToBestClickableNode) {
+ description('Tests touch-adjustment at a plugin boundary.');
+ testDirectTouches();
+ testIndirectTouches();
+ e['sandbox'].style.display = 'none';
+ }
+ }
+ runTests();
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>