Closed Bug 1546577 Opened 8 months ago Closed 8 months ago

Make overloads of CanCut(), CanCopy(), CanDelete() and CanPaste() which return bool instead of nsresult

Categories

(Core :: DOM: Editor, task)

task
Not set

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

CanCut(), CanCopy() and CanPaste() return error only when the editor has already been destroyed or not been initialized yet, or when failed to access clipboard when the document is not HTML/XHTML.

CanDelete() returns error only when the editor has already been destroyed or not been initialized yet.

So, these error result won't be exposed to the web in most cases and such exception shouldn't stop any content script because Chrome basically does not throw exception in such situation as far as I know.

So, there should be overloads of them to return bool result directly for making their callers simpler.

CanCut(), CanCopy() and CanPaste() return error only when the editor has
already been destroyed or not been initialized yet, or when failed to access
clipboard when the document is not HTML/XHTML.

CanDelete() returns error only when the editor has already been destroyed or
not been initialized yet.

So, these error result won't be exposed to the web in most cases and such
exception shouldn't stop any content script because Chrome basically does not
throw exception in such situation as far as I know.

Therefore, there should be overloads of them to return bool result directly
for making their callers simpler.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/feb8846c6602
Make overloads of CanCut(), CanCopy(), CanDelete() and CanPaste() which return bool instead of nsresult r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.