mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 17:59:34 +00:00
made parse color compress whitespace first
This commit is contained in:
parent
63b33bcbe8
commit
189579e0f1
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user