[Webkit-unassigned] [Bug 34733] :invalid only works when input is in a form

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 6 10:34:32 PDT 2010


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
  Attachment #52648|review?                     |review+
               Flag|                            |

--- Comment #10 from Darin Adler <darin at apple.com>  2010-04-06 10:34:32 PST ---
(From update of attachment 52648)
> -    , m_willValidate(false)
> +    , m_willValidateInitialized(false)
> +    , m_willValidate(true)

I am not sure that "initialized" is the right word here. Since you called the
function "recalc" maybe you should reverse the sense and call it
"m_willValidateNeedsRecalc" or "m_needsWillValidateRecalc"? Or maybe this is
needed only during construction. Maybe we can make m_willValidateInitialized be
a debug-only concept?

>      // FIXME: Check if the control does not have a datalist element as an ancestor.
> -    return m_form && m_hasName && !m_disabled && !m_readOnly;
> +    return !m_disabled && !m_readOnly;

It would be good to make that existing FIXME clearer and more specific. Check
that, and do what? Why check it?

>      bool newWillValidate = recalcWillValidate();
> -    if (m_willValidate == newWillValidate)
> +    if (m_willValidateInitialized && m_willValidate == newWillValidate)
>          return;
> +    m_willValidateInitialized = true;

This seems a little strange. Do we really need to recalc immediately here?
There at least needs to be a comment explaining why this doesn't just set
m_willValidateInitialized to false and return.


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