mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Fix CSS border rounding and currentcolor clipping
This commit is contained in:
parent
6c7e6095b5
commit
84b9b77335
10 changed files with 147 additions and 21 deletions
|
|
@ -3312,6 +3312,66 @@ nsComputedDOMStyle::DoGetBorderRightWidth()
|
|||
return GetBorderWidthFor(eSideRight);
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetBorderWidth()
|
||||
{
|
||||
nscoord widths[4];
|
||||
if (mInnerFrame) {
|
||||
AssertFlushedPendingReflows();
|
||||
const nsMargin& usedBorder = mInnerFrame->GetUsedBorder();
|
||||
NS_FOR_CSS_SIDES(side) {
|
||||
widths[side] = usedBorder.Side(side);
|
||||
}
|
||||
} else {
|
||||
const nsStyleBorder* border = StyleBorder();
|
||||
NS_FOR_CSS_SIDES(side) {
|
||||
widths[side] = border->GetComputedBorderWidth(side);
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> top = new nsROCSSPrimitiveValue;
|
||||
top->SetAppUnits(widths[eSideTop]);
|
||||
valueList->AppendCSSValue(top.forget());
|
||||
|
||||
if (widths[eSideRight] == widths[eSideLeft]) {
|
||||
if (widths[eSideTop] == widths[eSideBottom]) {
|
||||
if (widths[eSideTop] == widths[eSideRight]) {
|
||||
return valueList.forget();
|
||||
}
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> right = new nsROCSSPrimitiveValue;
|
||||
right->SetAppUnits(widths[eSideRight]);
|
||||
valueList->AppendCSSValue(right.forget());
|
||||
return valueList.forget();
|
||||
}
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> right = new nsROCSSPrimitiveValue;
|
||||
right->SetAppUnits(widths[eSideRight]);
|
||||
valueList->AppendCSSValue(right.forget());
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> bottom = new nsROCSSPrimitiveValue;
|
||||
bottom->SetAppUnits(widths[eSideBottom]);
|
||||
valueList->AppendCSSValue(bottom.forget());
|
||||
return valueList.forget();
|
||||
}
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> right = new nsROCSSPrimitiveValue;
|
||||
right->SetAppUnits(widths[eSideRight]);
|
||||
valueList->AppendCSSValue(right.forget());
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> bottom = new nsROCSSPrimitiveValue;
|
||||
bottom->SetAppUnits(widths[eSideBottom]);
|
||||
valueList->AppendCSSValue(bottom.forget());
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> left = new nsROCSSPrimitiveValue;
|
||||
left->SetAppUnits(widths[eSideLeft]);
|
||||
valueList->AppendCSSValue(left.forget());
|
||||
|
||||
return valueList.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetBorderTopColor()
|
||||
{
|
||||
|
|
@ -6960,4 +7020,5 @@ already_AddRefed<CSSValue>
|
|||
nsComputedDOMStyle::DoGetOverflowBlockEnd()
|
||||
{
|
||||
return DoGetOverflowBlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue