1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.html;
16
17 import org.htmlunit.WebDriverTestCase;
18 import org.htmlunit.junit.annotation.Alerts;
19 import org.junit.jupiter.api.Test;
20
21
22
23
24
25
26
27 public class HtmlRtTest extends WebDriverTestCase {
28
29
30
31
32 @Test
33 @Alerts(DEFAULT = {"", "inline", "ruby-text"},
34 FF = {"", "ruby-text", "ruby-text"},
35 FF_ESR = {"", "ruby-text", "ruby-text"})
36 public void defaultStyle() throws Exception {
37 final String html = DOCTYPE_HTML
38 + "<html><head>\n"
39 + "<script>\n"
40 + LOG_TITLE_FUNCTION
41 + " function test() {\n"
42 + " var e = document.createElement('rt');\n"
43 + " check(e);\n"
44 + " document.body.appendChild(e);\n"
45 + " check(e);\n"
46 + " check(document.getElementById('myId'));\n"
47 + " }\n"
48
49 + " function check(e) {\n"
50 + " var cs = window.getComputedStyle(e, null);\n"
51 + " var disp = cs ? cs.display : null;\n"
52 + " log(disp);\n"
53 + " }\n"
54 + "</script>\n"
55 + "</head><body onload='test()'>\n"
56 + "<ruby>\n"
57 + " <rt id='myId'></rt>\n"
58 + "</ruby>\n"
59 + "</body></html>";
60
61 loadPageVerifyTitle2(html);
62 }
63
64
65
66
67 @Test
68 @Alerts(DEFAULT = {"", "inline", "ruby-text"},
69 FF = {"", "ruby-text", "ruby-text"},
70 FF_ESR = {"", "ruby-text", "ruby-text"})
71 public void defaultStyleStandards() throws Exception {
72 final String html = DOCTYPE_HTML
73 + "<html><head>\n"
74 + "<script>\n"
75 + LOG_TITLE_FUNCTION
76 + " function test() {\n"
77 + " var e = document.createElement('rt');\n"
78 + " check(e);\n"
79 + " document.body.appendChild(e);\n"
80 + " check(e);\n"
81 + " check(document.getElementById('myId'));\n"
82 + " }\n"
83
84 + " function check(e) {\n"
85 + " var cs = window.getComputedStyle(e, null);\n"
86 + " var disp = cs ? cs.display : null;\n"
87 + " log(disp);\n"
88 + " }\n"
89 + "</script>\n"
90 + "</head><body onload='test()'>\n"
91 + "<ruby>\n"
92 + " <rt id='myId'></rt>\n"
93 + "</ruby>\n"
94 + "</body></html>";
95
96 loadPageVerifyTitle2(html);
97 }
98 }