[Webkit-unassigned] [Bug 32261] Add ability to specify suggested autocomplete value in HTMLInputElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 11 14:27:52 PST 2009


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
  Attachment #44581|review?                     |review-
               Flag|                            |

--- Comment #16 from Darin Adler <darin at apple.com>  2009-12-11 14:27:51 PST ---
(From update of attachment 44581)
How about using a suggested value of null to mean suggest and thus eliminating
the separate enterSuggestMode function and m_suggestMode?

I don't think you need a leaveSuggestMode function. The client can call
setValue(suggestedValue) and then setSuggestedValue(String()) or just
setSuggestedValue(String()). If you think setSuggestedValue(String()) is too
ugly you could make a convenience function member called clearSuggestedValue.

Ideally you'd factor things so more logic was shared with setValue. Since there
is no regression test for this that's particularly important. It's likely
people would forget to update setSuggestedValue as they change setValue.

The name suggestMode is not a good name for a function or data member that's a
boolean. A good name would be something that completes the phrase "element
<xxx>", and "element suggest mode" does not work for that. I think
hasSuggestion or hasSuggestedValue would be good. Or you could omit this
function and say !suggestedValue().isNull() at the call sites.

We frown on the use of booleans for function arguments if the caller will be
passing a constant to a function like leaveSuggestMode. Instead we use enums.
See ReferrerPolicy, for example. But I suggest just removing the function

The PopupMenu changes should be in a separate patch. Even if for you they are
part of the same task, they are not directly related.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list