mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
Issue #3109 - Clamp border-radius value to Int32.MaxValue
This avoids artifacts from out-of-bounds values. Resolves #3109
This commit is contained in:
parent
6e43835b34
commit
3ad2791ea1
1 changed files with 5 additions and 2 deletions
|
|
@ -8157,11 +8157,14 @@ nsRuleNode::ComputeBorderData(void* aStartStruct,
|
||||||
NS_FOR_CSS_FULL_CORNERS(corner) {
|
NS_FOR_CSS_FULL_CORNERS(corner) {
|
||||||
int cx = FullToHalfCorner(corner, false);
|
int cx = FullToHalfCorner(corner, false);
|
||||||
int cy = FullToHalfCorner(corner, true);
|
int cy = FullToHalfCorner(corner, true);
|
||||||
const nsCSSValue& radius = *aRuleData->ValueFor(subprops[corner]);
|
nsCSSValue radius = *aRuleData->ValueFor(subprops[corner]);
|
||||||
nsStyleCoord parentX = parentBorder->mBorderRadius.Get(cx);
|
nsStyleCoord parentX = parentBorder->mBorderRadius.Get(cx);
|
||||||
nsStyleCoord parentY = parentBorder->mBorderRadius.Get(cy);
|
nsStyleCoord parentY = parentBorder->mBorderRadius.Get(cy);
|
||||||
nsStyleCoord coordX, coordY;
|
nsStyleCoord coordX, coordY;
|
||||||
|
// Clamp border radius to the max value so it will not wrap and cause artifacts.
|
||||||
|
if (radius.GetFloatValue() > RADIUS_MAX) {
|
||||||
|
radius.SetFloatValue(RADIUS_MAX, eCSSUnit_Number);
|
||||||
|
}
|
||||||
if (SetPairCoords(radius, coordX, coordY, parentX, parentY,
|
if (SetPairCoords(radius, coordX, coordY, parentX, parentY,
|
||||||
SETCOORD_LPH | SETCOORD_INITIAL_ZERO |
|
SETCOORD_LPH | SETCOORD_INITIAL_ZERO |
|
||||||
SETCOORD_STORE_CALC | SETCOORD_UNSET_INITIAL,
|
SETCOORD_STORE_CALC | SETCOORD_UNSET_INITIAL,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue