Hi all,

I am working through the code to find hooks to implement automatic
form filling.

I have come across what appears to be an omission, but need to check
in fixing it I'm not going to cause issues elsewhere.

I am in dom_operations.cc in Glue.  On calling FillForm this calls
FindFormElements then FillFormImpl.

Both take a FormData structure which is a nice simple structure
containing GURLs for origin and action, 2 vectors of strings for
element name and element value, and lastly a string that names the
Submit button.

// Holds information about a form to be filled and/or submitted.
struct FormData {
  // The URL (minus query parameters) containing the form
  GURL origin;
  // The action target of the form
  GURL action;
  // A list of element names to be filled
  std::vector<std::wstring> elements;
  // A list of element values to be filled
  std::vector<std::wstring> values;
  // The name of the submit button to be used to submit (optional)
  std::wstring submit;
};

FillFormImpl as it stands expects the Submit form item to be part of a
list of form elements passed into it.

However FindFormElements (which just calls FindFormInputElements) only
searches for elements matching the elements array and ignores the
submit button.

I'm assuming in the design for this it was expected that the submit
would be part of the elements and that the fill routine is right, and
the find routine is wrong.  I have therefore extended its search to
return the submit button in the list of elements as the fill form
routine expects.  (An extra search outside the for loop).  It makes
sense to do the search for everything in the find elements routine.


I need to check that this is OK with all other parts of Chrome that
may call FindFormInputElements in some way, or may use the data it
returns (It looks like there may be a global structure for form
elements).  If the FormData struct that is passed in does not contain
a submit button name then nothing will change.

If I find problems in my testing how would you recommend I proceed
fixing them?

Thanks,
Chris


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/chromium-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to