Instead of dirtying the needsLayout bits during layout like in RenderQuote::updateDepth() we should instead use some kind of pre-layout like task. Unfortunately running before a layout is not quite enough, we instead need to run anytime someone would check needsLayout() to guard a call to layout() ex. Document::updateLayout() needs this.
Note that the reason for this more complicated approach than the current proposal for pre-layout tasks is that RenderView may not need a layout, but there may be some pre-layout tasks that need to run that would then mark it as needing layout so: if (needsLayout()) layout(); void layout() { // not enough! Since we'll never even get here if needsLayout was false. preLayoutTasks(); realLayout(); }
Related bug: https://bugs.webkit.org/show_bug.cgi?id=109616