mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
PR #2643 - The border-radius Directive Should Apply to Outlines
However, `-moz-outline-radius` should still override any `border-radius`. This is primarily done for backward compatibility with some themes. Additionally, it also allows for more advanced outline control than the CSS spec provides, without breaking spec. Finally, if the spec is ever updated to include `outline-radius`, we'll be ready to drop the `-moz-` prefix! Note: BZ 315209 has an inadvertent double-negative in nsDisplayList.cpp: HasRadius() essentially returns the opposite value it should.
This commit is contained in:
parent
a1d0cf1e05
commit
cee682b980
4 changed files with 48 additions and 33 deletions
|
|
@ -3757,18 +3757,23 @@ nsDisplayOutline::Paint(nsDisplayListBuilder* aBuilder,
|
|||
mFrame->StyleContext());
|
||||
}
|
||||
|
||||
bool nsDisplayOutline::HasRadius() const {
|
||||
if (nsLayoutUtils::HasNonZeroCorner(mFrame->StyleOutline()->mOutlineRadius)) {
|
||||
return true;
|
||||
}
|
||||
return nsLayoutUtils::HasNonZeroCorner(mFrame->StyleBorder()->mBorderRadius);
|
||||
}
|
||||
|
||||
bool
|
||||
nsDisplayOutline::IsInvisibleInRect(const nsRect& aRect)
|
||||
{
|
||||
const nsStyleOutline* outline = mFrame->StyleOutline();
|
||||
nsRect borderBox(ToReferenceFrame(), mFrame->GetSize());
|
||||
if (borderBox.Contains(aRect) &&
|
||||
!nsLayoutUtils::HasNonZeroCorner(outline->mOutlineRadius)) {
|
||||
if (outline->mOutlineOffset >= 0) {
|
||||
// aRect is entirely inside the border-rect, and the outline isn't
|
||||
// rendered inside the border-rect, so the outline is not visible.
|
||||
return true;
|
||||
}
|
||||
if (borderBox.Contains(aRect) && !HasRadius() &&
|
||||
outline->mOutlineOffset >= 0) {
|
||||
// aRect is entirely inside the border-rect, and the outline isn't
|
||||
// rendered inside the border-rect, so the outline is not visible.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue