Bug 1575584 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The problem is around https://searchfox.org/mozilla-central/source/editor/libeditor/TextEditor.cpp#1889:

```
  bool cancel, handled;
  nsresult rv = rules->WillDoAction(subActionInfo, &cancel, &handled);
  if (cancel || NS_FAILED(rv)) {
```
`WillDoAction` may return an error before assign values to `cancel` and `handled`. We need to swap the checks in
```
  if (cancel || NS_FAILED(rv)) {
```
Additionally, we should assign default values to `cancel` and `handled`.
The problem is around https://searchfox.org/mozilla-central/source/editor/libeditor/TextEditor.cpp#1889:

```
  bool cancel, handled;
  nsresult rv = rules->WillDoAction(subActionInfo, &cancel, &handled);
  if (cancel || NS_FAILED(rv)) {
```
`WillDoAction` may return an error before assigning values to `cancel` and `handled`. We need to swap the checks in
```
  if (cancel || NS_FAILED(rv)) {
```
Additionally, we should assign default values to `cancel` and `handled`.

Back to Bug 1575584 Comment 2