Closed Bug 207481 Opened 22 years ago Closed 21 years ago

[FIX]id attribute outside a form overrides

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.7alpha

People

(Reporter: joerg.baumann, Assigned: bzbarsky)

Details

(Keywords: testcase)

Attachments

(4 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030401 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030401 an image with id="reset" outside a form overrides the reset() function in the Javascript representation of the form-element. Reproducible: Always Steps to Reproduce: 1. load testcase strict.html or transitional.html 2. enter text 3. click on "Reset me" Actual Results: entered text is still there Expected Results: entered text should be erased I tested it with mozilla 1.0.1, 1.2.1, 1.3 1.4a, 1.4b on linux. All show the same behavior. There are three examples 1. strict.html (uses HTML 4.01 Strict and id attribute) 2. transitional.html (uses HTML 4.01 Transitional and name attribute) 3. xhtml.xml (uses XHTML 1.0 Strict and id attribute) All are very similar and use following construct: <img ... id/name="reset"> ... <form ... id/name="formular"> </form> Case 3 works, but for case 1 and 2 the image overrides the reset()-function of the formular which is then not longer accessbile from javascript. So it's seems that the HTML DOM is broken here, but the XHTML DOM works.
Attached file strict.html
broken example
Attached file transitional.html
broken example
Attached file xhtml.xml
working example
Attachment #124440 - Attachment mime type: text/xml+xhtml → text/xml
this is the same problem that bug 148782, but I can't find an open bug about the "reset" problem.
Summary: id attribute outside a form overrides → id attribute outside a form overrides
Wups sorry I added myself as CC and pressed enter stupidly. This bug should be easy to fix now that bug 148782 is fixed. The mechanisms are there, just have to use them. Marking NEW. P2/Normal to match bug 148782. All/All, adding testcase keyword.
Severity: major → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
OS: Linux → All
Priority: -- → P2
Hardware: PC → All
brendan? What's going on here?
QA Contact: desale → ian
What a mess. Cc'ing bz, who fixed bug 148782. I don't know the code involved here, and don't have time to analyze it. I expect jst or peterv can help too. /be
Attached patch PatchSplinter Review
We suck. Should have noticed the lack of an aForm check here... :(
Comment on attachment 138468 [details] [diff] [review] Patch jst, would you do the honors?
Attachment #138468 - Flags: superreview?(jst)
Attachment #138468 - Flags: review?(jst)
Taking.
Assignee: general → bz-vacation
Priority: P2 → P1
Summary: id attribute outside a form overrides → [FIX]id attribute outside a form overrides
Target Milestone: --- → mozilla1.7alpha
Comment on attachment 138468 [details] [diff] [review] Patch r+sr=jst
Attachment #138468 - Flags: superreview?(jst)
Attachment #138468 - Flags: superreview+
Attachment #138468 - Flags: review?(jst)
Attachment #138468 - Flags: review+
Fix checked in for 1.7a
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: