Currently Mac WK2 uses WebCore side throttling implementation in RenderLayerCompositor. This code has throttling timer per-frame while the actual decision making and layer flushes itself are per page. These timers generate way more flushes than expected in presence of multiple frames. There are also bugs in how flushing state is updated when frames are created dynamically. On iOS WK2 throttling is implemented on WebKit side and controlled by a per-page timer. Recent fixes also make this implementation visually fast. We should align the Mac implementation and eventually unify them.
Created attachment 354807 [details] patch
Comment on attachment 354807 [details] patch Clearing flags on attachment: 354807 Committed r238178: <https://trac.webkit.org/changeset/238178>
All reviewed patches have been landed. Closing bug.
<rdar://problem/46064211>
The changes in https://trac.webkit.org/changeset/238178/webkit has caused these two tests to begin timing out on MacOS Release WK2: fast/forms/access-key-mutated.html fast/forms/access-key-case-insensitive.html Repro Command: run-webkit-tests --root testbuild-238178 fast/forms/access-key-mutated.html fast/forms/access-key-case-insensitive.html --iterations 5 -f These tests pass instantly on 238177.
Filed https://bugs.webkit.org/show_bug.cgi?id=191642 for those, will skip meanwhile
Skipped in https://trac.webkit.org/r238187
Comment on attachment 354807 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=354807&action=review > Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:221 > + m_hasPendingFlush = true; > + > + if (m_layerTreeStateIsFrozen) { > + m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false; > return; > + } > + > + if (m_isLayerFlushThrottlingTemporarilyDisabledForInteraction) { > + m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false; > + scheduleLayerFlushRunLoopObserver(); > + m_layerFlushThrottlingTimer.stop(); > + return; > + } > + > + if (m_layerFlushThrottlingTimer.isActive()) { > + ASSERT(m_isThrottlingLayerFlushes); > + return; > + } > + > + if (m_isThrottlingLayerFlushes) { > + startLayerFlushThrottlingTimer(); > + return; > + } So now this code exists in both TiledCoreAnimationDrawingArea and RemoteLayerTreeDrawingArea. Can we share code?
> So now this code exists in both TiledCoreAnimationDrawingArea and > RemoteLayerTreeDrawingArea. Can we share code? Like the ChangeLog mentions, sharing is the next step.