Merge pull request #1005 from jjt/boolattr

Fix boolean attributes as per HTML5 spec
This commit is contained in:
Paul O’Shannessy
2014-02-03 18:17:46 -08:00
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',