Closed Bug 1771448 Opened 3 years ago Closed 3 years ago

Get rid of `GetEditorRoot` because of unclear term

Categories

(Core :: DOM: Editor, task, P3)

task

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

GetEditorRoot() must be designed when there is no contenteditable attribute in the web. It returns the anonymous <div> element in TextEditor, but active editing host in HTMLEditor. So, the result meaning is not unclear in some context, and now, all its users are HTMLEditor's methods. So we can get rid of this API.

With this patch, there are some odd points. We should investigate them later...

Depends on D147501

It returns the anonymous <div> element if the instance is a TextEditor, and
compute editing host otherwise. So it's unclear what it returns. Additionally,
all users except EditorBase::CreateTransactionForCollapsedRange are the
methods of HTMLEditor. Therefore, we should remove it and unwrap the code
which it's done.

Depends on D147502

It's currently computes the corresponding editing host from the focus node of
Selection with climbing up the DOM tree. So, it does not just return a stored
element. Therefore, some callers use it multiple times. For avoiding it, we
should rename it to explain that it computes the editing host.

Note that I think that we should make it takes a node to compute editing host
without Selection for solving the case of no selection ranges. Therefore,
I don't like to include more information into the name.

Depends on D147503

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/9ca2a9bf9473 part 1: Get rid of `EditorBase::IsEditorRoot` because of unused r=m_kato https://hg.mozilla.org/integration/autoland/rev/01f6a58a854c part 2: Get rid of `EditorBase::IsDescendantOfEditorRoot` r=m_kato https://hg.mozilla.org/integration/autoland/rev/e9a1c5ca6707 part 3: Get rid of `EditorBase::GetEditorRoot` r=m_kato https://hg.mozilla.org/integration/autoland/rev/07d2709e64fa part 4: Rename `HTMLEditor::GetActiveEditingHost` to `ComputeEditingHost` r=m_kato
Duplicate of this bug: 1768313
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: