blob: b056a30e4eb399cd67cc3aa70fd7ab49b7c5b44f [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>
<div id="result"></div>
<div id="div1" contenteditable="false"></div>
<p id="p1" contenteditable="true"></p>
<div id="div2" contenteditable="true">
<p id="p2" contenteditable="false"></p>
</div>
<div id="div3" contenteditable="true">
<p id="p3" contenteditable="false"></p>
</div>
<script>
description('When contentEditable is set to a new value, the new value can be case-insensitive.')
document.getElementById("div1").contentEditable = "TRue";
document.getElementById("p1").contentEditable = "faLSE";
document.getElementById("p2").contentEditable = "inHERIT";
document.getElementById("div3").contentEditable = "PlainText-Only"
document.getElementById("p3").contentEditable = "Inherit"
shouldBe('document.getElementById("div1").getAttribute("contentEditable")','"true"');
shouldBe('document.getElementById("div1").contentEditable', '"true"');
shouldBe('document.getElementById("div1").isContentEditable', 'true');
debug("FIXME: isContentEditable is not working properly. Related to https://bugs.webkit.org/show_bug.cgi?id=52058");
shouldBe('window.getComputedStyle(div1, "").getPropertyValue("-webkit-user-modify")', '"read-write"');
shouldBe('document.getElementById("p1").getAttribute("contentEditable")','"false"');
shouldBe('document.getElementById("p1").contentEditable', '"false"');
shouldBe('document.getElementById("p1").isContentEditable', 'false');
shouldBe('window.getComputedStyle(p1, "").getPropertyValue("-webkit-user-modify")', '"read-only"');
shouldBe('document.getElementById("p2").hasAttribute("contentEditable")','false');
shouldBe('document.getElementById("p2").contentEditable', '"inherit"');
shouldBe('document.getElementById("p2").isContentEditable', 'true');
shouldBe('window.getComputedStyle(p2, "").getPropertyValue("-webkit-user-modify")', '"read-write"');
shouldBe('document.getElementById("div3").hasAttribute("contentEditable")','true');
shouldBe('document.getElementById("div3").contentEditable', '"plaintext-only"');
shouldBe('document.getElementById("div3").isContentEditable', 'true');
shouldBe('window.getComputedStyle(div3, "").getPropertyValue("-webkit-user-modify")', '"read-write-plaintext-only"');
shouldBe('document.getElementById("p3").hasAttribute("contentEditable")','false');
shouldBe('document.getElementById("p3").contentEditable', '"inherit"');
shouldBe('document.getElementById("p3").isContentEditable', 'true');
shouldBe('window.getComputedStyle(p3, "").getPropertyValue("-webkit-user-modify")', '"read-write-plaintext-only"');
document.getElementById("div1").style.display= 'none';
document.getElementById("p1").style.display= 'none';
document.getElementById("div2").style.display= 'none';
document.getElementById("div3").style.display= 'none';
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>