back out 326f9ad627b8 (Bug 704482) for leaks
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 08 Dec 2011 15:18:22 -0800
changeset 82319 7ca9226b37abef7ac8e2d64760c9d6f6de0cb3e6
parent 82318 8165a0e15699df0a4d3459afe27a8ba82695035d
child 82320 a7a4d3885abd77fb7242708cd9829fc066648803
push id3969
push userdholbert@mozilla.com
push dateThu, 08 Dec 2011 23:19:02 +0000
treeherdermozilla-inbound@a7a4d3885abd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs704482
milestone11.0a1
backs out326f9ad627b822f6a9d8e47994dccc2c1201edd5
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
back out 326f9ad627b8 (Bug 704482) for leaks
content/smil/nsSMILTimeValueSpec.cpp
content/smil/nsSMILTimeValueSpec.h
--- a/content/smil/nsSMILTimeValueSpec.cpp
+++ b/content/smil/nsSMILTimeValueSpec.cpp
@@ -317,59 +317,32 @@ nsSMILTimeValueSpec::GetTimedElement(Ele
 
   nsCOMPtr<nsISMILAnimationElement> animElement = do_QueryInterface(aElement);
   if (!animElement)
     return nsnull;
 
   return &animElement->TimedElement();
 }
 
-// Indicates whether we're allowed to register an event-listener
-// when scripting is disabled.
-bool
-nsSMILTimeValueSpec::IsWhitelistedEvent()
-{
-  // The category of (SMIL-specific) "repeat(n)" events are allowed.
-  if (mParams.mType == nsSMILTimeValueSpecParams::REPEAT) {
-    return true;
-  }
-
-  // A specific list of other SMIL-related events are allowed, too.
-  // NOTE: "repeatEvent", "beginEvent", & "endEvent" aren't in nsGkAtoms --
-  // they're defined in nsDOMEvent.cpp -- so we need to use NS_NewAtom.
-  // (This could probably be optimized, but it's not a huge deal because
-  // we'll rarely hit this code.)
-  if (mParams.mType == nsSMILTimeValueSpecParams::EVENT &&
-      (mParams.mEventSymbol == nsGkAtoms::repeat ||
-       mParams.mEventSymbol == NS_NewAtom("repeatEvent") ||
-       mParams.mEventSymbol == NS_NewAtom("beginEvent") ||
-       mParams.mEventSymbol == NS_NewAtom("endEvent"))) {
-    return true;
-  }
-
-  return false;
-}
-
 void
 nsSMILTimeValueSpec::RegisterEventListener(Element* aTarget)
 {
   NS_ABORT_IF_FALSE(IsEventBased(),
     "Attempting to register event-listener for unexpected nsSMILTimeValueSpec"
     " type");
   NS_ABORT_IF_FALSE(mParams.mEventSymbol,
     "Attempting to register event-listener but there is no event name");
 
   if (!aTarget)
     return;
 
-  // When script is disabled, only allow registration for whitelisted events.
-  if (!aTarget->GetOwnerDocument()->IsScriptEnabled() &&
-      !IsWhitelistedEvent()) {
+  // Don't listen for accessKey events if script is disabled. (see bug 704482)
+  if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY &&
+      !aTarget->GetOwnerDocument()->IsScriptEnabled())
     return;
-  }
 
   if (!mEventListener) {
     mEventListener = new EventListener(this);
   }
 
   nsEventListenerManager* elm = GetEventListenerManager(aTarget);
   if (!elm)
     return;
--- a/content/smil/nsSMILTimeValueSpec.h
+++ b/content/smil/nsSMILTimeValueSpec.h
@@ -88,17 +88,16 @@ public:
   // Cycle-collection support
   void Traverse(nsCycleCollectionTraversalCallback* aCallback);
   void Unlink();
 
 protected:
   void UpdateReferencedElement(Element* aFrom, Element* aTo);
   void UnregisterFromReferencedElement(Element* aElement);
   nsSMILTimedElement* GetTimedElement(Element* aElement);
-  bool IsWhitelistedEvent();
   void RegisterEventListener(Element* aElement);
   void UnregisterEventListener(Element* aElement);
   nsEventListenerManager* GetEventListenerManager(Element* aElement);
   void HandleEvent(nsIDOMEvent* aEvent);
   bool CheckEventDetail(nsIDOMEvent* aEvent);
   bool CheckRepeatEventDetail(nsIDOMEvent* aEvent);
   bool CheckAccessKeyEventDetail(nsIDOMEvent* aEvent);
   nsSMILTimeValue ConvertBetweenTimeContainers(const nsSMILTimeValue& aSrcTime,