Bug 1494162 - Part 19: Directly import getCssPath, getXpath and findCssSelector. r=pbro
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user