Bug 378224 Comment 24 Edit History

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

(In reply to Alessandro Castellani (:aleca) from comment #23)

> Review of attachment 9152809 [details] [diff] [review]:
> This looks good, I think.

> ::: mail/components/compose/content/MsgComposeCommands.js
> @@ +1062,5 @@
> > +        // Update checkmarks on menuitems and toolbarbuttons.
> > +        for (let element of document.querySelectorAll(
> > +          'menuitem[command="cmd_toggleReturnReceipt"], ' +
> > +            'toolbarbutton[command="cmd_toggleReturnReceipt"]'
> > +        )) {
 
> Could we maybe only use the `[command="cmd_toggleReturnReceipt"]` attribute
> as a selector?

We could, but I'd think having to check all elements of the entire document if they have a command attribute should be less performant than just looking for two types of tags and checking on them if they have that attribute, unless if there are optimizations or hashes which improve the speed. Unfortunately I wouldn't know how best to check performance.
(In reply to Alessandro Castellani (:aleca) from comment #23)

> Review of attachment 9152809 [details] [diff] [review]:
> This looks good, I think.

```
> ::: mail/components/compose/content/MsgComposeCommands.js
> @@ +1062,5 @@
> > +        // Update checkmarks on menuitems and toolbarbuttons.
> > +        for (let element of document.querySelectorAll(
> > +          'menuitem[command="cmd_toggleReturnReceipt"], ' +
> > +            'toolbarbutton[command="cmd_toggleReturnReceipt"]'
> > +        )) {
```
 
> Could we maybe only use the `[command="cmd_toggleReturnReceipt"]` attribute
> as a selector?

We could, but I'd think having to check all elements of the entire document if they have a command attribute should be less performant than just looking for two types of tags and checking on them if they have that attribute, unless if there are optimizations or hashes which improve the speed. Unfortunately I wouldn't know how best to check performance.

Back to Bug 378224 Comment 24