1 setup({explicit_done:true});
8 {input:"-1", q:"-1px"},
9 {input:"1.5", q:"1.5px"},
10 {input:"+1.5", q:"1.5px"},
11 {input:"-1.5", q:"-1.5px"},
52 {input:"calc(2 * 2px)", q:"4px", s:"4px"},
53 {input:"1px 2", q:"1px 2px", shorthand:true},
54 {input:"1 2px", q:"1px 2px", shorthand:true},
55 {input:"1px calc(2)", shorthand:true},
56 {input:"calc(1) 2px", shorthand:true},
57 {input:"1 +2", q:"1px 2px", shorthand:true},
58 {input:"1 -2", q:"1px -2px", shorthand:true},
62 {prop:'background-position', check:'background-position', check_also:[]},
63 {prop:'border-spacing', check:'border-spacing', check_also:[]},
64 {prop:'border-top-width', check:'border-top-width'},
65 {prop:'border-right-width', check:'border-right-width'},
66 {prop:'border-bottom-width', check:'border-bottom-width'},
67 {prop:'border-left-width', check:'border-left-width'},
68 {prop:'border-width', check:'border-top-width', check_also:['border-right-width', 'border-bottom-width', 'border-left-width']},
69 {prop:'bottom', check:'bottom'},
70 {prop:'clip', check:'clip'},
71 {prop:'font-size', check:'font-size'},
72 {prop:'height', check:'height'},
73 {prop:'left', check:'left'},
74 {prop:'letter-spacing', check:'letter-spacing'},
75 {prop:'margin-right', check:'margin-right'},
76 {prop:'margin-left', check:'margin-left'},
77 {prop:'margin-top', check:'margin-top'},
78 {prop:'margin-bottom', check:'margin-bottom'},
79 {prop:'margin', check:'margin-top', check_also:['margin-right', 'margin-bottom', 'margin-left']},
80 {prop:'max-height', check:'max-height'},
81 {prop:'max-width', check:'max-width'},
82 {prop:'min-height', check:'min-height'},
83 {prop:'min-width', check:'min-width'},
84 {prop:'padding-top', check:'padding-top'},
85 {prop:'padding-right', check:'padding-right'},
86 {prop:'padding-bottom', check:'padding-bottom'},
87 {prop:'padding-left', check:'padding-left'},
88 {prop:'padding', check:'padding-top', check_also:['padding-right', 'padding-bottom', 'padding-left']},
89 {prop:'right', check:'right'},
90 {prop:'text-indent', check:'text-indent'},
91 {prop:'top', check:'top'},
92 {prop:'vertical-align', check:'vertical-align'},
93 {prop:'width', check:'width'},
94 {prop:'word-spacing', check:'word-spacing'},
96 var style_template = '#test{border-style:solid;position:relative;{prop}:{test};}' +
97 '#ref{border-style:solid;position:relative;{prop}:{ref};}';
99 tests.forEach(function(t) {
100 for (var i in props) {
101 if (t.shorthand && !(props[i].check_also)) {
105 win.style.textContent = style_template.replace('{test}', t.input)
106 .replace('{ref}', quirks ? t.q : t.s).replace(/\{prop\}/g, props[i].prop)
107 .replace(/clip:[^;]+/g, function(match) {
108 return 'clip:rect(auto, auto, auto, ' + match.substr(5) + ')';
110 assert_equals(win.getComputedStyle(win.test).getPropertyValue(props[i].check),
111 win.getComputedStyle(win.ref).getPropertyValue(props[i].check),
113 if (t.shorthand && props[i].check_also) {
114 for (var j in props[i].check_also) {
115 assert_equals(win.getComputedStyle(win.test).getPropertyValue(props[i].check_also[j]),
116 win.getComputedStyle(win.ref).getPropertyValue(props[i].check_also[j]),
117 props[i].prop + ', checking ' + props[i].check_also[j]);
120 }, props[i].prop + ": " + t.input);
127 {input:'background:1 1', prop:'background-position'},
128 {input:'border-top:red solid 1', prop:'border-top-width'},
129 {input:'border-right:red solid 1', prop:'border-right-width'},
130 {input:'border-bottom:red solid 1', prop:'border-bottom-width'},
131 {input:'border-left:red solid 1', prop:'border-left-width'},
132 {input:'border:red solid 1', prop:'border-top-width'},
133 {input:'font:normal normal normal 40 sans-serif', prop:'font-size'},
134 {input:'outline:red solid 1', prop:'outline-width'},
135 {input:'outline-width:1', prop:'outline-width'},
138 var other_template = "#test{position:relative;outline-style:solid;{test}}" +
139 "#ref{outline-style:solid}";
141 other_tests.forEach(function(t) {
143 win.style.textContent = other_template.replace('{test}', t.input);
144 assert_equals(win.getComputedStyle(win.test).getPropertyValue(t.prop),
145 win.getComputedStyle(win.ref).getPropertyValue(t.prop),
146 'quirk was supported');
147 }, 'Excluded property '+t.input);