Bug 1494162 - Part 19: Directly import getCssPath, getXpath and findCssSelector. r=pbro

This commit is contained in:
Gabriel Luong
2018-09-28 13:14:34 -04:00
parent 6045b40dd5
commit 937ac38f73
3 changed files with 4 additions and 29 deletions

View File

@@ -46,9 +46,6 @@ const MAX_DATA_URL_LENGTH = 40;
const Services = require("Services");
loader.lazyImporter(this, "findCssSelector", "resource://gre/modules/css-selector.js");
loader.lazyImporter(this, "getCssPath", "resource://gre/modules/css-selector.js");
loader.lazyImporter(this, "getXPath", "resource://gre/modules/css-selector.js");
loader.lazyRequireGetter(this, "getCSSLexer", "devtools/shared/css/lexer", true);
loader.lazyRequireGetter(this, "getTabPrefs", "devtools/shared/indentation", true);
@@ -362,28 +359,6 @@ function prettifyCSS(text, ruleCount) {
exports.prettifyCSS = prettifyCSS;
/**
* Find a unique CSS selector for a given element
* @returns a string such that ele.ownerDocument.querySelector(reply) === ele
* and ele.ownerDocument.querySelectorAll(reply).length === 1
*/
exports.findCssSelector = findCssSelector;
/**
* Get the full CSS path for a given element.
* @returns a string that can be used as a CSS selector for the element. It might not
* match the element uniquely. It does however, represent the full path from the root
* node to the element.
*/
exports.getCssPath = getCssPath;
/**
* Get the xpath for a given element.
* @param {DomNode} ele
* @returns a string that can be used as an XPath to find the element uniquely.
*/
exports.getXPath = getXPath;
/**
* Given a node, check to see if it is a ::before or ::after element.
* If so, return the node that is accessible from within the document