Bug 1926483 - part 1: Make WSRunScanner instance free from editing host r=m_kato
If it scans starting from a editable point, it does not require the editing host as an ancestor limiter. Therefore, some users can be free from editing host. Differential Revision: https://phabricator.services.mozilla.com/D233791
This commit is contained in:
@@ -2244,12 +2244,16 @@ nsresult HTMLEditor::InsertElementAtSelectionAsAction(
|
||||
if (!SelectionRef().GetAnchorNode()) {
|
||||
return NS_OK;
|
||||
}
|
||||
if (NS_WARN_IF(!SelectionRef().GetAnchorNode()->IsInclusiveDescendantOf(
|
||||
editingHost))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
EditorRawDOMPoint atAnchor(SelectionRef().AnchorRef());
|
||||
// Adjust position based on the node we are going to insert.
|
||||
EditorDOMPoint pointToInsert =
|
||||
HTMLEditUtils::GetBetterInsertionPointFor<EditorDOMPoint>(
|
||||
*aElement, atAnchor, *editingHost);
|
||||
HTMLEditUtils::GetBetterInsertionPointFor<EditorDOMPoint>(*aElement,
|
||||
atAnchor);
|
||||
if (!pointToInsert.IsSet()) {
|
||||
NS_WARNING("HTMLEditUtils::GetBetterInsertionPointFor() failed");
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user