Open alanjrogers opened 11 years ago
I think this is done to avoid a flash when the page reloads (by simply not returning control to the renderer until the page is ready).
Maybe we could instead do this in a block asynchronously dispatched to the main thread. It'd introduce an imperceptible delay before starting to render, but would ensure that it occurs outside of any transactional behavior.
This was to ensure that it rendered the new content as soon as it was set, as you'd expect a label to do. Introducing a queue hop doesn't seem like it'd solve the problem :\
https://github.com/github/Rebel/blob/master/Rebel/RBLHTMLView.m#L118-L120
RBLHTMLView
spins the current run loop while it waits for the HTML to render.I haven't dug into it too far yet, but I've seen this cause an intermittent crash if the HTML for the view has been assigned inside of a 'transaction' such as the
begin/endUpdates
calls used in view basedNSTableViews
.For example:
This method is called when rows are inserted into the table view, so usually after a call to
[tableView beginUpdates]
. My theory is that spinning the run loop is implicitly callingendUpdates
resulting in unbalanced calls.