Bug 135326 - Cleanup RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo.
Summary: Cleanup RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-26 20:59 PDT by zalan
Modified: 2014-07-29 07:51 PDT (History)
10 users (show)

See Also:


Attachments
Patch (9.84 KB, patch)
2014-07-26 22:28 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (17.00 KB, patch)
2014-07-28 21:00 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (21.02 KB, patch)
2014-07-29 07:02 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-07-26 20:59:54 PDT
instead of pointer to the renderer.
Comment 1 zalan 2014-07-26 22:28:41 PDT
Created attachment 235581 [details]
Patch
Comment 2 Darin Adler 2014-07-27 23:10:55 PDT
Comment on attachment 235581 [details]
Patch

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

Good refactoring.

> Source/WebCore/ChangeLog:3
> +        RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo should take renderer reference.

Bug title is a little more specific than the slightly broader refactoring this patch does.

> Source/WebCore/rendering/RenderSelectionInfo.h:37
> +    explicit RenderSelectionInfoBase(RenderObject& renderer)

Too bad we can’t make the type tighter than RenderObject, but I don’t think we can.

> Source/WebCore/rendering/RenderSelectionInfo.h:51
> +    void repaintRectangle(const LayoutRect& repaintRect)
> +    {
> +        m_renderer.repaintUsingContainer(m_repaintContainer, enclosingIntRect(repaintRect));
> +    }

I’m not sure this should be in the class definition. I think classes are easier to read if we move multiple-line function definitions out of the class definitions. I’ve been doing that when working on various header files.

> Source/WebCore/rendering/RenderSelectionInfo.h:84
> -    Vector<LayoutRect> m_rects;
> +    Vector<LayoutRect> m_rects; // relative to repaint container
>      LayoutRect m_rect; // relative to repaint container

Really unclear how these data members relate. Same is true of the two public functions that expose them; not clear why we have both.
Comment 3 zalan 2014-07-28 21:00:32 PDT
Created attachment 235661 [details]
Patch
Comment 4 zalan 2014-07-28 21:00:51 PDT
Comment on attachment 235661 [details]
Patch

EWS testing.
Comment 5 zalan 2014-07-29 07:02:17 PDT
Created attachment 235686 [details]
Patch
Comment 6 zalan 2014-07-29 07:02:39 PDT
Comment on attachment 235686 [details]
Patch

EWS
Comment 7 WebKit Commit Bot 2014-07-29 07:51:51 PDT
Comment on attachment 235686 [details]
Patch

Clearing flags on attachment: 235686

Committed r171744: <http://trac.webkit.org/changeset/171744>
Comment 8 WebKit Commit Bot 2014-07-29 07:51:57 PDT
All reviewed patches have been landed.  Closing bug.