1 description('Tests that computed style is not affected by the zoom value');
3 function testProperty(data)
9 for (var i = 1; i < data.length; i++) {
10 testPropertyValue(prop, data[i]);
14 function testPropertyValue(prop, value)
16 var el = document.createElement('div');
17 el.style.cssText = 'position: absolute; width: 100px; height: 100px;' +
18 'overflow: hidden; border: 20px solid red;' +
19 'outline: 20px solid blue;-webkit-column-rule: 20px solid red';
20 el.style.setProperty(prop, value, '');
22 document.body.style.zoom = '';
23 document.body.appendChild(el);
25 var value1 = getComputedStyle(el, null).getPropertyValue(prop);
26 document.body.style.zoom = 2;
27 var value2 = getComputedStyle(el, null).getPropertyValue(prop);
28 document.body.style.zoom = .5;
29 var value3 = getComputedStyle(el, null).getPropertyValue(prop);
31 document.body.removeChild(el);
32 document.body.style.zoom = '';
34 if (typeof value1 === 'string' && value1 === value2 && value2 == value3)
35 testPassed(prop + ', value: "' + value1 + '"');
37 testFailed(prop + ', value1: "' + value1 + '", value2: "' + value2 + '", value3: "' + value3 + '"');
41 ['-webkit-border-horizontal-spacing'],
42 ['-webkit-border-vertical-spacing'],
43 ['-webkit-box-reflect', 'below 20px -webkit-gradient(linear, left top, left bottom, from(transparent), to(white))'],
44 ['-webkit-box-shadow', '20px 20px 20px 20px red'],
45 ['-webkit-column-rule-width', '20px'],
46 ['-webkit-mask-box-image-outset'],
47 ['-webkit-mask-box-image-width'],
48 ['-webkit-mask-position-x', '20px', '-20px'],
49 ['-webkit-mask-position-y', '20px', '-20px'],
50 ['-webkit-perspective-origin', '20px 20px'],
51 ['-webkit-text-stroke-width'],
52 ['-webkit-transform', 'translate(20px, 20px)', 'translate3d(20px, 20px, 20px)'],
53 ['-webkit-transform-origin', '20px 20px', '-20px -20px'],
54 ['background-position-x', '20px', '-20px'],
55 ['background-position-y', '20px', '-20px'],
56 ['border-bottom-left-radius'],
57 ['border-bottom-right-radius'],
58 ['border-bottom-width'],
59 ['border-image-outset'],
60 ['border-image-width'],
61 ['border-left-width'],
62 ['border-right-width'],
64 ['border-top-left-radius'],
65 ['border-top-right-radius'],
67 ['bottom', '20px', '-20px'],
68 ['clip', 'rect(20px 80px 80px 20px)'],
69 ['flex-basis', '20px'],
70 ['font-size', '20px', 'large'],
72 ['left', '20px', '-20px'],
73 ['letter-spacing', '20px', '-20px'],
75 ['margin-bottom', '20px', '-20px'],
76 ['margin-left', '20px', '-20px'],
77 ['margin-right', '20px', '-20px'],
78 ['margin-top', '20px', '-20px'],
84 ['right', '20px', '-20px'],
85 ['text-shadow', '20px 20px 20px red'],
86 ['top', '20px', '-20px'],
87 ['vertical-align', '20px', '-20px'],
89 ['word-spacing', '20px', '-20px'],
92 testData.forEach(testProperty);