Closed Bug 1814620 Opened 1 year ago Closed 1 year ago

Use InspectorUtils color function in color.js

Categories

(DevTools :: Shared Components, task)

task

Tracking

(firefox111 fixed)

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(2 files)

There are a few functions in color.js that are direct replacement of InspectorUtils methods (isValidCSSColor, rgbToColorName, colorToRGBA)

This was done as part of the devtools.html project, and since this is not a goal we want to pursue, we should roll back to using InspectorUtils methods to lower the maintenance cost

Let's use InspectorUtils isValidCSSColor, rgbToColorName and colorToRGBA
instead of their js-counterpart.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

Make the callsites call InspectorUtils.rgbToColorName instead.
Since it was throwing when passed a non-valid named color,
which wasn't the expected outcome in DevTools, modify the
c++ method so it return an empty string instead.
Add a dedicated test since there wasn't one.

Depends on D168669

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b74334ea6e48
[devtools] Replace custom color.js method with  InspectorUtils ones. r=ochameau.
https://hg.mozilla.org/integration/autoland/rev/a7cf3a7ae359
[devtools] Remove color.js rgbToColorName. r=ochameau.

Backed out as requested by dev

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/db9259efdb85
[devtools] Replace custom color.js method with  InspectorUtils ones. r=ochameau.
https://hg.mozilla.org/integration/autoland/rev/604e9f20d161
[devtools] Remove color.js rgbToColorName. r=ochameau.
Regressions: 1815434
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Flags: needinfo?(nchevobbe)
Regressions: 1816342
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: