diff options
Diffstat (limited to 'src/jqLite.js')
| -rw-r--r-- | src/jqLite.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jqLite.js b/src/jqLite.js index 387de47d..3e8fb266 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -365,8 +365,12 @@ forEach('input,select,option,textarea,button,form'.split(','), function(value) { BOOLEAN_ELEMENTS[uppercase(value)] = true; }); -function isBooleanAttr(element, name) { - return BOOLEAN_ELEMENTS[element.nodeName] && BOOLEAN_ATTR[name.toLowerCase()]; +function getBooleanAttrName(element, name) { + // check dom last since we will most likely fail on name + var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; + + // booleanAttr is here twice to minimize DOM access + return booleanAttr && BOOLEAN_ELEMENTS[element.nodeName] && booleanAttr; } forEach({ |
