From a9baf2d0c279b8bb3f5dc5981d218c970595aca5 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Fri, 6 Mar 2009 13:05:01 +0900 Subject: [PATCH] Remove unreachable code, since text-decoration:none is not stored as an enumerated value. (Bug 481595) r+sr=bzbarsky --- layout/style/nsCSSDeclaration.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/layout/style/nsCSSDeclaration.cpp b/layout/style/nsCSSDeclaration.cpp index 3a05b9c9454c..6605aecf7f32 100644 --- a/layout/style/nsCSSDeclaration.cpp +++ b/layout/style/nsCSSDeclaration.cpp @@ -311,23 +311,20 @@ nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty, else if (eCSSUnit_Enumerated == unit) { if (eCSSProperty_text_decoration == aProperty) { PRInt32 intValue = aValue.GetIntValue(); - if (NS_STYLE_TEXT_DECORATION_NONE != intValue) { - PRInt32 mask; - for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE; - mask <= NS_STYLE_TEXT_DECORATION_BLINK; - mask <<= 1) { - if ((mask & intValue) == mask) { - AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, mask), aResult); - intValue &= ~mask; - if (0 != intValue) { // more left - aResult.Append(PRUnichar(' ')); - } + NS_ABORT_IF_FALSE(NS_STYLE_TEXT_DECORATION_NONE != intValue, + "none should be parsed as eCSSUnit_None"); + PRInt32 mask; + for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE; + mask <= NS_STYLE_TEXT_DECORATION_BLINK; + mask <<= 1) { + if ((mask & intValue) == mask) { + AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, mask), aResult); + intValue &= ~mask; + if (0 != intValue) { // more left + aResult.Append(PRUnichar(' ')); } } } - else { - AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_TEXT_DECORATION_NONE), aResult); - } } else if (eCSSProperty_azimuth == aProperty) { PRInt32 intValue = aValue.GetIntValue();