Skip to content

Commit 1a92bca

Browse files
crisbetojelbourn
authored andcommitted
fix(progress-bar): animation tearing in Firefox 57 (angular#9123)
Works around an issue in Firefox 57 and above where the animated elements in the progress bar start leaving trails as they animate. Fixes angular#7606.
1 parent d8ee297 commit 1a92bca

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/lib/progress-bar/progress-bar.scss

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import '../core/style/variables';
2+
@import '../core/style/vendor-prefixes';
23

34
$mat-progress-bar-height: 5px !default;
45
$mat-progress-bar-full-animation-duration: 2000ms !default;
@@ -11,8 +12,6 @@ $mat-progress-bar-piece-animation-duration: 250ms !default;
1112
height: $mat-progress-bar-height;
1213
overflow: hidden;
1314
position: relative;
14-
// translateZ is added to force the mat-progress-bar into its own GPU layer.
15-
transform: translateZ(0);
1615
transition: opacity $mat-progress-bar-piece-animation-duration linear;
1716
width: 100%;
1817

@@ -80,28 +79,38 @@ $mat-progress-bar-piece-animation-duration: 250ms !default;
8079
transition: none;
8180
}
8281
.mat-progress-bar-primary {
82+
// Avoids stacked animation tearing in Firefox >= 57.
83+
@include backface-visibility(hidden);
8384
animation: mat-progress-bar-primary-indeterminate-translate
8485
$mat-progress-bar-full-animation-duration infinite linear;
8586
left: -145.166611%;
8687
}
8788
.mat-progress-bar-primary.mat-progress-bar-fill::after {
89+
// Avoids stacked animation tearing in Firefox >= 57.
90+
@include backface-visibility(hidden);
8891
animation: mat-progress-bar-primary-indeterminate-scale
8992
$mat-progress-bar-full-animation-duration infinite linear;
9093
}
9194
.mat-progress-bar-secondary {
95+
// Avoids stacked animation tearing in Firefox >= 57.
96+
@include backface-visibility(hidden);
9297
animation: mat-progress-bar-secondary-indeterminate-translate
9398
$mat-progress-bar-full-animation-duration infinite linear;
9499
left: -54.888891%;
95100
display: block;
96101
}
97102
.mat-progress-bar-secondary.mat-progress-bar-fill::after {
103+
// Avoids stacked animation tearing in Firefox >= 57.
104+
@include backface-visibility(hidden);
98105
animation: mat-progress-bar-secondary-indeterminate-scale
99106
$mat-progress-bar-full-animation-duration infinite linear;
100107
}
101108
}
102109

103110
&[mode='buffer'] {
104111
.mat-progress-bar-background {
112+
// Avoids stacked animation tearing in Firefox >= 57.
113+
@include backface-visibility(hidden);
105114
animation: mat-progress-bar-background-scroll
106115
$mat-progress-bar-piece-animation-duration infinite linear;
107116
display: block;

0 commit comments

Comments
 (0)