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

Side by Side Diff: LayoutTests/editing/selection/script-tests/click-in-margins-inside-editable-div.js

Issue 14859016: Don't force layout for mouse event hit tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix review comment Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 description("Ensure cursor placement matches IE6/IE7/FF3 when clicking above/bel ow lines in padding.") 1 description("Ensure cursor placement matches IE6/IE7/FF3 when clicking above/bel ow lines in padding.")
2 2
3 document.body.style.margin = 0; 3 document.body.style.margin = 0;
4 4
5 var div = document.createElement("div"); 5 var div = document.createElement("div");
6 div.style.cssText = "font-family: ahem; font-size: 20px; -webkit-text-fill-color : yellow; width: 40px; height: 80px; padding: 20px; background-color: green;"; 6 div.style.cssText = "font-family: ahem; font-size: 20px; -webkit-text-fill-color : yellow; width: 40px; height: 80px; padding: 20px; background-color: green;";
7 div.contentEditable = true; 7 div.contentEditable = true;
8 8
9 var firstText = document.createTextNode("XX"); 9 var firstText = document.createTextNode("XX");
10 var firstDiv = document.createElement("div"); 10 var firstDiv = document.createElement("div");
11 firstDiv.appendChild(firstText); 11 firstDiv.appendChild(firstText);
12 firstDiv.style.cssText = "padding-bottom: 19px; border-bottom: 1px solid pink; m argin-bottom: 20px"; 12 firstDiv.style.cssText = "padding-bottom: 19px; border-bottom: 1px solid pink; m argin-bottom: 20px";
13 div.appendChild(firstDiv); 13 div.appendChild(firstDiv);
14 14
15 var secondText = document.createTextNode("YY"); 15 var secondText = document.createTextNode("YY");
16 var secondDiv = document.createElement("div"); 16 var secondDiv = document.createElement("div");
17 secondDiv.appendChild(secondText); 17 secondDiv.appendChild(secondText);
18 div.appendChild(secondDiv); 18 div.appendChild(secondDiv);
19 19
20 document.body.insertBefore(div, document.body.firstChild); 20 document.body.insertBefore(div, document.body.firstChild);
21 21
22 // Mouse events only work after an initial layout
23 document.body.offsetLeft;
24
22 function clickShouldResultInRange(x, y, node, offset) { 25 function clickShouldResultInRange(x, y, node, offset) {
23 if (window.eventSender) { 26 if (window.eventSender) {
24 clickAt(x, y); 27 clickAt(x, y);
25 assertSelectionAt(node, offset); 28 assertSelectionAt(node, offset);
26 } else { 29 } else {
27 tests.push({ 30 tests.push({
28 testFunction: function() { assertRange(node, offset); }, 31 testFunction: function() { assertRange(node, offset); },
29 clickString: " " + x + ", " + y } 32 clickString: " " + x + ", " + y }
30 ) 33 )
31 } 34 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 editingTest("android"); 101 editingTest("android");
99 102
100 // Clean up after ourselves if we're not being run in the browser 103 // Clean up after ourselves if we're not being run in the browser
101 if (window.eventSender) { 104 if (window.eventSender) {
102 document.body.removeChild(div); 105 document.body.removeChild(div);
103 } else { 106 } else {
104 runInteractiveTests(); 107 runInteractiveTests();
105 } 108 }
106 109
107 var successfullyParsed = true; 110 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698