Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: third_party/WebKit/LayoutTests/web-animations-api/reject-hyphen.html

Issue 1771733002: Web Animations: Use of hyphens is no longer supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: warn if hyphenated property is present Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/web-animations-api/reject-hyphen.html
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/reject-hyphen.html b/third_party/WebKit/LayoutTests/web-animations-api/reject-hyphen.html
new file mode 100644
index 0000000000000000000000000000000000000000..6872cec433ed381bde836ff3edba9aeba6d8103b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/web-animations-api/reject-hyphen.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+
+div { font-size: 10px; }
+
+</style>
+<div id='element'></div>
+<script>
+
+var element = document.getElementById('element');
+
+function animate(property, value) {
+ var keyframes = [
+ {offset: 0},
+ {offset: 1},
+ ];
+ keyframes[0][property] = value;
+ keyframes[1][property] = value;
+
+ try { element.animate(keyframes, {fill: 'forwards'}); } catch(e) {}
+}
alancutter (OOO until 2018) 2016/03/10 01:26:50 Why is there a try catch? This helper function is
Eric Willigers 2016/03/10 01:56:04 Fixed.
+
+test(function() {
+ animate('font-size', '20px');
+ assert_equals(getComputedStyle(element).fontSize, '10px');
+
+ animate('fontSize', '30px');
+ assert_equals(getComputedStyle(element).fontSize, '30px');
+}, 'Hyphenated propery names are rejected.');
alancutter (OOO until 2018) 2016/03/10 01:26:50 s/rejected/ignored/
Eric Willigers 2016/03/10 01:56:04 Done.
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698