Index: third_party/WebKit/Source/core/paint/ReplacedPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp b/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp |
index 96793b41e7d4479c10bedf713d7317c7b3e04165..922f5bd7af976e068f240d3c72989882c9ab99b3 100644 |
--- a/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp |
@@ -7,6 +7,7 @@ |
#include "core/layout/LayoutReplaced.h" |
#include "core/layout/api/SelectionState.h" |
+#include "core/layout/svg/LayoutSVGRoot.h" |
#include "core/paint/BoxPainter.h" |
#include "core/paint/LayoutObjectDrawingRecorder.h" |
#include "core/paint/ObjectPainter.h" |
@@ -17,6 +18,11 @@ |
namespace blink { |
+static bool shouldApplyViewportClip(const LayoutReplaced& layoutReplaced) |
+{ |
+ return !layoutReplaced.isSVGRoot() || toLayoutSVGRoot(&layoutReplaced)->shouldApplyViewportClip(); |
+} |
+ |
void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
{ |
if (!m_layoutReplaced.shouldPaint(paintInfo, paintOffset)) |
@@ -58,7 +64,7 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint |
if (m_layoutReplaced.style()->hasBorderRadius()) { |
if (borderRect.isEmpty()) { |
completelyClippedOut = true; |
- } else { |
+ } else if (shouldApplyViewportClip(m_layoutReplaced)) { |
// Push a clip if we have a border radius, since we want to round the foreground content that gets painted. |
FloatRoundedRect roundedInnerRect = m_layoutReplaced.style()->getRoundedInnerBorderFor(borderRect, |
LayoutRectOutsets( |