зеркало из https://github.com/mozilla/pjs.git
Bug 738366 - Default styleWithCSS to false; r=ehsan
This commit is contained in:
Родитель
2daa1fe614
Коммит
120d208770
|
@ -9,12 +9,22 @@ function boom()
|
|||
{
|
||||
document.getElementById("i").focus();
|
||||
|
||||
try { document.execCommand("stylewithcss", false, "true") } catch(e) { }
|
||||
try { document.execCommand("inserthtml", false, "<x>X</x>"); } catch(e) { }
|
||||
try { document.execCommand("underline", false, null); } catch(e) { }
|
||||
try { document.execCommand("justifyfull", false, null); } catch(e) { }
|
||||
try { document.execCommand("underline", false, null); } catch(e) { }
|
||||
try { document.execCommand("insertParagraph", false, null); } catch(e) { }
|
||||
try { document.execCommand("delete", false, null); } catch(e) { }
|
||||
|
||||
try { document.execCommand("stylewithcss", false, "false") } catch(e) { }
|
||||
try { document.execCommand("inserthtml", false, "<x>X</x>"); } catch(e) { }
|
||||
try { document.execCommand("underline", false, null); } catch(e) { }
|
||||
try { document.execCommand("justifyfull", false, null); } catch(e) { }
|
||||
try { document.execCommand("underline", false, null); } catch(e) { }
|
||||
try { document.execCommand("insertParagraph", false, null); } catch(e) { }
|
||||
try { document.execCommand("delete", false, null); } catch(e) { }
|
||||
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ load 407256-1.html
|
|||
load 430624-1.html
|
||||
load 459613.html
|
||||
load 475132-1.xhtml
|
||||
asserts-if(!Android,1) load 633709.xhtml # Bug 695364
|
||||
asserts-if(!Android,2) load 633709.xhtml # Bug 695364 and bug 671153
|
||||
asserts-if(!Android,6) load 636074-1.html # Bug 439258, charged to the wrong test due to bug 635550
|
||||
load 713427-1.html
|
||||
load 713427-2.xhtml
|
||||
|
|
|
@ -299,7 +299,7 @@ const nsHTMLCSSUtils::CSSEquivTable hrAlignEquivTable[] = {
|
|||
|
||||
nsHTMLCSSUtils::nsHTMLCSSUtils(nsHTMLEditor* aEditor)
|
||||
: mHTMLEditor(aEditor)
|
||||
, mIsCSSPrefChecked(false)
|
||||
, mIsCSSPrefChecked(true)
|
||||
{
|
||||
// let's retrieve the value of the "CSS editing" pref
|
||||
mIsCSSPrefChecked = Preferences::GetBool("editor.use_css", mIsCSSPrefChecked);
|
||||
|
|
|
@ -102,6 +102,7 @@ _TEST_FILES = \
|
|||
test_select_all_without_body.html \
|
||||
file_select_all_without_body.html \
|
||||
test_root_element_replacement.html \
|
||||
test_bug738366.html \
|
||||
$(NULL)
|
||||
|
||||
ifneq (mobile,$(MOZ_BUILD_APP))
|
||||
|
|
|
@ -25,7 +25,7 @@ editor.innerHTML = '<p></p><ul><li>Item 1</li><li>Item 2</li></ul><p></p>';
|
|||
editor.focus();
|
||||
|
||||
addLoadEvent(function() {
|
||||
|
||||
document.execCommand("stylewithcss", false, "true");
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
var lis = document.getElementsByTagName("li");
|
||||
|
|
|
@ -54,6 +54,8 @@ function justify(textNode, pos) {
|
|||
}
|
||||
|
||||
function runTests() {
|
||||
document.execCommand("stylewithcss", false, "true");
|
||||
|
||||
const test1 = document.getElementById("test1");
|
||||
const test2 = document.getElementById("test2");
|
||||
const test3 = document.getElementById("test3");
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=738366
|
||||
-->
|
||||
<title>Test for Bug 738366</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=738366">Mozilla Bug 738366</a>
|
||||
<div id="display" contenteditable>foobarbaz</div>
|
||||
<script>
|
||||
/** Test for Bug 738366 **/
|
||||
|
||||
getSelection().collapse(document.getElementById("display").firstChild, 3);
|
||||
getSelection().extend(document.getElementById("display").firstChild, 6);
|
||||
document.execCommand("bold");
|
||||
is(document.getElementById("display").innerHTML, "foo<b>bar</b>baz",
|
||||
"styleWithCSS must default to false");
|
||||
document.execCommand("stylewithcss", false, "true");
|
||||
document.execCommand("bold");
|
||||
document.execCommand("bold");
|
||||
is(document.getElementById("display").innerHTML,
|
||||
'foo<span style="font-weight: bold;">bar</span>baz',
|
||||
"styleWithCSS must be settable to true");
|
||||
</script>
|
|
@ -31,6 +31,7 @@ const kIsLinux = navigator.platform.indexOf("Linux") == 0 || navigator.platform.
|
|||
|
||||
function runTests()
|
||||
{
|
||||
document.execCommand("stylewithcss", false, "true");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
var fm = Components.classes["@mozilla.org/focus-manager;1"].
|
||||
|
|
|
@ -425,7 +425,7 @@ pref("extensions.spellcheck.inline.max-misspellings", 500);
|
|||
|
||||
pref("editor.use_custom_colors", false);
|
||||
pref("editor.singleLine.pasteNewlines", 2);
|
||||
pref("editor.use_css", true);
|
||||
pref("editor.use_css", false);
|
||||
pref("editor.css.default_length_unit", "px");
|
||||
pref("editor.resizing.preserve_ratio", true);
|
||||
pref("editor.positioning.offset", 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче