Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp

Issue 2648343004: Don't paint selections in <mask>s, <clipPath>s and <pattern>s (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
index f992bd601a8cdfccb0fdb315a572fa91f50a8acb..3d91da3adac68c69b119e869fa603f8ffa459ae0 100644
--- a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -37,8 +37,14 @@ static inline bool textShouldBePainted(
bool SVGInlineTextBoxPainter::shouldPaintSelection(
const PaintInfo& paintInfo) const {
- return !paintInfo.isPrinting() &&
- m_svgInlineTextBox.getSelectionState() != SelectionNone;
+ // Don't paint selections when printing.
+ if (paintInfo.isPrinting())
+ return false;
+ // Don't paint selections when rendering a mask, clip-path (as a mask),
+ // pattern or feImage (element reference.)
+ if (paintInfo.isRenderingResourceSubtree())
+ return false;
+ return m_svgInlineTextBox.getSelectionState() != SelectionNone;
}
static bool hasShadow(const PaintInfo& paintInfo, const ComputedStyle& style) {

Powered by Google App Engine
This is Rietveld 408576698