blob: b698d796e21fdecbcdf5f8b592e6469f57c3717d [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('HTMLTextAreaElement.wrap reflects the wrap="" attribute.<br>It is not "limited to only known values", and it is a DOMString attribute which means it just returns the content attributes\'s value directly.');
var textArea = document.createElement('textarea');
document.body.appendChild(textArea);
debug('If wrap attribute is not specified it sould be empty String.');
shouldBe('textArea.wrap', "''");
debug('');
debug('Check if it sets warpAttr value hard, should return hard.');
textArea.wrap = "hard";
shouldBe('textArea.wrap', "'hard'");
debug('');
debug('Check if it sets warpAttr value as soft, should return soft.');
textArea.wrap = "soft";
shouldBe('textArea.wrap', "'soft'");
debug('');
debug('Check if warpAttr present but no keyVal specified, should return empty String.');
textArea.wrap = "";
shouldBe('textArea.wrap', "''");
debug('');
debug('Check if it sets warpAttr invaild value, should return foo.');
textArea.wrap = "foo";
shouldBe('textArea.wrap', "'foo'");
debug('');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>