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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-custom.html

Issue 2898133002: CSS: Use count unitless 0 supplied as <angle> (Closed)
Patch Set: test Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(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 UnitlessZeroAngleCustomProperty = 2006; // From UseCounter.h
9
10 let isCounted = () => internals.isUseCounted(document, UnitlessZeroAngleCust omProperty);
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698