[Pkg-mozext-commits] [firebug] 12/68: Added function for getting style rules by selector

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:45:50 UTC 2014


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

taffit pushed a commit to tag fbtest-1.11.4
in repository firebug.

commit 68f183ac4a94f65ce27285bea8e57b4278cbdc61
Author: Sebastian Zartner <sebastianzartner at gmail.com>
Date:   Tue Feb 26 07:57:46 2013 +0100

    Added function for getting style rules by selector
---
 tests/FBTest/content/FBTestFirebug.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/FBTest/content/FBTestFirebug.js b/tests/FBTest/content/FBTestFirebug.js
index a786acd..672c7b6 100644
--- a/tests/FBTest/content/FBTestFirebug.js
+++ b/tests/FBTest/content/FBTestFirebug.js
@@ -2291,6 +2291,24 @@ this.getSelectedNodeBox = function()
     return panel.panelNode.querySelector(".nodeBox.selected");
 }
 
+//********************************************************************************************* //
+// CSS panel
+this.getStyleRulesBySelector = function(selector)
+{
+    var panel = FBTest.selectPanel("stylesheet");
+    var selectors = panel.panelNode.getElementsByClassName("cssSelector");
+
+    var rules = [];
+    for (var i = 0, len = selectors.length; i < len; ++i)
+    {
+        if (selectors[i].textContent.indexOf(selector) != -1)
+            rules.push(FW.FBL.getAncestorByClass(selector, "cssRule"));
+    }
+
+    return rules;
+};
+
+
 // ********************************************************************************************* //
 // Context menu
 

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



More information about the Pkg-mozext-commits mailing list