[Pkg-mozext-commits] [firebug] 05/16: Add Domplate.[gs]etElementData APIs to Firebug 2

David Prévot taffit at moszumanska.debian.org
Fri Apr 10 02:19:01 UTC 2015


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

taffit pushed a commit to branch master
in repository firebug.

commit dd458279b5a2c1ff761c7f67d7f7ad7930a1815d
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date:   Mon Mar 16 14:00:48 2015 +0100

    Add Domplate.[gs]etElementData APIs to Firebug 2
    
    Related to issue 7186.
---
 extension/content/firebug/lib/domplate.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/extension/content/firebug/lib/domplate.js b/extension/content/firebug/lib/domplate.js
index fc65371..4464481 100644
--- a/extension/content/firebug/lib/domplate.js
+++ b/extension/content/firebug/lib/domplate.js
@@ -1313,12 +1313,29 @@ function defineTags()
     }
 }
 
+// APIs for associating elements with data, future compatible with Firebug.next.
+// The data is currently stored as expandos on the elements, or in the case of
+// elements from unprivileged content, expandos on the elements' unwaived xray
+// wrappers. Note that the latter expandos are local to the current
+// compartment, and thus to Firebug when compartment_per_addon is set.
+Domplate.getElementData = function(elem, name)
+{
+    return elem[name];
+};
+
+Domplate.setElementData = function(elem, name, value)
+{
+    elem[name] = value;
+};
+
 // xxxHonza: Domplate is injected into FBL namespace only for backward
 // compatibility with extensions.
 // We need to mark this as deprecated.
 FBL.TAG = Domplate.TAG;
 FBL.FOR = Domplate.FOR;
 FBL.DomplateTag = Domplate.DomplateTag;
+FBL.getElementData = Domplate.getElementData;
+FBL.setElementData = Domplate.setElementData;
 
 defineTags(
     "a", "button", "br", "canvas", "col", "colgroup", "div", "fieldset", "form", "h1", "h2",

-- 
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