38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
This test checks if offsetParent is always null when accessed from the HTML <body> and from elements with CSS property position:fixed. To ensure values match layout, this test also checks offsetTop and offsetLeft.
|
|
|
|
In addition to the HTML <body>, two elements with CSS property position:fixed are tested: One within the body, and one within an element with CSS property position:absolute.
|
|
|
|
Finally, a static- and relative-positioned element are tested for sanity and spec adherence.
|
|
|
|
Expected values are parenthesized. Test has passed if all values match.
|
|
|
|
First Fixed offsetParent (null): null
|
|
|
|
First Fixed offsetTop (10): 10
|
|
|
|
First Fixed offsetLeft (20): 20
|
|
|
|
Second Fixed offsetParent (null): null
|
|
|
|
Second Fixed offsetTop (15): 15
|
|
|
|
Second Fixed offsetLeft (30): 30
|
|
|
|
Body offsetParent (null): null
|
|
|
|
Body offsetTop (0): 0
|
|
|
|
Body offsetLeft (0): 0
|
|
|
|
Static offsetParent ([object HTMLBodyElement]): [object HTMLBodyElement]
|
|
|
|
Static offsetTop (15): 15
|
|
|
|
Static offsetLeft (15): 15
|
|
|
|
Relative offsetParent ([object HTMLBodyElement]): [object HTMLBodyElement]
|
|
|
|
Relative offsetTop (13): 13
|
|
|
|
Relative offsetLeft (19): 19
|