Commit 78622cf9 authored by Raine Makelainen's avatar Raine Makelainen

[embedlite-components] Fix runtime errors from context menu opening and text...

[embedlite-components] Fix runtime errors from context menu opening and text selection. Contributes to JB#44128

Especially text selection might still be glitchy.
parent e052283b
......@@ -3,9 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
let Ci = Components.interfaces;
let Cc = Components.classes;
/*
* SelectionPrototype - common base class used by both chrome and content selection logic.
*/
......
......@@ -210,8 +210,9 @@ let Util = {
// If a body element is editable and the body is the child of an
// iframe or div we can assume this is an advanced HTML editor
if ((aElement instanceof Ci.nsIDOMHTMLIFrameElement ||
aElement instanceof Ci.nsIDOMHTMLDivElement) &&
if ((aElement instanceof Ci.nsIDOMHTMLIFrameElement) &&
// ||
// aElement instanceof HTMLDivElement) &&
aElement.contentDocument &&
this.isEditableContent(aElement.contentDocument.body)) {
return true;
......@@ -241,12 +242,13 @@ let Util = {
isText: function isText(aElement) {
return (aElement instanceof Ci.nsIDOMHTMLParagraphElement ||
aElement instanceof Ci.nsIDOMHTMLDivElement ||
aElement instanceof Ci.nsIDOMHTMLLIElement ||
aElement instanceof Ci.nsIDOMHTMLPreElement ||
aElement instanceof Ci.nsIDOMHTMLHeadingElement ||
aElement instanceof Ci.nsIDOMHTMLTableCellElement ||
aElement instanceof Ci.nsIDOMHTMLBodyElement);
// Test agaist webidl of HTMLDivElement
// aElement instanceof HTMLDivElement ||
// aElement instanceof HTMLHeadingElement ||
// aElement instanceof HTMLTableCellElement ||
},
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment