w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.49k stars 662 forks source link

[cssom-view] HTMLElement offsetParent quirk? #1812

Open andrewplummer opened 7 years ago

andrewplummer commented 7 years ago

Apologies if this is not the right place to post this. Although I'm sure this spec is ancient, is it not incorrect to report <body> as an offsetParent when the body is statically positioned, as it is by default?

This can easily be seen as unexpected behavior by creating an absolutely positioned element with bottom in a long document. The element is clearly positioned relative to documentElement, not `body.

https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent

Loirooriol commented 7 years ago

The document element is also statically positioned by default.

andrewplummer commented 7 years ago

@Loirooriol Sorry, you appear to be correct, it's actually positioned relative to the viewport. In any case it doesn't seem to make sense to report body.