Bug 1479681: Fix the loop in nsTransitionManager dealing with stopping all transitions. r=hiro a=aryx

The loop was mutating the nsCSSPropertyID used to guard the exit, which is
obviously wrong.

This branch is pretty rarely taken, since people don't usually specify `all` as
a transition property other than the first, for which case we take the fast path
with `checkProperties = false`. Our test-suite failed to catch this.

Added a crashtest that hangs without this patch.

The reason bug 1478990 regressed this is because it changed the order of
nsCSSPropertyID so that `p` actually went backwards causing the infinite loop,
but the bug was introduced (by me, whoops) in bug 1309752.

Differential Revision: https://phabricator.services.mozilla.com/D2552

MozReview-Commit-ID: Ii3D1FaZ31R

--HG--
extra : source : 78be4bbf4b050f6614bb9f4115f57fb61f4890df
This commit is contained in:
Emilio Cobos Álvarez 2018-07-31 11:32:53 +02:00
parent f0d8729e09
commit 196560b95f
3 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,14 @@
<!doctype html>
<style>
div {
color: red;
transition: margin 1s ease, all 2s;
}
</style>
<div>Should turn Green</div>
<script>
onload = function() {
document.querySelector('div').style.color = "green";
document.body.offsetTop;
}
</script>

View File

@ -291,3 +291,4 @@ load 1457985.html
pref(dom.webcomponents.shadowdom.enabled,true) load 1468640.html
load 1469076.html
load 1475003.html
load 1479681.html

View File

@ -544,8 +544,7 @@ nsTransitionManager::DoUpdateTransitions(
for (nsCSSPropertyID p = nsCSSPropertyID(0);
p < eCSSProperty_COUNT_no_shorthands;
p = nsCSSPropertyID(p + 1)) {
p = nsCSSProps::Physicalize(p, aNewStyle);
allTransitionProperties.AddProperty(p);
allTransitionProperties.AddProperty(nsCSSProps::Physicalize(p, aNewStyle));
}
} else if (nsCSSProps::IsShorthand(property)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(