Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

  • This WPT test may be referenced by the following Test IDs:
    • /html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/user-interaction-editing-designMode-xml.xml - WPT Dashboard Interop Dashboard
<?xml version="1.0" encoding="utf-8"?>
<head>
<title>Editing: designMode attribute test</title>
<link rel="author" title="Baidu" href="mailto: guopengcheng@baidu.com"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
</head>
<body>
<script type="text/javascript"><![CDATA[
test(function() {
assert_equals(document.designMode, "off", "check for designMode value");
assert_throws_dom("InvalidStateError", function() { document.queryCommandSupported("delete") });
assert_throws_dom("InvalidStateError", function() { document.queryCommandEnabled("delete") });
}, "initial designMode attribute");
document.designMode="on";
test(function() {
assert_equals(document.designMode, "on", "check for designMode value");
assert_throws_dom("InvalidStateError", function() { document.queryCommandSupported("delete") });
assert_throws_dom("InvalidStateError", function() { document.queryCommandEnabled("delete") });
}, "set designMode = \"on\"");
document.designMode="off";
test(function() {
assert_equals(document.designMode,"off", "check for designMode value");
assert_throws_dom("InvalidStateError", function() { document.queryCommandSupported("delete") });
assert_throws_dom("InvalidStateError", function() { document.queryCommandEnabled("delete") });
}, "set designMode = \"off\"");
]]></script>
</body>
</html>