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

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: Refined the Layout test case. 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
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..df6254f97764ef31bd9ed8affd3116ecc2cf49a3
--- /dev/null
+++ b/LayoutTests/editing/selection/readonly-disabled-hittest.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<script src="../../touchadjustment/resources/touchadjustment.js"></script>
Yuta Kitamura 2014/10/16 04:01:23 Using this code sounds like an abuse to me, becaus
AKVT 2014/10/16 17:17:14 Done.
+<script>
+function test() {
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ if (!window.eventSender)
+ return;
+
+ if (!window.eventSender.gestureLongPress) {
+ debug("gestureLongPress not implemented by this platform.");
Yuta Kitamura 2014/10/16 04:01:23 It would be nice if you can add some instruction t
AKVT 2014/10/16 17:17:13 Done. Thanks
+ 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");
+}
+
+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.
+ var touchPoint = offsetTouchPoint(findAbsoluteBounds(element), 'center', 0, 0, 0);
+ window.eventSender.gestureLongPress(touchPoint.x, touchPoint.y);
+ shouldBeNode(document.elementFromPoint(middleX, middleY), element);
+}
+</script>
+</head>
+<body onload="test();">
Yuta Kitamura 2014/10/16 04:01:23 I would recommend setting jsTestIsAsync to true (a
AKVT 2014/10/16 17:17:13 Done. Thank you
+<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 and 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>
+

Powered by Google App Engine
This is Rietveld 408576698