marcj / css-element-queries

CSS Element-Queries aka Container Queries. High-speed element dimension/media queries in valid css.
http://marcj.github.io/css-element-queries/
MIT License
4.27k stars 487 forks source link

ResizeSensor.js optimization #172

Closed FranckFreiburger closed 7 years ago

FranckFreiburger commented 7 years ago

The aim of getComputedStyle(element, 'position') == 'static' is to detect that element is not "positioned".
HTMLElement.offsetParent returns the nearest positioned element in the containment hierarchy.
element.resizeSensor.offsetParent !== element mean that element is not positioned.
(see issue #164) Right ?

marcj commented 7 years ago

Very clever, thanks!