OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 'use strict'; |
| 6 |
| 7 test(() => { |
| 8 let ZeroAngleCustomProperty = 1977; // From UseCounter.h |
| 9 |
| 10 let isCounted = () => internals.isUseCounted(document, ZeroAngleCustomProper
ty); |
| 11 var div = document.createElement('div'); |
| 12 |
| 13 // These values are invalid. |
| 14 div.style = 'image-orientation: 0;'; |
| 15 div.style = 'rotate: 0;'; |
| 16 div.style = 'offset-path: ray(0 closest-side);'; |
| 17 // These properties have their own counters. |
| 18 div.style = 'filter: hue-rotate(0);'; |
| 19 div.style = 'background-image: linear-gradient(0, red, black);'; |
| 20 div.style = 'offset-rotate: 0;'; |
| 21 div.style = 'transform: skewX(0);'; |
| 22 assert_false(isCounted(), |
| 23 'non custom property should not be counted'); |
| 24 |
| 25 CSS.registerProperty({ |
| 26 name: '--degrees', |
| 27 syntax: '<angle>', |
| 28 initialValue: '0deg', |
| 29 }); |
| 30 assert_false(isCounted(), |
| 31 '0deg should not be counted'); |
| 32 |
| 33 CSS.registerProperty({ |
| 34 name: '--unitless', |
| 35 syntax: '<angle>', |
| 36 initialValue: '0', |
| 37 }); |
| 38 assert_true(isCounted(), |
| 39 '0 should be counted'); |
| 40 }, 'angle 0 is use counted for custom property registration'); |
| 41 </script> |
OLD | NEW |