icecat: add release icecat-140.6.0-1gnu1 for aramo

This commit is contained in:
Ark74 2026-01-17 18:56:47 -06:00
parent 92fef42cd6
commit 17ba0259bf
3382 changed files with 457689 additions and 569094 deletions

View file

@ -3450,6 +3450,11 @@ WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
MOZ_ASSERT(
StaticPrefs::editor_white_space_normalization_blink_compatible());
Maybe<AutoTrackDOMPoint> trackPointToPutCaret;
if (aCaretPoint.IsSet()) {
trackPointToPutCaret.emplace(aHTMLEditor.RangeUpdaterRef(),
&pointToPutCaret);
}
// If we're removing a block, it may be surrounded by invisible
// white-spaces. We should remove them to avoid to make them accidentally
// visible.
@ -3459,8 +3464,6 @@ WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
AutoTrackDOMPoint trackAtContent(aHTMLEditor.RangeUpdaterRef(),
&atContent);
{
AutoTrackDOMPoint trackPointToPutCaret(aHTMLEditor.RangeUpdaterRef(),
&pointToPutCaret);
nsresult rv =
WhiteSpaceVisibilityKeeper::EnsureNoInvisibleWhiteSpacesBefore(
aHTMLEditor, EditorDOMPoint(aContentToDelete.AsElement()));
@ -3484,6 +3487,9 @@ WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
if (NS_WARN_IF(!aContentToDelete.IsInComposedDoc())) {
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
}
if (trackPointToPutCaret.isSome()) {
trackPointToPutCaret->Flush(StopTracking::No);
}
}
if (pointToPutCaret.IsInContentNode()) {
// Additionally, we may put caret into the preceding block (this is the
@ -3558,7 +3564,7 @@ WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
}
}
}
trackAtContent.FlushAndStopTracking();
trackAtContent.Flush(StopTracking::Yes);
if (NS_WARN_IF(!atContent.IsInContentNodeAndValidInComposedDoc())) {
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
}
@ -3584,7 +3590,7 @@ WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
"failed");
return afterLastVisibleThingOrError.propagateErr();
}
trackAtContent.FlushAndStopTracking();
trackAtContent.Flush(StopTracking::Yes);
if (NS_WARN_IF(!atContent.IsInContentNodeAndValidInComposedDoc())) {
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
}
@ -3604,7 +3610,7 @@ WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
"WhiteSpaceVisibilityKeeper::NormalizeWhiteSpacesBefore() failed");
return atFirstVisibleThingOrError.propagateErr();
}
trackAtContent.FlushAndStopTracking();
trackAtContent.Flush(StopTracking::Yes);
if (NS_WARN_IF(!atContent.IsInContentNodeAndValidInComposedDoc())) {
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
}
@ -3616,13 +3622,22 @@ WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
aContentToDelete, {WalkTreeOption::IgnoreNonEditableNode});
// Delete the node, and join like nodes if appropriate
{
AutoTrackDOMPoint trackPointToPutCaret(aHTMLEditor.RangeUpdaterRef(),
&pointToPutCaret);
Maybe<AutoTrackDOMPoint> trackPointToPutCaret;
if (pointToPutCaret.IsSet()) {
trackPointToPutCaret.emplace(aHTMLEditor.RangeUpdaterRef(),
&pointToPutCaret);
}
nsresult rv = aHTMLEditor.DeleteNodeWithTransaction(aContentToDelete);
if (NS_FAILED(rv)) {
NS_WARNING("EditorBase::DeleteNodeWithTransaction() failed");
return Err(rv);
}
if (trackPointToPutCaret.isSome()) {
trackPointToPutCaret->Flush(StopTracking::Yes);
if (NS_WARN_IF(!pointToPutCaret.IsInContentNode())) {
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
}
}
}
// Are they both text nodes? If so, join them!