/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
onMouseMove(target) { // Not an element we care about if (!target || !target.id) { return;
}
// If the user didn't change targets, do nothing if (this.lastTarget && this.lastTarget.id === target.id) { return;
}
if (
target.id.includes("step-button") ||
target.id.includes("resume-button")
) { // The hover should be applied to the wrapper (icon's parent node) const newTarget = target.parentNode.id.includes("wrapper")
? target.parentNode
: target;
// Remove the hover class if the user has changed buttons if (this.lastTarget && this.lastTarget != newTarget) { this.lastTarget.classList.remove("hover");
}
newTarget.classList.add("hover"); this.lastTarget = newTarget;
} elseif (this.lastTarget) { // Remove the hover class if the user isn't on a button this.lastTarget.classList.remove("hover");
}
}
handleEvent(e) { switch (e.type) { case"mousedown": this.onClick(e.target); break; case"DOMMouseScroll": // Prevent scrolling. That's because we only took a screenshot of the viewport, so // scrolling out of the viewport wouldn't draw the expected things. In the future // we can take the screenshot again on scroll, but for now it doesn't seem // important.
e.preventDefault(); break;
show(reason) { if (this.env.isXUL || !reason) { returnfalse;
}
// Only track mouse movement when the the overlay is shown // Prevents mouse tracking when the user isn't paused const { pageListenerTarget } = this.env;
pageListenerTarget.addEventListener("mousemove", this);
// Show the highlighter's root element. const root = this.getElement("paused-dbg-root");
root.removeAttribute("hidden");
root.setAttribute("overlay", "true");
// Set the text to appear in the toolbar. const toolbar = this.getElement("paused-dbg-toolbar");
toolbar.removeAttribute("hidden");
// When the debugger pauses execution in a page, events will not be delivered // to any handlers added to elements on that page. So here we use the // document's setSuppressedEventListener interface to still be able to act on mouse // events (they'll be handled by the `handleEvent` method) this.env.window.document.setSuppressedEventListener(this); // Ensure layout is initialized so that we show the highlighter no matter what, // even if the page is not done loading, see bug 1580394. this.env.window.document.documentElement?.getBoundingClientRect(); returntrue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.