Fix use of incorrect variable, and harmless but valgrind-noisy use of variables in incorrect order. (Bug 455093)
authorL. David Baron <dbaron@dbaron.org>
Fri, 12 Sep 2008 20:45:37 -0700
changeset 19204 094602d1ccfcf8937002d5f7bb25f1d509aae0ff
parent 19203 a1770f9c945ff707d97862ec5505204f01b81bc6
child 19205 47e7de9ac585147de70d55357235338595cbfaa7
push id2020
push userdbaron@mozilla.com
push dateSat, 13 Sep 2008 03:46:28 +0000
treeherderautoland@95f310fa27bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs455093
milestone1.9.1b1pre
Fix use of incorrect variable, and harmless but valgrind-noisy use of variables in incorrect order. (Bug 455093)
layout/style/nsHTMLStyleSheet.cpp
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -184,21 +184,22 @@ ProcessTableRulesAttribute(void*       a
         bStyle = NS_STYLE_BORDER_STYLE_SOLID;
       }
       bStyle |= NS_STYLE_BORDER_STYLE_RULES_MARKER;
       borderData->SetBorderStyle(aSide, bStyle);
 
       nscolor borderColor;
       PRBool foreground;
       borderData->GetBorderColor(aSide, borderColor, foreground);
-      if (NS_GET_A(borderColor) == 0 || foreground) {
+      if (foreground || NS_GET_A(borderColor) == 0) {
         // use the table's border color if it is set, otherwise use black
         nscolor tableBorderColor;
         tableBorderData->GetBorderColor(aSide, tableBorderColor, foreground);
-        borderColor = (NS_GET_A(borderColor) == 0 || foreground) ? NS_RGB(0,0,0) : tableBorderColor;
+        borderColor = (foreground || NS_GET_A(tableBorderColor) == 0)
+                        ? NS_RGB(0,0,0) : tableBorderColor;
         borderData->SetBorderColor(aSide, borderColor);
       }
       // set the border width to be 1 pixel
       borderData->SetBorderWidth(aSide, nsPresContext::CSSPixelsToAppUnits(1));
     }
   }
 }