Permalink
Browse files

Fixes #2113.

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...
1 parent 2c3f288 commit 0ecfdbebf3d20fea5b9c1fdcedce167346253186 @ibolmo ibolmo committed Nov 29, 2011
Showing with 10 additions and 1 deletion.
  1. +9 −0 Source/Element/Element.js
  2. +1 −1 Specs
@@ -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({
2 Specs

0 comments on commit 0ecfdbe

Please sign in to comment.