@@ -1785,44 +1785,6 @@ BrowserBot.prototype.replaceText = function(element, stringValue) {
17851785 } catch ( e ) { } // eslint-disable-line no-empty
17861786} ;
17871787
1788- BrowserBot . prototype . submit = function ( formElement ) {
1789- let actuallySubmit = true ;
1790- this . _modifyElementTarget ( formElement ) ;
1791-
1792- if ( formElement . onsubmit ) {
1793- if ( browserVersion . isHTA ) {
1794- // run the code in the correct window so alerts are handled correctly even in HTA mode
1795- let win = this . browserbot . getCurrentWindow ( ) ;
1796- let now = new Date ( ) . getTime ( ) ;
1797- let marker = "marker" + now ;
1798- win [ marker ] = formElement ;
1799- win . setTimeout ( "var actuallySubmit = " + marker + ".onsubmit();" +
1800- "if (actuallySubmit) { " +
1801- marker + ".submit(); " +
1802- "if (" + marker + ".target && !/^_/.test(" + marker + ".target)) {" +
1803- "window.open('', " + marker + ".target);" +
1804- "}" +
1805- "};" +
1806- marker + "=null" , 0 ) ;
1807- // pause for up to 2s while this command runs
1808- let terminationCondition = function ( ) {
1809- return ! win [ marker ] ;
1810- } ;
1811- return Selenium . decorateFunctionWithTimeout ( terminationCondition , 2000 ) ;
1812- } else {
1813- actuallySubmit = formElement . onsubmit ( ) ;
1814- if ( actuallySubmit ) {
1815- formElement . submit ( ) ;
1816- if ( formElement . target && ! / ^ _ / . test ( formElement . target ) ) {
1817- this . browserbot . openWindow ( "" , formElement . target ) ;
1818- }
1819- }
1820- }
1821- } else {
1822- formElement . submit ( ) ;
1823- }
1824- } ;
1825-
18261788BrowserBot . prototype . clickElement = function ( element , clientX , clientY ) {
18271789 this . _fireEventOnElement ( "click" , element , clientX , clientY ) ;
18281790} ;
0 commit comments