]> source.dussan.org Git - jquery.git/commitdiff
Add support for the contenteditable attribute
authortimmywil <tim.willison@thisismedium.com>
Thu, 5 May 2011 16:52:04 +0000 (12:52 -0400)
committertimmywil <tim.willison@thisismedium.com>
Thu, 5 May 2011 16:52:04 +0000 (12:52 -0400)
src/attributes.js
test/unit/attributes.js

index c869163105e6b9ffa0c53fd054fac5636228f35f..a058a82b9012d80125c302dce4ee61e011ae9cb0 100644 (file)
@@ -414,7 +414,8 @@ jQuery.extend({
                rowspan: "rowSpan",
                colspan: "colSpan",
                usemap: "useMap",
-               frameborder: "frameBorder"
+               frameborder: "frameBorder",
+               contenteditable: "contentEditable"
        },
        
        prop: function( elem, name, value ) {
index 5f35e94824ebd70618fdd849a42d261fef91574a..257d02d09e6d05b861ce9a9757d509d6a84595ec 100644 (file)
@@ -22,7 +22,8 @@ test("jQuery.attrFix/jQuery.propFix integrity test", function() {
                        rowspan: "rowSpan",
                        colspan: "colSpan",
                        usemap: "useMap",
-                       frameborder: "frameBorder"
+                       frameborder: "frameBorder",
+                       contenteditable: "contentEditable"
                },
                propsShouldBe;
 
@@ -143,7 +144,7 @@ test("attr(Hash)", function() {
 });
 
 test("attr(String, Object)", function() {
-       expect(56);
+       expect(57);
 
        var div = jQuery("div").attr("foo", "bar"),
                fail = false;
@@ -215,6 +216,9 @@ test("attr(String, Object)", function() {
        equals( $text.attr("aria-disabled", false).attr("aria-disabled"), "false", "Setting aria attributes are not affected by boolean settings");
        $text.removeData("something").removeData("another").removeAttr("aria-disabled");
 
+       jQuery("#foo").attr("contenteditable", true);
+       equals( jQuery("#foo").attr("contenteditable"), "true", "Enumerated attributes are set properly" );
+
        var attributeNode = document.createAttribute("irrelevant"),
                commentNode = document.createComment("some comment"),
                textNode = document.createTextNode("some text");