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

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

Issue 1675823002: Force bleed avoidance for some background image rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/BoxDecorationData.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp b/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp
index ef35fb1fffab783a39ddaa21d7c09b690541270b..822c00c4e36587792236dfdb3046ae8bac918419 100644
--- a/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp
@@ -47,13 +47,19 @@ BackgroundBleedAvoidance BoxDecorationData::determineBackgroundBleedAvoidance(co
if (!hasBackground)
return BackgroundBleedNone;
- if (!hasBorderDecoration || !layoutBox.style()->hasBorderRadius() || layoutBox.canRenderBorderImage()) {
+ const ComputedStyle& boxStyle = *layoutBox.style();
jbroman 2016/02/09 22:06:21 nit: *layoutBox.style() equivalent to layoutBox.st
+ const bool hasBorderRadius = boxStyle.hasBorderRadius();
+ if (!hasBorderDecoration || !hasBorderRadius || layoutBox.canRenderBorderImage()) {
if (layoutBox.backgroundShouldAlwaysBeClipped())
return BackgroundBleedClipOnly;
+ if (backgroundColor.alpha() && boxStyle.hasBackgroundImage() && hasBorderRadius) {
f(malita) 2016/02/09 22:07:39 I think one can stack background layers arbitraril
+ // Prevent bleeding of background color behind the background image when we clip for the border radius
+ return BackgroundBleedClipLayer;
+ }
return BackgroundBleedNone;
}
- if (borderObscuresBackgroundEdge(*layoutBox.style()))
+ if (borderObscuresBackgroundEdge(boxStyle))
return BackgroundBleedShrinkBackground;
return BackgroundBleedClipLayer;

Powered by Google App Engine
This is Rietveld 408576698