NEW 242420
☂️ avoid invalidating SVG resources when referencing element changes layout
https://bugs.webkit.org/show_bug.cgi?id=242420
Summary ☂️ avoid invalidating SVG resources when referencing element changes layout
Cameron McCormack (:heycam)
Reported 2022-07-06 21:26:02 PDT
In SVG RenderObject layout methods, we call SVGResourcesCache::clientLayoutChanged if any layout was performed. Sometimes this is unnecessary work, as the specific changes that were made during layout do not affect the data that the SVGResourceContainer has cached. In the dependent bugs I'll file under here, I'll make all of the SVG resource types able to respond to changes on referencing element lazily, without needing to eagerly remove and recreate all resources.
Attachments
Cameron McCormack (:heycam)
Comment 1 2022-07-06 21:29:04 PDT
The pattern I will use for all of the resource classes is to store the dependencies that came from the referencing RenderElement (such as its object bounding box) on the data object we store in the HashMap of the resource container object. Then, under applyResource, we compute those dependencies and compare them against the cached values. If they differ, we invalidate the cached values (such as the RefPtr<Gradient> of a gradient resource or the RefPtr<ImageBuffer> of a mask resource) and recompute them.
Radar WebKit Bug Importer
Comment 2 2022-07-13 21:26:15 PDT
Note You need to log in before you can comment on or make changes to this bug.