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

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: Align with review comments 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/overflow/overflow-visible-with-border-radius-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/overflow/overflow-visible-with-border-radius-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698