1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/libeditor/html/tests/test_bug738366.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,24 @@ 1.4 +<!DOCTYPE html> 1.5 +<!-- 1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=738366 1.7 +--> 1.8 +<title>Test for Bug 738366</title> 1.9 +<script src="/tests/SimpleTest/SimpleTest.js"></script> 1.10 +<link rel="stylesheet" href="/tests/SimpleTest/test.css"/> 1.11 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=738366">Mozilla Bug 738366</a> 1.12 +<div id="display" contenteditable>foobarbaz</div> 1.13 +<script> 1.14 +/** Test for Bug 738366 **/ 1.15 + 1.16 +getSelection().collapse(document.getElementById("display").firstChild, 3); 1.17 +getSelection().extend(document.getElementById("display").firstChild, 6); 1.18 +document.execCommand("bold"); 1.19 +is(document.getElementById("display").innerHTML, "foo<b>bar</b>baz", 1.20 + "styleWithCSS must default to false"); 1.21 +document.execCommand("stylewithcss", false, "true"); 1.22 +document.execCommand("bold"); 1.23 +document.execCommand("bold"); 1.24 +is(document.getElementById("display").innerHTML, 1.25 + 'foo<span style="font-weight: bold;">bar</span>baz', 1.26 + "styleWithCSS must be settable to true"); 1.27 +</script>