Closed Bug 7548 Opened 23 years ago Closed 23 years ago

<select> not doing default select when tags close themselves

Categories

(Core :: Layout: Form Controls, defect, P3)

PowerPC
Mac System 8.5
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: Brade, Assigned: harishd)

Details

(Whiteboard: [TESTCASE][1999.07.26]reporter to verify)

Attachments

(2 files)

In the following html, "right alignment" isn't selected.
However, if I change the <option> tags to be formatted so the closure is in a
separate tag like:
  <option>left alignment</option>
then the 3rd item does get selected.


<html>
  <head>
    <title> select test </title>
  </head>

  <body>
    <form>
			  <select size="1" name="hrule.alignType">
			    <optgroup label="alignment" value="centered">
				    <option/>left alignment
				    <option/>center alignment
				    <option selected/>right alignment
			    </optgroup>
			  </select>
    </form>
  </body>
</html>
note: the problem is the same if you change it to a list (size="3")--no selection
is made unless using </option>
Moving all Widget Set bugs, past and present, to new HTML Form Controls
component per request from karnaze.  Widget Set component will be retired
shortly.
Whiteboard: [TESTCASE] <option selected/> doesn't work, <option selected /> does...
Overview Description:
<option selected/> does not work as expected, <option selected /> does.

Steps to reproduce:
 1) load the attachment
 2 [details] [diff] [review]) have a look at the two combo boxes. The left one has it's third option like
that: <option selected/>; the right one's third option looks like this: <option
selected />

Actual result:
the left box  displays its first option; only the right box (correctly) displays
its third option.

Expected result:
both boxes to have their third option selected

Build No.: 1999071417 build (Win32)

Additional information:
 Obviously, the tag is imho (internally) split up into "<", "option",
"selected/" and ">" and not into "<", "option", "selected" and "/>"
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
As far as I know, the self-closing tag syntax <foo/> is an XML-ism.  I just read
through the HTML 4 spec and couldn't find mention of it.

Just as a check, I created a page that passes all the fun tests at:
http://validator.w3.org/

But contained an <option/> tag.  Weblint complained:

line 11: unknown element <OPTION/>.
line 12: unknown attribute "SELECTED/" for element <OPTION>.

At any rate, if this bug is to be fixed, it needs to be fixed in the parser, as
the content model is being constructed incorrectly for your interpretation.  As
Christian guessed, it is being parsed as < option selected/ >, as can be seen by
viewing the document in viewer then dumping the content model.

You can work around this bug, if you are truly averse to using:
<select>
 <option>foo</option>
</select>

With this shorter syntax, also parsed as you would expect:
<select>
 <option>foo
 <option>bar
</select>

I'm going to mark this bug invalid.  If you really want this to work as you
described, please reopen but assign to harishd, the parser guru.  Thanks!
Status: RESOLVED → REOPENED
Assignee: pollmann → harishd
Status: REOPENED → NEW
reopening bug

I'd like harishd to at least look into the bug to ensure that the bug isn't

causing problems / other bugs in the parser.
Resolution: INVALID → ---
reassign to harishd and clear resolution
Target Milestone: M9
cathy, I do have a fix for this.  But I will not be checking it in until I'm
convinced with the performance data :)
Status: NEW → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Fix is in.

Marking FIXED.
Whiteboard: [TESTCASE] <option selected/> doesn't work, <option selected /> does... → [TESTCASE][1999.07.26]reporter to verify
kathy, can you please verify?
QA Contact massive update.
Status: RESOLVED → VERIFIED
Marking VERIFIED FIXED in MacOS86 102708 apprunner.
Also works on Linux6 102708 apprunner and Win98 102709 apprunner.
You need to log in before you can comment on or make changes to this bug.