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

Side by Side Diff: LayoutTests/touchadjustment/search-cancel.html

Issue 100823012: Show delete button in input[type=search] only if the field is editable and focused/hovered. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update touchadjustment/search-cancel.html Created 7 years 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
« no previous file with comments | « LayoutTests/fast/forms/search/search-appearance-basic.html ('k') | Source/core/css/html.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Touch Adjustment : Shadow DOM Element Search Cancel Button - bug 9189 4</title> 4 <title>Touch Adjustment : Shadow DOM Element Search Cancel Button - bug 9189 4</title>
5 <script src="../resources/js-test.js"></script> 5 <script src="../resources/js-test.js"></script>
6 <script src="resources/touchadjustment.js"></script> 6 <script src="resources/touchadjustment.js"></script>
7 <style> 7 <style>
8 input[type='search'] { 8 input[type='search'] {
9 -webkit-appearance: none; 9 -webkit-appearance: none;
10 -webkit-box-sizing: border-box; 10 -webkit-box-sizing: border-box;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 var textContentBounds; 42 var textContentBounds;
43 var touchBounds; 43 var touchBounds;
44 var targetBounds; 44 var targetBounds;
45 var targetContainsPoint; 45 var targetContainsPoint;
46 var touchContainsPoint; 46 var touchContainsPoint;
47 47
48 function runTouchTests() { 48 function runTouchTests() {
49 document.addEventListener('click', function() {}, false); 49 document.addEventListener('click', function() {}, false);
50 50
51 element = document.getElementById('target'); 51 element = document.getElementById('target');
52 element.focus();
52 53
53 inputBounds = findAbsoluteBounds(element); 54 inputBounds = findAbsoluteBounds(element);
54 55
55 var touchRadius = 20; 56 var touchRadius = 20;
56 var offset = touchRadius / 2; 57 var offset = touchRadius / 2;
57 58
58 // Center of cancel button. 59 // Center of cancel button.
59 var midX = inputBounds.left + inputBounds.width - 11; 60 var midX = inputBounds.left + inputBounds.width - 11;
60 var midY = inputBounds.top + inputBounds.height / 2; 61 var midY = inputBounds.top + inputBounds.height / 2;
61 62
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 { 113 {
113 if (window.testRunner && window.internals && internals.touchNodeAdjusted ToBestClickableNode) { 114 if (window.testRunner && window.internals && internals.touchNodeAdjusted ToBestClickableNode) {
114 description('Test touch adjustment on a search field with a visible cancel button.'); 115 description('Test touch adjustment on a search field with a visible cancel button.');
115 runTouchTests(); 116 runTouchTests();
116 } 117 }
117 } 118 }
118 runTests(); 119 runTests();
119 </script> 120 </script>
120 </body> 121 </body>
121 </html> 122 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/search/search-appearance-basic.html ('k') | Source/core/css/html.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698