Bug 1790725 - Allow useCss for mail editor. r=masayuki

After this change, it's possible to set the pref, or use editor.document.execCommand("styleWithCSS", false, "true") to enable css in mail compose.

Differential Revision: https://phabricator.services.mozilla.com/D157276
This commit is contained in:
Magnus Melin 2022-09-14 10:27:39 +00:00
Родитель adea50e5d0
Коммит a4024058a5
2 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -359,7 +359,7 @@ class HTMLEditor final : public EditorBase,
* with "font style elements" like <b>, <i>, etc, and <blockquote> to indent,
* align attribute to align contents, returns false.
*/
bool IsCSSEnabled() const { return !IsMailEditor() && mIsCSSPrefChecked; }
bool IsCSSEnabled() const { return mIsCSSPrefChecked; }
/**
* Enable/disable object resizers for <img> elements, <table> elements,

Просмотреть файл

@ -3176,9 +3176,8 @@ nsresult HTMLEditor::GetFontColorState(bool* aMixed, nsAString& aOutColor) {
return NS_OK;
}
// the return value is true only if the instance of the HTML editor we created
// can handle CSS styles (for instance, Composer can, Messenger can't) and if
// the CSS preference is checked
// The return value is true only if the instance of the HTML editor we created
// can handle CSS styles and if the CSS preference is checked.
NS_IMETHODIMP HTMLEditor::GetIsCSSEnabled(bool* aIsCSSEnabled) {
*aIsCSSEnabled = IsCSSEnabled();
return NS_OK;