Fix boolean attributes as per HTML5 spec

This commit is contained in:
jjt
2014-01-31 17:24:48 -08:00
parent fce6d114fe
commit f7949c1c23
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -95,6 +95,9 @@ var DOMPropertyOperations = {
return '';
}
var attributeName = DOMProperty.getAttributeName[name];
if (DOMProperty.hasBooleanValue[name]) {
return escapeTextForBrowser(attributeName);
}
return processAttributeNameAndPrefix(attributeName) +
escapeTextForBrowser(value) + '"';
} else if (DOMProperty.isCustomAttribute(name)) {
@@ -82,12 +82,12 @@ describe('DOMPropertyOperations', function() {
expect(DOMPropertyOperations.createMarkupForProperty(
'checked',
'simple'
)).toBe('checked="simple"');
)).toBe('checked');
expect(DOMPropertyOperations.createMarkupForProperty(
'checked',
true
)).toBe('checked="true"');
)).toBe('checked');
expect(DOMPropertyOperations.createMarkupForProperty(
'checked',