Closed Bug 1892653 Opened 1 month ago Closed 1 month ago

repeating-linear-gradient doesn't repeat when it contains OKLCH colors

Categories

(Core :: Graphics: WebRender, defect, P2)

Firefox 126
defect

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox125 --- unaffected
firefox126 + fixed
firefox127 + fixed

People

(Reporter: mail, Assigned: ahale)

References

(Regression)

Details

(Keywords: regression)

Attachments

(6 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0

Steps to reproduce:

Visit the attached HTML page with a CSS repeating-linear-gradient using OKLCH colors

Actual results:

In Firefox 126 and 127, the repeating-linear-gradient doesn't repeat when it contains OKLCH, OKLAB, LCH, or LAB colors

Named colors, HSL, and hex colors all seem to work fine

Expected results:

The repeating gradient should repeat

I noticed that the built-in screenshot tool in Firefox (Ctrl-Shift-S) actually doesn't reproduce the bug with the gradient... I have to use Windows 11 built-in screenshot tool (Win-Shift-S) in order to capture it correctly.

Maybe that would be useful for helping to figure out where the gradient render is failing.

Status: UNCONFIRMED → NEW
Component: Untriaged → Graphics: WebRender
Ever confirmed: true
Keywords: regression
Product: Firefox → Core
Regressed by: 1885716

:ahale, since you are the author of the regressor, bug 1885716, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(ahale)

:gw pinging as triage owner, could this be triaged for severity?
Next week is the final week of beta for Fx126 so we don't have long left for fixes.

Flags: needinfo?(gwatson)

I'll look into this tomorrow, I am not sure how repeating gradients interact with the hue longer fix I made in bug 1885716, so I'll need to try out these test cases - speaking of which, we don't appear to have test coverage for this case, so I'll make a WPT test as part of fixing this (like how I made a WPT test for hue longer).

Assignee: nobody → ahale
Severity: -- → S2
Flags: needinfo?(gwatson)
Priority: -- → P2

Tracking since this is was triaged as an S2

I wasn't able to make much progress on this today but I will get a fix ready over the weekend.

Adding a WPT test first before I fix the code.

In terms of minimally invasive fixes, this should address the problem, however it would be good to check if it is a non-repeating gradient as well, because this logic could still misbehave on a repeating gradient with longer hue interpolation, I expect that to be a far more obscure issue in terms of user impact.

Third patch fixes the one remaining corner case (CSS repeating gradient with longer hue), which is probably rare, but now the logic always does what it is meant to do.

Attachment #9399274 - Attachment description: Bug 1892653 - Handle repeating oklch longer hue gradients correctly r?#gfx-reviewers → Bug 1892653 - Fix repeating oklch gradients r?#gfx-reviewers
Attachment #9399112 - Attachment is obsolete: true
Flags: needinfo?(ahale)
Attachment #9399271 - Attachment is obsolete: true
Pushed by ahale@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3e212a42ac4d
Fix repeating oklch gradients r=gfx-reviewers,lsalzman
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/45975 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch

The patch landed in nightly and beta is affected.
:ahale, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox126 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(ahale)
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
Attached image Nightly after fix

Looks like the fix has landed in nightly. Will request uplift on it.

Comment on attachment 9399274 [details]
Bug 1892653 - Fix repeating oklch gradients r?#gfx-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined: CSS gradients that are repeating type do not work in non-sRGB colorspaces, such as HSL and OKLCH. Non-repeating ones look fine. Repeating gradients are mostly used to make stripe patterns on web pages, sometimes as a background fill, though it is not clear how often they are in non-sRGB colorspaces.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce: View first attachment https://bugzilla.mozilla.org/attachment.cgi?id=9397785 , before the fix there is only a single stripe at the top of each example, after the fix it correctly looks like a stripe pattern with alternating color stripes on each of the two examples.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Simplified logic that should be more robust, only a single very specific case that will use the gradient extending logic (the one case it was meant to fix - longer hue on a non-repeating gradient such as OKLCH space).
  • String changes made/needed:
  • Is Android affected?: Yes
Flags: needinfo?(ahale)
Attachment #9399274 - Flags: approval-mozilla-beta?

Comment on attachment 9399274 [details]
Bug 1892653 - Fix repeating oklch gradients r?#gfx-reviewers

Approved for 126.0b9

Attachment #9399274 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9399112 - Attachment is obsolete: false
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: