summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/svg
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/svg')
-rw-r--r--Source/WebCore/rendering/svg/SVGInlineTextBox.cpp3
-rw-r--r--Source/WebCore/rendering/svg/SVGRenderingContext.cpp4
-rw-r--r--Source/WebCore/rendering/svg/SVGRootInlineBox.cpp3
3 files changed, 7 insertions, 3 deletions
diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
index ddf4a8f5f..669066fdf 100644
--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -249,6 +249,7 @@ void SVGInlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
auto& parentRenderer = parent()->renderer();
bool paintSelectedTextOnly = paintInfo.phase == PaintPhaseSelection;
+ bool shouldPaintSelectionHighlight = !(paintInfo.paintBehavior & PaintBehaviorSkipSelectionHighlight);
bool hasSelection = !parentRenderer.document().printing() && selectionState() != RenderObject::SelectionNone;
if (!hasSelection && paintSelectedTextOnly)
return;
@@ -264,7 +265,7 @@ void SVGInlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
bool hasVisibleStroke = svgStyle.hasVisibleStroke();
RenderStyle* selectionStyle = &style;
- if (hasSelection) {
+ if (hasSelection && shouldPaintSelectionHighlight) {
selectionStyle = parentRenderer.getCachedPseudoStyle(SELECTION);
if (selectionStyle) {
const SVGRenderStyle& svgSelectionStyle = selectionStyle->svgStyle();
diff --git a/Source/WebCore/rendering/svg/SVGRenderingContext.cpp b/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
index 879513cb9..2dba13672 100644
--- a/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
@@ -295,7 +295,9 @@ void SVGRenderingContext::renderSubtreeToImageBuffer(ImageBuffer* image, RenderE
{
ASSERT(image);
- PaintInfo info(image->context(), LayoutRect::infiniteRect(), PaintPhaseForeground, PaintBehaviorNormal);
+ // Rendering into a buffer implies we're being used for masking, clipping, patterns or filters. In each of these
+ // cases we don't want to paint the selection.
+ PaintInfo info(image->context(), LayoutRect::infiniteRect(), PaintPhaseForeground, PaintBehaviorSkipSelectionHighlight);
AffineTransform& contentTransformation = currentContentTransformation();
AffineTransform savedContentTransformation = contentTransformation;
diff --git a/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp b/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
index be67d7484..c6d23f57c 100644
--- a/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
@@ -53,9 +53,10 @@ void SVGRootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
bool isPrinting = renderSVGText().document().printing();
bool hasSelection = !isPrinting && selectionState() != RenderObject::SelectionNone;
+ bool shouldPaintSelectionHighlight = !(paintInfo.paintBehavior & PaintBehaviorSkipSelectionHighlight);
PaintInfo childPaintInfo(paintInfo);
- if (hasSelection) {
+ if (hasSelection && shouldPaintSelectionHighlight) {
for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
if (is<SVGInlineTextBox>(*child))
downcast<SVGInlineTextBox>(*child).paintSelectionBackground(childPaintInfo);