Skip to content

Commit

Permalink
Add steps to SafeStyle list of allowed functions
Browse files Browse the repository at this point in the history
https://w3c.github.io/csswg-drafts/css-easing/#funcdef-step-easing-function-steps

RELNOTES: Add steps to SafeStyle list of allowed functions
PiperOrigin-RevId: 482386586
Change-Id: I3dc1ca86cf5f0493c41f96495b212f3dfe72f94a
  • Loading branch information
Closure Team authored and Copybara-Service committed Oct 20, 2022
1 parent a6c1483 commit 9d668cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions closure/goog/html/safestyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ const ALLOWED_FUNCTIONS = [
'rgb',
'rgba',
'(rotate|scale|translate)(X|Y|Z|3d)?',
'steps',
'var',
];

Expand Down
6 changes: 6 additions & 0 deletions closure/goog/html/safestyle_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ testSuite({
{'grid-template-columns': 'repeat(3, [start] 100px [end])'});
},

testCreate_allowsSteps() {
assertCreateEquals(
'animation-timing-function:steps(2, start);',
{'animation-timing-function': 'steps(2, start)'});
},

testCreate_allowsCubicBezier() {
assertCreateEquals(
'transition-timing-function:cubic-bezier(0.26, 0.86, 0.44, 0.95);',
Expand Down

0 comments on commit 9d668cd

Please sign in to comment.