[Pkg-mozext-commits] [itsalltext] 339/459: Ticket #38: Mutator test is failing.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:36 UTC 2015


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

taffit pushed a commit to branch master
in repository itsalltext.

commit 741da287431f12b6e37cbe5d7dc88a42be2be7a9
Author: Christian Höltje <docwhat at gmail.com>
Date:   Mon Oct 27 20:39:46 2008 -0400

    Ticket #38: Mutator test is failing.
---
 src/chrome/content/monitor.js | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/chrome/content/monitor.js b/src/chrome/content/monitor.js
index 34a3dcb..16d23ec 100644
--- a/src/chrome/content/monitor.js
+++ b/src/chrome/content/monitor.js
@@ -1,5 +1,5 @@
 /*extern HTMLDocument, gBrowser, ItsAllText */
-/*jslint undef: true, nomen: true, evil: false, browser: true, white: true */
+/*jslint undef: true, evil: false, browser: true, white: true */
 /*
  *  It's All Text! - Easy external editing of web forms.
  *
@@ -157,6 +157,26 @@ monitor.prototype.hitched_watcher = function (offset, init) {
     }
 };
 
+monitor.prototype._in_DOMSubtreeModified      = false;
+
+monitor.prototype.hitched_handleSubtreeModified = function (event) {
+    var has_textareas;
+    if (this._in_DOMSubtreeModified) {
+        return;
+    }
+    has_textareas = event.originalTarget.getElementsByTagName('textarea').length > 0;
+    if (has_textareas) {
+        try {
+            // Ignore events while adding the gumdrops.
+            this._in_DOMSubtreeModified = true;
+            this.watcher(0, true);
+        } catch (e) {
+            this._in_DOMSubtreeModified = false;
+        }
+        this._in_DOMSubtreeModified = false;
+    }
+};
+
 monitor.prototype.hitched_startPage = function (event, force) {
     var doc = event.originalTarget,
         unsafeWin;
@@ -170,6 +190,7 @@ monitor.prototype.hitched_startPage = function (event, force) {
     if (unsafeWin) {
         this.iat.listen(unsafeWin, 'pagehide', this.stopPage);
     }
+    this.iat.listen(unsafeWin, 'DOMSubtreeModified', this.handleSubtreeModified);
 
     // Kick off a watcher now...
     this.watcher(0, true);

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



More information about the Pkg-mozext-commits mailing list