@@ -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 "
0 commit comments