| Index: LayoutTests/editing/selection/readonly-disabled-hittest.html
|
| diff --git a/LayoutTests/editing/selection/readonly-disabled-hittest.html b/LayoutTests/editing/selection/readonly-disabled-hittest.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..611b5bdb3c5d1b218248cbd9ef27942a31865f20
|
| --- /dev/null
|
| +++ b/LayoutTests/editing/selection/readonly-disabled-hittest.html
|
| @@ -0,0 +1,71 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../../resources/js-test.js"></script>
|
| +<script>
|
| +function test() {
|
| + jsTestAsync = true;
|
| + if (window.testRunner)
|
| + testRunner.dumpAsText();
|
| +
|
| + if (!window.eventSender)
|
| + return;
|
| +
|
| + if (!window.eventSender.gestureLongPress) {
|
| + debug("gestureLongPress not implemented by this platform.");
|
| + debug("Manullay long press on every element in the page and check whether Paste Popup is appearing or not");
|
| + debug("If Paste popup is appearing for readonly or disabled input/textarea, then it's a failure.");
|
| + return;
|
| + }
|
| +
|
| + // Normal Text
|
| + doLongPressOnElement("normalText");
|
| +
|
| + // ReadOnly Text
|
| + doLongPressOnElement("readOnlyText");
|
| +
|
| + // Disabled Text
|
| + doLongPressOnElement("disabledText");
|
| +
|
| + // ReadOnly and Disabled Text
|
| + doLongPressOnElement("readOnlyDisabledText");
|
| +
|
| + // Normal TextArea
|
| + doLongPressOnElement("normalTextArea");
|
| +
|
| + // ReadOnly TextArea
|
| + doLongPressOnElement("readOnlyTextArea");
|
| +
|
| + // Disabled TextArea
|
| + doLongPressOnElement("disabledTextArea");
|
| +
|
| + // ReadOnly and Disabled TextArea
|
| + doLongPressOnElement("readOnlyDisabledTextArea");
|
| +
|
| + finishJSTest();
|
| +}
|
| +
|
| +function doLongPressOnElement(elementId) {
|
| + var element = document.getElementById(elementId);
|
| + var bounds = element.getBoundingClientRect();
|
| + var middleX = (bounds.left + bounds.right) / 2;
|
| + var middleY = (bounds.top + bounds.bottom) / 2;
|
| + // Touch directly in the center of the element.
|
| + window.eventSender.gestureLongPress(middleX, middleY);
|
| + var touchNode = document.elementFromPoint(middleX, middleY);
|
| + shouldBe(touchNode.id, elementId);
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="test();">
|
| +<input id="normalText" type="text" value="Normal input">
|
| +<input id="readOnlyText" type="text" value="Readonly input" readonly>
|
| +<input id="disabledText" type="text" value="Disabled input" disabled>
|
| +<input id="readOnlyDisabledText" size="20" type="text" value="Readonly Disabled input"readonly disabled>
|
| +<textarea id="normalTextArea" cols="31">Normal textarea</textarea>
|
| +<textarea id="readOnlyTextArea" cols="31" readonly>Readonly textarea</textarea>
|
| +<textarea id="disabledTextArea" cols="31" disabled>Disabled textarea</textarea>
|
| +<textarea id="readOnlyDisabledTextArea" cols="31" readonly disabled>Readonly Disabled textarea</textarea>
|
| +</body>
|
| +</html>
|
| +
|
|
|