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

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: 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
« no previous file with comments | « LayoutTests/platform/linux/fast/masking/clip-path-inset-large-radii-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..56c7018b8451da1b14c2991f04a2d097d89c1ce1 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),
+ FloatRect rect(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)
« no previous file with comments | « LayoutTests/platform/linux/fast/masking/clip-path-inset-large-radii-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698