[Webkit-unassigned] [Bug 33194] New: typeof form element group returns "function", causing a regression

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 4 20:36:08 PST 2010


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

           Summary: typeof form element group returns "function", causing
                    a regression
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: lambda at mac.com


Created an attachment (id=45859)
 --> (https://bugs.webkit.org/attachment.cgi?id=45859)
Example of behavior, displays "object" in Safari 4.0.4, but "function" in
WebKit nightly

In Safari 4.0.4, getting a form element group via document.forms[0].somename
gives you a collection that returns "object" when you call typeof on it. In the
latest WebKit nightly (r52686), it returns "function".  This behavior is
discussed in bug 14547, but it did not previously apply to the collections
retrieved by accessing a form element group.

This has caused a regression on the following page:
https://nhworksjobmatch.nhes.nh.gov/regstep1of3.asp?rt=ind . Once you click
past the privacy agreement, you get a registration form, with some radio
buttons near the bottom. If you fill out the form and click "next", it runs
some validation code, which results in an assertion failure, as it tries to
check that the form element of the given name has a typeof "object", when in
WebKit it has a typeof "function":


            // Get an object reference to the HTML control
            obj = eval("document.forms[" + ary[counter].FormIndex + "]." +
ary[counter].ControlName);
        }

        // Did it eval?
        if (typeof(obj) != "object") 
        { 
            alert("Developer Error: document.forms[" + ary[counter].FormIndex +
"]." + ary[counter].ControlName + " did not evaluate to a valid object!");
            return false;
        }

A fix for this problem, to allow NodeLists to be callable but have type
"object", has been discussed in bug 14547, but does not appear to be
implemented.

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