Bug 978833 patch 8 - Call SetImmutable for declarations of @page and keyframe rules. r=heycam

This probably should have been done before, but prior to this patch
series, dynamic changes of the declarations on these rules were broken
due to rule immutability violations; now that is no longer the case, but
to benefit from that, I believe we actually need to mark the
declarations as immutable once matched so that dynamic changes will
trigger construction of a new declaration (which thus has a new
nsIStyleRule identity).

--HG--
extra : commitid : 8IsYBd67qQr
This commit is contained in:
L. David Baron 2015-11-05 16:44:09 +08:00
Родитель 4ed7c0f036
Коммит 6208d2fc5b
2 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -625,6 +625,7 @@ ResolvedStyleCache::Get(nsPresContext *aPresContext,
// StyleAnimationValue values in AnimationPropertySegment).
nsStyleContext *result = mCache.GetWeak(aKeyframe);
if (!result) {
aKeyframe->Declaration()->SetImmutable();
nsCOMArray<nsIStyleRule> rules;
rules.AppendObject(aKeyframe);
RefPtr<nsStyleContext> resultStrong = aPresContext->StyleSet()->

Просмотреть файл

@ -1963,6 +1963,7 @@ nsStyleSet::ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag,
nsTArray<css::ImportantStyleData*> importantRules;
PresContext()->StyleSet()->AppendPageRules(rules);
for (uint32_t i = 0, i_end = rules.Length(); i != i_end; ++i) {
rules[i]->Declaration()->SetImmutable();
ruleWalker.Forward(rules[i]);
css::ImportantStyleData* importantRule = rules[i]->GetImportantRule();
if (importantRule) {