diff --git a/editor/libeditor/text/nsTextEditRulesBidi.cpp b/editor/libeditor/text/nsTextEditRulesBidi.cpp index f44b6ce129e..2512a85de40 100644 --- a/editor/libeditor/text/nsTextEditRulesBidi.cpp +++ b/editor/libeditor/text/nsTextEditRulesBidi.cpp @@ -70,6 +70,14 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode, nsCOMPtr content = do_QueryInterface(aSelNode); if (!content) return NS_ERROR_NULL_POINTER; + + if (content->IsContentOfType(nsIContent::eELEMENT)) + { + content = content->GetChildAt(aSelOffset); + if (!content) + return NS_ERROR_FAILURE; + aSelOffset = 0; + } nsIFrame *primaryFrame = shell->GetPrimaryFrameFor(content); if (!primaryFrame)