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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/resources/common.js

Issue 2219373002: input[type=search]: Flip the position of cancel button in RTL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 function $(id) { 1 function $(id) {
2 return document.getElementById(id); 2 return document.getElementById(id);
3 } 3 }
4 4
5 function createFormControlDataSet() { 5 function createFormControlDataSet() {
6 // A list of labelable elements resides in http://www.whatwg.org/specs/web-a pps/current-work/multipage/forms.html#category-label 6 // A list of labelable elements resides in http://www.whatwg.org/specs/web-a pps/current-work/multipage/forms.html#category-label
7 var formControlClassNames = [ 7 var formControlClassNames = [
8 'HTMLButtonElement', 8 'HTMLButtonElement',
9 'HTMLDataListElement', 9 'HTMLDataListElement',
10 'HTMLFieldSetElement', 10 'HTMLFieldSetElement',
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return rect; 95 return rect;
96 } 96 }
97 97
98 function searchCancelButtonPosition(element) { 98 function searchCancelButtonPosition(element) {
99 var pos = {}; 99 var pos = {};
100 pos.x = element.offsetLeft + element.offsetWidth - 9; 100 pos.x = element.offsetLeft + element.offsetWidth - 9;
101 pos.y = element.offsetTop + element.offsetHeight / 2; 101 pos.y = element.offsetTop + element.offsetHeight / 2;
102 return pos; 102 return pos;
103 } 103 }
104 104
105 function rtlSearchCancelButtonPosition(element) {
106 var pos = {};
107 pos.x = element.offsetLeft + 9;
108 pos.y = element.offsetTop + element.offsetHeight / 2;
109 return pos;
110 }
111
105 function mouseMoveToIndexInListbox(index, listboxId) { 112 function mouseMoveToIndexInListbox(index, listboxId) {
106 var listbox = document.getElementById(listboxId); 113 var listbox = document.getElementById(listboxId);
107 var itemHeight = Math.floor(listbox.offsetHeight / listbox.size); 114 var itemHeight = Math.floor(listbox.offsetHeight / listbox.size);
108 var border = 1; 115 var border = 1;
109 var y = border + index * itemHeight; 116 var y = border + index * itemHeight;
110 if (window.eventSender) 117 if (window.eventSender)
111 eventSender.mouseMoveTo(listbox.offsetLeft + border, listbox.offsetTop + y - window.pageYOffset); 118 eventSender.mouseMoveTo(listbox.offsetLeft + border, listbox.offsetTop + y - window.pageYOffset);
112 } 119 }
113 120
114 function getUserAgentShadowTextContent(element) { 121 function getUserAgentShadowTextContent(element) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return; 229 return;
223 } 230 }
224 for (var i = 0; i < str.length; ++i) { 231 for (var i = 0; i < str.length; ++i) {
225 var key = str.charAt(i); 232 var key = str.charAt(i);
226 if (key == '\n') 233 if (key == '\n')
227 key = 'Enter'; 234 key = 'Enter';
228 eventSender.keyDown(key); 235 eventSender.keyDown(key);
229 } 236 }
230 } 237 }
231 238
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/LayoutTests/fast/forms/search/search-rtl.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698