From f65db6acde1cd1b61bf7562524f84ef962a56e76 Mon Sep 17 00:00:00 2001 From: "jst%mozilla.jstenback.com" Date: Fri, 26 Mar 2004 01:44:44 +0000 Subject: [PATCH] Checking in for trev@gtchat.de. Fixing bug 238409. Regression in attribute parsing. r=bugmail@sicking.cc, sr=jst@mozilla.org, a=asa@mozilla.org --- content/base/src/nsAttrValue.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/content/base/src/nsAttrValue.cpp b/content/base/src/nsAttrValue.cpp index c3bc4f3433e..c7e960f5d06 100644 --- a/content/base/src/nsAttrValue.cpp +++ b/content/base/src/nsAttrValue.cpp @@ -764,16 +764,19 @@ nsAttrValue::ParseSpecialIntValue(const nsAString& aString, nsAutoString tmp(aString); PRInt32 val = tmp.ToInteger(&ec); - if (NS_FAILED(ec) && aCanBeProportional) { - // Even if the integer could not be parsed, it might just be "*" - tmp.CompressWhitespace(PR_TRUE, PR_TRUE); - if (tmp.Length() == 1 && tmp.Last() == '*') { - // special case: HTML spec says a value '*' == '1*' - // see http://www.w3.org/TR/html4/types.html#type-multi-length - // bug 29061 - SetIntValueAndType(1, eProportional); - return PR_TRUE; + if (NS_FAILED(ec)) { + if (aCanBeProportional) { + // Even if the integer could not be parsed, it might just be "*" + tmp.CompressWhitespace(PR_TRUE, PR_TRUE); + if (tmp.Length() == 1 && tmp.Last() == '*') { + // special case: HTML spec says a value '*' == '1*' + // see http://www.w3.org/TR/html4/types.html#type-multi-length + // bug 29061 + SetIntValueAndType(1, eProportional); + return PR_TRUE; + } } + return PR_FALSE; } val = PR_MAX(val, 0);