We can assert the following invariant to find divergences: If a DOM event is dispatched and the page's EventLoopInputDispatcher::dispatching() is false, then replay divergence is possible. Let's unpack that: 1. For a web page's JS to execute deterministically, the engine must execute code blocks in the same order. 2. To run JS in the same order, DOM events must be dispatched in the same order. 3. For DOM events to be dispatched in the same order, the relevant run loops must be dispatched in the same order. 4. If we are not controlling the dispatch of a run loop that fired a DOM event, then it could potentially execute script in any order with respect to other run loops. In practice, this assertion finds more nondeterminism (and provides useful stack traces) than any other technique. In the short term, it will make it really hard to do replay in debug mode without asserting, so it should probably be put behind a guard that is normally compiled out. Once an error reporting mechanism is implemented, it could show a warning in the inspector UI.
Created attachment 228713 [details] the patch
Comment on attachment 228713 [details] the patch r=me
Comment on attachment 228713 [details] the patch Clearing flags on attachment: 228713 Committed r166880: <http://trac.webkit.org/changeset/166880>
All reviewed patches have been landed. Closing bug.