Closed Bug 15581 Opened 25 years ago Closed 25 years ago

&nbsp dos not work in form widgets

Categories

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

All
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: teruko, Assigned: rickg)

References

()

Details

In the form widgets, some fields does not handle &nbsp correctly.

In the above URL

   input type=button
   input type=readonly
   input type=reset
   input type=submit
   input type=text

 do not handle &nbsp correctly.

   input type=text area

 does not handle <  correctly.

Tested 10-01 Mac and Linux, 10-03 Win32 M10 build.
Assignee: karnaze → kmcclusk
Reassigning to Kevin.
The problem seems to be with attributes which begin with an entity reference. In
the example below (value=&lt;&nbsp;πώ) fails. It only display the <.

If you insert a non entity reference before the &lt such as a x.
(value=x&lt;&nbsp;πώ) then it works correctly. It displays the x, <, backspace
and πώ.

<HTML>
  <BODY>
   <FORM>
    <INPUT type=button style="width:100px;" value=x&lt;&nbsp;πώ>
   </FORM>
  </BODY>
</HTML>
The content model with (value=&lt;&nbsp;πώ)

webshell=00C79E40
html refcount=3<
  head refcount=2<
  >
  Text refcount=3<\n  >
  body refcount=3<
    Text refcount=3<\n   >
    form refcount=4<
      Text refcount=3<\n    >
      input type=button style=width: 100px;  value=< &nbsp= refcount=6<>
      Text refcount=3<\n   >
    >
    Text refcount=3<\n  \n\n>
  >
>

The content model with (value=x&lt;&nbsp;πώ)

html refcount=3<
  head refcount=2<
  >
  Text refcount=3<\n  >
  body refcount=3<
    Text refcount=3<\n   >
    form refcount=4<
      Text refcount=3<\n    >
      input type=button style=width: 100px;  value=x<α=¦ refcount=6<>
      Text refcount=3<\n   >
    >
    Text refcount=3<\n  \n\n>
  >
>

Dumping the content model in viewer shows the attribute for the button is not
set to the correct value when it begins with an entity reference.
Assignee: kmcclusk → rickg
I set a break point in void nsCParserNode::AddAttribute(CToken* aToken).

When I look at the aToken's mTextValue it is set to "&lt" for
(value=&lt;&nbsp;πώ). When value is set to (value=x&lt;&nbsp;πώ) the entire
string is correctly stored in the aToken's mTextValue.

Rick, looks like a parser bug.
Status: NEW → ASSIGNED
The parser was seeing the entity and stopping after that. I've taught it to
continue until the next common terminal. I'll check this in tomorrow after a
code review.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fixed by loosening up parsing rules for entities within attribute values.
Status: RESOLVED → VERIFIED
Using the 1999101808 build under NT, this looks the same as it does under 4.7.
I've posted a simple test case to http://schist/15581.html (Netscape internal
only).
You need to log in before you can comment on or make changes to this bug.