@@ -328,8 +328,42 @@ public void offsetTopAndLeft_Nothing() throws Exception {
328
328
* @throws Exception if an error occurs
329
329
*/
330
330
@ Test
331
- @ Alerts ({"8 " , "8 " })
331
+ @ Alerts ({"50 " , "50 " })
332
332
public void offsetTopAndLeft_AbsolutelyPositioned () throws Exception {
333
+ final String html = DOCTYPE_HTML
334
+ + "<html>\n "
335
+ + " <head>\n "
336
+ + " <script>\n "
337
+ + LOG_TITLE_FUNCTION
338
+ + " function test() {\n "
339
+ + " var e = document.getElementById('d');\n "
340
+ + " log(e.offsetTop);\n "
341
+ + " log(e.offsetLeft);\n "
342
+ + " }\n "
343
+ + " </script>\n "
344
+ + " </head>\n "
345
+ + " <body onload='test()'>\n "
346
+ + " <div>\n "
347
+ + " <div>\n "
348
+ + " <div id='d' style='position:absolute; top:50px; left:50px;'>d</div>\n "
349
+ + " </div>\n "
350
+ + " </div>\n "
351
+ + " </body>\n "
352
+ + "</html>" ;
353
+ loadPageVerifyTitle2 (html );
354
+ }
355
+
356
+ /**
357
+ * @throws Exception if an error occurs
358
+ */
359
+ @ Test
360
+ @ Alerts ({"8" , "8" })
361
+ // so far we still support the quirks behaviour
362
+ @ HtmlUnitNYI (CHROME = {"50" , "50" },
363
+ EDGE = {"50" , "50" },
364
+ FF = {"50" , "50" },
365
+ FF_ESR = {"50" , "50" })
366
+ public void offsetTopAndLeft_AbsolutelyPositionedValueWithoutUnit () throws Exception {
333
367
final String html = DOCTYPE_HTML
334
368
+ "<html>\n "
335
369
+ " <head>\n "
@@ -561,6 +595,8 @@ public void offsetTopAndLeftWithRelativePosition() throws Exception {
561
595
@ Alerts (DEFAULT = {"" , "1240" , "" , "34" , "34" , "0" , "0" , "0" , "0" },
562
596
EDGE = {"" , "1232" , "" , "34" , "34" , "0" , "0" , "0" , "0" },
563
597
FF_ESR = {"" , "1244" , "" , "34" , "34" , "0" , "0" , "0" , "0" })
598
+ @ HtmlUnitNYI (EDGE = {"" , "1240" , "" , "34" , "34" , "0" , "0" , "0" , "0" },
599
+ FF_ESR = {"" , "1240" , "" , "34" , "34" , "0" , "0" , "0" , "0" })
564
600
public void offsetWidthAndHeight () throws Exception {
565
601
final String html = DOCTYPE_HTML
566
602
+ "<html><head>\n "
0 commit comments