Commit 6189619b authored by dstockwell's avatar dstockwell Committed by Commit Bot

pdf: Work around a web-animations bug in viewer-pen-options

Bug: 902646,938857
Change-Id: I8a6165fc0de258b634733b77ac166c184882318a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505733Reviewed-by: default avatardsinclair <dsinclair@chromium.org>
Commit-Queue: dstockwell <dstockwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638323}
parent e001b097
...@@ -148,14 +148,16 @@ Polymer({ ...@@ -148,14 +148,16 @@ Polymer({
}), }),
]; ];
} }
if (this.expanded_) {
for (const animation of this.expandAnimations_) { for (const animation of this.expandAnimations_) {
animation.playbackRate = 1; // TODO(dstockwell): Ideally we would just set playbackRate,
} // but there appears to be a web-animations bug that
} else { // results in the animation getting stuck in the 'pending'
for (const animation of this.expandAnimations_) { // state sometimes. See crbug.com/938857
animation.playbackRate = -1; const currentTime = animation.currentTime;
} animation.cancel();
animation.playbackRate = this.expanded_ ? 1 : -1;
animation.currentTime = currentTime;
animation.play();
} }
for (const input of colors.querySelectorAll('input:nth-child(n+8)')) { for (const input of colors.querySelectorAll('input:nth-child(n+8)')) {
if (this.expanded_) { if (this.expanded_) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment