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

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

Issue 1420563006: SVG should respect overflow:visible even with border-radius (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small nits Created 5 years, 1 month 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/ReplacedPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp b/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp
index 96793b41e7d4479c10bedf713d7317c7b3e04165..1d890afc1a4d8bb93a89a94ad75a572621991717 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"
@@ -59,16 +60,18 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
if (borderRect.isEmpty()) {
completelyClippedOut = true;
} else {
- // 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(
- -(m_layoutReplaced.paddingTop() + m_layoutReplaced.borderTop()),
- -(m_layoutReplaced.paddingRight() + m_layoutReplaced.borderRight()),
- -(m_layoutReplaced.paddingBottom() + m_layoutReplaced.borderBottom()),
- -(m_layoutReplaced.paddingLeft() + m_layoutReplaced.borderLeft())),
- true, true);
-
- clipper.emplace(m_layoutReplaced, paintInfo, borderRect, roundedInnerRect, ApplyToDisplayList);
+ if (!m_layoutReplaced.isSVGRoot() || toLayoutSVGRoot(&m_layoutReplaced)->shouldApplyViewportClip()) {
fs 2015/11/16 15:35:03 Could you put this in a helper method, and then do
Shanmuga Pandi 2015/11/17 06:11:15 Done.
+ // 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(
+ -(m_layoutReplaced.paddingTop() + m_layoutReplaced.borderTop()),
+ -(m_layoutReplaced.paddingRight() + m_layoutReplaced.borderRight()),
+ -(m_layoutReplaced.paddingBottom() + m_layoutReplaced.borderBottom()),
+ -(m_layoutReplaced.paddingLeft() + m_layoutReplaced.borderLeft())),
+ true, true);
+
+ clipper.emplace(m_layoutReplaced, paintInfo, borderRect, roundedInnerRect, ApplyToDisplayList);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698