[Pkg-mozext-commits] [firexpath] 14/18: fixed a bug with the css selector generation code

David Prévot taffit at moszumanska.debian.org
Sat Mar 26 19:35:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag FirePath-0.9.5
in repository firexpath.

commit 452c03281a729e05345fb51be2526febda05142d
Author: pierre.tholence <pierre.tholence at gmail.com>
Date:   Sun Sep 19 14:06:53 2010 +0000

    fixed a bug with the css selector generation code
---
 content/FirePathPanel.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/content/FirePathPanel.js b/content/FirePathPanel.js
index 986e527..3a41df4 100644
--- a/content/FirePathPanel.js
+++ b/content/FirePathPanel.js
@@ -1049,6 +1049,9 @@ FBL.getXPathFromNode = function(node, context) {
 	return result;
 }
 
+const firepathClass = /\s*firepath-matching-node\s*/g;
+const multipleSpace = /\s+/g;
+
 FBL.getCssSelectorFromNode = function (node, context) {
 	var result = '',
 		node,
@@ -1061,9 +1064,9 @@ FBL.getCssSelectorFromNode = function (node, context) {
 			if(node.id) {
 				str = '#' + node.id;
 				stop = true;
-			} else if(node.className) {
-				str = '.' + node.className.trim()
-					.replace(/\s+/g, '').split(' ').join('.');
+			} else if(node.className && node.className.replace(firepathClass, '')) {
+				str = '.' + node.className.replace(firepathClass, ' ').trim()
+					.replace(multipleSpace, ' ').split(' ').join('.');
 				stop = true;
 			} else {
 				str = node.localName.toLowerCase();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firexpath.git



More information about the Pkg-mozext-commits mailing list