зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b5ed92b74381 (bug 1777787) for causing mochitest failures on browser_styleeditor_filesave.js CLOSED TREE
This commit is contained in:
Родитель
daedda077e
Коммит
ccea8e742a
|
@ -309,12 +309,3 @@
|
|||
outline: 1px solid var(--theme-contrast-border);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.cm-non-printable-char {
|
||||
color: var(--theme-comment);
|
||||
font-size: 0.9em;
|
||||
border-radius: 2px;
|
||||
outline: 1px solid currentColor;
|
||||
margin-inline: 2px;
|
||||
padding-inline: 2px;
|
||||
}
|
||||
|
|
|
@ -161,22 +161,6 @@ function Editor(config) {
|
|||
maxHighlightLength: 1000,
|
||||
// Disable codeMirror setTimeout-based cursor blinking (will be replaced by a CSS animation)
|
||||
cursorBlinkRate: 0,
|
||||
// List of non-printable chars that will be displayed in the editor, showing their
|
||||
// unicode version. We only add a few characters to the default list:
|
||||
// - \u202d LEFT-TO-RIGHT OVERRIDE
|
||||
// - \u202e RIGHT-TO-LEFT OVERRIDE
|
||||
// - \u2066 LEFT-TO-RIGHT ISOLATE
|
||||
// - \u2067 RIGHT-TO-LEFT ISOLATE
|
||||
// - \u2069 POP DIRECTIONAL ISOLATE
|
||||
// eslint-disable-next-line no-control-regex
|
||||
specialChars: /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/,
|
||||
specialCharPlaceholder: char => {
|
||||
const doc = this.codeMirror.getWrapperElement().ownerDocument;
|
||||
const el = doc.createElement("span");
|
||||
el.classList.add("cm-non-printable-char");
|
||||
el.append(doc.createTextNode(`\\u${char.codePointAt(0).toString(16)}`));
|
||||
return el;
|
||||
},
|
||||
};
|
||||
|
||||
// Additional shortcuts.
|
||||
|
|
|
@ -57,19 +57,5 @@ async function test() {
|
|||
ed.setFontSize(ed.getFontSize() + 1);
|
||||
is(ed.getFontSize(), size + 1, "new font size was set");
|
||||
|
||||
info("Check that we display unicode values for non-printable characters");
|
||||
ed.setText("> \u202e \u2066 - \u2069 \u2066 <");
|
||||
|
||||
const doc = win.document.querySelector("iframe").contentWindow.document;
|
||||
const nonPrintableCharElements = Array.from(
|
||||
doc.querySelectorAll(".cm-non-printable-char")
|
||||
);
|
||||
|
||||
Assert.deepEqual(
|
||||
nonPrintableCharElements.map(el => el.textContent),
|
||||
["\\u202e", "\\u2066", "\\u2069", "\\u2066"],
|
||||
"non printable chars are displayed as expected"
|
||||
);
|
||||
|
||||
teardown(ed, win);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче