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

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

Issue 2112643002: Reinstate BoxPainter's unrederable background rrect logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test tweak Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/backgrounds/unrenderable-rrect-crash-expected.txt ('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/BoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxPainter.cpp b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
index 0eca8fd2c22a06c57d874abc0147cbd48ba66aec..b7e005a61ba2af7da17a4dfb21571ceabfc4df5e 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
@@ -421,9 +421,14 @@ inline bool paintFastBottomLayer(const LayoutBoxModelObject& obj, const PaintInf
FloatRoundedRect border = info.isRoundedFill
? backgroundRoundedRectAdjustedForBleedAvoidance(obj, rect, bleedAvoidance, box, boxSize, info.includeLeftEdge, info.includeRightEdge)
: FloatRoundedRect(pixelSnappedIntRect(rect));
- // We only take this path for BorderFillBox. https://www.w3.org/TR/css3-background/#corner-overlap
- // should ensure that the border rrect is renderable.
- DCHECK(border.isRenderable());
+
+ Optional<RoundedInnerRectClipper> clipper;
+ if (info.isRoundedFill && !border.isRenderable()) {
chrishtr 2016/06/30 00:48:14 Why not ensure the border is renderable at the tim
f(malita) 2016/06/30 13:53:38 Yeah, that was my first thought also, but it turns
+ // When the rrect is not renderable, we resort to clipping.
+ // RoundedInnerRectClipper handles this case via discrete, corner-wise clipping.
+ clipper.emplace(obj, paintInfo, rect, border, ApplyToContext);
+ border.setRadii(FloatRoundedRect::Radii());
+ }
// Paint the color + shadow if needed.
if (info.shouldPaintColor) {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/backgrounds/unrenderable-rrect-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698