Nested jank markers are confusing
Example profile: https://share.firefox.dev/3mtg0JD

Quick discussion with the team gives me the impression that this isn't the intended behavior.
Which jank markers would you expect in this example?:
function blockFor100msAndRequeue() {
sleep(100);
queueTask(blockFor100msAndRequeue);
}
// Start with three tasks in the queue.
queueTask(blockFor100msAndRequeue);
queueTask(blockFor100msAndRequeue);
queueTask(blockFor100msAndRequeue);
// The first queued task starts executing now.
In this example, there are two tasks in the queue at all times, and one of them is executing. So, at any point where you want to queue some other event, that event needs to wait for 200ms-300ms before it starts executing. What's the jank duration? Is it 100ms? Is it 300ms? Is it "until the event loop is empty again"?
I believe our current expectation is how the browser reacts to user input.
BTW I'm not sure what you mean with task here, is that macro tasks (in that case I believe we would be able to react between tasks) or micro tasks (in that case we would never yield to repaint/redraws)?
Also :dholbert filed a bug for that in bugzilla here: https://bugzilla.mozilla.org/show_bug.cgi?id=1829955 .