diff options
author | hugo.lima@openbossa.org <hugo.lima@openbossa.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-08-28 14:11:18 +0000 |
---|---|---|
committer | hugo.lima@openbossa.org <hugo.lima@openbossa.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-08-28 14:11:18 +0000 |
commit | a08741dea573b3fb3642167a252eaa1ccbfe5e84 (patch) | |
tree | 291678688c9bcba50db250170c76d144600e8c0a /third_party/WebKit/LayoutTests/touchadjustment | |
parent | 8da791b6173b7e7448ea960377fbc32874a10542 (diff) | |
download | chromium_src-a08741dea573b3fb3642167a252eaa1ccbfe5e84.zip chromium_src-a08741dea573b3fb3642167a252eaa1ccbfe5e84.tar.gz chromium_src-a08741dea573b3fb3642167a252eaa1ccbfe5e84.tar.bz2 |
[WK2] Send click events to WebCore when the user clicked on a non-special node with TOUCH_ADJUSTMENT enabled.
https://bugs.webkit.org/show_bug.cgi?id=91012
Reviewed by Antonio Gomes.
Source/WebCore:
Don't abort the gesture tap handling when the tap hits a non user
interactable node like a text node.
Test: touchadjustment/focusout-on-touch.html
* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureTap):
LayoutTests:
* touchadjustment/focusout-on-touch-expected.txt: Added.
* touchadjustment/focusout-on-touch.html: Added.
git-svn-id: svn://svn.chromium.org/blink/trunk@126873 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/touchadjustment')
-rw-r--r-- | third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch-expected.txt | 3 | ||||
-rw-r--r-- | third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch.html | 66 |
2 files changed, 69 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch-expected.txt b/third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch-expected.txt new file mode 100644 index 0000000..a1d9026 --- /dev/null +++ b/third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch-expected.txt @@ -0,0 +1,3 @@ +ALERT: PASS! +You should see "ALERT: PASS!" + diff --git a/third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch.html b/third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch.html new file mode 100644 index 0000000..b2c4c40 --- /dev/null +++ b/third_party/WebKit/LayoutTests/touchadjustment/focusout-on-touch.html @@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> +<title>Touch Adjustment : Fake mouse events not delivered when touching on a non-interactable node - bug 91012</title> +<style type="text/css"> +div { + width: 400px; + height: 400px; +} +</style> +<script type="text/javascript"> +function runTest() +{ +/* + WebKit generates fake mouse events on each touch event, here we test if + the touch adjustment doesn't caused an early return not firing the fake + mouse events used here to unfocus a simple text input. +*/ + if (!window.eventSender || !window.testRunner) + return; + + testRunner.dumpAsText(); + + // Focus the text field + var textInput = document.getElementById("textInput"); + if (document.activeElement === textInput) + alert("FAILED!"); + textInput.focus(); + if (document.activeElement != textInput) + alert("FAILED!"); + + // Try to loose the focus touching on a non-editable element. + var theDiv = document.getElementById("theDiv"); + var w = theDiv.clientWidth; + var h = theDiv.clientHeight; + var x = theDiv.offsetLeft + w/2; + var y = theDiv.offsetTop + h/2; + + eventSender.clearTouchPoints(); + eventSender.setTouchPointRadius(10, 10); + eventSender.addTouchPoint(x, y); + eventSender.touchStart(); + eventSender.releaseTouchPoint(0); + eventSender.touchEnd(); + + // Need to wait a bit so the gesture recognizer will be sure this isn't a double tap. + setTimeout(function() { + if (document.activeElement == document.body) + alert("PASS!") + else + alert("FAILED, " + document.activeElement.id + " is focused."); + testRunner.notifyDone(); + }, 800); + + // Wait and see... + testRunner.waitUntilDone(); + +} + +</script> +</head> +<body onload="runTest()"> +<div id="theDiv">You should see "ALERT: PASS!"</div> +<input id="textInput" type="text" value="Touch me please!" /> +</body> +</html>
\ No newline at end of file |