Closed Bug 1786796 Opened 2 years ago Closed 2 years ago

[COLRv1] Gradient interpolation for extend mode pad when color stop range is 0

Categories

(Core :: Layout: Text and Fonts, defect)

defect

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: drott, Assigned: jfkthame)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Steps to reproduce:

(tested on latest nightly)

https://jfkthame.github.io/test/test-colr1.html
When COL1 set to 0.5, COL2 set to 0 and COL3 set to -0.5 the glyphs for extend mode demonstrating linear gradients are disappearing, even though for extend mode pad it is possible to have a rendering which divides the square into a green and a red part.

Compare this Skia change:
https://skia-review.googlesource.com/c/skia/+/572934 where I am fixing this after this issue was identified by fuzzing.

I think we need an enhancement to the spec to clarify this situation for radial and linear gradients. For sweep we already have "If the ColorLine's extend mode is reflect or repeat and start and end angle are equal, nothing is drawn."

Actual results:

Glyphs disappear.

Expected results:

Linear gradient extend mode tests with color stops in the exact same location should divide the filled area with a left and right colored part.

So for extend-mode:pad, we'd get the simple two-color result, but for repeat/reflect modes, the spec should explicitly say that we draw nothing -- right? That makes sense to me.

Assignee: nobody → jfkthame
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 1740525
Component: Untriaged → Graphics: Text
Product: Firefox → Core
Version: other → unspecified
Component: Graphics: Text → Layout: Text and Fonts
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc292ca682cf
Handle a color stop range of zero in COLRv1 gradients. r=gfx-reviewers,lsalzman
https://hg.mozilla.org/integration/autoland/rev/9c09be52726f
Reftest for gradient when color stop range collapses to zero. r=gfx-reviewers,lsalzman
Flags: needinfo?(jfkthame)

Test depends on a variation font, which isn't supported on Win7. Adding a skip-if annotation.

Flags: needinfo?(jfkthame)
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c80a7f0aee8e
Handle a color stop range of zero in COLRv1 gradients. r=gfx-reviewers,lsalzman
https://hg.mozilla.org/integration/autoland/rev/97fc4d3e5911
Reftest for gradient when color stop range collapses to zero. r=gfx-reviewers,lsalzman

Backed out for causing reftest failure at font-error-404-2.html.

And also layout/reftests/font-face/reflow-sanity-1.html.

Sigh. This is a spurious Win7 failure due to the general flakiness of the DirectWrite backend there. The patches in this push would have had no effect whatever on that test, but the addition of a couple of reftests -- even though they're skipped on Win7 -- has changed the chunking, such that these tests that used to be in R2 have moved to R1, and there, they fail. Probably because they're running later in the browser session, and DWrite resources are running out.

I'm going to just annotate them as random on Win7.... this isn't an actual bug, and attempting to work around it in the past has been a never-ending rabbit-hole.

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/706242b846a9
Handle a color stop range of zero in COLRv1 gradients. r=gfx-reviewers,lsalzman
https://hg.mozilla.org/integration/autoland/rev/e70cfab1ee66
Reftest for gradient when color stop range collapses to zero. r=gfx-reviewers,lsalzman
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: