Bug 242425 - avoid invalidating SVG resources when referencing element changes style
Summary: avoid invalidating SVG resources when referencing element changes style
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-06 22:20 PDT by Cameron McCormack (:heycam)
Modified: 2022-07-14 18:08 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2022-07-06 22:20:47 PDT
SVGResourcesCache::clientStyleChanged will destroy then recreate the SVG resources for an element when it is restyled and the StyleDifference is not Repaint or RepaintIfText.  This is not necessary for many property changes.  We only need to do this if there is a change in which resource is being referenced (i.e., the clip-path, mask-image, fill, etc. property changed), or if there is a property change on the element that a cached resource depends on.

One specific example is when the transform of a client RenderElement changes.  With the work to make resources handle client layout changes lazily in bug 242420, transforms will be taken into account as part of the resource validation process at paint time, if needed.  So if the transform changes we don't need to destroy and recreate the full set of SVG resources here in clientStyleChanged.
Comment 1 Radar WebKit Bug Importer 2022-07-06 22:20:55 PDT
<rdar://problem/96572561>
Comment 2 Cameron McCormack (:heycam) 2022-07-06 22:38:30 PDT
Pull request: https://github.com/WebKit/WebKit/pull/2154
Comment 3 EWS 2022-07-14 18:08:06 PDT
Committed 252484@main (fda943aadc10): <https://commits.webkit.org/252484@main>

Reviewed commits have been landed. Closing PR #2154 and removing active labels.