5 -webkit-font-feature-settings: normal;
9 -webkit-font-feature-settings:
"dlig" 1;
13 -webkit-font-feature-settings:
"swsh" 2;
17 -webkit-font-feature-settings:
"smcp" on;
21 -webkit-font-feature-settings:
"liga" off;
25 -webkit-font-feature-settings:
"c2sc";
29 -webkit-font-feature-settings:
"tnum", 'hist';
33 -webkit-font-feature-settings: 'PKRN';
37 -webkit-font-feature-settings:
"!@#$";
41 -webkit-font-feature-settings:
"a bc";
45 -webkit-font-feature-settings:
"dlig" 1, 'smcp' on, 'lig ' off;
49 -webkit-font-feature-settings: dlig;
53 -webkit-font-feature-settings: dlig, DLIG, DLig;
57 -webkit-font-feature-settings:
1;
61 -webkit-font-feature-settings: off;
64 #invalid_normal_duplicate {
65 -webkit-font-feature-settings: normal, normal;
68 #invalid_normal_list {
69 -webkit-font-feature-settings: normal, aaaa;
72 #invalid_longer_ident {
73 -webkit-font-feature-settings: aaaaa;
76 #invalid_longer_quote {
77 -webkit-font-feature-settings:
"aaaaa";
81 -webkit-font-feature-settings: aaaa -
1;
85 -webkit-font-feature-settings: aaaa
1.5;
88 #invalid_missing_comma {
89 -webkit-font-feature-settings: aaaa
"bbbb";
92 #invalid_missing_comma_ident {
93 -webkit-font-feature-settings: aaaa bbbb;
97 -webkit-font-feature-settings: ,;
100 #invalid_ending_comma {
101 -webkit-font-feature-settings: aaaa,;
104 #invalid_beginning_comma {
105 -webkit-font-feature-settings: ,aaaa;
109 -webkit-font-feature-settings: aaaa, on;
113 -webkit-font-feature-settings:
"aaaa" 1,
"bbbb",
0;
117 -webkit-font-feature-settings: aaaaa on, dlig on, PKRN -
1;
122 -webkit-font-feature-settings: 'liga';
126 -webkit-font-feature-settings: aaaaa;
129 <script src=
"../resources/js-test.js"></script>
132 <div id=
"valid_normal"></div>
133 <div id=
"valid_value_1"></div>
134 <div id=
"valid_value_2"></div>
135 <div id=
"valid_value_on"></div>
136 <div id=
"valid_value_off"></div>
137 <div id=
"valid_value_omit"></div>
138 <div id=
"valid_valuelist"></div>
139 <div id=
"valid_singlequote"></div>
140 <div id=
"valid_unusual_tag"></div>
141 <div id=
"valid_tag_space"></div>
142 <div id=
"valid_composite"></div>
144 <div id=
"invalid_ident"></div>
145 <div id=
"invalid_cases"></div>
146 <div id=
"invalid_1"></div>
147 <div id=
"invalid_off"></div>
148 <div id=
"invalid_normal_duplicate"></div>
149 <div id=
"invalid_normal_list"></div>
150 <div id=
"invalid_longer_ident"></div>
151 <div id=
"invalid_longer_quote"></div>
152 <div id=
"invalid_negative"></div>
153 <div id=
"invalid_float"></div>
154 <div id=
"invalid_missing_comma"></div>
155 <div id=
"invalid_missing_comma_ident"></div>
156 <div id=
"invalid_comma"></div>
157 <div id=
"invalid_ending_comma"></div>
158 <div id=
"invalid_beginning_comma"></div>
159 <div id=
"invalid_on"></div>
160 <div id=
"invalid_0"></div>
162 <div id=
"outer" style=
"-webkit-font-feature-settings: 'dlig';">
163 <div id=
"inner"></div>
166 <p id=
"description"></p>
167 <div id=
"console"></div>
169 description('Test parsing of the CSS3 font-feature-settings property.');
171 function parseResultOf(id
) {
172 var element
= document
.getElementById(id
);
173 return window
.getComputedStyle(element
)['-webkit-font-feature-settings'];
176 debug('- Tests valid inputs.');
177 shouldBeEqualToString('parseResultOf("valid_normal")', "normal");
178 shouldBeEqualToString('parseResultOf("valid_value_1")', "'dlig' 1");
179 shouldBeEqualToString('parseResultOf("valid_value_2")', "'swsh' 2");
180 shouldBeEqualToString('parseResultOf("valid_value_on")', "'smcp' 1");
181 shouldBeEqualToString('parseResultOf("valid_value_off")', "'liga' 0");
182 shouldBeEqualToString('parseResultOf("valid_value_omit")', "'c2sc' 1");
183 shouldBeEqualToString('parseResultOf("valid_valuelist")', "'tnum' 1, 'hist' 1");
184 shouldBeEqualToString('parseResultOf("valid_singlequote")', "'PKRN' 1");
185 shouldBeEqualToString('parseResultOf("valid_unusual_tag")', "'!@#$' 1");
186 shouldBeEqualToString('parseResultOf("valid_tag_space")', "'a bc' 1");
187 shouldBeEqualToString('parseResultOf("valid_composite")', "'dlig' 1, 'smcp' 1, 'lig ' 0");
189 debug('- Tests invalid inputs. Results should be "normal".');
190 shouldBe('parseResultOf("invalid_ident")', '"normal"');
191 shouldBe('parseResultOf("invalid_cases")', '"normal"');
192 shouldBe('parseResultOf("invalid_1")', '"normal"');
193 shouldBe('parseResultOf("invalid_off")', '"normal"');
194 shouldBe('parseResultOf("invalid_normal_duplicate")', '"normal"');
195 shouldBe('parseResultOf("invalid_normal_list")', '"normal"');
196 shouldBe('parseResultOf("invalid_longer_ident")', '"normal"');
197 shouldBe('parseResultOf("invalid_longer_quote")', '"normal"');
198 shouldBe('parseResultOf("invalid_negative")', '"normal"');
199 shouldBe('parseResultOf("invalid_float")', '"normal"');
200 shouldBe('parseResultOf("invalid_missing_comma")', '"normal"');
201 shouldBe('parseResultOf("invalid_missing_comma_ident")', '"normal"');
202 shouldBe('parseResultOf("invalid_comma")', '"normal"');
203 shouldBe('parseResultOf("invalid_ending_comma")', '"normal"');
204 shouldBe('parseResultOf("invalid_beginning_comma")', '"normal"');
205 shouldBe('parseResultOf("invalid_on")', '"normal"');
206 shouldBe('parseResultOf("invalid_0")', '"normal"');
208 debug('- Tests inherit.');
209 shouldBeEqualToString('parseResultOf("outer")', "'dlig' 1");
210 shouldBeEqualToString('parseResultOf("inner")', "'dlig' 1");
212 debug('- Tests @font-face.');
213 var fontFaceRuleValid
= document
.styleSheets
[1].cssRules
[0].style
['-webkit-font-feature-settings'];
214 var fontFaceRuleInvalid
= document
.styleSheets
[1].cssRules
[1].style
['-webkit-font-feature-settings'];
215 shouldBeEqualToString('fontFaceRuleValid', "'liga' 1");
216 shouldBeEqualToString('fontFaceRuleInvalid', "");