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

Unified Diff: LayoutTests/editing/selection/readonly-disabled-hittest.html

Issue 246203004: Fixed unnecessary Paste Popup showing issue when long press on ReadOnly/Disabled elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the typo in Layout test. Created 6 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/editing/selection/readonly-disabled-hittest-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
+
« no previous file with comments | « no previous file | LayoutTests/editing/selection/readonly-disabled-hittest-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698