Bug 444237 - "Crash with -moz-box-shadow: -moz-initial on input" [p=ventnor.bugzilla@gmail.com (Michael Ventnor) r+sr=dbaron]

This commit is contained in:
Michael Ventnor 2008-07-12 03:52:32 -05:00
parent 2d9641055d
commit 6317647cd2
3 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1 @@
<input style="-moz-box-shadow: -moz-initial;">

View File

@ -13,4 +13,5 @@ load 404470-1.html
load 411603-1.html
load 413274-1.xhtml
load 437170-1.html
load 444237-1.html
load 444848-1.html

View File

@ -1210,6 +1210,10 @@ nsRuleNode::GetBackgroundData(nsStyleContext* aContext)
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(Background), mPresContext, aContext);
ruleData.mColorData = &colorData;
// If any members need to be set to null here, they must also be set to
// null in HasAuthorSpecifiedRules (look at mBoxShadow in GetBorderData
// and HasAuthorSpecifiedRules).
return WalkRuleTree(eStyleStruct_Background, aContext, &ruleData, &colorData);
}
@ -1231,7 +1235,9 @@ nsRuleNode::GetBorderData(nsStyleContext* aContext)
ruleData.mMarginData = &marginData;
const void* res = WalkRuleTree(eStyleStruct_Border, aContext, &ruleData, &marginData);
marginData.mBoxShadow = nsnull; // We are sharing with some style rule. It really owns the data.
// We are sharing with some style rule. It really owns the data.
// This nulling must also happen in HasAuthorSpecifiedRules.
marginData.mBoxShadow = nsnull;
return res;
}
@ -1242,6 +1248,10 @@ nsRuleNode::GetPaddingData(nsStyleContext* aContext)
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(Padding), mPresContext, aContext);
ruleData.mMarginData = &marginData;
// If any members need to be set to null here, they must also be set to
// null in HasAuthorSpecifiedRules (look at mBoxShadow in GetBorderData
// and HasAuthorSpecifiedRules).
return WalkRuleTree(eStyleStruct_Padding, aContext, &ruleData, &marginData);
}
@ -5339,6 +5349,11 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext,
ruleData.mLevel = ruleNode->GetLevel();
ruleData.mIsImportantRule = ruleNode->IsImportantRule();
rule->MapRuleInfoInto(&ruleData);
// Do the same nulling out as in GetBorderData, GetBackgroundData
// or GetPaddingData.
// We are sharing with some style rule. It really owns the data.
marginData.mBoxShadow = nsnull;
if (ruleData.mLevel == nsStyleSet::eAgentSheet ||
ruleData.mLevel == nsStyleSet::eUserSheet) {
// This is a rule whose effect we want to ignore, so if any of