Closed Bug 1359404 Opened 7 years ago Closed 4 years ago

HTMLEditor::IsEmptyNode() and HTMLEditor::IsEmptyNodeImpl() should return bool

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: masayuki, Assigned: m_kato)

References

Details

Attachments

(1 file, 1 obsolete file)

HTMLEditor::IsEmptyNode() and HTMLEditor::IsEmptyNodeImpl() returns nsresult. However, the error result isn't useful for callers since they return error only when some information of editor isn't available, e.g., selection controller isn't available.

So, just returning bool value is fine.
Ah, and perhaps, IsEmptyNodeImpl() should return a struct which has mIsEmpty and mHasBRElement. Then, we can improve the complicated arguments.
Priority: -- → P3
Comment on attachment 8938000 [details]
Bug 1359404 - Redesign HTMLEditor::IsVisTextNode()

Oops, the bug# in the commit message is wrong.
Attachment #8938000 - Attachment is obsolete: true
Attachment #8938000 - Flags: review?(m_kato)

IsEmptyNode won't return error if parameter is not null. So we shouldn't use
nserror for return value and use assertion to check parameter.

Assignee: nobody → m_kato
Status: NEW → ASSIGNED
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/808290d9cd09
Make IsEmptyNode infaillible. r=masayuki
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: