Bug 1727844 - part 1: Stop enabling blink-compat white-space normalizer at running mochitests r=m_kato

It was enabled for working on implementing blink-compat white-space normalizer,
but currently nobody works on it actively.  Therefore, we should disable it
at running mochitests for detecting any regressions in the default settings.

Differential Revision: https://phabricator.services.mozilla.com/D123868
This commit is contained in:
Masayuki Nakano 2021-08-31 17:37:40 +00:00
parent 7be95b70ef
commit c117a4d476
5 changed files with 44 additions and 12 deletions

View File

@ -1,7 +1,5 @@
[DEFAULT]
skip-if = os == 'android'
prefs =
editor.white_space_normalization.blink_compatible=true
support-files = green.png
[test_bug489202.xhtml]

View File

@ -1,6 +1,5 @@
[DEFAULT]
prefs =
editor.white_space_normalization.blink_compatible=true
apz.zoom-to-focused-input.enabled=false
support-files =
data/cfhtml-chromium.txt

View File

@ -93,8 +93,13 @@ function runTests() {
editor7.focus();
synthesizeKey("KEY_ArrowRight");
synthesizeKey("KEY_Backspace");
is(editor7.innerHTML, "<br>",
"an editor which had \"f\" in a <span> element should have only <br> element after Backspace keypress");
is(
editor7.innerHTML,
SpecialPowers.getBoolPref("editor.white_space_normalization.blink_compatible")
? "<br>"
: "<span><br></span>",
"an editor which had \"f\" in a <span> element should have only <br> element after Backspace keypress"
);
ok(Math.abs(editor7.getBoundingClientRect().height - editor1.getBoundingClientRect().height) <= 1,
"an editor whose content was removed by Backspace key should have a place to put a caret");
@ -102,9 +107,14 @@ function runTests() {
synthesizeKey("KEY_ArrowLeft");
synthesizeKey("KEY_Delete");
todo_is(editor8.innerHTML, "<br>",
"an editor which had \"g\" in a <span> element should have only <br> element after Delete keypress");
todo_isnot(editor8.innerHTML, "<br><span></span>",
"an editor which had \"g\" in a <span> element should have only <br> element after Delete keypress");
"an editor which had \"g\" in a <span> element should have only <br> element after Delete keypress");
todo_isnot(
editor8.innerHTML,
SpecialPowers.getBoolPref("editor.white_space_normalization.blink_compatible")
? "<br><span></span>"
: "<span><br></span>",
"an editor which had \"g\" in a <span> element should have only <br> element after Delete keypress"
);
ok(Math.abs(editor8.getBoundingClientRect().height - editor1.getBoundingClientRect().height) <= 1,
"an editor whose content was removed by Backspace key should have a place to put a caret");

View File

@ -53,7 +53,13 @@ function runTest() {
sendKey("right");
sendChar(" ");
is(e.parentNode.childNodes[2].nodeValue, before, msg + " with id=" + e.id);
is(e.innerHTML, "X&nbsp;", msg + " with id=" + e.id);
is(
e.innerHTML,
SpecialPowers.getBoolPref("editor.white_space_normalization.blink_compatible") || e.tagName == "SPAN"
? "X&nbsp;"
: "X <br>",
msg + " with id=" + e.id
);
}
test_begin_bs(select("t1"));

View File

@ -226,8 +226,17 @@ function runTests() {
check(aDescription + "Tab",
true, true, !aIsTabbable && !aIsReadonly);
is(aElement.innerHTML,
aIsTabbable || aIsReadonly ? "a" :
aIsPlaintext ? "a\t" : "a&nbsp; &nbsp;&nbsp;",
(() => {
if (aIsTabbable || aIsReadonly) {
return "a";
}
if (aIsPlaintext) {
return "a\t";
}
return SpecialPowers.getBoolPref("editor.white_space_normalization.blink_compatible")
? "a&nbsp; &nbsp;&nbsp;"
: "a&nbsp;&nbsp;&nbsp; <br>";
})(),
aDescription + "Tab");
is(SpecialPowers.unwrap(fm.focusedElement), aElement,
aDescription + "focus moved unexpectedly (Tab)");
@ -597,7 +606,17 @@ function runTests() {
sendString(" ");
check(aDescription + "' '", true, true, !aIsReadonly);
is(aElement.innerHTML,
aIsReadonly ? "" : aIsPlaintext ? "Mozilla " : "Mozilla&nbsp;",
(() => {
if (aIsReadonly) {
return "";
}
if (aIsPlaintext) {
return "Mozilla ";
}
return SpecialPowers.getBoolPref("editor.white_space_normalization.blink_compatible")
? "Mozilla&nbsp;"
: "Mozilla <br>";
})(),
aDescription + "typed \"Mozilla \"");
}