зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1705598 - part 7: Make `WSRunScanner::GetRangeContainingInvisibleWhiteSpacesAtRangeBoundaries()` take editing host instead of `HTMLEditor` r=m_kato
Depends on D112507 Differential Revision: https://phabricator.services.mozilla.com/D112508
This commit is contained in:
Родитель
7c39f920b9
Коммит
16c03a3b47
|
@ -2903,7 +2903,8 @@ HTMLEditor::AutoDeleteRangesHandler::ComputeRangesToDeleteNonCollapsedRanges(
|
|||
EditorDOMRange firstRange(aRangesToDelete.FirstRangeRef());
|
||||
EditorDOMRange extendedRange =
|
||||
WSRunScanner::GetRangeContainingInvisibleWhiteSpacesAtRangeBoundaries(
|
||||
aHTMLEditor, EditorDOMRange(aRangesToDelete.FirstRangeRef()));
|
||||
aHTMLEditor.GetActiveEditingHost(),
|
||||
EditorDOMRange(aRangesToDelete.FirstRangeRef()));
|
||||
if (firstRange != extendedRange) {
|
||||
nsresult rv = aRangesToDelete.FirstRangeRef()->SetStartAndEnd(
|
||||
extendedRange.StartRef().ToRawRangeBoundary(),
|
||||
|
|
|
@ -3566,15 +3566,13 @@ EditorDOMRange WSRunScanner::GetRangeForDeletingBlockElementBoundaries(
|
|||
// static
|
||||
EditorDOMRange
|
||||
WSRunScanner::GetRangeContainingInvisibleWhiteSpacesAtRangeBoundaries(
|
||||
const HTMLEditor& aHTMLEditor, const EditorDOMRange& aRange) {
|
||||
Element* aEditingHost, const EditorDOMRange& aRange) {
|
||||
MOZ_ASSERT(aRange.IsPositionedAndValid());
|
||||
MOZ_ASSERT(aRange.EndRef().IsSetAndValid());
|
||||
MOZ_ASSERT(aRange.StartRef().IsSetAndValid());
|
||||
|
||||
const Element* editingHost = aHTMLEditor.GetActiveEditingHost();
|
||||
|
||||
EditorDOMRange result;
|
||||
TextFragmentData textFragmentDataAtStart(aRange.StartRef(), editingHost);
|
||||
TextFragmentData textFragmentDataAtStart(aRange.StartRef(), aEditingHost);
|
||||
if (NS_WARN_IF(!textFragmentDataAtStart.IsInitialized())) {
|
||||
return EditorDOMRange(); // TODO: Make here return error with Err.
|
||||
}
|
||||
|
@ -3607,7 +3605,7 @@ WSRunScanner::GetRangeContainingInvisibleWhiteSpacesAtRangeBoundaries(
|
|||
result.SetStart(aRange.StartRef());
|
||||
}
|
||||
|
||||
TextFragmentData textFragmentDataAtEnd(aRange.EndRef(), editingHost);
|
||||
TextFragmentData textFragmentDataAtEnd(aRange.EndRef(), aEditingHost);
|
||||
if (NS_WARN_IF(!textFragmentDataAtEnd.IsInitialized())) {
|
||||
return EditorDOMRange(); // TODO: Make here return error with Err.
|
||||
}
|
||||
|
|
|
@ -419,7 +419,7 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
* extended range if range boundaries of aRange are in invisible white-spaces.
|
||||
*/
|
||||
static EditorDOMRange GetRangeContainingInvisibleWhiteSpacesAtRangeBoundaries(
|
||||
const HTMLEditor& aHTMLEditor, const EditorDOMRange& aRange);
|
||||
dom::Element* aEditingHost, const EditorDOMRange& aRange);
|
||||
|
||||
/**
|
||||
* GetPrecedingBRElementUnlessVisibleContentFound() scans a `<br>` element
|
||||
|
|
Загрузка…
Ссылка в новой задаче