Repository navigation
Conversation
`count: double.infinity` was rendered as `infinity`, which is not a valid `animation-iteration-count`, so the browser dropped the whole `animation` declaration. Fixes schultek#919
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #919
I started from #919 and checked it against the code on
next._Animation.valuerenders the iteration count withcount!.numstr, andnumstrreturnstoString().toLowerCase()for infinite values, socount: double.infinitybecomesinfinity.animation-iteration-countonly accepts the keywordinfinite, so the browser cannot parse the shorthand and drops the wholeanimationdeclaration, as the issue describes.The change renders an infinite count as
infinitein_Animation.valueand leavesnumstralone, since its other callers (units, angles, transforms) still needinfinity, which is the valid keyword insidecalc(). The existingbasictest was asserting the brokeninfinityoutput, so it now expectsinfinite, and a newfinite counttest keeps the plain number path covered.This follows the approach that was approved on #923, rebased onto
nextas requested there.How I found it
I read
_Animation.valueinanimation.dartand followednumstrtounit.dart. TheisInfinitebranch there is what turnsdouble.infinityintoinfinity.Animation.countis adouble?, sodouble.infinityis the only way to ask for an endless loop with the typed API.Where this can show up in practice
Any site that uses
Animation(..., count: double.infinity)for a looping animation, such as a spinner or a pulsing placeholder, gets no animation at all and no error at build time or in the console. This is my estimate beyond the report in #919.Type of Change
Testing
dart test -p vm test/dom/inpackages/jasprpasses (138 tests). With the source change reverted,animation_test.dartfails on the newinfiniteexpectation.dart analyze --fatal-infosreports no issues for the two changed Dart files, anddart format --line-length 120leaves them unchanged.dart pub getthere, because that image has no Flutter SDK.melos run coverage, and a check in a real browser.Ready Checklist
the semantic_changelog format.
///).