Bug 208903

Summary: [SVG] RenderSVGResourceContainer's style invalidation should be a pre-layout task
Product: WebKit Reporter: zalan <zalan>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bfulgham, sabouhallawa, simon.fraser, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=232230

Description zalan 2020-03-10 20:48:13 PDT
RenderSVGRoot::layout() -> m_resourcesNeedingToInvalidateClients -> resource->removeAllClientsFromCache() -> RenderSVGResourceContainer::markAllClientsForInvalidation -> RenderSVGResourceContainer::markAllClientLayersForInvalidation -> invalidateStyleAndLayerComposition -> dirty style -> schedule style recalc.

This leads to unstable layout.
Comment 1 Radar WebKit Bug Importer 2020-03-10 20:48:36 PDT
<rdar://problem/60306128>
Comment 2 zalan 2020-03-10 21:15:30 PDT
Alternatively split RenderSVGResourceContainer::markAllClientsForInvalidation into 2 functions and call invalidation only through the non-layout case (e.g. make sure this function never gets called while in layout)