mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
back out 326f9ad627b8 (Bug 704482) for leaks
This commit is contained in:
parent
85f602de44
commit
63fe4d416f
@ -322,32 +322,6 @@ nsSMILTimeValueSpec::GetTimedElement(Element* aElement)
|
|||||||
return &animElement->TimedElement();
|
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
|
void
|
||||||
nsSMILTimeValueSpec::RegisterEventListener(Element* aTarget)
|
nsSMILTimeValueSpec::RegisterEventListener(Element* aTarget)
|
||||||
{
|
{
|
||||||
@ -360,11 +334,10 @@ nsSMILTimeValueSpec::RegisterEventListener(Element* aTarget)
|
|||||||
if (!aTarget)
|
if (!aTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// When script is disabled, only allow registration for whitelisted events.
|
// Don't listen for accessKey events if script is disabled. (see bug 704482)
|
||||||
if (!aTarget->GetOwnerDocument()->IsScriptEnabled() &&
|
if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY &&
|
||||||
!IsWhitelistedEvent()) {
|
!aTarget->GetOwnerDocument()->IsScriptEnabled())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (!mEventListener) {
|
if (!mEventListener) {
|
||||||
mEventListener = new EventListener(this);
|
mEventListener = new EventListener(this);
|
||||||
|
@ -93,7 +93,6 @@ protected:
|
|||||||
void UpdateReferencedElement(Element* aFrom, Element* aTo);
|
void UpdateReferencedElement(Element* aFrom, Element* aTo);
|
||||||
void UnregisterFromReferencedElement(Element* aElement);
|
void UnregisterFromReferencedElement(Element* aElement);
|
||||||
nsSMILTimedElement* GetTimedElement(Element* aElement);
|
nsSMILTimedElement* GetTimedElement(Element* aElement);
|
||||||
bool IsWhitelistedEvent();
|
|
||||||
void RegisterEventListener(Element* aElement);
|
void RegisterEventListener(Element* aElement);
|
||||||
void UnregisterEventListener(Element* aElement);
|
void UnregisterEventListener(Element* aElement);
|
||||||
nsEventListenerManager* GetEventListenerManager(Element* aElement);
|
nsEventListenerManager* GetEventListenerManager(Element* aElement);
|
||||||
|
Loading…
Reference in New Issue
Block a user