file_transitions_with_disabled_properties.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!doctype html>
  2. <head>
  3. <meta charset=utf-8>
  4. <style>
  5. #display {
  6. transition: all 0.01s;
  7. }
  8. </style>
  9. <script>
  10. var ok = opener.ok.bind(opener);
  11. function finish() {
  12. var o = opener;
  13. self.close();
  14. o.SimpleTest.finish();
  15. }
  16. </script>
  17. </head>
  18. <body>
  19. <div id="display"></div>
  20. <script>
  21. 'use strict';
  22. /*
  23. * This tests for transitions generated on the -webkit-text-fill-color property.
  24. * This property has an initial value of 'currentcolor' so by triggering a
  25. * transition on the 'color' property we also--at least at the point when
  26. * this test was written--trigger a transition on the -webkit-text-fill-color
  27. * property (that behavior may change in bug 1260543).
  28. *
  29. * However, before beginning the test we disable -webkit-text-fill-color by
  30. * setting layout.css.prefixes.webkit to false. This code tests that we don't
  31. * end up triggering a transition on the (disabled) property in that case.
  32. */
  33. var display = document.getElementById('display');
  34. display.style.color = 'green';
  35. var transitionedProperties =
  36. display.getAnimations().map(transition => transition.transitionProperty);
  37. ok(!transitionedProperties.includes('-webkit-text-fill-color'),
  38. 'We should not fire transitions for properties disabled by prefs');
  39. finish();
  40. </script>
  41. </body>