Bug 117347 - [rendering] Use foreground color to render the overtype caret
Summary: [rendering] Use foreground color to render the overtype caret
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Claudio Saavedra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-07 07:18 PDT by Claudio Saavedra
Modified: 2013-06-07 08:37 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.46 KB, patch)
2013-06-07 07:22 PDT, Claudio Saavedra
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Saavedra 2013-06-07 07:18:54 PDT
[rendering] Use foreground color to render the overtype caret
Comment 1 Claudio Saavedra 2013-06-07 07:22:21 PDT
Created attachment 204042 [details]
Patch
Comment 2 Darin Adler 2013-06-07 07:27:00 PDT
Comment on attachment 204042 [details]
Patch

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

> Source/WebCore/rendering/RenderObject.cpp:1640
> +                color = frame()->selection()->isFocusedAndActive() ?
>                      theme()->activeSelectionBackgroundColor() :
>                      theme()->inactiveSelectionBackgroundColor();

WebKit style guide says to put the "?" and ":" at the beginnings of lines, not the ends of lines, or this fits fine on one line, I think.

> Source/WebCore/rendering/RenderView.h:344
> +    bool m_selectionWasCaret;

It would be better to initialize this when in the RenderView constructor, even if the code will work OK with an uninitialized boolean. If nothing else, the uninitialized read it will irritate people using memory tools like valgrind.
Comment 3 Claudio Saavedra 2013-06-07 08:37:08 PDT
Committed r151322: <http://trac.webkit.org/changeset/151322>