Closed Bug 171713 Opened 23 years ago Closed 21 years ago

[FIX]<input> should imply missing/misplaced </select>

Categories

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

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha2

People

(Reporter: martin, Assigned: bzbarsky)

References

()

Details

(Keywords: compat)

Attachments

(1 file)

This is a bug for an enhancement to quirks mode. With the following (admittedly, invalid and evil and wrong) html, one gets a form that can be submitted when using i.e. or even when using lynx. However, mozilla fails to render the submit button: <FORM ACTION='http://www.furious-george.net' METHOD='POST'> <SELECT SIZE=1 NAME='stops'> <OPTION VALUE='1' NAME='stops'>1 <OPTION VALUE='2' NAME='stops'>2 <OPTION VALUE='3' NAME='stops'>3 <OPTION VALUE='4' NAME='stops'>4 <OPTION VALUE='5' NAME='stops'>5 <P><INPUT TYPE='submit' VALUE='Move'></SELECT></FORM> Quirks mode should consider either the <P> tag or the <INPUT> tag as implicitly closing the <SELECT>; it appears visually that i.e. ignores the <P> tag. A snippet of lynx -trace output (shown below) shows that lynx also ignores the <P> but considers the <INPUT> to end the enclosing <SELECT>: ========snip========== SGML: Start <OPTION> Entering HText_setLastOptionValue: value:4 , checked:off HText_setLastOptionValue: value=4 val_cs=0 "iso-8859-1" (submit_val_cs 0 "iso-8859-1") submit_value=4 HTML:begin_element[4]: adding style to stack - Normal (OPTION) SGML: End </OPTION> <- supplied, start <P> SGML: Still open SELECT <- ***invalid start <P> SGML: Still open SELECT <- ***ignoring start <P> SGML: End </SELECT> <- ***forced by start <INPUT> Entering HText_setLastOptionValue: value:5 , checked:off HText_setLastOptionValue: LAST_ORDER value=5 val_cs=0 "iso-8859-1" (submit_val_cs 0 "iso-8859-1") submit_value=5 SGML: Start <INPUT> Ok, we're trying type=[submit] 2.Ok, we're trying type=[submit] (present=0xa0435f9) 3.Ok, we're trying type=[submit] normal field type: submit 4.Ok, we're trying type=[submit] GridText: Entering HText_beginInput Input link: name= value=Move size=4 Input link: name_cs=0 "iso-8859-1" (from 0 "iso-8859-1") value_cs=0 "iso-8859-1" (from 0 "iso-8859-1") I.submit have 4 chars, or something I.submit, 1 SGML: Still open FORM, ***no open SELECT for </SELECT> SGML: End </FORM> ========snip==========
To parser.
Assignee: jkeiser → harishd
Status: UNCONFIRMED → NEW
Component: HTML Form Controls → Parser
Ever confirmed: true
QA Contact: tpreston → moied
Keywords: compat
This may actually be reasonable to do.... Should be a tweak to nsElementTable.cpp, but there are four totally undocumented fields in the table that have to do with autoclosing behavior... :(
This wouldn't be a quirks-mode only thing. Remove "quirk" from summary.
Summary: Quirks mode should ignore missing/misplaced </select> → <input> should imply missing/misplaced </select>
We could probably do this by removing the exclgroup for <select>, but that's scary.... Alternately, we could allow <input> as a special child of select but make it autoclose the select? (evil and counterintuitive, but it works, and is much less invasive!) I wish this code were somewhat documented.
Blocks: 140657
*** Bug 244469 has been marked as a duplicate of this bug. ***
Blocks: 245047
Attached patch PatchSplinter Review
Assignee: harishd → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 149607 [details] [diff] [review] Patch peterv, could you review? The long comment should explain what's going on, I think.... This patch gives us something close to IE compat on this sort of markup (fixes this bug and the bugs it blocks).
Attachment #149607 - Flags: superreview?(peterv)
Attachment #149607 - Flags: review?(peterv)
Severity: minor → normal
Priority: -- → P1
Summary: <input> should imply missing/misplaced </select> → [FIX]<input> should imply missing/misplaced </select>
Target Milestone: --- → mozilla1.8alpha2
Attachment #149607 - Flags: superreview?(peterv)
Attachment #149607 - Flags: superreview+
Attachment #149607 - Flags: review?(peterv)
Attachment #149607 - Flags: review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
No longer blocks: 245047
*** Bug 245047 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: