When we set border-radius on <hr>, make the ends circular rather than elliptical. (Bug 597721) r=bzbarsky a2.0=blocking:betaN

This commit is contained in:
L. David Baron 2010-10-06 21:25:44 -07:00
parent 2f435cdf89
commit c4f6132d18
4 changed files with 17 additions and 2 deletions

View File

@ -280,13 +280,15 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
// If it would be noticeable, set the border radius to
// 100% on all corners
// 10000px on all corners; this triggers the clamping to make
// circular ends. This assumes the <hr> isn't larger than
// that in *both* dimensions.
nsCSSCornerSizes& corners = aData->mMarginData->mBorderRadius;
NS_FOR_CSS_FULL_CORNERS(c) {
nsCSSValue& dimen = corners.GetCorner(c);
if (dimen.GetUnit() == eCSSUnit_Null) {
dimen.SetPercentValue(1.0f);
dimen.SetFloatValue(10000.0f, eCSSUnit_Pixel);
}
}
}

View File

@ -0,0 +1,8 @@
<!DOCTYPE HTML>
<title>HR elements should have circular ends, not elliptical</title>
<body style="margin:0; font-size: 0">
<hr size="100" color="blue">
<div style="position: absolute; background: red; height: 5px; width: 5px; top: 1px; left: 51px; z-index: -1"></div>
<div style="position: absolute; background: red; height: 5px; width: 5px; top: 1px; right: 51px; z-index: -1"></div>
<div style="position: absolute; background: red; height: 5px; width: 5px; top: 94px; left: 51px; z-index: -1"></div>
<div style="position: absolute; background: red; height: 5px; width: 5px; top: 94px; right: 51px; z-index: -1"></div>

View File

@ -0,0 +1,4 @@
<!DOCTYPE HTML>
<title>HR elements should have circular ends, not elliptical</title>
<body style="margin:0; font-size: 0">
<hr size="100" color="blue">

View File

@ -1506,4 +1506,5 @@ random-if(layersGPUAccelerated) == 581317-1.html 581317-1-ref.html
== 593544-1.html 593544-1-ref.html
== 594737-1.html 594737-1-ref.html
== 594624-1.html 594624-1-ref.html
== 597721-1.html 597721-1-ref.html
fails-if(!haveTestPlugin) == 599476.html 599476-ref.html