-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not synchronously measure SVG text every time it changes #21278
Do not synchronously measure SVG text every time it changes #21278
Conversation
EWS run on current version of this PR (hash 883a96f) |
@vitorroriz - does it show any performance improvement in WebKit through A/B Test or on any specific benchmark? |
I don't know yet. I've tried running benchmarks for it before but I was having some build issues. I'm trying again now. |
A/B tests show no progression/regression for this patch. But since it is a bit specific (multiple consecutive updates of SVG text), it might be our benchmarks don't cover that and that's still a valid patch. Maybe @shallawa can have a look at it. |
https://bugs.webkit.org/show_bug.cgi?id=264669 rdar://problem/118451741 Reviewed by Simon Fraser. This is a optimization done in the Blink fork https://chromium.googlesource.com/chromium/src.git/+/34c351416a102e4ee510badb86fbc4f57604ccd0 and found by Ahmad Saleem. If SVG text is set multiple times in a row, we would measure text synchronously for every set, even though just the last measurement would count. This patch marks it as "need layout", so we measure text in the next layout. * Source/WebCore/rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::subtreeTextDidChange): Canonical link: https://commits.webkit.org/271678@main
883a96f
to
97f84b2
Compare
Committed 271678@main (97f84b2): https://commits.webkit.org/271678@main Reviewed commits have been landed. Closing PR #21278 and removing active labels. |
for (RenderObject* descendant = text; descendant; descendant = descendant->nextInPreOrder(text)) { | ||
if (is<RenderSVGInlineText>(*descendant)) | ||
m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(downcast<RenderSVGInlineText>(*descendant)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is so special about subtreeTextDidChange()
? The same function buildLayoutAttributesForTextRenderer()
is called from subtreeChildWasAdded()
and subtreeChildWasRemoved()
in the same file. So why do not we apply the same fix in these two functions as well?
Also are we sure this will not affect JS querying the SVG text in the same update-the-rendering this function is called?
97f84b2
883a96f