Closed Bug 1618997 Opened 5 years ago Closed 5 years ago

Improve serialization of conic and radial gradients

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

VERIFIED FIXED
mozilla76
Tracking Status
firefox76 --- verified

People

(Reporter: sebo, Assigned: ntim)

References

Details

Attachments

(1 file)

According to https://drafts.csswg.org/cssom-1/#serializing-css-values, the serialization of values should always be as short as possible (without changing the meaning of the value).

Currently, the computed value of a conic-gradient() value always includes the at <position> value, even when it's the default value.

Examples:

  • conic-gradient(lime, blue) => conic-gradient(at 50% 50%, rgb(0, 255, 0), rgb(0, 0, 255))
  • conic-gradient(at center, lime, blue) => conic-gradient(at 50% 50%, rgb(0, 255, 0), rgb(0, 0, 255))
  • conic-gradient(at 50% 50%, lime, blue) => conic-gradient(at 50% 50%, rgb(0, 255, 0), rgb(0, 0, 255))
  • conic-gradient(from 0deg, lime, blue) => conic-gradient(at 50% 50%, rgb(0, 255, 0), rgb(0, 0, 255))

In all those cases the at 50% 50% should be removed from the serialized value (like it's done for the from <angle> value).

Sebastian

This is also an issue for radial gradients, for what is worth.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)

This is also an issue for radial gradients, for what is worth.

I've extended this bug to also cover radial gradients. Feel free to reduce its scope to conic gradients again if you think they should be treated separately.

Sebastian

Summary: Improve serialization of conic-gradient() → Improve serialization of conic and radial gradients
Priority: -- → P3
Attachment #9134385 - Attachment description: Bug 1618997 - Omit position when it is center in conic/radial gradient serialization. → Bug 1618997 - Omit center positions in conic/radial gradient serialization.
Assignee: nobody → ntim.bugs
Status: NEW → ASSIGNED
Pushed by ntim.bugs@gmail.com: https://hg.mozilla.org/integration/autoland/rev/507a811671f8 Omit center positions in conic/radial gradient serialization. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/22503 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Pushed by ntim.bugs@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9bbf5c41c5ce Omit center positions in conic/radial gradient serialization. r=emilio
Flags: needinfo?(ntim.bugs)
Pushed by ntim.bugs@gmail.com: https://hg.mozilla.org/integration/autoland/rev/32333a094ae8 Omit center positions in conic/radial gradient serialization. r=emilio
Flags: needinfo?(ntim.bugs)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Upstream PR merged by moz-wptsync-bot
Upstream PR was closed without merging

Tested it with Nightly 76.0a1 2020-03-29 on Windows 10 and it works now as expected.
Thank you for fixing this, Tim!

Sebastian

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: