[Webkit-unassigned] [Bug 19562] ValidityState object stub

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 4 11:40:29 PDT 2008


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


eric at webkit.org changed:

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




------- Comment #2 from eric at webkit.org  2008-07-04 11:40 PDT -------
(From update of attachment 21716)
In general, this looks fine.

I'm sad that %baseTypeHash still exists (but that's not your fault).  That
information needs to move into .in or .idl files.

This needs your copyright instead of Apple's :)

+    // ValidityState objects are always bound to their controls at creation
time
isn't really needed.  The ASSERT says the same thing.

So is there any way a ValidityState could outlive its associated form control? 
If so, its going to end up with a bad pointer to a deleted form control.

This would be clearer:
+    return (!(typeMismatch() || stepMismatch() || rangeUnderflow() ||
rangeOverflow() ||
+            tooLong() || patternMismatch() || valueMissing() ||
customError()));
Written in two parts:

+    bool formHasError = typeMismatch() || stepMismatch() || rangeUnderflow()
|| rangeOverflow() ||
+            tooLong() || patternMismatch() || valueMissing() || customError();
+   return !formHasError;

The use of the extra variable name makes the long boolean expression much
clearer to read.

+        static PassRefPtr<ValidityState> create(HTMLFormControlElement* owner
= 0)

Should not have =0 if the form control is required.  That makes it a compile
time error to call HTMLFormControlElement::create() w/o arguments instead of a
runtime error.

r- for the possible crasher (and for the =0 in the create call).

How about adding a minimal js test case which tests for the existence of this
interface?  Hum...I guess there is no way to get at it yet (you haven't added a
ValidityState accessor onto form controls.


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



More information about the webkit-unassigned mailing list