Closed Bug 154345 Opened 23 years ago Closed 22 years ago

ParseValueOrPercent compressing whitespace unnecessarily

Categories

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

All
Other
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 obsolete file)

nsGenericElement::ParseValueOrPercent and nsGenericElement::ParseValueOrPercentOrProportional are calling CompressWhitespace(), which is not needed -- ToInteger() will properly handle leading whitespace...
Attached patch Proposed patch (obsolete) — Splinter Review
Fixing ParseValueOrPercentOrProportional is hard; this fixes ParseValueOrPercent
Comment on attachment 89240 [details] [diff] [review] Proposed patch r=peterv
Attachment #89240 - Flags: review+
Comment on attachment 89240 [details] [diff] [review] Proposed patch Split the line: if (val < 0) val = 0; into two separate lines, and add braces while you're at it... sr=jst
Attachment #89240 - Flags: superreview+
Fix checked in; I'll want to get rid of those nsAutoStrings in general at some point, methinks....
Priority: -- → P5
Target Milestone: --- → Future
Attachment #89240 - Attachment is obsolete: true
QA Contact: desale → stummala
Boris: please be very carefull what you are doing here, this code is heavily used by tables and it covers some strange attribute cases. Please look at lxr that you don't regress the bugs that have been fixed here already.
Yeah, I will.... that's why I did not touch ParseValueOrPercentOrProportional yet...
alright, marking this fixed. jkeiser moved all this code around and I think we now only compress whitespace when it's actually needed (see nsHTMLValue::ParseIntValue)
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: