Commit 8eaec07a authored by Patrick Brosset's avatar Patrick Brosset
Browse files

Bug 1601219 - Use the right PageStyleFront instance when querying computed...

Bug 1601219 - Use the right PageStyleFront instance when querying computed styles from the color picker; r=rcaliman

It looks like we left out some places in the inspector when we made it fission-compatible.
The color-picker, in particular, needs access to the selected node's computed style for its
color contrast logic.
We used to access this on the top-level target PageStyleFront. We just need to change this so
it uses the one contextual to the selected node.

Differential Revision:

extra : moz-landing-system : lando
parent cc652315
......@@ -119,11 +119,12 @@ class SwatchColorPickerTooltip extends SwatchBasedEditorTooltip {
this.spectrum.contrastEnabled =
name === "color" && this.isContrastCompatible;
if (this.spectrum.contrastEnabled) {
this.spectrum.textProps = await this.inspector.pageStyle.getComputed(
{ filterProperties: ["font-size", "font-weight", "opacity"] }
this.spectrum.backgroundColorData = await this.inspector.selection.nodeFront.getBackgroundColor();
const { nodeFront } = this.inspector.selection;
const { pageStyle } = nodeFront.inspectorFront;
this.spectrum.textProps = await pageStyle.getComputed(nodeFront, {
filterProperties: ["font-size", "font-weight", "opacity"],
this.spectrum.backgroundColorData = await nodeFront.getBackgroundColor();
// Then set spectrum's color and listen to color changes to preview them
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment