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