Skip to content

Commit

Permalink
Fixes #2113.
Browse files Browse the repository at this point in the history
Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=14439 prevents
button.type = 'button' from working as expected. Current solution is to
use setAttribute. This fix adds propertySetter.type with setAttribute
but only for webkit.
  • Loading branch information
ibolmo committed Nov 29, 2011
1 parent 2c3f288 commit 0ecfdbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Source/Element/Element.js
Expand Up @@ -576,6 +576,15 @@ propertyGetters['class'] = function(node){
return ('className' in node) ? node.className || null : node.getAttribute('class');
};

/* <webkit> */
var el = document.createElement('button');
// IE sets type as readonly and throws
try { el.type = 'button'; } catch(e){}
if (el.type != 'button') propertySetters.type = function(node, value){
node.setAttribute('type', value);
};
/* </webkit> */

/* getProperty, setProperty */

Element.implement({
Expand Down
2 changes: 1 addition & 1 deletion Specs
Submodule Specs updated 1 files
+8 −0 1.4client/Element/Element.js

0 comments on commit 0ecfdbe

Please sign in to comment.