b=417246, wrong border size rendering in some cases ; r=roc

This commit is contained in:
vladimir@pobox.com 2008-03-05 23:58:58 -08:00
parent c8cf53147c
commit 26262aaee9
4 changed files with 32 additions and 13 deletions

View File

@ -1103,9 +1103,6 @@ GetBorderCornerDimensions(const gfxRect& oRect,
const gfxFloat *radii,
gfxSize *oDims)
{
gfxFloat halfWidth = oRect.size.width / 2.0;
gfxFloat halfHeight = oRect.size.height / 2.0;
gfxFloat topWidth = iRect.pos.y - oRect.pos.y;
gfxFloat leftWidth = iRect.pos.x - oRect.pos.x;
gfxFloat rightWidth = oRect.size.width - iRect.size.width - leftWidth;
@ -1118,16 +1115,10 @@ GetBorderCornerDimensions(const gfxRect& oRect,
bottomWidth = PR_MAX(bottomWidth, PR_MAX(radii[C_BR], radii[C_BL]));
}
// Make sure that the computed corner size doesn't ever go beyond
// half of the full border width/height
oDims[C_TL] = gfxSize(PR_MIN(halfWidth, leftWidth * CORNER_FACTOR),
PR_MIN(halfHeight, topWidth * CORNER_FACTOR));
oDims[C_TR] = gfxSize(PR_MIN(halfWidth, rightWidth * CORNER_FACTOR),
PR_MIN(halfHeight, topWidth * CORNER_FACTOR));
oDims[C_BL] = gfxSize(PR_MIN(halfWidth, leftWidth * CORNER_FACTOR),
PR_MIN(halfHeight, bottomWidth * CORNER_FACTOR));
oDims[C_BR] = gfxSize(PR_MIN(halfWidth, rightWidth * CORNER_FACTOR),
PR_MIN(halfHeight, bottomWidth * CORNER_FACTOR));
oDims[C_TL] = gfxSize(leftWidth, topWidth);
oDims[C_TR] = gfxSize(rightWidth, topWidth);
oDims[C_BL] = gfxSize(leftWidth, bottomWidth);
oDims[C_BR] = gfxSize(rightWidth, bottomWidth);
}
/* Set up a path for rendering just the corners of the path. Executed

View File

@ -0,0 +1,13 @@
<html>
<head>
<style>
.a {
border-top: 40px solid blue;
border-bottom: 20px solid green;
width: 200px;
}
</style>
</head>
<body>
<div class="a"></div>
</body> </html>

View File

@ -0,0 +1,14 @@
<html>
<head>
<style>
.a {
border-top: 40px solid blue;
border-bottom: 20px dashed green;
background: green;
width: 200px;
}
</style>
</head>
<body>
<div class="a"></div>
</body> </html>

View File

@ -737,6 +737,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
== 414851-1.html 414851-1-ref.html
== 416106-1.xhtml 416106-1-ref.xhtml
== 416752-1.html 416752-1-ref.html
== 417246-1.html 417246-1-ref.html
== 417676.html 417676-ref.html
== 418766-1a.html 418766-1-ref.html
== 418766-1b.html 418766-1-ref.html