(intersection-observer) Firefox doesn't accept unitless rootMargin
Categories
(Core :: Layout, defect)
Tracking
()
People
(Reporter: mark, Unassigned)
References
Details
Firefox doesn't accept unitless rootMargin attributes when creating intersection observers.
Unlike any other dimension values where unitless numbers default to the equivalent number of pixels, Firefox instead throws an error.
Confusingly, passing an empty string "" or just whitespace is accepted as meaning "0px", but "0" isn't. This seems to be terribly inconsistent and prone to breakage.
Comment 1•3 years ago
|
||
This is the same across browsers afaict, and is per spec. The spec issue is https://github.com/w3c/IntersectionObserver/issues/244
| Reporter | ||
Comment 2•3 years ago
|
||
Well, it seems to be clear to me that the spec needs to change then.
It's madness that "" = 0px, but "0" != 0px and throws. Either empty strings need to also be throwing, or unit-less dimensions need to be accepted just like for margin.
Description
•