haikuwebkit/LayoutTests/fast/borders/border-non-renderable-radiu...

68 lines
1.7 KiB
HTML
Raw Permalink Normal View History

border-radius with different width and height rendered wrong https://bugs.webkit.org/show_bug.cgi?id=158300 <rdar://problem/26672922> Reviewed by Zalan Bujtas. Source/WebCore: Borders with border-radius close to 100% 100% got oddly clipped. This happened because of the clipping we do to achieve the diagonal corner joins; RenderBoxModelObject::clipBorderSidePolygon() created trapezoids for each side, but only extended them to the center of the inner border rect. This clipped out parts of these borders. Fix by computing the trapezoids by intersecting the corner diagonal line with a line that passes through the adjacent corners of the inner rect, whose intersection is always going to be inside the rounded border. Also fix the quads used to do the antialiased/non-antialiased clipping, by adding a point rather than moving a corner point to ensure we don't mistakenly clip out any parts of the border. Finally, improve the rendering of non-renderable cases by actually doing the diagonal corner joins rather than just giving up. Tests: fast/borders/border-non-renderable-radius-inner-clip.html fast/borders/border-radius-inner-clip-vertical.html fast/borders/border-radius-inner-clip.html * rendering/RenderBoxModelObject.cpp: (WebCore::calculateAdjustedInnerBorder): Moved up. (WebCore::RenderBoxModelObject::paintOneBorderSide): (WebCore::RenderBoxModelObject::clipBorderSidePolygon): (WebCore::findInnerVertex): Deleted. (WebCore::calculateSideRectIncludingInner): Deleted. (WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath): Deleted. * rendering/RenderBoxModelObject.h: LayoutTests: * fast/borders/border-non-renderable-radius-inner-clip-expected.html: Added. * fast/borders/border-non-renderable-radius-inner-clip.html: Added. * fast/borders/border-radius-inner-clip-expected-mismatch.html: Added. * fast/borders/border-radius-inner-clip-vertical-expected-mismatch.html: Added. * fast/borders/border-radius-inner-clip-vertical.html: Added. * fast/borders/border-radius-inner-clip.html: Added. * fast/borders/resources/border-radius-helpers.js: Added. (createContainer): (createReferenceContainer): Canonical link: https://commits.webkit.org/176650@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-09 16:59:17 +00:00
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
body {
margin: 0;
}
div {
box-sizing: border-box;
}
.container {
position: relative;
width: 800px;
height: 100px;
margin: 10px 0;
padding: 20px;
}
.container div {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 1px solid black;
}
</style>
<script src="resources/border-radius-helpers.js"></script>
<script>
const borderWidth = 50;
const corners = [
'top-left',
'top-right',
'bottom-left',
'bottom-right'
];
const clipPaths = [
'inset(10px 2px 60px 500px)',
'inset(10px 500px 60px 2px)',
'inset(60px 2px 10px 500px)',
'inset(60px 500px 10px 20px)'
];
var colors = [
'green',
'red'
];
var radii = '1178px 178px';
function doSetup()
{
for (var index in corners)
document.body.appendChild(createContainer(corners[index], colors, clipPaths[index], radii));
}
window.addEventListener('load', doSetup, false);
</script>
</head>
<body>
</body>
</html>