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

Side by Side Diff: components/autofill/ios/browser/resources/autofill_controller.js

Issue 2343753002: [ios] Fixed getUnownedAutofillableFormFieldElements_. (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Installs Autofill management functions on the |__gCrWeb| object. 5 // Installs Autofill management functions on the |__gCrWeb| object.
6 // 6 //
7 // It scans the DOM, extracting and storing forms and returns a JSON string 7 // It scans the DOM, extracting and storing forms and returns a JSON string
8 // representing an array of objects, each of which represents an Autofill form 8 // representing an array of objects, each of which represents an Autofill form
9 // with information about a form to be filled and/or submitted and it can be 9 // with information about a form to be filled and/or submitted and it can be
10 // translated to struct FormData 10 // translated to struct FormData
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 var unownedFieldsetChildren = []; 258 var unownedFieldsetChildren = [];
259 for (var i = 0; i < elements.length; ++i) { 259 for (var i = 0; i < elements.length; ++i) {
260 if (__gCrWeb.common.isFormControlElement(elements[i])) { 260 if (__gCrWeb.common.isFormControlElement(elements[i])) {
261 if (!elements[i].form) { 261 if (!elements[i].form) {
262 unownedFieldsetChildren.push(elements[i]); 262 unownedFieldsetChildren.push(elements[i]);
263 } 263 }
264 } 264 }
265 265
266 if (__gCrWeb.autofill.hasTagName(elements[i], 'fieldset') && 266 if (__gCrWeb.autofill.hasTagName(elements[i], 'fieldset') &&
267 !isElementInsideFormOrFieldSet(elements[i])) { 267 !isElementInsideFormOrFieldSet(elements[i])) {
268 fieldset.push(elements[i]); 268 fieldsets.push(elements[i]);
269 } 269 }
270 } 270 }
271 return __gCrWeb.autofill.extractAutofillableElementsFromSet( 271 return __gCrWeb.autofill.extractAutofillableElementsFromSet(
272 unownedFieldsetChildren); 272 unownedFieldsetChildren);
273 } 273 }
274 274
275 /** 275 /**
276 * Extracts fields from |controlElements| with |extractMask| to |formFields|. 276 * Extracts fields from |controlElements| with |extractMask| to |formFields|.
277 * The extracted fields are also placed in |elementArray|. 277 * The extracted fields are also placed in |elementArray|.
278 * 278 *
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 var elementName = __gCrWeb['common'].nameForAutofill(element); 2060 var elementName = __gCrWeb['common'].nameForAutofill(element);
2061 var value = formData[elementName]; 2061 var value = formData[elementName];
2062 if (value) { 2062 if (value) {
2063 element.placeholder = value; 2063 element.placeholder = value;
2064 } 2064 }
2065 } 2065 }
2066 } 2066 }
2067 }; 2067 };
2068 2068
2069 }()); // End of anonymous object 2069 }()); // End of anonymous object
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698