Open Bug 2017167 Opened 2 months ago Updated 1 month ago

Using color picker after using Color vision simulation picks the wrong color

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

(Keywords: devtools-platform-blocked)

STRs:

  • open data:text/html,<div style="background:red; width:100px; height:100px">
  • open devtools
  • open accessibility panel
  • Simulate Protanopia
  • open inspector
  • start the color picker
  • try to pick the color in the square

The picked color will be "#ff0000", whereas the color actually rendered thanks to the color vision simulation is "#271d00".

this should be fixed at the screenshot level. You get the same issue if you simulate color vision and take a screenshot (either using devtools tools or the main firefox screenshot one)

the simulation is set on the docShell in https://searchfox.org/firefox-main/rev/2477384eae35d0ee85d43dfdeba6f2ba51d9abfb/devtools/server/actors/accessibility/simulator.js#54

this.docShell.setColorMatrix(colorMatrix);

which ultimately calls https://searchfox.org/firefox-main/rev/2477384eae35d0ee85d43dfdeba6f2ba51d9abfb/docshell/base/nsDocShell.cpp#14607

nsDocShell::SetColorMatrix(const nsTArray<float>& aMatrix) {

so https://searchfox.org/firefox-main/rev/2477384eae35d0ee85d43dfdeba6f2ba51d9abfb/dom/ipc/WindowGlobalParent.cpp#1077

already_AddRefed<mozilla::dom::Promise> WindowGlobalParent::DrawSnapshot(

should somehow take this applied matrix into account

ahale, maybe you could help us here?

Flags: needinfo?(ahale)
Severity: -- → S3
Priority: -- → P2

Also note that the devtools highlighters are impacted by the matrix, which can be an issue with the grid highlighters for instance which are color coded.

We might file a separate bug about this, but if we can make the matrix not apply to our highlighters, that would also solve this issue.

See Also: → 2024121
You need to log in before you can comment on or make changes to this bug.