Closed Bug 1810655 Opened 2 years ago Closed 2 years ago

Methods of `nsIEditorMailSupport` should work even if the editor is readonly mode

Categories

(Core :: DOM: Editor, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Addons for Thunderbird may want to update editing emails even while the editor is set to readonly. I think that the readonly flag should work with user interaction. Therefore, HTMLEditor should stop checking IsReadOnly in various sub action handlers.

https://searchfox.org/mozilla-central/search?q=EditorBase%3A%3AIsReadonly&path=&case=true&regexp=false

The readonly flag of HTMLEditor can be set by chrome script or
Document.execCommand("contentReadOnly"). However, the XPCOM APIs should keep
working to update the editable content. E.g., if focused editor is a single
line text field, the app may want to change the value even if it's not editable
by the users.

Note that this patch does not fix all cases of all APIs because this is not
important for Firefox even though the status can be created by web apps (but
Firefox does not use XPCOM APIs basically, instead using XUL commands and it
should not work with readonly state since it may be kicked by user
interactions, e.g., executing a menu item or a shortcut key).
Therefore, it's enough to work it in current Thunderbird for now.

Thanks for your time to work on this, Masayuki, even though it is mostly a Thunderbird request.

No problem. Thunderbird testers are really important testers for the editor module since the mail composer is implemented without cross-browser code.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/9d7bac312272
Make `HTMLEditor` check readonly flag when its public methods are called r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Regressions: 1812493
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: