Skip to content

Commit 1f6994f

Browse files
committed
fix: support any contet editable element
1 parent a5e4ee2 commit 1f6994f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

common/content/buffer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,8 +1501,10 @@ const Buffer = Module("buffer", {
15011501
modes.set(modes.INSERT);
15021502
else if (Buffer.focusedWindow.getSelection().toString() != "")
15031503
modes.set(modes.VISUAL, modes.TEXTAREA);
1504-
else
1504+
else {
1505+
options.setPref("accessibility.browsewithcaret", true);
15051506
modes.main = modes.TEXTAREA;
1507+
}
15061508
} else {
15071509
// setting this option notifies an observer which takes care of the
15081510
// mode setting

common/content/editor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ const Editor = Module("editor", {
478478
}, {
479479
getEditor: function () {
480480
let e = liberator.focus;
481-
if (!e) {
481+
if (!e || e.isContentEditable) {
482482
e = document.commandDispatcher.focusedWindow;
483483
if (!Editor.windowIsEditable(e))
484484
return null;
@@ -509,8 +509,8 @@ const Editor = Module("editor", {
509509
.QueryInterface(Ci.nsIInterfaceRequestor)
510510
.getInterface(Ci.nsIEditingSession);
511511
return editingSession.windowIsEditable(win) &&
512-
win.document.body &&
513-
util.computedStyle(win.document.body).getPropertyValue("-moz-user-modify") == "read-write";
512+
(win.document.designMode === "on" ||
513+
(services.get("focus").getFocusedElementForWindow(win, true, {})||{}).isContentEditable);
514514
}
515515
}, {
516516
mappings: function () {

0 commit comments

Comments
 (0)