test_bug738440.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!doctype html>
  2. <!--
  3. https://bugzilla.mozilla.org/show_bug.cgi?id=738440
  4. -->
  5. <title>Test for Bug 738440</title>
  6. <script src="/tests/SimpleTest/SimpleTest.js"></script>
  7. <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
  8. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=738440">Mozilla Bug 738440</a>
  9. <div contenteditable></div>
  10. <script>
  11. /** Test for Bug 738440 **/
  12. document.execCommand("stylewithcss", false, "true");
  13. is(document.queryCommandState("stylewithcss"), true,
  14. "setting stylewithcss to true should cause its state to be true");
  15. is(document.queryCommandState("usecss"), false,
  16. "usecss state should always be false");
  17. document.execCommand("stylewithcss", false, "false");
  18. is(document.queryCommandState("stylewithcss"), false,
  19. "setting stylewithcss to false should cause its state to be false");
  20. is(document.queryCommandState("usecss"), false,
  21. "usecss state should always be false");
  22. document.execCommand("usecss", false, "true");
  23. is(document.queryCommandState("stylewithcss"), false,
  24. "setting usecss to true should cause stylewithcss state to be false");
  25. is(document.queryCommandState("usecss"), false,
  26. "usecss state should always be false");
  27. document.execCommand("usecss", false, "false");
  28. is(document.queryCommandState("stylewithcss"), true,
  29. "setting usecss to false should cause stylewithcss state to be true");
  30. is(document.queryCommandState("usecss"), false,
  31. "usecss state should always be false");
  32. </script>