From 03614968507a0dbbe283b5630c5ae5aa8fcc8a5e Mon Sep 17 00:00:00 2001 From: "neil@parkwaycc.co.uk" Date: Fri, 21 Sep 2007 09:09:45 -0700 Subject: [PATCH] Remove expensive DOMAttrModified listeners b=395496 r=Enn sr+a=bz --- toolkit/content/widgets/menulist.xml | 40 +++++++++++----------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/toolkit/content/widgets/menulist.xml b/toolkit/content/widgets/menulist.xml index eb1bd9948e3..28e330dc51a 100644 --- a/toolkit/content/widgets/menulist.xml +++ b/toolkit/content/widgets/menulist.xml @@ -47,7 +47,7 @@ - + this.setInitialSelection() @@ -189,7 +189,10 @@ if (oldval) { oldval.removeAttribute('selected'); - oldval.removeEventListener("DOMAttrModified", this, false); + document.removeBroadcastListenerFor(oldval, this, "value"); + document.removeBroadcastListenerFor(oldval, this, "label"); + document.removeBroadcastListenerFor(oldval, this, "image"); + document.removeBroadcastListenerFor(oldval, this, "description"); } this.mSelectedInternal = val; @@ -199,7 +202,10 @@ this.setAttribute('image', val.getAttribute('image')); this.setAttribute('label', val.getAttribute('label')); this.setAttribute('description', val.getAttribute('description')); - val.addEventListener("DOMAttrModified", this, false); + document.addBroadcastListenerFor(val, this, "value"); + document.addBroadcastListenerFor(val, this, "label"); + document.addBroadcastListenerFor(val, this, "image"); + document.addBroadcastListenerFor(val, this, "description"); } else { this.removeAttribute('value'); @@ -253,25 +259,6 @@ - - - - - - - @@ -357,8 +344,13 @@