| <!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="parent_of_div" contentEditable="false"> |
| <div id="div"></div> |
| </div> |
| <div id="parent_of_div2"> |
| <div id="div2"></div> |
| </div> |
| <div id="parent_of_p" contentEditable="true"> |
| <p id="p"></p> |
| </div> |
| <div id="parent_of_p2"> |
| <p id="p2"></p> |
| </div> |
| <script> |
| description('isContentEditable should not change if its ancestor\'s contentEditable is set, no matter whether document.designMode is enabled or not.') |
| |
| document.getElementById("parent_of_div2").contentEditable = false; |
| document.getElementById("parent_of_p2").contentEditable = true; |
| |
| evalAndLog('document.designMode = "on"'); |
| |
| shouldBe('document.getElementById("div").contentEditable', '"inherit"'); |
| shouldBe('document.getElementById("div").isContentEditable', 'false'); |
| shouldBe('window.getComputedStyle(div, "").getPropertyValue("-webkit-user-modify")', '"read-only"'); |
| |
| shouldBe('document.getElementById("div2").contentEditable', '"inherit"'); |
| shouldBe('document.getElementById("div2").isContentEditable', 'false'); |
| shouldBe('window.getComputedStyle(div2, "").getPropertyValue("-webkit-user-modify")', '"read-only"'); |
| |
| shouldBe('document.getElementById("p").contentEditable', '"inherit"'); |
| shouldBe('document.getElementById("p").isContentEditable', 'true'); |
| shouldBe('window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify")', '"read-write"'); |
| |
| shouldBe('document.getElementById("p2").contentEditable', '"inherit"'); |
| shouldBe('document.getElementById("p2").isContentEditable', 'true'); |
| shouldBe('window.getComputedStyle(p2, "").getPropertyValue("-webkit-user-modify")', '"read-write"'); |
| |
| document.getElementById("parent_of_div").style.display= 'none'; |
| document.getElementById("parent_of_div2").style.display= 'none'; |
| document.getElementById("parent_of_p").style.display= 'none'; |
| document.getElementById("parent_of_p2").style.display= 'none'; |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |
| </html> |