[Webkit-unassigned] [Bug 50380] Implement "required" attribute for select tags

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 7 04:03:48 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50380


Kent Tamura <tkent at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #75795|1                           |0
        is obsolete|                            |




--- Comment #30 from Kent Tamura <tkent at chromium.org>  2010-12-07 04:03:48 PST ---
(From update of attachment 75795)
View in context: https://bugs.webkit.org/attachment.cgi?id=75795&action=review

> WebCore/html/HTMLSelectElement.cpp:121
> +bool HTMLSelectElement::hasPlaceholderLabelOption() const
> +{
> +    int listIndex = optionToListIndex(0);
> +    ASSERT(listIndex >= 0);
> +    if (listIndex < 0)
> +        return false;
> +    HTMLOptionElement* option = static_cast<HTMLOptionElement*>(listItems()[listIndex]);
> +    return !option->disabled() && !listIndex && value().isEmpty();
> +}

value() should not be used here.  It should be the value of the "option".

Because this function might be called by others in the future, the implementation had better follow the definition of the specification as possible.
- multiple()-check should be moved here.
- size()-check should be moved here.

Then, valueMissing() implementation can be cleaner like:
return firstSelectionIndex < 0 || (!firstSelectedIndex && hasPlaceholderLabelOption());

> WebCore/html/ValidityState.cpp:109
>  bool ValidityState::valueMissing() const
>  {
> +    if (!m_control->willValidate())
> +        return false;
> +
>      if (m_control->hasTagName(inputTag)) {

This part conflicts with the latest WebKit.  Please rebase.

-- 
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