[webkit-reviews] review granted: [Bug 205217] Nullptr crash if SVG element if element parent becomes document node : [Attachment 385640] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Dec 13 13:55:03 PST 2019
Darin Adler <darin at apple.com> has granted Sunny He <sunny_he at apple.com>'s
request for review:
Bug 205217: Nullptr crash if SVG element if element parent becomes document
node
https://bugs.webkit.org/show_bug.cgi?id=205217
Attachment 385640: Patch
https://bugs.webkit.org/attachment.cgi?id=385640&action=review
--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 385640
--> https://bugs.webkit.org/attachment.cgi?id=385640
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=385640&action=review
> Source/WebCore/rendering/svg/RenderSVGText.cpp:375
> - } else if (m_needsTextMetricsUpdate ||
SVGRenderSupport::findTreeRootObject(*this)->isLayoutSizeChanged()) {
> + } else if (m_needsTextMetricsUpdate ||
(SVGRenderSupport::findTreeRootObject(*this) &&
SVGRenderSupport::findTreeRootObject(*this)->isLayoutSizeChanged())) {
The word "find" in the function name here is supposed to be a hint that the
operation is nontrivial, so I suggest we restructure slightly so we can use a
local variable and don’t need to call the function twice. Or rename the
function if "find" is a guaranteed-inexpensive operation.
More information about the webkit-reviews
mailing list