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

Unified Diff: Source/core/rendering/style/BasicShapes.cpp

Issue 839903003: [CSS Masking][CSS Shapes] Large corner radii use with inset() clip-path are not properly constrained (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adds NeedsRebaseline Created 5 years, 11 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/style/BasicShapes.cpp
diff --git a/Source/core/rendering/style/BasicShapes.cpp b/Source/core/rendering/style/BasicShapes.cpp
index 74c13eeb3f878146efb57a048123a9f828902b0b..c83c9579a5398a35ea124ebffba649ddefb7bb62 100644
--- a/Source/core/rendering/style/BasicShapes.cpp
+++ b/Source/core/rendering/style/BasicShapes.cpp
@@ -31,6 +31,7 @@
#include "core/rendering/style/BasicShapes.h"
#include "core/css/BasicShapeFunctions.h"
+#include "core/rendering/style/RenderStyle.h"
#include "platform/CalculationValue.h"
#include "platform/LengthFunctions.h"
#include "platform/geometry/FloatRect.h"
@@ -227,18 +228,15 @@ void BasicShapeInset::path(Path& path, const FloatRect& boundingBox)
ASSERT(path.isEmpty());
float left = floatValueForLength(m_left, boundingBox.width());
float top = floatValueForLength(m_top, boundingBox.height());
- path.addRoundedRect(
- FloatRect(
- left + boundingBox.x(),
- top + boundingBox.y(),
- std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0),
- std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0)
- ),
- floatSizeForLengthSize(m_topLeftRadius, boundingBox),
+ auto rect = FloatRect(left + boundingBox.x(), top + boundingBox.y(),
+ std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0),
+ std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0));
+ auto radii = FloatRoundedRect::Radii(floatSizeForLengthSize(m_topLeftRadius, boundingBox),
floatSizeForLengthSize(m_topRightRadius, boundingBox),
floatSizeForLengthSize(m_bottomLeftRadius, boundingBox),
- floatSizeForLengthSize(m_bottomRightRadius, boundingBox)
- );
+ floatSizeForLengthSize(m_bottomRightRadius, boundingBox));
+ radii.scale(calcBorderRadiiConstraintScaleFor(rect, radii));
+ path.addRoundedRect(FloatRoundedRect(rect, radii));
}
static inline LengthSize blendLengthSize(const LengthSize& to, const LengthSize& from, double progress)

Powered by Google App Engine
This is Rietveld 408576698