Skip to content

Commit a678fb8

Browse files
committed
retested
1 parent f2fff35 commit a678fb8

File tree

3 files changed

+99
-31
lines changed

3 files changed

+99
-31
lines changed

src/test/java/org/htmlunit/javascript/host/Window2Test.java

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -955,17 +955,47 @@ public void IEScriptEngineXxx() throws Exception {
955955
* @throws Exception if the test fails
956956
*/
957957
@Test
958-
@Alerts(CHROME = {"true", "true", "147", "true", "true", "16"},
959-
EDGE = {"true", "true", "138", "true", "true", "24"},
960-
FF = {"true", "true", "93", "true", "true", "16"},
961-
FF_ESR = {"true", "true", "91", "true", "true", "12"})
958+
@Alerts(CHROME = {"true", "621", "147", "true", "16", "16"},
959+
EDGE = {"true", "630", "138", "true", "16", "24"},
960+
FF = {"true", "675", "93", "true", "16", "16"},
961+
FF_ESR = {"true", "677", "91", "true", "16", "12"})
962+
@HtmlUnitNYI(CHROME = {"true", "605", "147", "true", "0", "16"},
963+
EDGE = {"true", "605", "138", "true", "0", "24"},
964+
FF = {"true", "605", "93", "true", "0", "16"},
965+
FF_ESR = {"true", "605", "91", "true", "0", "12"})
962966
public void heightsAndWidths() throws Exception {
963967
final String html = DOCTYPE_HTML
964968
+ "<html><body onload='test()'><script>\n"
965969
+ LOG_TITLE_FUNCTION
966970
+ "function test() {\n"
967971
+ " log(window.innerHeight > 0);\n"
968-
+ " log(window.innerHeight == document.body.clientHeight);\n"
972+
+ " log(window.innerHeight - document.body.clientHeight);\n"
973+
+ " log(window.outerHeight - window.innerHeight);\n"
974+
+ " log(window.innerWidth > 0);\n"
975+
+ " log(window.innerWidth - document.body.clientWidth);\n"
976+
+ " log(window.outerWidth - window.innerWidth);\n"
977+
+ "}\n"
978+
+ "</script>\n"
979+
+ "</body></html>";
980+
loadPageVerifyTitle2(html);
981+
}
982+
983+
/**
984+
* Regression test for bug 2897473.
985+
* @throws Exception if the test fails
986+
*/
987+
@Test
988+
@Alerts(CHROME = {"true", "0", "147", "true", "true", "16"},
989+
EDGE = {"true", "0", "138", "true", "true", "24"},
990+
FF = {"true", "0", "93", "true", "true", "16"},
991+
FF_ESR = {"true", "0", "91", "true", "true", "12"})
992+
public void heightsAndWidthsQuirks() throws Exception {
993+
final String html =
994+
"<html><body onload='test()'><script>\n"
995+
+ LOG_TITLE_FUNCTION
996+
+ "function test() {\n"
997+
+ " log(window.innerHeight > 0);\n"
998+
+ " log(window.innerHeight - document.body.clientHeight);\n"
969999
+ " log(window.outerHeight - window.innerHeight);\n"
9701000
+ " log(window.innerWidth > 0);\n"
9711001
+ " log(window.innerWidth == document.body.clientWidth);\n"
@@ -1052,6 +1082,45 @@ public void setOuterHeight() throws Exception {
10521082
loadPageVerifyTitle2(html);
10531083
}
10541084

1085+
/**
1086+
* Regression test for bug 2944261.
1087+
* @throws Exception if the test fails
1088+
*/
1089+
@Test
1090+
@Alerts(CHROME = {"0", "1240", "100", "1240"},
1091+
EDGE = {"0", "1232", "100", "1232"},
1092+
FF = {"0", "1240", "100", "1240"},
1093+
FF_ESR = {"0", "1244", "100", "1244"})
1094+
@HtmlUnitNYI(CHROME = {"0", "1256", "100", "1256"},
1095+
EDGE = {"0", "1256", "100", "1256"},
1096+
FF = {"0", "1256", "100", "1256"},
1097+
FF_ESR = {"0", "1256", "100", "1256"})
1098+
// TODO width and height calculation needs to be reworked in HtmlUnit
1099+
// but as the calculation might be effected by e.g. current windows style it is not that simple
1100+
public void changeHeightsAndWidths() throws Exception {
1101+
final String html = DOCTYPE_HTML
1102+
+ "<html><head>\n"
1103+
+ "<script language='javascript'>\n"
1104+
+ LOG_TITLE_FUNCTION
1105+
+ " function test() {\n"
1106+
+ " var oldHeight = document.body.clientHeight;\n"
1107+
+ " var oldWidth = document.body.clientWidth;\n"
1108+
+ " log(document.body.clientHeight);\n"
1109+
+ " log(document.body.clientWidth);\n"
1110+
+ " newDiv = document.createElement('div');\n"
1111+
+ " document.body.appendChild(newDiv);\n"
1112+
+ " newDiv.style['height'] = oldHeight + 100 + 'px';\n"
1113+
+ " newDiv.style['width'] = oldWidth + 100 + 'px';\n"
1114+
+ " log(document.body.clientHeight);\n"
1115+
+ " log(document.body.clientWidth);\n"
1116+
+ " }\n"
1117+
+ "</script>\n"
1118+
+ "</head>\n"
1119+
+ "<body onload='test()'></body>\n"
1120+
+ "</html>";
1121+
loadPageVerifyTitle2(html);
1122+
}
1123+
10551124
/**
10561125
* Regression test for bug 2944261.
10571126
* @throws Exception if the test fails
@@ -1061,12 +1130,15 @@ public void setOuterHeight() throws Exception {
10611130
EDGE = {"630", "1248", "615", "1233"},
10621131
FF = {"675", "1256", "658", "1239"},
10631132
FF_ESR = {"677", "1260", "660", "1243"})
1064-
@NotYetImplemented
10651133
// TODO width and height calculation needs to be reworked in HtmlUnit
10661134
// but as the calculation might be effected by e.g. current windows style it is not that simple
1067-
public void changeHeightsAndWidths() throws Exception {
1068-
final String html = DOCTYPE_HTML
1069-
+ "<html><head>\n"
1135+
@HtmlUnitNYI(CHROME = {"605", "1256", "705", "1256"},
1136+
EDGE = {"605", "1256", "705", "1256"},
1137+
FF = {"605", "1256", "705", "1256"},
1138+
FF_ESR = {"605", "1256", "705", "1256"})
1139+
public void changeHeightsAndWidthsQuirks() throws Exception {
1140+
final String html =
1141+
"<html><head>\n"
10701142
+ "<script language='javascript'>\n"
10711143
+ LOG_TITLE_FUNCTION
10721144
+ " function test() {\n"

src/test/java/org/htmlunit/javascript/host/dom/DocumentTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3771,9 +3771,7 @@ public void newDoc() throws Exception {
37713771
EDGE = {"0", "0", "8", "1248"},
37723772
FF = {"0", "0", "8", "1256"},
37733773
FF_ESR = {"0", "0", "8", "1260"})
3774-
@HtmlUnitNYI(CHROME = {"0", "0", "8", "1256"},
3775-
EDGE = {"0", "0", "8", "1256"},
3776-
FF = {"0", "0", "8", "1256"},
3774+
@HtmlUnitNYI(EDGE = {"0", "0", "8", "1256"},
37773775
FF_ESR = {"0", "0", "8", "1256"})
37783776
public void documentElementBoundingClientRect() throws Exception {
37793777
final String html = DOCTYPE_HTML
@@ -3830,9 +3828,7 @@ public void documentElementBoundingClientRectQuirks() throws Exception {
38303828
EDGE = {"0", "0", "8", "1248"},
38313829
FF = {"0", "0", "8", "1256"},
38323830
FF_ESR = {"0", "0", "8", "1260"})
3833-
@HtmlUnitNYI(CHROME = {"0", "0", "8", "1256"},
3834-
EDGE = {"0", "0", "8", "1256"},
3835-
FF = {"0", "0", "8", "1256"},
3831+
@HtmlUnitNYI(EDGE = {"0", "0", "8", "1256"},
38363832
FF_ESR = {"0", "0", "8", "1256"})
38373833
public void documentElementOffset() throws Exception {
38383834
final String html = DOCTYPE_HTML

src/test/java/org/htmlunit/javascript/host/html/HTMLHtmlElementTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ public void innerText() throws Exception {
185185
@Alerts(DEFAULT = {"8", "16", "13", "0"},
186186
FF = {"8", "16", "0", "0"},
187187
FF_ESR = {"8", "16", "0", "0"})
188-
@HtmlUnitNYI(CHROME = {"613", "1256", "13", "0"},
189-
EDGE = {"613", "1256", "13", "0"},
190-
FF = {"613", "1256", "13", "0"},
191-
FF_ESR = {"613", "1256", "13", "0"})
188+
@HtmlUnitNYI(CHROME = {"8", "1256", "13", "0"},
189+
EDGE = {"8", "1256", "13", "0"},
190+
FF = {"8", "1256", "13", "0"},
191+
FF_ESR = {"8", "1256", "13", "0"})
192192
public void offsetsHtmlAbsoluteLeft() throws Exception {
193193
offsetsHtml("position: absolute; left: 13px;");
194194
}
@@ -205,10 +205,10 @@ public void offsetsHtmlAbsoluteLeft() throws Exception {
205205
EDGE = {"8", "16", "1219", "0"},
206206
FF = {"8", "16", "0", "0"},
207207
FF_ESR = {"8", "16", "0", "0"})
208-
@HtmlUnitNYI(CHROME = {"613", "1256", "1243", "0"},
209-
EDGE = {"613", "1256", "1243", "0"},
210-
FF = {"613", "1256", "1243", "0"},
211-
FF_ESR = {"613", "1256", "1243", "0"})
208+
@HtmlUnitNYI(CHROME = {"8", "1256", "1243", "0"},
209+
EDGE = {"8", "1256", "1243", "0"},
210+
FF = {"8", "1256", "1243", "0"},
211+
FF_ESR = {"8", "1256", "1243", "0"})
212212
public void offsetsHtmlAbsoluteRight() throws Exception {
213213
offsetsHtml("position: absolute; right: 13px;");
214214
}
@@ -222,10 +222,10 @@ public void offsetsHtmlAbsoluteRight() throws Exception {
222222
*/
223223
@Test
224224
@Alerts({"8", "16", "0", "0"})
225-
@HtmlUnitNYI(CHROME = {"613", "1256", "0", "0"},
226-
EDGE = {"613", "1256", "0", "0"},
227-
FF = {"613", "1256", "0", "0"},
228-
FF_ESR = {"613", "1256", "0", "0"})
225+
@HtmlUnitNYI(CHROME = {"8", "1256", "0", "0"},
226+
EDGE = {"8", "1256", "0", "0"},
227+
FF = {"8", "1256", "0", "0"},
228+
FF_ESR = {"8", "1256", "0", "0"})
229229
public void offsetsHtmlFixed() throws Exception {
230230
offsetsHtml("position: fixed;");
231231
}
@@ -242,10 +242,10 @@ public void offsetsHtmlFixed() throws Exception {
242242
EDGE = {"8", "16", "1219", "0"},
243243
FF = {"8", "16", "0", "0"},
244244
FF_ESR = {"8", "16", "0", "0"})
245-
@HtmlUnitNYI(CHROME = {"613", "1256", "1243", "0"},
246-
EDGE = {"613", "1256", "1243", "0"},
247-
FF = {"613", "1256", "1243", "0"},
248-
FF_ESR = {"613", "1256", "1243", "0"})
245+
@HtmlUnitNYI(CHROME = {"8", "1256", "1243", "0"},
246+
EDGE = {"8", "1256", "1243", "0"},
247+
FF = {"8", "1256", "1243", "0"},
248+
FF_ESR = {"8", "1256", "1243", "0"})
249249
public void offsetsHtmlFixedRight() throws Exception {
250250
offsetsHtml("position: fixed; right: 13px;");
251251
}

0 commit comments

Comments
 (0)