Bug 264669

Summary: Do not synchronously measure SVG text every time it changes
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: fantasai.bugs, karlcow, rbuis, sabouhallawa, simon.fraser, vitor.roriz, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2023-11-11 05:16:30 PST
Hi team,

While going through Blink's commit, I came across another potential optimization but I haven't confirmed whether it is something applicable in WebKit realm or not.

Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/34c351416a102e4ee510badb86fbc4f57604ccd0

WebKit Source: https://searchfox.org/wubkat/rev/3e2262b3476ecfb5666a35bcdd746d474c061b0d/Source/WebCore/rendering/svg/RenderSVGText.cpp#286

Just wanted to raise to get an input from others.

____

It compiles:

// The positioning elements cache depends on the size of each text renderer in the
    // subtree. If this changes, clear the cache and mark it for rebuilding in the next layout.
    m_layoutAttributesBuilder.clearTextPositioningElements();
    setNeedsPositioningValuesUpdate();
    setNeedsLayout();

_____

Thanks!
Comment 1 Vitor Roriz 2023-11-15 05:32:17 PST
Cool. I can check if break anything and/or have a significant performance boost with that change. Thank you!
Comment 2 Radar WebKit Bug Importer 2023-11-15 06:08:07 PST
<rdar://problem/118451741>
Comment 3 Vitor Roriz 2023-12-04 07:25:39 PST
Pull request: https://github.com/WebKit/WebKit/pull/21278
Comment 4 EWS 2023-12-07 09:40:58 PST
Committed 271678@main (97f84b2e6bd1): <https://commits.webkit.org/271678@main>

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