(In reply to Alessandro Castellani (:aleca) from comment #44) > > When you preview, you insertRule(rule, index). If canceled/changed, you deleteRule(index) and insertRule(newrule, index). > > I did that while updating the patch, but it's not possible because the preview is updated at every color change when the color picker is touched, which might mean hundreds of changes per second if the user quickly moves the picker around the color wheel. > We need that kind of accuracy to ensure a proper real time preview of the selected color, and constantly calling `insertRule` and `deleteRule` at every value change has some serious performance issues. That's because the wrong event listener here should only be "change" on a type="color" input, fired when dialog is accepted/canceled. The color changes both on the wheel and the colorpicker box, so it's not like the user can't preview what it looks like. And the existing method pegs cpu when moving the picker regardless; it seems not worth the feature of also updating the folder in the tree.. Especially since invalidateRow() may also invalidate() the entire tree (invalidateCell() doesn't work on only a cell in my experience).
Bug 1637668 Comment 46 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 #44) > > When you preview, you insertRule(rule, index). If canceled/changed, you deleteRule(index) and insertRule(newrule, index). > > I did that while updating the patch, but it's not possible because the preview is updated at every color change when the color picker is touched, which might mean hundreds of changes per second if the user quickly moves the picker around the color wheel. > We need that kind of accuracy to ensure a proper real time preview of the selected color, and constantly calling `insertRule` and `deleteRule` at every value change has some serious performance issues. That's because the event listener here should only be "change" on a type="color" input, fired when dialog is accepted/canceled. The color changes both on the wheel and the colorpicker box, so it's not like the user can't preview what it looks like. And the existing method pegs cpu when moving the picker regardless; it seems not worth the feature of also updating the folder in the tree.. Especially since invalidateRow() may also invalidate() the entire tree (invalidateCell() doesn't work on only a cell in my experience).