Implement the HTML5 algorithm for parsing a legacy color value: add comment pointing out whitespace and emptiness issues. (Bug 121738)

This commit is contained in:
L. David Baron 2010-06-03 13:11:35 -07:00
parent 46fa64dce6
commit 975623ca0e

View File

@ -1142,6 +1142,10 @@ nsAttrValue::ParseColor(const nsAString& aString, nsIDocument* aDocument)
{
ResetIfSet();
// FIXME (partially, at least): HTML5's algorithm says we shouldn't do
// the whitespace compression, trimming, or the test for emptiness.
// (I'm a little skeptical that we shouldn't do the whitespace
// trimming; WebKit also does it.)
nsAutoString colorStr(aString);
colorStr.CompressWhitespace(PR_TRUE, PR_TRUE);
if (colorStr.IsEmpty()) {