Bug 822854: Crash [@ nsRuleNode::ComputeColumnData] with -moz-column-rule-color: inherit r=heycam
authorJet Villegas <jet@mozilla.com>
Fri, 04 Jan 2013 16:17:33 -0800
changeset 126680 345a115d32384f6d199f203c826ae1fc7f59a142
parent 125352 ba26dc1c6267bd22235e3ffca31824dba5ada4ec
child 126681 3077141dd57fe885707a430b1f1e3a071ad4b71d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs822854
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 822854: Crash [@ nsRuleNode::ComputeColumnData] with -moz-column-rule-color: inherit r=heycam
layout/style/nsRuleNode.cpp
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -7134,17 +7134,22 @@ nsRuleNode::ComputeColumnData(void* aSta
   }
 
   // column-rule-color: color, inherit
   const nsCSSValue& colorValue = *aRuleData->ValueForColumnRuleColor();
   if (eCSSUnit_Inherit == colorValue.GetUnit()) {
     canStoreInRuleTree = false;
     column->mColumnRuleColorIsForeground = false;
     if (parent->mColumnRuleColorIsForeground) {
-      column->mColumnRuleColor = parentContext->GetStyleColor()->mColor;
+      if (parentContext) {
+        column->mColumnRuleColor = parentContext->GetStyleColor()->mColor;
+      } else {
+        nsStyleColor defaultColumnRuleColor(mPresContext);
+        column->mColumnRuleColor = defaultColumnRuleColor.mColor;
+      }
     } else {
       column->mColumnRuleColor = parent->mColumnRuleColor;
     }
   }
   else if (eCSSUnit_Initial == colorValue.GetUnit() ||
            eCSSUnit_Enumerated == colorValue.GetUnit()) {
     column->mColumnRuleColorIsForeground = true;
   }