Make a feature detect for the attribute selected code. Fixes #5702.

This commit is contained in:
jeresig 2009-12-22 15:46:54 -05:00
parent 7b0b348419
commit a00e63ea5a
2 changed files with 15 additions and 8 deletions

View file

@ -8,7 +8,7 @@
id = "script" + now();
div.style.display = "none";
div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><select><option>text</option></select><input type='checkbox'/>";
div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var all = div.getElementsByTagName("*"),
a = div.getElementsByTagName("a")[0];
@ -52,6 +52,10 @@
// (WebKit defaults to "" instead)
checkOn: div.getElementsByTagName("input")[0].value === "on",
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
// Will be defined later
scriptEval: false,
noCloneEvent: true,