Bug 163772 - SVG should not paint selection within a mask
Summary: SVG should not paint selection within a mask
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-20 19:04 PDT by Dean Jackson
Modified: 2016-10-21 12:14 PDT (History)
0 users

See Also:


Attachments
Patch (6.63 KB, patch)
2016-10-20 19:07 PDT, Dean Jackson
no flags Details | Formatted Diff | Diff
Patch (8.28 KB, patch)
2016-10-21 12:00 PDT, Dean Jackson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2016-10-20 19:04:19 PDT
SVG should not paint selection within a mask
Comment 1 Dean Jackson 2016-10-20 19:07:53 PDT
Created attachment 292308 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-10-20 19:13:20 PDT
Comment on attachment 292308 [details]
Patch

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

> Source/WebCore/rendering/PaintPhase.h:66
> +    PaintBehaviorDoNotPaintSelection = 1 << 8,

I would call this PaintBehaviorSkipSelection and put it after PaintBehaviorSelectionOnly, adjusting the bit shifts accordingly.

I think PaintBehaviorSelectionOnly could use a rename too, since it doesn't mean "paint the selection", it means "paint the selected content". Either that or rename yours to "PaintBehaviorSkipSelectionHighlight".

> Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:266
> -    if (hasSelection) {
> +    if (hasSelection && shouldPaintSelection) {

If you introduce this flag, you need to make to work for all painting, not just SVG text painting.
Comment 3 Dean Jackson 2016-10-21 12:00:04 PDT
Created attachment 292379 [details]
Patch
Comment 4 Simon Fraser (smfr) 2016-10-21 12:01:39 PDT
Comment on attachment 292379 [details]
Patch

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

> Source/WebCore/rendering/PaintPhase.h:66
> +    PaintBehaviorSkipSelectionHighlight = 1 << 1,
> +    PaintBehaviorForceBlackText = 1 << 2,
> +    PaintBehaviorForceWhiteText = 1 << 3,
> +    PaintBehaviorFlattenCompositingLayers = 1 << 4,
> +    PaintBehaviorRenderingSVGMask = 1 << 5,
> +    PaintBehaviorSkipRootBackground = 1 << 6,
> +    PaintBehaviorRootBackgroundOnly = 1 << 7,
> +    PaintBehaviorSelectionAndBackgroundsOnly = 1 << 8,

I've taken to lining up the = 1 << ... to make it easier to edit them, and to spot errors.
Comment 5 Dean Jackson 2016-10-21 12:14:20 PDT
Committed r207692: <http://trac.webkit.org/changeset/207692>