Remove unreachable code, since text-decoration:none is not stored as an enumerated value. (Bug 481595) r+sr=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Fri, 06 Mar 2009 13:05:01 +0900
changeset 25800 154a9af70678555c8d866285c30cb18da127d490
parent 25799 ac91e21d53c597db9ad418d4b931f584420bba68
child 25801 3a9de3a90f021333da189a906522575b1bfa57f9
push idunknown
push userunknown
push dateunknown
bugs481595
milestone1.9.2a1pre
Remove unreachable code, since text-decoration:none is not stored as an enumerated value. (Bug 481595) r+sr=bzbarsky
layout/style/nsCSSDeclaration.cpp
--- a/layout/style/nsCSSDeclaration.cpp
+++ b/layout/style/nsCSSDeclaration.cpp
@@ -306,33 +306,30 @@ nsCSSDeclaration::AppendCSSValueToString
   else if (eCSSUnit_Integer == unit) {
     nsAutoString tmpStr;
     tmpStr.AppendInt(aValue.GetIntValue(), 10);
     aResult.Append(tmpStr);
   }
   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();
       AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, (intValue & ~NS_STYLE_AZIMUTH_BEHIND)), aResult);
       if ((NS_STYLE_AZIMUTH_BEHIND & intValue) != 0) {
         aResult.Append(PRUnichar(' '));
         AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_AZIMUTH_BEHIND), aResult);
       }