How to tell if a DOM element is visible in the current viewport?


Is there an efficient way to tell if a DOM element (in an HTML document) is currently visible (appears in the viewport)?

(The question refers to Firefox)