Bug 132533

Summary: Pass around RenderStyle by const-reference inside SVGInlineTextBox.
Product: WebKit Reporter: Andreas Kling <kling>
Component: SVGAssignee: Andreas Kling <kling>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, commit-queue, dbates, d-r, esprehn+autocc, fmalita, glenn, gyuyoung.kim, kondapallykalyan, krit, pdr, schenney, sergio, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch dbates: review+

Description Andreas Kling 2014-05-03 15:16:56 PDT
Functions that immediately start by asserting that some Foo* argument is non-null are silly.
Comment 1 Andreas Kling 2014-05-03 15:19:51 PDT
Created attachment 230766 [details]
Patch
Comment 2 Daniel Bates 2014-05-03 16:19:34 PDT
Comment on attachment 230766 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=230766&action=review

> Source/WebCore/ChangeLog:9
> +        Reviewed by NOBODY (OOPS!).

The reviewed by line should precede the description of the change log entry.

> Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:204
> +    const RenderStyle* selectionStyle = &style;

This local variables isn't used in a meaningful way in this function. I mean, we only assign a value(s) to it and never reference it. Shouldn't we be referencing this variable instead of |style| in SVGInlineTextBox::selectionRectForTextFragment() and GraphicsContext::fillRect() below?

> Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:273
> +    const RenderStyle* selectionStyle = &style;
>      if (hasSelection) {
>          selectionStyle = parentRenderer.getCachedPseudoStyle(SELECTION);
>          if (selectionStyle) {

This is OK as-is. We should consider simplifying this code so as to remove an extraneous assignment to selectionStyle when parentRenderer.getCachedPseudoStyle(SELECTION) (on line 272) returns null. We can do this in another patch.
Comment 3 Dirk Schulze 2014-07-12 23:22:18 PDT
Will you land this kling?
Comment 4 Ahmad Saleem 2022-09-22 15:59:38 PDT
It seems that this r+ patch didn't landed.

Is this needed anymore? Thanks!
Comment 5 Ahmad Saleem 2024-07-18 07:04:15 PDT
It seems to be done - https://searchfox.org/wubkat/rev/7cf0e3722de99a6fc09380aae193381be6733ebb/Source/WebCore/rendering/svg/SVGInlineTextBox.h#78

Marking this as 'REOSLVED CONFIGURATION CHANGED'.