Some times I need to know whether a element is visible. Looking in forums I got that a easy way to know this is getting the offsetParent (not null). But, sometimes, the parent exists but height and width is zero, resulting in a no visible element. Now I realize that there are situations in which the element is visible but client{Width,Height} properties are zero!!!
In this question (clientWidth and clientHeight report zero while getBoundingClientRect is correct), a new feature overcame to me: in order to these properties to work properly, the element need to be associated to a CSS layout box!
1.If the element has no associated CSS layout box or if the CSS layout box is inline, return zero.
How to know if a element is associated to CSS layout box?