X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=build%2Fruntest%2Fenv.js;h=23b413640f2d2c16e764d624b279b217c0ec71b8;hp=f4c54bb4bdf6dc7e1680d14e4347fe2962f547a5;hb=6f0c9a5fd751d590be07e890758b8229e630413d;hpb=52c6739c20838f2d705d404664dcc0cfa07f2c30 diff --git a/build/runtest/env.js b/build/runtest/env.js index f4c54bb..23b4136 100644 --- a/build/runtest/env.js +++ b/build/runtest/env.js @@ -305,6 +305,27 @@ var window = this; set checked(val) { return this.setAttribute("checked",val); }, get selected() { + if ( !this._selectDone ) { + this._selectDone = true; + + if ( this.nodeName == "OPTION" && !this.parentNode.getAttribute("multiple") ) { + var opt = this.parentNode.getElementsByTagName("option"); + + if ( this == opt[0] ) { + var select = true; + + for ( var i = 1; i < opt.length; i++ ) + if ( opt[i].selected ) { + select = false; + break; + } + + if ( select ) + this.selected = true; + } + } + } + var val = this.getAttribute("selected"); return val != "false" && !!val; },