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

Unified Diff: Source/core/rendering/RenderReplaced.cpp

Issue 16688004: Large canvas does not honor containing div's border radius (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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: Source/core/rendering/RenderReplaced.cpp
diff --git a/Source/core/rendering/RenderReplaced.cpp b/Source/core/rendering/RenderReplaced.cpp
index 93db7ed2d3e54c4cebd894321c8c13bad8d20a4a..bdfa1e82a8e69533c2405fecace4c1c3b06113ab 100644
--- a/Source/core/rendering/RenderReplaced.cpp
+++ b/Source/core/rendering/RenderReplaced.cpp
@@ -120,11 +120,14 @@ void RenderReplaced::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
return;
}
+ if (paintInfo.phase == PaintPhaseBorderRadiusMask && (!hasLayer() || !layer()->hasCompositedBorderRadiusMask()))
+ return;
+
LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size());
if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
paintOutline(paintInfo, paintRect);
- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && !canHaveChildren())
+ if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && !canHaveChildren() && paintInfo.phase != PaintPhaseBorderRadiusMask)
return;
if (!paintInfo.shouldPaintWithinRoot(this))
@@ -153,7 +156,11 @@ void RenderReplaced::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
}
if (!completelyClippedOut) {
- paintReplaced(paintInfo, adjustedPaintOffset);
+ if (paintInfo.phase == PaintPhaseBorderRadiusMask) {
+ paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black);
+ } else {
+ paintReplaced(paintInfo, adjustedPaintOffset);
+ }
if (style()->hasBorderRadius())
paintInfo.context->restore();
@@ -171,7 +178,7 @@ void RenderReplaced::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline
- && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseMask)
+ && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseMask && paintInfo.phase != PaintPhaseBorderRadiusMask)
return false;
if (!paintInfo.shouldPaintWithinRoot(this))

Powered by Google App Engine
This is Rietveld 408576698