|
1 <html> |
|
2 <head> |
|
3 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
|
4 <title>Testing Microformats.js (hCard)</title> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"></link> |
|
8 </head> |
|
9 <body> |
|
10 <div id="content" style="display: none"> |
|
11 |
|
12 From http://microformats.org/tests/hcard/ |
|
13 |
|
14 <div class="vcard" id="01-tantek-basic"> |
|
15 <a class="url fn" href="http://tantek.com/">Tantek Çelik</a> |
|
16 <div class="org">Technorati</div> |
|
17 </div> |
|
18 |
|
19 <div class="vcard" id="02-multiple-class-names-on-vcard.1"><span class="fn n"><span class="given-name">Ryan</span> <span class="family-name">King</span></span></div> |
|
20 <p><span class="attendee vcard" id="02-multiple-class-names-on-vcard.2"><span class="fn n"><span class="given-name">Ryan</span> <span class="family-name">King</span></span></span></p> |
|
21 <address class="vcard author" id="02-multiple-class-names-on-vcard.3"><span class="fn n"><span class="given-name">Ryan</span> <span class="family-name">King</span></span></address> |
|
22 <ul><li class="reviewer vcard first" id="02-multiple-class-names-on-vcard.4"><span class="fn n"><span class="given-name">Ryan</span> <span class="family-name">King</span></span></li></ul> |
|
23 |
|
24 <p class="vcard" id="03-implied-n.1"> |
|
25 <span class="fn">Ryan King</span> |
|
26 </p> |
|
27 <p class="vcard" id="03-implied-n.2"> |
|
28 <abbr class="fn" title="Ryan King">me</abbr> |
|
29 </p> |
|
30 <p class="vcard" id="03-implied-n.3"> |
|
31 <img src="/me.jpg" title="Brian Suda" alt="Ryan King" class="fn" /> |
|
32 </p> |
|
33 <p class="vcard" id="03-implied-n.4"> |
|
34 <a class="fn" href="http://suda.co.uk/">Brian Suda</a> |
|
35 </p> |
|
36 <p class="vcard" id="03-implied-n.5"> |
|
37 <span class="fn">King, Ryan</span> |
|
38 </p> |
|
39 <p class="vcard" id="03-implied-n.6"> |
|
40 <span class="fn">King, R</span> |
|
41 </p> |
|
42 <p class="vcard" id="03-implied-n.7"> |
|
43 <span class="fn">King R</span> |
|
44 </p> |
|
45 <p class="vcard" id="03-implied-n.8"> |
|
46 <span class="fn">King R.</span> |
|
47 </p> |
|
48 <p class="vcard" id="03-implied-n.9"> |
|
49 <span class="fn">Jesse James Garrett</span> |
|
50 </p> |
|
51 <p class="vcard" id="03-implied-n.10"> |
|
52 <span class="fn">Thomas Vander Wal</span> |
|
53 </p> |
|
54 |
|
55 <p class="vcard" id="04-ignore-unknowns"> |
|
56 <span class="ignore-me">Some text that shouldn't be in the vCard.</span> |
|
57 <span class="fn n"> |
|
58 <span class="given-name">Ryan</span> <span class="family-name">King</span> |
|
59 </span> |
|
60 </p> |
|
61 <p class="ignore-me-too">Some more text that shouldn't be in the vCard.</p> |
|
62 |
|
63 <p class="vcard" id="05-mailto-1"> |
|
64 <!-- fn should be the text node (with implied-n-optimization) and 'email' should be the href, sans scheme --> |
|
65 <a class="fn email" href="mailto:ryan@technorati.com">Ryan King</a> |
|
66 </p> |
|
67 |
|
68 <p class="vcard" id="06-mailto-2"> |
|
69 <!-- ignore the parameters on the addr-spec --> |
|
70 <a class="fn email" href="mailto:brian@example.com?subject=foo">Brian Suda</a> |
|
71 </p> |
|
72 |
|
73 <p class="vcard" id="07-relative-url"> |
|
74 <span class="fn n"><span class="given-name">John</span> <span class="family-name">Doe</span></span> |
|
75 <a class="url" href="/home/blah">my website</a> |
|
76 </p> |
|
77 |
|
78 Tests 8/9/10 involve base tags and must each be self contained |
|
79 |
|
80 <p class="vcard" id="11-multiple-urls"> |
|
81 <span class="fn n"> |
|
82 <span class="given-name">John</span> <span class="family-name">Doe</span></span> |
|
83 <a class="url" href="http://example.com/foo">my website</a> |
|
84 <a class="url" href="http://example.com/bar">my other website</a> |
|
85 </p> |
|
86 |
|
87 <p class="vcard" id="12-img-src-url"> |
|
88 <span class="fn n"><span class="given-name">John</span> <span class="family-name">Doe</span></span> |
|
89 <!-- take the @src, ignore the @type --> |
|
90 <img class="url" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" type="image/png" /> |
|
91 </p> |
|
92 |
|
93 <p class="vcard" id="13-photo-logo"> |
|
94 <span class="fn n"><span class="given-name">John</span> <span class="family-name">Doe</span></span> |
|
95 <!-- take the @src, ignore the @type --> |
|
96 <img class="photo logo" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" type="image/png" /> |
|
97 </p> |
|
98 |
|
99 <p class="vcard" id="14-img-src-data-url"> |
|
100 <span class="fn n"><span class="given-name">John</span> <span class="family-name">Doe</span></span> |
|
101 <img class="photo logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg=="/> |
|
102 </p> |
|
103 |
|
104 <p class="vcard" id="15-honorific-additional-single"> |
|
105 <span class="fn n"> |
|
106 <span class="honorific-prefix">Mr.</span> |
|
107 <span class="given-name">John</span> |
|
108 <span class="additional-name">Maurice</span> |
|
109 <span class="family-name">Doe</span>, |
|
110 <span class="honorific-suffix">Ph.D.</span> |
|
111 </span> |
|
112 </p> |
|
113 |
|
114 <p class="vcard" id="16-honorific-additional-multiple"> |
|
115 <span class="fn n"> |
|
116 <span class="honorific-prefix">Mr.</span> |
|
117 <span class="honorific-prefix">Dr.</span> |
|
118 <span class="given-name">John</span> |
|
119 <span class="additional-name">Maurice</span> |
|
120 <span class="additional-name">Benjamin</span> |
|
121 <span class="family-name">Doe</span> |
|
122 <span class="honorific-suffix">Ph.D.</span>, |
|
123 <span class="honorific-suffix">J.D.</span> |
|
124 </span> |
|
125 </p> |
|
126 |
|
127 <p class="vcard" id="17-email-not-uri"> |
|
128 <span class="fn">John Doe</span> |
|
129 <span class="email">john@example.com</span> |
|
130 </p> |
|
131 |
|
132 <p class="vcard" id="18-object-data-http-uri"> |
|
133 <span class="fn">John Doe</span> |
|
134 <object class="url photo logo" data="http://mochi.test:8888/tests/browser/microformats/test/picture.png" type="image/png"></object> |
|
135 </p> |
|
136 |
|
137 <p class="vcard" id="19-object-data-data-uri"> |
|
138 <span class="fn">John Doe</span> |
|
139 <object class="photo logo" data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==" /> |
|
140 </p> |
|
141 |
|
142 <p class="vcard" id="20-image-alt"> |
|
143 <!-- only testing 'fn' here, but you should be able to parse any text value out of the img@alt --> |
|
144 <!-- also note, the fn should only be used to infer n, when there's no explicit n in the hcard --> |
|
145 <img class="fn photo logo" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="John Doe" /> |
|
146 </p> |
|
147 |
|
148 <div class="vcard" id="21-tel"> |
|
149 <p class="fn">John Doe</p>v |
|
150 <p class="tel">+1.415.555.1231</p> |
|
151 <p class="tel"> |
|
152 <span class="type">home</span> |
|
153 <span class="value">+1 415 555 1232</span> |
|
154 </p> |
|
155 <div class="tel"> |
|
156 types: |
|
157 <ul> |
|
158 <li class="type">msg</li> |
|
159 <li class="type">home</li> |
|
160 <li class="type">work</li> |
|
161 <li class="type">pref</li> |
|
162 <li class="type">voice</li> |
|
163 <li class="type">fax</li> |
|
164 <li class="type">cell</li> |
|
165 <li class="type">video</li> |
|
166 <li class="type">pager</li> |
|
167 <li class="type">bbs</li> |
|
168 <li class="type">car</li> |
|
169 <li class="type">isdn</li> |
|
170 <li class="type">pcs</li> |
|
171 <li class="type">invalid</li> |
|
172 </ul> |
|
173 <span class="value">+1</span> |
|
174 <span class="value">415</span> |
|
175 <span class="value">555</span> |
|
176 <span class="value">1233</span> |
|
177 </div> |
|
178 <p class="tel"> |
|
179 <abbr class="type" title="home">H</abbr> |
|
180 <span class="value">+1 415 555 1234</span> |
|
181 </p> |
|
182 <a class="tel" href="tel:+1.415.555.1235">call me</a> |
|
183 <object class="tel" data="tel:+1.415.555.1236">call me</object> |
|
184 <a class="tel" href="fax:+1.415.555.1238">call me</a> |
|
185 <object class="tel" data="fax:+1.415.555.1239">call me</object> |
|
186 <a class="tel" href="modem:+1.415.555.1241">call me</a> |
|
187 <object class="tel" data="modem:+1.415.555.1242">call me</object> |
|
188 </div> |
|
189 |
|
190 <div class="vcard" id="21-tel.2"> |
|
191 <span class="fn">John Doe</span> |
|
192 <span class="tel"><span class="type">Home</span> +1.415.555.1212</span> |
|
193 </div> |
|
194 |
|
195 <div class="vcard" id="21-tel.3"> |
|
196 <span class="fn">John Doe</span> |
|
197 <span class="tel"><span class="type">Home</span><span class="type"> Pref</span> +1.415.555.1212</span> |
|
198 </div> |
|
199 |
|
200 <!-- TODO: add test for 'extended' --> |
|
201 <div class="vcard" id="22-adr"> |
|
202 <p class="fn">John Doe</p> |
|
203 <p class="adr"> |
|
204 <span class="street-address">1231 Main St.</span> |
|
205 <span class="locality">Beverly Hills</span> |
|
206 <span class="region">California</span> |
|
207 <span class="country-name">United States of America</span> |
|
208 <span class="postal-code">90210</span> |
|
209 </p> |
|
210 <!-- multiple street-addresses, should produce a comma-separated list --> |
|
211 <p class="adr"> |
|
212 <span class="post-office-box">PO Box 1234</span> |
|
213 <span class="street-address">1232 Main St.</span> |
|
214 <span class="street-address">Suite 100</span> |
|
215 <span class="locality">Beverly Hills</span> |
|
216 <span class="region">California</span> |
|
217 <span class="country-name">United States of America</span> |
|
218 <span class="postal-code">90210</span> |
|
219 </p> |
|
220 <!-- one type subproperty --> |
|
221 <p class="adr"> |
|
222 <span class="type">home</span> |
|
223 <span class="street-address">1233 Main St.</span> |
|
224 <span class="locality">Beverly Hills</span> |
|
225 <span class="region">California</span> |
|
226 <span class="country-name">United States of America</span> |
|
227 <span class="postal-code">90210</span> |
|
228 </p> |
|
229 <!-- many type subproperties, each with their own class name --> |
|
230 <div class="adr"> |
|
231 <ul> |
|
232 <li class="type">dom</li> |
|
233 <li class="type">intl</li> |
|
234 <li class="type">postal</li> |
|
235 <li class="type">parcel</li> |
|
236 <li class="type">home</li> |
|
237 <li class="type">work</li> |
|
238 <li class="type">pref</li> |
|
239 </ul> |
|
240 <span class="street-address">1234 Main St.</span> |
|
241 <span class="locality">Beverly Hills</span> |
|
242 <span class="region">California</span> |
|
243 <span class="country-name">United States of America</span> |
|
244 <span class="postal-code">90210</span> |
|
245 </div> |
|
246 </div> |
|
247 |
|
248 <p class="vcard" id="23-abbr-title-everything"> |
|
249 <!-- perhaps the most annoying test ever --> |
|
250 <abbr class="fn" title="John Doe">foo</abbr> |
|
251 <span class="n"> |
|
252 <abbr class="honorific-prefix" title="Mister">Mr.</abbr> |
|
253 <abbr class="given-name" title="Jonathan">John</abbr> |
|
254 <abbr class="additional-name" title="John">J</abbr> |
|
255 <abbr class="family-name" title="Doe-Smith">Doe</abbr> |
|
256 <abbr class="honorific-suffix" title="Medical Doctor">M.D</abbr> |
|
257 </span> |
|
258 <abbr class="nickname" title="JJ">jj</abbr> |
|
259 <abbr class="bday" title="2006-04-04">April 4, 2006</abbr> |
|
260 <span class="adr"> |
|
261 <abbr class="post-office-box" title="Box 1234">B. 1234</abbr> |
|
262 <abbr class="extended-address" title="Suite 100">Ste. 100</abbr> |
|
263 <abbr class="street-address" title="123 Fake Street">123 Fake St.</abbr> |
|
264 <abbr class="locality" title="San Francisco">San Fran</abbr> |
|
265 <abbr class="region" title="California">CA</abbr> |
|
266 <abbr class="postal-code" title="12345-6789">12345</abbr> |
|
267 <abbr class="country-name" title="United States of America">USA</abbr> |
|
268 <abbr class="type" title="work">workplace</abbr> |
|
269 </span> |
|
270 <abbr class="tel" title="415.555.1234">1234</abbr> |
|
271 <abbr class="tel-type-value" title="work">workplace</abbr> |
|
272 <!-- mailer --> |
|
273 <abbr class="tz" title="-0700">Pacific Time</abbr> |
|
274 <span class="geo"> |
|
275 <abbr class="latitude" title="37.77">Northern</abbr> |
|
276 <abbr class="longitude" title="-122.41">California</abbr> |
|
277 </span> |
|
278 <abbr class="title" title="President">pres.</abbr> and |
|
279 <abbr class="role" title="Chief">cat wrangler</abbr> |
|
280 <!-- <span class="agent"></span> --> |
|
281 <span class="org"> |
|
282 <abbr class="organization-name" title="Intellicorp">foo</abbr> |
|
283 <abbr class="organization-unit" title="Intelligence">bar</abbr> |
|
284 </span> |
|
285 <!-- <abbr class="category" title=""></abbr> --> |
|
286 <abbr class="note" title="this is a note">this is not a note</abbr> |
|
287 <!-- <abbr class="rev" title=""></abbr> (revision datetime) --> |
|
288 <!-- <abbr class="sort-string" title=""></abbr> --> |
|
289 <abbr class="uid" title="abcdefghijklmnopqrstuvwxyz">alpha</abbr> |
|
290 <abbr class="class" title="public">pub</abbr> |
|
291 <!-- <abbr class="key" title=""></abbr> --> |
|
292 </p> |
|
293 |
|
294 There is no 24 |
|
295 |
|
296 <p class="vcard" id="25-geo-abbr"> |
|
297 <abbr class="geo" title="30.267991;-97.739568"><span class="fn org">Paradise</span></abbr> |
|
298 </p> |
|
299 |
|
300 <!-- This test is to make sure that parsers look at ancestors, not just children.--> |
|
301 <div class="vcard" id="26-ancestors"> |
|
302 <!-- perhaps the second most annoying test ever --> |
|
303 <div> |
|
304 <span class="fn"><span>John</span> <span>Doe</span></span> |
|
305 <span class="n"> |
|
306 <span> |
|
307 <span class="honorific-prefix"><strong>Mister</strong></span> |
|
308 <span class="given-name"><i>Jonathan</i></span> |
|
309 <span class="additional-name"><b>John</b></span> |
|
310 <span class="family-name"><em>Doe-Smith</em></span> |
|
311 <span class="honorific-suffix">Medical Doctor</span> |
|
312 </span> |
|
313 </span> |
|
314 <span class="nickname"><span>JJ</span></span> |
|
315 <span class="bday">2006-04-04</span> |
|
316 <span class="adr"> |
|
317 <span> |
|
318 <span class="post-office-box"><samp>Box 1234</samp></span> |
|
319 <span class="extended-address"><dfn>Suite 100</dfn></span> |
|
320 <span class="street-address"><span>123 Fake Street</span></span> |
|
321 <span class="locality"><em>San Francisco</em></span> |
|
322 <span class="region"><strong>California</strong></span> |
|
323 <span class="postal-code"><abbr>12345-6789</abbr></span> |
|
324 <span class="country-name"><acronym>United States of America</acronym></span> |
|
325 <span class="type"><span>work</span></span> |
|
326 </span> |
|
327 </span> |
|
328 <span class="tel"><span>415</span>.<span>555</span>.<span>1234</span></span> |
|
329 <span class="tel-type-value">work</span> |
|
330 <!-- @TODO mailer? --> |
|
331 <span class="tz"><span>-0700</span></span> |
|
332 <span class="geo"> |
|
333 <span> |
|
334 <span class="latitude"><code>37.77</code></span> |
|
335 <span class="longitude"><tt>-122.41</tt></span> |
|
336 </span> |
|
337 </span> |
|
338 <span class="title"><strong>President</strong></span> and |
|
339 <span class="role"><em>Chief</em></span> |
|
340 <span class="agent vcard"> |
|
341 <span class="fn">Bob Smith</span> |
|
342 <span class="title">Executive Assistant</span> |
|
343 </span> |
|
344 <!-- <span class="agent</span> @TODO --> |
|
345 <span class="org"> |
|
346 <span class="organization-name"><strong>Intellicorp</strong></span> |
|
347 <span class="organization-unit"><em>Intelligence</em></span> |
|
348 </span> |
|
349 <!-- @TODO <span class="category"></span> --> |
|
350 <span class="note"><cite>this is a note</cite></span> |
|
351 <!-- @TODO <span class="rev"></span> (revision datetime) --> |
|
352 <!-- @TODO <span class="sort-string"></span> --> |
|
353 <span class="uid"><kbd>abcdefghijklmnopqrstuvwxyz</kbd></span> |
|
354 <span class="class"><samp>public</samp></span> |
|
355 <!-- @TODO <span class="key"></span> --> |
|
356 </div> |
|
357 </div> |
|
358 |
|
359 <p class="vcard" id="27-bday-date"> |
|
360 <span class="fn">john doe</span>, |
|
361 <abbr class="bday" title="2000-01-01">January 1st, 2000</abbr> |
|
362 </p> |
|
363 |
|
364 <p class="vcard" id="28-bday-datetime"> |
|
365 <span class="fn">john doe</span>, |
|
366 <abbr class="bday" title="2000-01-01T00:00:00">January 1st, 2000 at midnight</abbr> |
|
367 </p> |
|
368 |
|
369 <p class="vcard" id="29-bday-datetime-timezone"> |
|
370 <span class="fn">john doe</span>, |
|
371 <abbr class="bday" title="2000-01-01T00:00:00-0800">January 1st, 2000 at midnight on the north american west coast</abbr> |
|
372 </p> |
|
373 |
|
374 <div class="vcard" id="30-fn-org.1"> |
|
375 <div class="fn org">W3C</div> |
|
376 </div> |
|
377 <div class="vcard" id="30-fn-org.2"> |
|
378 <div class="fn">Dan Connolly</div> |
|
379 <div class="org">W3C</div> |
|
380 </div> |
|
381 <div class="vcard" id="30-fn-org.3"> |
|
382 <img class="fn" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="W3C" /> |
|
383 <div class="org">W3C</div> |
|
384 </div> |
|
385 <div class="vcard" id="30-fn-org.4"> |
|
386 <img class="fn org" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" |
|
387 alt="World Wide Web Consortium" /> |
|
388 </div> |
|
389 <div class="vcard" id="30-fn-org.5"> |
|
390 <object data="http://mochi.test:8888/tests/browser/microformats/test/w3c_home"> |
|
391 <abbr class="fn org" title="World Wide Web Consortium">W3C</abbr> |
|
392 </object> |
|
393 </div> |
|
394 |
|
395 <p id="email1"><a href="mailto:correct@example.com" class="email">my email</a></p> |
|
396 <p id="email2"><a href="mailto:incorrect@example.com" class="email">my email</a></p> |
|
397 <div class="vcard" id="31-include.1"> |
|
398 <a class="url fn" href="http://suda.co.uk/">Brian Suda</a> |
|
399 <object data="#email1" class="include" type="text/html"/> |
|
400 <object data="#email2" type="text/html"/> |
|
401 </div> |
|
402 <div class="vcard" id="31-include.2"> |
|
403 <a class="url fn" href="http://suda.co.uk/">Brian Suda</a> |
|
404 <a href="#email1" class="include"></a> |
|
405 <a href="#email2"/> |
|
406 </div> |
|
407 <div class="vcard" id="31-include.3"> |
|
408 <a class="url fn" href="http://suda.co.uk/">Brian Suda</a> |
|
409 <a href="#email1" class="include"/> |
|
410 <a href="#email2"/> |
|
411 </div> |
|
412 <div class="vcard" id="31-include.4"> |
|
413 <a class="url fn" href="http://suda.co.uk/">Brian Suda</a> |
|
414 <a href="#email" class="include"/> |
|
415 </div> |
|
416 |
|
417 <table> |
|
418 <tr> |
|
419 <th id="org" ><a class="url org" href="http://example.org/">example.org</a></th> |
|
420 </tr> |
|
421 <tr> |
|
422 <td class="vcard" id="32-header.1" headers="org"><span class="fn">Brian Suda</span></td> |
|
423 </tr> |
|
424 <tr> |
|
425 <td class="vcard" id="32-header.2" headers="org"><span class="fn">John Doe</span></td> |
|
426 </tr> |
|
427 </table> |
|
428 |
|
429 <div class="vcard" id="33-area.1"> |
|
430 <map id="mailto-test-1"> |
|
431 <area class="fn email" href="mailto:joe@example.com" alt="Joe Public"/> |
|
432 <area class="url" href="http://example.com/" alt="my website!" /> |
|
433 </map> |
|
434 </div> |
|
435 <div class="vcard" id="33-area.2"> |
|
436 <map id="mailto-test-2"> |
|
437 <area class="fn email" href="mailto:joe@example.com" alt="Joe Public"/> |
|
438 <area class="url" href="http://example.com/" alt="my website!" /> |
|
439 <area class="org" href="http://example.com/" alt="Joe Public" /> |
|
440 </map> |
|
441 </div> |
|
442 <div class="vcard" id="33-area.3"> |
|
443 <map id="mailto-test-3"> |
|
444 <area class="fn email" href="mailto:joe@example.com" alt="Joe Public"/> |
|
445 <area class="url" href="http://example.com/" alt="my website!" /> |
|
446 </map> |
|
447 <img class="org" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="Joe Public" /> |
|
448 </div> |
|
449 <div class="vcard" id="33-area.4"> |
|
450 <map id="mailto-test-4"> |
|
451 <area class="fn email" href="mailto:joe@example.com" alt="Joe Public"/> |
|
452 <area class="url" href="http://example.com/" alt="my website!" /> |
|
453 </map> |
|
454 <div class="org">Joe Public</div> |
|
455 </div> |
|
456 <div class="vcard" id="33-area.5"> |
|
457 <map id="mailto-test-5"> |
|
458 <area class="fn email" href="mailto:joe@example.com" alt="Joe Public"/> |
|
459 <area class="url" href="http://example.com/" alt="my website!" /> |
|
460 </map> |
|
461 <abbr class="org" title="Joe Public">Joe</abbr> |
|
462 </div> |
|
463 |
|
464 <div class="vcard" id="34-notes"> |
|
465 <a class="fn email" href="mailto:joe@example.com">Joe Public</a> |
|
466 <span class="note">Note 1</span> |
|
467 <span class="foorbar">Note 2</span> |
|
468 <span class="note foorbar">Note 3</span> |
|
469 <span class="note foorbar">Note 4 with a ; and a , to be escaped<!-- this <strong>should</strong> be ignored--></span> |
|
470 </div> |
|
471 |
|
472 <div class="vcard" id="35-include-pattern.1"> |
|
473 <span class="fn n" id="j"> |
|
474 <span class="given-name">James</span> <span class="family-name">Levine</span> |
|
475 </span> |
|
476 </div> |
|
477 <div class="vcard" id="35-include-pattern.2"> |
|
478 <object data="#j" class="include" type="text/html"></object> |
|
479 <span class="org">SimplyHired</span> |
|
480 <span class="title">Microformat Brainstormer</span> |
|
481 </div> |
|
482 <div class="vcard" id="35-include-pattern.3"> |
|
483 <span class="fn n" id="j2"> |
|
484 <span class="given-name">James</span> <span class="family-name">Levine</span> |
|
485 </span> |
|
486 <span class="org">SimplyHired</span> |
|
487 <span class="title">Microformat Brainstormer</span> |
|
488 </div> |
|
489 |
|
490 <p class="vcard" id="36-categories.1"> |
|
491 <span class="fn">john doe</span>, |
|
492 <abbr class="category" title="C1">C1a</abbr> |
|
493 <a class="category" href="http://example.com" title="C2">C2a</a> |
|
494 <a class="category" href="http://example.com/C3" rel="tag" title="C3a">C3b</a> |
|
495 <img class="category" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="C4"/> |
|
496 <a class="category" href="http://example.com/C5/" rel="tag" title="C5a">C5b</a> |
|
497 <a class="category" href="http://example.com/C6?tag=false" rel="tag" title="C6a">C6b</a> |
|
498 <a class="category" href="http://example.com/C7#anchor" rel="tag" title="C7a">C7b</a> |
|
499 <a class="category" href="http://example.com/C8?tag=trailing-slash/" rel="tag" title="C8a">C8b</a> |
|
500 <a class="category" href="http://example.com/C9/?tag=trailing-slash/" rel="tag" title="C9a">C9b</a> |
|
501 </p> |
|
502 <div class="vcard" id="36-categories.2"> |
|
503 <span class="fn n"> |
|
504 <span class="given-name">Joe</span> <span class="family-name">User</span> |
|
505 </span> |
|
506 <span class="category">User</span> |
|
507 <a class="category" rel="tag" href="http://example.com/luser">a big luser!</a> |
|
508 </div> |
|
509 |
|
510 <p class="vcard" id="37-singleton"> |
|
511 <span class="fn n"><span class="given-name">john</span> <span class="family-name"><span class="sort-string">d</span>oe</span> 1</span> |
|
512 <span class="fn n"><span class="given-name"><span class="sort-string">j</span>ohn</span> <span class="family-name">doe</span> 2</span> |
|
513 <abbr class="bday" title="20060707">today</abbr> |
|
514 <abbr class="bday" title="20060708">tomorrow</abbr> |
|
515 <abbr class="geo" title="123.45;67.89">Here</abbr> |
|
516 <abbr class="geo" title="98.765;43.21">There</abbr> |
|
517 <abbr class="rev" title="20060707">today</abbr> |
|
518 <abbr class="rev" title="20060708">tomorrow</abbr> |
|
519 <abbr class="uid" title="unique-id-1">id-1</abbr> |
|
520 <abbr class="uid" title="unique-id-2">id-2</abbr> |
|
521 <span class="tz">+0600</span> |
|
522 <span class="tz">+0800</span> |
|
523 <span class="class">public</span> |
|
524 <span class="class">private</span> |
|
525 </p> |
|
526 |
|
527 <div class="vcard" id="38-uid.1"> |
|
528 <span class="fn">Ryan King</span> |
|
529 <a class="url uid" href="http://theryanking.com/contact/">My other hCard</a> |
|
530 </div> |
|
531 <div class="vcard" id="38-uid.2"> |
|
532 <span class="fn">Ryan King</span> |
|
533 <object class="url uid" data="http://mochi.test:8888/tests/browser/microformats/test/contact/">My other hCard</object> |
|
534 </div> |
|
535 <div class="vcard" id="38-uid.3"> |
|
536 <span class="fn">Ryan King</span> |
|
537 <img class="url uid" src="http://mochi.test:8888/tests/browser/microformats/test/contact/" alt="my other hcard" /> |
|
538 </div> |
|
539 <div class="vcard" id="38-uid.4"> |
|
540 <span class="fn">Ryan King</span> |
|
541 <map id="foo"><area class="url uid" href="http://theryanking.com/contact/" alt="my other hcard" /></map> |
|
542 </div> |
|
543 |
|
544 <div class="vcard" id="39-noteHTML"> |
|
545 <a class="fn">Joe Public</a> |
|
546 <span class="note"><b>Note</b></span> |
|
547 </div> |
|
548 |
|
549 <div class="vcard" id="email-type"> |
|
550 <span class="fn">John Doe</span> |
|
551 <span class="email"> |
|
552 <span class="type">internet</span> |
|
553 <a href="mailto:notthis@example.com">john@example.com</a> |
|
554 </span> |
|
555 </div> |
|
556 |
|
557 |
|
558 </div> |
|
559 <pre id="test"> |
|
560 <script class="testbody" type="text/javascript"> |
|
561 |
|
562 test_Microformats(); |
|
563 test_hCard(); |
|
564 |
|
565 function test_Microformats() { |
|
566 var Microformats = SpecialPowers.Cu.import("resource://gre/modules/Microformats.js").Microformats; |
|
567 |
|
568 ok(Microformats, "Check global access to Microformats"); |
|
569 }; |
|
570 |
|
571 function test_hCard() { |
|
572 var hCard = SpecialPowers.Cu.import("resource://gre/modules/Microformats.js").hCard; |
|
573 |
|
574 var hcard; |
|
575 |
|
576 hcard = new hCard(document.getElementById("01-tantek-basic")); |
|
577 |
|
578 is(hcard.fn, "Tantek Çelik", "01-tantek-basic - fn"); |
|
579 is(hcard.url, "http://tantek.com/", "01-tantek-basic - url"); |
|
580 is(hcard.n["given-name"][0], "Tantek", "01-tantek-basic - given-name"); |
|
581 is(hcard.n["family-name"][0], "Çelik", "01-tantek-basic - family-name"); |
|
582 is(hcard.org[0]["organization-name"], "Technorati", "01-tantek-basic - organization-name"); |
|
583 |
|
584 hcard = new hCard(document.getElementById("02-multiple-class-names-on-vcard.1")); |
|
585 |
|
586 is(hcard.fn, "Ryan King", "02-multiple-class-names-on-vcard.1 - fn"); |
|
587 is(hcard.n["given-name"][0], "Ryan", "02-multiple-class-names-on-vcard.1 - given-name"); |
|
588 is(hcard.n["family-name"][0], "King", "02-multiple-class-names-on-vcard.1 - family-name"); |
|
589 |
|
590 hcard = new hCard(document.getElementById("02-multiple-class-names-on-vcard.2")); |
|
591 |
|
592 is(hcard.fn, "Ryan King", "02-multiple-class-names-on-vcard.2 - fn"); |
|
593 is(hcard.n["given-name"][0], "Ryan", "02-multiple-class-names-on-vcard.2 - given-name"); |
|
594 is(hcard.n["family-name"][0], "King", "02-multiple-class-names-on-vcard.2 - family-name"); |
|
595 |
|
596 hcard = new hCard(document.getElementById("02-multiple-class-names-on-vcard.3")); |
|
597 |
|
598 is(hcard.fn, "Ryan King", "02-multiple-class-names-on-vcard.3 - fn"); |
|
599 is(hcard.n["given-name"][0], "Ryan", "02-multiple-class-names-on-vcard.3 - given-name"); |
|
600 is(hcard.n["family-name"][0], "King", "02-multiple-class-names-on-vcard.3 - family-name"); |
|
601 |
|
602 hcard = new hCard(document.getElementById("03-implied-n.1")); |
|
603 |
|
604 is(hcard.fn, "Ryan King", "03-implied-n.1 - fn"); |
|
605 is(hcard.n["given-name"][0], "Ryan", "03-implied-n.1 - given-name"); |
|
606 is(hcard.n["family-name"][0], "King", "03-implied-n.1 - family-name"); |
|
607 |
|
608 hcard = new hCard(document.getElementById("03-implied-n.2")); |
|
609 |
|
610 is(hcard.fn, "Ryan King", "03-implied-n.2 - fn"); |
|
611 is(hcard.n["given-name"][0], "Ryan", "03-implied-n.2 - given-name"); |
|
612 is(hcard.n["family-name"][0], "King", "03-implied-n.2 - family-name"); |
|
613 |
|
614 hcard = new hCard(document.getElementById("03-implied-n.3")); |
|
615 |
|
616 is(hcard.fn, "Ryan King", "03-implied-n.3 - fn"); |
|
617 is(hcard.n["given-name"][0], "Ryan", "03-implied-n.3 - given-name"); |
|
618 is(hcard.n["family-name"][0], "King", "03-implied-n.3 - family-name"); |
|
619 |
|
620 hcard = new hCard(document.getElementById("03-implied-n.4")); |
|
621 |
|
622 is(hcard.fn, "Brian Suda", "03-implied-n.4 - fn"); |
|
623 is(hcard.n["given-name"][0], "Brian", "03-implied-n.4 - given-name"); |
|
624 is(hcard.n["family-name"][0], "Suda", "03-implied-n.4 - family-name"); |
|
625 |
|
626 hcard = new hCard(document.getElementById("03-implied-n.5")); |
|
627 |
|
628 is(hcard.fn, "King, Ryan", "03-implied-n.5 - fn"); |
|
629 is(hcard.n["given-name"][0], "Ryan", "03-implied-n.5 - given-name"); |
|
630 is(hcard.n["family-name"][0], "King", "03-implied-n.5 - family-name"); |
|
631 |
|
632 hcard = new hCard(document.getElementById("03-implied-n.6")); |
|
633 |
|
634 is(hcard.fn, "King, R", "03-implied-n.6 - fn"); |
|
635 is(hcard.n["given-name"][0], "R", "03-implied-n.6 - given-name"); |
|
636 is(hcard.n["family-name"][0], "King", "03-implied-n.6 - family-name"); |
|
637 |
|
638 hcard = new hCard(document.getElementById("03-implied-n.7")); |
|
639 |
|
640 is(hcard.fn, "King R", "03-implied-n.7 - fn"); |
|
641 is(hcard.n["given-name"][0], "R", "03-implied-n.7 - given-name"); |
|
642 is(hcard.n["family-name"][0], "King", "03-implied-n.7 - family-name"); |
|
643 |
|
644 hcard = new hCard(document.getElementById("03-implied-n.8")); |
|
645 |
|
646 is(hcard.fn, "King R.", "03-implied-n.8 - fn"); |
|
647 is(hcard.n["given-name"][0], "R.", "03-implied-n.8 - given-name"); |
|
648 is(hcard.n["family-name"][0], "King", "03-implied-n.8 - family-name"); |
|
649 |
|
650 hcard = new hCard(document.getElementById("03-implied-n.9")); |
|
651 |
|
652 is(hcard.fn, "Jesse James Garrett", "03-implied-n.9 - fn"); |
|
653 ok(hcard.n === undefined, "03-implied-n.9 -n"); |
|
654 |
|
655 hcard = new hCard(document.getElementById("03-implied-n.10")); |
|
656 |
|
657 is(hcard.fn, "Thomas Vander Wal", "03-implied-n.10 - fn"); |
|
658 ok(hcard.n === undefined, "03-implied-n.10 -n"); |
|
659 |
|
660 hcard = new hCard(document.getElementById("04-ignore-unknowns")); |
|
661 |
|
662 is(hcard.fn, "Ryan King", "04-ignore-unknowns - fn"); |
|
663 is(hcard.n["given-name"][0], "Ryan", "04-ignore-unknowns - given-name"); |
|
664 is(hcard.n["family-name"][0], "King", "04-ignore-unknowns - family-name"); |
|
665 |
|
666 hcard = new hCard(document.getElementById("05-mailto-1")); |
|
667 |
|
668 is(hcard.fn, "Ryan King", "05-mailto-1 - fn"); |
|
669 is(hcard.n["given-name"][0], "Ryan", "05-mailto-1 - given-name"); |
|
670 is(hcard.n["family-name"][0], "King", "05-mailto-1 - family-name"); |
|
671 is(hcard.email[0].value, "ryan@technorati.com", "05-mailto-1 - email"); |
|
672 |
|
673 hcard = new hCard(document.getElementById("06-mailto-2")); |
|
674 |
|
675 is(hcard.fn, "Brian Suda", "06-mailto-2 - fn"); |
|
676 is(hcard.n["given-name"][0], "Brian", "06-mailto-2 - given-name"); |
|
677 is(hcard.n["family-name"][0], "Suda", "06-mailto-2 - family-name"); |
|
678 is(hcard.email[0].value, "brian@example.com", "06-mailto-2 - email"); |
|
679 |
|
680 hcard = new hCard(document.getElementById("07-relative-url")); |
|
681 |
|
682 is(hcard.fn, "John Doe", "07-relative-url - fn"); |
|
683 is(hcard.n["given-name"][0], "John", "07-relative-url - given-name"); |
|
684 is(hcard.n["family-name"][0], "Doe", "07-relative-url - family-name"); |
|
685 // is(hcard.url[0], "http://microformats.org/home/blah", "07-relative-url - url"); |
|
686 is(hcard.url, "http://mochi.test:8888/home/blah", "07-relative-url - url"); |
|
687 |
|
688 hcard = new hCard(document.getElementById("11-multiple-urls")); |
|
689 |
|
690 is(hcard.fn, "John Doe", "11-multiple-urls - fn"); |
|
691 is(hcard.n["given-name"][0], "John", "11-multiple-urls - given-name"); |
|
692 is(hcard.n["family-name"][0], "Doe", "11-multiple-urls - family-name"); |
|
693 is(hcard.url[0], "http://example.com/foo", "11-multiple-urls - url"); |
|
694 is(hcard.url[1], "http://example.com/bar", "11-multiple-urls - url"); |
|
695 |
|
696 hcard = new hCard(document.getElementById("12-img-src-url")); |
|
697 |
|
698 is(hcard.fn, "John Doe", "12-img-src-url - fn"); |
|
699 is(hcard.n["given-name"][0], "John", "12-img-src-url - given-name"); |
|
700 is(hcard.n["family-name"][0], "Doe", "12-img-src-url - family-name"); |
|
701 is(hcard.url[0], "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "12-img-src-url - url"); |
|
702 |
|
703 hcard = new hCard(document.getElementById("13-photo-logo")); |
|
704 |
|
705 is(hcard.fn, "John Doe", "13-photo-logo - fn"); |
|
706 is(hcard.n["given-name"][0], "John", "13-photo-logo - given-name"); |
|
707 is(hcard.n["family-name"][0], "Doe", "13-photo-logo - family-name"); |
|
708 is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - logo"); |
|
709 is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - photo"); |
|
710 |
|
711 hcard = new hCard(document.getElementById("14-img-src-data-url")); |
|
712 |
|
713 is(hcard.fn, "John Doe", "14-img-src-data-url - fn"); |
|
714 is(hcard.n["given-name"][0], "John", "14-img-src-data-url - given-name"); |
|
715 is(hcard.n["family-name"][0], "Doe", "14-img-src-data-url - family-name"); |
|
716 is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - logo"); |
|
717 is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - photo"); |
|
718 |
|
719 hcard = new hCard(document.getElementById("15-honorific-additional-single")); |
|
720 |
|
721 is(hcard.fn, "Mr. John Maurice Doe, Ph.D.", "15-honorific-additional-single - fn"); |
|
722 is(hcard.n["given-name"][0], "John", "15-honorific-additional-single - given-name"); |
|
723 is(hcard.n["family-name"][0], "Doe", "15-honorific-additional-single - family-name"); |
|
724 is(hcard.n["honorific-prefix"], "Mr.", "15-honorific-additional-single - honorific-prefix"); |
|
725 is(hcard.n["additional-name"], "Maurice", "15-honorific-additional-single - additional-name"); |
|
726 is(hcard.n["honorific-suffix"], "Ph.D.", "15-honorific-additional-single - honorific-suffix"); |
|
727 |
|
728 hcard = new hCard(document.getElementById("16-honorific-additional-multiple")); |
|
729 |
|
730 is(hcard.fn, "Mr. Dr. John Maurice Benjamin Doe Ph.D., J.D.", "16-honorific-additional-multiple - fn"); |
|
731 is(hcard.n["given-name"][0], "John", "16-honorific-additional-multiple - given-name"); |
|
732 is(hcard.n["family-name"][0], "Doe", "16-honorific-additional-multiple - family-name"); |
|
733 is(hcard.n["honorific-prefix"][0], "Mr.", "16-honorific-additional-multiple - honorific-prefix"); |
|
734 is(hcard.n["honorific-prefix"][1], "Dr.", "16-honorific-additional-multiple - honorific-prefix"); |
|
735 is(hcard.n["additional-name"][0], "Maurice", "16-honorific-additional-multiple - additional-name"); |
|
736 is(hcard.n["additional-name"][1], "Benjamin", "16-honorific-additional-multiple - additional-name"); |
|
737 is(hcard.n["honorific-suffix"][0], "Ph.D.", "16-honorific-additional-multiple - honorific-suffix"); |
|
738 is(hcard.n["honorific-suffix"][1], "J.D.", "16-honorific-additional-multiple - honorific-suffix"); |
|
739 |
|
740 hcard = new hCard(document.getElementById("17-email-not-uri")); |
|
741 |
|
742 is(hcard.fn, "John Doe", "17-email-not-uri - fn"); |
|
743 is(hcard.n["given-name"][0], "John", "17-email-not-uri - given-name"); |
|
744 is(hcard.n["family-name"][0], "Doe", "17-email-not-uri - family-name"); |
|
745 is(hcard.email[0].value, "john@example.com", "17-email-not-uri - email"); |
|
746 |
|
747 hcard = new hCard(document.getElementById("18-object-data-http-uri")); |
|
748 |
|
749 is(hcard.fn, "John Doe", "18-object-data-http-uri - fn"); |
|
750 is(hcard.n["given-name"][0], "John", "18-object-data-http-uri - given-name"); |
|
751 is(hcard.n["family-name"][0], "Doe", "18-object-data-http-uri - family-name"); |
|
752 is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - logo"); |
|
753 is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - photo"); |
|
754 is(hcard.url, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - url"); |
|
755 |
|
756 hcard = new hCard(document.getElementById("19-object-data-data-uri")); |
|
757 |
|
758 is(hcard.fn, "John Doe", "19-object-data-data-uri - fn"); |
|
759 is(hcard.n["given-name"][0], "John", "19-object-data-data-uri - given-name"); |
|
760 is(hcard.n["family-name"][0], "Doe", "19-object-data-data-uri - family-name"); |
|
761 is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - logo"); |
|
762 is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - photo"); |
|
763 |
|
764 |
|
765 hcard = new hCard(document.getElementById("20-image-alt")); |
|
766 |
|
767 is(hcard.fn, "John Doe", "20-image-alt - fn"); |
|
768 is(hcard.n["given-name"][0], "John", "20-image-alt - given-name"); |
|
769 is(hcard.n["family-name"][0], "Doe", "20-image-alt - family-name"); |
|
770 is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - logo"); |
|
771 is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - photo"); |
|
772 |
|
773 hcard = new hCard(document.getElementById("21-tel")); |
|
774 |
|
775 is(hcard.fn, "John Doe", "21-tel - fn"); |
|
776 is(hcard.n["given-name"][0], "John", "21-tel - given-name"); |
|
777 is(hcard.n["family-name"][0], "Doe", "21-tel - family-name"); |
|
778 is(hcard.tel[0].value, "+1.415.555.1231", "21-tel - tel"); |
|
779 is(hcard.tel[1].value, "+1 415 555 1232", "21-tel - tel"); |
|
780 is(hcard.tel[1].type[0], "home", "21-tel - type"); |
|
781 is(hcard.tel[2].value, "+14155551233", "21-tel - tel"); |
|
782 is(hcard.tel[2].type[0], "msg", "21-tel - type"); |
|
783 is(hcard.tel[2].type[1], "home", "21-tel - type"); |
|
784 is(hcard.tel[2].type[2], "work", "21-tel - type"); |
|
785 is(hcard.tel[2].type[3], "pref", "21-tel - type"); |
|
786 is(hcard.tel[2].type[4], "voice", "21-tel - type"); |
|
787 is(hcard.tel[2].type[5], "fax", "21-tel - type"); |
|
788 is(hcard.tel[2].type[6], "cell", "21-tel - type"); |
|
789 is(hcard.tel[2].type[7], "video", "21-tel - type"); |
|
790 is(hcard.tel[2].type[8], "pager", "21-tel - type"); |
|
791 is(hcard.tel[2].type[9], "bbs", "21-tel - type"); |
|
792 is(hcard.tel[2].type[10], "car", "21-tel - type"); |
|
793 is(hcard.tel[2].type[11], "isdn", "21-tel - type"); |
|
794 is(hcard.tel[2].type[12], "pcs", "21-tel - type"); |
|
795 isnot(hcard.tel[2].type[13], "invalid", "21-tel - type"); |
|
796 is(hcard.tel[3].value, "+1 415 555 1234", "21-tel - tel"); |
|
797 is(hcard.tel[3].type[0], "home", "21-tel - type"); |
|
798 is(hcard.tel[4].value, "+1.415.555.1235", "21-tel - tel"); |
|
799 is(hcard.tel[5].value, "+1.415.555.1236", "21-tel - tel"); |
|
800 is(hcard.tel[6].value, "+1.415.555.1238", "21-tel - tel"); |
|
801 is(hcard.tel[7].value, "+1.415.555.1239", "21-tel - tel"); |
|
802 is(hcard.tel[8].value, "+1.415.555.1241", "21-tel - tel"); |
|
803 is(hcard.tel[9].value, "+1.415.555.1242", "21-tel - tel"); |
|
804 |
|
805 hcard = new hCard(document.getElementById("21-tel.2")); |
|
806 |
|
807 is(hcard.tel[0].type[0], "home", "21-tel.2 - type"); |
|
808 is(hcard.tel[0].value, "+1.415.555.1212", "21-tel.2 - tel"); |
|
809 |
|
810 hcard = new hCard(document.getElementById("21-tel.3")); |
|
811 |
|
812 is(hcard.tel[0].type[0], "home", "21-tel.3 - type (home)"); |
|
813 is(hcard.tel[0].type[1], "pref", "21-tel.3 - type (pref)"); |
|
814 is(hcard.tel[0].value, "+1.415.555.1212", "21-tel.3 - tel"); |
|
815 |
|
816 hcard = new hCard(document.getElementById("22-adr")); |
|
817 |
|
818 is(hcard.fn, "John Doe", "22-adr - fn"); |
|
819 is(hcard.n["given-name"][0], "John", "22-adr - given-name"); |
|
820 is(hcard.n["family-name"][0], "Doe", "22-adr - family-name"); |
|
821 is(hcard.adr[0]["street-address"][0], "1231 Main St.", "22-adr - street-address"); |
|
822 is(hcard.adr[0].locality, "Beverly Hills", "22-adr - locality"); |
|
823 is(hcard.adr[0].region, "California", "22-adr - region"); |
|
824 is(hcard.adr[0]["postal-code"], "90210", "22-adr - postal-code"); |
|
825 is(hcard.adr[0]["country-name"], "United States of America", "22-adr - country-name"); |
|
826 is(hcard.adr[1]["post-office-box"], "PO Box 1234", "22-adr - post-office-box"); |
|
827 is(hcard.adr[1]["street-address"][0], "1232 Main St.", "22-adr - street-address"); |
|
828 is(hcard.adr[1]["street-address"][1], "Suite 100", "22-adr - street-address"); |
|
829 is(hcard.adr[1].locality, "Beverly Hills", "22-adr - locality"); |
|
830 is(hcard.adr[1].region, "California", "22-adr - region"); |
|
831 is(hcard.adr[1]["postal-code"], "90210", "22-adr - postal-code"); |
|
832 is(hcard.adr[1]["country-name"], "United States of America", "22-adr - country-name"); |
|
833 is(hcard.adr[2]["type"][0], "home", "22-adr - type"); |
|
834 is(hcard.adr[2]["street-address"][0], "1233 Main St.", "22-adr - street-address"); |
|
835 is(hcard.adr[2].locality, "Beverly Hills", "22-adr - locality"); |
|
836 is(hcard.adr[2].region, "California", "22-adr - region"); |
|
837 is(hcard.adr[2]["postal-code"], "90210", "22-adr - postal-code"); |
|
838 is(hcard.adr[2]["country-name"], "United States of America", "22-adr - country-name"); |
|
839 is(hcard.adr[3]["type"][0], "dom", "22-adr - type"); |
|
840 is(hcard.adr[3]["type"][1], "intl", "22-adr - type"); |
|
841 is(hcard.adr[3]["type"][2], "postal", "22-adr - type"); |
|
842 is(hcard.adr[3]["type"][3], "parcel", "22-adr - type"); |
|
843 is(hcard.adr[3]["type"][4], "home", "22-adr - type"); |
|
844 is(hcard.adr[3]["type"][5], "work", "22-adr - type"); |
|
845 is(hcard.adr[3]["type"][6], "pref", "22-adr - type"); |
|
846 is(hcard.adr[3]["street-address"][0], "1234 Main St.", "22-adr - street-address"); |
|
847 is(hcard.adr[3].locality, "Beverly Hills", "22-adr - locality"); |
|
848 is(hcard.adr[3].region, "California", "22-adr - region"); |
|
849 is(hcard.adr[3]["postal-code"], "90210", "22-adr - postal-code"); |
|
850 is(hcard.adr[3]["country-name"], "United States of America", "22-adr - country-name"); |
|
851 |
|
852 hcard = new hCard(document.getElementById("23-abbr-title-everything")); |
|
853 |
|
854 is(hcard.fn, "John Doe", "23-abbr-title-everything - fn"); |
|
855 is(hcard.n["given-name"][0], "Jonathan", "23-abbr-title-everything - given-name"); |
|
856 is(hcard.n["family-name"][0], "Doe-Smith", "23-abbr-title-everything - family-name"); |
|
857 is(hcard.n["additional-name"], "John", "23-abbr-title-everything - additional-name"); |
|
858 is(hcard.n["honorific-prefix"], "Mister", "23-abbr-title-everything - honorific-prefix"); |
|
859 is(hcard.n["honorific-suffix"], "Medical Doctor", "23-abbr-title-everything - honorific-suffix"); |
|
860 is(hcard["class"], "public", "23-abbr-title-everything - class"); |
|
861 is(hcard.geo.latitude, "37.77", "23-abbr-title-everything - geo.latitude"); |
|
862 is(hcard.geo.longitude, "-122.41", "23-abbr-title-everything - geo.longitude"); |
|
863 is(hcard.bday, "2006-04-04", "23-abbr-title-everything - bday"); |
|
864 is(hcard.nickname[0], "JJ", "23-abbr-title-everything - nickname"); |
|
865 is(hcard.note[0], "this is a note", "23-abbr-title-everything - note"); |
|
866 isnot(hcard.note[0], "this is not a note", "23-abbr-title-everything - note"); |
|
867 is(hcard.org[0]["organization-name"], "Intellicorp", "23-abbr-title-everything - organization-name"); |
|
868 is(hcard.org[0]["organization-unit"][0], "Intelligence", "23-abbr-title-everything - organization-unit"); |
|
869 is(hcard.role, "Chief", "23-abbr-title-everything - role"); |
|
870 is(hcard.tel[0].value, "415.555.1234", "23-abbr-title-everything - tel"); |
|
871 is(hcard.title[0], "President", "23-abbr-title-everything - title"); |
|
872 is(hcard.tz, "-0700", "23-abbr-title-everything - tz"); |
|
873 is(hcard.uid, "abcdefghijklmnopqrstuvwxyz", "23-abbr-title-everything - uid"); |
|
874 is(hcard.adr[0]["post-office-box"], "Box 1234", "23-abbr-title-everything - post-office-box"); |
|
875 is(hcard.adr[0]["street-address"][0], "123 Fake Street", "23-abbr-title-everything - street-address"); |
|
876 is(hcard.adr[0]["extended-address"], "Suite 100", "23-abbr-title-everything - street-address"); |
|
877 is(hcard.adr[0].locality, "San Francisco", "23-abbr-title-everything - locality"); |
|
878 is(hcard.adr[0].region, "California", "23-abbr-title-everything - region"); |
|
879 is(hcard.adr[0]["postal-code"], "12345-6789", "23-abbr-title-everything - postal-code"); |
|
880 is(hcard.adr[0]["country-name"], "United States of America", "23-abbr-title-everything - country-name"); |
|
881 |
|
882 hcard = new hCard(document.getElementById("25-geo-abbr")); |
|
883 |
|
884 is(hcard.fn, "Paradise", "25-geo-abbr - fn"); |
|
885 is(hcard.geo.latitude, "30.267991", "25-geo-abbr - geo.latitude"); |
|
886 is(hcard.geo.longitude, "-97.739568", "25-geo-abbr - geo.longitude"); |
|
887 |
|
888 hcard = new hCard(document.getElementById("26-ancestors")); |
|
889 |
|
890 is(hcard.fn, "John Doe", "26-ancestors - fn"); |
|
891 is(hcard.n["given-name"][0], "Jonathan", "26-ancestors - given-name"); |
|
892 is(hcard.n["family-name"][0], "Doe-Smith", "26-ancestors - family-name"); |
|
893 is(hcard.n["additional-name"], "John", "26-ancestors - additional-name"); |
|
894 is(hcard.n["honorific-prefix"], "Mister", "26-ancestors - honorific-prefix"); |
|
895 is(hcard.n["honorific-suffix"], "Medical Doctor", "26-ancestors - honorific-suffix"); |
|
896 is(hcard["class"], "public", "26-ancestors - class"); |
|
897 is(hcard.geo.latitude, "37.77", "26-ancestors - geo.latitude"); |
|
898 is(hcard.geo.longitude, "-122.41", "26-ancestors - geo.longitude"); |
|
899 is(hcard.bday, "2006-04-04", "26-ancestors - bday"); |
|
900 is(hcard.nickname[0], "JJ", "26-ancestors - nickname"); |
|
901 is(hcard.note[0], "this is a note", "26-ancestors - note"); |
|
902 isnot(hcard.note[0], "this is not a note", "26-ancestors - note"); |
|
903 is(hcard.org[0]["organization-name"], "Intellicorp", "26-ancestors - organization-name"); |
|
904 is(hcard.org[0]["organization-unit"][0], "Intelligence", "26-ancestors - organization-unit"); |
|
905 is(hcard.role, "Chief", "26-ancestors - role"); |
|
906 is(hcard.agent[0].fn, "Bob Smith", "26-ancestors - agent.fn"); |
|
907 is(hcard.agent[0].title, "Executive Assistant", "26-ancestors - agent.title"); |
|
908 is(hcard.tel[0].value, "415.555.1234", "26-ancestors - tel"); |
|
909 is(hcard.title[0], "President", "26-ancestors - title"); |
|
910 is(hcard.tz, "-0700", "26-ancestors - tz"); |
|
911 is(hcard.uid, "abcdefghijklmnopqrstuvwxyz", "26-ancestors - uid"); |
|
912 is(hcard.adr[0]["post-office-box"], "Box 1234", "26-ancestors - post-office-box"); |
|
913 is(hcard.adr[0]["street-address"][0], "123 Fake Street", "26-ancestors - street-address"); |
|
914 is(hcard.adr[0]["extended-address"], "Suite 100", "26-ancestors - street-address"); |
|
915 is(hcard.adr[0].locality, "San Francisco", "26-ancestors - locality"); |
|
916 is(hcard.adr[0].region, "California", "26-ancestors - region"); |
|
917 is(hcard.adr[0]["postal-code"], "12345-6789", "26-ancestors - postal-code"); |
|
918 is(hcard.adr[0]["country-name"], "United States of America", "26-ancestors - country-name"); |
|
919 |
|
920 hcard = new hCard(document.getElementById("27-bday-date")); |
|
921 |
|
922 is(hcard.fn, "john doe", "27-bday-date - fn"); |
|
923 is(hcard.n["given-name"][0], "john", "27-bday-date - given-name"); |
|
924 is(hcard.n["family-name"][0], "doe", "27-bday-date - family-name"); |
|
925 is(hcard.bday, "2000-01-01", "27-bday-date - bday"); |
|
926 |
|
927 hcard = new hCard(document.getElementById("28-bday-datetime")); |
|
928 |
|
929 is(hcard.fn, "john doe", "28-bday-datetime - fn"); |
|
930 is(hcard.n["given-name"][0], "john", "28-bday-datetime - given-name"); |
|
931 is(hcard.n["family-name"][0], "doe", "28-bday-datetime - family-name"); |
|
932 is(hcard.bday, "2000-01-01T00:00:00", "28-bday-datetime - bday"); |
|
933 |
|
934 hcard = new hCard(document.getElementById("29-bday-datetime-timezone")); |
|
935 |
|
936 is(hcard.fn, "john doe", "29-bday-datetime-timezone - fn"); |
|
937 is(hcard.n["given-name"][0], "john", "29-bday-datetime-timezone - given-name"); |
|
938 is(hcard.n["family-name"][0], "doe", "29-bday-datetime-timezone - family-name"); |
|
939 is(hcard.bday, "2000-01-01T00:00:00-0800", "29-bday-datetime-timezone - bday"); |
|
940 |
|
941 hcard = new hCard(document.getElementById("30-fn-org.1")); |
|
942 |
|
943 is(hcard.fn, "W3C", "30-fn-org.1 - fn"); |
|
944 is(hcard.org[0]["organization-name"], "W3C", "30-fn-org.1 - organization-name"); |
|
945 |
|
946 |
|
947 hcard = new hCard(document.getElementById("30-fn-org.2")); |
|
948 |
|
949 is(hcard.fn, "Dan Connolly", "30-fn-org.2 - fn"); |
|
950 is(hcard.n["given-name"][0], "Dan", "30-fn-org.2 - given-name"); |
|
951 is(hcard.n["family-name"][0], "Connolly", "30-fn-org.2 - family-name"); |
|
952 is(hcard.org[0]["organization-name"], "W3C", "30-fn-org.2 - organization-name"); |
|
953 |
|
954 hcard = new hCard(document.getElementById("30-fn-org.3")); |
|
955 |
|
956 is(hcard.fn, "W3C", "30-fn-org.3 - fn"); |
|
957 is(hcard.org[0]["organization-name"], "W3C", "30-fn-org.3 - organization-name"); |
|
958 |
|
959 hcard = new hCard(document.getElementById("30-fn-org.4")); |
|
960 |
|
961 is(hcard.fn, "World Wide Web Consortium", "30-fn-org.4 - fn"); |
|
962 is(hcard.org[0]["organization-name"], "World Wide Web Consortium", "30-fn-org.4 - organization-name"); |
|
963 |
|
964 hcard = new hCard(document.getElementById("30-fn-org.5")); |
|
965 |
|
966 is(hcard.fn, "World Wide Web Consortium", "30-fn-org.5 - fn"); |
|
967 is(hcard.org[0]["organization-name"], "World Wide Web Consortium", "30-fn-org.5 - organization-name"); |
|
968 |
|
969 hcard = new hCard(document.getElementById("31-include.1")); |
|
970 |
|
971 is(hcard.fn, "Brian Suda", "31-include.1 - fn"); |
|
972 is(hcard.n["given-name"][0], "Brian", "31-include.1 - given-name"); |
|
973 is(hcard.n["family-name"][0], "Suda", "31-include.1 - family-name"); |
|
974 is(hcard.url, "http://suda.co.uk/", "31-include.1 - url"); |
|
975 is(hcard.email[0].value, "correct@example.com", "31-include.1 - email"); |
|
976 isnot(hcard.email[0].value, "incorrect@example.com", "31-include.1 - email"); |
|
977 |
|
978 hcard = new hCard(document.getElementById("31-include.2")); |
|
979 |
|
980 is(hcard.fn, "Brian Suda", "31-include.2 - fn"); |
|
981 is(hcard.n["given-name"][0], "Brian", "31-include.2 - given-name"); |
|
982 is(hcard.n["family-name"][0], "Suda", "31-include.2 - family-name"); |
|
983 is(hcard.url, "http://suda.co.uk/", "31-include.2 - url"); |
|
984 is(hcard.email[0].value, "correct@example.com", "31-include.2 - email"); |
|
985 isnot(hcard.email[0].value, "incorrect@example.com", "31-include.2 - email"); |
|
986 |
|
987 hcard = new hCard(document.getElementById("31-include.3")); |
|
988 |
|
989 is(hcard.fn, "Brian Suda", "31-include.3 - fn"); |
|
990 is(hcard.n["given-name"][0], "Brian", "31-include.3 - given-name"); |
|
991 is(hcard.n["family-name"][0], "Suda", "31-include.3 - family-name"); |
|
992 is(hcard.url, "http://suda.co.uk/", "31-include.3 - url"); |
|
993 is(hcard.email[0].value, "correct@example.com", "31-include.3 - email"); |
|
994 isnot(hcard.email[0].value, "incorrect@example.com", "31-include.3 - email"); |
|
995 |
|
996 hcard = new hCard(document.getElementById("31-include.4")); |
|
997 |
|
998 is(hcard.fn, "Brian Suda", "31-include.3 - fn"); |
|
999 is(hcard.n["given-name"][0], "Brian", "31-include.3 - given-name"); |
|
1000 is(hcard.n["family-name"][0], "Suda", "31-include.3 - family-name"); |
|
1001 is(hcard.url, "http://suda.co.uk/", "31-include.3 - url"); |
|
1002 |
|
1003 hcard = new hCard(document.getElementById("32-header.1")); |
|
1004 |
|
1005 is(hcard.fn, "Brian Suda", "32-header.1 - fn"); |
|
1006 is(hcard.n["given-name"][0], "Brian", "32-header.1 - given-name"); |
|
1007 is(hcard.n["family-name"][0], "Suda", "32-header.1 - family-name"); |
|
1008 is(hcard.org[0]["organization-name"], "example.org", "32-header.1 - organization-name"); |
|
1009 is(hcard.url, "http://example.org/", "32-header.1 - url"); |
|
1010 |
|
1011 hcard = new hCard(document.getElementById("32-header.2")); |
|
1012 |
|
1013 is(hcard.fn, "John Doe", "32-header.2 - fn"); |
|
1014 is(hcard.n["given-name"][0], "John", "32-header.2 - given-name"); |
|
1015 is(hcard.n["family-name"][0], "Doe", "32-header.2 - family-name"); |
|
1016 is(hcard.org[0]["organization-name"], "example.org", "32-header.2 - organization-name"); |
|
1017 is(hcard.url, "http://example.org/", "32-header.2 - url"); |
|
1018 |
|
1019 hcard = new hCard(document.getElementById("33-area.1")); |
|
1020 |
|
1021 is(hcard.fn, "Joe Public", "33-area.1 - fn"); |
|
1022 is(hcard.n["given-name"][0], "Joe", "33-area.1 - given-name"); |
|
1023 is(hcard.n["family-name"][0], "Public", "33-area.1 - family-name"); |
|
1024 is(hcard.url, "http://example.com/", "33-area.1 - url"); |
|
1025 is(hcard.email[0].value, "joe@example.com", "33-area.1 - email"); |
|
1026 |
|
1027 hcard = new hCard(document.getElementById("33-area.2")); |
|
1028 |
|
1029 is(hcard.fn, "Joe Public", "33-area.2 - fn"); |
|
1030 is(hcard.url, "http://example.com/", "33-area.2 - url"); |
|
1031 is(hcard.email[0].value, "joe@example.com", "33-area.2 - email"); |
|
1032 is(hcard.org[0]["organization-name"], "Joe Public", "33-area.2 - organization-name"); |
|
1033 |
|
1034 hcard = new hCard(document.getElementById("33-area.3")); |
|
1035 |
|
1036 is(hcard.fn, "Joe Public", "33-area.3 - fn"); |
|
1037 is(hcard.url, "http://example.com/", "33-area.3 - url"); |
|
1038 is(hcard.email[0].value, "joe@example.com", "33-area.3 - email"); |
|
1039 is(hcard.org[0]["organization-name"], "Joe Public", "33-area.3 - organization-name"); |
|
1040 |
|
1041 hcard = new hCard(document.getElementById("33-area.4")); |
|
1042 |
|
1043 is(hcard.fn, "Joe Public", "33-area.4 - fn"); |
|
1044 is(hcard.url, "http://example.com/", "33-area.4 - url"); |
|
1045 is(hcard.email[0].value, "joe@example.com", "33-area.4 - email"); |
|
1046 is(hcard.org[0]["organization-name"], "Joe Public", "33-area.4 - organization-name"); |
|
1047 |
|
1048 hcard = new hCard(document.getElementById("33-area.5")); |
|
1049 |
|
1050 is(hcard.fn, "Joe Public", "33-area.5 - fn"); |
|
1051 is(hcard.url, "http://example.com/", "33-area.5 - url"); |
|
1052 is(hcard.email[0].value, "joe@example.com", "33-area.5 - email"); |
|
1053 is(hcard.org[0]["organization-name"], "Joe Public", "33-area.5 - organization-name"); |
|
1054 |
|
1055 hcard = new hCard(document.getElementById("34-notes")); |
|
1056 |
|
1057 is(hcard.fn, "Joe Public", "34-notes - fn"); |
|
1058 is(hcard.n["given-name"][0], "Joe", "34-notes - given-name"); |
|
1059 is(hcard.n["family-name"][0], "Public", "34-notes - family-name"); |
|
1060 is(hcard.note[0], "Note 1", "34-notes - note"); |
|
1061 isnot(hcard.note[1], "Note 2", "34-notes - note"); |
|
1062 is(hcard.note[1], "Note 3", "34-notes - note"); |
|
1063 is(hcard.note[2], "Note 4 with a ; and a , to be escaped", "34-notes - note"); |
|
1064 |
|
1065 hcard = new hCard(document.getElementById("35-include-pattern.1")); |
|
1066 |
|
1067 is(hcard.fn, "James Levine", "35-include-pattern.1 - fn"); |
|
1068 is(hcard.n["given-name"][0], "James", "35-include-pattern.1 - given-name"); |
|
1069 is(hcard.n["family-name"][0], "Levine", "35-include-pattern.1 - family-name"); |
|
1070 |
|
1071 hcard = new hCard(document.getElementById("35-include-pattern.2")); |
|
1072 |
|
1073 is(hcard.fn, "James Levine", "35-include-pattern.2 - fn"); |
|
1074 is(hcard.n["given-name"][0], "James", "35-include-pattern.2 - given-name"); |
|
1075 is(hcard.n["family-name"][0], "Levine", "35-include-pattern.2 - family-name"); |
|
1076 is(hcard.org[0]["organization-name"], "SimplyHired", "35-include-pattern.2 - organization-name"); |
|
1077 is(hcard.title[0], "Microformat Brainstormer", "35-include-pattern.2 - title"); |
|
1078 |
|
1079 hcard = new hCard(document.getElementById("35-include-pattern.3")); |
|
1080 |
|
1081 is(hcard.fn, "James Levine", "35-include-pattern.3 - fn"); |
|
1082 is(hcard.n["given-name"][0], "James", "35-include-pattern.3 - given-name"); |
|
1083 is(hcard.n["family-name"][0], "Levine", "35-include-pattern.3 - family-name"); |
|
1084 is(hcard.org[0]["organization-name"], "SimplyHired", "35-include-pattern.3 - organization-name"); |
|
1085 is(hcard.title[0], "Microformat Brainstormer", "35-include-pattern.3 - title"); |
|
1086 |
|
1087 hcard = new hCard(document.getElementById("36-categories.1")); |
|
1088 |
|
1089 is(hcard.fn, "john doe", "36-categories.1 - fn"); |
|
1090 is(hcard.n["given-name"][0], "john", "36-categories.1 - given-name"); |
|
1091 is(hcard.n["family-name"][0], "doe", "36-categories.1 - family-name"); |
|
1092 is(hcard.category[0], "C1", "36-categories.1 - category"); |
|
1093 isnot(hcard.category[0], "C1a", "36-categories.1 - category"); |
|
1094 is(hcard.category[1], "C2a", "36-categories.1 - category"); |
|
1095 isnot(hcard.category[1], "C2", "36-categories.1 - category"); |
|
1096 is(hcard.category[2], "C3", "36-categories.1 - category"); |
|
1097 isnot(hcard.category[2], "C3a", "36-categories.1 - category"); |
|
1098 isnot(hcard.category[2], "C3b", "36-categories.1 - category"); |
|
1099 is(hcard.category[3], "C4", "36-categories.1 - category"); |
|
1100 is(hcard.category[4], "C5", "36-categories.1 - category"); |
|
1101 isnot(hcard.category[4], "C5a", "36-categories.1 - category"); |
|
1102 isnot(hcard.category[4], "C5b", "36-categories.1 - category"); |
|
1103 is(hcard.category[5], "C6", "36-categories.1 - category"); |
|
1104 isnot(hcard.category[4], "C6a", "36-categories.1 - category"); |
|
1105 isnot(hcard.category[4], "C6b", "36-categories.1 - category"); |
|
1106 is(hcard.category[6], "C7", "36-categories.1 - category"); |
|
1107 isnot(hcard.category[4], "C7a", "36-categories.1 - category"); |
|
1108 isnot(hcard.category[4], "C7b", "36-categories.1 - category"); |
|
1109 is(hcard.category[7], "C8", "36-categories.1 - category"); |
|
1110 isnot(hcard.category[4], "C8a", "36-categories.1 - category"); |
|
1111 isnot(hcard.category[4], "C8b", "36-categories.1 - category"); |
|
1112 is(hcard.category[8], "C9", "36-categories.1 - category"); |
|
1113 isnot(hcard.category[4], "C9a", "36-categories.1 - category"); |
|
1114 isnot(hcard.category[4], "C9b", "36-categories.1 - category"); |
|
1115 |
|
1116 hcard = new hCard(document.getElementById("37-singleton")); |
|
1117 |
|
1118 is(hcard.fn, "john doe 1", "37-singleton - fn"); |
|
1119 is(hcard.n["given-name"][0], "john", "37-singleton - given-name"); |
|
1120 is(hcard.n["family-name"][0], "doe", "37-singleton - family-name"); |
|
1121 is(hcard.uid, "unique-id-1", "37-singleton - uid"); |
|
1122 is(hcard.tz, "+0600", "37-singleton - tz"); |
|
1123 is(hcard["sort-string"], "d", "37-singleton - sort-string"); |
|
1124 is(hcard.geo.latitude, "123.45", "37-singleton - geo.latitude"); |
|
1125 is(hcard.geo.longitude, "67.89", "37-singleton - geo.longitude"); |
|
1126 is(hcard["class"], "public", "37-singleton - class"); |
|
1127 is(hcard.bday, "2006-07-07", "37-singleton - bday"); |
|
1128 is(hcard.rev, "2006-07-07", "37-singleton - rev"); |
|
1129 |
|
1130 hcard = new hCard(document.getElementById("38-uid.1")); |
|
1131 |
|
1132 is(hcard.fn, "Ryan King", "38-uid.1 - fn"); |
|
1133 is(hcard.n["given-name"][0], "Ryan", "38-uid.1 - given-name"); |
|
1134 is(hcard.n["family-name"][0], "King", "38-uid.1 - family-name"); |
|
1135 is(hcard.uid, "http://theryanking.com/contact/", "38-uid.1 - uid"); |
|
1136 is(hcard.url[0], "http://theryanking.com/contact/", "38-uid.1 - url"); |
|
1137 |
|
1138 hcard = new hCard(document.getElementById("38-uid.2")); |
|
1139 |
|
1140 is(hcard.fn, "Ryan King", "38-uid.2 - fn"); |
|
1141 is(hcard.n["given-name"][0], "Ryan", "38-uid.2 - given-name"); |
|
1142 is(hcard.n["family-name"][0], "King", "38-uid.2 - family-name"); |
|
1143 is(hcard.uid, "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.2 - uid"); |
|
1144 is(hcard.url[0], "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.2 - url"); |
|
1145 |
|
1146 hcard = new hCard(document.getElementById("38-uid.3")); |
|
1147 |
|
1148 is(hcard.fn, "Ryan King", "38-uid.3 - fn"); |
|
1149 is(hcard.n["given-name"][0], "Ryan", "38-uid.3 - given-name"); |
|
1150 is(hcard.n["family-name"][0], "King", "38-uid.3 - family-name"); |
|
1151 is(hcard.uid, "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.3 - uid"); |
|
1152 is(hcard.url[0], "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.3 - url"); |
|
1153 |
|
1154 hcard = new hCard(document.getElementById("38-uid.4")); |
|
1155 |
|
1156 is(hcard.fn, "Ryan King", "38-uid.4 - fn"); |
|
1157 is(hcard.n["given-name"][0], "Ryan", "38-uid.4 - given-name"); |
|
1158 is(hcard.n["family-name"][0], "King", "38-uid.4 - family-name"); |
|
1159 is(hcard.uid, "http://theryanking.com/contact/", "38-uid.4 - uid"); |
|
1160 is(hcard.url[0], "http://theryanking.com/contact/", "38-uid.4 - url"); |
|
1161 |
|
1162 hcard = new hCard(document.getElementById("39-noteHTML")); |
|
1163 |
|
1164 is(hcard.note[0], "Note", "39-noteHTML - note"); |
|
1165 is(hcard.note[0].toHTML(), "<b>Note</b>", "39-noteHTML - note as HTML"); |
|
1166 is(hcard.note[0].match("Note"), "Note", "39-noteHTML - match in note"); |
|
1167 |
|
1168 hcard = new hCard(document.getElementById("email-type")); |
|
1169 is(hcard.email[0].type, "internet", "email - type no value (type)"); |
|
1170 is(hcard.email[0].value, "john@example.com", "email - type no value (value)"); |
|
1171 } |
|
1172 |
|
1173 </script> |
|
1174 </pre> |
|
1175 </body> |
|
1176 </html> |