Bug 1161325 - Make nsStyleVariables copy constructor behave more traditionally. r=dbaron

This commit is contained in:
Cameron McCormack 2015-05-05 19:57:34 +10:00
parent 91197585f6
commit 75f1ec8916
2 changed files with 7 additions and 1 deletions

View File

@ -2611,7 +2611,12 @@ nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContex
parentdata_ = maybeFakeParentData.ptr(); \
} \
} \
if (aStartStruct) \
if (eStyleStruct_##type_ == eStyleStruct_Variables) \
/* no need to copy construct an nsStyleVariables, as we will copy */ \
/* inherited variables (and set canStoreInRuleTree to false) in */ \
/* ComputeVariablesData */ \
data_ = new (mPresContext) nsStyle##type_ ctorargs_; \
else if (aStartStruct) \
/* We only need to compute the delta between this computed data and */ \
/* our computed data. */ \
data_ = new (mPresContext) \

View File

@ -3643,6 +3643,7 @@ nsStyleVariables::nsStyleVariables()
nsStyleVariables::nsStyleVariables(const nsStyleVariables& aSource)
{
MOZ_COUNT_CTOR(nsStyleVariables);
mVariables = aSource.mVariables;
}
nsStyleVariables::~nsStyleVariables(void)