From 189579e0f191608476895f40fed6fde27a3807b2 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Wed, 12 Aug 1998 18:28:55 +0000 Subject: [PATCH] made parse color compress whitespace first --- layout/html/base/src/nsHTMLTagContent.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layout/html/base/src/nsHTMLTagContent.cpp b/layout/html/base/src/nsHTMLTagContent.cpp index 6a4be25bf866..4595d532e41a 100644 --- a/layout/html/base/src/nsHTMLTagContent.cpp +++ b/layout/html/base/src/nsHTMLTagContent.cpp @@ -1543,12 +1543,14 @@ nsHTMLTagContent::MapImageBorderInto(nsIStyleContext* aContext, PRBool nsHTMLTagContent::ParseColor(const nsString& aString, nsHTMLValue& aResult) { - char cbuf[40]; - aString.ToCString(cbuf, sizeof(cbuf)); if (aString.Length() > 0) { + nsAutoString colorStr (aString); + colorStr.CompressWhitespace(); + char cbuf[40]; + colorStr.ToCString(cbuf, sizeof(cbuf)); nscolor color; if (NS_ColorNameToRGB(cbuf, &color)) { - aResult.SetStringValue(aString); + aResult.SetStringValue(colorStr); return PR_TRUE; } if (NS_HexToRGB(cbuf, &color)) {