Closed Bug 14920 Opened 21 years ago Closed 21 years ago

[4x.P] GFX textfield size="N,M" is treated as size="M"

Categories

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

x86
Windows 98
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: mats, Assigned: rickg)

References

()

Details

(Whiteboard: [TESTCASE])

Attachments

(1 file)

GFX textfield size="N,M" is treated as size="M" by apprunner.
Both Navigator 4.08 and IE5 on Windows 98 treats this as size="N".
At the given URL above, it's the textfield in the "Sign up for free newsletter"
form. I'm using apprunner 1999-09-24-09-M11 on Windows 98.
Will attach a testcase to illustrate in a moment.
Attached file testcase
Whiteboard: [TESTCASE]
Assignee: karnaze → kmcclusk
Reassigning to Kevin.
Assignee: kmcclusk → buster
I'm not sure this is valid. Do we have to replicate old parsing behavior when
looking at an invalid size specification. I don't think N,M is valid looking at
the HTML4.0 spec.

size = cdata [CN]
     This attribute tells the user agent the initial width of the control. The
width is given in pixels except when type
     attribute has the value "text" or "password". In that case, its value
refers to the (integer) number of characters.
Assignee: buster → kmcclusk
Assignee: kmcclusk → rickg
The problem is the call to nsString::ToInteger returns the second value after
the comma instead of the value before the comma
in nsGenericHTMLElement::ParseValue.

PRBool
nsGenericHTMLElement::ParseValue(const nsString& aString, PRInt32 aMin,
                                 nsHTMLValue& aResult, nsHTMLUnit aValueUnit)
{
  PRInt32 ec, val = aString.ToInteger(&ec);
  if (NS_OK == ec) {
    if (val < aMin) val = aMin;
    if (eHTMLUnit_Pixel == aValueUnit) {
      aResult.SetPixelValue(val);
    }
    else {
      aResult.SetIntValue(val, aValueUnit);
    }
    return PR_TRUE;
  }

  return PR_FALSE;
}

Rick, should nsString::ToString be modified to return the first value instead of
the second in this case of aString.ToInteger("10,40"); ?
Additional info:
Navigator 3.04, 4.6, 4.61 and IE4 also treats it as size="N"
Status: NEW → ASSIGNED
Target Milestone: M11
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Fixed by change to GetNumericSubstring(). r=kmcclusk.
Using the 1999111016 M11 build on NT, this looks the same as in Nav 4.7. Marking
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.