haikuwebkit/LayoutTests/css3/masking/clip-path-border-radius-bor...

17 lines
341 B
HTML
Raw Permalink Normal View History

[CSS Shapes][css clip-path] rounded corner calculation for box shapes is wrong https://bugs.webkit.org/show_bug.cgi?id=127982 Reviewed by Simon Fraser. Source/WebCore: Calculate rounded corners for box shapes as defined in the CSS Shapes spec. Tests: css3/masking/clip-path-border-radius-border-box-000.html css3/masking/clip-path-border-radius-content-box-000.html css3/masking/clip-path-border-radius-content-box-001.html css3/masking/clip-path-border-radius-padding-box-000.html css3/masking/clip-path-border-radius-padding-box-001.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-000.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-001.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-002.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-000.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-001.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-002.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-003.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-000.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-001.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-002.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-003.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-004.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-000.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-001.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-002.html fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-003.html * platform/graphics/RoundedRect.h: (WebCore::RoundedRect::Radii::transposedRadii): Transpose radii for vertical writing modes. (WebCore::RoundedRect::moveBy): Add method for use with clip path. (WebCore::RoundedRect::transposedRect): Transpose rect for vertical writing modes. * rendering/RenderBox.h: (WebCore::RenderBox::marginBoxRect): Return the margin box rect for the RenderBox. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setupClipPath): Call the new function for the rounded corner calculation. * rendering/shapes/ShapeInfo.cpp: (WebCore::ShapeInfo<RenderType>::computedShape): Call the new function for the rounded corner calculation. * rendering/shapes/BoxShape.cpp: (WebCore::adjustRadiusForMarginBoxShape): Helper function for computeRoundedRectForLayoutBoxShape. (WebCore::computeMarginBoxShapeRadius): Ditto. (WebCore::computeMarginBoxShapeRadii): Ditto. (WebCore::computeRoundedRectForBoxShape): Utility function to do the rounded corner calculation. * rendering/shapes/BoxShape.h: Add new function. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::getRoundedInnerBorderFor): Add default argument values. LayoutTests: * css3/masking/clip-path-border-radius-border-box-000-expected.html: Added. * css3/masking/clip-path-border-radius-border-box-000.html: Added. * css3/masking/clip-path-border-radius-content-box-000-expected.html: Added. * css3/masking/clip-path-border-radius-content-box-000.html: Added. * css3/masking/clip-path-border-radius-content-box-001-expected.html: Added. * css3/masking/clip-path-border-radius-content-box-001.html: Added. * css3/masking/clip-path-border-radius-padding-box-000-expected.html: Added. * css3/masking/clip-path-border-radius-padding-box-000.html: Added. * css3/masking/clip-path-border-radius-padding-box-001-expected.html: Added. * css3/masking/clip-path-border-radius-padding-box-001.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-000-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-000.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-001-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-001.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-002-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-border-box-002.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-000-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-000.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-001-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-001.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-002-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-002.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-003-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-content-box-003.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-000-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-000.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-001-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-001.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-002-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-002.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-003-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-003.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-004-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-margin-box-004.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-000-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-000.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-001-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-001.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-002-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-002.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-003-expected.html: Added. * fast/shapes/shape-outside-floats/shape-outside-floats-border-radius-padding-box-003.html: Added. Canonical link: https://commits.webkit.org/148899@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-03-27 23:40:04 +00:00
<!DOCTYPE html>
<style>
.clip {
width: 100px;
height: 100px;
padding: 20px;
border: 20px solid rgba(0, 0, 0, 0);
border-radius: 30px;
margin: 20px;
background-color: blue;
-webkit-clip-path: inset(0px round 30px);
}
</style>
<body>
<div class="clip"></div>
</body>