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

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

Issue 15508003: Revert "Don't force layout for mouse event hit tests" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
25 function clickShouldResultInRange(x, y, node, offset) { 22 function clickShouldResultInRange(x, y, node, offset) {
26 if (window.eventSender) { 23 if (window.eventSender) {
27 clickAt(x, y); 24 clickAt(x, y);
28 assertSelectionAt(node, offset); 25 assertSelectionAt(node, offset);
29 } else { 26 } else {
30 tests.push({ 27 tests.push({
31 testFunction: function() { assertRange(node, offset); }, 28 testFunction: function() { assertRange(node, offset); },
32 clickString: " " + x + ", " + y } 29 clickString: " " + x + ", " + y }
33 ) 30 )
34 } 31 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 editingTest("android"); 98 editingTest("android");
102 99
103 // Clean up after ourselves if we're not being run in the browser 100 // Clean up after ourselves if we're not being run in the browser
104 if (window.eventSender) { 101 if (window.eventSender) {
105 document.body.removeChild(div); 102 document.body.removeChild(div);
106 } else { 103 } else {
107 runInteractiveTests(); 104 runInteractiveTests();
108 } 105 }
109 106
110 var successfullyParsed = true; 107 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698