from http://code.google.com/p/selenium/source/browse/#svn/trunk