See https://bugs.jquery.com/ticket/9841. In our case, the OutputArea was triggering a ‘resize’ event on its element, which was bubbling up and causing this handler to execute every time an output was appended. This was a pretty big drain on output areas that quickly changed (like for interact widgets), presumably since this function involves a DOM read to get heights.
The only real fix is an errant `+` on the final replacement, which would end up skipping sequential replacements.
- leaves trailing `\r` on the text, if there is one
- use groups to avoid unnecessary replace calls (no change)
- includes test
This allows us to override output callbacks to redirect output messages, and is used to implement the Output widget, for example. It does not redirect status messages or messages on other channels.
Basically, message processing did not wait for any promises a comm message handler may return to resolve, because comms were not set up to resolve return values of message handlers.
Also change the line-height multiplier to 1.3, which is closer to what the CSS is (I think it is 1.21 something.)
Thanks to @williamstein and @haraldschilly for bringing this to our attention: https://github.com/sagemathinc/smc/issues/1262
We also re-enable auto scrolling for Firefox, since this might have been the issue.
rather than throwing handler errors in the call to `.trigger()`
Extensions can register buggy event handlers.
These should not be able to cause failures in the event-triggering code paths.
This should fix several avenues where extensions (or other bugs) could prevent a notebook from loading.
adds callbacks.clear_on_done bool flag for kernel callbacks.
Default: true (current behavior)
Setting to false means that the caller is taking responsibility for clearing callbacks.
Use this in cells to only clear callbacks on the next execution, for better handling of async output.
and when the prompt changes
we were previously only setting dirty when execution finishes, leaving dirty=false during many changes until the output is complete