Closed Bug 428732 Opened 17 years ago Closed 17 years ago

Changes form elements test through the DOM: inputs[11] is undefined

Categories

(www.mozilla.org :: General, defect)

x86
All
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla, Assigned: bugzilla)

References

()

Details

(Keywords: polish)

Steps to reproduce ================== 1- Load provided testcase URL 2- Click the "change size attribute" button Actual results in all Firefox and Seamonkey versions ==================================================== a) Error console reports: "Error: inputs[11] is undefined Source File: http://www.mozilla.org/newlayout/samples/test8dom.html?radio=js+bug Line: 52" b) Code source (line 48 to line 53) says: function changeSizes() { inputs[2].size = 100; inputs[3].size = 100; inputs[4].size = 100; inputs[11].size = 10; } Expected results ================ a) Error console should report no error. b) Code source (line 48 to line 53) should say: function changeSizes() { inputs[2].size = 100; inputs[3].size = 100; inputs[4].size = 100; inputs[10].size = 10; } Explanation: There are 11 form elements, not 12. Form elements are counted from 0 to N and therefore means that there are N+1 form elements. Severity set to minor Keyword polish added Status set to UNCONFIRMED because I'm not sure as to what is the correct component for this bug. Another point. I could FIX this bug but then I do not know why we create testcase-webpages like that (eg like http://www.mozilla.org/newlayout/samples/test8.html ) which are not fully web standards compliant (declaring a strict DTD and with no markup errors). I do not know if creating such webpages (no doctype decl. and with validation markup errors) is done on purpose.
The last 2 tests are also misleading: In "Disabled Option Test", the text says "You should see a Combobox with optgroups" but there is no optgroups; there are just options. Same error with the "Option Label Test". A few examples are without any realism, even without good usage or making sense. e.g.: <select size=1> <option>One</option> <option label="Label">Two</option> <option>Three</option> </select> "This [label] attribute allows authors to specify a shorter label for an option than the content of the OPTION element." http://www.w3.org/TR/html4/interact/forms.html#adef-label-OPTION but here, in the example, the label is longer than the content! One example, the "Optgroup Test", is particularly good though: the select has 3 optgroups for the each country having different regions or provinces providing world renowned tea.
Ooops... wrong bug number! Sorry! Ignore the previous comment.
CONFIRMING I will fix the error, then add a doctype declaration (HTML 4.01 strict DTD) and fix possible markup errors. assigning -> me
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: nobody → bugzilla
Status: ASSIGNED → NEW
Changed inputs[10].size = 10; (line 52); added doctype declaration strict; added 2 <link rel="...">; added quotes around attribute values; fixed all of the markup errors; pretty print + code indentation controlled by latest HTML Tidy version. Checking in mozilla-org/html/newlayout/samples/test8dom.html; /www/mozilla-org/html/newlayout/samples/test8dom.html,v <-- test8dom.html new revision: 1.2; previous revision: 1.1 done
Status: NEW → ASSIGNED
If there is a problem, just reopen and explain. Resolving as FIXED
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: mozilla.org → Websites
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.