fune/devtools/shared/specs/inspector.js
Razvan Caliman 8dacfff4f6 Bug 1623667 - [devtools] Remove HighlighterActor r=ochameau,devtools-backward-compat-reviewers
This patch completely removes the `HighlighterActor` and its accessors.

The rest of the patches in this commit series update the consumers and tests to use the new highlighter manager added to `HighlightersOverlay` in D81526. [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) updated all consumers within the **Inspector** panel to use this approach. Now, we're updating the rest of the consumers outside the Inspector.

### Why remove HighlighterActor?

The changes introduced in D81526 for [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) make it possible to  highlight nodes using the `CustomHighligtherActor` with the **Box Model Highlighter** implementation.

The `HighlighterActor` was itself a wrapper around **Box Model Highlighter** and Simple Outline Highlighter, and exposed node picking functionality. Simple Outline Highlighter was removed with [Bug 1650094](https://bugzilla.mozilla.org/show_bug.cgi?id=1650094). The node picking functionality was decoupled from `HighlighterActor`in [Bug 1607756](https://bugzilla.mozilla.org/show_bug.cgi?id=1607756).

After those changes, `HighlighterActor` is no longer special. It can be removed in favor of a single generic actor, `CustomHighligtherActor`, with the Box Model Highlighter implementation.

Differential Revision: https://phabricator.services.mozilla.com/D92220
2020-10-20 14:43:23 +00:00

75 lines
1.7 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Arg, RetVal, generateActorSpec } = require("devtools/shared/protocol");
const inspectorSpec = generateActorSpec({
typeName: "inspector",
events: {
"color-picked": {
type: "colorPicked",
color: Arg(0, "string"),
},
"color-pick-canceled": {
type: "colorPickCanceled",
},
},
methods: {
getWalker: {
request: {
options: Arg(0, "nullable:json"),
},
response: {
walker: RetVal("domwalker"),
},
},
getPageStyle: {
request: {},
response: {
pageStyle: RetVal("pagestyle"),
},
},
getCompatibility: {
request: {},
response: {
compatibility: RetVal("compatibility"),
},
},
getHighlighterByType: {
request: {
typeName: Arg(0),
},
response: {
highlighter: RetVal("nullable:customhighlighter"),
},
},
getImageDataFromURL: {
request: { url: Arg(0), maxDim: Arg(1, "nullable:number") },
response: RetVal("imageData"),
},
resolveRelativeURL: {
request: { url: Arg(0, "string"), node: Arg(1, "nullable:domnode") },
response: { value: RetVal("string") },
},
pickColorFromPage: {
request: { options: Arg(0, "nullable:json") },
response: {},
},
cancelPickColorFromPage: {
request: {},
response: {},
},
supportsHighlighters: {
request: {},
response: {
value: RetVal("boolean"),
},
},
},
});
exports.inspectorSpec = inspectorSpec;