Bug 132533 - Pass around RenderStyle by const-reference inside SVGInlineTextBox.
Summary: Pass around RenderStyle by const-reference inside SVGInlineTextBox.
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-03 15:16 PDT by Andreas Kling
Modified: 2024-07-18 07:04 PDT (History)
14 users (show)

See Also:


Attachments
Patch (16.28 KB, patch)
2014-05-03 15:19 PDT, Andreas Kling
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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'.