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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/selection/readonly-disabled-hittest-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 function test() {
7 jsTestAsync = true;
8 if (window.testRunner)
9 testRunner.dumpAsText();
10
11 if (!window.eventSender)
12 return;
13
14 if (!window.eventSender.gestureLongPress) {
15 debug("gestureLongPress not implemented by this platform.");
16 debug("Manullay long press on every element in the page and check whethe r Paste Popup is appearing or not");
17 debug("If Paste popup is appearing for readonly or disabled input/textar ea, then it's a failure.");
18 return;
19 }
20
21 // Normal Text
22 doLongPressOnElement("normalText");
23
24 // ReadOnly Text
25 doLongPressOnElement("readOnlyText");
26
27 // Disabled Text
28 doLongPressOnElement("disabledText");
29
30 // ReadOnly and Disabled Text
31 doLongPressOnElement("readOnlyDisabledText");
32
33 // Normal TextArea
34 doLongPressOnElement("normalTextArea");
35
36 // ReadOnly TextArea
37 doLongPressOnElement("readOnlyTextArea");
38
39 // Disabled TextArea
40 doLongPressOnElement("disabledTextArea");
41
42 // ReadOnly and Disabled TextArea
43 doLongPressOnElement("readOnlyDisabledTextArea");
44
45 finishJSTest();
46 }
47
48 function doLongPressOnElement(elementId) {
49 var element = document.getElementById(elementId);
50 var bounds = element.getBoundingClientRect();
51 var middleX = (bounds.left + bounds.right) / 2;
52 var middleY = (bounds.top + bounds.bottom) / 2;
53 // Touch directly in the center of the element.
54 window.eventSender.gestureLongPress(middleX, middleY);
55 var touchNode = document.elementFromPoint(middleX, middleY);
56 shouldBe(touchNode.id, elementId);
57 }
58 </script>
59 </head>
60 <body onload="test();">
61 <input id="normalText" type="text" value="Normal input">
62 <input id="readOnlyText" type="text" value="Readonly input" readonly>
63 <input id="disabledText" type="text" value="Disabled input" disabled>
64 <input id="readOnlyDisabledText" size="20" type="text" value="Readonly Disabled input"readonly disabled>
65 <textarea id="normalTextArea" cols="31">Normal textarea</textarea>
66 <textarea id="readOnlyTextArea" cols="31" readonly>Readonly textarea</textarea>
67 <textarea id="disabledTextArea" cols="31" disabled>Disabled textarea</textarea>
68 <textarea id="readOnlyDisabledTextArea" cols="31" readonly disabled>Readonly Dis abled textarea</textarea>
69 </body>
70 </html>
71
OLDNEW
« 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