View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.javascript.host.css;
16  
17  import org.htmlunit.WebDriverTestCase;
18  import org.htmlunit.junit.BrowserRunner;
19  import org.htmlunit.junit.annotation.Alerts;
20  import org.htmlunit.junit.annotation.HtmlUnitNYI;
21  import org.htmlunit.util.MimeType;
22  import org.junit.Test;
23  import org.junit.runner.RunWith;
24  
25  /**
26   * Tests for {@link CSSStyleDeclaration} background, font and border shorthand.
27   *
28   * @author Ronald Brill
29   * @author Frank Danek
30   */
31  @RunWith(BrowserRunner.class)
32  public class CSSStyleDeclaration3Test extends WebDriverTestCase {
33  
34      /**
35       * @throws Exception if the test fails
36       */
37      @Test
38      @Alerts({"", "", "", "", ""})
39      public void backgroundEmpty() throws Exception {
40          background("");
41      }
42  
43      /**
44       * @throws Exception if the test fails
45       */
46      @Test
47      @Alerts(DEFAULT = {"red", "none", "repeat", "0% 0%", "scroll"},
48              CHROME = {"red", "initial", "initial", "initial", "initial"},
49              EDGE = {"red", "initial", "initial", "initial", "initial"})
50      public void backgroundColorRed() throws Exception {
51          background("rEd");
52      }
53  
54      /**
55       * @throws Exception if the test fails
56       */
57      @Test
58      @Alerts(DEFAULT = {"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"},
59              CHROME = {"rgb(255, 204, 221)", "initial", "initial", "initial", "initial"},
60              EDGE = {"rgb(255, 204, 221)", "initial", "initial", "initial", "initial"})
61      public void backgroundColorHex() throws Exception {
62          background("#fFccdd");
63      }
64  
65      /**
66       * @throws Exception if the test fails
67       */
68      @Test
69      @Alerts(DEFAULT = {"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"},
70              CHROME = {"rgb(255, 204, 221)", "initial", "initial", "initial", "initial"},
71              EDGE = {"rgb(255, 204, 221)", "initial", "initial", "initial", "initial"})
72      public void backgroundColorHexShort() throws Exception {
73          background("#fCd");
74      }
75  
76      /**
77       * @throws Exception if the test fails
78       */
79      @Test
80      @Alerts(DEFAULT = {"rgb(20, 40, 60)", "none", "repeat", "0% 0%", "scroll"},
81              CHROME = {"rgb(20, 40, 60)", "initial", "initial", "initial", "initial"},
82              EDGE = {"rgb(20, 40, 60)", "initial", "initial", "initial", "initial"})
83      public void backgroundColorRgb() throws Exception {
84          background("rGb(20, 40, 60)");
85      }
86  
87      /**
88       * @throws Exception if the test fails
89       */
90      @Test
91      @Alerts(DEFAULT = {"initial", "url(\"myImage.png\")", "initial", "initial", "initial"},
92              FF = {"rgba(0, 0, 0, 0)", "url(\"myImage.png\")", "repeat", "0% 0%", "scroll"},
93              FF_ESR = {"rgba(0, 0, 0, 0)", "url(\"myImage.png\")", "repeat", "0% 0%", "scroll"})
94      public void backgroundImage() throws Exception {
95          background("uRl(myImage.png)");
96      }
97  
98      /**
99       * @throws Exception if the test fails
100      */
101     @Test
102     @Alerts(DEFAULT = {"initial", "initial", "repeat-x", "initial", "initial"},
103             FF = {"rgba(0, 0, 0, 0)", "none", "repeat-x", "0% 0%", "scroll"},
104             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat-x", "0% 0%", "scroll"})
105     public void backgroundRepeat() throws Exception {
106         background("repeat-x");
107     }
108 
109     /**
110      * @throws Exception if the test fails
111      */
112     @Test
113     @Alerts(DEFAULT = {"initial", "initial", "initial", "20px 100%", "initial"},
114             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "20px 100%", "scroll"},
115             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "20px 100%", "scroll"})
116     public void backgroundPosition() throws Exception {
117         background("20px 100%");
118     }
119 
120     /**
121      * @throws Exception if the test fails
122      */
123     @Test
124     @Alerts(DEFAULT = {"initial", "initial", "initial", "right bottom", "initial"},
125             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "right bottom", "scroll"},
126             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "right bottom", "scroll"})
127     public void backgroundPosition2() throws Exception {
128         background("bottom right");
129     }
130 
131     /**
132      * @throws Exception if the test fails
133      */
134     @Test
135     @Alerts(DEFAULT = {"initial", "initial", "initial", "10em bottom", "initial"},
136             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "10em bottom", "scroll"},
137             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "10em bottom", "scroll"})
138     public void backgroundPosition3() throws Exception {
139         background("10em bottom");
140     }
141 
142     /**
143      * @throws Exception if the test fails
144      */
145     @Test
146     @Alerts(DEFAULT = {"initial", "initial", "initial", "10em center", "initial"},
147             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "10em center", "scroll"},
148             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "10em center", "scroll"})
149     public void backgroundPosition4() throws Exception {
150         background("10em center");
151     }
152 
153     /**
154      * @throws Exception if the test fails
155      */
156     @Test
157     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "fixed"},
158             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "0% 0%", "fixed"},
159             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "0% 0%", "fixed"})
160     public void backgroundAttachment() throws Exception {
161         background("fixed");
162     }
163 
164     /**
165      * @throws Exception if the test fails
166      */
167     @Test
168     @Alerts(DEFAULT = {"red", "url(\"myImage.png\")", "repeat", "0% 0%", "scroll"},
169             CHROME = {"red", "url(\"myImage.png\")", "initial", "initial", "initial"},
170             EDGE = {"red", "url(\"myImage.png\")", "initial", "initial", "initial"})
171     public void backgroundMixed() throws Exception {
172         background("red url(\"myImage.png\")");
173     }
174 
175     /**
176      * @throws Exception if the test fails
177      */
178     @Test
179     @Alerts(DEFAULT = {"rgb(255, 255, 255)", "none", "no-repeat", "20px 100px", "scroll"},
180             CHROME = {"rgb(255, 255, 255)", "initial", "no-repeat", "20px 100px", "initial"},
181             EDGE = {"rgb(255, 255, 255)", "initial", "no-repeat", "20px 100px", "initial"})
182     public void backgroundMixed2() throws Exception {
183         background("#fff no-repeat 20px 100px");
184     }
185 
186     private void background(final String backgroundStyle) throws Exception {
187         final String html = DOCTYPE_HTML
188             + "<html>\n"
189             + "<body>\n"
190             + "  <div id='tester' style='background: " + backgroundStyle + "' >hello</div>\n"
191             + "  <script>\n"
192             + LOG_TITLE_FUNCTION
193             + "    var myStyle = document.getElementById('tester').style;\n"
194             + "    log(myStyle.backgroundColor);\n"
195             + "    log(myStyle.backgroundImage);\n"
196             + "    log(myStyle.backgroundRepeat);\n"
197             + "    log(myStyle.backgroundPosition);\n"
198             + "    log(myStyle.backgroundAttachment);\n"
199             + "  </script>\n"
200             + "</body></html>";
201 
202         getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML);
203 
204         loadPageVerifyTitle2(html);
205     }
206 
207     /**
208      * @throws Exception if the test fails
209      */
210     @Test
211     @Alerts({"", "", "", "", ""})
212     public void backgroundCssEmpty() throws Exception {
213         backgroundCss("");
214     }
215 
216     /**
217      * @throws Exception if the test fails
218      */
219     @Test
220     @Alerts(DEFAULT = {"red", "initial", "initial", "initial", "initial"},
221             FF = {"red", "none", "repeat", "0% 0%", "scroll"},
222             FF_ESR = {"red", "none", "repeat", "0% 0%", "scroll"})
223     @HtmlUnitNYI(CHROME = {"rEd", "initial", "initial", "initial", "initial"},
224             EDGE = {"rEd", "initial", "initial", "initial", "initial"},
225             FF = {"rEd", "none", "repeat", "0% 0%", "scroll"},
226             FF_ESR = {"rEd", "none", "repeat", "0% 0%", "scroll"})
227     public void backgroundCssColorRed() throws Exception {
228         backgroundCss("rEd");
229     }
230 
231     /**
232      * @throws Exception if the test fails
233      */
234     @Test
235     @Alerts(DEFAULT = {"rgb(255, 204, 221)", "initial", "initial", "initial", "initial"},
236             FF = {"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"},
237             FF_ESR = {"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"})
238     public void backgroundCssColorHex() throws Exception {
239         backgroundCss("#fFccdd");
240     }
241 
242     /**
243      * @throws Exception if the test fails
244      */
245     @Test
246     @Alerts(DEFAULT = {"rgb(255, 204, 221)", "initial", "initial", "initial", "initial"},
247             FF = {"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"},
248             FF_ESR = {"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"})
249     public void backgroundCssColorHexShort() throws Exception {
250         backgroundCss("#fCd");
251     }
252 
253     /**
254      * @throws Exception if the test fails
255      */
256     @Test
257     @Alerts(DEFAULT = {"rgb(20, 40, 60)", "initial", "initial", "initial", "initial"},
258             FF = {"rgb(20, 40, 60)", "none", "repeat", "0% 0%", "scroll"},
259             FF_ESR = {"rgb(20, 40, 60)", "none", "repeat", "0% 0%", "scroll"})
260     public void backgroundCssColorRgb() throws Exception {
261         backgroundCss("rGb(20, 40, 60)");
262     }
263 
264     /**
265      * @throws Exception if the test fails
266      */
267     @Test
268     @Alerts(DEFAULT = {"initial", "url(\"myImage.png\")", "initial", "initial", "initial"},
269             FF = {"rgba(0, 0, 0, 0)", "url(\"myImage.png\")", "repeat", "0% 0%", "scroll"},
270             FF_ESR = {"rgba(0, 0, 0, 0)", "url(\"myImage.png\")", "repeat", "0% 0%", "scroll"})
271     public void backgroundCssImage() throws Exception {
272         backgroundCss("uRl(myImage.png)");
273     }
274 
275     /**
276      * @throws Exception if the test fails
277      */
278     @Test
279     @Alerts(DEFAULT = {"initial", "initial", "repeat-x", "initial", "initial"},
280             FF = {"rgba(0, 0, 0, 0)", "none", "repeat-x", "0% 0%", "scroll"},
281             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat-x", "0% 0%", "scroll"})
282     public void backgroundCssRepeat() throws Exception {
283         backgroundCss("repeat-x");
284     }
285 
286     /**
287      * @throws Exception if the test fails
288      */
289     @Test
290     @Alerts(DEFAULT = {"initial", "initial", "initial", "20px 100%", "initial"},
291             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "20px 100%", "scroll"},
292             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "20px 100%", "scroll"})
293     public void backgroundCssPosition() throws Exception {
294         backgroundCss("20px 100%");
295     }
296 
297     /**
298      * @throws Exception if the test fails
299      */
300     @Test
301     @Alerts(DEFAULT = {"initial", "initial", "initial", "right bottom", "initial"},
302             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "right bottom", "scroll"},
303             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "right bottom", "scroll"})
304     public void backgroundCssPosition2() throws Exception {
305         backgroundCss("bottom right");
306     }
307 
308     /**
309      * @throws Exception if the test fails
310      */
311     @Test
312     @Alerts(DEFAULT = {"initial", "initial", "initial", "left bottom", "initial"},
313             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "left bottom", "scroll"},
314             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "left bottom", "scroll"})
315     public void backgroundCssPosition3() throws Exception {
316         backgroundCss("left bottom");
317     }
318 
319     /**
320      * @throws Exception if the test fails
321      */
322     @Test
323     @Alerts(DEFAULT = {"initial", "initial", "initial", "center top", "initial"},
324             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "center top", "scroll"},
325             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "center top", "scroll"})
326     public void backgroundCssPosition4() throws Exception {
327         backgroundCss("top center");
328     }
329 
330     /**
331      * @throws Exception if the test fails
332      */
333     @Test
334     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "fixed"},
335             FF = {"rgba(0, 0, 0, 0)", "none", "repeat", "0% 0%", "fixed"},
336             FF_ESR = {"rgba(0, 0, 0, 0)", "none", "repeat", "0% 0%", "fixed"})
337     public void backgroundCssAttachment() throws Exception {
338         backgroundCss("fixed");
339     }
340 
341     /**
342      * @throws Exception if the test fails
343      */
344     @Test
345     @Alerts(DEFAULT = {"red", "url(\"myImage.png\")", "initial", "initial", "initial"},
346             FF = {"red", "url(\"myImage.png\")", "repeat", "0% 0%", "scroll"},
347             FF_ESR = {"red", "url(\"myImage.png\")", "repeat", "0% 0%", "scroll"})
348     public void backgroundCssMixed() throws Exception {
349         backgroundCss("red url(\"myImage.png\")");
350     }
351 
352     /**
353      * @throws Exception if the test fails
354      */
355     @Test
356     @Alerts(DEFAULT = {"rgb(255, 255, 255)", "initial", "no-repeat", "20px 100px", "initial"},
357             FF = {"rgb(255, 255, 255)", "none", "no-repeat", "20px 100px", "scroll"},
358             FF_ESR = {"rgb(255, 255, 255)", "none", "no-repeat", "20px 100px", "scroll"})
359     public void backgroundCssMixed2() throws Exception {
360         backgroundCss("#fff no-repeat 20px 100px");
361     }
362 
363     private void backgroundCss(final String backgroundStyle) throws Exception {
364         final String html = DOCTYPE_HTML
365             + "<html>\n"
366             + "</head>\n"
367             + "  <style type='text/css'>div { background: " + backgroundStyle + " }</style>\n"
368             + "</head>\n"
369             + "<body>\n"
370             + "  <div id='tester'>hello</div>\n"
371             + "  <script>\n"
372             + LOG_TITLE_FUNCTION
373             + "    var myStyle = document.styleSheets[0].cssRules[0].style;\n"
374             + "    log(myStyle.backgroundColor);\n"
375             + "    log(myStyle.backgroundImage);\n"
376             + "    log(myStyle.backgroundRepeat);\n"
377             + "    log(myStyle.backgroundPosition);\n"
378             + "    log(myStyle.backgroundAttachment);\n"
379             + "  </script>\n"
380             + "</body></html>";
381 
382         getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML);
383 
384         expandExpectedAlertsVariables(URL_FIRST);
385         loadPageVerifyTitle2(html);
386     }
387 
388     /**
389      * @throws Exception if the test fails
390      */
391     @Test
392     @Alerts({"rgba(0, 0, 0, 0)", "none", "repeat", "0% 0%", "scroll"})
393     public void backgroundComputedEmpty() throws Exception {
394         backgroundComputed("");
395     }
396 
397     /**
398      * @throws Exception if the test fails
399      */
400     @Test
401     @Alerts({"rgb(255, 0, 0)", "none", "repeat", "0% 0%", "scroll"})
402     public void backgroundComputedColorRed() throws Exception {
403         backgroundComputed("rEd");
404     }
405 
406     /**
407      * @throws Exception if the test fails
408      */
409     @Test
410     @Alerts({"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"})
411     public void backgroundComputedColorHex() throws Exception {
412         backgroundComputed("#fFccdd");
413     }
414 
415     /**
416      * @throws Exception if the test fails
417      */
418     @Test
419     @Alerts({"rgb(255, 204, 221)", "none", "repeat", "0% 0%", "scroll"})
420     public void backgroundComputedColorHexShort() throws Exception {
421         backgroundComputed("#fCd");
422     }
423 
424     /**
425      * @throws Exception if the test fails
426      */
427     @Test
428     @Alerts({"rgb(20, 40, 60)", "none", "repeat", "0% 0%", "scroll"})
429     public void backgroundComputedColorRgb() throws Exception {
430         backgroundComputed("rGb(20, 40, 60)");
431     }
432 
433     /**
434      * @throws Exception if the test fails
435      */
436     @Test
437     @Alerts({"rgba(0, 0, 0, 0)", "url(\"§§URL§§myImage.png\")", "repeat", "0% 0%", "scroll"})
438     public void backgroundComputedImage() throws Exception {
439         backgroundComputed("uRl(myImage.png)");
440     }
441 
442     /**
443      * @throws Exception if the test fails
444      */
445     @Test
446     @Alerts({"rgba(0, 0, 0, 0)", "none", "repeat-x", "0% 0%", "scroll"})
447     public void backgroundComputedRepeat() throws Exception {
448         backgroundComputed("repeat-x");
449     }
450 
451     /**
452      * @throws Exception if the test fails
453      */
454     @Test
455     @Alerts({"rgba(0, 0, 0, 0)", "none", "repeat", "20px 100%", "scroll"})
456     public void backgroundComputedPosition() throws Exception {
457         backgroundComputed("20px 100%");
458     }
459 
460     /**
461      * @throws Exception if the test fails
462      */
463     @Test
464     @Alerts({"rgba(0, 0, 0, 0)", "none", "repeat", "100% 100%", "scroll"})
465     public void backgroundComputedPosition2() throws Exception {
466         backgroundComputed("bottom right");
467     }
468 
469     /**
470      * @throws Exception if the test fails
471      */
472     @Test
473     @Alerts({"rgba(0, 0, 0, 0)", "none", "repeat", "0% 100%", "scroll"})
474     public void backgroundComputedPosition3() throws Exception {
475         backgroundComputed("left bottom");
476     }
477 
478     /**
479      * @throws Exception if the test fails
480      */
481     @Test
482     @Alerts({"rgba(0, 0, 0, 0)", "none", "repeat", "50% 0%", "scroll"})
483     public void backgroundComputedPosition4() throws Exception {
484         backgroundComputed("top center");
485     }
486 
487     /**
488      * @throws Exception if the test fails
489      */
490     @Test
491     @Alerts({"rgba(0, 0, 0, 0)", "none", "repeat", "0% 0%", "fixed"})
492     public void backgroundComputedAttachment() throws Exception {
493         backgroundComputed("fixed");
494     }
495 
496     /**
497      * @throws Exception if the test fails
498      */
499     @Test
500     @Alerts({"rgb(255, 0, 0)", "url(\"§§URL§§myImage.png\")", "repeat", "0% 0%", "scroll"})
501     public void backgroundComputedMixed() throws Exception {
502         backgroundComputed("red url(\"myImage.png\")");
503     }
504 
505     /**
506      * @throws Exception if the test fails
507      */
508     @Test
509     @Alerts({"rgb(255, 255, 255)", "none", "no-repeat", "20px 100px", "scroll"})
510     public void backgroundComputedMixed2() throws Exception {
511         backgroundComputed("#fff no-repeat 20px 100px");
512     }
513 
514     private void backgroundComputed(final String backgroundStyle) throws Exception {
515         final String html = DOCTYPE_HTML
516             + "<html>\n"
517             + "</head>\n"
518             + "  <style type='text/css'>div { background: " + backgroundStyle + " }</style>\n"
519             + "</head>\n"
520             + "<body>\n"
521             + "  <div id='tester'>hello</div>\n"
522             + "  <script>\n"
523             + LOG_TITLE_FUNCTION
524             + "    var myDiv = document.getElementById('tester');\n"
525             + "    var myStyle = window.getComputedStyle(myDiv, null);\n"
526             + "    log(myStyle.backgroundColor);\n"
527             + "    log(myStyle.backgroundImage);\n"
528             + "    log(myStyle.backgroundRepeat);\n"
529             + "    log(myStyle.backgroundPosition);\n"
530             + "    log(myStyle.backgroundAttachment);\n"
531             + "  </script>\n"
532             + "</body></html>";
533 
534         getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML);
535 
536         expandExpectedAlertsVariables(URL_FIRST);
537         loadPageVerifyTitle2(html);
538     }
539 
540     /**
541      * @throws Exception if the test fails
542      */
543     @Test
544     @Alerts({"", "", "", "", "", ""})
545     public void fontEmpty() throws Exception {
546         font("");
547     }
548 
549     /**
550      * @throws Exception if the test fails
551      */
552     @Test
553     @Alerts({"", "", "", "", "", ""})
554     public void fontSizeOnly() throws Exception {
555         font("14px");
556     }
557 
558     /**
559      * @throws Exception if the test fails
560      */
561     @Test
562     @Alerts({"", "", "", "", "", ""})
563     public void fontFamilyOnly() throws Exception {
564         font("sans-serif");
565     }
566 
567     /**
568      * @throws Exception if the test fails
569      */
570     @Test
571     @Alerts({"", "", "", "", "", ""})
572     public void fontAllExceptSizeAndFamily() throws Exception {
573         font("italic small-caps bold");
574     }
575 
576     /**
577      * @throws Exception if the test fails
578      */
579     @Test
580     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif"})
581     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
582             EDGE = {"", "", "", "", "", ""},
583             FF = {"", "", "", "", "", ""},
584             FF_ESR = {"", "", "", "", "", ""})
585     public void fontSizeAndFamily() throws Exception {
586         font("14pX sAns-serif");
587     }
588 
589     /**
590      * @throws Exception if the test fails
591      */
592     @Test
593     @Alerts(DEFAULT = {"normal", "normal", "normal", "14px", "normal", "\"Gill Sans Extrabold\""},
594             FF = {"normal", "normal", "normal", "14px", "normal", "Gill Sans Extrabold"},
595             FF_ESR = {"normal", "normal", "normal", "14px", "normal", "Gill Sans Extrabold"})
596     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
597             EDGE = {"", "", "", "", "", ""},
598             FF = {"", "", "", "", "", ""},
599             FF_ESR = {"", "", "", "", "", ""})
600     public void fontFamilyWithSpaces() throws Exception {
601         font("14pX Gill Sans Extrabold");
602     }
603 
604     /**
605      * @throws Exception if the test fails
606      */
607     @Test
608     @Alerts({"normal", "normal", "normal", "14px", "normal", "\"Gill Sans Extrabold\""})
609     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
610             EDGE = {"", "", "", "", "", ""},
611             FF = {"", "", "", "", "", ""},
612             FF_ESR = {"", "", "", "", "", ""})
613     public void fontFamilyQuoted() throws Exception {
614         font("14pX \"Gill Sans Extrabold\"");
615     }
616 
617     /**
618      * @throws Exception if the test fails
619      */
620     @Test
621     @Alerts({"normal", "normal", "normal", "14px", "normal", "\"Gill Sans Extrabold\", serif"})
622     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
623             EDGE = {"", "", "", "", "", ""},
624             FF = {"", "", "", "", "", ""},
625             FF_ESR = {"", "", "", "", "", ""})
626     public void fontFamilyMultiple() throws Exception {
627         font("14pX \"Gill Sans Extrabold\", serif");
628     }
629 
630     /**
631      * @throws Exception if the test fails
632      */
633     @Test
634     @Alerts({"normal", "normal", "normal", "14%", "normal", "sans-serif"})
635     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
636             EDGE = {"", "", "", "", "", ""},
637             FF = {"", "", "", "", "", ""},
638             FF_ESR = {"", "", "", "", "", ""})
639     public void fontSizePercent() throws Exception {
640         font("14.0% sAns-serif");
641     }
642 
643     /**
644      * @throws Exception if the test fails
645      */
646     @Test
647     @Alerts({"italic", "normal", "normal", "14px", "normal", "sans-serif"})
648     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
649             EDGE = {"", "", "", "", "", ""},
650             FF = {"", "", "", "", "", ""},
651             FF_ESR = {"", "", "", "", "", ""})
652     public void fontStyle() throws Exception {
653         font("iTalic 14pX sAns-serif");
654     }
655 
656     /**
657      * @throws Exception if the test fails
658      */
659     @Test
660     @Alerts({"oblique 10deg", "normal", "normal", "14px", "normal", "sans-serif"})
661     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
662             EDGE = {"", "", "", "", "", ""},
663             FF = {"", "", "", "", "", ""},
664             FF_ESR = {"", "", "", "", "", ""})
665     public void fontStyleWithDegree() throws Exception {
666         font("oBlique 10deg 14pX sAns-serif");
667     }
668 
669     /**
670      * @throws Exception if the test fails
671      */
672     @Test
673     @Alerts({"normal", "small-caps", "normal", "14px", "normal", "sans-serif"})
674     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
675             EDGE = {"", "", "", "", "", ""},
676             FF = {"", "", "", "", "", ""},
677             FF_ESR = {"", "", "", "", "", ""})
678     public void fontVariant() throws Exception {
679         font("sMall-caps 14pX sAns-serif");
680     }
681 
682     /**
683      * @throws Exception if the test fails
684      */
685     @Test
686     @Alerts({"normal", "normal", "bold", "14px", "normal", "sans-serif"})
687     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
688             EDGE = {"", "", "", "", "", ""},
689             FF = {"", "", "", "", "", ""},
690             FF_ESR = {"", "", "", "", "", ""})
691     public void fontWeight() throws Exception {
692         font("bOld 14pX sAns-serif");
693     }
694 
695     /**
696      * @throws Exception if the test fails
697      */
698     @Test
699     @Alerts({"normal", "normal", "800", "14px", "normal", "sans-serif"})
700     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
701             EDGE = {"", "", "", "", "", ""},
702             FF = {"", "", "", "", "", ""},
703             FF_ESR = {"", "", "", "", "", ""})
704     public void fontWeightNumber() throws Exception {
705         font("800 14pX sAns-serif");
706     }
707 
708     /**
709      * @throws Exception if the test fails
710      */
711     @Test
712     @Alerts({"normal", "normal", "normal", "14px", "18em", "sans-serif"})
713     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
714             EDGE = {"", "", "", "", "", ""},
715             FF = {"", "", "", "", "", ""},
716             FF_ESR = {"", "", "", "", "", ""})
717     public void fontLineHeight() throws Exception {
718         font("14pX/18eM sAns-serif");
719     }
720 
721     /**
722      * @throws Exception if the test fails
723      */
724     @Test
725     @Alerts({"normal", "normal", "normal", "14px", "18%", "sans-serif"})
726     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
727             EDGE = {"", "", "", "", "", ""},
728             FF = {"", "", "", "", "", ""},
729             FF_ESR = {"", "", "", "", "", ""})
730     public void fontLineHeightPercent() throws Exception {
731         font("14pX/18.0% sAns-serif");
732     }
733 
734     /**
735      * @throws Exception if the test fails
736      */
737     @Test
738     @Alerts({"italic", "small-caps", "bold", "14px", "18em", "sans-serif"})
739     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
740             EDGE = {"", "", "", "", "", ""},
741             FF = {"", "", "", "", "", ""},
742             FF_ESR = {"", "", "", "", "", ""})
743     public void fontAll() throws Exception {
744         font("iTalic sMall-caps bOld 14pX/18eM sAns-serif");
745     }
746 
747     /**
748      * @throws Exception if the test fails
749      */
750     @Test
751     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "none", "normal"})
752     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "0.5", ""},
753             EDGE = {"", "", "", "", "", "", "0.5", ""},
754             FF = {"", "", "", "", "", "", "0.5", ""},
755             FF_ESR = {"", "", "", "", "", "", "0.5", ""})
756     public void fontSizeAdjustBefore() throws Exception {
757         font("14pX sAns-serif", "font-size-adjust: 0.5");
758     }
759 
760     /**
761      * @throws Exception if the test fails
762      */
763     @Test
764     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "0.5", "normal"})
765     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "0.5", ""},
766             EDGE = {"", "", "", "", "", "", "0.5", ""},
767             FF = {"", "", "", "", "", "", "0.5", ""},
768             FF_ESR = {"", "", "", "", "", "", "0.5", ""})
769     public void fontSizeAdjustAfter() throws Exception {
770         font("14pX sAns-serif; font-size-adjust: 0.5", "");
771     }
772 
773     /**
774      * @throws Exception if the test fails
775      */
776     @Test
777     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "none", "normal"})
778     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "expanded"},
779             EDGE = {"", "", "", "", "", "", "", "expanded"},
780             FF = {"", "", "", "", "", "", "", "expanded"},
781             FF_ESR = {"", "", "", "", "", "", "", "expanded"})
782     public void fontStretchBefore() throws Exception {
783         font("14pX sAns-serif", "font-stretch: expanded");
784     }
785 
786     /**
787      * @throws Exception if the test fails
788      */
789     @Test
790     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "none", "expanded"})
791     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "expanded"},
792             EDGE = {"", "", "", "", "", "", "", "expanded"},
793             FF = {"", "", "", "", "", "", "", "expanded"},
794             FF_ESR = {"", "", "", "", "", "", "", "expanded"})
795     public void fontStretchAfter() throws Exception {
796         font("14pX sAns-serif; font-stretch: expanded", "");
797     }
798 
799     private void font(final String fontStyle) throws Exception {
800         final String html = DOCTYPE_HTML
801                 + "<html>\n"
802                 + "<body>\n"
803                 + "  <div id='tester' style='font: " + fontStyle + "' >hello</div>\n"
804                 + "  <script>\n"
805                 + LOG_TITLE_FUNCTION
806                 + "    var myStyle = document.getElementById('tester').style;\n"
807                 + "    log(myStyle.fontStyle);\n"
808                 + "    log(myStyle.fontVariant);\n"
809                 + "    log(myStyle.fontWeight);\n"
810                 + "    log(myStyle.fontSize);\n"
811                 + "    log(myStyle.lineHeight);\n"
812                 + "    log(myStyle.fontFamily);\n"
813                 + "  </script>\n"
814                 + "</body></html>";
815 
816         loadPageVerifyTitle2(html);
817     }
818 
819     private void font(final String fontStyle, final String otherStyle) throws Exception {
820         final String html = DOCTYPE_HTML
821             + "<html>\n"
822             + "<body>\n"
823             + "  <div id='tester' style='" + otherStyle + "; font: " + fontStyle + "' >hello</div>\n"
824             + "  <script>\n"
825             + LOG_TITLE_FUNCTION
826             + "    var myStyle = document.getElementById('tester').style;\n"
827             + "    log(myStyle.fontStyle);\n"
828             + "    log(myStyle.fontVariant);\n"
829             + "    log(myStyle.fontWeight);\n"
830             + "    log(myStyle.fontSize);\n"
831             + "    log(myStyle.lineHeight);\n"
832             + "    log(myStyle.fontFamily);\n"
833             + "    log(myStyle.fontSizeAdjust);\n"
834             + "    log(myStyle.fontStretch);\n"
835             + "  </script>\n"
836             + "</body></html>";
837 
838         loadPageVerifyTitle2(html);
839     }
840 
841     /**
842      * @throws Exception if the test fails
843      */
844     @Test
845     @Alerts({"", "", "", "", "", ""})
846     public void fontCssEmpty() throws Exception {
847         fontCss("");
848     }
849 
850     /**
851      * @throws Exception if the test fails
852      */
853     @Test
854     @Alerts({"", "", "", "", "", ""})
855     public void fontCssSizeOnly() throws Exception {
856         fontCss("14px");
857     }
858 
859     /**
860      * @throws Exception if the test fails
861      */
862     @Test
863     @Alerts({"", "", "", "", "", ""})
864     public void fontCssFamilyOnly() throws Exception {
865         fontCss("sans-serif");
866     }
867 
868     /**
869      * @throws Exception if the test fails
870      */
871     @Test
872     @Alerts({"", "", "", "", "", ""})
873     public void fontCssAllExceptSizeAndFamily() throws Exception {
874         fontCss("italic small-caps bold");
875     }
876 
877     /**
878      * @throws Exception if the test fails
879      */
880     @Test
881     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif"})
882     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
883             EDGE = {"", "", "", "", "", ""},
884             FF = {"", "", "", "", "", ""},
885             FF_ESR = {"", "", "", "", "", ""})
886     public void fontCssSizeAndFamily() throws Exception {
887         fontCss("14pX sAns-serif");
888     }
889 
890     /**
891      * @throws Exception if the test fails
892      */
893     @Test
894     @Alerts(DEFAULT = {"normal", "normal", "normal", "14px", "normal", "\"Gill Sans Extrabold\""},
895             FF = {"normal", "normal", "normal", "14px", "normal", "Gill Sans Extrabold"},
896             FF_ESR = {"normal", "normal", "normal", "14px", "normal", "Gill Sans Extrabold"})
897     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
898             EDGE = {"", "", "", "", "", ""},
899             FF = {"", "", "", "", "", ""},
900             FF_ESR = {"", "", "", "", "", ""})
901     public void fontCssFamilyWithSpaces() throws Exception {
902         fontCss("14pX Gill Sans Extrabold");
903     }
904 
905     /**
906      * @throws Exception if the test fails
907      */
908     @Test
909     @Alerts({"normal", "normal", "normal", "14px", "normal", "\"Gill Sans Extrabold\""})
910     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
911             EDGE = {"", "", "", "", "", ""},
912             FF = {"", "", "", "", "", ""},
913             FF_ESR = {"", "", "", "", "", ""})
914     public void fontCssFamilyQuoted() throws Exception {
915         fontCss("14pX \"Gill Sans Extrabold\"");
916     }
917 
918     /**
919      * @throws Exception if the test fails
920      */
921     @Test
922     @Alerts({"normal", "normal", "normal", "14px", "normal", "\"Gill Sans Extrabold\", serif"})
923     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
924             EDGE = {"", "", "", "", "", ""},
925             FF = {"", "", "", "", "", ""},
926             FF_ESR = {"", "", "", "", "", ""})
927     public void fontCssFamilyMultiple() throws Exception {
928         fontCss("14pX \"Gill Sans Extrabold\", serif");
929     }
930 
931     /**
932      * @throws Exception if the test fails
933      */
934     @Test
935     @Alerts({"normal", "normal", "normal", "14%", "normal", "sans-serif"})
936     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
937             EDGE = {"", "", "", "", "", ""},
938             FF = {"", "", "", "", "", ""},
939             FF_ESR = {"", "", "", "", "", ""})
940     public void fontCssSizePercent() throws Exception {
941         fontCss("14.0% sAns-serif");
942     }
943 
944     /**
945      * @throws Exception if the test fails
946      */
947     @Test
948     @Alerts({"italic", "normal", "normal", "14px", "normal", "sans-serif"})
949     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
950             EDGE = {"", "", "", "", "", ""},
951             FF = {"", "", "", "", "", ""},
952             FF_ESR = {"", "", "", "", "", ""})
953     public void fontCssStyle() throws Exception {
954         fontCss("iTalic 14pX sAns-serif");
955     }
956 
957     /**
958      * @throws Exception if the test fails
959      */
960     @Test
961     @Alerts({"oblique 10deg", "normal", "normal", "14px", "normal", "sans-serif"})
962     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
963             EDGE = {"", "", "", "", "", ""},
964             FF = {"", "", "", "", "", ""},
965             FF_ESR = {"", "", "", "", "", ""})
966     public void fontCssStyleWithDegree() throws Exception {
967         fontCss("oBlique 10deg 14pX sAns-serif");
968     }
969 
970     /**
971      * @throws Exception if the test fails
972      */
973     @Test
974     @Alerts({"normal", "small-caps", "normal", "14px", "normal", "sans-serif"})
975     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
976             EDGE = {"", "", "", "", "", ""},
977             FF = {"", "", "", "", "", ""},
978             FF_ESR = {"", "", "", "", "", ""})
979     public void fontCssVariant() throws Exception {
980         fontCss("sMall-caps 14pX sAns-serif");
981     }
982 
983     /**
984      * @throws Exception if the test fails
985      */
986     @Test
987     @Alerts({"normal", "normal", "bold", "14px", "normal", "sans-serif"})
988     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
989             EDGE = {"", "", "", "", "", ""},
990             FF = {"", "", "", "", "", ""},
991             FF_ESR = {"", "", "", "", "", ""})
992     public void fontCssWeight() throws Exception {
993         fontCss("bOld 14pX sAns-serif");
994     }
995 
996     /**
997      * @throws Exception if the test fails
998      */
999     @Test
1000     @Alerts({"normal", "normal", "800", "14px", "normal", "sans-serif"})
1001     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
1002             EDGE = {"", "", "", "", "", ""},
1003             FF = {"", "", "", "", "", ""},
1004             FF_ESR = {"", "", "", "", "", ""})
1005     public void fontCssWeightNumber() throws Exception {
1006         fontCss("800 14pX sAns-serif");
1007     }
1008 
1009     /**
1010      * @throws Exception if the test fails
1011      */
1012     @Test
1013     @Alerts({"normal", "normal", "normal", "14px", "18em", "sans-serif"})
1014     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
1015             EDGE = {"", "", "", "", "", ""},
1016             FF = {"", "", "", "", "", ""},
1017             FF_ESR = {"", "", "", "", "", ""})
1018     public void fontCssLineHeight() throws Exception {
1019         fontCss("14pX/18eM sAns-serif");
1020     }
1021 
1022     /**
1023      * @throws Exception if the test fails
1024      */
1025     @Test
1026     @Alerts({"normal", "normal", "normal", "14px", "18%", "sans-serif"})
1027     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
1028             EDGE = {"", "", "", "", "", ""},
1029             FF = {"", "", "", "", "", ""},
1030             FF_ESR = {"", "", "", "", "", ""})
1031     public void fontCssLineHeightPercent() throws Exception {
1032         fontCss("14pX/18.0% sAns-serif");
1033     }
1034 
1035     /**
1036      * @throws Exception if the test fails
1037      */
1038     @Test
1039     @Alerts({"italic", "small-caps", "bold", "14px", "18em", "sans-serif"})
1040     @HtmlUnitNYI(CHROME = {"", "", "", "", "", ""},
1041             EDGE = {"", "", "", "", "", ""},
1042             FF = {"", "", "", "", "", ""},
1043             FF_ESR = {"", "", "", "", "", ""})
1044     public void fontCssAll() throws Exception {
1045         fontCss("iTalic sMall-caps bOld 14pX/18eM sAns-serif");
1046     }
1047 
1048     /**
1049      * @throws Exception if the test fails
1050      */
1051     @Test
1052     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "none", "normal"})
1053     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "0.5", ""},
1054             EDGE = {"", "", "", "", "", "", "0.5", ""},
1055             FF = {"", "", "", "", "", "", "0.5", ""},
1056             FF_ESR = {"", "", "", "", "", "", "0.5", ""})
1057     public void fontCssSizeAdjustBefore() throws Exception {
1058         fontCss("14pX sAns-serif", "font-size-adjust: 0.5");
1059     }
1060 
1061     /**
1062      * @throws Exception if the test fails
1063      */
1064     @Test
1065     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "0.5", "normal"})
1066     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "0.5", ""},
1067             EDGE = {"", "", "", "", "", "", "0.5", ""},
1068             FF = {"", "", "", "", "", "", "0.5", ""},
1069             FF_ESR = {"", "", "", "", "", "", "0.5", ""})
1070     public void fontCssSizeAdjustAfter() throws Exception {
1071         fontCss("14pX sAns-serif; font-size-adjust: 0.5", "");
1072     }
1073 
1074     /**
1075      * @throws Exception if the test fails
1076      */
1077     @Test
1078     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "none", "normal"})
1079     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "expanded"},
1080             EDGE = {"", "", "", "", "", "", "", "expanded"},
1081             FF = {"", "", "", "", "", "", "", "expanded"},
1082             FF_ESR = {"", "", "", "", "", "", "", "expanded"})
1083     public void fontCssStretchBefore() throws Exception {
1084         fontCss("14pX sAns-serif", "font-stretch: expanded");
1085     }
1086 
1087     /**
1088      * @throws Exception if the test fails
1089      */
1090     @Test
1091     @Alerts({"normal", "normal", "normal", "14px", "normal", "sans-serif", "none", "expanded"})
1092     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "expanded"},
1093             EDGE = {"", "", "", "", "", "", "", "expanded"},
1094             FF = {"", "", "", "", "", "", "", "expanded"},
1095             FF_ESR = {"", "", "", "", "", "", "", "expanded"})
1096     public void fontCssStretchAfter() throws Exception {
1097         fontCss("14pX sAns-serif; font-stretch: expanded", "");
1098     }
1099 
1100     private void fontCss(final String fontStyle) throws Exception {
1101         final String html = DOCTYPE_HTML
1102                 + "<html>\n"
1103                 + "</head>\n"
1104                 + "  <style type='text/css'>div { font: " + fontStyle + " }</style>\n"
1105                 + "</head>\n"
1106                 + "<body>\n"
1107                 + "  <div id='tester'>hello</div>\n"
1108                 + "  <script>\n"
1109                 + LOG_TITLE_FUNCTION
1110                 + "    var myStyle = document.styleSheets[0].cssRules[0].style;\n"
1111                 + "    log(myStyle.fontStyle);\n"
1112                 + "    log(myStyle.fontVariant);\n"
1113                 + "    log(myStyle.fontWeight);\n"
1114                 + "    log(myStyle.fontSize);\n"
1115                 + "    log(myStyle.lineHeight);\n"
1116                 + "    log(myStyle.fontFamily);\n"
1117                 + "  </script>\n"
1118                 + "</body></html>";
1119 
1120         loadPageVerifyTitle2(html);
1121     }
1122 
1123     private void fontCss(final String fontStyle, final String otherStyle) throws Exception {
1124         final String html = DOCTYPE_HTML
1125             + "<html>\n"
1126             + "</head>\n"
1127             + "  <style type='text/css'>div { " + otherStyle + "; font: " + fontStyle + " }</style>\n"
1128             + "</head>\n"
1129             + "<body>\n"
1130             + "  <div id='tester'>hello</div>\n"
1131             + "  <script>\n"
1132             + LOG_TITLE_FUNCTION
1133             + "    var myStyle = document.styleSheets[0].cssRules[0].style;\n"
1134             + "    log(myStyle.fontStyle);\n"
1135             + "    log(myStyle.fontVariant);\n"
1136             + "    log(myStyle.fontWeight);\n"
1137             + "    log(myStyle.fontSize);\n"
1138             + "    log(myStyle.lineHeight);\n"
1139             + "    log(myStyle.fontFamily);\n"
1140             + "    log(myStyle.fontSizeAdjust);\n"
1141             + "    log(myStyle.fontStretch);\n"
1142             + "  </script>\n"
1143             + "</body></html>";
1144 
1145         loadPageVerifyTitle2(html);
1146     }
1147 
1148     /**
1149      * @throws Exception if the test fails
1150      */
1151     @Test
1152     @Alerts(DEFAULT = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1153             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1154             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1155     public void fontComputedEmpty() throws Exception {
1156         fontComputed("");
1157     }
1158 
1159     /**
1160      * @throws Exception if the test fails
1161      */
1162     @Test
1163     @Alerts(DEFAULT = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1164             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1165             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1166     public void fontComputedSizeOnly() throws Exception {
1167         fontComputed("14px");
1168     }
1169 
1170     /**
1171      * @throws Exception if the test fails
1172      */
1173     @Test
1174     @Alerts(DEFAULT = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1175             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1176             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1177     public void fontComputedFamilyOnly() throws Exception {
1178         fontComputed("sans-serif");
1179     }
1180 
1181     /**
1182      * @throws Exception if the test fails
1183      */
1184     @Test
1185     @Alerts(DEFAULT = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1186             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1187             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1188     public void fontComputedAllExceptSizeAndFamily() throws Exception {
1189         fontComputed("italic small-caps bold");
1190     }
1191 
1192     /**
1193      * @throws Exception if the test fails
1194      */
1195     @Test
1196     @Alerts({"normal", "normal", "400", "14px", "normal", "sans-serif"})
1197     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1198             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1199             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1200             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1201     public void fontComputedSizeAndFamily() throws Exception {
1202         fontComputed("14pX sAns-serif");
1203     }
1204 
1205     /**
1206      * @throws Exception if the test fails
1207      */
1208     @Test
1209     @Alerts(DEFAULT = {"normal", "normal", "400", "14px", "normal", "\"Gill Sans Extrabold\""},
1210             FF = {"normal", "normal", "400", "14px", "normal", "Gill Sans Extrabold"},
1211             FF_ESR = {"normal", "normal", "400", "14px", "normal", "Gill Sans Extrabold"})
1212     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1213             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1214             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1215             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1216     public void fontComputedFamilyWithSpaces() throws Exception {
1217         fontComputed("14pX Gill Sans Extrabold");
1218     }
1219 
1220     /**
1221      * @throws Exception if the test fails
1222      */
1223     @Test
1224     @Alerts({"normal", "normal", "400", "14px", "normal", "\"Gill Sans Extrabold\""})
1225     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1226             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1227             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1228             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1229     public void fontComputedFamilyQuoted() throws Exception {
1230         fontComputed("14pX \"Gill Sans Extrabold\"");
1231     }
1232 
1233     /**
1234      * @throws Exception if the test fails
1235      */
1236     @Test
1237     @Alerts({"normal", "normal", "400", "14px", "normal", "\"Gill Sans Extrabold\", serif"})
1238     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1239             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1240             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1241             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1242     public void fontComputedFamilyMultiple() throws Exception {
1243         fontComputed("14pX \"Gill Sans Extrabold\", serif");
1244     }
1245 
1246     /**
1247      * @throws Exception if the test fails
1248      */
1249     @Test
1250     @Alerts(DEFAULT = {"normal", "normal", "400", "6px", "normal", "sans-serif"},
1251             FF = {"normal", "normal", "400", "2.24px", "normal", "sans-serif"},
1252             FF_ESR = {"normal", "normal", "400", "2.24px", "normal", "sans-serif"})
1253     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1254             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1255             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1256             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1257     public void fontComputedSizePercent() throws Exception {
1258         fontComputed("14.0% sAns-serif");
1259     }
1260 
1261     /**
1262      * @throws Exception if the test fails
1263      */
1264     @Test
1265     @Alerts({"italic", "normal", "400", "14px", "normal", "sans-serif"})
1266     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1267             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1268             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1269             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1270     public void fontComputedStyle() throws Exception {
1271         fontComputed("iTalic 14pX sAns-serif");
1272     }
1273 
1274     /**
1275      * @throws Exception if the test fails
1276      */
1277     @Test
1278     @Alerts({"oblique 10deg", "normal", "400", "14px", "normal", "sans-serif"})
1279     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1280             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1281             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1282             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1283     public void fontComputedStyleWithDegree() throws Exception {
1284         fontComputed("oBlique 10deg 14pX sAns-serif");
1285     }
1286 
1287     /**
1288      * @throws Exception if the test fails
1289      */
1290     @Test
1291     @Alerts({"normal", "small-caps", "400", "14px", "normal", "sans-serif"})
1292     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1293             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1294             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1295             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1296     public void fontComputedVariant() throws Exception {
1297         fontComputed("sMall-caps 14pX sAns-serif");
1298     }
1299 
1300     /**
1301      * @throws Exception if the test fails
1302      */
1303     @Test
1304     @Alerts({"normal", "normal", "700", "14px", "normal", "sans-serif"})
1305     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1306             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1307             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1308             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1309     public void fontComputedWeight() throws Exception {
1310         fontComputed("bOld 14pX sAns-serif");
1311     }
1312 
1313     /**
1314      * @throws Exception if the test fails
1315      */
1316     @Test
1317     @Alerts({"normal", "normal", "800", "14px", "normal", "sans-serif"})
1318     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1319             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1320             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1321             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1322     public void fontComputedWeightNumber() throws Exception {
1323         fontComputed("800 14pX sAns-serif");
1324     }
1325 
1326     /**
1327      * @throws Exception if the test fails
1328      */
1329     @Test
1330     @Alerts({"normal", "normal", "400", "14px", "252px", "sans-serif"})
1331     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1332             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1333             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1334             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1335     public void fontComputedLineHeight() throws Exception {
1336         fontComputed("14pX/18eM sAns-serif");
1337     }
1338 
1339     /**
1340      * @throws Exception if the test fails
1341      */
1342     @Test
1343     @Alerts(DEFAULT = {"normal", "normal", "400", "14px", "2.52px", "sans-serif"},
1344             FF = {"normal", "normal", "400", "14px", "2.51667px", "sans-serif"},
1345             FF_ESR = {"normal", "normal", "400", "14px", "2.51667px", "sans-serif"})
1346     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1347             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1348             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1349             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1350     public void fontComputedLineHeightPercent() throws Exception {
1351         fontComputed("14pX/18.0% sAns-serif");
1352     }
1353 
1354     /**
1355      * @throws Exception if the test fails
1356      */
1357     @Test
1358     @Alerts({"italic", "small-caps", "700", "14px", "252px", "sans-serif"})
1359     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1360             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\""},
1361             FF = {"normal", "normal", "400", "16px", "normal", "serif"},
1362             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif"})
1363     public void fontComputedAll() throws Exception {
1364         fontComputed("iTalic sMall-caps bOld 14pX/18eM sAns-serif");
1365     }
1366 
1367     /**
1368      * @throws Exception if the test fails
1369      */
1370     @Test
1371     @Alerts({"normal", "normal", "400", "14px", "normal", "sans-serif", "none", "100%"})
1372     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "0.5", "100%"},
1373             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "0.5", "100%"},
1374             FF = {"normal", "normal", "400", "16px", "normal", "serif", "0.5", "100%"},
1375             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif", "0.5", "100%"})
1376     public void fontComputedSizeAdjustBefore() throws Exception {
1377         fontComputed("14pX sAns-serif", "font-size-adjust: 0.5");
1378     }
1379 
1380     /**
1381      * @throws Exception if the test fails
1382      */
1383     @Test
1384     @Alerts({"normal", "normal", "400", "14px", "normal", "sans-serif", "0.5", "100%"})
1385     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "0.5", "100%"},
1386             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "0.5", "100%"},
1387             FF = {"normal", "normal", "400", "16px", "normal", "serif", "0.5", "100%"},
1388             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif", "0.5", "100%"})
1389     public void fontComputedSizeAdjustAfter() throws Exception {
1390         fontComputed("14pX sAns-serif; font-size-adjust: 0.5", "");
1391     }
1392 
1393     /**
1394      * @throws Exception if the test fails
1395      */
1396     @Test
1397     @Alerts({"normal", "normal", "400", "14px", "normal", "sans-serif", "none", "100%"})
1398     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "none", "expanded"},
1399             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "none", "expanded"},
1400             FF = {"normal", "normal", "400", "16px", "normal", "serif", "none", "expanded"},
1401             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif", "none", "expanded"})
1402     public void fontComputedStretchBefore() throws Exception {
1403         fontComputed("14pX sAns-serif", "font-stretch: expanded");
1404     }
1405 
1406     /**
1407      * @throws Exception if the test fails
1408      */
1409     @Test
1410     @Alerts({"normal", "normal", "400", "14px", "normal", "sans-serif", "none", "125%"})
1411     @HtmlUnitNYI(CHROME = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "none", "expanded"},
1412             EDGE = {"normal", "normal", "400", "16px", "normal", "\"Times New Roman\"", "none", "expanded"},
1413             FF = {"normal", "normal", "400", "16px", "normal", "serif", "none", "expanded"},
1414             FF_ESR = {"normal", "normal", "400", "16px", "normal", "serif", "none", "expanded"})
1415     public void fontComputedStretchAfter() throws Exception {
1416         fontComputed("14pX sAns-serif; font-stretch: expanded", "");
1417     }
1418 
1419     private void fontComputed(final String fontStyle) throws Exception {
1420         final String html = DOCTYPE_HTML
1421                 + "<html>\n"
1422                 + "</head>\n"
1423                 + "  <style type='text/css'>div { font: " + fontStyle + " }</style>\n"
1424                 + "</head>\n"
1425                 + "<body>\n"
1426                 + "  <div id='tester'>hello</div>\n"
1427                 + "  <script>\n"
1428                 + LOG_TITLE_FUNCTION
1429                 + "    var myDiv = document.getElementById('tester');\n"
1430                 + "    var myStyle = window.getComputedStyle(myDiv, null);\n"
1431                 + "    log(myStyle.fontStyle);\n"
1432                 + "    log(myStyle.fontVariant);\n"
1433                 + "    log(myStyle.fontWeight);\n"
1434                 + "    log(myStyle.fontSize);\n"
1435                 + "    log(myStyle.lineHeight);\n"
1436                 + "    log(myStyle.fontFamily);\n"
1437                 + "  </script>\n"
1438                 + "</body></html>";
1439 
1440         loadPageVerifyTitle2(html);
1441     }
1442 
1443     private void fontComputed(final String fontStyle, final String otherStyle) throws Exception {
1444         final String html = DOCTYPE_HTML
1445             + "<html>\n"
1446             + "</head>\n"
1447             + "  <style type='text/css'>div { " + otherStyle + "; font: " + fontStyle + " }</style>\n"
1448             + "</head>\n"
1449             + "<body>\n"
1450             + "  <div id='tester'>hello</div>\n"
1451             + "  <script>\n"
1452             + LOG_TITLE_FUNCTION
1453             + "    var myDiv = document.getElementById('tester');\n"
1454             + "    var myStyle = window.getComputedStyle(myDiv, null);\n"
1455             + "    log(myStyle.fontStyle);\n"
1456             + "    log(myStyle.fontVariant);\n"
1457             + "    log(myStyle.fontWeight);\n"
1458             + "    log(myStyle.fontSize);\n"
1459             + "    log(myStyle.lineHeight);\n"
1460             + "    log(myStyle.fontFamily);\n"
1461             + "    log(myStyle.fontSizeAdjust);\n"
1462             + "    log(myStyle.fontStretch);\n"
1463             + "  </script>\n"
1464             + "</body></html>";
1465 
1466         loadPageVerifyTitle2(html);
1467     }
1468 
1469     /**
1470      * @throws Exception if the test fails
1471      */
1472     @Test
1473     @Alerts({"", "", "", "", "", "", "", "", "", "", "", ""})
1474     public void borderEmpty() throws Exception {
1475         border("");
1476     }
1477 
1478     /**
1479      * @throws Exception if the test fails
1480      */
1481     @Test
1482     @Alerts(DEFAULT = {"thin", "thin", "thin", "thin", "initial", "initial", "initial", "initial",
1483                        "initial", "initial", "initial", "initial"},
1484             FF = {"thin", "thin", "thin", "thin", "none", "none", "none", "none",
1485                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1486             FF_ESR = {"thin", "thin", "thin", "thin", "none", "none", "none", "none",
1487                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1488     @HtmlUnitNYI(CHROME = {"thin", "thin", "thin", "thin", "", "", "", "", "", "", "", ""},
1489             EDGE = {"thin", "thin", "thin", "thin", "", "", "", "", "", "", "", ""},
1490             FF = {"thin", "thin", "thin", "thin", "", "", "", "", "", "", "", ""},
1491             FF_ESR = {"thin", "thin", "thin", "thin", "", "", "", "", "", "", "", ""})
1492     public void borderWidth() throws Exception {
1493         border("tHin");
1494     }
1495 
1496     /**
1497      * @throws Exception if the test fails
1498      */
1499     @Test
1500     @Alerts(DEFAULT = {"2px", "2px", "2px", "2px", "initial", "initial", "initial", "initial",
1501                        "initial", "initial", "initial", "initial"},
1502             FF = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1503                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1504             FF_ESR = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1505                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1506     @HtmlUnitNYI(CHROME = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""},
1507             EDGE = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""},
1508             FF = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""},
1509             FF_ESR = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""})
1510     public void borderWidthNumber() throws Exception {
1511         border("2pX");
1512     }
1513 
1514     /**
1515      * @throws Exception if the test fails
1516      */
1517     @Test
1518     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "solid", "solid", "solid", "solid",
1519                        "initial", "initial", "initial", "initial"},
1520             FF = {"medium", "medium", "medium", "medium", "solid", "solid", "solid", "solid",
1521                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1522             FF_ESR = {"medium", "medium", "medium", "medium", "solid", "solid", "solid", "solid",
1523                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1524     @HtmlUnitNYI(CHROME = {"", "", "", "", "solid", "solid", "solid", "solid", "", "", "", ""},
1525             EDGE = {"", "", "", "", "solid", "solid", "solid", "solid", "", "", "", ""},
1526             FF = {"", "", "", "", "solid", "solid", "solid", "solid", "", "", "", ""},
1527             FF_ESR = {"", "", "", "", "solid", "solid", "solid", "solid", "", "", "", ""})
1528     public void borderStyle() throws Exception {
1529         border("sOlid");
1530     }
1531 
1532     /**
1533      * @throws Exception if the test fails
1534      */
1535     @Test
1536     @Alerts(DEFAULT = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1537                        "initial", "initial", "initial", "initial"},
1538             FF = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1539                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1540             FF_ESR = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1541                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1542     @HtmlUnitNYI(CHROME = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid", "", "", "", ""},
1543             EDGE = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid", "", "", "", ""},
1544             FF = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid", "", "", "", ""},
1545             FF_ESR = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid", "", "", "", ""})
1546     public void borderWidthAndStyle() throws Exception {
1547         border("tHin sOlid");
1548     }
1549 
1550     /**
1551      * @throws Exception if the test fails
1552      */
1553     @Test
1554     @Alerts(DEFAULT = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid",
1555                        "initial", "initial", "initial", "initial"},
1556             FF = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid",
1557                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1558             FF_ESR = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid",
1559                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1560     @HtmlUnitNYI(CHROME = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid", "", "", "", ""},
1561             EDGE = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid", "", "", "", ""},
1562             FF = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid", "", "", "", ""},
1563             FF_ESR = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid", "", "", "", ""})
1564     public void borderWidthNumberAndStyle() throws Exception {
1565         border("2pX sOlid");
1566     }
1567 
1568     /**
1569      * @throws Exception if the test fails
1570      */
1571     @Test
1572     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1573                        "red", "red", "red", "red"},
1574             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1575                   "red", "red", "red", "red"},
1576             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1577                       "red", "red", "red", "red"})
1578     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "", "red", "red", "red", "red"},
1579             EDGE = {"", "", "", "", "", "", "", "", "red", "red", "red", "red"},
1580             FF = {"", "", "", "", "", "", "", "", "red", "red", "red", "red"},
1581             FF_ESR = {"", "", "", "", "", "", "", "", "red", "red", "red", "red"})
1582     public void borderColor() throws Exception {
1583         border("rEd");
1584     }
1585 
1586     /**
1587      * @throws Exception if the test fails
1588      */
1589     @Test
1590     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1591                        "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1592             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1593                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1594             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1595                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1596     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "",
1597                            "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1598             EDGE = {"", "", "", "", "", "", "", "",
1599                     "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1600             FF = {"", "", "", "", "", "", "", "",
1601                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1602             FF_ESR = {"", "", "", "", "", "", "", "",
1603                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1604     public void borderColorHex() throws Exception {
1605         border("#fFccdd");
1606     }
1607 
1608     /**
1609      * @throws Exception if the test fails
1610      */
1611     @Test
1612     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1613                        "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1614             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1615                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1616             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1617                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1618     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "",
1619                            "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1620             EDGE = {"", "", "", "", "", "", "", "",
1621                     "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1622             FF = {"", "", "", "", "", "", "", "",
1623                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1624             FF_ESR = {"", "", "", "", "", "", "", "",
1625                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1626     public void borderColorHexShort() throws Exception {
1627         border("#fCd");
1628     }
1629 
1630     /**
1631      * @throws Exception if the test fails
1632      */
1633     @Test
1634     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1635                        "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1636             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1637                   "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1638             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1639                       "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"})
1640     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "",
1641                            "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1642             EDGE = {"", "", "", "", "", "", "", "",
1643                     "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1644             FF = {"", "", "", "", "", "", "", "",
1645                   "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1646             FF_ESR = {"", "", "", "", "", "", "", "",
1647                       "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"})
1648     public void borderColorRgb() throws Exception {
1649         border("rGb(20, 40, 60)");
1650     }
1651 
1652     /**
1653      * @throws Exception if the test fails
1654      */
1655     @Test
1656     @Alerts({"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1657              "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1658     public void borderAll() throws Exception {
1659         border("tHin sOlid #fFccdd");
1660     }
1661 
1662     private void border(final String borderStyle) throws Exception {
1663         final String html = DOCTYPE_HTML
1664             + "<html>\n"
1665             + "<body>\n"
1666             + "  <div id='tester' style='border: " + borderStyle + "' >hello</div>\n"
1667             + "  <script>\n"
1668             + LOG_TITLE_FUNCTION
1669             + "    var myStyle = document.getElementById('tester').style;\n"
1670             + "    log(myStyle.borderTopWidth);\n"
1671             + "    log(myStyle.borderRightWidth);\n"
1672             + "    log(myStyle.borderBottomWidth);\n"
1673             + "    log(myStyle.borderLeftWidth);\n"
1674             + "    log(myStyle.borderTopStyle);\n"
1675             + "    log(myStyle.borderRightStyle);\n"
1676             + "    log(myStyle.borderBottomStyle);\n"
1677             + "    log(myStyle.borderLeftStyle);\n"
1678             + "    log(myStyle.borderTopColor);\n"
1679             + "    log(myStyle.borderRightColor);\n"
1680             + "    log(myStyle.borderBottomColor);\n"
1681             + "    log(myStyle.borderLeftColor);\n"
1682             + "  </script>\n"
1683             + "</body></html>";
1684 
1685         getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML);
1686 
1687         loadPageVerifyTitle2(html);
1688     }
1689 
1690     /**
1691      * @throws Exception if the test fails
1692      */
1693     @Test
1694     @Alerts({"", "", "", "", "", "", "", "", "", "", "", ""})
1695     public void borderCssEmpty() throws Exception {
1696         borderCss("");
1697     }
1698 
1699     /**
1700      * @throws Exception if the test fails
1701      */
1702     @Test
1703     @Alerts(DEFAULT = {"thin", "thin", "thin", "thin", "initial", "initial", "initial", "initial",
1704                        "initial", "initial", "initial", "initial"},
1705             FF = {"thin", "thin", "thin", "thin", "none", "none", "none", "none",
1706                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1707             FF_ESR = {"thin", "thin", "thin", "thin", "none", "none", "none", "none",
1708                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1709     @HtmlUnitNYI(CHROME = {"tHin", "tHin", "tHin", "tHin", "", "", "", "", "", "", "", ""},
1710             EDGE = {"tHin", "tHin", "tHin", "tHin", "", "", "", "", "", "", "", ""},
1711             FF = {"tHin", "tHin", "tHin", "tHin", "", "", "", "", "", "", "", ""},
1712             FF_ESR = {"tHin", "tHin", "tHin", "tHin", "", "", "", "", "", "", "", ""})
1713     public void borderCssWidth() throws Exception {
1714         borderCss("tHin");
1715     }
1716 
1717     /**
1718      * @throws Exception if the test fails
1719      */
1720     @Test
1721     @Alerts(DEFAULT = {"2px", "2px", "2px", "2px", "initial", "initial", "initial", "initial",
1722                        "initial", "initial", "initial", "initial"},
1723             FF = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1724                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1725             FF_ESR = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1726                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1727     @HtmlUnitNYI(CHROME = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""},
1728             EDGE = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""},
1729             FF = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""},
1730             FF_ESR = {"2px", "2px", "2px", "2px", "", "", "", "", "", "", "", ""})
1731     public void borderCssWidthNumber() throws Exception {
1732         borderCss("2pX");
1733     }
1734 
1735     /**
1736      * @throws Exception if the test fails
1737      */
1738     @Test
1739     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "solid", "solid", "solid", "solid",
1740                        "initial", "initial", "initial", "initial"},
1741             FF = {"medium", "medium", "medium", "medium", "solid", "solid", "solid", "solid",
1742                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1743             FF_ESR = {"medium", "medium", "medium", "medium", "solid", "solid", "solid", "solid",
1744                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1745     @HtmlUnitNYI(CHROME = {"", "", "", "", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1746             EDGE = {"", "", "", "", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1747             FF = {"", "", "", "", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1748             FF_ESR = {"", "", "", "", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""})
1749     public void borderCssStyle() throws Exception {
1750         borderCss("sOlid");
1751     }
1752 
1753     /**
1754      * @throws Exception if the test fails
1755      */
1756     @Test
1757     @Alerts(DEFAULT = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1758                        "initial", "initial", "initial", "initial"},
1759             FF = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1760                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1761             FF_ESR = {"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1762                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1763     @HtmlUnitNYI(CHROME = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1764             EDGE = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1765             FF = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1766             FF_ESR = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""})
1767     public void borderCssWidthAndStyle() throws Exception {
1768         borderCss("tHin sOlid");
1769     }
1770 
1771     /**
1772      * @throws Exception if the test fails
1773      */
1774     @Test
1775     @Alerts(DEFAULT = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid",
1776                        "initial", "initial", "initial", "initial"},
1777             FF = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid",
1778                   "currentcolor", "currentcolor", "currentcolor", "currentcolor"},
1779             FF_ESR = {"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid",
1780                       "currentcolor", "currentcolor", "currentcolor", "currentcolor"})
1781     @HtmlUnitNYI(CHROME = {"2px", "2px", "2px", "2px", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1782             EDGE = {"2px", "2px", "2px", "2px", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1783             FF = {"2px", "2px", "2px", "2px", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""},
1784             FF_ESR = {"2px", "2px", "2px", "2px", "sOlid", "sOlid", "sOlid", "sOlid", "", "", "", ""})
1785     public void borderCssWidthNumberAndStyle() throws Exception {
1786         borderCss("2pX sOlid");
1787     }
1788 
1789     /**
1790      * @throws Exception if the test fails
1791      */
1792     @Test
1793     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1794                        "red", "red", "red", "red"},
1795             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1796                   "red", "red", "red", "red"},
1797             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1798                       "red", "red", "red", "red"})
1799     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "", "rEd", "rEd", "rEd", "rEd"},
1800             EDGE = {"", "", "", "", "", "", "", "", "rEd", "rEd", "rEd", "rEd"},
1801             FF = {"", "", "", "", "", "", "", "", "rEd", "rEd", "rEd", "rEd"},
1802             FF_ESR = {"", "", "", "", "", "", "", "", "rEd", "rEd", "rEd", "rEd"})
1803     public void borderCssColor() throws Exception {
1804         borderCss("rEd");
1805     }
1806 
1807     /**
1808      * @throws Exception if the test fails
1809      */
1810     @Test
1811     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1812                        "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1813             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1814                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1815             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1816                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1817     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "",
1818                            "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1819             EDGE = {"", "", "", "", "", "", "", "",
1820                     "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1821             FF = {"", "", "", "", "", "", "", "",
1822                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1823             FF_ESR = {"", "", "", "", "", "", "", "",
1824                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1825     public void borderCssColorHex() throws Exception {
1826         borderCss("#fFccdd");
1827     }
1828 
1829     /**
1830      * @throws Exception if the test fails
1831      */
1832     @Test
1833     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1834                        "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1835             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1836                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1837             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1838                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1839     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "",
1840                            "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1841             EDGE = {"", "", "", "", "", "", "", "",
1842                     "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1843             FF = {"", "", "", "", "", "", "", "",
1844                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1845             FF_ESR = {"", "", "", "", "", "", "", "",
1846                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1847     public void borderCssColorHexShort() throws Exception {
1848         borderCss("#fCd");
1849     }
1850 
1851     /**
1852      * @throws Exception if the test fails
1853      */
1854     @Test
1855     @Alerts(DEFAULT = {"initial", "initial", "initial", "initial", "initial", "initial", "initial", "initial",
1856                        "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1857             FF = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1858                   "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1859             FF_ESR = {"medium", "medium", "medium", "medium", "none", "none", "none", "none",
1860                       "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"})
1861     @HtmlUnitNYI(CHROME = {"", "", "", "", "", "", "", "",
1862                            "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1863             EDGE = {"", "", "", "", "", "", "", "",
1864                     "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1865             FF = {"", "", "", "", "", "", "", "",
1866                   "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"},
1867             FF_ESR = {"", "", "", "", "", "", "", "",
1868                       "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"})
1869     public void borderCssColorRgb() throws Exception {
1870         borderCss("rGb(20, 40, 60)");
1871     }
1872 
1873     /**
1874      * @throws Exception if the test fails
1875      */
1876     @Test
1877     @Alerts({"thin", "thin", "thin", "thin", "solid", "solid", "solid", "solid",
1878              "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1879     @HtmlUnitNYI(CHROME = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid",
1880                            "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1881             EDGE = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid",
1882                     "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1883             FF = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid",
1884                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
1885             FF_ESR = {"tHin", "tHin", "tHin", "tHin", "sOlid", "sOlid", "sOlid", "sOlid",
1886                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
1887     public void borderCssAll() throws Exception {
1888         borderCss("tHin sOlid #fFccdd");
1889     }
1890 
1891     private void borderCss(final String borderStyle) throws Exception {
1892         final String html = DOCTYPE_HTML
1893             + "<html>\n"
1894             + "</head>\n"
1895             + "  <style type='text/css'>div { border: " + borderStyle + " }</style>\n"
1896             + "</head>\n"
1897             + "<body>\n"
1898             + "  <div id='tester'>hello</div>\n"
1899             + "  <script>\n"
1900             + LOG_TITLE_FUNCTION
1901             + "    var myStyle = document.styleSheets[0].cssRules[0].style;\n"
1902             + "    log(myStyle.borderTopWidth);\n"
1903             + "    log(myStyle.borderRightWidth);\n"
1904             + "    log(myStyle.borderBottomWidth);\n"
1905             + "    log(myStyle.borderLeftWidth);\n"
1906             + "    log(myStyle.borderTopStyle);\n"
1907             + "    log(myStyle.borderRightStyle);\n"
1908             + "    log(myStyle.borderBottomStyle);\n"
1909             + "    log(myStyle.borderLeftStyle);\n"
1910             + "    log(myStyle.borderTopColor);\n"
1911             + "    log(myStyle.borderRightColor);\n"
1912             + "    log(myStyle.borderBottomColor);\n"
1913             + "    log(myStyle.borderLeftColor);\n"
1914             + "  </script>\n"
1915             + "</body></html>";
1916 
1917         getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML);
1918 
1919         loadPageVerifyTitle2(html);
1920     }
1921 
1922     /**
1923      * @throws Exception if the test fails
1924      */
1925     @Test
1926     @Alerts({"0px", "0px", "0px", "0px", "none", "none", "none", "none",
1927              "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1928     public void borderComputedEmpty() throws Exception {
1929         borderComputed("");
1930     }
1931 
1932     /**
1933      * @throws Exception if the test fails
1934      */
1935     @Test
1936     @Alerts({"0px", "0px", "0px", "0px", "none", "none", "none", "none",
1937              "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1938     public void borderComputedWidth() throws Exception {
1939         borderComputed("tHin");
1940     }
1941 
1942     /**
1943      * @throws Exception if the test fails
1944      */
1945     @Test
1946     @Alerts({"0px", "0px", "0px", "0px", "none", "none", "none", "none",
1947              "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1948     @HtmlUnitNYI(CHROME = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1949                            "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1950             EDGE = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1951                     "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1952             FF = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1953                   "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1954             FF_ESR = {"2px", "2px", "2px", "2px", "none", "none", "none", "none",
1955                       "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1956     public void borderComputedWidthNumber() throws Exception {
1957         borderComputed("2pX");
1958     }
1959 
1960     /**
1961      * @throws Exception if the test fails
1962      */
1963     @Test
1964     @Alerts({"3px", "3px", "3px", "3px", "solid", "solid", "solid", "solid",
1965              "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1966     @HtmlUnitNYI(CHROME = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1967                            "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1968             EDGE = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1969                     "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1970             FF = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1971                   "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1972             FF_ESR = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1973                       "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1974     public void borderComputedStyle() throws Exception {
1975         borderComputed("sOlid");
1976     }
1977 
1978     /**
1979      * @throws Exception if the test fails
1980      */
1981     @Test
1982     @Alerts({"1px", "1px", "1px", "1px", "solid", "solid", "solid", "solid",
1983              "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1984     @HtmlUnitNYI(CHROME = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1985                            "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1986             EDGE = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1987                     "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1988             FF = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1989                   "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"},
1990             FF_ESR = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
1991                       "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
1992     public void borderComputedWidthAndStyle() throws Exception {
1993         borderComputed("tHin sOlid");
1994     }
1995 
1996     /**
1997      * @throws Exception if the test fails
1998      */
1999     @Test
2000     @Alerts({"2px", "2px", "2px", "2px", "solid", "solid", "solid", "solid",
2001              "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)"})
2002     public void borderComputedWidthNumberAndStyle() throws Exception {
2003         borderComputed("2pX sOlid");
2004     }
2005 
2006     /**
2007      * @throws Exception if the test fails
2008      */
2009     @Test
2010     @Alerts({"0px", "0px", "0px", "0px", "none", "none", "none", "none",
2011              "rgb(255, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 0, 0)"})
2012     @HtmlUnitNYI(CHROME = {"0px", "0px", "0px", "0px", "none", "none", "none", "none", "red", "red", "red", "red"},
2013             EDGE = {"0px", "0px", "0px", "0px", "none", "none", "none", "none", "red", "red", "red", "red"},
2014             FF = {"0px", "0px", "0px", "0px", "none", "none", "none", "none", "red", "red", "red", "red"},
2015             FF_ESR = {"0px", "0px", "0px", "0px", "none", "none", "none", "none", "red", "red", "red", "red"})
2016     public void borderComputedColor() throws Exception {
2017         borderComputed("rEd");
2018     }
2019 
2020     /**
2021      * @throws Exception if the test fails
2022      */
2023     @Test
2024     @Alerts({"0px", "0px", "0px", "0px", "none", "none", "none", "none",
2025              "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
2026     public void borderComputedColorHex() throws Exception {
2027         borderComputed("#fFccdd");
2028     }
2029 
2030     /**
2031      * @throws Exception if the test fails
2032      */
2033     @Test
2034     @Alerts({"0px", "0px", "0px", "0px", "none", "none", "none", "none",
2035              "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
2036     public void borderComputedColorHexShort() throws Exception {
2037         borderComputed("#fCd");
2038     }
2039 
2040     /**
2041      * @throws Exception if the test fails
2042      */
2043     @Test
2044     @Alerts({"0px", "0px", "0px", "0px", "none", "none", "none", "none",
2045              "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)", "rgb(20, 40, 60)"})
2046     public void borderComputedColorRgb() throws Exception {
2047         borderComputed("rGb(20, 40, 60)");
2048     }
2049 
2050     /**
2051      * @throws Exception if the test fails
2052      */
2053     @Test
2054     @Alerts({"1px", "1px", "1px", "1px", "solid", "solid", "solid", "solid",
2055              "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
2056     @HtmlUnitNYI(CHROME = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
2057                            "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
2058             EDGE = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
2059                     "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
2060             FF = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
2061                   "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"},
2062             FF_ESR = {"0px", "0px", "0px", "0px", "solid", "solid", "solid", "solid",
2063                       "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)", "rgb(255, 204, 221)"})
2064     public void borderComputedAll() throws Exception {
2065         borderComputed("tHin sOlid #fFccdd");
2066     }
2067 
2068     private void borderComputed(final String borderStyle) throws Exception {
2069         final String html = DOCTYPE_HTML
2070             + "<html>\n"
2071             + "</head>\n"
2072             + "  <style type='text/css'>div { border: " + borderStyle + " }</style>\n"
2073             + "</head>\n"
2074             + "<body>\n"
2075             + "  <div id='tester'>hello</div>\n"
2076             + "  <script>\n"
2077             + LOG_TITLE_FUNCTION
2078             + "    var myDiv = document.getElementById('tester');\n"
2079             + "    var myStyle = window.getComputedStyle(myDiv, null);\n"
2080             + "    log(myStyle.borderTopWidth);\n"
2081             + "    log(myStyle.borderRightWidth);\n"
2082             + "    log(myStyle.borderBottomWidth);\n"
2083             + "    log(myStyle.borderLeftWidth);\n"
2084             + "    log(myStyle.borderTopStyle);\n"
2085             + "    log(myStyle.borderRightStyle);\n"
2086             + "    log(myStyle.borderBottomStyle);\n"
2087             + "    log(myStyle.borderLeftStyle);\n"
2088             + "    log(myStyle.borderTopColor);\n"
2089             + "    log(myStyle.borderRightColor);\n"
2090             + "    log(myStyle.borderBottomColor);\n"
2091             + "    log(myStyle.borderLeftColor);\n"
2092             + "  </script>\n"
2093             + "</body></html>";
2094 
2095         getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML);
2096 
2097         loadPageVerifyTitle2(html);
2098     }
2099 
2100 }