Closed Bug 1623017 Opened 4 years ago Closed 3 months ago

[meta] Methods which can run script in editor should return error code

Categories

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

task

Tracking

()

RESOLVED FIXED

People

(Reporter: masayuki, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: meta)

Currently, some methods returns bool or Foo* from can-run-script methods. However, it requires that callers need to check whether the editor is destroyed during the call or not. And this must be error-prone design. Fortunately, there is Result template class now. Looks like that its destruction cost is cheaper than ErrorResult and IgnoredErrorResult. So, perhaps, we should change all methods in editor which take ErrorResult& too.

Summary: Methods which can run script in editor should return error code → [meta] Methods which can run script in editor should return error code
Severity: normal → S3

I think that HTMLEditor methods are marked with MOZ_CAN_RUN_SCRIPT enough.

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.