/* 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 { CanvasFrameAnonymousContentHelper } = require("./utils/markup"); const { getAdjustedQuads } = require("devtools/shared/layout/utils"); /** * The RectHighlighter is a class that draws a rectangle highlighter at specific * coordinates. * It does *not* highlight DOM nodes, but rects. * It also does *not* update dynamically, it only highlights a rect and remains * there as long as it is shown. */ function RectHighlighter(highlighterEnv) { this.win = highlighterEnv.window; this.markup = new CanvasFrameAnonymousContentHelper(highlighterEnv, this._buildMarkup.bind(this)); } RectHighlighter.prototype = { typeName: "RectHighlighter", _buildMarkup: function () { let doc = this.win.document; let container = doc.createElement("div"); container.className = "highlighter-container"; container.innerHTML = "