Closed Bug 1999938 Opened 3 months ago Closed 3 months ago

Inconsistent border rendering on rounded elements when color is implicit vs explicit

Categories

(Core :: Web Painting, defect, P3)

Firefox 145
Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: leeroyjenkins176, Assigned: emilio)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0

Steps to reproduce:

Summary:
Firefox shows a visual difference in border rendering on rounded elements (border-radius: 50%) depending on how the color is specified. When using border: 10px solid (without explicit color) or border: 10px solid currentcolor, the border has a slight shadow/blur effect of ~1px. When using border: 10px solid #fff (or any explicitly specified color), this effect is absent.

<style>
div {
  display: block;
  width: 51px;
  height: 51px;
  border-radius: 50%;
  background-color: #323232;
}
:root {
  --color: #fff;
  background: var(--color);
  color: var(--color);
}
.demo-1 {
  border: 10px solid;
}
.demo-2 {
  border: 10px solid currentcolor;
}
.demo-3 {
  border: 10px solid var(--color);
}
</style>

<div class="demo-1"></div>
<div class="demo-2"></div>
<div class="demo-3"></div>

https://codepen.io/coyibe2003/pen/ogxjBqN

Actual results:

.demo-1 and .demo-2 have a visible shadow/blur effect on the border (~1px)
.demo-3 looks without this effect

Expected results:

Border rendering should be identical since the final computed color is the same (#fff in all cases).

Component: Untriaged → CSS Parsing and Computation
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → Desktop

The severity field is not set for this bug.
:jwatt, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mozmail)

The explanation is here: https://searchfox.org/firefox-main/rev/5ccf4a7d77a329f237d3a41e400049f9c47dc71f/layout/painting/nsCSSRendering.cpp#1966-1969

We should be able to plumb the right foreground color there tho.

Flags: needinfo?(mozmail) → needinfo?(emilio)
Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: CSS Parsing and Computation → Web Painting
Ever confirmed: true
Priority: -- → P3
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/56451 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triage-done-c148/b147]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: