Bug 1654760 - [devtools] Remove usage of actorHasMethod in SwatchColorPickerTooltip r=rcaliman

This backward compatibility code can be removed
"getBackgroundColor" was added in https://bugzilla.mozilla.org/show_bug.cgi?id=1568053 (FF70)

Differential Revision: https://phabricator.services.mozilla.com/D95315
This commit is contained in:
Julian Descottes 2020-11-03 16:34:58 +00:00
Родитель c2b12f7822
Коммит a311d05ca5
1 изменённых файлов: 2 добавлений и 12 удалений

Просмотреть файл

@ -139,18 +139,8 @@ class SwatchColorPickerTooltip extends SwatchBasedEditorTooltip {
// set contrast enabled for the spectrum
const name = this.activeSwatch.dataset.propertyName;
if (this.isContrastCompatible === undefined) {
const target = this.inspector.currentTarget;
this.isContrastCompatible = await target.actorHasMethod(
"domnode",
"getBackgroundColor"
);
}
// Only enable contrast and set text props and bg color if selected node is
// contrast compatible and if the type of property is color.
this.spectrum.contrastEnabled =
name === "color" && this.isContrastCompatible;
// Only enable contrast if the type of property is color.
this.spectrum.contrastEnabled = name === "color";
if (this.spectrum.contrastEnabled) {
const { nodeFront } = this.inspector.selection;
const { pageStyle } = nodeFront.inspectorFront;