Bug 242420
Summary: | ☂️ avoid invalidating SVG resources when referencing element changes layout | ||
---|---|---|---|
Product: | WebKit | Reporter: | Cameron McCormack (:heycam) <heycam> |
Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer, zimmermann |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 242778, 242421, 242423 | ||
Bug Blocks: |
Cameron McCormack (:heycam)
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Cameron McCormack (:heycam)
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
<rdar://problem/96991415>