SVG should not paint selection within a mask
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Oct 2016 19:10:41 +0000 (19:10 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Oct 2016 19:10:41 +0000 (19:10 +0000)
commit362fdbde8cb06b270fdb20e3051bb2a5551a2a3c
tree0cd03562328debce4152b3094607245981aa89ac
parent82b2ea268aa87aca21f34bbf12449df6f29b2f28
SVG should not paint selection within a mask
https://bugs.webkit.org/show_bug.cgi?id=163772
<rdar://problem/28705129>

Reviewed by Simon Fraser.

Source/WebCore:

When masking content, we shouldn't paint the text
selection as we are rendering into the masking
offscreen buffer.

Test: svg/masking/mask-should-not-paint-selection.html

* rendering/PaintPhase.h: Add a new behavior - PaintBehaviorSkipSelectionHighlight.
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint): Don't update the selectionStyle if
PaintBehaviorSkipSelectionHighlight is true.
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Add PaintBehaviorSkipSelectionHighlight
to the PaintInfo.

LayoutTests:

* svg/masking/mask-should-not-paint-selection-expected.html: Added.
* svg/masking/mask-should-not-paint-selection.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/masking/mask-should-not-paint-selection-expected.html [new file with mode: 0644]
LayoutTests/svg/masking/mask-should-not-paint-selection.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/PaintPhase.h
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/rendering/svg/SVGRootInlineBox.cpp