How to find scrollable elements in DOM using XPath?

Posted by ak. on Stack Overflow See other posts from Stack Overflow or by ak.
Published on 2012-11-15T13:20:54Z Indexed on 2012/11/15 23:00 UTC
Read the original article Hit count: 237

Filed under:
|
|
|
|

Basically I need to find all elements on the page that have a scrollbar (vertical or horizontal)

How to tell if an element has a scrollbar and can actually be scrolled? I found this code snippet on jsperf. Is it possible to capture the logic behind the code into and XPath expression? Or are there any other ways to check for scrollbars?

Added:

Just to explain what I'm trying to do: I'm developing extension for Firefox. Basically it introduces Vim-style mouseless shortcuts (I know there is Vimperator and Pentadactyl...). One of the features I'd like to implement is to allow the use to select the container that's scrolled with j/k keys. That's why I need to discover all scrollable elements on any given random page.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about dom