From afa048f8e8e2e6179aa17e4e7ef488bce6d0d5a3 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 27 Jun 2002 04:22:45 +0000 Subject: [PATCH] No need to CompressWhitespace here... Bug 154345, r=peterv, sr=jst --- content/html/content/src/nsGenericHTMLElement.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 3b9ef287c41..f9ea5e29b6d 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -2656,12 +2656,15 @@ nsGenericHTMLElement::ParseValueOrPercent(const nsAString& aString, nsHTMLUnit aValueUnit) { nsAutoString tmp(aString); - tmp.CompressWhitespace(PR_TRUE, PR_TRUE); PRInt32 ec, val = tmp.ToInteger(&ec); if (NS_OK == ec) { - if (val < 0) val = 0; - if (!tmp.IsEmpty() && tmp.RFindChar('%') >= 0) {/* XXX not 100% compatible with ebina's code */ - if (val > 100) val = 100; + if (val < 0) { + val = 0; + } + if (tmp.RFindChar('%') != kNotFound) { + if (val > 100) { + val = 100; + } aResult.SetPercentValue(float(val)/100.0f); } else { if (eHTMLUnit_Pixel == aValueUnit) {